3 #define SYS_open 0xfff4
4 #define SYS_close 0xfff5
5 #define SYS_read 0xfff6
6 #define SYS_write 0xfff7
7 #define SYS_args 0xfff8
8 #define SYS_exit 0xfff9
10 typedef void (*sim65_write_t
)(int count
, const char* buf
, int fd
) __reentrant
;
12 // sim65 expects a software stack
13 unsigned short stack
[8];
15 // stack pointer location defined in sim65 header
16 unsigned short* __at(0x0) stackptr
;
19 _putchar(unsigned char c
)
22 stackptr
[0] = (short)&c
;
24 (*(sim65_write_t
)SYS_write
)(1, &c
, 1);