From 1ff4ea987d70d541a28dc35d342b273fba82d756 Mon Sep 17 00:00:00 2001 From: Hikaru Ikuta Date: Thu, 6 Jan 2022 11:43:11 +0900 Subject: [PATCH] Print newline capability --- sectorlisp.S | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sectorlisp.S b/sectorlisp.S index 46cf3bc..f7a97bf 100644 --- a/sectorlisp.S +++ b/sectorlisp.S @@ -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