libws libws
WSwan hardware library for the Wonderful toolchain
Loading...
Searching...
No Matches
ia16.h File Reference
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define IA16_INT_DIV   0
 Divide error interrupt vector index.
#define IA16_INT_STEP   1
 Single step/break interrupt vector index.
#define IA16_INT_NMI   2
 Non-maskable interrupt vector index.
#define IA16_INT_BREAK   3
 Breakpoint (INT3) interrupt vector index.
#define IA16_INT_INTO   4
 Overflow (INTO) interrupt vector index.
#define IA16_INT_BOUNDS   5
 Array bounds (BOUND) interrupt vector index.
#define IA16_FLAG_CF   0x0001
 Carry CPU flag bit mask.
#define IA16_FLAG_PF   0x0004
 Parity CPU flag bit mask.
#define IA16_FLAG_AF   0x0010
 Auxillary carry CPU flag bit mask.
#define IA16_FLAG_ZF   0x0040
 Zero CPU flag bit mask.
#define IA16_FLAG_SF   0x0080
 Sign CPU flag bit mask.
#define IA16_FLAG_TF   0x0100
 Single step CPU flag bit mask.
#define IA16_FLAG_IF   0x0200
 Interrupt enable CPU flag bit mask.
#define IA16_FLAG_DF   0x0400
 Direction CPU flag bit mask.
#define IA16_FLAG_OF   0x0800
 Overflow CPU flag bit mask.
#define IA16_FLAG_MD   0x8000
 Mode CPU flag bit mask.
#define FP_SEG(x)
 Retrieve the segment of a far pointer.
#define FP_OFF(x)
 Retrieve the offset of a far pointer.
#define MK_FP(seg, ofs)
 Create a far pointer from a segment and offset.
#define _CS   ia16_get_cs()
#define _DS   ia16_get_ds()
#define _ES   ia16_get_es()
#define _SS   ia16_get_ss()
#define ia16_get_ds   __builtin_ia16_near_data_segment
 Retrieve the current value of the data segment DS.
#define ia16_get_ss   __builtin_ia16_ss
 Retrieve the current value of the stack segment SS.
#define ia16_port_inb(port)
#define ia16_port_inw(port)
#define ia16_port_outb(value, port)
#define ia16_port_outw(value, port)
#define ia16_critical(...)
 Define a critical code segment in which IRQs are disabled.

Typedefs

typedef void __far(* ia16_int_handler_t) (void)

Functions

static __segment ia16_get_cs ()
 Retrieve the current value of the code segment CS.
static __segment ia16_get_es ()
 Retrieve the current value of the data segment ES.
static uint16_t ia16_get_sp ()
 Retrieve the current value of the stack pointer SP.
static uint16_t ia16_get_flags ()
 Retrieve the current value of the CPU flag register.
static void ia16_set_flags (uint16_t flags)
 Set the CPU flag register to a new value.
static uint8_t inportb (uint8_t port)
 Read a byte from the given port.
static uint16_t inportw (uint8_t port)
 Read a word from the given port.
static void outportb (uint8_t port, uint8_t value)
 Write a byte to the given port.
static void outportw (uint8_t port, uint16_t value)
 Write a word to the given port.
static void ia16_halt (void)
 Halt the CPU until an interrupt is received.
static void ia16_enable_irq (void)
 Enable jumping to interrupt vectors on an interrupt being received by the CPU.
static void ia16_disable_irq (void)
 Disable jumping to interrupt vectors on an interrupt being received by the CPU.
void ia16_int_set_handler (uint8_t idx, ia16_int_handler_t handler)
 Register a CPU interrupt handler.

Detailed Description

NEC V30MZ-related CPU defines

Definition in file ia16.h.