Click to See Complete Forum and Search --> : I'm a beginner, I was a higher level language programmer, this is a beginner question


Fatboy
December 29th, 2004, 05:23 PM
This is the code.................


dosseg
.model small
.stack 200h
.data
.code

start:
mov ax, 0a000h
mov es, ax

mov ax, 100
mov bx, 100
mov cx, 200

sub cx, ax
mov di, ax
mov dx, bx
shl bx, 8h
shl dx, 6h
add dx, bx
add di, dx

mov al, 1
rep stosb
end start


The assembler is masm32, the file name is simple.asm, and here is my problem................


Assembling: simple.asm
simple.asm(19) : error A2070: invalid instruction operands
simple.asm(20) : error A2070: invalid instruction operands






Please help, it's easy right? Thanks.

NoHero
December 30th, 2004, 07:07 AM
Line 19 and 20 are these:


add dx, bx
add di, dx


But those instruction seems alright though; Is this the correct code?

Fatboy
December 30th, 2004, 09:30 AM
Sorry, I think the assembler meant these lines:

shl bx, 8h
shl dx, 6h

NoHero
December 30th, 2004, 09:44 AM
My assembler does not complain about your code. Have you posted the right one, because I think this code is fine.

Fatboy
December 30th, 2004, 05:03 PM
hmmmmmm.................wait....................


Hey NoHero, I feel like I owe you something now.

NoHero
January 1st, 2005, 08:27 AM
Hey NoHero, I feel like I owe you something now.

a good reputation? ;) :D

/ kidding

SuperKoko
February 19th, 2005, 11:46 AM
Hello.

incorrects instructions are :

shl bx, 8h
shl dx, 6h

You cannot use immediate operands non equal to 1 with shl for 8086!
Just introduce a .186 or .286 after the dosseg directive!

I think that it would work for Turbo Assembler and maybe MASM !