[英]Intel 8051 EdSim51 7 Segment Display
Why does when I remove the "B" in the binary on the code, it messes up when displaying the number?为什么当我删除代码上二进制中的“B”时,显示数字时会混乱?
ORG 0000H
START:
SETB P3.3
SETB P3.4
MOV P1, #11111001
CALL DELAY
CLR P3.3
MOV P1, #10100100
CALL DELAY
CLR P3.4
SETB P3.3
MOV P1, #10110000
CALL DELAY
CLR P3.3
MOV P1, #10011001
CALL DELAY
JMP START
DELAY: MOV R0, #45H
DJNZ R0, $
RET
END
Thank you谢谢
Because the assembler looks at the last character to determine the base of the number.因为汇编程序查看最后一个字符来确定数字的基数。
If you use:如果您使用:
MOV P1, #10B
It means the binary value 10, giving a decimal 2.它表示二进制值 10,给出十进制 2。
If you use:如果您使用:
MOV P1, #10
It means the decimal 10.它的意思是十进制的 10。
If you use:如果您使用:
MOV P1, #10H
It means the hex value 10, giving a decimal 16.它表示十六进制值 10,给出十进制 16。
Note: Your assembler should have warned you about a number overflow or so.注意:您的汇编程序应该警告您有关数字溢出的情况。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.