
#ifndef _BYTE
#define _BYTE
typedef unsigned char BYTE;
#endif

#ifndef _WORD
#define _WORD
typedef unsigned short int WORD;
#endif

#define SIMBase 0xfffa00

#define scimcr  (*(volatile WORD *)(SIMBase + 0x00))
#define scimtr  (*(volatile WORD *)(SIMBase + 0x02))
#define syncr   (*(volatile WORD *)(SIMBase + 0x04))
#define rsr     (*(volatile BYTE *)(SIMBase + 0x07))
#define simtre  (*(volatile WORD *)(SIMBase + 0x08))
#define porte   (*(volatile BYTE *)(SIMBase + 0x11))
#define ddre    (*(volatile BYTE *)(SIMBase + 0x15))
#define pepar   (*(volatile BYTE *)(SIMBase + 0x17))
#define portf   (*(volatile BYTE *)(SIMBase + 0x1b))
#define ddrf    (*(volatile BYTE *)(SIMBase + 0x1d))
#define pfpar   (*(volatile BYTE *)(SIMBase + 0x1f))
#define sypcr   (*(volatile BYTE *)(SIMBase + 0x21))
#define picr    (*(volatile WORD *)(SIMBase + 0x22))
#define pitr    (*(volatile WORD *)(SIMBase + 0x24))
#define swsr    (*(volatile BYTE *)(SIMBase + 0x27))
#define portfe  (*(volatile BYTE *)(SIMBase + 0x29))
#define pfivr   (*(volatile BYTE *)(SIMBase + 0x2b))
#define pflvr   (*(volatile BYTE *)(SIMBase + 0x2d))
#define tstmsra (*(volatile WORD *)(SIMBase + 0x30))
#define tstmsrb (*(volatile WORD *)(SIMBase + 0x32))
#define tstsc   (*(volatile WORD *)(SIMBase + 0x34))
#define tstrc   (*(volatile WORD *)(SIMBase + 0x36))
#define creg    (*(volatile WORD *)(SIMBase + 0x38))
#define dreg    (*(volatile WORD *)(SIMBase + 0x3a))
#define portc   (*(volatile BYTE *)(SIMBase + 0x41))
#define cspar0  (*(volatile WORD *)(SIMBase + 0x44))
#define cspar1  (*(volatile WORD *)(SIMBase + 0x46))
#define csbarbt (*(volatile WORD *)(SIMBase + 0x48))
#define csorbt  (*(volatile WORD *)(SIMBase + 0x4a))
#define csbar0  (*(volatile WORD *)(SIMBase + 0x4c))
#define csor0   (*(volatile WORD *)(SIMBase + 0x4e))
#define csbar1  (*(volatile WORD *)(SIMBase + 0x50))
#define csor1   (*(volatile WORD *)(SIMBase + 0x52))
#define csbar2  (*(volatile WORD *)(SIMBase + 0x54))
#define csor2   (*(volatile WORD *)(SIMBase + 0x56))
#define csbar3  (*(volatile WORD *)(SIMBase + 0x58))
#define csor3   (*(volatile WORD *)(SIMBase + 0x5a))
#define csbar4  (*(volatile WORD *)(SIMBase + 0x5c))
#define csor4   (*(volatile WORD *)(SIMBase + 0x5e))
#define csbar5  (*(volatile WORD *)(SIMBase + 0x60))
#define csor5   (*(volatile WORD *)(SIMBase + 0x62))
#define csbar6  (*(volatile WORD *)(SIMBase + 0x64))
#define csor6   (*(volatile WORD *)(SIMBase + 0x66))
#define csbar7  (*(volatile WORD *)(SIMBase + 0x68))
#define csor7   (*(volatile WORD *)(SIMBase + 0x6a))
#define csbar8  (*(volatile WORD *)(SIMBase + 0x6c))
#define csor8   (*(volatile WORD *)(SIMBase + 0x6e))
#define csbar9  (*(volatile WORD *)(SIMBase + 0x70))
#define csor9   (*(volatile WORD *)(SIMBase + 0x72))
#define csbar10 (*(volatile WORD *)(SIMBase + 0x74))
#define csor10  (*(volatile WORD *)(SIMBase + 0x76))
