git @ Cat's Eye Technologies SixtyPical / b86e749
Copy word to word table. Chris Pressey 3 years ago
3 changed file(s) with 22 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
88 ld x, 0
99 copy 777, one
1010 copy one, many + x
11 copy many + x, one
11 //copy many + x, one
1212 }
362362 if src.type == TYPE_WORD and dest.ref.type == TYPE_WORD_TABLE:
363363 src_label = self.labels[src.name]
364364 dest_label = self.labels[dest.ref.name]
365 raise NotImplementedError("""\
366 What we will need to do here, is to have TWO 'labels' per name, one for the high byte table,
367 and one for the low byte table. Then select AbsoluteX() or AbsoluteY() addressing on those
368 tables. And use that in the STA() part.""")
365 addressing_mode = None
366 if dest.index == REG_X:
367 addressing_mode = AbsoluteX
368 elif dest.index == REG_Y:
369 addressing_mode = AbsoluteY
370 else:
371 raise NotImplementedError(dest)
372 self.emitter.emit(LDA(Absolute(src_label)))
373 self.emitter.emit(STA(AbsoluteX(dest_label)))
374 self.emitter.emit(LDA(Absolute(Offset(src_label, 1))))
375 self.emitter.emit(STA(AbsoluteX(Offset(dest_label, 256))))
369376 else:
370377 raise NotImplementedError
371378
452452 = $081A INX
453453 = $081B RTS
454454
455 Copy word to word table and back.
455 Copy word to word table.
456456
457457 | word one
458458 | word table many
465465 | ld x, 0
466466 | copy 777, one
467467 | copy one, many + x
468 | copy many + x, one
469468 | }
470469 = $080D LDX #$00
471 = $08.. LDA #$D0
472 = $080F STA $0818
473 = $0812 LDA #$07
474 = $0814 STA $0819
475 = ...
476 = $08.. RTS
470 = $080F LDA #$09
471 = $0811 STA $0826
472 = $0814 LDA #$03
473 = $0816 STA $0827
474 = $0819 LDA $0826
475 = $081C STA $0828,X
476 = $081F LDA $0827
477 = $0822 STA $0928,X
478 = $0825 RTS
477479
478480 Indirect call.
479481