you can push anything now

please work
This commit is contained in:
2023-05-31 21:51:01 +02:00
parent d6981a4995
commit 4aa642aef0
3 changed files with 28 additions and 7 deletions

View File

@@ -54,4 +54,8 @@ je numbers ; if GetAsyncKeyState was false, jump to numbers
push a1 ; push char
call put
push \n ; push char
call put
jmp numbers

View File

@@ -4,7 +4,7 @@
#include <Windows.h>
void api_put() {
printf("%c\n", stack[top--]);
printf("%c", stack[top--]);
}
void api_getasynckeystate() {

View File

@@ -184,17 +184,34 @@ void call() {
}
void push() {
if (!((is_num(args->arg1) || (is_reg(args->arg1))))) {
last_check_args_code = ARG1_WRONG;
return;
}
if (top == STACK_SIZE) { //stack overflow
last_stack_code = OVERFLOW;
return;
}
stack[++top] = get_value(args->arg1);
int value = get_value(args->arg1);
if (value == 0) {
if (args->arg1[0] == '\\') {
switch (args->arg1[1]) {
case 'n':
value = (int)'\n';
break;
case 't':
value = (int)'\t';
break;
case 'r':
value = (int)'\r';
break;
default:
break;
}
}
else {
value = (int)args->arg1[0];
}
}
stack[++top] = value;
}
void pop() {