Hello All, My brain is on leave and I can't translate the following. (I know I know how to do it...) *pSomething = 1; Help! Thanks. Xtreme
Posted on 2001-02-06 02:16:00 by Xtreme
In a miraculous turn of events I started thinking again. mov , 1 Yippee!!! Xtreme
Posted on 2001-02-06 02:28:00 by Xtreme
Close, but not quite there. Try the following.

    mov  eax,
    mov  dword ptr , 1
This message was edited by tank, on 2/6/2001 2:54:25 AM
Posted on 2001-02-06 02:51:00 by tank
i think in c, the * means pointer, that is, and you found it, it means :

    mov    dword ptr ,1
roy http://www.effervescence.com these thingies are *soooo* cool
Posted on 2001-02-06 08:10:00 by roy
Except if thingie is a memory address, the x86 doesn't support such an instruction. The assembler will reject it and won't generate the two instructions I wrote.
Posted on 2001-02-07 13:57:00 by tank
Actually, this is a complete mind-bleep. I use indirection all the time in asm (COM is all indurection), and I still screw it up all the time. Example 1:

Var   DWORD  ?

mov Var, NULL       ; these both generate IDENTICAL code
mov , NULL     ; (masm assumes the brackets)
Indirection is most useful when passing params to a proc BY REFERENCE (address of). Passing a reference means the procedure may change the variable itself

invoke SomeProc, ADDR Var
invoke SomeProc, pVar           ; equivalent statements

SomeProc PROC  pResult:DWORD
  mov ecx, pResult   ; get the address
  mov eax, NULL      ; set-up the return value
  mov , eax     ; move the return value to the address passed in

  mov , NULL    ; ILLEGAL Instruction, no immediate to mem mode
SomeProc ENDP    
This can be lots more fun (and actually useful too) if you pass the address of a structure, then get each element from that one pointer:

OtherProc  PROC  pRect:DWORD
   mov ecx, pRect
   mov eax, .RECT.right
   sub eax, .RECT.left
   ret     ; width of the rect is in eax
OtherProc  ENDP
This message was edited by Ernie, on 2/25/2001 2:11:09 PM
Posted on 2001-02-25 14:10:00 by Ernie