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