2

For this assembly source code:

.386p
c segment byte use32
mov word ptr ds:foo, ax
foo:   
c ends
end

TASM 1.0, when run as tasm prog.asm, gives the following error:

Turbo Assembler  Version 1.0  Copyright (c) 1988 by Borland International

Assembling file:   PROG.ASM
**Error** PROG.ASM(3) Forward reference needs override
Error messages:    1
Warning messages:  None
Remaining memory:  507k

Upgrading to TASM 1.01 (or later) fixes the problem. Is there a workaround for TASM 1.0?

I do need use32. The problem persists with mov dword ptr ds:foo, eax as well.


As suggested by @dirkt, I've tried adding near and far, but all my attempts resulted in an error:

.386p
c segment byte use32
mov far word ptr ds:foo, ax
mov word far ptr ds:foo, ax
mov word ptr far ds:foo, ax
mov word ptr ds:far foo, ax
mov word ptr ds:foo, far ax
mov far ptr word ptr ds:foo, ax
mov word far ptr ptr ds:foo, ax
mov word ptr far ptr ds:foo, ax
mov word ptr ds:far ptr foo, ax
mov word ptr ds:foo, far ptr ax
mov near word ptr ds:foo, ax
mov word near ptr ds:foo, ax
mov word ptr near ds:foo, ax
mov word ptr ds:near foo, ax
mov word ptr ds:foo, near ax
mov near ptr word ptr ds:foo, ax
mov word near ptr ptr ds:foo, ax
mov word ptr near ptr ds:foo, ax
mov word ptr ds:near ptr foo, ax
mov word ptr ds:foo, near ptr ax
foo:
c ends
end

Error messages:

Turbo Assembler  Version 1.0  Copyright (c) 1988 by Borland International

Assembling file:   PROG.ASM
**Error** PROG.ASM(3) Too few operands to instruction
**Error** PROG.ASM(4) Too few operands to instruction
**Error** PROG.ASM(5) Too few operands to instruction
**Error** PROG.ASM(6) Too few operands to instruction
**Error** PROG.ASM(7) Extra characters on line
**Error** PROG.ASM(8) Argument to operation or instruction has illegal size
**Error** PROG.ASM(9) Too few operands to instruction
**Error** PROG.ASM(10) Forward reference needs override
**Error** PROG.ASM(11) Can't address with currently ASSUMEd segment registers
**Error** PROG.ASM(12) Forward reference needs override
**Error** PROG.ASM(13) Too few operands to instruction
**Error** PROG.ASM(14) Too few operands to instruction
**Error** PROG.ASM(15) Too few operands to instruction
**Error** PROG.ASM(16) Too few operands to instruction
**Error** PROG.ASM(17) Extra characters on line
**Error** PROG.ASM(18) Argument to operation or instruction has illegal size
**Error** PROG.ASM(19) Too few operands to instruction
**Error** PROG.ASM(20) Forward reference needs override
**Error** PROG.ASM(21) Can't address with currently ASSUMEd segment registers
**Error** PROG.ASM(22) Forward reference needs override
Error messages:    20
Warning messages:  None
Remaining memory:  506k
11
  • 1
    Have you tried to use the /m flag? This allows you to specify number of passes so something like /m2 should work in this simple case. That's assuming TASM 1.0 had that flag of course.
    – paxdiablo
    Apr 13 at 3:01
  • 1
    The /m flag has been introduced in TASM 2.0. However, the /m flag shouldn't be necessary, because TASM 1.01 can compile this program.
    – pts
    Apr 13 at 3:55
  • What happens if you actually supply an override, e.g. NEAR or FAR?
    – dirkt
    Apr 13 at 8:33
  • @dirkt: Adding near or far didn't help, I've added the details to the question.
    – pts
    Apr 13 at 23:04
  • 1
    "Too few operands to instruction" is a really interesting error for this... so potentially you need to override something else, and not near/far.
    – dirkt
    Apr 14 at 5:13

0

You must log in to answer this question.

Browse other questions tagged .