store32.asm 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. __PISTORE32:
  2. lda z80_l ;- push hl
  3. pha
  4. lda z80_h
  5. pha
  6. lda z80_ix ;- push ix
  7. pha
  8. lda z80_ix+1
  9. pha
  10. pla ;- pop hl
  11. sta z80_h
  12. pla
  13. sta z80_l
  14. lda z80_l ;- add hl,bc
  15. clc
  16. adc z80_c
  17. sta z80_l
  18. lda z80_h
  19. adc z80_b
  20. sta z80_h
  21. pla ;- pop bc
  22. sta z80_b
  23. pla
  24. sta z80_c
  25. __ISTORE32: ; Load address at hl, and stores E,D,B,C integer at that address
  26. ldy #$00 ;- ld a,(hl)
  27. lda (z80_hl),y
  28. sta z80_a
  29. inc z80_l ;- inc hl
  30. bne *+4
  31. inc z80_h
  32. ldy #$00 ;- ld h,(hl)
  33. lda (z80_hl),y
  34. sta z80_h
  35. lda z80_a ;- ld l,a
  36. sta z80_l
  37. __STORE32: ; Stores the given integer in DEBC at address HL
  38. lda z80_c ;- ld (hl),c
  39. ldy #$00
  40. sta (z80_hl),y
  41. inc z80_l ;- inc hl
  42. bne *+4
  43. inc z80_h
  44. lda z80_b ;- ld (hl),b
  45. ldy #$00
  46. sta (z80_hl),y
  47. inc z80_l ;- inc hl
  48. bne *+4
  49. inc z80_h
  50. lda z80_e ;- ld (hl),e
  51. ldy #$00
  52. sta (z80_hl),y
  53. inc z80_l ;- inc hl
  54. bne *+4
  55. inc z80_h
  56. lda z80_d ;- ld (hl),d
  57. ldy #$00
  58. sta (z80_hl),y
  59. rts ;- ret