I'm trying to compare a value in the data segment (an item in an array) to the ASCII character value for a space (20h, stored in a register) using a cmp instruction in MASM.
The instruction i'm attempting to use is:
cmp [ds:bp + si + 1],cx
My goal is for ds:bp to represent the offset of an array into the data segment, si to contain the offset of a row into the two-dimensional array, and 1 (or a constant) to represent the element's position in a row.
However, when moving to assemble my code in MASM, i get
error A2032: invalid use of register
in my mind, I'm using a base register, an index register and a constant, so all the components of indirect addressing are present.
I'm not sure what's going wrong; please have mercy on me, I'm new.
Appreciate help.