delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/16/19:45:17

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ....I know...
Date: 16 Aug 2000 16:03:48 -0700
Organization: Posted via Supernews, http://www.supernews.com
Lines: 32
Sender: nate AT mercury DOT bitbucket
Message-ID: <83em3ox0yz.fsf@mercury.bitbucket>
References: <zvFl5.2159$By6 DOT 31387 AT news1 DOT online DOT no> <t0sfpsgrntmfofa91jq7ut5cc1p1943729 AT 4ax DOT com> <JXBm5.4390$By6 DOT 71767 AT news1 DOT online DOT no>
X-Complaints-To: newsabuse AT supernews DOT com
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5
MIME-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Vermin" <ratspl AT hotmail DOT com> writes:

> ..I'm quite aware of how asm works... I actually coded in asm before I
> started in DJGPP/C++.
> What I wanted to know was for instance that "&" gives the mem pos of the
> variable, sort of like
> 
> mov ax, anIntVar
> 
> instead of
> 
> mov ax, [anIntVar]
> 
> ...but how does -> and * work??

For *, you load the pointer into some register, and then move
indirectly.

mov eax, pointer
mov result, [eax]

-> does the same thing, but adds the offset of the desired field.  So
if the field is 8 bytes from the beginning of the struct, you might
have

mov eax, pointer
mov result, [eax+8]

-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019