mirror of
https://github.com/samsonjs/sectorlisp.git
synced 2026-04-27 14:57:41 +00:00
A more robust Read function
This commit is contained in:
parent
90903662a9
commit
46ba9fee4f
1 changed files with 18 additions and 13 deletions
31
sectorlisp.S
31
sectorlisp.S
|
|
@ -104,8 +104,25 @@ PrintObject: # PrintObject(x:si)
|
||||||
jnz .PrintString # -> ret
|
jnz .PrintString # -> ret
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Read: xchg %dx,%ax
|
Print: mov (%si),%si # si = Cdr(e)
|
||||||
|
mov (%si),%ax # ax = Car(Cdr(e))
|
||||||
|
EvalPrint:
|
||||||
|
call Eval
|
||||||
|
push %ax
|
||||||
|
push %dx
|
||||||
|
xchg %ax,%si
|
||||||
|
call PrintObject
|
||||||
|
pop %dx
|
||||||
|
pop %ax
|
||||||
|
ret
|
||||||
|
|
||||||
|
Read: push %dx
|
||||||
|
call GetChar
|
||||||
call GetToken
|
call GetToken
|
||||||
|
call GetObject
|
||||||
|
pop %dx
|
||||||
|
ret
|
||||||
|
|
||||||
GetObject: # called just after GetToken
|
GetObject: # called just after GetToken
|
||||||
cmp $'(',%al
|
cmp $'(',%al
|
||||||
je GetList
|
je GetList
|
||||||
|
|
@ -144,18 +161,6 @@ PutChar:mov $0x0e,%ah # prints CP-437
|
||||||
.RetDx: xchg %dx,%ax
|
.RetDx: xchg %dx,%ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Print: mov (%si),%si # si = Cdr(e)
|
|
||||||
mov (%si),%ax # ax = Car(Cdr(e))
|
|
||||||
EvalPrint:
|
|
||||||
call Eval
|
|
||||||
push %ax
|
|
||||||
push %dx
|
|
||||||
xchg %ax,%si
|
|
||||||
call PrintObject
|
|
||||||
pop %dx
|
|
||||||
pop %ax
|
|
||||||
ret
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Evlis: test %di,%di # Evlis(m:di,a:dx):ax
|
Evlis: test %di,%di # Evlis(m:di,a:dx):ax
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue