Re: A83: Help TASM
[Prev][Next][Index][Thread]
Re: A83: Help TASM
TASM is a macro assembler ( = it can have labels and equs), and all macro
assemblers run two passes through the source code. The first pass will put
all equs, labels etc. into some memory structure together with their
equivalence. Say that we have this source code:
whatever equ 3 ;line 1
org 9327h ;line 2
ld b,2 ;line 3
label1: ;line 4
ld a,3 ;line 5
jp z,label1 ;line 6
ret ;line 7
Pass 1 will then scan through the code like this:
Line 1: Remember that whatever = 3.
Line 2: We are at 9327h.
Line 3: Since this instruction is 2 bytes long, we are now at 9329h.
Line 4: ...so label1 = 9329h.
Line 5: This instruction is 2 bytes long, so we are at 932bh.
Line 6: This instruction is 3 bytes long, so we are at 932eh.
Line 7: This instruction is 1 byte long, so we are at 932fh (but who cares).
Now the memory structure says that whatever=0003h and label1=9329h. In pass
2 the following happens:
Line 1: No action.
Line 2: No action.
Line 3: Assemble this instruction -> 0602.
Line 4: No action.
Line 5: Assemble this instruction -> 3e03.
Line 6: Assemble this instruction. We know that label1=9329h, so
the code would be -> ca2993.
Line 7: Assemble this instruction -> c9.
Done!!!
Linus
On 05-May-98, Jimmy Conner wrote:
>I have a semihard question.
>I need to know how the tasm compiler encodes the labels. For example:
>If you have:
>Jimmy:
> ld a,69h
> jr Jimmy
>I need to know how the compiler tells it where it should jump to, in the
>program. Does it go to a certain byte ect...
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
References: