4.7
This commit is contained in:
29
projects/04/tests/Flip.asm
Normal file
29
projects/04/tests/Flip.asm
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
//Flip.asm
|
||||||
|
//flips the values of RAM[0] and RAM[1]
|
||||||
|
|
||||||
|
//temp=R1
|
||||||
|
//R1=R0
|
||||||
|
//R0=temp
|
||||||
|
|
||||||
|
@R1
|
||||||
|
D=M
|
||||||
|
@temp // Variable
|
||||||
|
M=D // temp = R1
|
||||||
|
|
||||||
|
@R0
|
||||||
|
D=M
|
||||||
|
@R1
|
||||||
|
M=D // R1 = R0
|
||||||
|
|
||||||
|
@temp
|
||||||
|
D=M
|
||||||
|
@R0
|
||||||
|
M=D // R0 = temp
|
||||||
|
|
||||||
|
(END)
|
||||||
|
@END
|
||||||
|
0;JMP
|
||||||
|
|
||||||
|
//@temp --> find some available memory register (register n)
|
||||||
|
//and use it to represent the variable temp. So, from now on, each
|
||||||
|
//occurance of @temp in the program will be translated into @n
|
||||||
4
projects/04/tests/Frage.txt
Normal file
4
projects/04/tests/Frage.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
How would a assembler distinguish between a branching symbol and a variable symbol?
|
||||||
|
Wie würde ein Assembler zwischen einem Verzweigungssymbol und einem variablen Symbol unterscheiden?
|
||||||
|
|
||||||
|
A branching symbol has a label declaration somewhere in the program, and a variable symbol doesn't
|
||||||
Reference in New Issue
Block a user