Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembler v1.4 #17

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions asm/samples/add_and_mv.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ADD W1, W2, W3
MV W1, #5
6 changes: 6 additions & 0 deletions asm/samples/all_instructions.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
LOAD W1, 0x1000
STORE W2, 0x2000
ADD W3, W4, W5
SUB W5, W1, W2
CMP W3, W4
JUMP 0x3000
14 changes: 0 additions & 14 deletions asm/samples/factorial_filter.txt

This file was deleted.

17 changes: 0 additions & 17 deletions asm/samples/gcd.txt

This file was deleted.

2 changes: 2 additions & 0 deletions asm/samples/jump_and_load.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
JUMP 0x0010
LOAD W2, 0x0020
11 changes: 9 additions & 2 deletions asm/samples/multiply_two_numbers.asm
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
_start:
MV W1, #4 ; Load the number 4 into W1
MV W2, #6 ; Load the number 6 into W2
MUL W0, W1, W2 ; Multiply W1 and W2, result in W0
MV W0, #0 ; Initialize W0 with 0, where the result will be stored

ADD W0, W0, W1 ; W0 = W0 + W1 (sum 1st time)
ADD W0, W0, W1 ; W0 = W0 + W1 (sum 2nd time)
ADD W0, W0, W1 ; W0 = W0 + W1 (sum 3rd time)
ADD W0, W0, W1 ; W0 = W0 + W1 (sum 4th time)
ADD W0, W0, W1 ; W0 = W0 + W1 (sum 5th time)
ADD W0, W0, W1 ; W0 = W0 + W1 (sum 6th time)

_end:
; End of program
; End of program
1 change: 1 addition & 0 deletions asm/samples/store.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STORE W3, 0x0040
2 changes: 2 additions & 0 deletions asm/samples/sub_and_cmp.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SUB W4, W5, W3
CMP W0, W1
Loading