|
@@ -68,7 +68,7 @@ GetToken: # GetToken():al, dl is g_look
|
|
jbe 3f
|
|
jbe 3f
|
|
cmp $')',%dl # dl = g_look
|
|
cmp $')',%dl # dl = g_look
|
|
ja 1b
|
|
ja 1b
|
|
-3: movb %bh,(%di) # bh is zero
|
|
|
|
|
|
+3: mov %bh,(%di) # bh is zero
|
|
xchg %si,%ax
|
|
xchg %si,%ax
|
|
ret
|
|
ret
|
|
|
|
|
|
@@ -86,6 +86,7 @@ GetToken: # GetToken():al, dl is g_look
|
|
call .PutObject
|
|
call .PutObject
|
|
4: mov $')',%al
|
|
4: mov $')',%al
|
|
jmp PutChar
|
|
jmp PutChar
|
|
|
|
+
|
|
.PutObject: # .PutObject(c:al,x:si)
|
|
.PutObject: # .PutObject(c:al,x:si)
|
|
.PrintString: # nul-terminated in si
|
|
.PrintString: # nul-terminated in si
|
|
call PutChar # preserves si
|
|
call PutChar # preserves si
|
|
@@ -99,32 +100,30 @@ PrintObject: # PrintObject(x:si)
|
|
ret
|
|
ret
|
|
|
|
|
|
GetObject: # called just after GetToken
|
|
GetObject: # called just after GetToken
|
|
- cmpb $'(',%al
|
|
|
|
|
|
+ cmp $'(',%al
|
|
je GetList
|
|
je GetList
|
|
-.Intern:
|
|
|
|
- mov %cx,%si
|
|
|
|
|
|
+# jmp Intern
|
|
|
|
+
|
|
|
|
+Intern: push %cx # Intern(cx,di): ax
|
|
|
|
+ mov %di,%bp
|
|
|
|
+ sub %cx,%bp
|
|
|
|
+ inc %bp
|
|
xor %di,%di
|
|
xor %di,%di
|
|
- xor %al,%al
|
|
|
|
-0: push %di # save 1
|
|
|
|
-1: cmpsb
|
|
|
|
- jne 2f
|
|
|
|
- dec %di
|
|
|
|
- scasb
|
|
|
|
- jne 1b
|
|
|
|
- jmp 5f
|
|
|
|
-2: pop %bp # drop 1
|
|
|
|
- mov %cx,%si
|
|
|
|
-3: scasb
|
|
|
|
- jne 3b
|
|
|
|
- cmp (%di),%al
|
|
|
|
- jne 0b
|
|
|
|
- push %di # StpCpy
|
|
|
|
-4: movsb
|
|
|
|
- dec %di
|
|
|
|
- scasb
|
|
|
|
- jnz 4b
|
|
|
|
-5: pop %ax # restore 1
|
|
|
|
-.ret: ret
|
|
|
|
|
|
+1: pop %si
|
|
|
|
+ push %si
|
|
|
|
+ mov %bp,%cx
|
|
|
|
+ mov %di,%ax
|
|
|
|
+ cmp %bh,(%di)
|
|
|
|
+ je 2f
|
|
|
|
+ rep cmpsb # memcmp(di,si,cx)
|
|
|
|
+ je 9f
|
|
|
|
+ not %cx
|
|
|
|
+ xor %ax,%ax
|
|
|
|
+ repne scasb # memchr(di,al,cx)
|
|
|
|
+ jmp 1b
|
|
|
|
+2: rep movsb # memcpy(di,si,cx)
|
|
|
|
+9: pop %cx
|
|
|
|
+ ret
|
|
|
|
|
|
GetChar:xor %ax,%ax # GetChar→al:dl
|
|
GetChar:xor %ax,%ax # GetChar→al:dl
|
|
int $0x16 # get keystroke
|
|
int $0x16 # get keystroke
|
|
@@ -185,7 +184,7 @@ Gc: cmp %dx,%di # Gc(x:di,A:dx,B:si):ax
|
|
ret
|
|
ret
|
|
|
|
|
|
GetList:call GetToken
|
|
GetList:call GetToken
|
|
- cmpb $')',%al
|
|
|
|
|
|
+ cmp $')',%al
|
|
je .retF
|
|
je .retF
|
|
call GetObject
|
|
call GetObject
|
|
push %ax # popped by xCons
|
|
push %ax # popped by xCons
|