Added translation registers (2)

This commit is contained in:
alejeune 2023-05-12 15:57:55 +02:00
parent f006ac975a
commit 1f8fa678bc

View file

@ -50,9 +50,32 @@ def convertToRegister(s):
case "JMF":
pass
case "INF":
l.append("LOAD R0 "+s[2])
l.append("LOAD R1 "+s[3])
l.append("SUB R1 ")
l.append("LOAD R0 "+s[2+inc])
l.append("LOAD R1 "+s[3+inc])
l.append("INF R2 R0 R1")
case "SUP":
l.append("LOAD R0 "+s[2+inc])
l.append("LOAD R1 "+s[3+inc])
l.append("SUP R2 R1 R0")
case "EQ":
l.append("LOAD R0 "+s[2+inc])
l.append("LOAD R1 "+s[3+inc])
l.append("EQ R2 R1 R0")
case "PRI":
l.append("PRI "+s[2+inc])
case "AND":
l.append("LOAD R0 "+s[2+inc])
l.append("LOAD R1 "+s[3+inc])
l.append("AND R2 R0 R1")
case "OR":
l.append("LOAD R0 "+s[2+inc])
l.append("LOAD R1 "+s[3+inc])
l.append("OR R2 R0 R1")
case "NOT":
l.append("LOAD R0 "+s[2+inc])
l.append("NOT R2 R0")
''' R2 contiendra la valeur qui dit s'il faut sauter ou non'''
return l