汇编LODSB/LODSW指令

汇编语言中,串操作指令LODSB/LODSW是块装入指令,其具体操作是把SI指向的存储单元读入累加器,LODSB就读入AL,LODSW就读入AX中,然后SI自动增加或减小1或2.
       例如:驻留程序使用 "base memory size in KB" of BIOS Data Area (0040h:0013h)给自己程序开辟2K内存,程序可以这样实现:

push es
mov si,0413h                                          ; using "base memory size in KB" of BIOS Data Area (0040h:0013h)
sub [si],word 2
lodsw
shl ax,6                                                   ; * 1024 / 16
mov es,ax                                              ; store segment address

然后将你的程序拷贝到di处即可!

作者: flysunni   发布时间: 2010-11-30