1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-21 00:28:05 +11:00

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:
Virgil Dupras 2020-10-28 20:45:50 -04:00
parent 30b56185e9
commit de7cb4a80f
9 changed files with 16 additions and 16 deletions

View File

@ -4,8 +4,8 @@
; ;
: PC H@ ORG @ - BIN( @ + ; : PC H@ ORG @ - BIN( @ + ;
( A, spits an assembled byte, A,, spits an assembled word ( A, spits an assembled byte, A,, spits an assembled word
Both increase PC. To debug, change C, to .X ) Both increase PC. )
: A, C, ; : A,, SPLITB A, A, ; : A,, SPLITB A, A, ;
: <<3 3 LSHIFT ; : <<4 4 LSHIFT ; : <<3 3 LSHIFT ; : <<4 4 LSHIFT ;
( As a general rule, IX and IY are equivalent to spitting an ( As a general rule, IX and IY are equivalent to spitting an
extra 0xdd / 0xfd and then spit the equivalent of HL ) extra 0xdd / 0xfd and then spit the equivalent of HL )

View File

@ -3,5 +3,4 @@
256 /MOD SWAP 256 /MOD SWAP
; ;
: PC H@ ORG @ - BIN( @ + ; : PC H@ ORG @ - BIN( @ + ;
: A, C, ;
: A,, SPLITB A, A, ; : A,, SPLITB A, A, ;

View File

@ -6,5 +6,5 @@ VARIABLE L1 VARIABLE L2 VARIABLE L3 VARIABLE L4
( We divide by 2 because each PC represents a word. ) ( We divide by 2 because each PC represents a word. )
: PC H@ ORG @ - 1 RSHIFT ; : PC H@ ORG @ - 1 RSHIFT ;
( A, spits an assembled byte, A,, spits an assembled word ( A, spits an assembled byte, A,, spits an assembled word
Both increase PC. To debug, change C, to .X ) Both increase PC. )
: A, C, ; : A,, SPLITB A, A, ; : A,, SPLITB A, A, ;

View File

@ -4,7 +4,7 @@ SYSVARS 0x0c + :** C<*
0x08 RAM+ ( C<* override ) @ 0x08 RAM+ ( C<* override ) @
?DUP NOT IF C<* ELSE EXECUTE THEN ; ?DUP NOT IF C<* ELSE EXECUTE THEN ;
: , H@ ! H@ 2+ HERE ! ; : , H@ ! H@ 2+ HERE ! ;
: C, H@ C! H@ 1+ HERE ! ; : C, H@ C!+ HERE ! ;
: ," : ,"
BEGIN BEGIN
C< DUP 34 ( ASCII " ) = IF DROP EXIT THEN C, C< DUP 34 ( ASCII " ) = IF DROP EXIT THEN C,

View File

@ -5,6 +5,7 @@
( Now, adev stuff ) ( Now, adev stuff )
SYSVARS 0x3e + :** A@ SYSVARS 0x3e + :** A@
SYSVARS 0x40 + :** A! SYSVARS 0x40 + :** A!
SYSVARS 0x42 + :** A,
( src dst u -- ) ( src dst u -- )
: AMOVE : AMOVE

View File

@ -7,7 +7,7 @@
['] (emit) ['] EMIT **! ['] (key) ['] KEY **! ['] (emit) ['] EMIT **! ['] (key) ['] KEY **!
['] CRLF ['] NL **! ['] CRLF ['] NL **!
['] (boot<) ['] C<* **! ['] (boot<) ['] C<* **!
['] C@ ['] A@ **! ['] C! ['] A! **! ['] C@ ['] A@ **! ['] C! ['] A! **! ['] C, ['] A, **!
( boot< always has a char waiting. 06 == C<?* ) ( boot< always has a char waiting. 06 == C<?* )
1 0x06 RAM+ ! INTERPRET 1 0x06 RAM+ ! INTERPRET
RDLN$ LIT" _sys" [entry] RDLN$ LIT" _sys" [entry]

Binary file not shown.

View File

@ -125,12 +125,12 @@ Here's a list of them:
SYSVARS FUTURE USES +3c BLK(* SYSVARS FUTURE USES +3c BLK(*
+02 CURRENT +3e A@* +02 CURRENT +3e A@*
+04 HERE +40 A!* +04 HERE +40 A!*
+06 C<? +42 FUTURE USES +06 C<? +42 A,*
+08 C<* override +51 CURRENTPTR +08 C<* override +44 FUTURE USES
+0a NLPTR +53 (emit) override +0a NLPTR +51 CURRENTPTR
+0c C<* +55 (key) override +0c C<* +53 (emit) override
+0e WORDBUF +57 FUTURE USES +0e WORDBUF +55 (key) override
+2e BOOT C< PTR +2e BOOT C< PTR +57 FUTURE USES
+30 IN> +30 IN>
+32 IN(* +70 DRIVERS +32 IN(* +70 DRIVERS
+34 BLK@* +80 RAMEND +34 BLK@* +80 RAMEND

View File

@ -84,9 +84,9 @@ need switches in regular code.
# Addressed devices # Addressed devices
A@ and A! are the indirect versions of C@ and C!. They are A@, A! and A, are the indirect versions of C@, C! and C,. They
aliases and initially point to C@ and C!. There is also a AMOVE are switch words and initially point to C@, C! and C,. There is
word that is the same as MOVE but using A@ and A!. 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 Addressed device words can be useful to "pipe" processing to
places outside of regular memory. places outside of regular memory.