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

Minor cleanups
author JeanDo
date Sun, 31 Jul 2011 13:27:20 +0200
parents 7250ca7c8d24
children c512a868937c
comparison
equal deleted inserted replaced
424:8147c35da3ca 425:a76c5a3e9e96
26 incf_eeprom_address0: 26 incf_eeprom_address0:
27 addwf eeprom_address+0,F ; increase address 27 addwf eeprom_address+0,F ; increase address
28 movlw d'0' 28 movlw d'0'
29 addwfc eeprom_address+1,F 29 addwfc eeprom_address+1,F
30 return 30 return
31 ; btfss eeprom_address+1,7 ; at address 8000? 31
32 ; return ; No, continue
33 ;
34 ; ; Yes, clear eeprom_address:2
35 ; clrf eeprom_address+0 ; Clear eeprom address
36 ; clrf eeprom_address+1
37 ; return ; Done.
38 ;
39 ;============================================================================= 32 ;=============================================================================
40 ; Will decrease eeprom_address:2 with the 8Bit value "ext_ee_temp1" 33 ; Will decrease eeprom_address:2 with the 8Bit value "ext_ee_temp1"
41 34
42 35
43 decf_eeprom_address macro ext_ee_temp1 36 decf_eeprom_address macro ext_ee_temp1
48 decf_eeprom_address0: 41 decf_eeprom_address0:
49 subwf eeprom_address+0,F ; decrease address: do a 16-8bits substract. 42 subwf eeprom_address+0,F ; decrease address: do a 16-8bits substract.
50 movlw d'0' 43 movlw d'0'
51 subwfb eeprom_address+1,F 44 subwfb eeprom_address+1,F
52 return 45 return
53 ;
54 ; btfss eeprom_address+1,7 ; at address 8000?
55 ; return ; No, done.
56 ;
57 ; movlw b'01111111' ; yes, reset highbyte
58 ; movwf eeprom_address+1
59 ; return ; Done.
60 46
61 ;============================================================================= 47 ;=============================================================================
62 48
63 write_external_eeprom: ; data in WREG 49 write_external_eeprom: ; data in WREG
64 ; increase address eeprom_address+0:eeprom_address+1 after write 50 ; increase address eeprom_address+0:eeprom_address+1 after write