home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17469 < prev    next >
Encoding:
Text File  |  1992-12-17  |  2.5 KB  |  67 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!doug.cae.wisc.edu!pochanay
  3. From: pochanay@cae.wisc.edu (Adisak Pochanayon)
  4. Subject: Re: RUN BYTE! RUN!
  5. Organization: College of Engineering, Univ. of Wisconsin--Madison
  6. Date: 17 Dec 92 08:08:58 CST
  7. Message-ID: <1992Dec17.080859.10280@doug.cae.wisc.edu>
  8. References: <1992Dec15.213400.28437@doug.cae.wisc.edu> <JRAJA.92Dec17102659@vipunen.hut.fi>
  9. Sender: pochanay@cae.wisc.edu
  10. Lines: 55
  11.  
  12. In article <JRAJA.92Dec17102659@vipunen.hut.fi> jraja@vipunen.hut.fi (Jarno Tapio Rajahalme) writes:
  13. >In article <1992Dec15.213400.28437@doug.cae.wisc.edu> pochanay@cae.wisc.edu (Adisak Pochanayon) writes:
  14. >
  15. >        XDEF @UnPackByteRun
  16. >   @UnPackByteRun:
  17. >
  18. >         move.l    d2,-(SP)       ; Move #7F to d2 so that the and.w
  19. >         move.b    #$7F,d2        ; instruction at the upb_copyit label
  20. >         ^^^^^^^              ; will execute more quickly
  21. >
  22. >this should be at least word size, or even better moveq.l could be used.
  23. >Byte transfer only will trash the value of the counter in 'upb_copyit'.
  24. >
  25. >         bra.s     upb_startit    ; Process First byte-tag
  26. >
  27. >
  28. >   *********************************
  29. >
  30. >   upb_copyit
  31. >         and.w     d2,d0          ; Clear bit seven in d0
  32. >         ^^^^^
  33. >
  34. >This is the point of trouble if only 8 bits are loaded to d2.
  35. >
  36. >
  37. >    Jarno
  38. >-- 
  39. >-----------------------------------------------------------------------------
  40. >| Address: Jarno Rajahalme            | EMail:                              |
  41. >|          Servin Maijan tie 12 H 111 |   Jarno.Rajahalme@hut.fi            |
  42. >|          02150  ESPOO, FINLAND      | tel: +358 0 468 2891                |
  43. >-----------------------------------------------------------------------------
  44. >
  45. >
  46.  
  47.      If you notice, I at upb_startit
  48.  
  49. upb_startit
  50.           moveq.l   #0,d0          ; Require to clear MSB of d0 for dbf loops
  51.                                    ; Which is $FF after dbf loops
  52.  
  53.           move.b    (a0)+,d0       ; Load byte-tag into d0 and test byte-tag
  54.  
  55.     Therefore d0 always has a byte value only (upper 24 bits are 0).
  56.  
  57. upb_copyit
  58.           and.w     d2,d0          ; Clear bit seven in d0
  59.  
  60.    When the above and is executed, it doesn't matter what is in the highest
  61. 24 bits of d2 because the highest 24 bits of d0 will be guaranteed to be
  62. zero.  If you really want to avoid confusion, change the and.w to and.b
  63. although it won't have any effect on the code.  The code works perfectly as
  64. posted and is in several of my games including my most recent FreeWare game
  65. "znykdist.lha" which is on wuarchive and physik.
  66.  
  67.