From 58b707c7ef462b87c82bef7e275318451012354b Mon Sep 17 00:00:00 2001 From: XOR Date: Sun, 12 Mar 2023 09:11:51 +0100 Subject: [PATCH 1/3] Delete not anymore needed comment In lexer.c --- src/image_saver.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/image_saver.c b/src/image_saver.c index 8e0b21c..130b0b4 100755 --- a/src/image_saver.c +++ b/src/image_saver.c @@ -27,9 +27,6 @@ int save_img(char *out_path, __uint32_t *target_code){ FILE *out_file = fopen(out_path, "wb"); if(out_file == NULL) return EIO; - - // Count instructions - if (fwrite(target_code, sizeof(target_code), count, out_file) != count) { From 8b75dbd887b1c67ec973b7754b1dc9649e14a893 Mon Sep 17 00:00:00 2001 From: XOR Date: Sun, 19 Mar 2023 14:17:24 +0100 Subject: [PATCH 2/3] Update TODO --- TODO.txt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/TODO.txt b/TODO.txt index 254b18e..38feb43 100755 --- a/TODO.txt +++ b/TODO.txt @@ -1,11 +1,2 @@ -#Convert tokens to Machiene code -Check for Errors in the EIPA Assembly (using the tokens) -#Save Machiene code in a file -#Add command line options -#COMMENTS! -function return errors + handling of those -Consider what happens when the input file contains too many instructions or one token is too long -Do some "skip over" loops in lexer need a check for EOF? - - -Consider using a hashtable for the token array to eliminate the if else ladder in get_target_code +Moved to +https://gabby-goose-5bd.notion.site/1118d9c2fd87412b8710656d17dcd32c?v=cc164a067eb24bbf94024865970e9337 \ No newline at end of file From fce1fa6a7208d54820bf88647355865019211c66 Mon Sep 17 00:00:00 2001 From: XOR Date: Tue, 4 Apr 2023 23:40:32 +0200 Subject: [PATCH 3/3] Make readme more readable --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bee8470..bfae5b0 100755 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ The assembler converts the written assembly into a memory image for the EIPA pro It is basically made up of 4 building blocks: ### 1. lexer The lexer takes the file with the written assembly and converts it into the individual components (tokens). It also takes into account if, for example, there are multiple spaces between the parts of the instruction, so that the other parts of the assembler do not have to worry about that. It converts e.g. the line -INP 31 ; A comment -into the parts |INP|, |31|, |end of instruction|. +`INP 31 ; A comment` +into the parts `|INP|, |31|, |end of instruction|`. ### 2. error analyzer The error analyzer takes the tokens from the lexer, and checks e.g. if the address of an instruction is too large, if an instruction that needs an address has one, if there are any typos, etc. If it finds an error, it aborts the program.