📄 remote.s
字号:
.module remote.c
.area text(rom, con, rel)
.dbfile C:\DATA\MP3\Player\Code\remote.c
.dbfunc e InitRemote _InitRemote fV
.even
_InitRemote::
.dbline -1
.dbline 22
; #include <iom128v.h>
; #include "remote.h"
; #include "vs1001.h"
; #include "fat.h"
; #include "generic.h"
; #include <string.h>
; #include <stdio.h>
; #include <macros.h>
;
; //******************************************************************
; //* Global Variable
; //******************************************************************
; extern unsigned char Key;
; extern unsigned char RemoteTextLine[5][40];
;
; //******************************************************************
; //* INITIALIZE HARDWARE FOR SERIAL INTERFACE
; //*
; //*
; //******************************************************************
; void InitRemote(void)
; {
.dbline 23
; UCSR1B = 0x00; //disable while setting baud rate
clr R2
sts 154,R2
.dbline 24
; UCSR1A = 0x00;
sts 155,R2
.dbline 25
; UCSR1C = 0x8e; // Asyn,NoParity,2StopBit,8Bit,
ldi R24,142
sts 157,R24
.dbline 26
; UBRR1H = 0x01; // set baud rate hi
ldi R24,1
sts 152,R24
.dbline 27
; UBRR1L = 0xa0; // set baud rate low for 2400 at 16Mhz
ldi R24,160
sts 153,R24
.dbline 28
; UCSR1B = 0x98; // Rx enable Tx Enable
ldi R24,152
sts 154,R24
.dbline -2
.dbline 29
; }
L1:
.dbline 0 ; func end
ret
.dbend
.dbfunc e RemoteSendLine _RemoteSendLine fV
; text -> y+4
; LinePtr -> R20
.even
_RemoteSendLine::
xcall push_gset1
mov R20,R16
sbiw R28,63
sbiw R28,63
sbiw R28,63
sbiw R28,63
sbiw R28,7 ; offset = 259
.dbline -1
.dbline 37
;
; //******************************************************************
; //* void RemoteSendLine(unsigned char LinePtr)
; //*
; //*
; //******************************************************************
; void RemoteSendLine(unsigned char LinePtr)
; {
.dbline 40
; char text[255];
;
; sprintf(&text[0],"%c%s\0",0x81+LinePtr,&RemoteTextLine[LinePtr][0]);
ldi R24,40
mul R24,R20
movw R2,R0
ldi R24,<_RemoteTextLine
ldi R25,>_RemoteTextLine
add R2,R24
adc R3,R25
std y+3,R3
std y+2,R2
mov R24,R20
clr R25
subi R24,127 ; offset = 129
sbci R25,255
std y+1,R25
std y+0,R24
ldi R18,<L3
ldi R19,>L3
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 41
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline 43
;
; sprintf(&text[0],"%c\0",0xa1+LinePtr);
mov R24,R20
clr R25
subi R24,95 ; offset = 161
sbci R25,255
std y+1,R25
std y+0,R24
ldi R18,<L4
ldi R19,>L4
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 44
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline -2
.dbline 45
; }
L2:
adiw R28,63
adiw R28,63
adiw R28,63
adiw R28,63
adiw R28,7 ; offset = 259
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym l text 4 A[255:255]c
.dbsym r LinePtr 20 c
.dbend
.dbfunc e RemoteSendScreen _RemoteSendScreen fV
; text -> y+4
; LinePtr -> R20
; Header -> R22
.even
_RemoteSendScreen::
xcall push_gset2
mov R20,R18
mov R22,R16
sbiw R28,63
sbiw R28,63
sbiw R28,63
sbiw R28,63
sbiw R28,7 ; offset = 259
.dbline -1
.dbline 53
;
; //******************************************************************
; //* void RemoteSendScreen(unsigned char Header,unsigned char LinePtr)
; //*
; //*
; //******************************************************************
; void RemoteSendScreen(unsigned char Header,unsigned char LinePtr)
; {
.dbline 56
; char text[255];
;
; sprintf(&text[0],"%c\0",0x80); // Clear Screen
ldi R24,128
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L4
ldi R19,>L4
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 57
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline 59
;
; if (Header == DIR) sprintf(&text[0],"%c\0",0x91);
cpi R22,1
brne L6
.dbline 59
ldi R24,145
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L4
ldi R19,>L4
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
L6:
.dbline 60
; if (Header == FILE) sprintf(&text[0],"%c\0",0x90);
tst R22
brne L8
.dbline 60
ldi R24,144
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L4
ldi R19,>L4
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
L8:
.dbline 61
; if (Header == PLAY) sprintf(&text[0],"%c\0",0x92);
cpi R22,2
brne L10
.dbline 61
ldi R24,146
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L4
ldi R19,>L4
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
L10:
.dbline 62
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline 64
;
; sprintf(&text[0],"%c%s\0",0x81,&RemoteTextLine[0][0]);
ldi R24,<_RemoteTextLine
ldi R25,>_RemoteTextLine
std y+3,R25
std y+2,R24
ldi R24,129
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L3
ldi R19,>L3
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 65
; if (LinePtr != 0) text[14] = 0x00;
tst R20
breq L12
.dbline 65
clr R2
std y+18,R2
L12:
.dbline 66
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline 68
;
; sprintf(&text[0],"%c%s\0",0x82,&RemoteTextLine[1][0]);
ldi R24,<_RemoteTextLine+40
ldi R25,>_RemoteTextLine+40
std y+3,R25
std y+2,R24
ldi R24,130
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L3
ldi R19,>L3
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 69
; if (LinePtr != 1) text[14] = 0x00;
cpi R20,1
breq L16
.dbline 69
clr R2
std y+18,R2
L16:
.dbline 70
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline 72
;
; sprintf(&text[0],"%c%s\0",0x83,&RemoteTextLine[2][0]) ;
ldi R24,<_RemoteTextLine+80
ldi R25,>_RemoteTextLine+80
std y+3,R25
std y+2,R24
ldi R24,131
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L3
ldi R19,>L3
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 73
; if (LinePtr != 2) text[14] = 0x00;
cpi R20,2
breq L20
.dbline 73
clr R2
std y+18,R2
L20:
.dbline 74
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline 76
;
; sprintf(&text[0],"%c%s\0",0x84,&RemoteTextLine[3][0]);
ldi R24,<_RemoteTextLine+120
ldi R25,>_RemoteTextLine+120
std y+3,R25
std y+2,R24
ldi R24,132
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L3
ldi R19,>L3
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 77
; if (LinePtr != 3) text[14] = 0x00;
cpi R20,3
breq L24
.dbline 77
clr R2
std y+18,R2
L24:
.dbline 78
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline 80
;
; sprintf(&text[0],"%c%s\0",0x85,&RemoteTextLine[4][0]) ;
ldi R24,<_RemoteTextLine+160
ldi R25,>_RemoteTextLine+160
std y+3,R25
std y+2,R24
ldi R24,133
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L3
ldi R19,>L3
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 81
; if (LinePtr != 4) text[14] = 0x00;
cpi R20,4
breq L28
.dbline 81
clr R2
std y+18,R2
L28:
.dbline 82
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline 84
;
; sprintf(&text[0],"%c\0",0xa1+LinePtr);
mov R24,R20
clr R25
subi R24,95 ; offset = 161
sbci R25,255
std y+1,R25
std y+0,R24
ldi R18,<L4
ldi R19,>L4
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 85
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline 87
;
; sprintf(&text[0],"%c\0",0xb0);
ldi R24,176
ldi R25,0
std y+1,R25
std y+0,R24
ldi R18,<L4
ldi R19,>L4
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _sprintf
.dbline 88
; SendRemote(&text[0]);
movw R16,R28
subi R16,252 ; offset = 4
sbci R17,255
xcall _SendRemote
.dbline -2
.dbline 89
; }
L5:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -