From Spectrum hardware wiki
Jump to: navigation, search

HLCALL - call a routine pointed to by hl using the pager

IXCALL - call a routine pointed to by ix using the pager


   ld hl, ADDRESS
   call HLCALL

   ld ix, ADDRESS
   call HLCALL


The HLCALL and IXCALL symbols are entry points into the Spectranet ROM. The hardware traps the CALL instruction, and pages in the Spectranet ROM. The argument, in the HL register pair for HLCALL, or IX for IXCALL, should be an address in the indirect call table (0x3E00 to 0x3EFF), which is defined in the file spectranet.asm.

On return from the routine that was specified, the Spectranet ROM is paged out, and the ZX ROM is paged back in. Therefore, this mechanism should not be used for code that resides in the Spectranet flash ROM or paged RAM, rather, a CALL instruction should reference the address in the indirect table itself. Similarly, code that runs from main memory where the Spectranet memory should remain paged in, should call the indirect table rather than using the HLCALL/IXCALL entry points.