求解汇编题目

来源:百度知道 编辑:UC知道 时间:2024/05/28 15:01:28
在内存DATA开始的单元中连续存放一个8个长度的字符串(只有英文字母),将这个字符串中小写字符转换为大写字符,并把转换前和后的字符串分别在屏幕上显示出来。
DSEG SEGMENT
DATA DB 'abcdEFGH$'
DSEG ENDS
CSEG SEGMENT
ASSUME DS:DSEG,CS:CSEG
START:
(请填写程序)
CSEG ENDS
END START

assume cs:code
data segment
db 'abCdefgh'
data ends
code segment
start: mov ax,data
mov ds,ax
mov ax,0b800h
mov es,ax
mov bx,0
mov si,0
mov cx,8
s1: mov al,[bx]
cmp al,'a'
jb s2
;and al,11011111b
sub al,20h
s2: mov es:[12*160+40*2+si],al
mov es:[12*160+40*2+1+si],2
inc bx
add si,2
loop s1

s: mov ax,4c00h
int 21h

code ends
end start