comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 305:77c70898c7aa

cleanup
author heinrichsweikamp
date Sat, 30 Apr 2011 14:18:30 +0200
parents ed08d441ed26
children 5bc3467fc421
comparison
equal deleted inserted replaced
304:ed08d441ed26 305:77c70898c7aa
3080 ; We are in CCR mode... 3080 ; We are in CCR mode...
3081 btfss is_bailout ; In bailout mode? 3081 btfss is_bailout ; In bailout mode?
3082 bra PLED_show_end_ead_divemode3 ; No, show CC EAD and END 3082 bra PLED_show_end_ead_divemode3 ; No, show CC EAD and END
3083 3083
3084 PLED_show_end_ead_divemode2: ; Show OC EAD and END 3084 PLED_show_end_ead_divemode2: ; Show OC EAD and END
3085 ; Show EAD: char_I_N2_ratio/0.79*rel_pressure:2*10 -> char_I_N2_ratio*rel_pressure:2/7900 -> EAD in m 3085 ; Show EAD:
3086 WIN_LEFT .125 3086 WIN_LEFT .125
3087 WIN_TOP .192 3087 WIN_TOP .192
3088 movff char_I_N2_ratio,xA+0 3088
3089 clrf xA+1 3089 ; Show END:
3090 movff rel_pressure+0,xB+0
3091 movff rel_pressure+1,xB+1
3092 call mult16x16 ; xA*xB=xC
3093 movlw LOW d'7900'
3094 movwf xB+0
3095 movlw HIGH d'7900'
3096 movwf xB+1
3097 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
3098 movff xC+0,lo
3099 movff xC+1,hi ; lo:hi now hold EAD in m
3100 lfsr FSR2,letter
3101 output_16_3 ; Display only full meters
3102 STRCAT_PRINT "m" ; Display EAD
3103
3104 WIN_LEFT .125 3090 WIN_LEFT .125
3105 WIN_TOP .216 3091 WIN_TOP .216
3106 ; Show END = rel_pressure × (100 - char_I_He_ratio)/10000 -> Result in m
3107 movff char_I_He_ratio,lo ; temp
3108 movlw d'100'
3109 bsf STATUS,C
3110 subfwb lo,W
3111 movwf xA+0
3112 clrf xA+1
3113 movff rel_pressure+0,xB+0
3114 movff rel_pressure+1,xB+1
3115 call mult16x16 ; xA*xB=xC
3116 movlw LOW d'10000'
3117 movwf xB+0
3118 movlw HIGH d'10000'
3119 movwf xB+1
3120 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
3121 movff xC+0,lo
3122 movff xC+1,hi ; lo:hi now hold END in m
3123 lfsr FSR2,letter
3124 output_16_3
3125 STRCAT_PRINT "m" ; Display END
3126 return 3092 return
3127 3093
3128 PLED_show_end_ead_divemode3: ; Show CC EAD, END and pO2[Diluent] 3094 PLED_show_end_ead_divemode3: ; Show CC EAD, END and pO2[Diluent]
3129 ; Show ppO2[Diluent] 3095 ; Show ppO2[Diluent]
3130 WIN_LEFT .95 3096 WIN_LEFT .95
3168 bcf ignore_digit4 3134 bcf ignore_digit4
3169 bcf leftbind 3135 bcf leftbind
3170 STRCAT_PRINT " " ; Display ppO2[Diluent] 3136 STRCAT_PRINT " " ; Display ppO2[Diluent]
3171 3137
3172 ; EAD and END: ToDo... 3138 ; EAD and END: ToDo...
3139 ; Show EAD:
3140 WIN_LEFT .125
3141 WIN_TOP .192
3142
3143 ; Show END:
3144 WIN_LEFT .125
3145 WIN_TOP .216
3173 return 3146 return
3174 3147
3175 3148
3176 PLED_show_leading_tissue: 3149 PLED_show_leading_tissue:
3177 call PLED_divemask_color ; Set Color for Divemode mask 3150 call PLED_divemask_color ; Set Color for Divemode mask