Ejemplo n.º 1
0
 def execute(self, eu: IExecutionUnit, *args) -> bool:
     port, dest = args
     if eu.has_input(port):
         value = eu.read_port(port)
         eu.store(value)
         return True
     return False
Ejemplo n.º 2
0
Archivo: cmp.py Proyecto: en0/emu
 def execute(self, eu: IExecutionUnit, *args) -> bool:
     a, b = args
     eu.clear_flag(FLG_CORE_EQ | FLG_CORE_LT | FLG_CORE_GT)
     if a < b:
         eu.set_flag(FLG_CORE_LT)
     if a > b:
         eu.set_flag(FLG_CORE_GT)
     if a == b:
         eu.set_flag(FLG_CORE_EQ)
     return True
Ejemplo n.º 3
0
 def execute(self, eu: IExecutionUnit, *args) -> bool:
     a, b = args
     eu.store(a | b)
     return True
Ejemplo n.º 4
0
Archivo: jmp.py Proyecto: en0/emu
 def execute(self, eu: IExecutionUnit, *args) -> bool:
     value, _ = args
     eu.store(value)
     return False
Ejemplo n.º 5
0
 def execute(self, eu: IExecutionUnit, *args) -> bool:
     value, port = args
     eu.write_port(port, value)
     return True
Ejemplo n.º 6
0
Archivo: hlt.py Proyecto: en0/emu
 def execute(self, eu: IExecutionUnit, *args) -> bool:
     eu.set_flag(FLG_CORE_HLT)
     return False
Ejemplo n.º 7
0
Archivo: brk.py Proyecto: en0/emu
 def execute(self, eu: IExecutionUnit, *args) -> bool:
     eu.dump_core()
     input("...")
     return True