22 arg_len = strlen(
arg);
36 {
"cls", (
char *[]){
"clear_screen()",
NULL } },
37 {
"drw", (
char *[]){
"draw(",
argv[1],
", ",
argv[2],
", ",
argv[3],
")",
NULL } },
38 {
"exit", (
char *[]){
"exit()",
NULL } },
39 {
"high", (
char *[]){
"high_res()",
NULL } },
40 {
"jp", (
char *[]){
"goto ",
argv[1],
NULL } },
42 {
"low", (
char *[]){
"low_res()",
NULL } },
44 {
"rnd", (
char *[]){
argv[1],
" = random(256) & ",
argv[2],
NULL } },
45 {
"scd", (
char *[]){
"scroll_down(",
argv[1],
")",
NULL } },
46 {
"scl", (
char *[]){
"scroll_left()",
NULL } },
47 {
"scr", (
char *[]){
"scroll_right()",
NULL } },
48 {
"se", (
char *[]){
"skip_next_instr if ",
argv[1],
" == ",
argv[2],
NULL } },
49 {
"shl", (
char *[]){
argv[1],
" <<= 1",
NULL } },
50 {
"shr", (
char *[]){
argv[1],
" >>= 1",
NULL } },
51 {
"sknp", (
char *[]){
"skip_next_instr if !key_pressed(",
argv[1],
")",
NULL } },
52 {
"skp", (
char *[]){
"skip_next_instr if key_pressed(",
argv[1],
")",
NULL } },
53 {
"sne", (
char *[]){
"skip_next_instr if ",
argv[1],
" != ",
argv[2],
NULL } },
60 for (
i = 0;
ops[
i].op;
i++) {
71 int len = strlen(
in),
count = 0,
i = 0, tokenlen = 0, seplen = 0;
72 char *token, *
buf = (
char *)
in;
73 const char *tokcharset =
", \t\n";
76 tokenlen = strcspn(
buf, tokcharset);
77 token =
calloc(tokenlen + 1,
sizeof(
char));
84 seplen = strspn(
buf, tokcharset);
94 char str[1024] = { 0 };
111 .
name =
"chip8.pseudo",
112 .desc =
"chip8 pseudo syntax",
116 #ifndef RZ_PLUGIN_INCORE
static const char * arg(RzAnalysis *a, csh *handle, cs_insn *insn, char *buf, int n)
static RASN1String * newstr(const char *string)
const lzma_allocator const uint8_t * in
const lzma_allocator const uint8_t size_t uint8_t * out
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
RZ_API void Ht_() free(HtName_(Ht) *ht)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * calloc(size_t number, size_t size)
static static fork const void static count static fd const char const char static newpath char char argv
static bool parse(RzParse *p, const char *data, RzStrBuf *sb)
static int replace(int argc, char *argv[], char *newstr, size_t len)
RZ_API RzLibStruct rizin_plugin
static void concat(char *buf, size_t len, char **args)
RzParsePlugin rz_parse_plugin_chip8_pseudo
static int tokenize(const char *in, char *out[])
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)