# HG changeset patch # User heinrichsweikamp # Date 1340256613 -7200 # Node ID d7eeaffd8fc12a35a7397cf848a77befd24df18e # Parent 16f4eafc197ebb5f2d5e0b2936ebbc0d1c28b504 CNS in planner (pSCR-GF) diff -r 16f4eafc197e -r d7eeaffd8fc1 code_part1/OSTC_code_asm_part1/simulator.asm --- 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