Add word A,
This would be useful, for example, to allow the assembler to write straight to an AT28 EEPROM without going to RAM. This would be a life saver in machines with tight RAM such as the SMS.
This commit is contained in:
parent
30b56185e9
commit
de7cb4a80f
4
blk/007
4
blk/007
@ -4,8 +4,8 @@
|
||||
;
|
||||
: PC H@ ORG @ - BIN( @ + ;
|
||||
( A, spits an assembled byte, A,, spits an assembled word
|
||||
Both increase PC. To debug, change C, to .X )
|
||||
: A, C, ; : A,, SPLITB A, A, ;
|
||||
Both increase PC. )
|
||||
: A,, SPLITB A, A, ;
|
||||
: <<3 3 LSHIFT ; : <<4 4 LSHIFT ;
|
||||
( As a general rule, IX and IY are equivalent to spitting an
|
||||
extra 0xdd / 0xfd and then spit the equivalent of HL )
|
||||
|
1
blk/032
1
blk/032
@ -3,5 +3,4 @@
|
||||
256 /MOD SWAP
|
||||
;
|
||||
: PC H@ ORG @ - BIN( @ + ;
|
||||
: A, C, ;
|
||||
: A,, SPLITB A, A, ;
|
||||
|
4
blk/051
4
blk/051
@ -6,5 +6,5 @@ VARIABLE L1 VARIABLE L2 VARIABLE L3 VARIABLE L4
|
||||
( We divide by 2 because each PC represents a word. )
|
||||
: PC H@ ORG @ - 1 RSHIFT ;
|
||||
( A, spits an assembled byte, A,, spits an assembled word
|
||||
Both increase PC. To debug, change C, to .X )
|
||||
: A, C, ; : A,, SPLITB A, A, ;
|
||||
Both increase PC. )
|
||||
: A,, SPLITB A, A, ;
|
||||
|
2
blk/363
2
blk/363
@ -4,7 +4,7 @@ SYSVARS 0x0c + :** C<*
|
||||
0x08 RAM+ ( C<* override ) @
|
||||
?DUP NOT IF C<* ELSE EXECUTE THEN ;
|
||||
: , H@ ! H@ 2+ HERE ! ;
|
||||
: C, H@ C! H@ 1+ HERE ! ;
|
||||
: C, H@ C!+ HERE ! ;
|
||||
: ,"
|
||||
BEGIN
|
||||
C< DUP 34 ( ASCII " ) = IF DROP EXIT THEN C,
|
||||
|
1
blk/385
1
blk/385
@ -5,6 +5,7 @@
|
||||
( Now, adev stuff )
|
||||
SYSVARS 0x3e + :** A@
|
||||
SYSVARS 0x40 + :** A!
|
||||
SYSVARS 0x42 + :** A,
|
||||
|
||||
( src dst u -- )
|
||||
: AMOVE
|
||||
|
2
blk/390
2
blk/390
@ -7,7 +7,7 @@
|
||||
['] (emit) ['] EMIT **! ['] (key) ['] KEY **!
|
||||
['] CRLF ['] NL **!
|
||||
['] (boot<) ['] C<* **!
|
||||
['] C@ ['] A@ **! ['] C! ['] A! **!
|
||||
['] C@ ['] A@ **! ['] C! ['] A! **! ['] C, ['] A, **!
|
||||
( boot< always has a char waiting. 06 == C<?* )
|
||||
1 0x06 RAM+ ! INTERPRET
|
||||
RDLN$ LIT" _sys" [entry]
|
||||
|
BIN
cvm/forth.bin
BIN
cvm/forth.bin
Binary file not shown.
12
doc/impl.txt
12
doc/impl.txt
@ -125,12 +125,12 @@ Here's a list of them:
|
||||
SYSVARS FUTURE USES +3c BLK(*
|
||||
+02 CURRENT +3e A@*
|
||||
+04 HERE +40 A!*
|
||||
+06 C<? +42 FUTURE USES
|
||||
+08 C<* override +51 CURRENTPTR
|
||||
+0a NLPTR +53 (emit) override
|
||||
+0c C<* +55 (key) override
|
||||
+0e WORDBUF +57 FUTURE USES
|
||||
+2e BOOT C< PTR
|
||||
+06 C<? +42 A,*
|
||||
+08 C<* override +44 FUTURE USES
|
||||
+0a NLPTR +51 CURRENTPTR
|
||||
+0c C<* +53 (emit) override
|
||||
+0e WORDBUF +55 (key) override
|
||||
+2e BOOT C< PTR +57 FUTURE USES
|
||||
+30 IN>
|
||||
+32 IN(* +70 DRIVERS
|
||||
+34 BLK@* +80 RAMEND
|
||||
|
@ -84,9 +84,9 @@ need switches in regular code.
|
||||
|
||||
# Addressed devices
|
||||
|
||||
A@ and A! are the indirect versions of C@ and C!. They are
|
||||
aliases and initially point to C@ and C!. There is also a AMOVE
|
||||
word that is the same as MOVE but using A@ and A!.
|
||||
A@, A! and A, are the indirect versions of C@, C! and C,. They
|
||||
are switch words and initially point to C@, C! and C,. There is
|
||||
also a AMOVE word that is the same as MOVE but using A@ and A!.
|
||||
|
||||
Addressed device words can be useful to "pipe" processing to
|
||||
places outside of regular memory.
|
||||
|
Loading…
Reference in New Issue
Block a user