Results 1 to 3 of 3

Thread: difficult!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    166

    difficult!

    hello everyone !

    i've a very strange question. i'm using asm block in VC++. i need to pass arguements argv[1],argv[2], etc to the C program.

    when i write
    mov ebx,argv[1]

    its taking the address of argv[1] in ebx. is there any way by which i can pass the value of argv[1] in ebx ??

    pls reply asap.

    thanks in anticipation.

    shruti !!




    #include <stdio.h>
    #include <conio.h>
    #include<string.h>

    void main(int argc,char *argv[])
    {
    char *a;
    a=argv[1];

    _asm
    {
    mov DX,3f8H
    mov ebx,a
    mov eax,ebx
    out dx,AL

    }
    getch();
    }

  2. #2
    Hyperactive Member
    Join Date
    Jun 2002
    Posts
    299
    put it in brackets [a]
    If I agree with you today, don't get used to it.

  3. #3
    Code:
      mov ebx, argv[1]           ; address of argv[1] into ebx
      mov al, byte ptr [ebx]    ; read the byte at this address into al

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width