mirror of
https://github.com/pnx/m16vm
synced 2026-06-16 03:44:55 +02:00
src/syscall: define write system call
This commit is contained in:
parent
837bd8f892
commit
fa30f39d55
2 changed files with 13 additions and 2 deletions
|
|
@ -20,7 +20,14 @@
|
|||
#include <stdio.h>
|
||||
#include "syscall.h"
|
||||
|
||||
void syscall_write(int16_t value, int8_t op) {
|
||||
void vm_syscall(int16_t number, int8_t op, uint16_t* regs) {
|
||||
|
||||
if (number == SYS_WRITE) {
|
||||
vm_syscall_write(op, regs[15]);
|
||||
}
|
||||
}
|
||||
|
||||
void vm_syscall_write(int8_t op, int16_t value) {
|
||||
|
||||
switch(op) {
|
||||
case SYSW_INT16 :
|
||||
|
|
|
|||
|
|
@ -23,10 +23,14 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#define SYS_WRITE 10
|
||||
|
||||
#define SYSW_INT16 0x0
|
||||
#define SYSW_INT8 0x1
|
||||
#define SYSW_CHAR 0x2
|
||||
|
||||
void syscall_write(int16_t value, int8_t op);
|
||||
void vm_syscall(int16_t number, int8_t op, uint16_t* regs);
|
||||
|
||||
void vm_syscall_write(int8_t op, int16_t value);
|
||||
|
||||
#endif /* SYSCALL_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue