Re: A83: Re: question about moving programs around


[Prev][Next][Index][Thread]

Re: A83: Re: question about moving programs around




No, you can't write relocatable code in z80 with just an assembler.  If a
jump is greater than a signed byte, then you need an absolute jump, which is
not relocatable.  If you want to access memory in your program using a
pointer, it has to be absolute.  Look at ZShell programming.  It's relative,
but you have to use macro's which call routines built into the shell
(located at a fixed address) to do certain things, and you are restricted
greatly when programming.  To access memory that's located within your
program, you must first read a variable located at a fixed address in the
shell to find where your program is, then add the offset of the address in
your program.  You can relocate stuff like Usgard does, but then that adds
space to the program for a relocation table, requires a bunch of special
symbols on variables that need to be relocated, and requires a special tool
that is run when the program is assembled.  The best way to do relocation is
like Rigel does it: relocate the program to a fixed address.

> So you can use your usual programming style, and the assembler will
convert
> it to relocatable code, automagicaly. This off coarse will increase the
> overall size... :(





References: