flat assembler
Message board for the users of flat assembler.

Index > Main > use "org" command on data segment

Author
Thread Post new topic Reply to topic
golant85



Joined: 01 Dec 2013
Posts: 1
Location: Israel
golant85
hye i try to use "org" command on dseg and somhow it's not working
there is some of my code that i write
dseg segment
N1 db 6
org 10h
TABLE1 db 3,12h,13h,15h,34h,7Ah
N2 db 5
org 30h
TABLE2 db 4,12h,14h,15h,87h
dseg ends

cseg segment
assume ds:dseg, cs:cseg

begin: mov ax,dseg
mov ds,ax

;--- cecking for equal values & coping unique values ----

mov ax,0 ;<=== reset regiter AX to 0
mov bx,0 ;<====reset counter to 0
mov cx,0 ;<=== reset counter2 to 0
mov bl,N1[0] ;<=== move value from N1 to register BL
mov cl,N2[0]
mov di,0 ;<=== move pointer DI to the first cell
mov si,0 ;<=== move pointer SI to the first cell
start: mov al,TABLE1 [si];<=== transfer value from TABLE1 array to register AL
mov ah,TABLE2 [di];<=== transfer value from TABLE 2 array to register AH
cmp al,ah
je eqq
jne neq



if someone can help to understand why if i use org commend it not working well
Post 01 Dec 2013, 05:57
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
> hye i try to use "org" command on dseg and somhow

Hi I try to use "org" directive on dseg(?) and somehow

Code:
N1 db 6
org 10h
TABLE1 db 3,12h,13h,15h,34h,7Ah
N2 db 5
org 30h
TABLE2 db 4,12h,14h,15h,87h
dseg ends
cseg segment
assume ds:dseg, cs:cseg 
    


0. Welcome to the FASM forum Smile

1. Please use [ c o d e ] tags

2. FASM doesn't support "assume" ... please RTFM (the official FASM manual), check what assembler you actually use, and check the FAQ's in this forum Smile

PS: org doesn't affect data ... it affects absolute addresses only http://flatassembler.net/docs.php?article=manual#2.2.4

(someone move in into Main please, I can't)
Post 03 Dec 2013, 09:52
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
golant85,

That source looks like MASM fragment. With slight ornamental works it compiles and links fine. Thus I deduce that you're trying to compile MASM source with fasm (or, in other words, don't understand what you're doing).
Post 03 Dec 2013, 10:49
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.