flat assembler
Message board for the users of flat assembler.

Index > DOS > compile error A2070: invalid instruction operands

Author
Thread Post new topic Reply to topic
Q2



Joined: 21 Jan 2006
Posts: 1
Q2 21 Jan 2006, 21:18
Hi,

does anybody know which exactly is wrong here? compiler gives me an
Code:
error A2070: invalid instruction operands    


Programm should count from 0 to 255 and output actual number. Theoretically very simple. Rolling Eyes

Code:
.MODEL small 

.CODE

        mov CL,0 ; initialize

        mov AL,CL ; output
        mov AH,02H
        int 21H

START:

        inc CL ; incrementing     

        mov AL,CL ; output
        mov AH,02H
        int 21H        

        mov AL,CL ; max. 256 outputs
        cmp AL,255   
        jne START

        .EXIT
    
Post 21 Jan 2006, 21:18
View user's profile Send private message Reply with quote
daluca



Joined: 05 Nov 2005
Posts: 86
daluca 22 Jan 2006, 08:12
i see you are using .MODEL so are you a FASM user?
i now fasm don't give errors like "A2070"
and i think that the 02H function of int 21 for character output takes the
character in dl not al the code in fasm is like:
Code:
org 100h
mov CL,0 ; initialize

        mov dl,CL ; output
        mov AH,02H
        int 21H

START:

        inc CL ; incrementing

        mov dl,CL ; output
        mov AH,02H
        int 21H

        mov dl,CL ; max. 256 outputs
        cmp dl,255
        jne START
ret                
    

you see i sustitude the al for dl this works fine in my machine
but your question is about the compiler giving an error
if you are usin masm i think you have to use the linker too
and maybe somethin like end START i realy don't have much
experince with masm.
Post 22 Jan 2006, 08:12
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.