So I'm trying to port the released QLSD source for use in my own hardware implementation. This will be on a standard expansion card and so i will need to put the I/O registers at a specified offset from the beginning of the ROM and **NOT** an absolute address.
This should work. PC-relative addressing doesn't like absolute offsets that are directly equated (I pretty much doubt that even if it had worked you'd be ending up at the correct address - I guess you put in the absolute offset of the registers from the beginning instead of the the difference between the PC and the register...). It want's to see these in your code and calculate on its own....
So I'm trying to port the released QLSD source for use in my own hardware implementation. This will be on a standard expansion card and so i will need to put the I/O registers at a specified offset from the beginning of the ROM and **NOT** an absolute address.
You load relative to the PC (program counter) with LEA (load effective address?) an absolute address(?). Relative addressing on the 68k is only -32768 to +32767 (it is not a real 32-bit processor). So if your program is loaded in the TPA, this relative addressing is too large?
Don't know, if this is correct (I haven't do any programming for 68k for long times) - so the assembler (the 68k-processor) can't relocate (do) this (physically not cabable).
http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX
I think you are right. The assembler calculates the distance from the PC to the address - programmers are lazy and this saves 4 characters typing ;-)
http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX
GENIF IS_ROMREL = 1
lea ROMSTART(PC),a5 ; point to base of ROM
ENDGEN
GENIF IS_ROMREL = 0
move.l #IF_BASE,a5 ; a5=Pointer to QLROMEXT control registers
ENDGEN
And then defining all the offsets for the IO relative to the start of the ROM if ROMREL=1, and relative to IF_BASE if not.