1.用汇编语言编程 51单片机片内RAM的汇编汇编50H和60H两单元存储数若相同70H单元中存1否则存零 紧急!各位帮帮忙啊
2.51单片机为基础用汇编语言编写用数码管显示一个同时有"加""减""乘""除"法功能的源码苏州桶装水溯源码价格表计算器程序,急用参考
用汇编语言编程 51单片机片内RAM的汇编汇编国际物流商城源码50H和60H两单元存储数若相同70H单元中存1否则存零 紧急!各位帮帮忙啊
我原来的源码微招聘源码8.10写法:用subb
MOV a,h
CLR c
SUBB a,h
JZ YES //a为0跳到YES
MOV h,#h //不相同
JMP OVER
YES:
MOV h,#h //相同
OVER:
///////////////////////================
上面这位兄台用CJNE是不是忘了加个jmp over
MOV A,H
CJNE A,H,MARK
JMP OVER //对上所改
MOV H,#H
MARK:
MOV H,#H
OVER: //对上所改
否则不管如何都会执行 在h里存0了
单片机为基础用汇编语言编写用数码管显示一个同时有"加""减""乘""除"法功能的计算器程序,急用参考
ORG HLJMP MAIN
ORG H
MAIN:MOV SP,汇编汇编哈土豆源码 家政#7EH
MOV H,#H
CLR P2.0
CLR P2.3
MOV H,#H
MOV H,#H
MOV H, #H
MOV H, #H
MOV H, #H ;初始化
SU: MOV 7DH,#0FFH
MOV 7EH,#0FFH
MOV 7FH,#0FFH
KEYI:ACALL KS1
CJNE A,#0F0H,LK1
ACALL DIR
AJMP KEYI
LK1:ACALL DIR
ACALL DIR
ACALL KS1
CJNE A, #0F0H,LK2
ACALL DIR
AJMP KEYI
LK2: ACALL KS1
MOV R2,A
ORL A,#0FH
MOV P0,A
ANL A,#0FH
ADD A,R2 ;键特征值
CJNE A,#0EEH,JZHI1
MOV A,#H
PUSH ACC
JZHI1: CJNE A,#0DEH,JZHI2
MOV A,#H
PUSH ACC
JZHI2: CJNE A,#0BEH, JZHI3
MOV A,#H
PUSH ACC
JZHI3: CJNE A,#7EH,JZHI4
MOV A,#H
PUSH ACC
JZHI4: CJNE A, #0EDH, JZHI5
MOV A,#H
PUSH ACC
JZHI5: CJNE A,#0DDH, JZHI6
MOV A, #H
PUSH ACC
JZHI6: CJNE A,#0BDH, JZHI7
MOV A, #H
PUSH ACC
JZHI7: CJNE A,#DH, JZHI8
MOV A, #H
PUSH ACC
JZHI8: CJNE A,#0EBH, JZHI9
MOV A, #H
PUSH ACC
JZHI9: CJNE A,#0DBH, JZHI
MOV A, #H
PUSH ACC
JZHI: CJNE A,#0BBH, JZHI
MOV H,#H
JZHI: CJNE A,#BH,FAN
MOV H, #H
LCALL GMI
SETB P2.2 ;灭绿灯
LJMP SU ;改密
FAN: MOV A, H
CJNE A,#7FH, KEYI
JNB (H).0, KEYITMP
MOV H,#H
JBC (H).0,LOOP
POP ACC
CJNE A,H,NOTE
MOV 7FH,A
POP ACC
CJNE A,H,NOTE
MOV 7EH,A
POP ACC
CJNE A,H,NOTE
MOV 7DH,A
CLR P2.2
KEYITMP:LJMP KEYI
NOTE:LCALL BAOJ ;NOT是保留字不能做标号
SUTMP:LJMP SU
BAOJ:MOV SP,#7EH
INC H
JNB (H).1, SUTMP
CLR P2.1
SETB P2.3
ACALL DELY1
CPL P2.1
CPL P2.3
MOV H,#H
RET
GMI:JNB P2.2,SUTMP
LOOP:POP H
POP H
POP H
RET
DIR:MOV R0,#7DH
MOV R3,#H
LD1: MOV A,@R0
MOV P1,A
MOV P3,R3
LCALL DELY
INC R0
MOV A,R3
JB ACC.2,LD2
RL A
MOV R3,A
SJMP LD1
LD2:RET ;显示
DELY:MOV R7,#
DL:DJNZ R7,DL
RET ;1ms延时
DELY1:MOV R5,#
MOV R4,#
LOOP1:MOV R3,#
NOP
LOOP2:DJNZ R3,LOOP2
DJNZ R5,LOOP1
DJNZ R4,LOOP1
RET ;s延时
KS1:MOV P0,#0F0H
MOV A,P0
ANL A, #0F0H
RET ;键是否按下
end