Вот такой незамысловатый код на nasm
use16
bits 16
org 0x100
segment .data
hello: db 'hello, world','$'
segment .text
mov dx,hello
mov ax,0900h
int 21h
mov ax,4c00h
int 21h
nasm a.asm -o a.com -f bin
Пытаюсь сделать аналогичное на gas
.code16
.globl _start
_start:
movw $hello, %dx
movb $0x09, %ah
int $0x21
movb $0x4c, %ah
int $0x21
hello: .ascii "Hello, world!$"
[actics@x120e dos]$ as -march=i386 -mtune=i8086 --32 gas.asm -o gas.o
[actics@x120e dos]$ ld -m i386linux -Ttext 0x100 -nostdlib --oformat binary gas.o -o gas.com
movw $0x100 + hello - _start, %dx