CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Mar 2009
    Posts
    13

    operand type does not match

    Im making a progam that ask for a value. The program than calculates values into a formula.
    My problem MOV U, AX. It generates a error (OPERAND TYPES DO NOT MATCH)

    here is my code
    Code:
    		page	58, 132
    		name	RUN
    		title	RUN (Executes a program specified on the cmd line).
    		
    
    
    
    		include	consts.a
    		include stdin.a
    		include stdout.a
    		include misc.a
    		include memory.a
    		include	strings.a
    
    		.list
                    include                 stdlib.a
                    includelib              stdlib.lib
                    
    
    dseg            segment public
    
    I db 44
    testtest db ?
    u               db    ?
    v               db    ?
    w               db    ?
    x               db    ?
    y               db    ?
    
    
    dseg            ends
    cseg segment public 'code'
    
    
    
    cseg ends
    
    
    
    
    CSEG		segment public 'CODE'
    		assume	cs:cseg, ds:cseg 
    
    
    ; Variables used by this program.  Okay, so I'm lazy and should have put
    ; them into their own segment.  However, you will not that I do not assume
    ; that these variables are in the code segment.
    geti            equ <call _geti>
    _geti           proc
                    push    es
                    push    di
    
                    getsm
                    atoi
                    free
    
                    pop     di
                    pop     es
                    ret
    _geti           endp
    
    
    
    Main		proc
    		mov ax, dseg
    		mov ds, ax
    		mov es, ax
    		meminit
    
    ; If you want to do something before the execution of the command-line
    ; specified program, here is a good place to do it:
    
    
    
    
    
    print
                    db    "Abitrary expression program",cr,lf
                    db    "---------------------------",cr,lf
                    db    lf
                    db    "Enter a value for u: ",0
    
                   geti
                    mov    u, ax
    
    ;I HAVE NOT DONE THE FORMULA YET, BUT I WILL
                    
    
    
    
    
    
                  
                    
                    
                   
                    
                    
    		
    
    
    ; Okay, if you have any great deeds to do after the program, this is a
    ; good place to put such stuff.
    
    
    
    
    ; Return control to MS-DOS
    
    Quit:		ExitPgm
    
    Main		endp
    
    
    cseg		ends
    
    
    
    sseg		segment	para stack 'stack'
    		dw	1024 dup (0)
    endstk		dw	?
    sseg		ends
    
    ; Seg aside some room for the heap.
    
    zzzzzzseg	segment	para public 'zzzzzzseg'
    		public	Heap
    Heap		db	200h dup (?)
    zzzzzzseg	ends
    
    		end	Main

    Im using TASM assembler. Also, Why can i not use WORD in my DSEG, I have to use DB or it will give me UNDEFINED SYMBOL: U.

    Also.. the "mov u, ax" can be fixed with "mov WORD PTR U, ax"....but than i get (CANT ADDRESS WITH CURRENTLY ASSUMED SEGMENT REGISTERS.
    Last edited by access1011; April 18th, 2009 at 03:16 AM.

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

Featured