flat assembler
Message board for the users of flat assembler.

Index > Main > Pointers to Buffer or Struc

Author
Thread Post new topic Reply to topic
darkshadow6921



Joined: 20 Aug 2006
Posts: 3
darkshadow6921
Ok I am just not getting it Sad Can someone give me an example or point me to an example for the following:

am calling (VESA Return Super VGA Information)

mov ax,4f00h

need to setup pointer to ES:DI which needs to be a 256 byte buffer or struct

what is the proper way to return the segment and offset of my buff or struct when i dont have the keywords of seg or offset to use... Confused I understand how to get the data out of the buffer just not into it.
Post 20 Aug 2006, 07:47
View user's profile Send private message Yahoo Messenger Reply with quote
Mr_Silent



Joined: 25 Apr 2006
Posts: 30
Mr_Silent
if I understand you correctly...
Code:
buffer rb 256
....
les di, [buffer] ;es:di
    
Post 20 Aug 2006, 16:38
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7756
Location: Kraków, Poland
Tomasz Grysztar
LES loads the pointer from the given memory area, so this wouldn't work.
Basically when you write the .COM program, it's enough to set up the DI to "buffer" offset, since ES is already the same as CS and DS.
If you write multisegment program, it's up to you to know to which segment the given offset applies to ("buffer" label itself is always just an offset).
Post 20 Aug 2006, 16:46
View user's profile Send private message Visit poster's website Reply with quote
darkshadow6921



Joined: 20 Aug 2006
Posts: 3
darkshadow6921
Ok thanks guys, Tomasz your detailed explaination makes sense (after re reading it several times..hehe). I removed the les di, buffer line and just did a


mov di, buffer

and when i dump the data from the buffer with a print command, the tell-tale signs of VESA show up.. so the data seems to be getting there now.

Thanks again Very Happy
Post 21 Aug 2006, 03:02
View user's profile Send private message Yahoo Messenger 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 YouTube, Twitter.

Website powered by rwasa.