error A2081: missing operand after unary operator
It's referring to the line with the label sbyte: If I comment that label
out, the error stops. I don't get this. This should assemble, as it
appears to be entirely valid code (a basic mov command)
The offending code follows.
.
.
.
jmp bbyte ; do we need another biggie?
jl451:
sbyte:
mov ax,-1 ; get mask
.
.
.
>sbyte:
--
40th Floor - Software @ http://40th.com/
PhantasmX - The finest sound in the world
phantasm.40th.com
Thanks for the assist.
Any thoughts on why this is causing this error:
error A2070: invalid instruction operands
It looks like the offset keyword causing the problem.
There are a few lines of code, all of which involve specifically
[bx+offset kbdtbl]
seen in
mov al,[bx+offset kbdtbl]
>JD wrote:
>> h...@40th.com wrote:
>>> sbyte is probably a reserved word. Use xsbyte:
>>> ml 6.11 - I haven't used that in more than a
>>> decade.
>>>
>>> >sbyte:
>>>
>> You were right! sbyte was reserved. No wonder it was looking for an
>> operand. This code was from 1990-1991, so I wouldn't be shocked if it
>> came from before masm 6.11 (I'm thinking 5.1)
MASM 6.x includes rudimentary variable typing. SBYTE, SWORD, and SDWORD
are the signed versions of BYTE, WORD, and DWORD.
>Any thoughts on why this is causing this error:
>error A2070: invalid instruction operands
>
>It looks like the offset keyword causing the problem.
>
>There are a few lines of code, all of which involve specifically
>[bx+offset kbdtbl]
>
>seen in
>
>mov al,[bx+offset kbdtbl]
How is "kbdtbl" defined, and in what segment?
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
>> >error A2070: invalid instruction operands
>> >mov al,[bx+offset kbdtbl]
>>
> I'll take a look at the code today. However I found that removing "offset"
> allowed masm to build. Don't know if there's a problem with the code now,
> but since bx+label should be an address, maybe the original author was
> being explicit that he meant the address of kbdtbl, and it isn't required.
The value of the kbdtbl is its segment address. Look at the instruction
mov al,[kbdtbl]
it stores the first byte at address kbdtbl, i.e. DS:offset of kbdtbl, to
the register al.
The original instructions uses the bx register. The format of the second
operand of the command is
DS: offset of kbdtbl + BX..
When you use [bx+offset kbdtbl] you get a scalar value of offset only while
the address should include a base register.
Vladimir Grigoriev