mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 12:18:07 +11:00
z80: remove call indirections in tight spots
This commit is contained in:
parent
2b7abf802f
commit
31095bc04d
2
blk/216
2
blk/216
@ -1,7 +1,7 @@
|
||||
: OP1 CREATE C, DOES> C@ A, ;
|
||||
0xf3 OP1 DI, 0xfb OP1 EI,
|
||||
0xeb OP1 EXDEHL, 0xd9 OP1 EXX,
|
||||
0x08 OP1 EXAFAF',
|
||||
0x08 OP1 EXAFAF', 0xe3 OP1 EX(SP)HL,
|
||||
0x76 OP1 HALT, 0xe9 OP1 JP(HL),
|
||||
0x12 OP1 LD(DE)A, 0x1a OP1 LDA(DE),
|
||||
0x02 OP1 LD(BC)A, 0x0a OP1 LDA(BC),
|
||||
|
2
blk/297
2
blk/297
@ -1,4 +1,4 @@
|
||||
PC ORG @ 0x12 + ! ( pushRS )
|
||||
L4 BSET PC ORG @ 0x12 + ! ( pushRS )
|
||||
IX INCss,
|
||||
IX INCss,
|
||||
0 IX+ L LDIXYr,
|
||||
|
2
blk/299
2
blk/299
@ -1,4 +1,4 @@
|
||||
PC ORG @ 0x1e + ! ( chkPS )
|
||||
L1 BSET PC ORG @ 0x1e + ! ( chkPS )
|
||||
( Note that you only need to call this in words that push
|
||||
back to PSP. If they don't, calling chkPS is redundant with
|
||||
check in next )
|
||||
|
2
blk/300
2
blk/300
@ -3,7 +3,7 @@ PC ORG @ 0x1b + ! ( next )
|
||||
we jump to current IP, but we also take care of increasing
|
||||
it by 2 before jumping. )
|
||||
( Before we continue: are stacks within bounds? )
|
||||
0x1d BCALL, ( chkPS )
|
||||
L1 @ ( chkPS ) BCALL,
|
||||
( check RS )
|
||||
IX PUSHqq, HL POPqq,
|
||||
DE RS_ADDR LDddnn,
|
||||
|
2
blk/302
2
blk/302
@ -3,7 +3,7 @@ L1 BSET PC ORG @ 0x0f + ! ( compiledWord )
|
||||
2. Set new IP to the second atom of the list
|
||||
3. Execute the first atom of the list. )
|
||||
IY PUSHqq, HL POPqq, ( <-- IP )
|
||||
0x11 BCALL, ( 11 == pushRS )
|
||||
L4 @ ( pushRS ) BCALL,
|
||||
EXDEHL, ( HL points to PFA )
|
||||
( While we inc, dereference into DE for execute call later. )
|
||||
LDDE(HL),
|
||||
|
BIN
emul/forth.bin
BIN
emul/forth.bin
Binary file not shown.
Loading…
Reference in New Issue
Block a user