home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20714 < prev    next >
Encoding:
Text File  |  1993-01-05  |  2.4 KB  |  56 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
  3. From: d88-jwa@dront.nada.kth.se (Jon WΣtte)
  4. Subject: Re: Proper way to do Self-Modifying code?
  5. Message-ID: <1993Jan5.202543.14793@kth.se>
  6. Sender: usenet@kth.se (Usenet)
  7. Nntp-Posting-Host: dront.nada.kth.se
  8. Organization: Royal Institute of Technology, Stockholm, Sweden
  9. References: <wfFp_jO00WB707kGgq@andrew.cmu.edu> <1993Jan5.183337.20064@gallant.apple.com>
  10. Date: Tue, 5 Jan 1993 20:25:43 GMT
  11. Lines: 43
  12.  
  13. In <1993Jan5.183337.20064@gallant.apple.com> alexr@apple.com (Alexander M. Rosenberg) writes:
  14.  
  15. >Immediate move instructions are generally faster than using an address
  16. >register. It adds up, especially when lots of small bitmaps may be necessary.
  17.  
  18. Hmm, well, I'm not convinced. Let's say you move a bitmap. Using an
  19. address register, you will only have to change the register. For a
  20. "compiled" bitmap, you would have to change each and every immediate
  21. move instruction. Not to mention that immediate instructions and
  22. longer, and thus takes more bus cycles in fetch; those bus cycles
  23. do also compete with the cycles spent writing to VRAM. (Some slow
  24. NuBus cards take 7 cycles for a longword write, but then fetching
  25. an 8-byte instruction instead of a 4-byte one takes 4 extra cycles
  26. on an LC)
  27.  
  28. It all comes out in amortized performance; if the blitting has to be
  29. raving fast, but you have ample of time to precompute the next
  30. image, compiled bitmaps would be OK (except they flush the cache on
  31. 040s; that's bad speed-wise) but if you have general throughput
  32. problems, register-relative blitting is DEFINATELY the right thing
  33. to do.
  34.  
  35. Just pass rowBytes in d0 and the address of the first pixel in
  36. a0, and make VERY SURE that address is longword aligned or you
  37. will suffer much more from misaligned writes than you will from
  38. the difference in register-based and immediate addressing.
  39.     
  40. >The one shot compile may even be possible to do at compile time, depending on
  41. >the way the screen bitmap is available on the target machine. The problem with
  42.  
  43. Not on the Mac, of course. However, certain other systems have
  44. a measly register set and the screen card (note the singularis)
  45. on a fixed address; I'm sure the timings you cite are for VGA
  46. and not for anything flexible like the mac QD device model.
  47.  
  48. Cheers,
  49.  
  50.                             / h+
  51.  
  52. -- 
  53.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  54.    This signature is kept shorter than 4 lines in the interests of UseNet
  55.    S/N ratio.
  56.