[bx+idata]
mov ax,[bx+200]
将长度为2个字节(子单元)的内容送入ax
(ax)=((ds)*16+(bx)+200)
等价写法
mov ax,[200+bx]
mov ax,200[bx]
mov ax,[bx].200
问题7.1
问题7.1
利用 [idata+bx] 重写大小写转换
assume cs:codesg,ds:datasg
datasg segment
db 'BaSiC'
db 'MinIX'
datasg ends
codesg segment
start: mov ax,datasg
mov ds,ax
mov bx,0
mov cx,5
s: mov al,[0+bx]
and al,11011111B
mov [0+bx],al
mov al,[5+bx]
or al,00100000B
mov [5+bx],al
inc bx
loop s
mov ax,4c00H
int 21H
codesg ends
end start
[0+bx] [5+bx] bx给出了从起始偏移地址开始的相对地址.png
ASCII大小写转换.png
-
BaSiCMinIX
紧紧挨着排列 -
字符 B
的起始地址是0
-
字符 M
的起始地址是5
-
bx
给出了从起始偏移地址开始的相对地址