📄 lcd16x2.lst
字号:
.module global.c
.text
--- 0000 .dbfile C:\Documents\Software\AVR\lcd16x2\code\global.c
.area data
--- 0000 .dbfile C:\Documents\Software\AVR\lcd16x2\code\global.c
0057 _LCDHeader1::
0057 .blkw 1
.area idata
--- 0000 0D00 .word L1
.area data
--- 0001 .dbfile C:\Documents\Software\AVR\lcd16x2\code\global.c
--- 0001 .dbsym s LCDHeader1 _LCDHeader1 pc
0058 _LCDHeader2::
0058 .blkw 1
.area idata
--- 0001 0400 .word L2
.area data
--- 0002 .dbfile C:\Documents\Software\AVR\lcd16x2\code\global.c
--- 0002 .dbsym s LCDHeader2 _LCDHeader2 pc
.area bss
--- 0000 .dbfile C:\Documents\Software\AVR\lcd16x2\code\global.c
0070 _LCDStatus::
0070 .blkb 1
0070 .dbsym s LCDStatus _LCDStatus c
.area data
--- 0002 .dbfile C:\Documents\Software\AVR\lcd16x2\code\global.c
--- 0002 L2:
--- 0002 .blkb 9
.area idata
--- 0002 4C4344203136783200 .byte 'L,'C,'D,32,49,54,'x,50,0
.area data
--- 0006 .dbfile C:\Documents\Software\AVR\lcd16x2\code\global.c
--- 0006 L1:
--- 0006 .blkb 12
.area idata
--- 0006 48656C6C6F20776F726C6400 .byte 'H,'e,'l,'l,'o,32,'w,'o,'r,'l,'d,0
.area data
--- 000C .dbfile C:\Documents\Software\AVR\lcd16x2\code\global.c
.module initialise.c
.text
--- 0000 .dbfile C:\Documents\Software\AVR\lcd16x2\code\initialise.c
.area text
--- 0000 .dbfile C:\Documents\Software\AVR\lcd16x2\code\initialise.c
--- 0000 .dbfunc s AVRInitialise _AVRInitialise fI
.even
0A68 _AVRInitialise::
0A68 .dbline 15{
; /* ATmega103 initiailise.c file
;
; Author : Robert Stuart
; Company : PDL Industries Ltd
; Date of Creation : 13 April 2000
; Tested : Not yet
;
; Function :
; */
;
; /* include */
; #include "initialise.h"
;
; void AVRInitialise( void )
; {
0A68 .dbline 16
; RuntimeInitialise(); /* initalise these first to start protection */
0A68 940E0C2C call _RuntimeInitialise
0A6A .dbline 18
;
; LCDInitialise();
0A6A 940E0A75 call _LCDInitialise
0A6C .dbline 20
;
; InitWatchdog();
0A6C 940E0A6F call _InitWatchdog
0A6E .dbline 21}
; }
0A6E L1:
0A6E 9508 ret
0A6F .dbfunc s InitWatchdog _InitWatchdog fI
.even
0A6F _InitWatchdog::
0A6F .dbline 24{
;
; void InitWatchdog( void )
; {
0A6F .dbline 25
; WDTCR = BIT(WDP1) | BIT(WDP0);
0A6F E083 ldi R24,3
0A70 BD81 out 0x21,R24
0A71 .dbline 26
; WDTCR |= BIT(WDE);
0A71 B581 in R24,0x21
0A72 6088 ori R24,8
0A73 BD81 out 0x21,R24
0A74 .dbline 27}
; }
0A74 L2:
0A74 9508 ret
.module lcd.c
.text
--- 0000 .dbfile C:\Documents\Software\AVR\lcd16x2\code\lcd.c
.area text
--- 0000 .dbfile C:\Documents\Software\AVR\lcd16x2\code\lcd.c
--- 0000 .dbfunc s LCDInitialise _LCDInitialise fI
.even
0A75 _LCDInitialise::
0A75 .dbline 22{
; /* ATmega103 lcd.c file
;
; Author : Robert Stuart
; Company : PDL Industries Ltd
; Date of Creation : 13 April 2000
; Tested : 13 April 2000
;
; Function :
; This module controls the operation of a 16x2 lcd for the ATmega603/103.
;
; Auto detection of lcd added. Reads the last character of each line to
; determine whether write was successful.
;
; EN timing performed by hardware.
; */
;
; /* include */
; #include "lcd.h"
;
; /* Initialises the lcd */
; void LCDInitialise( void )
; {
0A75 .dbline 23
; MCUCR |= BIT(SRE) | BIT(SRW);
0A75 B785 in R24,0x35
0A76 6C80 ori R24,192
0A77 BF85 out 0x35,R24
0A78 .dbline 24
; LCDCounter = _50MS; /* delay counter for lcd initialisation */
0A78 E382 ldi R24,50
0A79 93800127 sts _LCDCounter,R24
0A7B .dbline 25
; LCDStatus = 0; /* lcd status flags are reset */
0A7B 2422 clr R2
0A7C 922000E0 sts _LCDStatus,R2
0A7E .dbline 26}
; }
0A7E L1:
0A7E 9508 ret
0A7F .dbfunc s LCDPrintf _LCDPrintf fI
; ptr2 -> R20,R21
; ptr1 -> R22,R23
.even
0A7F _LCDPrintf::
0A7F 940E06E9 call push_gset2
0A81 2F42 mov R20,R18
0A82 2F53 mov R21,R19
0A83 2F60 mov R22,R16
0A84 2F71 mov R23,R17
0A85 .dbline 30{
;
; /* global function called when writing to the lcd */
; void LCDPrintf( char *ptr1, char *ptr2 )
; {
0A85 .dbline 31
; if ( !CHECKBIT( LCDStatus, LCD_UPDATE ) )
0A85 902000E0 lds R2,_LCDStatus
0A87 FC21 sbrc R2,1
0A88 C031 rjmp L3
0A89 .dbline 32
; { /* check that lcd is not currently updating */
0A89 .dbline 33
; strcpy( LCDStr1, ptr1 ); /* copy strings into local variables */
0A89 2F26 mov R18,R22
0A8A 2F37 mov R19,R23
0A8B E105 ldi R16,<_LCDStr1
0A8C E011 ldi R17,>_LCDStr1
0A8D 940E09AE call _strcpy
0A8F .dbline 34
; strcpy( LCDStr2, ptr2 );
0A8F 2F24 mov R18,R20
0A90 2F35 mov R19,R21
0A91 E004 ldi R16,<_LCDStr2
0A92 E011 ldi R17,>_LCDStr2
0A93 940E09AE call _strcpy
0A95 .dbline 36
;
; if ( LCDStr1[0] == CHARACTER_NULL ) /* line 1 not updated */
0A95 90200115 lds R2,_LCDStr1
0A97 2022 tst R2
0A98 F459 brne L5
0A99 .dbline 37
; {
0A99 .dbline 38
; strcpy( LCDStr1, LCDStr2 );
0A99 E024 ldi R18,<_LCDStr2
0A9A E031 ldi R19,>_LCDStr2
0A9B E105 ldi R16,<_LCDStr1
0A9C E011 ldi R17,>_LCDStr1
0A9D 940E09AE call _strcpy
0A9F .dbline 39
; LCDLine = LINE2;
0A9F E082 ldi R24,2
0AA0 93800126 sts _LCDLine,R24
0AA2 .dbline 40
; }
0AA2 940C0AB0 jmp L6
0AA4 L5:
0AA4 .dbline 41
; else if ( LCDStr2[0] == CHARACTER_NULL )
0AA4 90200104 lds R2,_LCDStr2
0AA6 2022 tst R2
0AA7 F429 brne L7
0AA8 .dbline 42
; LCDLine = LINE1; /* line 2 not updated */
0AA8 E081 ldi R24,1
0AA9 93800126 sts _LCDLine,R24
0AAB 940C0AB0 jmp L8
0AAD L7:
0AAD .dbline 44
; else
; LCDLine = LINE1_AND_LINE2;
0AAD E083 ldi R24,3
0AAE 93800126 sts _LCDLine,R24
0AB0 L8:
0AB0 L6:
0AB0 .dbline 46
;
; SETBIT( LCDStatus, LCD_UPDATE ); /* set flags */
0AB0 918000E0 lds R24,_LCDStatus
0AB2 6082 ori R24,2
0AB3 938000E0 sts _LCDStatus,R24
0AB5 .dbline 47
; CLEARBIT( LCDStatus, LCD_QUEUE );
0AB5 7E8F andi R24,239
0AB6 938000E0 sts _LCDStatus,R24
0AB8 .dbline 48
; }
0AB8 940C0ACF jmp L4
0ABA L3:
0ABA .dbline 49
; else if ( !CHECKBIT( LCDStatus, LCD_QUEUE ) )
0ABA 902000E0 lds R2,_LCDStatus
0ABC FC24 sbrc R2,4
0ABD C011 rjmp L9
0ABE .dbline 50
; { /* update after existing update has been completed */
0ABE .dbline 51
; strcpy( LCDQueueStr1, ptr1);
0ABE 2F26 mov R18,R22
0ABF 2F37 mov R19,R23
0AC0 EF03 ldi R16,<_LCDQueueStr1
0AC1 E010 ldi R17,>_LCDQueueStr1
0AC2 940E09AE call _strcpy
0AC4 .dbline 52
; strcpy( LCDQueueStr2, ptr2);
0AC4 2F24 mov R18,R20
0AC5 2F35 mov R19,R21
0AC6 EE02 ldi R16,<_LCDQueueStr2
0AC7 E010 ldi R17,>_LCDQueueStr2
0AC8 940E09AE call _strcpy
0ACA .dbline 54
;
; SETBIT( LCDStatus, LCD_QUEUE );
0ACA 918000E0 lds R24,_LCDStatus
0ACC 6180 ori R24,16
0ACD 938000E0 sts _LCDStatus,R24
0ACF .dbline 55
; }
0ACF L9:
0ACF L4:
0ACF .dbline 56}
; }
0ACF L2:
0ACF 940E06F5 call pop_gset2
0AD1 9508 ret
0AD2 .dbsym r ptr2 20 pc
0AD2 .dbsym r ptr1 22 pc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -