Print newline capability

This commit is contained in:
Hikaru Ikuta 2022-01-06 11:43:11 +09:00
parent 72b037de93
commit 1ff4ea987d

View file

@ -53,8 +53,7 @@ begin: mov $0x8000,%sp # uses higher address as stack
pop %ss # errata exists but don't care
mov $2,%bx
main: mov %sp,%cx
mov $'\r',%al
call PutChar
call NewLine
mov %dx,%fs # Clear input lookahead cache
call Read
call EvalPrint
@ -106,7 +105,11 @@ PrintObject: # PrintObject(x:si)
ret
Print: mov (%si),%si # si = Cdr(e)
mov (%si),%ax # ax = Car(Cdr(e))
test %si,%si
jnz 1f
NewLine:mov $'\r',%al
jmp PutChar
1: mov (%si),%ax # ax = Car(Cdr(e))
EvalPrint:
call Eval
push %dx