From 06f2620ead18279afdd2501c3fef409252aa7ea0 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 14 Jan 2016 17:59:58 -0500 Subject: big_copy() API for bignum --- bignum.s | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'bignum.s') diff --git a/bignum.s b/bignum.s index 27580d5..9d24115 100644 --- a/bignum.s +++ b/bignum.s @@ -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 + .export _bank_maxed_out, _big_cmp, _big_copy .include "atari.inc" @@ -34,15 +34,6 @@ fr0_to_fptemp: bpl @l rts -fr0_to_fr1: - ldx #5 -@l: - lda FR0,x - sta FR1,x - dex - bpl @l - rts - fptemp_to_fr0: ldx #5 @l: @@ -104,6 +95,17 @@ trunc_fr0: @done: rts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; void __fastcall__ big_copy(bignump dest, bignump src) +_big_copy: + sta FLPTR ; src arg in FLPTR + stx FLPTR+1 + jsr FLD0P ; load src value into FR0 + jsr popax ; get dest arg + sta FLPTR ; dest arg in FLPTR + stx FLPTR+1 + jmp FST0P ; store FR0 value into dest + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; void __fastcall__ big_binary_op(bignump dest, bignump a, bignump b, unsigned int jsraddr); _big_binary_op: -- cgit v1.2.3