|
发表于 2016-1-10 16:04:29
|
显示全部楼层
assume cs:code
data segment
db 'word',0
db 'unix',0
db 'wind',0
db 'good',0
data ends
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
code segment
start:mov ax,data
mov ds,ax
mov bx,0
mov ax,stack
mov ss,ax
mov sp,16+offset stack
mov cx,4
s:mov si,bx
call capital
add bx,5
loop s
mov ax,4c00h
int 21h
code ends
end start ; 到这里已经结束了
capital:push cx ;所以这里会找不到
push si
change:mov cl,[si]
mov ch,0
jcxz ok
and byte ptr [si],11011111b
inc si
jmp short change
ok:pop si
pop cx
ret
应该这样assume cs:code
data segment
db 'word',0
db 'unix',0
db 'wind',0
db 'good',0
data ends
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
code segment
start:
mov ax,data
mov ds,ax
mov bx,0
mov ax,stack
mov ss,ax
mov sp,16+offset stack
mov cx,4
s:
mov si,bx
call capital
add bx,5
loop s
mov ax,4c00h
int 21h
capital:
push cx
push si
change:
mov cl,[si]
mov ch,0
jcxz ok
and byte ptr [si],11011111b
inc si
jmp short change
ok:
pop si
pop cx
ret
code ends
end start
|
|