Difference between revisions of "Ixcall"

From Spectrum
Jump to navigation Jump to search
(New page: '''HLCALL''' - call a routine pointed to by hl using the pager '''IXCALL''' - call a routine pointed to by ix using the pager == Synopsis == ld hl, ADDRESS call HLCALL ld i...)
 
 
Line 1: Line 1:
'''HLCALL''' - call a routine pointed to by hl using the pager
'''HLCALL''' - call a routine pointed to by hl using the pager
'''IXCALL''' - call a routine pointed to by ix using the pager
'''IXCALL''' - call a routine pointed to by ix using the pager



Latest revision as of 13:59, 6 September 2008

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

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

Synopsis

   ld hl, ADDRESS
   call HLCALL

   ld ix, ADDRESS
   call HLCALL

Description

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.