Make BIN( offsetted binaries closer to working at all

I have a working offset-by-0x100 stage0 now.
This commit is contained in:
Virgil Dupras 2020-04-28 21:12:52 -04:00
parent 0b8c8c9ca0
commit fc67b88720
4 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,7 @@
DUP PC ( l l pc )
-^ 1- ( l off )
( warning: l is a PC offset, not a mem addr! )
SWAP ORG @ + ( off addr )
SWAP ORG @ + BIN( @ - ( off addr )
C!
;
: FWR BSET 0 A, ;

View File

@ -7,3 +7,5 @@
: HLZ, A H LDrr, L ORr, ;
: DEZ, A D LDrr, E ORr, ;
: LDDE(HL), E (HL) LDrr, HL INCss, D (HL) LDrr, ;
: OUTHL, DUP A H LDrr, OUTnA, A L LDrr, OUTnA, ;
: OUTDE, DUP A D LDrr, OUTnA, A E LDrr, OUTnA, ;

View File

@ -10,7 +10,7 @@
DE DECss, ( prev field )
DE PUSHqq, ( --> lvl 2 )
EXDEHL,
E (HL) LDrr,
HL INCss,
D (HL) LDrr,
LDDE(HL),
( cont. )

View File

@ -3,7 +3,7 @@ L3 BSET PC ORG @ 0x34 + ! ( execute )
( We don't apply BIN( reliably on stable ABI stuff, we
might need to adjust addr. Ugly, but well... )
BIN( @ [IF]
A XORr, H ORr, IFZ, H BIN( @ 256 / LDrn,
A XORr, H ORr, IFZ, H BIN( @ 256 / LDrn, THEN,
[THEN]
E (HL) LDrr,
D BIN( @ 256 / LDrn,