bxor32.asm 1.2 KB

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