storef.asm 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. __PISTOREF: ; Indect Stores a float (A, E, D, C, B) at location stored in memory, pointed by (IX + HL)
  2. lda z80_e ;- push de
  3. pha
  4. lda z80_d
  5. pha
  6. lda z80_e ;- ex de,hl ; 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. lda z80_ix ;- push ix
  15. pha
  16. lda z80_ix+1
  17. pha
  18. pla ;- pop hl ; HL <- IX
  19. sta z80_h
  20. pla
  21. sta z80_l
  22. clc ;- add hl,de ; HL <- IX + HL
  23. lda z80_l
  24. adc z80_e
  25. sta z80_l
  26. lda z80_h
  27. adc z80_d
  28. sta z80_h
  29. pla ;- pop de
  30. sta z80_d
  31. pla
  32. sta z80_e
  33. __ISTOREF: ; Load address at hl, and stores A,E,D,C,B registers at that address. Modifies A' register
  34. ldx z80_ap ;- ex af,af'
  35. sta z80_ap
  36. txa
  37. ldy #$00 ;- ld a,(hl)
  38. lda (z80_hl),y
  39. sta z80_a
  40. inc z80_l ;- inc hl
  41. bne *+4
  42. inc z80_h
  43. ldy #$00 ;- ld h,(hl)
  44. lda (z80_hl),y
  45. sta z80_h
  46. lda z80_a ;- ld l,a ; HL = (HL)
  47. sta z80_l
  48. ldx z80_ap ;- ex af,af'
  49. sta z80_ap
  50. txa
  51. __STOREF: ; Stores the given FP number in A EDCB at address HL
  52. lda z80_a ;- ld (hl),a
  53. ldy #$00
  54. sta (z80_hl),y
  55. inc z80_l ;- inc hl
  56. bne *+4
  57. inc z80_h
  58. lda z80_e ;- ld (hl),e
  59. ldy #$00
  60. sta (z80_hl),y
  61. inc z80_l ;- inc hl
  62. bne *+4
  63. inc z80_h
  64. lda z80_d ;- ld (hl),d
  65. ldy #$00
  66. sta (z80_hl),y
  67. inc z80_l ;- inc hl
  68. bne *+4
  69. inc z80_h
  70. lda z80_c ;- ld (hl),c
  71. ldy #$00
  72. sta (z80_hl),y
  73. inc z80_l ;- inc hl
  74. bne *+4
  75. inc z80_h
  76. lda z80_b ;- ld (hl),b
  77. ldy #$00
  78. sta (z80_hl),y
  79. rts ;- ret