mirror of
https://github.com/samsonjs/sectorlisp.git
synced 2026-03-25 09:05:48 +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
|
||||
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 GetObject
|
||||
pop %dx
|
||||
ret
|
||||
|
||||
GetObject: # called just after GetToken
|
||||
cmp $'(',%al
|
||||
je GetList
|
||||
|
|
@ -144,18 +161,6 @@ PutChar:mov $0x0e,%ah # prints CP-437
|
|||
.RetDx: xchg %dx,%ax
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue