mirror of
https://github.com/samsonjs/sectorlisp.git
synced 2026-04-27 14:57:41 +00:00
move SP setting
This commit is contained in:
parent
d50e78162d
commit
88e749ea79
1 changed files with 8 additions and 2 deletions
10
sectorlisp.S
10
sectorlisp.S
|
|
@ -36,13 +36,19 @@ kCdr: .asciz "CDR" # ordering matters
|
||||||
kCons: .asciz "CONS" # ordering matters
|
kCons: .asciz "CONS" # ordering matters
|
||||||
kEq: .asciz "EQ" # needs to be last
|
kEq: .asciz "EQ" # needs to be last
|
||||||
|
|
||||||
begin: push %cs # that means ss = ds = es = cs
|
begin: xor %sp,%sp # use highest address as stack
|
||||||
|
# set independently of SS!
|
||||||
|
# 8088 doesn't stop interrupts
|
||||||
|
# after SS is set, and PC BIOS
|
||||||
|
# sets SP to a value that will
|
||||||
|
# damage our code if int fires
|
||||||
|
# between setting SS and SP
|
||||||
|
push %cs # that means ss = ds = es = cs
|
||||||
pop %ds # noting ljmp set cs to 0x7c00
|
pop %ds # noting ljmp set cs to 0x7c00
|
||||||
push %cs # that's the bios load address
|
push %cs # that's the bios load address
|
||||||
pop %es # therefore NULL points to NUL
|
pop %es # therefore NULL points to NUL
|
||||||
push %cs # terminated NIL string above!
|
push %cs # terminated NIL string above!
|
||||||
pop %ss # errata exists but don't care
|
pop %ss # errata exists but don't care
|
||||||
xor %sp,%sp # use highest address as stack
|
|
||||||
mov $2,%bx
|
mov $2,%bx
|
||||||
main: mov $0x8000,%cx # dl (g_look) is zero or cr
|
main: mov $0x8000,%cx # dl (g_look) is zero or cr
|
||||||
call GetToken
|
call GetToken
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue