急急急急!!!哪位大侠帮帮我翻译一下啊,我有急用啊!!!谢谢啦!!!
STBITP1.3OEBITP1.1EOCBITP1.2DIbitP3.0EbitP3.2RwbitP3.1resbitp1.0XEQU40HyEQU42HUPDEQU3...
ST BIT P1.3
OE BIT P1.1
EOC BIT P1.2
DI bit P3.0
E bit P3.2
Rw bit P3.1
res bit p1.0
X EQU 40H
y EQU 42H
UPD EQU 30H
DOD EQU 31H
org 00h
ajmp main
org 0030h
MAIN: nop
SETB EOC
MOV X,#00H
MOV Y,#9FH
MOV B,#16
clr res
lcall dly50
setb res
clr ea
CLR E
lcall dly50
mov 34h,#00h
lcall ClearLCD
lcall dly100
COVER: CLR ST
NOP
SETB ST
NOP
CLR ST
WAIT: JNB EOC,WAIT
SETB OE
NOP
MOV A,P0
CLR OE
JB ACC.7,WN
DIV AB
MOV B,#16
MOV DPTR,#AdressTAB
MOVC A,@A+DPTR
MOV UPD,#00H
MOV DOD,A
CALL DISP
SJMP COVER
WN: DIV AB
MOV B,#16
MOV DPTR,#AdressTAB
MOVC A,@A+DPTR
MOV UPD,A
MOV DOD,#00H
CALL DISP
SJMP COVER
DISP: LCALL CloseLCD
MOV DPTR,#XTAB
MOV A,X
MOVC A,@A+DPTR
MOV R1,Y
LCALL WRI
MOV R1,A
LCALL WRI
MOV R1,UPD
LCALL WRD
MOV R1,DOD
LCALL WRD
LCALL OpenLCD
DEC Y
MOV A,Y
CJNE A,#7FH,DISPEND
MOV Y,#9FH
INC X
MOV A,X
CJNE A,#16,DISPEND
MOV X,#0
LCALL ClearLCD
DISPEND:RET
ClearLCD:lcall CloseLCD
MOV R7,#32
MOV R2,#80H
LOP1: MOV A,R2
MOV R1,A
LCALL WRI
MOV R3,#80H
mov A,r3
mov r1,a
LCALL WRI
MOV R5,#32
LOP11: MOV R1,00H
LCALL WRD
DJNZ R5,LOP11
INC R2
DJNZ R7,LOP1
ret
CloseLCD:LCALL DLY50
MOV r1,#34H
LCALL WRI
lcall dly50
RET
OpenLCD:LCALL DLY50
MOV R1,#36H
LCALL WRI
LCALL DLY50
RET
WRI: CLR RW
CLR E
CLR DI
MOV p2,r1
lcall DLY10
SETB E
LCALL DLY10
CLR E
LCALL DLY10
LCALL DLY10
LCALL DLY10
RET
WRD: CLR RW
CLR E
SETB DI
mov p2,r1
LCALL DLY10
SETB E
LCALL DLY10
CLR E
LCALL DLY10
LCALL DLY10
LCALL DLY10
RET
DLY10: MOV R3,#01H
DL1: MOV R4,#01H
DL2: MOV R6,#0FH
DL3: DJNZ R6,DL3
DJNZ R4,DL2
DJNZ R3,DL1
RET
DLY50: MOV R3,#04H
DL111: MOV R4,#0FH
DL222: MOV R6,#0AFH
DL333: DJNZ R6,DL333
DJNZ R4,DL222
DJNZ R3,DL111
RET
DLY100: MOV R3,#06H
DL11: MOV R4,#0FFH
DL22: MOV R6,#0FFH
DL33: DJNZ R6,DL33
DJNZ R4,DL22
DJNZ R3,DL11
RET
XTAB:DB 88H,80H,89H,81H,8AH,82H,8BH,83H,8CH,84H,8DH,85H,8EH,86H,8FH,87H
AdressTAB:
DB 00000001B DB 00000010B DB 00000100B DB 00001000B DB 00010000B
DB 00100000B DB 01000000B DB 10000000B DB 00000001B DB 00000010B
DB 00000100B DB 00001000B DB 00010000B DB 00100000B DB 01000000B
DB 10000000B
END 展开
OE BIT P1.1
EOC BIT P1.2
DI bit P3.0
E bit P3.2
Rw bit P3.1
res bit p1.0
X EQU 40H
y EQU 42H
UPD EQU 30H
DOD EQU 31H
org 00h
ajmp main
org 0030h
MAIN: nop
SETB EOC
MOV X,#00H
MOV Y,#9FH
MOV B,#16
clr res
lcall dly50
setb res
clr ea
CLR E
lcall dly50
mov 34h,#00h
lcall ClearLCD
lcall dly100
COVER: CLR ST
NOP
SETB ST
NOP
CLR ST
WAIT: JNB EOC,WAIT
SETB OE
NOP
MOV A,P0
CLR OE
JB ACC.7,WN
DIV AB
MOV B,#16
MOV DPTR,#AdressTAB
MOVC A,@A+DPTR
MOV UPD,#00H
MOV DOD,A
CALL DISP
SJMP COVER
WN: DIV AB
MOV B,#16
MOV DPTR,#AdressTAB
MOVC A,@A+DPTR
MOV UPD,A
MOV DOD,#00H
CALL DISP
SJMP COVER
DISP: LCALL CloseLCD
MOV DPTR,#XTAB
MOV A,X
MOVC A,@A+DPTR
MOV R1,Y
LCALL WRI
MOV R1,A
LCALL WRI
MOV R1,UPD
LCALL WRD
MOV R1,DOD
LCALL WRD
LCALL OpenLCD
DEC Y
MOV A,Y
CJNE A,#7FH,DISPEND
MOV Y,#9FH
INC X
MOV A,X
CJNE A,#16,DISPEND
MOV X,#0
LCALL ClearLCD
DISPEND:RET
ClearLCD:lcall CloseLCD
MOV R7,#32
MOV R2,#80H
LOP1: MOV A,R2
MOV R1,A
LCALL WRI
MOV R3,#80H
mov A,r3
mov r1,a
LCALL WRI
MOV R5,#32
LOP11: MOV R1,00H
LCALL WRD
DJNZ R5,LOP11
INC R2
DJNZ R7,LOP1
ret
CloseLCD:LCALL DLY50
MOV r1,#34H
LCALL WRI
lcall dly50
RET
OpenLCD:LCALL DLY50
MOV R1,#36H
LCALL WRI
LCALL DLY50
RET
WRI: CLR RW
CLR E
CLR DI
MOV p2,r1
lcall DLY10
SETB E
LCALL DLY10
CLR E
LCALL DLY10
LCALL DLY10
LCALL DLY10
RET
WRD: CLR RW
CLR E
SETB DI
mov p2,r1
LCALL DLY10
SETB E
LCALL DLY10
CLR E
LCALL DLY10
LCALL DLY10
LCALL DLY10
RET
DLY10: MOV R3,#01H
DL1: MOV R4,#01H
DL2: MOV R6,#0FH
DL3: DJNZ R6,DL3
DJNZ R4,DL2
DJNZ R3,DL1
RET
DLY50: MOV R3,#04H
DL111: MOV R4,#0FH
DL222: MOV R6,#0AFH
DL333: DJNZ R6,DL333
DJNZ R4,DL222
DJNZ R3,DL111
RET
DLY100: MOV R3,#06H
DL11: MOV R4,#0FFH
DL22: MOV R6,#0FFH
DL33: DJNZ R6,DL33
DJNZ R4,DL22
DJNZ R3,DL11
RET
XTAB:DB 88H,80H,89H,81H,8AH,82H,8BH,83H,8CH,84H,8DH,85H,8EH,86H,8FH,87H
AdressTAB:
DB 00000001B DB 00000010B DB 00000100B DB 00001000B DB 00010000B
DB 00100000B DB 01000000B DB 10000000B DB 00000001B DB 00000010B
DB 00000100B DB 00001000B DB 00010000B DB 00100000B DB 01000000B
DB 10000000B
END 展开
3个回答
展开全部
ST BIT P1.3 ;定义IO口
OE BIT P1.1
EOC BIT P1.2
DI bit P3.0
E bit P3.2
Rw bit P3.1
res bit p1.0
X EQU 40H ; ;定义变量
y EQU 42H
UPD EQU 30H
DOD EQU 31H
org 00h ;定义子程序地址,00H是单片机复位开始的地址
ajmp main ;无条件跳转到main 程序段
org 0030h 定义子程序地址
MAIN: nop ;main就子程序标号,NOP是空指令占用1指令周期
SETB EOC ;;EOC BIT P1.2置1
MOV X,#00H ;把0送X
其它参考<<51单片机汇编语言>>
http://wenku.baidu.com/view/62812ff14693daef5ef73d2b.html
OE BIT P1.1
EOC BIT P1.2
DI bit P3.0
E bit P3.2
Rw bit P3.1
res bit p1.0
X EQU 40H ; ;定义变量
y EQU 42H
UPD EQU 30H
DOD EQU 31H
org 00h ;定义子程序地址,00H是单片机复位开始的地址
ajmp main ;无条件跳转到main 程序段
org 0030h 定义子程序地址
MAIN: nop ;main就子程序标号,NOP是空指令占用1指令周期
SETB EOC ;;EOC BIT P1.2置1
MOV X,#00H ;把0送X
其它参考<<51单片机汇编语言>>
http://wenku.baidu.com/view/62812ff14693daef5ef73d2b.html
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我R!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我了个大去 单片机啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询