Commit Graph

222 Commits

Author SHA1 Message Date
sBubshait
38e5cd06fa Add tokeniser.c to make parsing easier 2024-06-13 17:23:30 +01:00
EDiasAlberto
6ddf18be96 fix halt command encoding 2024-06-12 20:40:38 +01:00
EDiasAlberto
c52de918db build struct for loadstore instructions 2024-06-12 20:22:08 +01:00
Themis Demetriades
9dc460a047 Change directory structure of files w/ S 2024-06-12 19:28:48 +01:00
EDiasAlberto
344f455be3 fix loadreg struct construction 2024-06-12 19:25:05 +01:00
Themis Demetriades
98a5c8a93c Add comment explaining getField macro in decode w/ S 2024-06-12 19:15:33 +01:00
sBubshait
5013abfe00 Update decode, Restructure and add helper function 2024-06-12 19:07:41 +01:00
Themis Demetriades
24fd0c4ad6 Changed execute function to use function pointer array w/ S 2024-06-12 18:42:32 +01:00
Dias Alberto, Ethan
6c1be8e1ef Merge branch 'assembler-e' into 'assembler-s'
# Conflicts:
#   src/parser.c
2024-06-12 16:49:17 +00:00
sBubshait
fab4047d22 Update fileio, skip new lines 2024-06-12 17:48:23 +01:00
Themis Demetriades
297ec15436 Change name and signature of helper functions to be consistent w/ S 2024-06-12 17:47:37 +01:00
Themis Demetriades
64a9d72806 Change structure of execute module w/ S 2024-06-12 17:44:12 +01:00
EDiasAlberto
06b18706ed rewrite opcode/operand splitting logic 2024-06-12 17:34:14 +01:00
sBubshait
9a6d15ce1c Fix Branch Bug to fix infinite loop 2024-06-12 17:11:01 +01:00
Themis Demetriades
a009f43e83 Fixed overflow calculation to account for signed numbers w/ S 2024-06-12 17:09:07 +01:00
EDiasAlberto
53f5b05210 rewrite uses of strcpy w/ S 2024-06-12 17:02:52 +01:00
EDiasAlberto
9f92eb4766 fix tokeniseOperands param order 2024-06-12 16:54:38 +01:00
EDiasAlberto
f4fd71a330 fix syntax error with getOperandNumber 2024-06-12 16:46:59 +01:00
EDiasAlberto
c6ff7e1c4e comment getOperandNumber 2024-06-12 16:29:29 +01:00
EDiasAlberto
f32304afb7 create helper function to generate number from operand 2024-06-12 16:24:42 +01:00
sBubshait
954be5f8f4 Update structure to a binary and machine util and a64inst modules 2024-06-12 15:55:15 +01:00
sBubshait
53ab6a2bf6 Update fileio, add countLine, rewrite read and write file funcs 2024-06-12 00:50:00 +01:00
sBubshait
269a150926 Fix types, signatures, and arguments. 2024-06-12 00:49:25 +01:00
sBubshait
17d31a74e3 Add a working Makefile for testing purposes 2024-06-11 23:49:40 +01:00
sBubshait
850f3cf4f7 Add overall assemble structure 2024-06-11 23:46:40 +01:00
sBubshait
999f36facd Fix bugs to make code compile. Code now compiles 2024-06-11 23:19:04 +01:00
sBubshait
31c1ae90f7 Attempt to make code compile, fix syntax errors 2024-06-11 23:13:23 +01:00
sBubshait
efaed431d0 Added all instruction in subfolder a64instruction 2024-06-11 23:02:26 +01:00
sBubshait
c4e3493fdc Split utils into machine_util and binary_util modules 2024-06-11 22:40:36 +01:00
EDiasAlberto
62ff6e9e02 fix syntax errors in fileio.c 2024-06-11 21:23:26 +01:00
EDiasAlberto
647f47e39d rewrite fileio to load file into memory 2024-06-11 21:16:47 +01:00
EDiasAlberto
173bdf08ec fix incorrect fileio.c 2024-06-11 20:23:00 +01:00
EDiasAlberto
6153db7737 fix compile issues git add . :) 2024-06-11 17:35:23 +01:00
EDiasAlberto
92719b6b33 comments for clarity in parser 2024-06-09 23:10:39 +01:00
EDiasAlberto
d0be871e8f generate offset operand for load literal with immediate value 2024-06-09 23:07:45 +01:00
EDiasAlberto
44bb327b7d begin formulating parser pipeline 2024-06-09 22:54:27 +01:00
EDiasAlberto
4098ea5a5f calculate offsets for different store instructions 2024-06-09 22:43:37 +01:00
EDiasAlberto
04dda33987 calculate base register from input 2024-06-09 22:21:30 +01:00
sBubshait
a42576b4ed Restructing, keeping all emulator modules in emulator directory 2024-06-07 18:08:33 +01:00
sBubshait
46da019131 Remove No longer used files 2024-06-07 17:54:09 +01:00
sBubshait
2e5ecb175f Merge branch 'emulator' into emulator-s 2024-06-07 17:52:29 +01:00
EDiasAlberto
34060c3fad fix hierarchy of struct access in parser 2024-06-06 17:54:35 +01:00
EDiasAlberto
1fa33798bf rewrite DP classification logic 2024-06-06 17:38:54 +01:00
EDiasAlberto
f57e0a786f rename assembler funcs for clarity 2024-06-06 17:14:56 +01:00
EDiasAlberto
225ade7770 fix use of cpp syntax 2024-06-06 17:10:18 +01:00
Dias Alberto, Ethan
9c6a459b23 Merge branch 'assembler' into 'assembler-e'
# Conflicts:
#   src/twopassassembly.c
2024-06-06 16:03:18 +00:00
GDBWNV
da50ee27a1 added label, branch, halt, directive to switch statement 2024-06-06 16:40:24 +01:00
sBubshait
8893b62a18 Add storeMemory utility function and used it to fix a prev bug 2024-06-06 16:38:01 +01:00
sBubshait
b16fe2bee3 Fixed Bug: Struct Undefined Behaviour Due to Unguarded Access 2024-06-06 16:34:38 +01:00
sBubshait
4689aba219 Fix Bug: Fixed Post Indexed SDT to save AFTER the transfer 2024-06-06 16:31:59 +01:00
sBubshait
efca820fbf Fix Bug: Sign Extend SDT instrs instead of unsigned 2024-06-06 16:29:50 +01:00
sBubshait
059a3e747c Paranthesis for ROR instruction for readability 2024-06-06 16:25:17 +01:00
EDiasAlberto
5413d27026 adjust operand counts for calculating address format 2024-06-06 14:46:56 +01:00
EDiasAlberto
f1ac860d6a rewrite address format calculation
as { is not in the actual asm syntax
2024-06-06 14:46:16 +01:00
EDiasAlberto
70e02768b6 fix struct access 2024-06-06 14:30:13 +01:00
EDiasAlberto
872d4224f8 classify register type and base register for load/store 2024-06-06 14:28:32 +01:00
EDiasAlberto
1011d7be71 classify load store addressing type 2024-06-06 14:14:10 +01:00
Themis Demetriades
16efa0b3c8 Replaced type used in execute to be platform independent 2024-06-06 13:53:28 +01:00
Themis Demetriades
77cea8730a Fix getMSB function to only return 0 or 1 2024-06-06 13:47:01 +01:00
GDBWNV
1440ebd702 single data transfer & load literal 2024-06-06 13:34:14 +01:00
Themis Demetriades
c2844ce0ec Fix V amd C flags for DPI subs instruction 2024-06-06 13:30:47 +01:00
EDiasAlberto
b93ab76b82 generate branch struct from operands (INCOMPLETE) 2024-06-06 13:22:54 +01:00
Themis Demetriades
460b19aaf4 Fix ROR shift logic 2024-06-06 13:19:36 +01:00
EDiasAlberto
6177b2f748 assemble branch instructions 2024-06-06 13:01:26 +01:00
GDBWNV
09956c7b2e data processing register 2024-06-06 13:00:27 +01:00
GDBWNV
ce34f27fbd data processing immediate 2024-06-06 12:33:09 +01:00
GDBWNV
b362f46d58 Merge remote-tracking branch 'origin/emulator' into Assembler-G 2024-06-06 10:11:57 +01:00
sBubshait
d73111515e Fix Overflow handling in Subtraction DP Register, w/ T 2024-06-06 00:47:06 +01:00
Themis Demetriades
95c74964b3 Fix movk to not overwrite entire register for large scalars w/ S 2024-06-06 00:35:48 +01:00
sBubshait
7b1e6314a7 Fix Subs handling of carry PSTATE condition code, w/ T 2024-06-05 23:58:56 +01:00
Themis Demetriades
40c5fac9f6 Fixed bug with movk overwriting wrong bits w/ S 2024-06-05 23:43:36 +01:00
sBubshait
a3dd809437 Update execute, implemented the store instrs, w/ T 2024-06-05 23:30:20 +01:00
Themis Demetriades
75a8d79bb4 Changed order of operations for DPR logic instructions w/ S 2024-06-05 23:19:53 +01:00
Themis Demetriades
dd472117aa Add negation for second operand in DPR instructions w/ S 2024-06-05 22:50:04 +01:00
Themis Demetriades
cc62168d43 Remove debugging code w/ S 2024-06-05 22:23:51 +01:00
Themis Demetriades
294b03ddde Added ability to write to zero register (discard) w/ S 2024-06-05 22:21:32 +01:00
sBubshait
14fbb7e4fc Fix Bug: Struct was not being changed because it wasn't a ptr, w/ T 2024-06-05 21:31:41 +01:00
sBubshait
5bb7d86156 Fix syntax, add new line in end of file and # before include, w/ T 2024-06-05 21:30:41 +01:00
sBubshait
b3ccee44bb Change enum values in DP Register to match the spec, w/ T 2024-06-05 21:23:52 +01:00
EDiasAlberto
262fd6219d conditional definition of parser constants 2024-06-05 21:10:31 +01:00
EDiasAlberto
bb0f939539 construct instr IR from label 2024-06-05 21:07:28 +01:00
EDiasAlberto
8931c151f8 removed duped if statement 2024-06-05 21:02:25 +01:00
EDiasAlberto
f28d3b4047 removed alias function temporarily 2024-06-05 21:01:39 +01:00
Themis Demetriades
120b492a48 Added structs to represent labels and directives for assembler 2024-06-05 20:54:22 +01:00
EDiasAlberto
48efdf8284 classify directprocessing instruction type 2024-06-05 20:53:56 +01:00
sBubshait
379dedc6ce Add execution of Multiply DP Register Instructions, w/ T 2024-06-05 20:25:47 +01:00
sBubshait
9ea494acfc Fix branch enum numbering to match the spec, w/ T 2024-06-05 20:14:12 +01:00
Themis Demetriades
024044afc7 Add decode and execute structure for DPI instructions w/ S 2024-06-05 20:11:56 +01:00
Dias Alberto, Ethan
4df768f327 Merge branch 'assembler' into 'assembler-e'
# Conflicts:
#   src/parser.c
2024-06-05 19:01:15 +00:00
Themis Demetriades
8b0bb1888b Changed constant name for 64 bit register type w/ S 2024-06-05 20:00:25 +01:00
EDiasAlberto
1d1089634f add halt command handling 2024-06-05 19:57:51 +01:00
EDiasAlberto
129bdf3954 classify opcode load/store 2024-06-05 19:57:51 +01:00
GDBWNV
07ff159c9b Merge remote-tracking branch 'origin/assembler' into Assembler-G 2024-06-05 19:26:02 +01:00
Themis Demetriades
93031e82e0 Complete decode for DPR instructions and complete their IR 2024-06-05 16:38:13 +01:00
Themis Demetriades
ff25680455 Update names of decode SDT constants to follow style 2024-06-05 14:00:49 +01:00
Themis Demetriades
2402e3d268 Update DPR type instruction IR operand field name 2024-06-04 15:41:58 +01:00
Themis Demetriades
bb6fa95ade Add DPR type instruction data to IR of a64 instructions 2024-06-04 15:09:53 +01:00
EDiasAlberto
0f04ac9e22 rename fileaccess 2024-06-04 14:53:30 +01:00
GDBWNV
67a9c39832 Symbol basic functionality. 2024-06-04 14:02:09 +01:00
Themis Demetriades
d6b551c190 Fix function that updates N and Z flags of processor w/ S 2024-06-04 13:24:31 +01:00