diff --git a/asm/asm_test.asm b/asm/asm_test.asm new file mode 100644 index 0000000..546e779 --- /dev/null +++ b/asm/asm_test.asm @@ -0,0 +1,26 @@ +.ORIG x3000 + AND R0, R0, #0 + AND R1, R1, #0 + AND R3, R3, #0 + LEA R0, NUM + ADD R1, R1, R0 + LD R2, ASCII + +FOR_LOOP + LDR R4, R1, #0 + BRz END_LOOP + ADD R4, R4, R2 + STR R4, R1, #0 + ADD R1, R1, #1 + BRnzp FOR_LOOP +END_LOOP + + PUTs +HALT + +ASCII .fill x30 +NUM .fill x01 + .fill x02 + .fill x03 + .fill x04 +.END \ No newline at end of file diff --git a/asm/helloworld.asm b/asm/helloworld.asm index fd0bdb1..ae4edc1 100644 --- a/asm/helloworld.asm +++ b/asm/helloworld.asm @@ -1,6 +1,26 @@ - .ORIG x3000 - LEA R0, HS ; - PUTS ; - HALT ; -HS .STRINGZ "Henlo world!" - .END \ No newline at end of file +.ORIG x3000 + AND R0, R0, #0 + AND R1, R1, #0 + AND R3, R3, #0 + LEA R0, NUM + ADD R1, R1, R0 + LD R2, ASCII + +FOR_LOOP + LDR R4, R1, #0 + BRz END_LOOP + ADD R4, R4, R2 + STR R4, R1, #0 + ADD R1, R1, #1 + BRnzp FOR_LOOP +END_LOOP + + PUTs +HALT + +ASCII .fill x30 +NUM .fill x01 + .fill x02 + .fill x03 + .fill x04 +.END