comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 304:ed08d441ed26

Backed out changeset: 9c39cedb662b
author heinrichsweikamp
date Sat, 30 Apr 2011 14:09:38 +0200
parents 9c39cedb662b
children 77c70898c7aa
comparison
equal deleted inserted replaced
303:9c39cedb662b 304:ed08d441ed26
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 ; EAD and END: ToDo... 3085 ; Show EAD: char_I_N2_ratio/0.79*rel_pressure:2*10 -> char_I_N2_ratio*rel_pressure:2/7900 -> EAD in m
3086
3087 ; Show EAD
3088 WIN_LEFT .125 3086 WIN_LEFT .125
3089 WIN_TOP .192 3087 WIN_TOP .192
3090 3088 movff char_I_N2_ratio,xA+0
3091 ; Show END 3089 clrf xA+1
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
3092 WIN_LEFT .125 3104 WIN_LEFT .125
3093 WIN_TOP .216 3105 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
3094 return 3126 return
3095 3127
3096 PLED_show_end_ead_divemode3: ; Show CC EAD, END and pO2[Diluent] 3128 PLED_show_end_ead_divemode3: ; Show CC EAD, END and pO2[Diluent]
3097 ; Show ppO2[Diluent] 3129 ; Show ppO2[Diluent]
3098 WIN_LEFT .95 3130 WIN_LEFT .95
3136 bcf ignore_digit4 3168 bcf ignore_digit4
3137 bcf leftbind 3169 bcf leftbind
3138 STRCAT_PRINT " " ; Display ppO2[Diluent] 3170 STRCAT_PRINT " " ; Display ppO2[Diluent]
3139 3171
3140 ; EAD and END: ToDo... 3172 ; EAD and END: ToDo...
3141
3142 ; Show EAD
3143 WIN_LEFT .125
3144 WIN_TOP .192
3145
3146 ; Show END
3147 WIN_LEFT .125
3148 WIN_TOP .216
3149 return 3173 return
3150 3174
3151 3175
3152 PLED_show_leading_tissue: 3176 PLED_show_leading_tissue:
3153 call PLED_divemask_color ; Set Color for Divemode mask 3177 call PLED_divemask_color ; Set Color for Divemode mask