Download 8085/Z80 ASSEMBLER USER`S MANUAL
Transcript
DSM85 User t s Manual ) Page 3-10 3.10 Forvard Rererences A for"ard reference is a reference to a symbol vhich is not defined until later in the source program. For example, take the folloving program fragment: DS GRINeH EQU DS GRINCH+I 7 GRINCH+I The use of GRINeR in the first DS statement 15 a for"ard reference, since GRINeH has not yet been defined vhen this statement is encountered. The use of GRINeR in the second DS is not a forvard reference, as the statement defining GRINeR bas already been encountered. ) There are a number of places in the assembly language "here forvard references, and expressions containing them, are specifically prohibited. The general rule is that a forvard reference is not alloyed vhere the value of the expression affects the location counter or controls the number of bytes of code generated. Most cases vhere this occurs are in pseudo-instructions; if' forvard ref'erences are not allo"ed, this viII be stated In the p;eudo-op descrip tion. The assembler viII report an ifF" error vhenever it finds an illegal forvard reference. To further clarify the notion of a forvard reference, consider the folloving statement: JMP $+5 Tbe expression $+5 is not a forvard reference, even though the jump is forvard, because the value of the location counter ($) is already knovn "hen the JMP statement is processed. )