1.在一个升序数组中插入一个正数。(从键盘输入数组和要插入数)
2.从键盘输入字符串,如是 小写字母,则转为大写字母输出。如是大写字母,原样输出。并约定,键入复位键[ESC]中止输入。例:输入: deddeDEDG 按复位键[ESC] 输出:deddededg
我也想知道
[此贴子已经被作者于2006-7-6 21:52:04编辑过]
第二个我记得前几天发过一次了:
data segment
string db 10 dup(?)
nextline db 0dh,0ah,'$'
exit db 0dh,0ah,"please any key to exit",'$'
str db 10 dup(?)
data ends
code segment
assume cs:code,ds:data
main:
mov ax,data
mov ds,ax
mov cx,1
sub si,si
get:mov ah,01h
int 21h
cmp cx,10
jz full
inc cx
cmp al,1bh
jz done
mov string[si],al
inc si
jmp get
full:mov string[si],al
done:sub si,si
sub di,di
again:mov al,string[si]
cmp al,61h
jae next
add al,20h
next:mov str[di],al
inc si
inc di
loop again
lea dx,nextline
mov ah,09h
int 21h
sub di,di
mov cx,si
get1:mov dl,str[di]
mov ah,02h
int 21h
inc di
loop get1
lea dx,exit
mov ah,09h
int 21h
mov ah,01h
int 21h
mov ah,4ch
int 21h
code ends
end main