Re: A83: Out of Range.
[Prev][Next][Index][Thread]
Re: A83: Out of Range.
No, they do. He was explaining how they would be used to store jump
addresses.
A byte is only enough to hold a relative address. A word is enough to store
an absolute address.
However, doing a '.db exit' will NOT store the relative address. Relative
to what? There is no way for the assembler to tell. It will attempt to
store the absolute address and give a warning (at least it should!) that
there is unused data. If you really need to store a relative address, it
can be done as follows:
Label =$+1
jr 0
.db Exit-Label
In this case, the relative address will be used for the JR below 'Label'.
> > db exit = Relative address of exit (like jr)
> > dw exit = Absolute address of exit (like jp... or ld (...),...)
>
> So 'db' and 'dw' have nothing to do with 'data byte' and 'data word'?
References: