编写汇编程序,找出字节数组buf[10]中所有正数,将结果存在数组BUF2中
答案:1 悬赏:30 手机版
解决时间 2021-11-15 07:32
- 提问者网友:爱唱彩虹
- 2021-11-14 08:18
编写汇编程序,找出字节数组buf[10]中所有正数,将结果存在数组BUF2中
最佳答案
- 五星知识达人网友:孤老序
- 2021-11-14 09:31
dseg segment
buf1 db 1,2,3,4,5,-1,-2,-3,-4,-5
len equ $-buf1
buf2 db len dup(0)
dseg ends
cseg segment
assume cs:cseg, ds:dseg
start:
mov ax, dseg
mov ds, ax
mov cx, len
lea si, buf1
lea di, buf2
l0:
mov al, [si]
test al, 80h
jnz l1
mov [di], al
inc di
l1:
inc si
loop l0
mov ah,4ch
int 21h
cseg ends
end start
buf1 db 1,2,3,4,5,-1,-2,-3,-4,-5
len equ $-buf1
buf2 db len dup(0)
dseg ends
cseg segment
assume cs:cseg, ds:dseg
start:
mov ax, dseg
mov ds, ax
mov cx, len
lea si, buf1
lea di, buf2
l0:
mov al, [si]
test al, 80h
jnz l1
mov [di], al
inc di
l1:
inc si
loop l0
mov ah,4ch
int 21h
cseg ends
end start
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯