1 assume cs:code
2 //统计在076b:0起32个字节中数值在[32,128]的个数,使用jb,ja指令
3 code segment
4 start:
5 mov ax,076bh
6 mov ds,ax
7 mov bx,0
8 mov dx,0
9 mov cx,32
10 s:
11 mov al,[bx]
12 cmp al,32
13 jb s0
14 cmp al,128
15 ja s0
16 inc dx
17 s0:
18 inc bx
19 loop s
20 mov ax,4c00h
21 int 21h
22 code ends
23
24 end start
1 assume cs:code
2 //统计在076b:0起32个字节中数值在(32,128)的个数,使用jnb,jna指令
3 code segment
4 start:
5 mov ax,076bh
6 mov ds,ax
7 mov bx,0
8 mov dx,0
9 mov cx,32
10 s:
11 mov al,[bx]
12 cmp al,32
13 jna s0
14 cmp al,128
15 jnb s0
16 inc dx
17 s0:
18 inc bx
19 loop s
20 mov ax,4c00h
21 int 21h
22 code ends
23
24 end start