📄 reclama_fct3.s
字号:
.module reclama_fct3.c
.area text(rom, con, rel)
.dbfile C:\tempAVR\RECLAM~1\reclama_fct3.c
.dbfunc e send_octetA _send_octetA fV
.dbstruct 0 8 octet
.dbfield 0 a A[8:8]c
.dbend
; i -> R20
; oct -> R10,R11
.even
_send_octetA::
rcall push_xgset300C
movw R10,R16
.dbline -1
.dbline 12
; #include <string.h>
; #include <iom8v.h>
; #include <EEPROM.h>
; #include "reclama_fct3.h"
; #include "delay_fct3.h"
; #define zero 0x00
; #define unu 0x01
; #define doi 0x02
; #define trei 0x03
;
; /* ********************** */
; void send_octetA(struct octet oct){
.dbline 14
; uc_8 i;
; for(i=0;i<8;i++) send_bitA(oct.a[i]);
clr R20
rjmp L5
L2:
.dbline 14
mov R30,R20
clr R31
add R30,R10
adc R31,R11
ldd R16,z+0
rcall _send_bitA
L3:
.dbline 14
inc R20
L5:
.dbline 14
cpi R20,8
brlo L2
X0:
.dbline -2
L1:
.dbline 0 ; func end
rjmp pop_xgset300C
.dbsym r i 20 c
.dbsym r oct 10 pS[octet]
.dbend
.dbfunc e send_octetB _send_octetB fV
; i -> R20
; oct -> R10,R11
.even
_send_octetB::
rcall push_xgset300C
movw R10,R16
.dbline -1
.dbline 17
; }
; /* ********************** */
; void send_octetB(struct octet oct){
.dbline 19
; uc_8 i;
; for(i=0;i<8;i++) send_bitB(oct.a[i]);
clr R20
rjmp L10
L7:
.dbline 19
mov R30,R20
clr R31
add R30,R10
adc R31,R11
ldd R16,z+0
rcall _send_bitB
L8:
.dbline 19
inc R20
L10:
.dbline 19
cpi R20,8
brlo L7
X1:
.dbline -2
L6:
.dbline 0 ; func end
rjmp pop_xgset300C
.dbsym r i 20 c
.dbsym r oct 10 pS[octet]
.dbend
.dbfunc e send_octetAB _send_octetAB fV
; i -> <dead>
; h -> R14
; g -> R20
; f -> R22
; e -> R12
; d -> R10
; c -> y+2
; b -> y+1
; a -> y+0
; oct -> R14,R15
.even
_send_octetAB::
rcall push_xgsetF0FC
movw R14,R16
sbiw R28,3
.dbline -1
.dbline 22
; }
; /* ********************** */
; void send_octetAB(struct octet oct){
.dbline 25
; uc_8 a,b,c,d,e,f,g,h,i;
;
; a=oct.a[0];b=oct.a[1];c=oct.a[2];d=oct.a[3];
movw R30,R14
ldd R2,z+0
std y+0,R2
.dbline 25
ldd R2,z+1
std y+1,R2
.dbline 25
ldd R2,z+2
std y+2,R2
.dbline 25
ldd R10,z+3
.dbline 26
; e=oct.a[4];f=oct.a[5];g=oct.a[6];h=oct.a[7];
ldd R12,z+4
.dbline 26
ldd R22,z+5
.dbline 26
ldd R20,z+6
.dbline 26
ldd R14,z+7
.dbline 28
;
; send_bitAB(a,a);
ldd R18,y+0
mov R16,R18
rcall _send_bitAB
.dbline 29
; send_bitAB(c,g);
mov R18,R20
ldd R16,y+2
rcall _send_bitAB
.dbline 30
; send_bitAB(d,g);
mov R18,R20
mov R16,R10
rcall _send_bitAB
.dbline 31
; send_bitAB(d,f);
mov R18,R22
mov R16,R10
rcall _send_bitAB
.dbline 32
; send_bitAB(f,e);
mov R18,R12
mov R16,R22
rcall _send_bitAB
.dbline 33
; send_bitAB(c,h);
mov R18,R14
ldd R16,y+2
rcall _send_bitAB
.dbline 34
; send_bitAB(b,h);
mov R18,R14
ldd R16,y+1
rcall _send_bitAB
.dbline 35
; send_bitAB(b,e);
mov R18,R12
ldd R16,y+1
rcall _send_bitAB
.dbline 36
; send_bitAB(a,a);
ldd R18,y+0
mov R16,R18
rcall _send_bitAB
.dbline 37
; send_bitAB(c,g);
mov R18,R20
ldd R16,y+2
rcall _send_bitAB
.dbline 38
; send_bitAB(d,g);
mov R18,R20
mov R16,R10
rcall _send_bitAB
.dbline 39
; send_bitAB(d,f);
mov R18,R22
mov R16,R10
rcall _send_bitAB
.dbline 40
; send_bitAB(f,e);
mov R18,R12
mov R16,R22
rcall _send_bitAB
.dbline 41
; send_bitAB(c,h);
mov R18,R14
ldd R16,y+2
rcall _send_bitAB
.dbline 42
; send_bitAB(b,h);
mov R18,R14
ldd R16,y+1
rcall _send_bitAB
.dbline 43
; send_bitAB(b,e);
mov R18,R12
ldd R16,y+1
rcall _send_bitAB
.dbline -2
L11:
.dbline 0 ; func end
adiw R28,3
rjmp pop_xgsetF0FC
.dbsym l i 1 c
.dbsym r h 14 c
.dbsym r g 20 c
.dbsym r f 22 c
.dbsym r e 12 c
.dbsym r d 10 c
.dbsym l c 2 c
.dbsym l b 1 c
.dbsym l a 0 c
.dbsym r oct 14 pS[octet]
.dbend
.dbfunc e send_bitA _send_bitA fV
; b -> R10
.even
_send_bitA::
rcall push_xgset300C
mov R10,R16
.dbline -1
.dbline 47
;
; }
; /* ********************** */
; void send_bitA(uc_8 b){
.dbline 48
; switch(b){
mov R20,R10
clr R21
cpi R20,0
cpc R20,R21
breq L16
X2:
cpi R20,1
ldi R30,0
cpc R21,R30
breq L17
X3:
rjmp L13
L16:
.dbline 49
; case 0: PORTB|=(0<<PORTB0);clock();PORTB&=~(0<<PORTB0);break;//clock(); break;
in R2,0x18
out 0x18,R2
.dbline 49
rcall _clock
.dbline 49
in R24,0x18
andi R24,255
out 0x18,R24
.dbline 49
rjmp L14
L17:
.dbline 50
; case 1: PORTB|=(1<<PORTB0);clock();PORTB&=~(1<<PORTB0);break;
sbi 0x18,0
.dbline 50
rcall _clock
.dbline 50
cbi 0x18,0
.dbline 50
L13:
L14:
.dbline -2
L12:
.dbline 0 ; func end
rjmp pop_xgset300C
.dbsym r b 10 c
.dbend
.dbfunc e send_bitB _send_bitB fV
; b -> R10
.even
_send_bitB::
rcall push_xgset300C
mov R10,R16
.dbline -1
.dbline 54
; }
; }
; /* ********************** */
; void send_bitB(uc_8 b){
.dbline 55
; switch(b){
mov R20,R10
clr R21
cpi R20,0
cpc R20,R21
breq L22
X4:
cpi R20,1
ldi R30,0
cpc R21,R30
breq L23
X5:
rjmp L19
L22:
.dbline 56
; case 0: PORTB|=(0<<PORTB1);clock();PORTB&=~(0<<PORTB1);break;//clock(); break;
in R2,0x18
out 0x18,R2
.dbline 56
rcall _clock
.dbline 56
in R24,0x18
andi R24,255
out 0x18,R24
.dbline 56
rjmp L20
L23:
.dbline 57
; case 1: PORTB|=(1<<PORTB1);clock();PORTB&=~(1<<PORTB1);break;
sbi 0x18,1
.dbline 57
rcall _clock
.dbline 57
cbi 0x18,1
.dbline 57
L19:
L20:
.dbline -2
L18:
.dbline 0 ; func end
rjmp pop_xgset300C
.dbsym r b 10 c
.dbend
.dbfunc e send_bitAB _send_bitAB fV
; b -> R20
; a -> R22
.even
_send_bitAB::
rcall push_xgsetF03C
mov R20,R18
mov R22,R16
.dbline -1
.dbline 61
; }
; }
; /* ********************** */
; void send_bitAB(uc_8 a,uc_8 b){
.dbline 63
;
; if(a==0&b==0) {PORTB|=zero;clock();PORTB&=~zero;}
tst R22
brne L27
X6:
ldi R24,1
ldi R25,0
movw R12,R24
rjmp L28
L27:
clr R12
clr R13
L28:
tst R20
brne L29
X7:
ldi R24,1
ldi R25,0
movw R10,R24
rjmp L30
L29:
clr R10
clr R11
L30:
movw R2,R12
and R2,R10
and R3,R11
tst R2
brne X8
tst R3
breq L25
X8:
.dbline 63
.dbline 63
in R2,0x18
out 0x18,R2
.dbline 63
rcall _clock
.dbline 63
in R24,0x18
andi R24,255
out 0x18,R24
.dbline 63
L25:
.dbline 64
; if(a==0&b==1) {PORTB|=unu;clock();PORTB&=~unu;}
tst R22
brne L33
X9:
ldi R24,1
ldi R25,0
movw R12,R24
rjmp L34
L33:
clr R12
clr R13
L34:
cpi R20,1
brne L35
X10:
ldi R24,1
ldi R25,0
movw R10,R24
rjmp L36
L35:
clr R10
clr R11
L36:
movw R2,R12
and R2,R10
and R3,R11
tst R2
brne X11
tst R3
breq L31
X11:
.dbline 64
.dbline 64
sbi 0x18,0
.dbline 64
rcall _clock
.dbline 64
cbi 0x18,0
.dbline 64
L31:
.dbline 65
; if(a==1&b==0) {PORTB|=doi;clock();PORTB&=~doi;}
cpi R22,1
brne L39
X12:
ldi R24,1
ldi R25,0
movw R12,R24
rjmp L40
L39:
clr R12
clr R13
L40:
tst R20
brne L41
X13:
ldi R24,1
ldi R25,0
movw R10,R24
rjmp L42
L41:
clr R10
clr R11
L42:
movw R2,R12
and R2,R10
and R3,R11
tst R2
brne X14
tst R3
breq L37
X14:
.dbline 65
.dbline 65
sbi 0x18,1
.dbline 65
rcall _clock
.dbline 65
cbi 0x18,1
.dbline 65
L37:
.dbline 66
; if(a==1&b==1) {PORTB|=trei;clock();PORTB&=~trei;}
cpi R22,1
brne L45
X15:
ldi R22,1
ldi R23,0
rjmp L46
L45:
clr R22
clr R23
L46:
cpi R20,1
brne L47
X16:
ldi R20,1
ldi R21,0
rjmp L48
L47:
clr R20
clr R21
L48:
movw R2,R22
and R2,R20
and R3,R21
tst R2
brne X17
tst R3
breq L43
X17:
.dbline 66
.dbline 66
in R24,0x18
ori R24,3
out 0x18,R24
.dbline 66
rcall _clock
.dbline 66
in R24,0x18
andi R24,252
out 0x18,R24
.dbline 66
L43:
.dbline -2
L24:
.dbline 0 ; func end
rjmp pop_xgsetF03C
.dbsym r b 20 c
.dbsym r a 22 c
.dbend
.dbfunc e afisheaza_A _afisheaza_A fV
; j -> R20
; img -> R10
.even
_afisheaza_A::
st -y,R10
st -y,R20
mov R10,R16
sbiw R28,13
.dbline -1
.dbline 69
; }
; /* ********************** */
; void afisheaza_A(uc_8 img){
.dbline 71
; uc_8 j;
; linie_goala(10);
ldi R16,10
rcall _linie_goala
.dbline 72
; for(j=0;j<5;j++) send_octetA(zecimal_binar(fig_dec(img).c[j]));
clr R20
rjmp L53
L50:
.dbline 72
mov R18,R10
movw R16,R28
rcall _fig_dec
movw R24,R28
mov R30,R20
clr R31
add R30,R24
adc R31,R25
ldd R18,z+0
movw R16,R28
subi R16,251 ; offset = 5
sbci R17,255
rcall _zecimal_binar
movw R16,R28
subi R16,251 ; offset = 5
sbci R17,255
rcall _send_octetA
L51:
.dbline 72
inc R20
L53:
.dbline 72
cpi R20,5
brlo L50
X18:
.dbline 73
; linie_goala(10);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -