mirror of
https://github.com/samsonjs/sectorlisp.git
synced 2026-04-27 14:57:41 +00:00
Fix off by one w/ interning (441 bytes)
This commit is contained in:
parent
d5afd05ef8
commit
040852302c
1 changed files with 9 additions and 8 deletions
17
sectorlisp.S
17
sectorlisp.S
|
|
@ -123,6 +123,7 @@ Intern: push %cx # Intern(cx,di): ax
|
||||||
je 8f
|
je 8f
|
||||||
rep cmpsb # memcmp(di,si,cx)
|
rep cmpsb # memcmp(di,si,cx)
|
||||||
je 9f
|
je 9f
|
||||||
|
dec %di
|
||||||
xor %ax,%ax
|
xor %ax,%ax
|
||||||
2: scasb # memchr(di,al,cx)
|
2: scasb # memchr(di,al,cx)
|
||||||
jne 2b
|
jne 2b
|
||||||
|
|
@ -175,6 +176,14 @@ Cons: xchg %di,%cx # Cons(m:di,a:ax):ax
|
||||||
1: xchg %di,%ax
|
1: xchg %di,%ax
|
||||||
ret
|
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
|
Gc: cmp %dx,%di # Gc(x:di,A:dx,B:si):ax
|
||||||
jb 1b # we assume immutable cells
|
jb 1b # we assume immutable cells
|
||||||
push (%bx,%di) # mark prevents negative gc
|
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
|
add %dx,%ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
GetList:call GetToken
|
|
||||||
cmp $')',%al
|
|
||||||
je .retF
|
|
||||||
call GetObject
|
|
||||||
push %ax # popped by xCons
|
|
||||||
call GetList
|
|
||||||
jmp xCons
|
|
||||||
|
|
||||||
.dflt1: push %si # save x
|
.dflt1: push %si # save x
|
||||||
call Eval
|
call Eval
|
||||||
pop %si # restore x
|
pop %si # restore x
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue