小编Mic*_*ole的帖子

程序集 (x86): <label> db 'string',0 不会被执行,除非有跳转指令

我一直在用头撞墙,试图理解为什么以下程序集没有正确转储“HELLO_WORLD”的内容。

; Explicitly set 16-bit
[ BITS 16 ]
[ ORG 0x7C00 ]

; Create label for hello world string terminated by null.
HELLO_WORLD db 'hello world', 0

start:
    ; Move address of HELLO_WORLD into si
    mov SI, HELLO_WORLD
    call print_string

    ; Continue until the end of time
    jmp $

print_string:
    loop:
        ; Retrieve value stored in address at si
        mov al, [SI]
        mov ah, 0x0E
        cmp al, 0
        ; Finish execution after hitting null terminator
        je  return …
Run Code Online (Sandbox Code Playgroud)

x86 assembly 16-bit bootloader

2
推荐指数
1
解决办法
625
查看次数

标签 统计

16-bit ×1

assembly ×1

bootloader ×1

x86 ×1