lddede.asm 562 B

1234567891011121314151617181920212223242526272829303132333435
  1. ; Loads DE into DE
  2. ; Modifies C register
  3. ; There is a routine similar to this one
  4. ; at ROM address L2AEE
  5. __LOAD_DE_DE:
  6. lda z80_e ;- ex de,hl
  7. ldx z80_l
  8. stx z80_e
  9. sta z80_l
  10. lda z80_d
  11. ldx z80_h
  12. stx z80_d
  13. sta z80_h
  14. ldy #$00 ;- ld c,(hl)
  15. lda (z80_hl),y
  16. sta z80_c
  17. inc z80_l ;- inc hl
  18. bne *+4
  19. inc z80_h
  20. ldy #$00 ;- ld h,(hl)
  21. lda (z80_hl),y
  22. sta z80_h
  23. lda z80_c ;- ld l,c
  24. sta z80_l
  25. lda z80_e ;- ex de,hl
  26. ldx z80_l
  27. stx z80_e
  28. sta z80_l
  29. lda z80_d
  30. ldx z80_h
  31. stx z80_d
  32. sta z80_h
  33. rts ;- ret