flat assembler
Message board for the users of flat assembler.

Index > Main > ORG question/problem

Author
Thread Post new topic Reply to topic
A.Cipher



Joined: 19 Jul 2008
Posts: 5
A.Cipher 25 Jul 2008, 21:05
Hello,

I was hoping that someone may help me with this.

I'm trying to organize my compilation at 0x200
in all my tests I find that fasm is compiling it at 0x100

test.asm
Code:
org 200h

mov ax,99h
    


test dissembled
Code:
; title Disassembly of file: TEST.BIN - produced by DASM.EXE v1.02

L0099           equ     0x0099

org             0x0100

L0100:          mov     ax,L0099

    


Thanks,
A.Ci
Post 25 Jul 2008, 21:05
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 25 Jul 2008, 21:39
org does nothing when you're directly loading a number into a register
It affects jumps and moving locations into registers and stuff like that.

Like:
Code:
org 200h
mov ax,loc1

loc1:
    

will disassemble to
Code:
mov ax,203h
    
Post 25 Jul 2008, 21:39
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
DOS386 26 Jul 2008, 06:34
> I'm trying to organize my compilation at 0x200
> in all my tests I find that fasm is compiling it at 0x100

Problem specific to DOS COM ... DOS loads COM's always at $0100. Idea
Post 26 Jul 2008, 06:34
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 26 Jul 2008, 10:18
Do you need to position code at 0x200 in binfile, or just to assemble it as if it starts at 0x200?
org directive does no more than change base for the following code. No padding, no alignment Wink
Post 26 Jul 2008, 10:18
View user's profile Send private message Reply with quote
A.Cipher



Joined: 19 Jul 2008
Posts: 5
A.Cipher 26 Jul 2008, 14:31
Thanks guys,

the easiest way to explain is I was just trying to position/pad it to start at 0x200 in bin file.

I finally did just add in
Code:
times 100- ($-INITIAL)  db 0    


A.Ci
Post 26 Jul 2008, 14:31
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.