Unified · Split
| @@ -230,10 +230,8 @@ class Dis: · 229 unmodified lines | |||
| 230 | 230 | ||
| 231 | def list(self): | 231 | def list(self): |
| 232 | 232 | ||
| 233 | address = 0 | 233 | for i, ins in enumerate(self.code): |
| 234 | for ins in self.code: | 234 | print hex(i), str(ins) |
| 235 | print hex(address), str(ins) | ||
| 236 | address += ins.size | ||
| 237 | 235 | ||
| 238 | 236 | ||
| 239 | class RuntimeFlag: | 237 | class RuntimeFlag: |
| @@ -255,8 +253,6 @@ class Instruction: · 15 unmodified lines | |||
| 255 | 253 | ||
| 256 | def __init__(self, f): | 254 | def __init__(self, f): |
| 257 | 255 | ||
| 258 | self.start = f.tell() | ||
| 259 | |||
| 260 | self.opcode = read_B(f) | 256 | self.opcode = read_B(f) |
| 261 | self.address_mode = read_B(f) | 257 | self.address_mode = read_B(f) |
| 262 | 258 | ||
| @@ -268,8 +264,6 @@ class Instruction: · 5 unmodified lines | |||
| 268 | 264 | ||
| 269 | destination = self.address_mode & 0x07 | 265 | destination = self.address_mode & 0x07 |
| 270 | self.destination, self.destination_type = self.read_operand(destination, f) | 266 | self.destination, self.destination_type = self.read_operand(destination, f) |
| 271 | |||
| 272 | self.size = f.tell() - self.start | ||
| 273 | 267 | ||
| 274 | def read_operand(self, operand, f): | 268 | def read_operand(self, operand, f): |
| 275 | 269 | ||