把字符串改为大写再显示
将数据段中的字符转化为大写,然后在第八行第三列显示.大家看下我代码哪里错了啊!assume cs:codesg
datasg segment
db "Beginner's All-purpose Symbolic Instruction Code.",0
datasg ends
stack segment
dw 8 dup(0)
stack ends
codesg segment
begin: mov ax,datasg
mov ds,ax
mov si,0
mov ax,stack
mov ss,ax
mov sp,8
mov dh,8
mov dl,3
call letterc
call show_str
mov ax,4c00h
int 21h
letterc:push ax
push si
mov ch,0
mov cl,
jcxz s2
s:mov al,
cmp al,'a'
jb s1
cmp al,'z'
ja s1
and al,11011111b
mov ,al
s1:inc si
jmp letterc
s2:pop si
pop ax
ret
show_str:push ax
push si
push dx
mov ax,0b800h
mov es,ax
mov ax,160
mul dh
mov bx,ax
mov ax,2
mul dl
add bx,ax
mov al,2
mov cl,0
s3:
mov ch,
jcxz s4
mov es:,ch
mov es:,al
inc si
add bx,2
jmp s3
s4:pop dx
pop si
pop ax
ret
codesg ends
end begin
斌少,你先说说cmd提示什么错误啊。 没错误,运行的时候显示不出来 首先映入眼帘的错误是assume cs:codesg,缺少ds,ss, ACC 发表于 2012-11-22 10:22 static/image/common/back.gif
首先映入眼帘的错误是assume cs:codesg,缺少ds,ss,
这个不是问题吧.没有也可以的,课本上也是这样的.我检查出来错误了,是letterc里面跳转写错了 assume cs:codesg
datasg segment
db "Beginner's All-purpose Symbolic Instruction Code.",0
datasg ends
stack segment
dw 8 dup(0)
stack ends
codesg segment
begin: mov ax,datasg
mov ds,ax
mov si,0
mov ax,stack
mov ss,ax
mov sp,8
mov dh,8
mov dl,3
call letterc
call show_str
mov ax,4c00h
int 21h
letterc:push ax
push si
letterc1:mov ch,0 ;此处加了标号
mov cl,
jcxz s2
s:mov al,
cmp al,'a'
jb s1
cmp al,'z'
ja s1
and al,11011111b
mov ,al
s1:inc si
jmp letterc1 ;修改了这里的标号
s2:pop si
pop ax
ret
show_str:push ax
push si
push dx
mov ax,0b800h
mov es,ax
mov ax,160
mul dh
mov bx,ax
mov ax,2
mul dl
add bx,ax
mov al,2
mov cl,0
s3:
mov ch,
jcxz s4
mov es:,ch
mov es:,al
inc si
add bx,2
jmp s3
s4:pop dx
pop si
pop ax
ret
codesg ends
end begin
谢谢!
有图片显示了哈哈! 要是什么都没提示 是不是名字错了? 帮顶
页:
[1]