comparison code_part1/OSTC_code_asm_part1/menu_logbook.asm @ 425:a76c5a3e9e96

Minor cleanups
author JeanDo
date Sun, 31 Jul 2011 13:27:20 +0200
parents 3abf9d7dafae
children 07f5b0baaa57
comparison
equal deleted inserted replaced
424:8147c35da3ca 425:a76c5a3e9e96
73 movlw d'2' 73 movlw d'2'
74 addwf divemins+0,F 74 addwf divemins+0,F
75 movlw d'0' 75 movlw d'0'
76 addwfc divemins+1,F ; increase 16Bit value, twice 76 addwfc divemins+1,F ; increase 16Bit value, twice
77 77
78 movlw 0xFF 78 incf divemins+1,W ; = 0xFF.. ?
79 cpfseq divemins+1 ; =0xFFFF ? 79 bnz menu_logbook2a ; No.
80 bra menu_logbook2a ; No 80 incf divemins+0,W ; = 0x..FF ?
81 cpfseq divemins+0 ; =0xFFFF ? 81 bz menu_logbook_reset ; Yes: FFFF --> loop.
82 bra menu_logbook2a ; No
83 bra menu_logbook_reset ; yes, restart (if not empty)
84 82
85 menu_logbook2a: 83 menu_logbook2a:
86 movlw 0x00 84 movf divemins+1,W ; = 0x00.. ?
87 cpfseq divemins+1 ; =0x0000 ? 85 bnz menu_logbook2b ; No.
88 bra menu_logbook2b ; No 86 movf divemins+0,W ; = 0x..00 ?
89 cpfseq divemins+0 ; =0x0000 ? 87 bz menu_logbook_reset ; yes, restart (if not empty)
90 bra menu_logbook2b ; No
91 bra menu_logbook_reset ; yes, restart (if not empty)
92 88
93 menu_logbook2b: 89 menu_logbook2b:
94 decf_eeprom_address d'2' ; -2 to eeprom address. 90 decf_eeprom_address d'2' ; -2 to eeprom address.
95 91
96 call I2CREAD ; reads one byte (Slow! Better use Blockread!) 92 call I2CREAD ; reads one byte (Slow! Better use Blockread!)