From d2d41c0761d59093080511fc6b73e0cb6e150e1a Mon Sep 17 00:00:00 2001 From: Roman-Dev Date: Mon, 21 Mar 2022 23:34:13 +0200 Subject: [PATCH 1/3] prepare for delivery Signed-off-by: Roman-Dev --- .github/workflows/CI.yml | 16 ++--- assembler | Bin 49912 -> 49960 bytes assembler.c | 3 +- .../main_tester.ob | 0 input_output_results/multi_file_log.txt | 62 ++++++++++++++++++ .../no_files_received_log.txt | 3 + {tester => input_output_results}/ps.am | 2 +- ps.as => input_output_results/ps.as | 2 +- {tester => input_output_results}/ps.ent | 0 {tester => input_output_results}/ps.ext | 0 {tester => input_output_results}/ps.ob | 0 ps2.as => input_output_results/ps2.as | 2 +- input_output_results/ps2_log.txt | 11 ++++ {tester => input_output_results}/ps3.am | 0 ps3.as => input_output_results/ps3.as | 0 input_output_results/ps3_log.txt | 27 ++++++++ {tester => input_output_results}/ps4.am | 0 ps4.as => input_output_results/ps4.as | 0 input_output_results/ps4_log.txt | 19 ++++++ {tester => input_output_results}/ps5.am | 0 ps5.as => input_output_results/ps5.as | 0 input_output_results/ps5_log.txt | 14 ++++ input_output_results/ps6_log.txt | 7 ++ {tester => input_output_results}/ps7.am | 0 ps7.as => input_output_results/ps7.as | 0 input_output_results/ps7_log.txt | 22 +++++++ input_output_results/ps_log.txt | 10 +++ misc/utils.c | 10 ++- passes/first_pass.c | 4 +- tester/ps.as | 25 ------- tester/ps2.as | 11 ---- tester/ps3.as | 15 ----- tester/ps4.as | 8 --- tester/ps5.as | 7 -- tester/ps7.as | 7 -- 35 files changed, 196 insertions(+), 91 deletions(-) rename tester/main_tester => input_output_results/main_tester.ob (100%) create mode 100644 input_output_results/multi_file_log.txt create mode 100644 input_output_results/no_files_received_log.txt rename {tester => input_output_results}/ps.am (90%) rename ps.as => input_output_results/ps.as (92%) rename {tester => input_output_results}/ps.ent (100%) rename {tester => input_output_results}/ps.ext (100%) rename {tester => input_output_results}/ps.ob (100%) rename ps2.as => input_output_results/ps2.as (94%) create mode 100644 input_output_results/ps2_log.txt rename {tester => input_output_results}/ps3.am (100%) rename ps3.as => input_output_results/ps3.as (100%) create mode 100644 input_output_results/ps3_log.txt rename {tester => input_output_results}/ps4.am (100%) rename ps4.as => input_output_results/ps4.as (100%) create mode 100644 input_output_results/ps4_log.txt rename {tester => input_output_results}/ps5.am (100%) rename ps5.as => input_output_results/ps5.as (100%) create mode 100644 input_output_results/ps5_log.txt create mode 100644 input_output_results/ps6_log.txt rename {tester => input_output_results}/ps7.am (100%) rename ps7.as => input_output_results/ps7.as (100%) create mode 100644 input_output_results/ps7_log.txt create mode 100644 input_output_results/ps_log.txt delete mode 100644 tester/ps.as delete mode 100644 tester/ps2.as delete mode 100644 tester/ps3.as delete mode 100644 tester/ps4.as delete mode 100644 tester/ps5.as delete mode 100644 tester/ps7.as diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7ce2839..fc308e0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,16 +21,16 @@ jobs: echo building project rm -f assembler make - ./assembler ps ps2 ps3 ps4 ps5 ps6 ps7 - echo compare tester/ps.ob tester/main_tester - cmp tester/ps.ob tester/main_tester + ./assembler input_output_results/ps input_output_results/ps2 input_output_results/ps3 input_output_results/ps4 input_output_results/ps5 ps6 input_output_results/ps7 + echo compare input_output_results/ps.ob input_output_results/main_tester + cmp input_output_results/ps.ob input_output_results/main_tester.ob - uses: actions/upload-artifact@v3 with: name: assembler.zip path: | misc passes - tester + input_output_results assembler assembler.c Makefile @@ -45,9 +45,9 @@ jobs: echo building project rm -f assembler make - ./assembler ps ps2 ps3 ps4 ps5 ps6 ps7 - echo compare tester/ps.ob tester/main_tester - cmp tester/ps.ob tester/main_tester + ./assembler input_output_results/ps input_output_results/ps2 input_output_results/ps3 input_output_results/ps4 input_output_results/ps5 ps6 input_output_results/ps7 + echo compare input_output_results/ps.ob input_output_results/main_tester + cmp input_output_results/ps.ob input_output_results/main_tester.ob build_and_test_macos-latest: runs-on: macos-latest @@ -59,4 +59,4 @@ jobs: echo building project rm -f assembler make - ./assembler ps ps2 ps3 ps4 ps5 ps6 ps7 \ No newline at end of file + ./assembler input_output_results/ps input_output_results/ps2 input_output_results/ps3 input_output_results/ps4 input_output_results/ps5 ps6 input_output_results/ps7 diff --git a/assembler b/assembler index fa4bb4030f7993681c1dc0aec42053fe6d94b0ff..d8ab2379046a5a9cf90645a883a43eea76a4271a 100755 GIT binary patch delta 10717 zcmZ`<30zfGw?F#=G6=#=-~u9-K~S84l+*&1isvN(rySFi9C4mV{n8MTPw{$XSX!EM z&N-oE>X!;yirOH4rD6FB8?Tv$O&|5r^Zt7{H?;T8PxspUzlOc`+I#K2&$%=fx$XX^ zTWN@SOiN8Xy(Q5mmBsJ!@$!=`FTb)+JNtM{l`W5{^a$&m<`txvifRF}%|M#rf8z$( zZrt}E-RCab6;!}1X0MI1<+Wc?+QTlHw=9z_7o}p;=&1kCqL-VY>+Lo=@Mh(V76GG2 zcRw_))uQCebjSBgdmW;MZta31AZ0kGX$3+jf{wejWml-oBZ1lJhMR@`L1y;^Heb{i ziE<>(a!;UR?jdZyXwMVnSW&(s$|1a@#m(I5YqvlaOtW@bSU;Qn=E>+|&&MgiD`eoOaGM7@FgF*I zpm2O_305*M#dqANW}4Paj{u?oCinx(Bpl zb6-DO6V#hJHMh`6pu?J=&1n?Sl|UyoLH)=9^aRlPP0#>33G@e`%bTDr={C@CUthnq zP0%1}?Q5Y-pu3x(7Rmy;5a_WcXecf6wS$79gd0x#eJ!kYoC|>nEK^ zJICp|e$HbS`3KHqJ85xX%o9teXj&CF?d*l2+KSz7h1=}uPMc$x7p#wSaib(x@dCiJ z(dU7)*j4Hu6!XNJlMO2~(9OeER=cu`QJjODo0-XivyT(b`%~ z6X>N0ns!VCV1J{oi`uQx7~XQ)6xzdQ$E!+gF5L*7!*B6CdVLFYC+}ACxtLLg=J*w&}Ogl}V9z zS;Y6xgH>E3J^Jqkguy=8iIFzKrSG4o-qE4KS0Ez!*M8)D!K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INNX1P+!RvXFaOVE4;JX6O?<}LWOr%bMFnQrmax;`Y;K2t6sJ! z{J;E4hsQm;Dg`d$C_SrWI;%x?QHpAH3h$r>rdrwjO5rJmQt+ITzXRN)MgC#G(v|$+ zd?~m{)v?|=*O9~dKzE=~gH0SPD+h}t(31b-SX?x(Aw$b%O4d~6$KwjWA^IFo4PJ+Y^T$oQQ!Y^V_0Uawk?nY@k4bGsCOUPzyHB2KHYC2)^E^96_`DE~ee+pDH%u2SC zsXp$*y@pPm?2DH&pQ= n-F@%h=eE$LV_~%JR3k2ow$t5x>eLDPB%M3mowX)*Ci(vWCgFG| diff --git a/assembler.c b/assembler.c index 670e055..e6515c9 100644 --- a/assembler.c +++ b/assembler.c @@ -41,10 +41,9 @@ void mainRunner(int argc, char **argv) { lineNum = 1; firstPass(line, outP, &errors, outPutFileName); } else { - fclose(outP); fclose(inp); remove(outPutFileName); - printError("due to errors not continuing with flow on current file, continue with next file..."); + printError("due to errors not continuing with flow on current file, continue with next file"); } printf("===>>>>>> Finished file: %s <<<<<<===\n", outPutFileName); printf("======================================================================\n\n"); diff --git a/tester/main_tester b/input_output_results/main_tester.ob similarity index 100% rename from tester/main_tester rename to input_output_results/main_tester.ob diff --git a/input_output_results/multi_file_log.txt b/input_output_results/multi_file_log.txt new file mode 100644 index 0000000..c299a25 --- /dev/null +++ b/input_output_results/multi_file_log.txt @@ -0,0 +1,62 @@ +Received 3 files, starting assembler process. + +Processing: ps7.as +===>>>>>> Pre assembler finished: Errors: 0 +1 --->Too many commas in 1 line +1 --->Too many commas in 1 line +1 --->Too many commas in 1 line +2 --->Wrong number of operands for command: clr +3 --->Error: CMD: [ ... ] not found. +4 --->Error: CMD: [ #$%#@$%@#$#@ ] not found. +5 --->Error: CMD: [ r1 ] not found. +6 --->Undefined label: MAIN: +7 --->Wrong number of operands for command: jsr +8 --->expected regs between 10 and 15 +9 --->reg: r32, wrong number +===>>>>>> First pass finished: Errors: 11 + +-->due to errors not continuing with flow on current file, continue with next file... +===>>>>>> Finished file: tester/ps7.am <<<<<<=== +====================================================================== + +Processing: ps4.as +===>>>>>> Pre assembler finished: Errors: 0 +1 --->Error: CMD: [ mow ] not found. +2 --->Error: CMD: [ wom ] not found. +3 --->Error: CMD: [ step ] not found. +4 --->Error: CMD: [ jpr ] not found. +5 --->Error: CMD: [ ABC ] not found. +7 --->Operand: 1, did not find matching sort type + +9 --->String not declared properly +===>>>>>> First pass finished: Errors: 7 + +-->due to errors not continuing with flow on current file, continue with next file... +===>>>>>> Finished file: tester/ps4.am <<<<<<=== +====================================================================== + +Processing: ps3.as +===>>>>>> Pre assembler finished: Errors: 0 +1 --->Undefined label: LIST: +2 --->Wrong number of operands for command: lea +3 --->Wrong number of operands for command: mov +5 --->Too many commas in 1 line +6 --->Wrong number of operands for command: mov +7 --->Undefined label: MAIN: +8 --->Wrong number of operands for command: mov +8 --->Too many commas in 1 line +9 --->Wrong number of operands for command: clr +10 --->Wrong number of operands for command: dec +11 --->Wrong number of operands for command: bne +12 --->Wrong number of operands for command: lea +13 --->No data after .data declaration +14 --->Undefined label: LABEL: + +14 --->No characters after .string declaration or string undeclared properly +===>>>>>> First pass finished: Errors: 15 + +-->due to errors not continuing with flow on current file, continue with next file... +===>>>>>> Finished file: tester/ps3.am <<<<<<=== +====================================================================== + +Finished processing - 3 file(s) that were received. diff --git a/input_output_results/no_files_received_log.txt b/input_output_results/no_files_received_log.txt new file mode 100644 index 0000000..ed67a73 --- /dev/null +++ b/input_output_results/no_files_received_log.txt @@ -0,0 +1,3 @@ +Received 0 files, starting assembler process. + +Finished processing - 0 file(s) that were received. diff --git a/tester/ps.am b/input_output_results/ps.am similarity index 90% rename from tester/ps.am rename to input_output_results/ps.am index 9531cf2..3c96bfa 100644 --- a/tester/ps.am +++ b/input_output_results/ps.am @@ -13,7 +13,7 @@ dec K .entry MAIN sub LOOP[r10] ,r14 END: stop -STR: .string “abcd” +STR: .string "abcd" LIST: .data 6, -9 .data -100 .entry K diff --git a/ps.as b/input_output_results/ps.as similarity index 92% rename from ps.as rename to input_output_results/ps.as index 4d5ba64..17a51da 100644 --- a/ps.as +++ b/input_output_results/ps.as @@ -17,7 +17,7 @@ dec K .entry MAIN sub LOOP[r10] ,r14 END: stop -STR: .string “abcd” +STR: .string "abcd" LIST: .data 6, -9 .data -100 .entry K diff --git a/tester/ps.ent b/input_output_results/ps.ent similarity index 100% rename from tester/ps.ent rename to input_output_results/ps.ent diff --git a/tester/ps.ext b/input_output_results/ps.ext similarity index 100% rename from tester/ps.ext rename to input_output_results/ps.ext diff --git a/tester/ps.ob b/input_output_results/ps.ob similarity index 100% rename from tester/ps.ob rename to input_output_results/ps.ob diff --git a/ps2.as b/input_output_results/ps2.as similarity index 94% rename from ps2.as rename to input_output_results/ps2.as index 15aa2b2..27424a2 100644 --- a/ps2.as +++ b/input_output_results/ps2.as @@ -8,4 +8,4 @@ clr r2 clr r3 m2 clr r3 -MAIN: \ No newline at end of file +LABB: \ No newline at end of file diff --git a/input_output_results/ps2_log.txt b/input_output_results/ps2_log.txt new file mode 100644 index 0000000..d5f6ba7 --- /dev/null +++ b/input_output_results/ps2_log.txt @@ -0,0 +1,11 @@ +Received 1 files, starting assembler process. + +Processing: ps2.as +--->macro doesnt have a closure with 'endm' (end of code) will not create am file and continue with process. +===>>>>>> Pre assembler finished: Errors: 1 + +-->due to errors not continuing with flow on current file, continue with next file +===>>>>>> Finished file: tester/ps2.am <<<<<<=== +====================================================================== + +Finished processing - 1 file(s) that were received. diff --git a/tester/ps3.am b/input_output_results/ps3.am similarity index 100% rename from tester/ps3.am rename to input_output_results/ps3.am diff --git a/ps3.as b/input_output_results/ps3.as similarity index 100% rename from ps3.as rename to input_output_results/ps3.as diff --git a/input_output_results/ps3_log.txt b/input_output_results/ps3_log.txt new file mode 100644 index 0000000..29ba56a --- /dev/null +++ b/input_output_results/ps3_log.txt @@ -0,0 +1,27 @@ +Received 1 files, starting assembler process. + +Processing: ps3.as +===>>>>>> Pre assembler finished: Errors: 0 +1 --->Undefined label: LIST: +2 --->Wrong number of operands for command: lea +3 --->Wrong number of operands for command: mov +5 --->Too many commas in 1 line +6 --->Wrong number of operands for command: mov +7 --->Undefined label: MAIN: +8 --->Wrong number of operands for command: mov +8 --->Too many commas in 1 line +9 --->Wrong number of operands for command: clr +10 --->Wrong number of operands for command: dec +11 --->Wrong number of operands for command: bne +12 --->Wrong number of operands for command: lea +13 --->No data after .data declaration +14 --->Undefined label: LABEL: + +14 --->No characters after .string declaration or string undeclared properly +===>>>>>> First pass finished: Errors: 15 + +-->due to errors not continuing with flow on current file, continue with next file... +===>>>>>> Finished file: tester/ps3.am <<<<<<=== +====================================================================== + +Finished processing - 1 file(s) that were received. diff --git a/tester/ps4.am b/input_output_results/ps4.am similarity index 100% rename from tester/ps4.am rename to input_output_results/ps4.am diff --git a/ps4.as b/input_output_results/ps4.as similarity index 100% rename from ps4.as rename to input_output_results/ps4.as diff --git a/input_output_results/ps4_log.txt b/input_output_results/ps4_log.txt new file mode 100644 index 0000000..3023918 --- /dev/null +++ b/input_output_results/ps4_log.txt @@ -0,0 +1,19 @@ +Received 1 files, starting assembler process. + +Processing: ps4.as +===>>>>>> Pre assembler finished: Errors: 0 +1 --->Error: CMD: [ mow ] not found. +2 --->Error: CMD: [ wom ] not found. +3 --->Error: CMD: [ step ] not found. +4 --->Error: CMD: [ jpr ] not found. +5 --->Error: CMD: [ ABC ] not found. +7 --->Operand: 1, did not find matching sort type + +9 --->String not declared properly +===>>>>>> First pass finished: Errors: 7 + +-->due to errors not continuing with flow on current file, continue with next file... +===>>>>>> Finished file: tester/ps4.am <<<<<<=== +====================================================================== + +Finished processing - 1 file(s) that were received. diff --git a/tester/ps5.am b/input_output_results/ps5.am similarity index 100% rename from tester/ps5.am rename to input_output_results/ps5.am diff --git a/ps5.as b/input_output_results/ps5.as similarity index 100% rename from ps5.as rename to input_output_results/ps5.as diff --git a/input_output_results/ps5_log.txt b/input_output_results/ps5_log.txt new file mode 100644 index 0000000..6625a0d --- /dev/null +++ b/input_output_results/ps5_log.txt @@ -0,0 +1,14 @@ +Received 1 files, starting assembler process. + +Processing: ps5.as +===>>>>>> Pre assembler finished: Errors: 0 +===>>>>>> First pass finished: Errors: 0 +--->Usage of undeclared label found: LIST, error +--->Usage of undeclared label found: NEWLABEL, error +===>>>>>> Second pass finished: Errors: 2 + +-->due to errors not continuing with flow on current file, continue with next file... +===>>>>>> Finished file: tester/ps5.am <<<<<<=== +====================================================================== + +Finished processing - 1 file(s) that were received. diff --git a/input_output_results/ps6_log.txt b/input_output_results/ps6_log.txt new file mode 100644 index 0000000..630b275 --- /dev/null +++ b/input_output_results/ps6_log.txt @@ -0,0 +1,7 @@ +Received 1 files, starting assembler process. + +Processing: ps6.as +============================================================ + +-->file not found, skipping to next +Finished processing - 1 file(s) that were received. diff --git a/tester/ps7.am b/input_output_results/ps7.am similarity index 100% rename from tester/ps7.am rename to input_output_results/ps7.am diff --git a/ps7.as b/input_output_results/ps7.as similarity index 100% rename from ps7.as rename to input_output_results/ps7.as diff --git a/input_output_results/ps7_log.txt b/input_output_results/ps7_log.txt new file mode 100644 index 0000000..f4cb0da --- /dev/null +++ b/input_output_results/ps7_log.txt @@ -0,0 +1,22 @@ +Received 1 files, starting assembler process. + +Processing: ps7.as +===>>>>>> Pre assembler finished: Errors: 0 +1 --->Too many commas in 1 line +1 --->Too many commas in 1 line +1 --->Too many commas in 1 line +2 --->Wrong number of operands for command: clr +3 --->Error: CMD: [ ... ] not found. +4 --->Error: CMD: [ #$%#@$%@#$#@ ] not found. +5 --->Error: CMD: [ r1 ] not found. +6 --->Undefined label: MAIN: +7 --->Wrong number of operands for command: jsr +8 --->expected regs between 10 and 15 +9 --->reg: r32, wrong number +===>>>>>> First pass finished: Errors: 11 + +-->due to errors not continuing with flow on current file, continue with next file... +===>>>>>> Finished file: tester/ps7.am <<<<<<=== +====================================================================== + +Finished processing - 1 file(s) that were received. diff --git a/input_output_results/ps_log.txt b/input_output_results/ps_log.txt new file mode 100644 index 0000000..6476061 --- /dev/null +++ b/input_output_results/ps_log.txt @@ -0,0 +1,10 @@ +Received 1 files, starting assembler process. + +Processing: ps.as +===>>>>>> Pre assembler finished: Errors: 0 +===>>>>>> First pass finished: Errors: 0 +===>>>>>> Second pass finished: Errors: 0 +===>>>>>> Finished file: tester/ps.am <<<<<<=== +====================================================================== + +Finished processing - 1 file(s) that were received. diff --git a/misc/utils.c b/misc/utils.c index 2e3793d..9acd5ff 100644 --- a/misc/utils.c +++ b/misc/utils.c @@ -100,7 +100,7 @@ FILE *inputFileInit(char **argv, FILE *inp, int *inputFileCounter) { * @return */ FILE *outputFileInit(FILE *outP, char *outPutFileName, char *inputName) { - sprintf(outPutFileName, "tester/%s.am", inputName); + sprintf(outPutFileName, "%s.am", inputName); outP = fopen(outPutFileName, "w+"); return outP; } @@ -573,7 +573,7 @@ void errorHandler(int *errors, char *currLine) { i = 0; isComma = FALSE; while (lineForErrorHandling[i] != '\0') { - if (lineForErrorHandling[i] == '"' && isComma == FALSE) { + if (isComma == FALSE && lineForErrorHandling[i] == '"') { isComma = TRUE; i++; continue; @@ -583,7 +583,11 @@ void errorHandler(int *errors, char *currLine) { } i++; } - printf("%d --->String not declared properly\n", lineNum); + printf("\n"); + if (isComma == TRUE){ + *errors += 1; + printf("%d --->String not declared properly\n", lineNum); + } } } diff --git a/passes/first_pass.c b/passes/first_pass.c index 808e893..177d3e8 100644 --- a/passes/first_pass.c +++ b/passes/first_pass.c @@ -41,10 +41,10 @@ int codeDataOrString(char *line, machineCode *mCode, long *DC, bool withLabel, c stringCopy(mCode[*DC].declaredLabel, tempLine); stringCopy(tempLine, line); } - strtok(tempLine, "”"); + strtok(tempLine, "\""); tempLine = strtok(NULL, ""); if (tempLine == NULL) { - printf("%d --->No characters after .string declaration or string undeclared properly\n", lineNum-1); + printf("%d --->No characters after .string declaration or string undeclared properly\n", lineNum); *errors += 1; return 0; } diff --git a/tester/ps.as b/tester/ps.as deleted file mode 100644 index 4d5ba64..0000000 --- a/tester/ps.as +++ /dev/null @@ -1,25 +0,0 @@ -; file ps.as - .entry LIST - .extern W -MAIN: add r3, LIST -LOOP: prn #48 -macro m1 -inc r6 -mov r3, W -endm -lea STR, r6 -m1 -sub r1, r4 -bne END -cmp val1, #-6 -bne END[r15] -dec K - .entry MAIN -sub LOOP[r10] ,r14 -END: stop -STR: .string “abcd” -LIST: .data 6, -9 - .data -100 - .entry K -K: .data 31 - .extern val1 \ No newline at end of file diff --git a/tester/ps2.as b/tester/ps2.as deleted file mode 100644 index 15aa2b2..0000000 --- a/tester/ps2.as +++ /dev/null @@ -1,11 +0,0 @@ -mov r1, r3 -MAIN: clr r3 -macro m2 -dec r4 -mov #1, r2 -clr r1 -clr r2 -clr r3 -m2 -clr r3 -MAIN: \ No newline at end of file diff --git a/tester/ps3.as b/tester/ps3.as deleted file mode 100644 index 50fe254..0000000 --- a/tester/ps3.as +++ /dev/null @@ -1,15 +0,0 @@ -LIST: -lea -mov r1 -clr r2 -mov #23, r14 -mov r1, r2, r3 -MAIN: -mov 1 -clr r4, r5, r7 -dec 5 rpfgihjerwfwoei0fhwefewi0uofhw9uweuf9oe -bne -lea -.data -LABEL: -.string \ No newline at end of file diff --git a/tester/ps4.as b/tester/ps4.as deleted file mode 100644 index 9613570..0000000 --- a/tester/ps4.as +++ /dev/null @@ -1,8 +0,0 @@ -mow r1, r2 -wom r3, r6 -step -jpr A -ABC DCA -mov #1, R23 -clr 1 -clr REG \ No newline at end of file diff --git a/tester/ps5.as b/tester/ps5.as deleted file mode 100644 index c4b66da..0000000 --- a/tester/ps5.as +++ /dev/null @@ -1,7 +0,0 @@ -.extern W - .entry LIST -MAIN: add r3, LIST -clr r2 -clr r3 -clr r4 -bne NEWLABEL \ No newline at end of file diff --git a/tester/ps7.as b/tester/ps7.as deleted file mode 100644 index 6a61e9e..0000000 --- a/tester/ps7.as +++ /dev/null @@ -1,7 +0,0 @@ -mov r1,,,r3 -clr A, , -... -#$%#@$%@#$#@ -r1 r2 -MAIN: -jsr \ No newline at end of file From 78980c39d208fdf856cf39e7f45e10376cce230a Mon Sep 17 00:00:00 2001 From: Roman-Dev Date: Mon, 21 Mar 2022 23:40:43 +0200 Subject: [PATCH 2/3] release 1.02 Signed-off-by: Roman-Dev --- .github/workflows/CI.yml | 14 +++++++------- ps.as | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 ps.as diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fc308e0..d576fc5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,9 +21,9 @@ jobs: echo building project rm -f assembler make - ./assembler input_output_results/ps input_output_results/ps2 input_output_results/ps3 input_output_results/ps4 input_output_results/ps5 ps6 input_output_results/ps7 - echo compare input_output_results/ps.ob input_output_results/main_tester - cmp input_output_results/ps.ob input_output_results/main_tester.ob + ./assembler ps + echo compare ps.ob input_output_results/main_tester + cmp ps.ob input_output_results/main_tester.ob - uses: actions/upload-artifact@v3 with: name: assembler.zip @@ -45,9 +45,9 @@ jobs: echo building project rm -f assembler make - ./assembler input_output_results/ps input_output_results/ps2 input_output_results/ps3 input_output_results/ps4 input_output_results/ps5 ps6 input_output_results/ps7 - echo compare input_output_results/ps.ob input_output_results/main_tester - cmp input_output_results/ps.ob input_output_results/main_tester.ob + ./assembler ps + echo compare ps.ob input_output_results/main_tester + cmp ps.ob input_output_results/main_tester.ob build_and_test_macos-latest: runs-on: macos-latest @@ -59,4 +59,4 @@ jobs: echo building project rm -f assembler make - ./assembler input_output_results/ps input_output_results/ps2 input_output_results/ps3 input_output_results/ps4 input_output_results/ps5 ps6 input_output_results/ps7 + ./assembler ps diff --git a/ps.as b/ps.as new file mode 100644 index 0000000..17a51da --- /dev/null +++ b/ps.as @@ -0,0 +1,25 @@ +; file ps.as + .entry LIST + .extern W +MAIN: add r3, LIST +LOOP: prn #48 +macro m1 +inc r6 +mov r3, W +endm +lea STR, r6 +m1 +sub r1, r4 +bne END +cmp val1, #-6 +bne END[r15] +dec K + .entry MAIN +sub LOOP[r10] ,r14 +END: stop +STR: .string "abcd" +LIST: .data 6, -9 + .data -100 + .entry K +K: .data 31 + .extern val1 \ No newline at end of file From dc5c6e546a361b969f97be874fbc8cd7d2b2a6b7 Mon Sep 17 00:00:00 2001 From: Roman-Dev Date: Mon, 21 Mar 2022 23:43:03 +0200 Subject: [PATCH 3/3] release 1.03 Signed-off-by: Roman-Dev --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d576fc5..cd1f8f5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,7 +23,7 @@ jobs: make ./assembler ps echo compare ps.ob input_output_results/main_tester - cmp ps.ob input_output_results/main_tester.ob + diff ps.ob input_output_results/main_tester.ob -s - uses: actions/upload-artifact@v3 with: name: assembler.zip @@ -47,7 +47,7 @@ jobs: make ./assembler ps echo compare ps.ob input_output_results/main_tester - cmp ps.ob input_output_results/main_tester.ob + diff ps.ob input_output_results/main_tester.ob -s build_and_test_macos-latest: runs-on: macos-latest