My task was to create a program that would copy a file. Ok, didn't look too hard using the textbook and class notes, heavily borrowing from the textbook.

However these 2 errors have me stumped.

invalid instruction operands

segment, group, or register expected.

The first one refers to this:

mov Values, ax

Values is declared as:
Values db ?

The second one refers to the ReadString Procedure:
call Read:proc

I did equ it to Read.

Read equ _ReadString@0

6 Years
Discussion Span
Last Post by low_coder

The first error could be because of two things. If you're using MASM, it probably has to do with operand sizes (AX is a WORD while Values is a BYTE). In that case, use one of the following lines to replace you're old lines:

Values dw ?       ; Declare 'Values' as a WORD
mov Values,al     ; Move lower bits of AX into Values

If you're not using MASM, then the problem could be that you have no square brackets ('') around 'Values' in you're mov instruction.

For the second problem, I think you shouldn't use 'Read:proc', just 'Read'. None of the assemblers I have ever worked with uses the ':proc' notation for common procedures.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.