Skip to content

Commit

Permalink
Add STORE (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemfp committed Oct 6, 2016
1 parent 5da21ab commit 8152e2e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
'BNQ': [14, -1, 1, 1, 1],
'JUMP': [31, -1, -1, -1, 1],
'ISLT': [28, 1, 1, -1, 1],
'LOAD': [29, 1, 1, 1, -1]
'LOAD': [29, 1, 1, 1, -1],
'STORE': [30, 1, 1, 1, -1]
}

try:
Expand Down
7 changes: 7 additions & 0 deletions exemplos/load-store.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sub $0, $0, $0 # zera o $0
isum $1, $0, 1 # adiciona 1 no $1
isum $2, $0, 10 # adiciona 10 no $2
store $2, $0, $1 # salva valor do $2 no ($0 + $1) endere�o
load $3, $0, $1 # carrega valor do ($0 + $1) endere�o para $3
and $3, $3, $3 # mostra valor do $3
jump 5
2 changes: 1 addition & 1 deletion ula
Submodule ula updated 2 files
+1 −1 README.md
+764 −565 main.circ

0 comments on commit 8152e2e

Please sign in to comment.