Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Loops 如何制作无限循环以保持8086的时钟连续显示?_Loops_Assembly_X86 16_Processor_16 Bit - Fatal编程技术网

Loops 如何制作无限循环以保持8086的时钟连续显示?

Loops 如何制作无限循环以保持8086的时钟连续显示?,loops,assembly,x86-16,processor,16-bit,Loops,Assembly,X86 16,Processor,16 Bit,下面是我编写的代码,但它显示了我希望它在循环中保持更新的时间。我已经试过了。虽然循环和简单的循环,但它们没有帮助 MAIN PROC L1: mov cx, 100 push cx MOV AX, @DATA ; initialize DS MOV DS, AX mov BX,offset time ; BX=offset address of string TIME CALL

下面是我编写的代码,但它显示了我希望它在循环中保持更新的时间。我已经试过了。虽然循环和简单的循环,但它们没有帮助

MAIN PROC

L1:
     mov cx, 100
     push cx

     MOV AX, @DATA                ; initialize DS
     MOV DS, AX


     mov BX,offset time           ; BX=offset address of string TIME

     CALL GET_TIME                ; call the procedure GET_TIME

     CALL clrscr

     MOV DX,offset time           ; DX=offset address of string PROMPT
     MOV AH, 09H                  ; print the string PROMPT
     INT 21H                                          

     MOV AH, 4CH                  ; return control to DOS
     INT 21H

     pop cx
     inc cx

     loop L1

MAIN ENDP

MOV-AH,4CH;将控件返回DOS
int21h
退出程序,使其不会到达loop语句。循环会自动减少CX,您根本不想看到
inc CX
。您需要将
mov-cx,100
移动到标签
L1
上方的循环外谢谢,它成功了!