王爽汇编实验九
assumecs:code,ds:data,ss:stackdatasegmentdb'welcometomasm!'db2h,24h,71hdataendsstacks...
assume cs:code,ds:data,ss:stack
data segment
db 'welcome to masm!'
db 2h,24h,71h
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start: mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10h
mov ax,0b872h
mov bx,0
mov cx,3
s: mov es,ax
push cx
push ax
push bx
mov si,0
mov di,0
pop bx
mov ax,10h[bx]
inc bx
mov cx,10h
s1: mov al,[si]
mov es:[di],al
mov es:[di+1],ah
inc si
add di,2
loop s1
pop ax
add ax,0ah
pop cx
loop s
mov ax,4c00h
int 21h
code ends
end start
输出结果为上图所示
而正确的是下图那位高手帮忙看看 展开
data segment
db 'welcome to masm!'
db 2h,24h,71h
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start: mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,10h
mov ax,0b872h
mov bx,0
mov cx,3
s: mov es,ax
push cx
push ax
push bx
mov si,0
mov di,0
pop bx
mov ax,10h[bx]
inc bx
mov cx,10h
s1: mov al,[si]
mov es:[di],al
mov es:[di+1],ah
inc si
add di,2
loop s1
pop ax
add ax,0ah
pop cx
loop s
mov ax,4c00h
int 21h
code ends
end start
输出结果为上图所示
而正确的是下图那位高手帮忙看看 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询