设置CX=0,那么loo指令循环多少次?

taogaowei 2003-10-20 11:09:31
例如:mov cx,0
delay: loop delay
...全文
914 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
SnHnBn 2003-10-28
  • 打赏
  • 举报
回复
楼主在倒分吗?
SnHnBn 2003-10-23
  • 打赏
  • 举报
回复
to: predrose(predrose)
please explain that why the value of the ax is zero in your code ? if there is no loop, the inc ax instruction must be executed once. why ax is still zero?
if you can not understand, I can tell you the reason is the inc ax instruction being executed 0xFFFF+1 times, then ax is overflow to zero(please check the AC flag).
Here another simple code, please test it:

100 mov cx,0
103 loop 100
104 int 3

hmm, the two instructions will satirize you. So, do not designating the others are newbeis arbitrary before you considering.
predrose 2003-10-22
  • 打赏
  • 举报
回复
Please use debug to test belowing code:
100 mov ax,0
103 mov cx,0
106 inc ax
107 loop 106
109 int 3
g=100
She screen output: EAX=0 ECX=0
So we have consider for the question: NO loop, CX=0.
The newbies on the CSDN have more, too.
junhli 2003-10-22
  • 打赏
  • 举报
回复
0xffff
SnHnBn 2003-10-22
  • 打赏
  • 举报
回复
0xFFFF
Lymtics 2003-10-22
  • 打赏
  • 举报
回复
如下:
-a
13A7:0100 xor ax,ax
13A7:0102 xor cx,cx
13A7:0104 inc ax
13A7:0105 loop 0104
13A7:0107 int3
13A7:0108
-
-t

AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=13A7 ES=13A7 SS=13A7 CS=13A7 IP=0102 NV UP EI PL ZR NA PE NC
13A7:0102 31C9 XOR CX,CX
-t

AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=13A7 ES=13A7 SS=13A7 CS=13A7 IP=0104 NV UP EI PL ZR NA PE NC
13A7:0104 40 INC AX
-t

AX=0001 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=13A7 ES=13A7 SS=13A7 CS=13A7 IP=0105 NV UP EI PL NZ NA PO NC
13A7:0105 E2FD LOOP 0104
-t

AX=0001 BX=0000 CX=FFFF DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=13A7 ES=13A7 SS=13A7 CS=13A7 IP=0104 NV UP EI PL NZ NA PO NC
13A7:0104 40 INC AX
-t

AX=0002 BX=0000 CX=FFFF DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=13A7 ES=13A7 SS=13A7 CS=13A7 IP=0105 NV UP EI PL NZ NA PO NC
13A7:0105 E2FD LOOP 0104


to:predrose(predrose)
now explain it,please??!!
Lymtics 2003-10-22
  • 打赏
  • 举报
回复
loop 65535 .................
predrose 2003-10-22
  • 打赏
  • 举报
回复
Dear all of Newbies:
See my first code and then execting it.
If you doesn't explict for the question, please see the instruction set reference (Intel Developer manual 2)(3-393 Pages)
hswxf 2003-10-22
  • 打赏
  • 举报
回复
MOV CX,之后的LOOP才决定CX-1值,应该是FFFFH(=-1)
所以你的LOOP要过%¥……%¥……%—……
SnHnBn 2003-10-22
  • 打赏
  • 举报
回复
The newbie is ONLY YOU!now.:) 铛铛铛铛……
SnHnBn 2003-10-22
  • 打赏
  • 举报
回复
楼上,如果没有循环,ax的值是1才对。动动脑袋为什么ax=0, cx=0吧。
caonimabi 2003-10-21
  • 打赏
  • 举报
回复
65535
ahjoe 2003-10-21
  • 打赏
  • 举报
回复
65536
hcj2002 2003-10-21
  • 打赏
  • 举报
回复
没有循环
zuolihua 2003-10-21
  • 打赏
  • 举报
回复
65535,0没有循环
csdsjkk 2003-10-20
  • 打赏
  • 举报
回复
65536

21,458

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧