Advertisement
Runer112

link protocol test stuff

Apr 7th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. __GetByteLoop:
  2. in a,(0)
  3. srl a
  4. jr z,__GetByteLoop ;31cc loop
  5. rl l
  6. jr nc,__GetByteLoop ;46cc loop
  7.  
  8.  
  9. __GetByteLoop:
  10. in a,(c)
  11. jr z,__GetByteLoop ;24cc loop
  12. rra
  13. rl l
  14. jp nc,__GetByteLoop ;41cc loop
  15.  
  16.  
  17. __GetByteLoop:
  18. in l,(c)
  19. jp (hl)
  20. .org $8500
  21. __GetByteJump:
  22. jr __GetByteLoop ;28cc loop
  23. ccf
  24. rla
  25. jp c,__GetByteLoop ;30/34cc loop
  26.  
  27.  
  28. __GetByteLoop:
  29. in l,(c)
  30. jp (hl)
  31. .org $8500
  32. __GetByteJump:
  33. jp (ix) ;24cc loop
  34. ccf
  35. rla
  36. jp c,__GetByteLoop ;30/34cc loop
  37.  
  38.  
  39. .org $8500
  40. __GetByteLoop:
  41. ccf
  42. rla
  43. ret c
  44. in l,(c)
  45. jp (hl) ;21/25/29cc loop
  46.  
  47.  
  48. SendByte:
  49. ld bc,$0302
  50. ld a,c
  51. out (0),a
  52. SendByteWait:
  53. ld a,h
  54. or l
  55. jr z,SendByteEnd
  56. dec hl
  57. in a,(0)
  58. and b
  59. jr nz,SendByteWait
  60. sla e
  61. sbc a,c
  62. out (0),a
  63. inc hl
  64. ld a,(hl)
  65. SendByteLoop:
  66. ld a,b
  67. out (0),a ;33cc
  68. sbc a,c
  69. out (0),a ;15cc
  70. sla e
  71. jp nz,SendByteLoop ;48cc loop
  72. sbc a,c
  73. out (0),a ;33cc
  74. xor a
  75. out (0),a ;15cc
  76. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement