From 040852302c1bd37b16bfb8f123083b80c07fd0be Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Wed, 8 Dec 2021 10:32:29 -0800 Subject: [PATCH] Fix off by one w/ interning (441 bytes) --- sectorlisp.S | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sectorlisp.S b/sectorlisp.S index b18b494..ced1f55 100644 --- a/sectorlisp.S +++ b/sectorlisp.S @@ -123,6 +123,7 @@ Intern: push %cx # Intern(cx,di): ax je 8f rep cmpsb # memcmp(di,si,cx) je 9f + dec %di xor %ax,%ax 2: scasb # memchr(di,al,cx) jne 2b @@ -175,6 +176,14 @@ Cons: xchg %di,%cx # Cons(m:di,a:ax):ax 1: xchg %di,%ax ret +GetList:call GetToken + cmp $')',%al + je .retF + call GetObject + push %ax # popped by xCons + call GetList + jmp xCons + Gc: cmp %dx,%di # Gc(x:di,A:dx,B:si):ax jb 1b # we assume immutable cells push (%bx,%di) # mark prevents negative gc @@ -189,14 +198,6 @@ Gc: cmp %dx,%di # Gc(x:di,A:dx,B:si):ax add %dx,%ax ret -GetList:call GetToken - cmp $')',%al - je .retF - call GetObject - push %ax # popped by xCons - call GetList - jmp xCons - .dflt1: push %si # save x call Eval pop %si # restore x