[fpc-devel] FPC and Z80

Florian Klämpfl florian at freepascal.org
Mon Apr 27 21:24:28 CEST 2020

Am 27.04.20 um 21:12 schrieb Marco van de Voort:
> Op 2020-04-27 om 18:28 schreef Florian Klaempfl:
>>> I have no idea, but quickly read through some docs, and it seems the
>>> GameBoy CPU doesn't have IX/IY registers, which seems to be very 
>>> useful to
>>> implement some of the more complex references handling, according to 
>>> what
>>> Nikolay wrote earlier. 
>> Yes. IX and IY are the key for the FPC Z80 port. Without them it's 
>> getting really difficult. And I suspect we need to work without a 
>> normal stack but allocate local variables globally, so basically no 
>> recursion will be possible.
> Well, for 6502 working 16-bit ptr indirect via volatile zp memory 
> locations needs to be implemented anyway :-)
> Does that CPU have no hardware stack at all, or only limited (128/256 
> bytes or so?)

It has a full stack but too little registers to use it efficiently for 
local variables: it has 3 8 bit registers pair plus accumulator (so 7 8 
bit registers), two of them can be used as pairs for indirect 
addressing, so this makes life very hard, but maybe, when I think about 
it, doable ;) 8085 assembler was the first assembler I learned, at a 
certain time I knew the hex. codes for most instructions.

More information about the fpc-devel mailing list