mirror of
https://github.com/cc65/cc65.git
synced 2026-04-26 13:18:31 +00:00
Minor optimization suggested by Greg King
git-svn-id: svn://svn.cc65.org/cc65/trunk@1468 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -16,6 +16,7 @@ tosmoda0:
|
||||
tosmodax:
|
||||
jsr popsargs ; Get arguments from stack, adjust sign
|
||||
jsr udiv16 ; Do the division
|
||||
lda ptr1 ; Load low byte of result
|
||||
ldx ptr1+1 ; Load high byte of result
|
||||
|
||||
; Adjust the sign of the result. tmp1 contains the high byte of the left
|
||||
@@ -23,16 +24,14 @@ tosmodax:
|
||||
; the result of the modulo operation is the same as that of the left
|
||||
; operand
|
||||
|
||||
lda tmp1
|
||||
bit tmp1
|
||||
bpl Pos ; Jump if sign of result positive
|
||||
|
||||
; Result is negative
|
||||
|
||||
lda ptr1 ; Load low byte of result
|
||||
jmp negax ; Adjust the sign
|
||||
|
||||
; Result is positive
|
||||
|
||||
Pos: lda ptr1
|
||||
rts
|
||||
Pos: rts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user