Why does this "hello world" x86 download code written for NASM work without the [BITS 16] and [ORG 0x7C00] directives?

push word 0b800h pop es xor di, di mov [es:di], word 441h jmp $ times 510 - ($-$$) db 0 db 55h db 0AAh 
+4
source share
1 answer

Because you write flat binary code without shortcuts. NASM should use 16 bits by default. This is because you do not have addressing or shortcuts, so there is no requirement to provide the [ORG ...] directive.

+9
source

Source: https://habr.com/ru/post/1307032/


All Articles