Take advantage of tail call optimization where possible in calculator.asm
This commit is contained in:
parent
41bdec1b12
commit
95b7c676b2
|
@ -334,9 +334,7 @@ fUnpack:
|
||||||
cleq r0, r0, stLowNybble
|
cleq r0, r0, stLowNybble
|
||||||
cleq r0, r0, stOver
|
cleq r0, r0, stOver
|
||||||
cleq r0, r0, stStoreByte
|
cleq r0, r0, stStoreByte
|
||||||
cleq r0, r0, stDec
|
breq r0, r0, stDec
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
; ptr -- f
|
; ptr -- f
|
||||||
fPack:
|
fPack:
|
||||||
|
@ -388,9 +386,7 @@ fPack:
|
||||||
cleq r0, r0, stLoadByte
|
cleq r0, r0, stLoadByte
|
||||||
cleq r0, r0, stOr
|
cleq r0, r0, stOr
|
||||||
cleq r0, r0, stSwap
|
cleq r0, r0, stSwap
|
||||||
cleq r0, r0, stInc
|
breq r0, r0, stInc
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------
|
; ------------------------------------------------------------------
|
||||||
; Unpacked floating point variables
|
; Unpacked floating point variables
|
||||||
|
@ -602,9 +598,7 @@ fPrint:
|
||||||
load r0, fArg1+2
|
load r0, fArg1+2
|
||||||
cleq r0, r0, writehexNybble
|
cleq r0, r0, writehexNybble
|
||||||
load r0, fArg1+3
|
load r0, fArg1+3
|
||||||
cleq r0, r0, writehexNybble
|
breq r0, r0, writehexNybble
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
fPrintNegativeExponent:
|
fPrintNegativeExponent:
|
||||||
cleq r0, r0, popWord ; Remove result we don't need
|
cleq r0, r0, popWord ; Remove result we don't need
|
||||||
|
@ -678,9 +672,7 @@ fPrint:
|
||||||
cleq r0, r0, popWord
|
cleq r0, r0, popWord
|
||||||
xor r0, r0
|
xor r0, r0
|
||||||
or r0, r1
|
or r0, r1
|
||||||
cleq r0, r0, writehexNybble
|
breq r0, r0, writehexNybble
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
fPrintOverflow:
|
fPrintOverflow:
|
||||||
load r0, #4f ; O
|
load r0, #4f ; O
|
||||||
|
|
Loading…
Reference in New Issue