Results 1 to 3 of 3

Thread: quite difficult !

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    166

    quite difficult !

    hello

    i'm writing this C program to run a asm. i want to pass command line arguements to this asm.
    but when i use mov cx,argv[1], it says operand size conflict. may be because mov requires 1 byte and argv[1] is sending 2 bytes. what is the possible solution ?? i need to use command line arguements only, what is the other way out to do this ?

    i'm also including a sample program. pls suggest me how to go abt it.

    waiting for a quick response.

    thanks
    shruti !!



    Code:
    #include <stdio.h>
    #include <conio.h>
    #include<string.h>
    
    void main(int argc,char *argv[])
    {
    
    	FILE *fptr;
    	printf("in func\n");
    
    	
    _asm
    {
              MOV     CX,0FF20H
       	  MOV     DX,3F8H
    	
    }   
    
    
    getch();
    }

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    I have moved your thread into the C/C++ forum as you should get a better response in here.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    argv[1] is one byte, cx is a 2-byte register. Try cl.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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