2 * EmbedVM - Embedded Virtual Machine for uC Applications
4 * Copyright (C) 2011 Clifford Wolf <clifford@clifford.at>
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
35 int16_t (*mem_read)(uint16_t addr, bool is16bit, void *ctx);
36 void (*mem_write)(uint16_t addr, int16_t value, bool is16bit, void *ctx);
37 int16_t (*call_user)(uint8_t funcid, uint8_t argc, int16_t *argv, void *ctx);
40 extern void embedvm_exec(struct embedvm_s *vm);
41 extern void embedvm_interrupt(struct embedvm_s *vm, uint16_t addr);
43 int16_t embedvm_pop(struct embedvm_s *vm);
44 void embedvm_push(struct embedvm_s *vm, int16_t value);
46 int16_t embedvm_local_read(struct embedvm_s *vm, int8_t sfa);
47 void embedvm_local_write(struct embedvm_s *vm, int8_t sfa, int16_t value);