table_jump.asm 679 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. JUMP_HL_PLUS_2A: ; Does JP (HL + A*2) Modifies DE. Modifies A
  2. clc ;- add a,a
  3. adc z80_a
  4. JUMP_HL_PLUS_A: ; Does JP (HL + A) Modifies DE
  5. lda z80_a ;- ld e,a
  6. sta z80_e
  7. lda #0 ;- ld d,0
  8. sta z80_d
  9. JUMP_HL_PLUS_DE: ; Does JP (HL + DE)
  10. clc ;- add hl,de
  11. lda z80_l
  12. adc z80_e
  13. sta z80_l
  14. lda z80_h
  15. adc z80_d
  16. sta z80_h
  17. ldy #$00 ;- ld e,(hl)
  18. lda (z80_hl),y
  19. sta z80_e
  20. inc z80_l ;- inc hl
  21. bne *+4
  22. inc z80_h
  23. ldy #$00 ;- ld d,(hl)
  24. lda (z80_hl),y
  25. sta z80_d
  26. lda z80_e ;- ex de,hl
  27. ldx z80_l
  28. stx z80_e
  29. sta z80_l
  30. lda z80_d
  31. ldx z80_h
  32. stx z80_d
  33. sta z80_h
  34. CALL_HL:
  35. jmp (z80_hl) ;- jp (hl)