Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/menu_gassetup.asm @ 45:985607cfb813
1.65beta
author | heinrichsweikamp |
---|---|
date | Sun, 11 Jul 2010 20:26:43 +0200 |
parents | 475a9e536d77 |
children | 56aea9fcdd8f |
comparison
equal
deleted
inserted
replaced
44:475a9e536d77 | 45:985607cfb813 |
---|---|
1216 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 5 | 1216 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 5 |
1217 movlw d'5' ; Gas 5 | 1217 movlw d'5' ; Gas 5 |
1218 movwf logbook_temp5 | 1218 movwf logbook_temp5 |
1219 rcall gassetup_sort_store | 1219 rcall gassetup_sort_store |
1220 movff logbook_temp1,EEDATA ; Change depth -> EEDATA | 1220 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
1221 write_int_eeprom d'32' ; Write Change Depth Gas 5 | 1221 write_int_eeprom d'122' ; Write Change Depth Gas 5 |
1222 | 1222 |
1223 rcall gassetup_sort_sort ; Sort! | 1223 rcall gassetup_sort_sort ; Sort! |
1224 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 4 | 1224 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 4 |
1225 movlw d'4' ; Gas 4 | 1225 movlw d'4' ; Gas 4 |
1226 movwf logbook_temp5 | 1226 movwf logbook_temp5 |
1227 rcall gassetup_sort_store | 1227 rcall gassetup_sort_store |
1228 movff logbook_temp1,EEDATA ; Change depth -> EEDATA | 1228 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
1229 write_int_eeprom d'31' ; Write Change Depth Gas 4 | 1229 write_int_eeprom d'121' ; Write Change Depth Gas 4 |
1230 | 1230 |
1231 rcall gassetup_sort_sort ; Sort! | 1231 rcall gassetup_sort_sort ; Sort! |
1232 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 3 | 1232 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 3 |
1233 movlw d'3' ; Gas 3 | 1233 movlw d'3' ; Gas 3 |
1234 movwf logbook_temp5 | 1234 movwf logbook_temp5 |
1235 rcall gassetup_sort_store | 1235 rcall gassetup_sort_store |
1236 movff logbook_temp1,EEDATA ; Change depth -> EEDATA | 1236 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
1237 write_int_eeprom d'30' ; Write Change Depth Gas 3 | 1237 write_int_eeprom d'120' ; Write Change Depth Gas 3 |
1238 | 1238 |
1239 rcall gassetup_sort_sort ; Sort! | 1239 rcall gassetup_sort_sort ; Sort! |
1240 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 2 | 1240 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 2 |
1241 movlw d'2' ; Gas 2 | 1241 movlw d'2' ; Gas 2 |
1242 movwf logbook_temp5 | 1242 movwf logbook_temp5 |
1243 rcall gassetup_sort_store | 1243 rcall gassetup_sort_store |
1244 movff logbook_temp1,EEDATA ; Change depth -> EEDATA | 1244 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
1245 write_int_eeprom d'29' ; Write Change Depth Gas 2 | 1245 write_int_eeprom d'119' ; Write Change Depth Gas 2 |
1246 | 1246 |
1247 rcall gassetup_sort_sort ; Sort! | 1247 rcall gassetup_sort_sort ; Sort! |
1248 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 1 | 1248 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 1 |
1249 movlw d'1' ; Gas 1 | 1249 movlw d'1' ; Gas 1 |
1250 movwf logbook_temp5 | 1250 movwf logbook_temp5 |
1251 rcall gassetup_sort_store | 1251 rcall gassetup_sort_store |
1252 movff logbook_temp1,EEDATA ; Change depth -> EEDATA | 1252 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
1253 write_int_eeprom d'28' ; Write Change Depth Gas 1 | 1253 write_int_eeprom d'118' ; Write Change Depth Gas 1 |
1254 return | 1254 return |
1255 | 1255 |
1256 gassetup_sort_sort: | 1256 gassetup_sort_sort: |
1257 clrf logbook_temp2 ; Gas (0-4) | 1257 clrf logbook_temp2 ; Gas (0-4) |
1258 clrf logbook_temp1 ; Here: Change depth in m | 1258 clrf logbook_temp1 ; Here: Change depth in m |
1309 read_int_eeprom d'33' ; Get old first gas (1-5) | 1309 read_int_eeprom d'33' ; Get old first gas (1-5) |
1310 incf logbook_temp3,W ; Gas 1-5 -> WREG | 1310 incf logbook_temp3,W ; Gas 1-5 -> WREG |
1311 cpfseq EEDATA ; Compare with EEDATA d'33' | 1311 cpfseq EEDATA ; Compare with EEDATA d'33' |
1312 bra gassetup_sort_store2 ; Was not first gas! | 1312 bra gassetup_sort_store2 ; Was not first gas! |
1313 movff logbook_temp5,EEDATA ; Copy new first gas | 1313 movff logbook_temp5,EEDATA ; Copy new first gas |
1314 write_int_eeprom d'33' ; Store | 1314 write_int_eeprom d'123' ; Store |
1315 bsf menubit2 ; Done. Do change again. | 1315 bsf menubit2 ; Done. Do not change again. |
1316 | 1316 |
1317 gassetup_sort_store2: | 1317 gassetup_sort_store2: |
1318 ;; Was Gas #logbook_temp3 active? | 1318 ; Was Gas #logbook_temp3 active? |
1319 ;; Letter+26 holds active bits 25? | 1319 ; Letter+26 holds active bits 25? |
1320 ; movff logbook_temp3,logbook_temp6 ; Counter 0-4 | 1320 movff logbook_temp3,logbook_temp6 ; Counter 0-4 |
1321 ; incf logbook_temp6,F ; Counter 1-5 | 1321 incf logbook_temp6,F ; Counter 1-5 |
1322 ; movff letter+.25, logbook_temp2 ; No longer used | 1322 movff letter+.25, logbook_temp2 ; No longer used |
1323 ; read_int_eeprom d'27' ; Active flag register | 1323 read_int_eeprom d'27' ; Active flag register |
1324 ;gassetup_sort_store3: | 1324 gassetup_sort_store3: |
1325 ; rrcf logbook_temp2,F ; Shift into Carry | 1325 rrcf logbook_temp2,F ; Shift into Carry |
1326 ; decfsz logbook_temp6,F ; 1-5 x | 1326 decfsz logbook_temp6,F ; 1-5 x |
1327 ; bra gassetup_sort_store3 ; Loop | 1327 bra gassetup_sort_store3 ; Loop |
1328 ;; Carry now holds active bit of gas #logbook_temp3 (0-4) | 1328 ; Carry now holds active bit of gas #logbook_temp3 (0-4) |
1329 ; | 1329 |
1330 ; movff logbook_temp3,logbook_temp6 ; Counter 0-4 | 1330 btfss STATUS,C ; Was Gas active? |
1331 ; incf logbook_temp6,F ; Counter 1-5 | 1331 clrf logbook_temp1 ; No!, Clear change Depth to make it inactive for sorted list! |
1332 ; clrf logbook_temp2 | 1332 |
1333 ;gassetup_sort_store4: | |
1334 ; rlcf logbook_temp2,F ; Shift into logbook_temp2 | |
1335 ; decfsz logbook_temp6,F ; 1-5 x | |
1336 ; bra gassetup_sort_store4 ; Loop | |
1337 ; movf logbook_temp2 | |
1338 ; | |
1339 | |
1340 movf logbook_temp5,W | 1333 movf logbook_temp5,W |
1341 mullw d'4' | 1334 mullw d'4' |
1342 movff PRODL,EEADR ; Point to EEPROM of Gas #logbook_temp5 | 1335 movff PRODL,EEADR ; Point to EEPROM of Gas #logbook_temp5 |
1336 | |
1337 movlw d'90' ; +90 Offset to new... | |
1338 addwf EEADR,F ; ..sorted list! | |
1339 | |
1343 movff POSTINC2,EEDATA ; O2 Default | 1340 movff POSTINC2,EEDATA ; O2 Default |
1344 call write_eeprom ; store in internal EEPROM | 1341 call write_eeprom ; store in internal EEPROM |
1345 incf EEADR,F ; +1 | 1342 incf EEADR,F ; +1 |
1346 movff POSTINC2,EEDATA ; He Default | 1343 movff POSTINC2,EEDATA ; He Default |
1347 call write_eeprom ; store in internal EEPROM | 1344 call write_eeprom ; store in internal EEPROM |