flat assembler
Message board for the users of flat assembler.

Index > Main > y dw x ; 16 bit offset

Author
Thread Post new topic Reply to topic
lazer1



Joined: 24 Jan 2006
Posts: 185
lazer1 17 Feb 2006, 20:28
How do I do the following?: Rolling Eyes

Code:
      org 10000h
y     dw   x
x     db   5
    


here I want y to have the offset of x's address ie 2,
x's address is 10002,

fasm rejects this as x is not 16 bit,

I tried:

Code:
y   dw word x
    


but fasm doesnt accept that! Surprised
Post 17 Feb 2006, 20:28
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 17 Feb 2006, 21:13
Code:
      org 10000h
ref:
y     dw   x-ref
x     db   5
    

hello, you mean this?
Post 17 Feb 2006, 21:13
View user's profile Send private message Visit poster's website Reply with quote
lazer1



Joined: 24 Jan 2006
Posts: 185
lazer1 17 Feb 2006, 22:20
Matrix wrote:
Code:
      org 10000h
ref:
y     dw   x-ref
x     db   5
    

hello, you mean this?


yes! Razz

I didnt see the ref: label at first,
once that was put it then functioned,
Post 17 Feb 2006, 22:20
View user's profile Send private message Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM 18 Feb 2006, 18:38
or you might want to to x-$$
Post 18 Feb 2006, 18:38
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.