Codul de iniţializare pentru variabilele din secţiunea idata

by donpedro

MPASM 03.20.02 Released IDATA.ASM
6-17-2003 13:43:38 PAGE 1

LOC OBJECT CODE LINE SOURCE TEXT
VALUE

00001 ;codul de initializare IDATA(lungime 67 words)
00002
00003 ;se apeleaza in secventa de initializare:
00004 ; lcall init_ram
00005 ; pagesel $
00006
00007 ;in fisierul .lkr se declara codul (exemplu pt. 16f73.lkr):
00008 ;SECTION NAME=.copy_idata ROM=page1
00009 ;si variabilele folosite (sunt overlay):
00010 ;SECTION NAME=VARIABLES RAM=gpr1
00011 ;
00012
00000000 00013 indf equ 0x00
00000002 00014 pcl equ 0x02
00000003 00015 status equ 0x03
00000004 00016 fsr equ 0x04
0000000A 00017 pclath equ 0x0a
00000002 00018 z equ 0x02
00000000 00019 c equ 0x00
00000007 00020 irp equ 0x07
00021
0000 00022 extern _cinit
00023
00024 VARIABLES udata_ovr
00025
0000 00026 nr res 2
0002 00027 rom res 2
0004 00028 ram res 2
0006 00029 size res 2
0008 00030 crt res 2
000A 00031 prm res 1
00032
00033 .copy_idata code
00034
0000 00035 rom_ram:
0000 2??? 00036 goto @2
0001 08?? 00037 @1: movf crt+1,w
0002 008A 00038 movwf pclath
0003 08?? 00039 movf crt,w
0004 0082 00040 movwf pcl
0005 2??? 00041 @2: call @1
0006 ???? 00042 pagesel $
0007 00?? 00043 movwf prm
0008 3001 00044 movlw 1
0009 07?? 00045 addwf crt,f
000A 1803 00046 btfsc status,c
000B 0A?? 00047 incf crt+1,f
000C 08?? 00048 movf prm,w
000D 0008 00049 return
000E 00050 init_ram:
000E 30?? 00051 movlw low _cinit
000F ???? ???? 00052 banksel crt
0011 00?? 00053 movwf crt

MPASM 03.20.02 Released IDATA.ASM
6-17-2003 13:43:38 PAGE 2

LOC OBJECT CODE LINE SOURCE TEXT
VALUE

0012 30?? 00054 movlw high _cinit
0013 00?? 00055 movwf crt+1
0014 2??? 00056 call rom_ram
0015 00?? 00057 movwf nr
0016 08?? 00058 movf nr,f
0017 2??? 00059 call rom_ram
0018 00?? 00060 movwf nr+1
0019 07?? 00061 addwf nr,w
001A 1903 00062 btfsc status,z
001B 0008 00063 return
001C 00064 cit_tbl:
001C 2??? 00065 call rom_ram
001D 00?? 00066 movwf rom
001E 2??? 00067 call rom_ram
001F 00?? 00068 movwf rom+1
0020 2??? 00069 call rom_ram
0021 00?? 00070 movwf ram
0022 2??? 00071 call rom_ram
0023 00?? 00072 movwf ram+1
0024 2??? 00073 call rom_ram
0025 00?? 00074 movwf size
0026 2??? 00075 call rom_ram
0027 00?? 00076 movwf size+1
0028 00077 copy_data:
0028 08?? 00078 movf ram,w
0029 0084 00079 movwf fsr
002A 2??? 00080 goto @@2
002B 08?? 00081 @@1: movf 1+rom,w
002C 008A 00082 movwf pclath
002D 08?? 00083 movf rom,w
002E 0082 00084 movwf pcl
002F 2??? 00085 @@2: call @@1
0030 ???? 00086 pagesel $
0031 08?? 00087 movf ram+1,f
0032 1D03 00088 btfss status,z
0033 1783 00089 bsf status,irp
0034 1903 00090 btfsc status,z
0035 1383 00091 bcf status,irp
0036 0080 00092 movwf indf;scrie data in RAM
0037 3001 00093 movlw 1
0038 07?? 00094 addwf ram,f
0039 1803 00095 btfsc status,c
003A 0A?? 00096 incf ram+1,f
003B 07?? 00097 addwf rom,f
003C 1803 00098 btfsc status,c
003D 0A?? 00099 incf rom+1,f
003E 0B?? 00100 decfsz size,f
003F 2??? 00101 goto copy_data;gata tabel
0040 0B?? 00102 decfsz nr,f
0041 2??? 00103 goto cit_tbl;gata tabele
0042 0008 00104 return
0000 00105 global init_ram
00106

MPASM 03.20.02 Released IDATA.ASM
6-17-2003 13:43:38 PAGE 3

LOC OBJECT CODE LINE SOURCE TEXT
VALUE

00107 end

MPASM 03.20.02 Released IDATA.ASM
6-17-2003 13:43:38 PAGE 4

SYMBOL TABLE
LABEL VALUE

@1 00000001
@2 00000005
@@1 0000002B
@@2 0000002F
_.copy_idata_0006 00000006
_.copy_idata_0030 00000030
__16F73 00000001
_cinit 00000000
c 00000000
cit_tbl 0000001C
copy_data 00000028
crt 00000008
fsr 00000004
indf 00000000
init_ram 0000000E
irp 00000007
nr 00000000
pcl 00000002
pclath 0000000A
prm 0000000A
ram 00000004
rom 00000002
rom_ram 00000000
size 00000006
status 00000003
z 00000002

Errors : 0
Warnings : 0 reported, 0 suppressed
Messages : 0 reported, 0 suppressed

S-ar putea să vă placă și

Adaugă un comentariu