Skip to content

Commit

Permalink
Uploaded the code of the register. Not complete.
Browse files Browse the repository at this point in the history
  • Loading branch information
ax-6 committed Jun 4, 2024
1 parent e1e4846 commit 8df1e2f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aq/aq.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@

#include "aq/aq.h"

#include <stdio.h>

#include "aqvm/aqvm.h"

int main(int argc, char *argv[]) {
char a[10] = "Helloworld";
printf("%s\n", a);

// TODO(Aqvm): Finish this function after completing AQVM development.
if(Aqvm_InitVm() != 0){
return -1;
Expand Down
30 changes: 30 additions & 0 deletions aqvm/memory/register.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,34 @@ struct AqvmMemoryRegister_Register {
union AqvmMemoryRegister_Value value;
};

/*
struct AqvmMemoryRegister_Register {
int* value;
size_t size;
};

int AqvmMemoryRegister_IntStore(int value,
struct AqvmMemoryRegister_Register* register,
size_t index) {
if (register->size < index * 4) {
// TODO(ERROR): Out of Memory.
return -1;
}
register->value[index] = value;
return 0;
}
int AqvmMemoryRegister_FloatStore(float value,
struct AqvmMemoryRegister_Register* register,
size_t index) {
if (register->size < index * 4) {
// TODO(ERROR): Out of Memory.
return -1;
}
register->value[index] = (int)value;
return 0;
}

// Wait for development.
* /

#endif

0 comments on commit 8df1e2f

Please sign in to comment.