diff code_part1/OSTC_code_asm_part1/math.asm @ 354:cec312042b94

Fix sub16 neg detect (related to bug #44)
author JeanDo
date Tue, 07 Jun 2011 03:55:27 +0200
parents 06299199dfb9
children 07f5b0baaa57
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/math.asm	Tue Jun 07 01:16:55 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/math.asm	Tue Jun 07 03:55:27 2011 +0200
@@ -54,10 +54,10 @@
 	subwfb 	sub_a+1, W
 	movwf  	sub_c+1
 
-	btfsc	STATUS,C
-	return							; result positve
+	btfss	STATUS,N                ; Negativ result ?
+	return							; NO: result positive done.
 
-	bsf		neg_flag				; result negative
+	bsf		neg_flag				; MARK result negative
 
     comf    sub_c+1                 ; 16bit sign change.
     negf    sub_c+0