I'm currently working on a MS-DOS .com file application using Turbo Assembler 1.0. The file starts with the following assembler directives.
DOSSEG
.286
.MODEL tiny
.CODE
ORG 100h
This assembles fine so far; however, if .286
is changed to .386
TASM generates error messages "Forward reference needs override". This is somewhat correct, as variables are accessed but defined later.
- Why don't these error messages appear when assembling with the
.286
directive? - What can I do to fix these error messages? If, for instance, there is a later variable definition like
Variable dw ?
, how can this be taken care of in an earlier reference? What is the TASM syntax for this?
Edit: Let me be more specific by giving full examples.
Version 1: Works fine.
DOSSEG
.286
.MODEL tiny
.CODE
ORG 100h
Main:
inc Var
ret
Var dw ?
END Main
Version 2: Error message "Forward reference needs override" (after enabling 386 opcodes).
DOSSEG
.386 ; <-- this has changed
.MODEL tiny
.CODE
ORG 100h
Main:
inc Var
ret
Var dw ?
END Main
Version 3: Also complains about "Forward reference needs override", although I believe to have indicated the size of the variable.
DOSSEG
.386
.MODEL tiny
.CODE
ORG 100h
Main:
inc word ptr Var ; <-- this has changed
ret
Var dw ?
END Main