Directives [BITS 16] and [ORG 0x0000]

I am starting to experiment with writing a kernel and am happy to do it. I have a main bootloader and the following directives:

[BITS 16]
[ORG 0x0000]

However, in the kernel textbook, it starts with:

[ORG 0x0000]
[BITS 16]

I was wondering if the order in which these directives changed? I am using NASM version 2.06rc2, OpenSUSE 11.2

+3
source share
2 answers

The latest NASM is on version 2.08, and judging by the documentation for the BITS Directive .

, NASM , , 16 . , NASM, , , , .

+3

, , :

        cpu 8086
        bits 16
        org 256

( bits 16 NASM, , , bits 32.)

, - "" non- . https://www.nasm.us/xdoc/2.14.02/html/nasmdoc6.html#section-6.1

BITS , [BITS16], [BITS32] [BITS64]. - , , .

+1

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


All Articles