z80 - marinus-lab/z88dk GitHub Wiki
| Include | #include <z80.h>
|
| ----------------------------------------------------------------------------------------------------------------------------
| Header | {z88dk}/include/_DEVELOPMENT/sccz80/z80.h |
| | {z88dk}/include/_DEVELOPMENT/sdcc/z80.h |
Specialized functions for the z80 microprocessor.
Busy-wait exactly ms milliseconds and return. Time will be longer if interrupts occur during the wait. Accurate time delay depends on the "__clock_freq" constant being set properly in the target's clib_target_cfg.asm file.
Busy-wait exactly tstates z80 cycles and return. Time will be longer if interrupts occur during the wait. The time delay measured in seconds will be tstates/f<sub>
clock</sub>
. tstates must be >= 141.
Refer to the library documentation for a complete discussion of interrupts on the z80 and how to create interrupt service routines.
These functions mainly serve to help implement the z80's im2 mode. Changes to interrupts should always be done while interrupts are disabled. None of these functions enable or disable interrupts.
Sets the location of the im2 vector table to im2_table_address and places the z80 in im2 mode. Note that the least significant byte of im2_table_address is discarded so that the im2 table will always begin on an exact 256-byte page.
Install the interrupt service routine isr on the im2 vector indicated. Return the old isr formerly registered on that vector. By convention, isrs are registered on even vectors only to avoid overlap of isr addresses in the table. Zilog's peripherals are only capable of producing even interrupt vectors. vector is taken as-is, odd or even, because some systems do have devices interrupting with odd vectors.
Create a generic isr in RAM at address address that can have up to num_callbacks (<128) isr subroutines registered with it. The amount of memory required at address address is (18 + num_callbacks2)* bytes. Returns the next available address after the installed generic isr.
On interrupt, the generic isr will save all registers, call its list of isr subroutines in sequence, restore registers, re-enable interrupts and return.
Create a generic isr in RAM at address address that can have up to num_callbacks (<128) isr subroutines registered with it. The amount of memory required at address address is (18 + num_callbacks2)* bytes. Returns the next available address after the installed generic isr.
On interrupt, the generic isr will only save the main register set (af,bc,de,hl), call its list of isr subroutines in sequence, restore registers, re-enable interrupts and return.
(macro)
(macro)
(macro)
(macro)
(macro)
(macro)