flat assembler
Message board for the users of flat assembler.

Index > OS Construction > question about data directives

Author
Thread Post new topic Reply to topic
jatos



Joined: 04 Nov 2006
Posts: 20
jatos
I just wondering with data directives, are there any trick I could use to put a data directive that is say bits 16-31 of a memory reference, for things like descriptors in the GDT and IDT

so say I had the label

int_1:

is there anyway I could put something after a dw directive that referenced bits 16-31 of memory location of int_1: label.

_________________
Jamie
Post 23 Apr 2008, 18:26
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17665
Location: In your JS exploiting you and your system
revolution
Code:
int1:
...
dw int1 shr 16    
But you need to state your file format, this won't work with some formats due to relocations etc.

Is that that what you are asking?
Post 23 Apr 2008, 18:52
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
Code:
easy:
dd int_1
...
mov eax,[easy]
shr eax,16
    
Post 23 Apr 2008, 19:26
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Code:
easy:
dd int_1
...
mov ax,[easy+2]
    
Post 23 Apr 2008, 19:37
View user's profile Send private message Visit poster's website Reply with quote
jatos



Joined: 04 Nov 2006
Posts: 20
jatos
I will keeping this for flat binary files, currently with the org of 0x1600 (where a boot loads the binary file from)

For my text trick, the same for bits 0-15, should be easy enough.
Post 23 Apr 2008, 19:51
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.