我不能移动汇编语言中的指针。我试图将指针移动到文件中的第4个位置,然后读取并显示3个字节。 这是我的代码 -汇编语言文件指针
.model tiny
.data
fil1 db 'testing.txt',0
dat1 db 100 dup('$')
dat2 db 100 dup('$')
.code
.startup
mov al,02h
lea dx,fil1
mov ah,3dh
int 21h
mov bx,ax
mov al,00
mov cx,00
mov dx,04
mov ah,42h
int 21h
mov bx,ax
lea dx,dat2
mov cx,3
mov ah,3fh
int 21h
mov ah,09h
lea dx,dat2
int 21h
mov ah,3eh
int 21h
.exit
end
这不会在控制台上显示任何东西。 在此先感谢
简单删除最后的“mov bx,ax”指令。因为LSEEK函数(42h)在DX:AX中返回从文件开始位置以字节为单位的新文件位置。第一个“mov bx,ax”指令已经将文件句柄移动到BX和BX中保持不变。 – 2015-04-02 05:53:08