以下站点"编写引导扇区代码"提供了一个代码示例,可在系统引导时将"A"打印到屏幕上.从我一直在阅读的不是你必须使用INT操作码让BIOS做某些事情?以下代码如何从上面引用的站点工作而不使用中断?代码的哪一部分实际告诉硬件将"A"打印到屏幕上?
有问题的代码:
.code16
.section .text
.globl _start
_start:
mov $0xb800, %ax
mov %ax, %ds
movb $'A', 0
movb $0x1e, 1
idle:
jmp idle
Run Code Online (Sandbox Code Playgroud)
附加原始问题
如果我使用以下代码,BIOS调用是否会为我写入文本缓冲区?缓冲区从地址0xb800开始?
# Author: Matthew Hoggan
# Date Created: Tuesday, Mar 6, 2012
.code16 # Tell assembler to work in 16 bit mode (directive)
.section .text
.globl _start # Help linker find start of program
_start:
movb $0x0e, %ah # Function to print a character to the screen
movb $0x00, %bh # Indicate the page …Run Code Online (Sandbox Code Playgroud)