diff --git a/wip-hugo/macros/16aritmatic.s b/wip-hugo/macros/16aritmatic.s index 46eb0be..ed2cba5 100755 --- a/wip-hugo/macros/16aritmatic.s +++ b/wip-hugo/macros/16aritmatic.s @@ -7,21 +7,27 @@ ;; IF to run it fast .ifblank fast_unsafe CLC -.endif -;; If b_low != A -.if .match(.mid (0, 1, {b_low}), A ) -.else - LDA b_low .endif LDA b_low ADC a_low STA a_low LDA b_hi - LDA b_hi ADC a_hi STA a_hi .endmacro +; Untested! +.macro Add_16_AX low, hi, fast_unsafe; , A, X +;; IF to run it fast +.ifblank fast_unsafe + CLC +.endif + ADC low + STA low + TXA + ADC hi + STA hi +.endmacro .macro Sub_16 a_low, a_hi, b_low, b_hi, fast_unsafe ; a = a - b .ifblank fast_unsafe @@ -35,6 +41,19 @@ STA a_hi .endmacro +;;Untested +.macro Sub_16_AX low, hi, fast_unsafe; , A, X +;; IF to run it fast +.ifblank fast_unsafe + SEC +.endif + SBC low + STA low + TXA + SBC hi + STA hi +.endmacro + .macro mult_16 low_, hi_, fast_unsafe ; [low, hi] = [low, hi]*2 ;; IF to run it fast .ifblank fast_unsafe