 		
 		return idPc
 	}
+	
+	// MARK: - Registers
+	
+	fileprivate func removeRegValue(in reg: String) throws {
+		
+		let key = privateReg(for: reg)
+
+		registers.removeValue(forKey: key)
+
+		// TODO: throw error?
+//		guard let _ = registers.removeValue(forKey: key) else {
+//			throw error(.unexpectedArgument)
+//		}
+	}
+	
+	fileprivate func getRegValue(for reg: String) throws -> StackElement {
+		
+		let key = privateReg(for: reg)
+
+		guard let regValue = registers[key] else {
+			throw error(.unexpectedArgument)
+		}
+		
+		return regValue
+	}
+	
+	fileprivate func setRegValue(_ value: StackElement, for reg: String) {
+		
+		let key = privateReg(for: reg)
+		registers[key] = value
+		
+	}
+	
+	fileprivate func privateReg(for reg: String) -> String {
+//		return "\(functionDepth)_\(reg)"
+		return "\(reg)"
+	}
+	
+	// MARK: -
 	
 	// TODO: max cache size?
 	fileprivate var labelProgramCountersCache = [String : Int]()

				
				pc = try popFunctionInvoke()
				
			} else if let functionHeader = bytecode[pc] as? BytecodeFunctionHeader {

				guard let funcEndPc = functionEndMap[functionHeader.id] else {
					throw error(.unexpectedArgument)
				}
				
				pc = funcEndPc + 1
				

			throw error(.unexpectedArgument)
		}
		
		let regValue = try getRegValue(for: reg)
		
		try push(regValue)
		
