nasm and effect of the org directive

NASM and the effect of changing the ORG directive from note “nasm and effect of org directive” based on tutorials from http://www.supernovah.com/Tutorials/index.php  website by Alex Jorg….

http://www.supernovah.com/Images/Signature.png ………:
:
asm.txt:
asm.txt:
[BITS 16]
[ORG 0x0]
jmp 0x0:Start
Start:
cli
mov AX,0x9000
mov SS,AX
mov SP,0xFB00
sti
cli
hlt

listing.txt:

1                                  [BITS 16]
2                                  [ORG 0x0]
3
4 00000000 EA[0500]0000            jmp 0x0:Start
5
6                                  Start:
7 00000005 FA                      cli
8 00000006 B80090                  mov AX,0x9000
9 00000009 8ED0                    mov SS,AX
10 0000000B BC00FB                  mov SP,0xFB00
11 0000000E FB                      sti
12
13 0000000F FA                      cli
14 00000010 F4                      hlt
15
16 00000011 00<rept>                times 510 – ($ – $$) db 0
17 000001FE 55AA                    dw 0xAA55

ndisasm.txt:
00000000 EA05000000 jmp word 0x0:0x5
00000005 FA cli
00000006 B80090 mov ax,0x9000
00000009 8ED0 mov ss,ax
0000000B BC00FB mov sp,0xfb00
0000000E FB sti
0000000F FA cli
00000010 F4 hlt

*******************************
asm.txt:
[BITS 16]
[ORG 0x7C00]
jmp 0x0:Start
Start:
cli
mov AX,0x9000
mov SS,AX
mov SP,0xFB00
sti
cli
hlt

listing.txt:

1                                  [BITS 16]
2                                  [ORG 0x7C00]
3
4 00000000 EA[0500]0000            jmp 0x0:Start
5
6                                  Start:
7 00000005 FA                      cli
8 00000006 B80090                  mov AX,0x9000
9 00000009 8ED0                    mov SS,AX
10 0000000B BC00FB                  mov SP,0xFB00
11 0000000E FB                      sti
12
13 0000000F FA                      cli
14 00000010 F4                      hlt
15
16 00000011 00<rept>                times 510 – ($ – $$) db 0
17 000001FE 55AA                    dw 0xAA55

ndisam.txt:

00000000 EA057C0000 jmp word 0x0:0x7c05
00000005 FA cli
00000006 B80090 mov ax,0x9000
00000009 8ED0 mov ss,ax
0000000B BC00FB mov sp,0xfb00
0000000E FB sti
0000000F FA cli
00000010 F4 hlt

Leave a comment