[英]AVR Assembly Language Code
I am stuck on the following code and don't have a basic understand of how it works? 我停留在以下代码上,对它的工作原理没有基本的了解?
Determine the decimal value of r22
after the following line of code is executed: 执行以下代码行后,确定r22
的十进制值:
clr r22
dec r22
push r22
dec r22
pop r5
value of r22 = ? r22的值=?
Well, just work through each instruction one at a time and figure out what each one does. 好吧,一次完成一个指令,找出每个指令的作用。
So, unless I got something wrong, the answer is r22 = 254. 因此,除非我弄错了,否则答案是r22 = 254。
The register(in 8bit) goes from 0 to FF(dec r22) to FE(dec r22) 寄存器(8位)从0到FF(dec r22)到FE(dec r22)
If r22 is 4 bit then E = 14 如果r22是4位,则E = 14
If r22 is 8 bit then FE = 254 如果r22是8位,则FE = 254
if r22 is 16 bit then FFFE = 65534 如果r22是16位,则FFFE = 65534
and so on 等等
A processor register is like a car mileometer When it reaches 99,999 miles it goes forwards to 00000 处理器寄存器就像汽车里程表一样,当到达99,999英里时,它将前进到00000
A register reaches FFFF, 15-15-15-15 (not 9-9-9-9 because it's hex not decimal) and when we +1 it returns to 0-0-0-0 寄存器达到FFFF 15-15-15-15(不是9-9-9-9,因为它不是十六进制,所以不是9-9-9-9),当我们+1时它返回0-0-0-0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.