changeset 596:d7eeaffd8fc1

CNS in planner (pSCR-GF)
author heinrichsweikamp
date Thu, 21 Jun 2012 07:30:13 +0200
parents 16f4eafc197e
children 8172a7ce6db1
files code_part1/OSTC_code_asm_part1/simulator.asm
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/simulator.asm	Thu Jun 21 07:16:11 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/simulator.asm	Thu Jun 21 07:30:13 2012 +0200
@@ -391,10 +391,15 @@
 	bra			simulator_calc_deco1
 	; in PSCR mode, compute fO2 into char_I_O2_ratio
 	call		compute_pscr_ppo2		; pSCR ppO2 into sub_c:2
-;    tstfsz      sub_c+1                 ; Is ppO2 > 2.55bar ? mH
-;    setf        sub_c+0                 ; yes: bound to 2.55... better than wrap around.
-    movff		sub_c+0,char_I_actual_ppO2	; copy last ppO2 to buffer register
-
+    movff		sub_c+0,xA+0
+    movff		sub_c+1,xA+1
+	movlw		d'100'
+	movwf		xB+0
+	clrf		xB+1
+	call		div16x16				; /100
+    tstfsz      xC+1                    ; Is ppO2 > 2.55bar ?
+    setf        xC+0                    ; yes: bound to 2.55... better than wrap around.
+    movff		xC+0,char_I_actual_ppO2	; copy last ppO2 to buffer register (for pSCR CNS)
 	movff		sub_c+0,xA+0
 	movff		sub_c+1,xA+1
 	movlw		LOW		.10