【发布时间】:2015-07-23 02:53:00
【问题描述】:
谁能向我解释一下汇编语言中的 INT 10H 、 INT 16H 、 INT 21H 之间的区别?我们什么时候应该使用它们中的任何一个以及用于什么目的?
例如:在这个打印“Hello, World!”的简单代码中 为什么我们在第四行使用 int 10h? 为什么我们在最后一行之前使用 int 16h?
name "hi-world"
org 100h
mov ax, 3
int 10h
mov ax, 1003h
mov bx, 0
int 10h
mov ax, 0b800h
mov ds, ax
mov [02h], 'H'
mov [04h], 'e'
mov [06h], 'l'
mov [08h], 'l'
mov [0ah], 'o'
mov [0ch], ','
mov [0eh], 'W'
mov [10h], 'o'
mov [12h], 'r'
mov [14h], 'l'
mov [16h], 'd'
mov [18h], '!'
mov cx, 12 ; number of characters.
mov di, 03h ; start from byte after 'h'
c: mov [di], 11101100b
add di, 2 ; skip over next ascii code in vga memory.
loop c
; wait for any key press:
mov ah, 0
int 16h
ret
【问题讨论】:
标签: assembly binary emulation x86-16