GIDForums  

Go Back   GIDForums > Computer Programming Forums > Assembly Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 01-Feb-2009, 03:34
minameisricky minameisricky is offline
New Member
 
Join Date: Feb 2009
Posts: 1
minameisricky is on a distinguished road

Error A2070: invalid instruction operands


; Find the sum and average for trapeziod arrays.

area_stats macro areas, len, asum, aave
local asum_lp
mov cx, len
lea bx, areas
mov asum, 0
asum_lp:
mov ax, word ptr[bx]
add asum, ax
add bx, 2
dec cx
cmp cx, 0
jg asum_lp
mov ax, asum
mov dx, 0
div len
mov aave, ax

endm

This is the envocation of the macro-
trap_areas height1, a_side1, c_side1, len1, areas1

These are the data declarations-
a_side1 db 10, 15, 10, 13, 14, 17, 10, 6, 13, 11
b_side1 db 15, 2, 13, 6, 12, 16, 7, 12, 10, 12
c_side1 db 11, 12, 3, 9, 7, 6, 17, 6, 1, 5
height1 db 4, 12, 11, 3, 8, 12, 14, 13, 18, 9
areas1 dw 10 dup (?)
perims1 dw 10 dup (?)
len1 dw 10
asum1 dw ?
aave1 db ?
psum1 dw ?
pave1 dw ?

These are the errors the assembler gives me. I am using MASMv6.
asst5.asm(225) : error A2070: invalid instruction operands
area_stats(15): Macro called from
asst5.asm(225): main line code

I have 5 of these when i try to assemble.

Any help would be greatly appreciated.
  #2  
Old 01-Feb-2009, 10:35
Howard_L Howard_L is offline
Regular Member
 
Join Date: Apr 2007
Location: Maryland/PA, USA
Posts: 800
Howard_L is a jewel in the roughHoward_L is a jewel in the roughHoward_L is a jewel in the rough

Re: new to assembly, trying to get macros to work


I would like to help but I have not used masm yet.
Is that masmv6 assembler part of Visual Studio or is it separate?
Does it come with XP Home?
Do you use it on the command line or IDE?
  #3  
Old 02-Feb-2009, 14:44
Howard_L Howard_L is offline
Regular Member
 
Join Date: Apr 2007
Location: Maryland/PA, USA
Posts: 800
Howard_L is a jewel in the roughHoward_L is a jewel in the roughHoward_L is a jewel in the rough

Re: Error A2070: invalid instruction operands


Are you saying that this is the invocation at line 225?:
CPP / C++ / C Code:
trap_areas height1, a_side1, c_side1, len1, areas1
Which is supposed to calling this macro?:
CPP / C++ / C Code:
area_stats macro areas, len, asum, aave
Those names don't match. Is that the right line 225?
The number of args don't match either.
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
32 bit assembly code doesn't work on 64 bit vikramaditya Assembly Language 1 08-Jan-2009 17:49
Mixing C and assembly in x86 - Makefile nuances aijazbaig1 Assembly Language 3 23-Apr-2008 09:29
Random access files Krazy_yA C Programming Language 6 07-May-2006 02:44
How do web redirection scripts work? rhino1616 Web Design Forum 9 27-Oct-2003 10:47

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 07:18.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.