; .\led.SRC generated from: led.c
; COMPILER INVOKED BY:
; c:\Keil\C51\BIN\C51.EXE led.c DEBUG OBJECTEXTEND PREPRINT SRC(.\led.SRC)
$NOMOD51
NAME LED
P0 DATA 080H
P1 DATA 090H
P2 DATA 0A0H
SERIN BIT 0B0H.5
STCLK BIT 0B0H.6
P3 DATA 0B0H
T0 BIT 0B0H.4
AC BIT 0D0H.6
T1 BIT 0B0H.5
T2 BIT 090H.0
EA BIT 0A8H.7
IE DATA 0A8H
EXF2 BIT 0C8H.6
RD BIT 0B0H.7
ES BIT 0A8H.4
IP DATA 0B8H
RI BIT 098H.0
INT0 BIT 0B0H.2
CY BIT 0D0H.7
TI BIT 098H.1
INT1 BIT 0B0H.3
RCAP2H DATA 0CBH
PS BIT 0B8H.4
SP DATA 081H
T2EX BIT 090H.1
OV BIT 0D0H.2
RCAP2L DATA 0CAH
C_T2 BIT 0C8H.1
WR BIT 0B0H.6
RCLK BIT 0C8H.5
EN154 BIT 0A0H.7
TCLK BIT 0C8H.4
SBUF DATA 099H
PCON DATA 087H
SCON DATA 098H
TMOD DATA 089H
TCON DATA 088H
IE0 BIT 088H.1
IE1 BIT 088H.3
B DATA 0F0H
CP_RL2 BIT 0C8H.0
ACC DATA 0E0H
ET0 BIT 0A8H.1
ET1 BIT 0A8H.3
TF0 BIT 088H.5
ET2 BIT 0A8H.5
TF1 BIT 088H.7
TF2 BIT 0C8H.7
RB8 BIT 098H.2
TH0 DATA 08CH
EX0 BIT 0A8H.0
IT0 BIT 088H.0
TH1 DATA 08DH
TB8 BIT 098H.3
EX1 BIT 0A8H.2
IT1 BIT 088H.2
TH2 DATA 0CDH
P BIT 0D0H.0
SM0 BIT 098H.7
TL0 DATA 08AH
SM1 BIT 098H.6
TL1 DATA 08BH
SM2 BIT 098H.5
TL2 DATA 0CCH
PT0 BIT 0B8H.1
PT1 BIT 0B8H.3
RS0 BIT 0D0H.3
PT2 BIT 0B8H.5
TR0 BIT 088H.4
RS1 BIT 0D0H.4
TR1 BIT 088H.6
TR2 BIT 0C8H.2
PX0 BIT 0B8H.0
PX1 BIT 0B8H.2
DPH DATA 083H
DPL DATA 082H
EXEN2 BIT 0C8H.3
REN BIT 098H.4
T2CON DATA 0C8H
RXD BIT 0B0H.0
TXD BIT 0B0H.1
F0 BIT 0D0H.5
SHCLK BIT 0B0H.7
PSW DATA 0D0H
?PR?main?LED SEGMENT CODE
?PR?trans?LED SEGMENT CODE
?DT?trans?LED SEGMENT DATA OVERLAYABLE
?PR?_display?LED SEGMENT CODE
?DT?_display?LED SEGMENT DATA OVERLAYABLE
?CO?LED SEGMENT CODE
?BA?LED SEGMENT DATA BITADDRESSABLE
EXTRN CODE (?C_STARTUP)
EXTRN CODE (?C?IMUL)
PUBLIC buff
PUBLIC tmp
PUBLIC _display
PUBLIC trans
PUBLIC main
RSEG ?DT?trans?LED
?trans?BYTE:
line?141: DS 1
ORG 1
m1?142: DS 2
ORG 3
m2?143: DS 2
ORG 5
j?144: DS 2
ORG 7
size?145: DS 2
ORG 9
i?146: DS 2
ORG 11
k?147: DS 2
RSEG ?DT?_display?LED
?_display?BYTE:
j?251: DS 1
RSEG ?BA?LED
buff: DS 8
RSEG ?CO?LED
tmp:
DB 0FEH
DB 0FFH
DB 0FEH
DB 0FFH
DB 0FEH
DB 0FFH
DB 0C0H
DB 007H
DB 0DEH
DB 0F7H
DB 0DEH
DB 0F7H
DB 0C0H
DB 007H
DB 0DEH
DB 0F7H
DB 0DEH
DB 0F7H
DB 0DEH
DB 0F7H
DB 0C0H
DB 007H
DB 0DEH
DB 0F7H
DB 0FEH
DB 0FDH
DB 0FEH
DB 0FDH
DB 0FFH
DB 001H
DB 0FFH
DB 0FFH
DB 0FFH
DB 0FFH
DB 0C0H
DB 00FH
DB 0FFH
DB 0DFH
DB 0FFH
DB 0BFH
DB 0FFH
DB 07FH
DB 0FEH
DB 0FFH
DB 0FEH
DB 0FFH
DB 0FEH
DB 0FBH
DB 000H
DB 001H
DB 0FEH
DB 0FFH
D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H
DB 0BFH
DB 0AFH
DB 0FFH
DB 070H
DB 001H
DB 0FFH
DB 0FFH
DB 0F6H
DB 0FFH
DB 0F6H
DB 07FH
DB 0EEH
DB 0FBH
DB 0ECH
DB 001H
DB 0DDH
DB 0FBH
DB 0CBH
DB 0B7H
DB 097H
DB 0BFH
DB 05DH
DB 0AFH
DB 0DCH
DB 0B7H
DB 0DDH
DB 0B7H
DB 0DBH
DB 0BBH
DB 0DBH
DB 0B9H
DB 0D7H
DB 0BBH
DB 0DEH
DB 0BFH
DB 0DFH
DB 07FH
DB 0FFH
DB 0FFH
DB 0FFH
DB 07FH
DB 0FEH
DB 0FFH
DB 008H
DB 003H
DB 069H
DB 0B3H
DB 06AH
DB 0ABH
DB 068H
DB 003H
DB 06BH
DB 01BH
DB 06AH
DB 0ABH
DB 069H
DB 0ABH
DB 00BH
DB 0BBH
DB 060H
DB 001H
DB 0FFH
DB 05FH
DB 0FEH
DB 0EFH
DB 0FDH
DB 0F7H
DB 0FBH
DB 0F9H
DB 0F7H
DB 0FBH
;
; #include
; #include
;
; #define uchar unsigned char
; uchar code tmp[]=
; {
; /*-- 文字: 电 --*/
; /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
; 0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xC0,0x07,0xDE,0xF7,0xDE,0xF7,0xC0,0x07,0xDE,0xF7,
; 0xDE,0xF7,0xDE,0xF7,0xC0,0x07,0xDE,0xF7,0xFE,0xFD,0xFE,0xFD,0xFF,0x01,0xFF,0xFF,
;
; /*-- 文字: 子 --*/
; /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
; 0xFF,0xFF,0xC0,0x0F,0xFF,0xDF,0xFF,0xBF,0xFF,0x7F,0xFE,0xFF,0xFE,0xFF,0xFE,0xFB,
; 0x00,0x01,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFA,0xFF,0xFD,0xFF,
;
; /*-- 文字: 科 --*/
; /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
; 0xF9,0xF7,0x87,0x77,0xF7,0xB7,0xF7,0xB7,0x01,0xF7,0xE7,0x77,0xE3,0xB7,0xD5,0xB7,
; 0xD7,0xF1,0xB7,0x87,0x74,0x77,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,
;
; /*-- 文字: 大 --*/
; /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
; 0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0x00,0x01,0xFE,0xFF,0xFD,0x7F,
; 0xFD,0x7F,0xFD,0xBF,0xFB,0xBF,0xFB,0xDF,0xF7,0xEF,0xEF,0xE7,0xDF,0xF1,0xBF,0xFB,
; /*-- 文字: 欢 --*/
; /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
; 0xFF,0x7F,0xFF,0x7F,0x03,0x7F,0xFA,0x01,0x7A,0xFB,0xB5,0xB7,0xD7,0xBF,0xEF,0xBF,
; 0xE7,0xBF,0xE7,0x9F,0xDB,0x5F,0xDB,0x6F,0xBE,0xE7,0x79,0xF1,0xC7,0xFB,0xFF,0xFF,
;
; /*-- 文字: 迎 --*/
; /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
; 0xBF,0xFF,0xDE,0x7F,0xC9,0x83,0xDB,0xBB,0xFB,0xBB,0xFB,0xBB,0x1B,0xBB,0xDB,0xBB,
; 0xDA,0xBB,0xD9,0xAB,0xDB,0xB7,0xDF,0xBF,0xDF,0xBF,0xAF,0xFF,0x70,0x01,0xFF,0xFF,
;
; /*-- 文字: 你 --*/
; /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
; 0xF6,0xFF,0xF6,0x7F,0xEE,0xFB,0xEC,0x01,0xDD,0xFB,0xCB,0xB7,0x97,0xBF,0x5D,0xAF,
; 0xDC,0xB7,0xDD,0xB7,0xDB,0xBB,0xDB,0xB9,0xD7,0xBB,0xDE,0xBF,0xDF,0x7F,0xFF,0xFF ,
;
; /*-- 文字: 噢 --*/
; /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
; 0xFF,0x7F,0xFE,0xFF,0x08,0x03,0x69,0xB3,0x6A,0xAB,0x68,0x03,0x6B,0x1B,0x6A,0xAB,
; 0x69,0xAB,0x0B,0xBB,0x60,0x01,0xFF,0x5F,0xFE,0xEF,0xFD,0xF7,0xFB,0xF9,0xF7,0xFB
;
; };
;
;
; uchar bdata buff[8];
; sbit SHCLK = P3^7;
; sbit STCLK= P3^6;
; sbit SERIN = P3^5;
; sbit EN154 = P2^7;
;
; void display(uchar line);
; void trans(void);
; void delay(void);
;
; void main(void)
RSEG ?PR?main?LED
main:
USING 0
; SOURCE LINE # 60
; {
; SOURCE LINE # 61
; trans();
; SOURCE LINE # 62
LJMP trans
; END OF main
; }
;
; void trans(void)
RSEG ?PR?trans?LED
trans:
USING 0
; SOURCE LINE # 65
; {
; SOURCE LINE # 66
; uchar data line2,line;
; unsigned int data m1,m2,j;
; unsigned int data size = sizeof(tmp) - 31;
; SOURCE LINE # 69
MOV size?145,#00H
MOV size?145+01H,#0E1H
; unsigned int data i = 1;
; SOURCE LINE # 70
MOV i?146,#00H
MOV i?146+01H,#01H
; unsigned int k = 0;
; SOURCE LINE # 71
CLR A
MOV k?147,A
MOV k?147+01H,A
?C0002:
; signed char num ;
; //数据宽度的大小很重要,这里i的宽度就可能影响程序的执行
;
; while ( k++ < sizeof(tmp))
; SOURCE LINE # 75
INC k?147+01H
MOV A,k?147+01H
MOV R6,k?147
JNZ ?C0023
INC k?147
?C0023:
CLR C
MOV A,R6
SUBB A,#01H
JC $ + 5H
LJMP ?C0018
; {
; SOURCE LINE # 76
; for(line = 0; line < 16; ++line )
; SOURCE LINE # 77
CLR A
MOV line?141,A
?C0004:
; { num = i/8;
; SOURCE LINE # 78
MOV A,i?146+01H
MOV R6,i?146
MOV R0,#03H
?C0024:
XCH A,R6
CLR C
RRC A
XCH A,R6
RRC A
DJNZ R0,?C0024
;---- Variable 'num?148' assigned to Register 'R3' ----
MOV R3,A
; line2 = 2 * line;
; SOURCE LINE # 79
MOV A,line?141
ADD A,ACC
;---- Variable 'line2?140' assigned to Register 'R2' ----
MOV R2,A
; if(num < 8)
; SOURCE LINE # 80
CLR C
MOV A,R3
XRL A,#080H
SUBB A,#088H
JNC ?C0007
; buff[num] = ((tmp[line2]>> ((num + 1) * 8 - i)) | buff[num]) ;
; SOURCE LINE # 81
MOV A,R3
INC A
MOV B,#08H
MUL AB
CLR C
SUBB A,i?146+01H
MOV R7,A
MOV A,R2
MOV DPTR,#tmp
MOVC A,@A+DPTR
MOV R6,A
MOV R0,AR7
INC R0
SJMP ?C0026
?C0025:
CLR C
RRC A
?C0026:
DJNZ R0,?C0025
MOV R7,A
MOV A,#LOW (buff)
ADD A,R3
MOV R0,A
MOV A,@R0
ORL A,R7
MOV @R0,A
?C0007:
; for(--num,j=0; num >= 0 ; --num,++j)
; SOURCE LINE # 82
DEC R3
CLR A
MOV j?144,A
MOV j?144+01H,A
?C0008:
CLR C
MOV A,R3
XRL A,#080H
SUBB A,#080H
JNC $ + 5H
LJMP ?C0009
; {
; SOURCE LINE # 83
; if (num >= 8) { j = (num - 7); num =7; }
; SOURCE LINE # 84
MOV A,R3
XRL A,#080H
SUBB A,#088H
JC ?C0011
MOV A,R3
MOV R7,A
RLC A
SUBB A,ACC
MOV R6,A
MOV A,R7
ADD A,#0F9H
MOV j?144+01H,A
MOV A,R6
ADDC A,#0FFH
MOV j?144,A
MOV R3,#07H
?C0011:
; m1 = (j/2)*30 + j;
; SOURCE LINE # 85
MOV A,j?144
CLR C
RRC A
MOV R6,A
MOV A,j?144+01H
RRC A
MOV R7,A
MOV R4,#00H
MOV R5,#01EH
LCALL ?C?IMUL
MOV A,j?144+01H
ADD A,R7
MOV m1?142+01H,A
MOV A,j?144
ADDC A,R6
MOV m1?142,A
; m2 = ((j+1) / 2) * 30 +(j+1);
; SOURCE LINE # 86
MOV A,j?144+01H
ADD A,#01H
MOV R7,A
CLR A
ADDC A,j?144
CLR C
RRC A
MOV R6,A
MOV A,R7
RRC A
MOV R7,A
LCALL ?C?IMUL
MOV A,j?144+01H
ADD A,#01H
XCH A,R5
CLR A
ADDC A,j?144
XCH A,R5
ADD A,R7
MOV m2?143+01H,A
MOV A,R5
ADDC A,R6
MOV m2?143,A
; if(m2 > size ) m2 -= sizeof(tmp) ;
; SOURCE LINE # 87
SETB C
MOV A,m2?143+01H
SUBB A,size?145+01H
MOV A,m2?143
SUBB A,size?145
JC ?C0012
CLR A
ADD A,m2?143+01H
MOV m2?143+01H,A
MOV A,#0FFH
ADDC A,m2?143
MOV m2?143,A
?C0012:
; if(m1 > size ) m1 -= sizeof(tmp) ;
; SOURCE LINE # 88
SETB C
MOV A,m1?142+01H
SUBB A,size?145+01H
MOV A,m1?142
SUBB A,size?145
JC ?C0013
CLR A
ADD A,m1?142+01H
MOV m1?142+01H,A
MOV A,#0FFH
ADDC A,m1?142
MOV m1?142,A
?C0013:
; buff[num] = (tmp[line2+m1] >((num+j)*8-i+16));
; SOURCE LINE # 89
MOV A,j?144+01H
ADD A,R3
MOV B,#08H
MUL AB
MOV R7,A
MOV R6,i?146+01H
CLR C
MOV A,R6
SUBB A,R7
ADD A,#0F8H
MOV R5,A
MOV A,m1?142+01H
ADD A,R2
MOV DPTR,#tmp
MOVC A,@A+DPTR
MOV R4,A
MOV R0,AR5
INC R0
SJMP ?C0028
?C0027:
CLR C
RLC A
?C0028:
DJNZ R0,?C0027
MOV R5,A
CLR C
MOV A,R7
SUBB A,R6
ADD A,#010H
MOV R7,A
MOV A,m2?143+01H
ADD A,R2
MOV DPTR,#tmp
MOVC A,@A+DPTR
MOV R6,A
MOV R0,AR7
INC R0
SJMP ?C0030
?C0029:
CLR C
RRC A
?C0030:
DJNZ R0,?C0029
ORL A,R5
MOV R7,A
MOV A,#LOW (buff)
ADD A,R3
MOV R0,A
MOV @R0,AR7
; }
; SOURCE LINE # 90
DEC R3
INC j?144+01H
MOV A,j?144+01H
JZ $ + 5H
LJMP ?C0008
INC j?144
?C0031:
LJMP ?C0008
?C0009:
; display(16-line);
; SOURCE LINE # 91
CLR C
MOV A,#010H
SUBB A,line?141
MOV R7,A
LCALL _display
; for(num = 8; num != 0; --num) buff[num-1] = 0xff;
; SOURCE LINE # 92
MOV R3,#08H
?C0014:
MOV A,#LOW (buff+0FFFFH)
ADD A,R3
MOV R0,A
MOV @R0,#0FFH
DJNZ R3,?C0014
; }
; SOURCE LINE # 93
?C0006:
INC line?141
MOV A,line?141
CLR C
SUBB A,#010H
JNC $ + 5H
LJMP ?C0004
?C0005:
; if(i > (sizeof(tmp) + 63)) i = 0x40;
; SOURCE LINE # 94
SETB C
MOV A,i?146+01H
SUBB A,#03FH
MOV A,i?146
SUBB A,#01H
JC ?C0017
MOV i?146,#00H
MOV i?146+01H,#040H
?C0017:
; ++i;
; SOURCE LINE # 95
INC i?146+01H
MOV A,i?146+01H
JZ $ + 5H
LJMP ?C0002
INC i?146
?C0032:
; }
; SOURCE LINE # 96
LJMP ?C0002
;
; }
; SOURCE LINE # 98
?C0018:
RET
; END OF trans
;
;
; void display(uchar line)
RSEG ?PR?_display?LED
_display:
USING 0
; SOURCE LINE # 101
;---- Variable 'line?249' assigned to Register 'R7' ----
; {
; SOURCE LINE # 102
; uchar i = 8;
; SOURCE LINE # 103
;---- Variable 'i?250' assigned to Register 'R6' ----
MOV R6,#08H
; uchar j = 0;
; SOURCE LINE # 104
CLR A
MOV j?251,A
; EN154 = 1;
; SOURCE LINE # 105
SETB EN154
; STCLK = 0;
; SOURCE LINE # 106
CLR STCLK
;
; for(i = 8; i!=0; --i)
; SOURCE LINE # 108
?C0019:
; {
; SOURCE LINE # 109
; ACC = buff[i-1];
; SOURCE LINE # 110
MOV A,#LOW (buff+0FFFFH)
ADD A,R6
MOV R0,A
MOV A,@R0
; #pragma asm
; MOV R1,#8
MOV R1,#8
; PUSHONE:
PUSHONE:
; CLR P3.7
CLR P3.7
; RLC A
RLC A
; MOV P3.5, C
MOV P3.5, C
; SETB P3.7
SETB P3.7
; DJNZ R1,PUSHONE
DJNZ R1,PUSHONE
; #pragma endasm
; }
; SOURCE LINE # 120
DJNZ R6,?C0019
?C0020:
;
; STCLK = 1;
; SOURCE LINE # 122
SETB STCLK
;
; P2 = (16-line) * 8 ;
; SOURCE LINE # 124
CLR C
MOV A,#010H
SUBB A,R7
MOV B,#08H
MUL AB
MOV P2,A
; }
; SOURCE LINE # 125
RET
; END OF _display
END