mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-27 19:08:06 +11:00
de7cb4a80f
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.
17 lines
525 B
Plaintext
17 lines
525 B
Plaintext
( Splits word into msb/lsb, lsb being on TOS )
|
|
: SPLITB
|
|
256 /MOD SWAP
|
|
;
|
|
: PC H@ ORG @ - BIN( @ + ;
|
|
( A, spits an assembled byte, A,, spits an assembled word
|
|
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 )
|
|
: IX 0xdd A, HL ; : IY 0xfd A, HL ;
|
|
: _ix+- 0xff AND 0xdd A, (HL) ;
|
|
: _iy+- 0xff AND 0xfd A, (HL) ;
|
|
: IX+ _ix+- ; : IX- 0 -^ _ix+- ;
|
|
: IY+ _iy+- ; : IY- 0 -^ _iy+- ;
|