Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated EXTCALL API description for OZ V4.7 and later

...

The EXTCALL functionality is mapped via the RST 28H vector and is located in LOWRAM (lower 8K address space). This ensures that application code can use EXTCALL in all segments while OZ is running. The 24bit address is available in low byte - high byte order following the RST 28H instruction opcode, and stored as a complete 32bit address. The segment specifier (bits 15,14) of the lower 16bit address automatically identifies where the bank will be bound into the Z80 address space. The bank number of the 24bit address may be specified as absolute or as slot relative ($00 - $3F).

...

Code Block
macro extcall (offset, bank)
  if \% = 2                                     ; only generate code if offset and bank is specified
        rst     28h                             ; EXTCALL <address>
        defw    \offset
        defbdefw    \bank                           ; 16bit bank number (reserved for future hardware) 
  else
        error "EXTCALL: missing or incomplete address"
  endif
endmacro


extcall $C000,$FE                               ; (a RST 28H followed by 24bit address - 32bit padded)

Execute code in bank $FE at address $C000 bound into segment 3 (the instruction opcode sequence in memory is $EF, $00, $C0, $FE, $00). This call instruction uses an absolute bank (located in slot 3) in the 24bit address, ie. a piece of code in slot 2 might want to execute a subroutine in slot 3.

...