nasm/ld “relocation truncated to fit: R_386_16”

后端 未结 2 1556
别那么骄傲
别那么骄傲 2021-02-10 03:18

Assembly:

[BITS 16]

global _start

_start:
    mov ax, 0x07C0
    mov ds, ax

    mov si, hw
    call print_string
    jmp $

print_string:
    mov ah, 0x0E
.ch         


        
2条回答
  •  清酒与你
    2021-02-10 03:51

    I found a solution here: Looking for 16-bit x86 compiler

    something I learned the hard way; -Ttext 0x0 is critical, otherwise the .text segment is pushed outside of 16bit addressing range (don't ask me why)

提交回复
热议问题