1 /*
2 ** testprogram for _sys() function on Atari
3 **
4 ** 17-Sep-2013, chris@groessler.org
5 **
6 ** uses PUTCHR IOCB function to display a string
7 */
8 
9 #include <atari.h>
10 #include <6502.h>
11 #include <conio.h>
12 
13 static struct regs regs;
14 static struct __iocb *iocb = &IOCB;  /* use IOCB #0 */
15 
16 static char message[] = "I'm the sys test text\n";
17 
main(void)18 int main(void)
19 {
20     /* setup IOCB for CIO call */
21     iocb->buffer = message;
22     iocb->buflen = sizeof(message) - 1;
23     iocb->command = IOCB_PUTCHR;
24 
25     /* setup input registers */
26     regs.x = 0;         /* IOCB #0 */
27     regs.pc = 0xe456;   /* CIOV */
28 
29     /* call CIO */
30     _sys(&regs);
31 
32     if (regs.y != 1)
33         cprintf("CIO error 0x%02\r\n", regs.y);
34 
35     cgetc();
36     return 0;
37 }
38