1 ;-------------------------------------------------------- 2 ; File Created by SDCC : free open source ANSI-C Compiler 3 ; Version 2.9.0 #5416 (Mar 22 2009) (MINGW32) 4 ; This file was generated Tue Oct 12 23:27:17 2010 5 ;-------------------------------------------------------- 6 .module eeprom_io 7 .optsdcc -mmcs51 --model-small 8 9 ;-------------------------------------------------------- 10 ; Public variables in this module 11 ;-------------------------------------------------------- 12 .globl _eeprom_read_PARM_4 13 .globl _eeprom_read_PARM_3 14 .globl _eeprom_read_PARM_2 15 .globl _eeprom_read 16 ;-------------------------------------------------------- 17 ; special function registers 18 ;-------------------------------------------------------- 19 .area RSEG (DATA) 20 ;-------------------------------------------------------- 21 ; special function bits 22 ;-------------------------------------------------------- 23 .area RSEG (DATA) 24 ;-------------------------------------------------------- 25 ; overlayable register banks 26 ;-------------------------------------------------------- 27 .area REG_BANK_0 (REL,OVR,DATA) 0000 28 .ds 8 29 ;-------------------------------------------------------- 30 ; internal ram data 31 ;-------------------------------------------------------- 32 .area DSEG (DATA) 0000 33 _eeprom_read_PARM_2: 0000 34 .ds 1 0001 35 _eeprom_read_PARM_3: 0001 36 .ds 2 0003 37 _eeprom_read_PARM_4: 0003 38 .ds 1 39 ;-------------------------------------------------------- 40 ; overlayable items in internal ram 41 ;-------------------------------------------------------- 42 .area OSEG (OVR,DATA) 43 ;-------------------------------------------------------- 44 ; indirectly addressable internal ram data 45 ;-------------------------------------------------------- 46 .area ISEG (DATA) 47 ;-------------------------------------------------------- 48 ; absolute internal ram data 49 ;-------------------------------------------------------- 50 .area IABS (ABS,DATA) 51 .area IABS (ABS,DATA) 52 ;-------------------------------------------------------- 53 ; bit data 54 ;-------------------------------------------------------- 55 .area BSEG (BIT) 56 ;-------------------------------------------------------- 57 ; paged external ram data 58 ;-------------------------------------------------------- 59 .area PSEG (PAG,XDATA) 60 ;-------------------------------------------------------- 61 ; external ram data 62 ;-------------------------------------------------------- 63 .area XSEG (XDATA) 0000 64 _eeprom_read_cmd_1_1: 0000 65 .ds 1 66 ;-------------------------------------------------------- 67 ; absolute external ram data 68 ;-------------------------------------------------------- 69 .area XABS (ABS,XDATA) 70 ;-------------------------------------------------------- 71 ; external initialized ram data 72 ;-------------------------------------------------------- 73 .area HOME (CODE) 74 .area GSINIT0 (CODE) 75 .area GSINIT1 (CODE) 76 .area GSINIT2 (CODE) 77 .area GSINIT3 (CODE) 78 .area GSINIT4 (CODE) 79 .area GSINIT5 (CODE) 80 .area GSINIT (CODE) 81 .area GSFINAL (CODE) 82 .area CSEG (CODE) 83 ;-------------------------------------------------------- 84 ; global & static initialisations 85 ;-------------------------------------------------------- 86 .area HOME (CODE) 87 .area GSINIT (CODE) 88 .area GSFINAL (CODE) 89 .area GSINIT (CODE) 90 ;-------------------------------------------------------- 91 ; Home 92 ;-------------------------------------------------------- 93 .area HOME (CODE) 94 .area HOME (CODE) 95 ;-------------------------------------------------------- 96 ; code 97 ;-------------------------------------------------------- 98 .area CSEG (CODE) 99 ;------------------------------------------------------------ 100 ;Allocation info for local variables in function 'eeprom_read' 101 ;------------------------------------------------------------ 102 ;eeprom_offset Allocated with name '_eeprom_read_PARM_2' 103 ;buf Allocated with name '_eeprom_read_PARM_3' 104 ;len Allocated with name '_eeprom_read_PARM_4' 105 ;i2c_addr Allocated to registers r2 106 ;cmd Allocated with name '_eeprom_read_cmd_1_1' 107 ;------------------------------------------------------------ 108 ; eeprom_io.c:29: eeprom_read (unsigned char i2c_addr, unsigned char eeprom_offset, 109 ; ----------------------------------------- 110 ; function eeprom_read 111 ; ----------------------------------------- 0000 112 _eeprom_read: 0002 113 ar2 = 0x02 0003 114 ar3 = 0x03 0004 115 ar4 = 0x04 0005 116 ar5 = 0x05 0006 117 ar6 = 0x06 0007 118 ar7 = 0x07 0000 119 ar0 = 0x00 0001 120 ar1 = 0x01 0000 AA 82 121 mov r2,dpl 122 ; eeprom_io.c:36: cmd[0] = eeprom_offset; 0002 90s00r00 123 mov dptr,#_eeprom_read_cmd_1_1 0005 E5*00 124 mov a,_eeprom_read_PARM_2 0007 F0 125 movx @dptr,a 126 ; eeprom_io.c:37: if (!i2c_write(i2c_addr, cmd, 1)) 0008 75*00r00 127 mov _i2c_write_PARM_2,#_eeprom_read_cmd_1_1 000B 75*01s00 128 mov (_i2c_write_PARM_2 + 1),#(_eeprom_read_cmd_1_1 >> 8) 000E 75*00 01 129 mov _i2c_write_PARM_3,#0x01 0011 8A 82 130 mov dpl,r2 0013 C0 02 131 push ar2 0015 12s00r00 132 lcall _i2c_write 0018 E5 82 133 mov a,dpl 001A D0 02 134 pop ar2 135 ; eeprom_io.c:38: return 0; 001C 70 03 136 jnz 00102$ 001E F5 82 137 mov dpl,a 0020 22 138 ret 0021 139 00102$: 140 ; eeprom_io.c:40: return i2c_read(i2c_addr, buf, len); 0021 85*01*00 141 mov _i2c_read_PARM_2,_eeprom_read_PARM_3 0024 85*02*01 142 mov (_i2c_read_PARM_2 + 1),(_eeprom_read_PARM_3 + 1) 0027 85*03*00 143 mov _i2c_read_PARM_3,_eeprom_read_PARM_4 002A 8A 82 144 mov dpl,r2 002C 02s00r00 145 ljmp _i2c_read 146 .area CSEG (CODE) 147 .area CONST (CODE) 148 .area CABS (ABS,CODE)