| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Assembly Questions and Answers for Assembly here! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm a beginner, I was a higher level language programmer, this is a beginner question
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. |
|
#2
|
||||
|
||||
|
Re: I'm a beginner, I was a higher level language programmer, this is a beginner ques
Line 19 and 20 are these:
Code:
add dx, bx add di, dx
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
|
#3
|
|||
|
|||
|
Re: I'm a beginner, I was a higher level language programmer, this is a beginner question
Sorry, I think the assembler meant these lines:
shl bx, 8h shl dx, 6h |
|
#4
|
||||
|
||||
|
Re: I'm a beginner, I was a higher level language programmer, this is a beginner ques
My assembler does not complain about your code. Have you posted the right one, because I think this code is fine.
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
|
#5
|
|||
|
|||
|
Re: I'm a beginner, I was a higher level language programmer, this is a beginner question
hmmmmmm.................wait....................
Hey NoHero, I feel like I owe you something now. |
|
#6
|
||||
|
||||
|
Re: I'm a beginner, I was a higher level language programmer, this is a beginner ques
Quote:
![]() / kidding
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
|
#7
|
||||
|
||||
|
Re: I'm a beginner, I was a higher level language programmer, this is a beginner ques
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 ! |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|