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

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

View File

@ -7,3 +7,5 @@
: HLZ, A H LDrr, L ORr, ; : HLZ, A H LDrr, L ORr, ;
: DEZ, A D LDrr, E ORr, ; : DEZ, A D LDrr, E ORr, ;
: LDDE(HL), E (HL) LDrr, HL INCss, D (HL) LDrr, ; : 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 DECss, ( prev field )
DE PUSHqq, ( --> lvl 2 ) DE PUSHqq, ( --> lvl 2 )
EXDEHL, EXDEHL,
E (HL) LDrr, LDDE(HL),
HL INCss,
D (HL) LDrr,
( cont. ) ( cont. )

View File

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