bor32.asm 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ; FASTCALL bitwise or 32 version.
  2. ; Performs 32bit or 32bit and returns the bitwise
  3. ; result DE,HL
  4. ; First operand in DE,HL 2nd operand into the stack
  5. __BOR32:
  6. lda z80_h ;- ld b,h
  7. lda z80_b
  8. lda z80_l ;- ld c,l ; BC <- HL
  9. lda z80_c
  10. pla ;- pop hl ; Return address
  11. sta z80_h
  12. pla
  13. sta z80_l
  14. tsx ;- ex (sp),hl ; HL <- Lower part of 2nd Operand
  15. lda $0103,x
  16. ldy z80_h
  17. sta z80_h
  18. tya
  19. sta $0103,x
  20. lda $0104,x
  21. ldy z80_l
  22. sta z80_l
  23. tya
  24. sta $104,x
  25. lda z80_b ;- ld a,b
  26. lda z80_a
  27. ora z80_h ;- or h
  28. lda z80_a ;- ld b,a
  29. lda z80_b
  30. lda z80_c ;- ld a,c
  31. lda z80_a
  32. ora z80_l ;- or l
  33. lda z80_a ;- ld c,a ; BC <- BC & HL
  34. sta z80_c
  35. pla ;- pop hl ; Return address
  36. sta z80_h
  37. pla
  38. sta z80_l
  39. tsx ;- ex (sp),hl ; HL <- High part of 2nd Operand
  40. lda $0103,x
  41. ldy z80_h
  42. sta z80_h
  43. tya
  44. sta $0103,x
  45. lda $0104,x
  46. ldy z80_l
  47. sta z80_l
  48. tya
  49. sta $104,x
  50. lda z80_d ;- ld a,d
  51. lda z80_a
  52. ora z80_h ;- or h
  53. lda z80_a ;- ld d,a
  54. lda z80_d
  55. lda z80_e ;- ld a,e
  56. lda z80_a
  57. ora z80_l ;- or l
  58. lda z80_a ;- ld e,a ; DE <- DE & HL
  59. sta z80_e
  60. lda z80_b ;- ld h,b
  61. sta z80_h
  62. lda z80_c ;- ld l,c ; HL <- BC ; Always return DE,HL pair regs
  63. sta z80_l
  64. rts ;- ret