.model tiny
.data
L1 db 30h
L2 db 40h
.code
start:
org 100h
mov ax, [L1]
mov bx, [L2]
add ax, bx
end start
MASM611 error message is:
Assembling: test.asm
test.asm(10): error A2070: invalid instruction operands
test.asm(11): error A2070: invalid instruction operands
someone tell me what's wrong with my code? :'(
You have defined your data as byte and are trying to move it into 16 bit registers, you should use al & bl, also the brackets are not needed.
Quote from: Neil on February 27, 2009, 09:29:56 AM
You have defined your data as byte and are trying to move it into 16 bit registers, you should use al & bl, also the brackets are not needed.
I thought if the brackets are missed, the address will be loaded into registers.
I am a newbie and I will try your advice, thank you
Quote from: Cao Huanyin on February 27, 2009, 03:42:29 PM
Quote from: Neil on February 27, 2009, 09:29:56 AM
You have defined your data as byte and are trying to move it into 16 bit registers, you should use al & bl, also the brackets are not needed.
I thought if the brackets are missed, the address will be loaded into registers.
I am a newbie and I will try your advice, thank you
Hi,
A diifferent assembler uses that action (NASM). MASM uses
the OFFSET operator to load an address.
MOV BX,L1 ; loads the contents of L1
MOV BX,[L1] ; loads the contents of L1
MOV BX,OFFSET L1 ; loads the address offset of L1
Steve N.
Oh...... different rules for different tools...... it is easy to make newbie confused.....
Quote from: FORTRANS on February 27, 2009, 06:30:43 PM
Hi,
A diifferent assembler uses that action (NASM). MASM uses
the OFFSET operator to load an address.
MOV BX,L1 ; loads the contents of L1
MOV BX,[L1] ; loads the contents of L1
MOV BX,OFFSET L1 ; loads the address offset of L1
Steve N.