1
0
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:
cuz
2002-10-24 19:23:24 +00:00
parent 89fe03a728
commit 82684d98fb
2 changed files with 7 additions and 9 deletions
+4 -5
View File
@@ -15,8 +15,9 @@ tosmodeax:
jsr poplsargs ; Get arguments from stack, adjust sign
jsr udiv32 ; Do the division, remainder is in (ptr2:tmp3:tmp4)
; Load the result with the exception of the low byte
; Load the result
lda ptr2
ldx ptr2+1
ldy tmp3
sty sreg
@@ -25,16 +26,14 @@ tosmodeax:
; Check the sign of the result. It is the sign of the left operand.
lda tmp1 ; Check sign of left operand
bit tmp1 ; Check sign of left operand
bpl Pos ; Jump if result is positive
; Result is negative
lda ptr2 ; Load byte 0 of result
jmp negeax ; Negate result
; Result is positive
Pos: lda ptr2 ; Load byte 0 of result
rts ; Done
Pos: rts ; Done