-
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();
}
-
-
Code:
mov ebx, argv[1] ; address of argv[1] into ebx
mov al, byte ptr [ebx] ; read the byte at this address into al