diff src/math.asm @ 628:cd58f7fc86db

3.05 stable work
author heinrichsweikamp
date Thu, 19 Sep 2019 12:01:29 +0200
parents c40025d8e750
children 4050675965ea
line wrap: on
line diff
--- a/src/math.asm	Sun Jun 30 23:22:32 2019 +0200
+++ b/src/math.asm	Thu Sep 19 12:01:29 2019 +0200
@@ -1,6 +1,6 @@
 ;=============================================================================
 ;
-;   File math.asm                             combined next generation V3.03.2
+;   File math.asm                             combined next generation V3.04.3
 ;
 ;   Math subroutines
 ;
@@ -54,6 +54,18 @@
 	return								; YES - done
 
 
+	global	addU16						; ; sub_c:2 = sub_a:2 + sub_b:2	with USIGNED values
+										; trashes WREG
+addU16:
+	movf	sub_a+0,W					; get 1st summand (low  byte) to WREG
+	addwf	sub_b+0,W					; add 2nd summand (low  byte) and store result in WREG
+	movwf	sub_c+0						; copy result     (low  byte) to sub_c
+	movf	sub_a+1,W					; get 1st summand (high byte) to WREG
+	addwfc	sub_b+1,W					; add 2nd summand (high byte) and store result in WREG
+	movwf	sub_c+1						; copy result     (high byte) to sub_c
+	return								; done
+
+
 	global	sub16						; sub_c:2 = sub_a:2 - sub_b:2   with SIGNED values
 										; sets neg_flag if result is < 0
 										; trashes WREG