|
-
Mar 8th, 2003, 08:15 AM
#1
Thread Starter
Addicted Member
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();
}
-
Mar 8th, 2003, 11:25 AM
#2
Hyperactive Member
If I agree with you today, don't get used to it.
-
Mar 9th, 2003, 09:08 PM
#3
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|