diff options
Diffstat (limited to 'bignum.s')
-rw-r--r-- | bignum.s | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -3,7 +3,7 @@ .importzp ptr3, ptr4, sreg .import popeax, popax, pushax, _memcmp .export _ulong_to_big, _big_to_ulong, _big_add, _big_sub, _big_mul, _big_div - .export _bank_maxed_out, _big_cmp, _big_copy + .export _bank_maxed_out, _big_cmp, _big_copy, _big_negate .include "atari.inc" @@ -71,6 +71,20 @@ ptr4_to_fr1: rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; void __fastcall__ big_negate(bignump dest, bignump src); +_big_negate: + sta ptr3 + stx ptr3+1 + jsr popax + sta ptr4 + stx ptr4+1 + ldy #0 + lda (ptr3),y + eor #$80 + sta (ptr4),y + rts + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; truncate FR0 to integer (no rounding: 2.8 -> 2) trunc_fr0: lda FR0 |