主题:[讨论]求助啊!!悬赏中.....
要求很简单,就是输入一个字符串,然后显示出来,第一个源程序怎么都不行,
stack segment stack
db 1024 dup(0)
stack ends
data segment
buf1 = 256
buf db buf1
db 0
db buf1 dup(0)
data ends
code segment
assume cs:code,ds:data,ss:stack
start:
mov ax,data
mov ds,ax
mov dx,offset buf
mov ah,0ah
int 21h
mov dl,0ah
mov ah,02h
int 21h
mov dx,offset buf+2
mov ah,09h
int 21h
mov ah,4ch
int 21h
code ends
end start
不知道错到哪里了......然后我改了一下,单个输出可以了,
stack segment stack
db 1024 dup(0)
stack ends
data segment
buf1 = 128
buf db buf1
db 0
db buf1 dup(0)
data ends
code segment
assume cs:code,ds:data,ss:stack
start:
mov ax,data
mov ds,ax
mov dx,offset buf
mov ah,0ah
int 21h
mov dl,0ah
mov ah,02h
int 21h
mov bx,offset buf+1
mov cl,[bx]
mov ch,0
again:
add bx,1
mov dl,[bx]
mov ah,02h
int 21h
loop again
mov ah,4ch
int 21h
code ends
end start
stack segment stack
db 1024 dup(0)
stack ends
data segment
buf1 = 256
buf db buf1
db 0
db buf1 dup(0)
data ends
code segment
assume cs:code,ds:data,ss:stack
start:
mov ax,data
mov ds,ax
mov dx,offset buf
mov ah,0ah
int 21h
mov dl,0ah
mov ah,02h
int 21h
mov dx,offset buf+2
mov ah,09h
int 21h
mov ah,4ch
int 21h
code ends
end start
不知道错到哪里了......然后我改了一下,单个输出可以了,
stack segment stack
db 1024 dup(0)
stack ends
data segment
buf1 = 128
buf db buf1
db 0
db buf1 dup(0)
data ends
code segment
assume cs:code,ds:data,ss:stack
start:
mov ax,data
mov ds,ax
mov dx,offset buf
mov ah,0ah
int 21h
mov dl,0ah
mov ah,02h
int 21h
mov bx,offset buf+1
mov cl,[bx]
mov ch,0
again:
add bx,1
mov dl,[bx]
mov ah,02h
int 21h
loop again
mov ah,4ch
int 21h
code ends
end start