NASM: How to declare a far pointer? 
Author Message
 NASM: How to declare a far pointer?

I have a program that I'm trying to get into NASM syntax from standard X86
syntax.  I apologize in advance if this is out of the scope of this
newsgroup... anyway, it's a pretty simple question (I think).. I just have
a function

keyrt: timeout:WORD, key:FAR PTR, latency:FAR PTR

And NASM doesn't like this declaration.  I knwo how to declare timeout as

        timeout         dw      0

But wasn't sure about the pointers.  Any help would be appreciated.
Thanks!
Tyler



Sun, 23 Dec 2001 03:00:00 GMT  
 NASM: How to declare a far pointer?

Quote:

> I have a program that I'm trying to get into NASM syntax from standard X86
> syntax.  I apologize in advance if this is out of the scope of this
> newsgroup... anyway, it's a pretty simple question (I think).. I just have
> a function

> keyrt: timeout:WORD, key:FAR PTR, latency:FAR PTR

> And NASM doesn't like this declaration.  I knwo how to declare timeout as

>         timeout         dw      0

> But wasn't sure about the pointers.  Any help would be appreciated.

A far pointer is simply two words containing the offset in the word at
the lower memory address) and the segment (or the selector in pmode) in
the word at the higher memory address. You could use something like

key     dd      address ; whatever the address is

or

key     dw      ofs,seg ; whatever ofs and seg are

HTH,
        AriL
--
Whom computers would destroy, they must first drive insane.
Homepaged at http://www.angelfire.com/or/lukumies



Mon, 24 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to declare procedure [nasm]

2. NASM far calls/jmps

3. NASM far Externals.

4. Far Jump in NASM

5. Declaring nested structure in NASM.

6. NASM far calls/jmps

7. Far jumps with NASM

8. NASM Macro Warnings - Further thoughts

9. Far Jump in NASM

10. How to declare program entry point with NASM?

11. Far Pointers and String Instructions

12. far pointer in assembler question

 

 
Powered by phpBB® Forum Software