Part 1 C-Instructions
This commit is contained in:
BIN
asm/Assembler.pdf
Normal file
BIN
asm/Assembler.pdf
Normal file
Binary file not shown.
18
asm/asm02.py
18
asm/asm02.py
@@ -102,8 +102,20 @@ def searchSymbols(asm):
|
||||
addtoSymboltable(line, i)
|
||||
i = i+1
|
||||
|
||||
def ciinstruction():
|
||||
c = "111"
|
||||
def ciinstruction(ci):
|
||||
c = "1110000000000000"
|
||||
|
||||
if ci.__contains__('='):
|
||||
c2 = ci.split('=')
|
||||
|
||||
ic(c2)
|
||||
|
||||
#ic("Dest = ", ci[0], " Comp = ", ci[2])
|
||||
|
||||
|
||||
return c +"\n"
|
||||
#return '{0:016b}'.format(c)+"\n"
|
||||
#return bin(c)[2:]+"\n" # 111 in binär --> falscher Weg
|
||||
# dest = comp; jump
|
||||
|
||||
|
||||
@@ -122,7 +134,7 @@ def createAsmFile():
|
||||
f.write('{0:016b}'.format(symboltable[line]) + "\n")
|
||||
else:
|
||||
#M=D
|
||||
f.write('1111111111111111\n')
|
||||
f.write(ciinstruction(line))
|
||||
f.close()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user