Shave three more bytes using overlaps

This commit is contained in:
Hikaru Ikuta 2022-01-06 19:14:31 +09:00
parent c84eed864f
commit 9b0b5e9f20

View file

@ -94,6 +94,10 @@ GetToken: # GetToken():al, dl is g_look
4: mov $')',%al
jmp PutChar
Print: test %si,%si
jz NewLine
xchg %di,%si
.byte 0x81 # sub ax, §call Putchar
.PutObject: # .PutObject(c:al,x:si)
.PrintString: # nul-terminated in si
call PutChar # preserves si
@ -106,12 +110,6 @@ PrintObject: # PrintObject(x:si)
jnz .PrintString # -> ret
ret
Print: test %si,%si
jz NewLine
xchg %di,%si
call PrintObject
ret
NewLine:mov $'\r',%al
jmp PutChar