mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 09:58:06 +11:00
zasm: complete mnemonic argspecs harmonization
This commit is contained in:
parent
a9ed8da0b2
commit
7ace3032ef
8
blk/200
8
blk/200
@ -3,11 +3,11 @@ Z80 Assembler
|
||||
201 Guide 208 Instructions list
|
||||
212 Loader 213 Variables & consts
|
||||
215 Utils 216 OP1
|
||||
218 OP1r 220 OP1qq
|
||||
218 OP1r 220 OP1d
|
||||
222 OP1rr 224 OP2
|
||||
226 OP2n 228 OP2rn
|
||||
226 OP2i 228 OP2ri
|
||||
230 OP2br 232 OProt
|
||||
234 OP2r 236 OP2ss
|
||||
238 OP3ddnn 240 OP3nn
|
||||
234 OP2r 236 OP2d
|
||||
238 OP3di 240 OP3i
|
||||
242 Specials 246 Flow
|
||||
249 Macros
|
||||
|
6
blk/238
6
blk/238
@ -1,5 +1,5 @@
|
||||
( d n -- )
|
||||
: OP3dn
|
||||
( d i -- )
|
||||
: OP3di
|
||||
CREATE C,
|
||||
DOES>
|
||||
C@ ( d n op )
|
||||
@ -8,4 +8,4 @@
|
||||
OR A,
|
||||
A,,
|
||||
;
|
||||
0x01 OP3dn LDdn,
|
||||
0x01 OP3di LDdi,
|
||||
|
12
blk/240
12
blk/240
@ -1,11 +1,11 @@
|
||||
( n -- )
|
||||
: OP3n
|
||||
( i -- )
|
||||
: OP3i
|
||||
CREATE C,
|
||||
DOES>
|
||||
C@ A,
|
||||
A,,
|
||||
;
|
||||
0xcd OP3n CALL,
|
||||
0xc3 OP3n JP,
|
||||
0x22 OP3n LD(n)HL, 0x2a OP3n LDHL(n),
|
||||
0x32 OP3n LD(i)A, 0x3a OP3n LDA(i),
|
||||
0xcd OP3i CALL,
|
||||
0xc3 OP3i JP,
|
||||
0x22 OP3i LD(i)HL, 0x2a OP3i LDHL(i),
|
||||
0x32 OP3i LD(i)A, 0x3a OP3i LDA(i),
|
||||
|
4
blk/242
4
blk/242
@ -1,9 +1,9 @@
|
||||
: LDd(n), ( d n -- )
|
||||
: LDd(i), ( d i -- )
|
||||
0xed A,
|
||||
SWAP <<4 0x4b OR A,
|
||||
A,,
|
||||
;
|
||||
: LD(n)d, ( n d -- )
|
||||
: LD(i)d, ( i d -- )
|
||||
0xed A,
|
||||
<<4 0x43 OR A,
|
||||
A,,
|
||||
|
6
blk/249
6
blk/249
@ -1,9 +1,9 @@
|
||||
( Macros )
|
||||
( clear carry + SBC )
|
||||
: SUBHLd, A ORr, SBCHLd, ;
|
||||
: PUSH0, DE 0 LDdn, DE PUSH, ;
|
||||
: PUSH1, DE 1 LDdn, DE PUSH, ;
|
||||
: PUSHZ, DE 0 LDdn, IFZ, DE INCd, THEN, DE PUSH, ;
|
||||
: PUSH0, DE 0 LDdi, DE PUSH, ;
|
||||
: PUSH1, DE 1 LDdi, DE PUSH, ;
|
||||
: PUSHZ, DE 0 LDdi, IFZ, DE INCd, THEN, DE PUSH, ;
|
||||
: PUSHA, D 0 LDri, E A LDrr, DE PUSH, ;
|
||||
: HLZ, A H LDrr, L ORr, ;
|
||||
: DEZ, A D LDrr, E ORr, ;
|
||||
|
12
blk/284
12
blk/284
@ -1,13 +1,13 @@
|
||||
PC ORG @ 1 + ! ( main )
|
||||
SP PS_ADDR LDdn, IX RS_ADDR LDdn,
|
||||
SP PS_ADDR LDdi, IX RS_ADDR LDdi,
|
||||
( LATEST is a label to the latest entry of the dict. It is
|
||||
written at offset 0x08 by the process or person building
|
||||
Forth. )
|
||||
BIN( @ 0x08 + LDHL(n),
|
||||
SYSVARS 0x02 ( CURRENT ) + LD(n)HL,
|
||||
BIN( @ 0x08 + LDHL(i),
|
||||
SYSVARS 0x02 ( CURRENT ) + LD(i)HL,
|
||||
HERESTART [IF]
|
||||
HL HERESTART LDdn,
|
||||
HL HERESTART LDdi,
|
||||
[THEN]
|
||||
SYSVARS 0x04 + LD(n)HL, ( RAM+04 == HERE )
|
||||
DE BIN( @ 0x04 ( BOOT ) + LDd(n),
|
||||
SYSVARS 0x04 + LD(i)HL, ( RAM+04 == HERE )
|
||||
DE BIN( @ 0x04 ( BOOT ) + LDd(i),
|
||||
JR, L1 FWR ( execute, B287 )
|
||||
|
4
blk/286
4
blk/286
@ -6,8 +6,8 @@ lblnext BSET PC ORG @ 0x1b + ! ( next )
|
||||
IX PUSH, EX(SP)HL, ( do EX to count the IX push in SP )
|
||||
SP SUBHLd, HL POP,
|
||||
IFNC, ( SP <= IX? overflow )
|
||||
SP PS_ADDR LDdn, IX RS_ADDR LDdn,
|
||||
DE BIN( @ 0x13 ( oflw ) + LDd(n),
|
||||
SP PS_ADDR LDdi, IX RS_ADDR LDdi,
|
||||
DE BIN( @ 0x13 ( oflw ) + LDd(i),
|
||||
JR, L2 FWR ( execute, B287 )
|
||||
THEN,
|
||||
LDA(BC), E A LDrr, BC INCd,
|
||||
|
4
blk/290
4
blk/290
@ -1,5 +1,5 @@
|
||||
lbluflw BSET ( abortUnderflow )
|
||||
DE BIN( @ 0x06 ( uflw ) + LDd(n),
|
||||
DE BIN( @ 0x06 ( uflw ) + LDd(i),
|
||||
JR, lblexec BWR
|
||||
lblchkPS BSET ( chkPS )
|
||||
( Note that you only need to call this in words that push
|
||||
@ -8,7 +8,7 @@ lblchkPS BSET ( chkPS )
|
||||
EXX,
|
||||
( We have the return address for this very call on the stack
|
||||
and protected registers. 2- is to compensate that. )
|
||||
HL PS_ADDR 2- LDdn,
|
||||
HL PS_ADDR 2- LDdi,
|
||||
SP SUBHLd,
|
||||
EXX,
|
||||
CNC RETc, ( PS_ADDR >= SP? good )
|
||||
|
2
blk/310
2
blk/310
@ -8,7 +8,7 @@ CODE PICK EXX, ( protect BC )
|
||||
B (HL) LDrr,
|
||||
( check PS range before returning )
|
||||
EXDEHL,
|
||||
HL PS_ADDR LDdn,
|
||||
HL PS_ADDR LDdi,
|
||||
DE SUBHLd,
|
||||
IFC, EXX, lbluflw @ JP, THEN,
|
||||
BC PUSH,
|
||||
|
4
blk/313
4
blk/313
@ -1,10 +1,10 @@
|
||||
CODE S0
|
||||
HL PS_ADDR LDdn,
|
||||
HL PS_ADDR LDdi,
|
||||
HL PUSH,
|
||||
;CODE
|
||||
|
||||
CODE 'S
|
||||
HL 0 LDdn,
|
||||
HL 0 LDdi,
|
||||
SP ADDHLd,
|
||||
HL PUSH,
|
||||
;CODE
|
||||
|
2
blk/319
2
blk/319
@ -1,7 +1,7 @@
|
||||
CODE * EXX, ( protect BC )
|
||||
( DE * BC -> DE (high) and HL (low) )
|
||||
DE POP, BC POP, chkPS,
|
||||
HL 0 LDdn,
|
||||
HL 0 LDdi,
|
||||
A 0x10 LDri,
|
||||
BEGIN,
|
||||
HL ADDHLd,
|
||||
|
2
blk/320
2
blk/320
@ -4,7 +4,7 @@
|
||||
CODE /MOD EXX, ( protect BC )
|
||||
DE POP, BC POP, chkPS,
|
||||
A B LDrr, B 16 LDri,
|
||||
HL 0 LDdn,
|
||||
HL 0 LDdi,
|
||||
BEGIN,
|
||||
SCF, C RL, RLA,
|
||||
HL ADCHLd, DE SBCHLd,
|
||||
|
4
blk/327
4
blk/327
@ -3,9 +3,9 @@ CODE BYE
|
||||
;CODE
|
||||
|
||||
CODE (resSP)
|
||||
SP PS_ADDR LDdn,
|
||||
SP PS_ADDR LDdi,
|
||||
;CODE
|
||||
|
||||
CODE (resRS)
|
||||
IX RS_ADDR LDdn,
|
||||
IX RS_ADDR LDdi,
|
||||
;CODE
|
||||
|
2
blk/329
2
blk/329
@ -3,7 +3,7 @@ CODE CMP
|
||||
DE POP,
|
||||
chkPS,
|
||||
DE SUBHLd,
|
||||
DE 0 LDdn,
|
||||
DE 0 LDdi,
|
||||
IFNZ, ( < or > )
|
||||
DE INCd,
|
||||
IFNC, ( < )
|
||||
|
2
blk/331
2
blk/331
@ -7,6 +7,6 @@ CODE 0 PUSH0, ;CODE
|
||||
CODE 1 PUSH1, ;CODE
|
||||
|
||||
CODE -1
|
||||
HL -1 LDdn,
|
||||
HL -1 LDdi,
|
||||
HL PUSH,
|
||||
;CODE
|
||||
|
2
blk/494
2
blk/494
@ -1,6 +1,6 @@
|
||||
: LINES 24 ; : COLS 80 ;
|
||||
CODE BYE
|
||||
HL 0 LDdn,
|
||||
HL 0 LDdi,
|
||||
A 0x16 LDri, ( @EXIT )
|
||||
0x28 RST,
|
||||
CODE @DCSTAT ( drv -- f ) EXX, ( protect BC )
|
||||
|
4
blk/502
4
blk/502
@ -3,7 +3,7 @@
|
||||
0xff mask. If it was a 0x20, we put a 0x7f mask. )
|
||||
: @GET,
|
||||
A 0x03 LDri, ( @GET )
|
||||
DE COM_DRV_ADDR LDdn,
|
||||
DE COM_DRV_ADDR LDdi,
|
||||
0x28 RST, JRNZ, L2 FWR ( maybeerror )
|
||||
A ORr,
|
||||
CZ RETc, ( Sending a straight NULL ends the comm. ) ;
|
||||
@ -13,4 +13,4 @@
|
||||
0x28 RST, JRNZ, L3 FWR ( error )
|
||||
A C LDrr, ;
|
||||
H@ ORG !
|
||||
HL DEST_ADDR LDdn, ( cont. )
|
||||
HL DEST_ADDR LDdi, ( cont. )
|
||||
|
4
blk/583
4
blk/583
@ -4,10 +4,10 @@
|
||||
ACIA_CTL INAi, 0x01 ANDi, ( is ACIA rcv buf full? )
|
||||
IFZ, ( no, abort ) AF POP, EI, RETI, THEN,
|
||||
HL PUSH,
|
||||
HL ACIAW> LDdn, A (HL) LDrr,
|
||||
HL ACIAW> LDdi, A (HL) LDrr,
|
||||
HL DECd, (HL) CPr, ( W> == R> ? )
|
||||
IFNZ, ( buffer not full )
|
||||
( get wr ptr ) HL ACIA( LDd(n),
|
||||
( get wr ptr ) HL ACIA( LDd(i),
|
||||
L ADDr, IFC, H INCr, THEN, L A LDrr,
|
||||
( fetch/write ) ACIA_IO INAi, (HL) A LDrr,
|
||||
( advance W> ) ACIAW> LDA(i), A INCr,
|
||||
|
Loading…
Reference in New Issue
Block a user