$ cat hello.c #include "stdio.h" void main(void) { printf("Hello world!\n"); } $ gcc -o hello hello.c -g -Wa,-anlhd=hello.lst,-L -masm=intel $ cat hello.lst 1 .file "hello.c" 2 .intel_syntax noprefix 3 .text 4 .Ltext0: 5 .section .rodata 6 .LC0: 7 0000 48656C6C .string "Hello world!" 7 6F20776F 7 726C6421 7 00 8 .text 9 .globl main 11 main: 12 .LFB0: 13 .file 1 "hello.c" 1:hello.c **** 2:hello.c **** #include "stdio.h" 3:hello.c **** 4:hello.c **** void main(void) { 14 .loc 1 4 17 15 .cfi_startproc 16 0000 55 push rbp 17 .cfi_def_cfa_offset 16 18 .cfi_offset 6, -16 19 0001 4889E5 mov rbp, rsp 20 .cfi_def_cfa_register 6 5:hello.c **** printf("Hello world!\n"); 21 .loc 1 5 2 22 0004 488D3D00 lea rdi, .LC0[rip] 22 000000 23 000b E8000000 call puts@PLT 23 00 6:hello.c **** } 24 .loc 1 6 1 25 0010 90 nop 26 0011 5D pop rbp 27 .cfi_def_cfa 7, 8 28 0012 C3 ret 29 .cfi_endproc 30 .LFE0: 32 .Letext0: $ ia16-elf-gcc -o hello.com hello.c -g -Wa,-anlhd=hello.lst,-L -masm=intel cc1: warning: target system does not support debug output $ cat hello.lst 1 .arch i8086,jumps 2 .code16 3 .intel_syntax noprefix 4 #NO_APP 5 .section .rodata 6 .LC0: 7 0000 48656C6C .string "Hello world!" 7 6F20776F 7 726C6421 7 00 8 .text 9 .global main 11 main: 12 0000 55 push bp 13 0001 89E5 mov bp, sp 14 0003 B80000 mov ax, offset .LC0 15 0006 50 push ax 16 0007 16 push ss 17 0008 1F pop ds 18 0009 E8FEFF call puts 19 000c 83C402 add sp, 2 20 000f 90 nop 21 0010 5D pop bp 22 0011 16 push ss 23 0012 1F pop ds 24 0013 C3 ret 26 .ident "GCC: (GNU) 6.3.0" $