Leo*_*rdo 2 assembly bios nasm bootloader x86-16
有人知道下面的代码有什么问题吗?
我无法让它按照我想要的方式工作。我只想打印变量的单个字符(字母“h”)。
为此,我只需通过方括号使用间接寻址来复制内容
[]
; Set BIOS print screen settings
mov ah, 0x0e ; Teletype
mov bh, 0 ; Page number
mov bl, 4 ; Red on black (00000100 - High 0000 is black, low 0100 is red)
mov cx, 1 ; Writes one character
; Printing to screen
mov al, [msg] ; Copy the contents of 'H' into 'al'; IT SEEMS THIS IS NOT WORKING!!!
jmp print_char ; Jump to executable code and do not let CPU step on DATA SECTION
; [BEG DATA SECTION]
msg: db 'HELLO', 0
; [END DATA SECTION]
print_char:
int 0x10 ; Call BIOS routine to print the char located at 'al'
infinite_loop:
jmp $
times 510 -($-$$) db 0 ; Pad with 0 until byte 510
dw 0xAA55 ; MBR Boot code signature
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1531 次 |
最近记录: |