File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 8383```
8484Addition in Hades:
8585``` nasm
86- WRT [1] ; write 1 to RAM ;
86+ WRT [1] ; write 1 to Tape ;
8787INCP ; move ptr to the right
88- WRT [2] ; write 2 to RAM ;
88+ WRT [2] ; write 2 to Tape ;
8989LOOP [ ; start a loop ;
9090 DECP ; move ptr to the left ;
91- RDV ; read value from RAM ;
91+ RDV ; read value from Tape ;
9292 INCV ; increment ptr value ;
93- WTV ; write ptr value to RAM ;
93+ WTV ; write ptr value to Tape ;
9494 INCP ; move ptr to the right ;
95- RDV ; read value from RAM ;
95+ RDV ; read value from Tape ;
9696 DECV ; decrement ptr value ;
97- WTV ; write ptr value to RAM ;
97+ WTV ; write ptr value to Tape ;
9898]
9999DECP ; move ptr to the left ;
100- RDV ; read value from RAM ;
100+ RDV ; read value from Tape ;
101101; end program ;
102102HLT
103103```
104104Using labels in Hades:
105105``` nasm
106106CLB [foo] ; create label called "foo" ;
107- MOV [5] ; move ptr to position 5 of RAM ;
107+ MOV [5] ; move ptr to position 5 of Tape ;
108108CLB [bar] ; create label called "bar" ;
109109JLB [foo] ; jump to foo label ;
110110WRT [1] ; write 1 to foo ;
You can’t perform that action at this time.
0 commit comments