Assembly 如何将emu 8086 hello world代码中的21h中断使用转换为13h或10h中断使用 那么你想问什么呢?你有没有看过那些中断的文档,看看它们是如何工作的,你自己有没有尝试过?你到底被困在哪里?您在理解int13h或int10h的文档时有困难吗?

Assembly 如何将emu 8086 hello world代码中的21h中断使用转换为13h或10h中断使用 那么你想问什么呢?你有没有看过那些中断的文档,看看它们是如何工作的,你自己有没有尝试过?你到底被困在哪里?您在理解int13h或int10h的文档时有困难吗?,assembly,emulation,interrupt,x86-16,Assembly,Emulation,Interrupt,X86 16,如何将emu 8086 hello world代码中的21h中断使用转换为13h或10h中断使用 那么你想问什么呢?你有没有看过那些中断的文档,看看它们是如何工作的,你自己有没有尝试过?你到底被困在哪里?您在理解int13h或int10h的文档时有困难吗?您可以通过谷歌BIOS“int13h”和BIOS“int10h”了解更多信息。没有BIOS中断来打开文件,因为BIOS不知道您使用的是什么文件系统。int21h采用DOS FAT文件系统,因此可以打开文件。如果你想使用int13h,你有很多工作

如何将emu 8086 hello world代码中的21h中断使用转换为13h或10h中断使用
那么你想问什么呢?你有没有看过那些中断的文档,看看它们是如何工作的,你自己有没有尝试过?你到底被困在哪里?您在理解
int13h
int10h
的文档时有困难吗?您可以通过谷歌
BIOS“int13h”
BIOS“int10h”
了解更多信息。没有BIOS中断来打开文件,因为BIOS不知道您使用的是什么文件系统。
int21h
采用DOS FAT文件系统,因此可以打开文件。如果你想使用
int13h
,你有很多工作要做,因为这是柱面/扇区/块级别。请注意
INT 13h/AH=02h
(从磁盘读取扇区)和
INT 21h/AH=3Dh
之间的区别,后者使用FAT(DOS)文件系统打开文件。您必须自己使用
int13h
解释文件系统。这个练习的目的是什么?
; emu8086 version 4.00-Beta-12 or better is required! 
; put file named "input.txt" to c:\emu8086\vdrive\c\ 
; (it's possible to copy "ReadMe.txt" and rename it or use any other 


org 100h ; .com memory layout 

mov dx, offset db; address of file to dx 
mov al,0 ; open file (read-only) 
mov ah,3dh 
int 21h ; call the interupt 
jc terminate ; if error occurs, terminate program 
mov bx,ax ; put handler to file in bx 

mov cx,1 ; read one character at a time 
print: 
lea dx, BUF 
mov ah,3fh ; read from the opened file (its handler in bx) 
int 21h 
CMP AX, 0 ; how many bytes transfered? 
JZ terminate ; end program if end of file is reached (no bytes 

mov al, BUF ; char is in BUF, send to ax for printing (char is 

mov ah,0eh ; print character (teletype). 
int 10h 
jmp print ; repeat if not end of file. 


terminate: 
mov ah, 0 ; wait for any key... 
int 16h 
ret 

db " Hello World! ", 0 
BUF db ? 


END