mirror of
https://github.com/cc65/cc65.git
synced 2024-12-22 12:30:41 +00:00
add rp6502 xregn
This commit is contained in:
parent
f42e6a26b2
commit
4d3153e10e
@ -117,6 +117,8 @@ long __fastcall__ ria_call_long_errno (unsigned char op);
|
||||
|
||||
/* C API for the operating system. */
|
||||
|
||||
int __cdecl__ xregn (char device, char channel, unsigned char address, unsigned count,
|
||||
...);
|
||||
int __cdecl__ xreg (char device, char channel, unsigned char address, ...);
|
||||
int phi2 (void);
|
||||
int codepage (void);
|
||||
|
19
libsrc/rp6502/xregn.c
Normal file
19
libsrc/rp6502/xregn.c
Normal file
@ -0,0 +1,19 @@
|
||||
#include <rp6502.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int __cdecl__ xregn (char device, char channel, unsigned char address, unsigned count,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
va_start (args, count);
|
||||
RIA.xstack = device;
|
||||
RIA.xstack = channel;
|
||||
RIA.xstack = address;
|
||||
while (count--) {
|
||||
unsigned v = va_arg (args, unsigned);
|
||||
RIA.xstack = v >> 8;
|
||||
RIA.xstack = v;
|
||||
}
|
||||
va_end (args);
|
||||
return ria_call_int_errno (RIA_OP_XREG);
|
||||
}
|
Loading…
Reference in New Issue
Block a user