home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!doug.cae.wisc.edu!pochanay
- From: pochanay@cae.wisc.edu (Adisak Pochanayon)
- Subject: Re: RUN BYTE! RUN!
- Organization: College of Engineering, Univ. of Wisconsin--Madison
- Date: 17 Dec 92 08:08:58 CST
- Message-ID: <1992Dec17.080859.10280@doug.cae.wisc.edu>
- References: <1992Dec15.213400.28437@doug.cae.wisc.edu> <JRAJA.92Dec17102659@vipunen.hut.fi>
- Sender: pochanay@cae.wisc.edu
- Lines: 55
-
- In article <JRAJA.92Dec17102659@vipunen.hut.fi> jraja@vipunen.hut.fi (Jarno Tapio Rajahalme) writes:
- >In article <1992Dec15.213400.28437@doug.cae.wisc.edu> pochanay@cae.wisc.edu (Adisak Pochanayon) writes:
- >
- > XDEF @UnPackByteRun
- > @UnPackByteRun:
- >
- > move.l d2,-(SP) ; Move #7F to d2 so that the and.w
- > move.b #$7F,d2 ; instruction at the upb_copyit label
- > ^^^^^^^ ; will execute more quickly
- >
- >this should be at least word size, or even better moveq.l could be used.
- >Byte transfer only will trash the value of the counter in 'upb_copyit'.
- >
- > bra.s upb_startit ; Process First byte-tag
- >
- >
- > *********************************
- >
- > upb_copyit
- > and.w d2,d0 ; Clear bit seven in d0
- > ^^^^^
- >
- >This is the point of trouble if only 8 bits are loaded to d2.
- >
- >
- > Jarno
- >--
- >-----------------------------------------------------------------------------
- >| Address: Jarno Rajahalme | EMail: |
- >| Servin Maijan tie 12 H 111 | Jarno.Rajahalme@hut.fi |
- >| 02150 ESPOO, FINLAND | tel: +358 0 468 2891 |
- >-----------------------------------------------------------------------------
- >
- >
-
- If you notice, I at upb_startit
-
- upb_startit
- moveq.l #0,d0 ; Require to clear MSB of d0 for dbf loops
- ; Which is $FF after dbf loops
-
- move.b (a0)+,d0 ; Load byte-tag into d0 and test byte-tag
-
- Therefore d0 always has a byte value only (upper 24 bits are 0).
-
- upb_copyit
- and.w d2,d0 ; Clear bit seven in d0
-
- When the above and is executed, it doesn't matter what is in the highest
- 24 bits of d2 because the highest 24 bits of d0 will be guaranteed to be
- zero. If you really want to avoid confusion, change the and.w to and.b
- although it won't have any effect on the code. The code works perfectly as
- posted and is in several of my games including my most recent FreeWare game
- "znykdist.lha" which is on wuarchive and physik.
-
-