0%

关于8086汇编中二重循环的写法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
assume cs:code
stack segment
db 128 dup(0)
stack ends

code segment
start: mov ax, stack
mov ss, ax
mov sp, 128

mov ax, 0b800h
mov es, ax
mov ah, 'a'

s:
mov es:[160*12+40*2], ah ;显示
call delay
inc ah
cmp ah, 'z'
jna s

mov ax, 4c00H
int 21H
delay:
push ax
push dx
mov dx, 10H ;外层循环变量
mov ax, 0 ;内层循环变量

s1:
sub ax, 1
sbb dx, 0 ;dx = dx - 0 - CF
cmp ax, 0
jne s1
cmp dx, 0
jne s1

pop dx
pop ax
ret

code ends

end start
求大佬赏个饭