-
ba57523f3e
Implemented opcode_as_cstr for NOT,OR,AND,XOR,EQ
Aryadev Chavali
2023-10-21 23:54:35 +01:00
-
696589b7b6
Introduced opcodes for NOT, OR, AND, XOR and EQ
Aryadev Chavali
2023-10-21 23:42:07 +01:00
-
f9b2c8ed77
Cleaned up and used macro magic to shorten the INST_* macros
Aryadev Chavali
2023-10-21 23:40:03 +01:00
-
d2cdb211b2
Added vm_execute_all which executes an entire program
Aryadev Chavali
2023-10-21 23:31:48 +01:00
-
1c2de9a926
Wrote a quick tutorial on targeting the virtual machine
Aryadev Chavali
2023-10-21 23:27:33 +01:00
-
f3a5981fa2
Wrote generalised procedures for interpret and assembly
Aryadev Chavali
2023-10-21 23:24:41 +01:00
-
44a9a3ca46
Helper functions for read/write instructions from darr or FILE*
Aryadev Chavali
2023-10-21 23:23:37 +01:00
-
903ae3ab04
Helper darr functions to read/write bytes from FILE *
Aryadev Chavali
2023-10-21 23:23:13 +01:00
-
dcedb70a5c
Switched from floats to halfword
Aryadev Chavali
2023-10-21 22:57:43 +01:00
-
266b4e4572
Implemented vm_print_* routines
Aryadev Chavali
2023-10-16 12:45:50 +01:00
-
44f8c81efe
Added opcode_as_cstr, opcode_type_as_cstr and inst_print
Aryadev Chavali
2023-10-16 12:45:04 +01:00
-
d01b39d1bb
Added helper functions to read and write bytes from files
Aryadev Chavali
2023-10-16 12:03:42 +01:00
-
e7616cdeb6
Made a sample program, loaded into VM and executed
Aryadev Chavali
2023-10-16 11:32:20 +01:00
-
7380dd375a
Fixed bug with get_opcode_data_type
Aryadev Chavali
2023-10-16 11:25:52 +01:00
-
845d864bc0
Set opcode after reading parameters in inst_read_byte
Aryadev Chavali
2023-10-16 11:04:43 +01:00
-
4d9b8a04f2
Fixed error with OP_PUSH where bits weren't in the pattern of data_type_t
Aryadev Chavali
2023-10-16 01:19:08 +01:00
-
a4c9b85c79
MOV and PUSH_*_REGISTER should only need bytes for their operand
Aryadev Chavali
2023-10-16 01:18:34 +01:00
-
6038363d2f
Added functionality to read and write instruction bytecode
Aryadev Chavali
2023-10-16 01:06:49 +01:00
-
a24a096e2a
Made OP_HALT the only instruction to have the top byte filled
Aryadev Chavali
2023-10-16 01:06:02 +01:00
-
0f37a59940
MOV now uses the stack, removed register member in inst_t
Aryadev Chavali
2023-10-16 00:59:30 +01:00
-
cd19f1e1d3
Better checking of opcode types
Aryadev Chavali
2023-10-15 22:16:31 +01:00
-
1cb54dc994
Remove parameter for INST_*POP
Aryadev Chavali
2023-10-15 22:06:30 +01:00
-
15ce778771
Set register parameter for inst_t to be a byte
Aryadev Chavali
2023-10-15 22:05:59 +01:00
-
c24c1d1607
Implemented a dynamically sized byte array
Aryadev Chavali
2023-10-15 21:49:30 +01:00
-
98760ee63b
Added macros for getting the maximum and minimum of two numbers
Aryadev Chavali
2023-10-15 21:49:13 +01:00
-
639808a092
Moved vm_* code to its own file (runtime.(h|c))
Aryadev Chavali
2023-10-15 21:41:16 +01:00
-
14e9192996
Implemented OP_PUSH_*_REGISTER in vm_execute
Aryadev Chavali
2023-10-15 21:29:26 +01:00
-
f73604ba6e
Make error TODOs specific to routine (for vm_mov_*)
Aryadev Chavali
2023-10-15 21:27:45 +01:00
-
f513e90f00
Implemented vm_push_*_register routines
Aryadev Chavali
2023-10-15 21:27:26 +01:00
-
744cc7acf7
Renamed opcodes PUSH_*REG to PUSH_*_REGISTER
Aryadev Chavali
2023-10-15 21:27:00 +01:00
-
4ae762294d
Rearranged opcodes (switched mov with push_reg)
Aryadev Chavali
2023-10-15 21:21:27 +01:00
-
54760d446c
Added instructions to push register values onto the stack
Aryadev Chavali
2023-10-15 21:19:49 +01:00
-
f0e48a186d
Added a register
ret, a word, which holds the result of any instruction
Aryadev Chavali
2023-10-15 21:14:56 +01:00
-
2490966554
Implemented vm_execute for pop routines
Aryadev Chavali
2023-10-15 21:13:15 +01:00
-
6927557d3f
Made vm_pop_* routines more uniform by returning a data_t
Aryadev Chavali
2023-10-15 21:12:53 +01:00
-
00517fddd6
Added instructions for popping differing types
Aryadev Chavali
2023-10-15 21:09:00 +01:00
-
2bc20f07d3
Added vm_execute support for mov routines
Aryadev Chavali
2023-10-15 21:05:56 +01:00
-
3f8544485a
Move push routines outside of vm_execute
Aryadev Chavali
2023-10-15 21:04:44 +01:00
-
56c545e7c9
Added opcodes for MOV and ability for instructions to hold registers
Aryadev Chavali
2023-10-15 21:02:40 +01:00
-
33aa62634a
Added registers to virtual machine
Aryadev Chavali
2023-10-15 21:00:01 +01:00
-
7a820290f9
Make push opcodes a specific bit set and add a NOOP opcode
Aryadev Chavali
2023-10-15 20:56:02 +01:00
-
40dfa5c255
Split off instruction structure to its own file
Aryadev Chavali
2023-10-15 17:38:35 +01:00
-
ea14b3beb6
Added an instruction setup
Aryadev Chavali
2023-10-15 05:52:58 +01:00
-
3786b7d785
stack.size -> stack.max
Aryadev Chavali
2023-10-15 05:43:57 +01:00
-
4ddc3cce71
Main now loads a stack allocated byte array for VM stack
Aryadev Chavali
2023-10-15 05:41:20 +01:00
-
bee6d445bb
Added a routine to load a pointer as stack memory
Aryadev Chavali
2023-10-15 05:40:53 +01:00
-
2de37b20e2
Changed stack data to be a pointer
Aryadev Chavali
2023-10-15 05:39:19 +01:00
-
a8747faa08
Split off general types and structures into separate header
Aryadev Chavali
2023-10-15 05:36:01 +01:00
-
da1c4aad35
Changed stack.pointer->stack.ptr
Aryadev Chavali
2023-10-15 05:33:42 +01:00
-
268fdf0ca0
Added floats (64 bit floating point) push and pop routines
Aryadev Chavali
2023-10-15 05:23:38 +01:00
-
724f5e0258
Force big endian when pushing words
Aryadev Chavali
2023-10-15 05:17:33 +01:00
-
54b836ba64
Add macro for size of a word
Aryadev Chavali
2023-10-15 05:03:09 +01:00
-
cfc9edebba
Added macro constructors for union types
Aryadev Chavali
2023-10-15 04:57:38 +01:00
-
1180833161
Implemented functions to pop a byte and a word
Aryadev Chavali
2023-10-15 04:40:14 +01:00
-
d52d7ad413
Implemented a union type to make vm_push_* routines uniform
Aryadev Chavali
2023-10-15 04:36:47 +01:00
-
49a85a20d8
Added functions to push a byte and a word
Aryadev Chavali
2023-10-15 04:35:07 +01:00
-
1101716f0f
Defined a simple virtual machine data structure
Aryadev Chavali
2023-10-15 01:35:05 +01:00
-
ca2e9c7083
Added some type aliases
Aryadev Chavali
2023-10-15 01:34:42 +01:00
-
7cf9160e3f
Added a README
Aryadev Chavali
2023-10-15 01:30:00 +01:00
-
b6672121a1
Remove unit tests from github workflow
Aryadev Chavali
2023-10-15 01:27:46 +01:00
-
16e2275576
First commit!
Aryadev Chavali
2023-10-15 01:25:24 +01:00