home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / alt / sys / amiga / demos / 1595 < prev    next >
Encoding:
Text File  |  1992-11-13  |  1.5 KB  |  50 lines

  1. Newsgroups: alt.sys.amiga.demos
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!informatik.tu-muenchen.de!unknown!erlebach
  3. From: erlebach@Informatik.TU-Muenchen.DE (Thomas Erlebach)
  4. Subject: Re: Writing a StarField. Which method is best?
  5. References: <1992Nov7.104910.60476@cc.usu.edu> <1992Nov11.131803.1276@ifi.uio.no> <1948@lysator.liu.se>
  6. Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
  7. Organization: Technische Universitaet Muenchen, Germany
  8. Date: Fri, 13 Nov 1992 09:22:57 GMT
  9. Message-ID: <erlebach.721646577@unknown>
  10. Lines: 38
  11.  
  12. marvil@lysator.liu.se (Martin Vilcans) writes:
  13.  
  14. >larshaug@ifi.uio.no (Lars Haugseth) writes:
  15.  
  16.  
  17. >>    move.l    a7,SAVEA7
  18. >>    lea    $1000.w,a7
  19.  
  20. >Hey, DON'T DO THAT! You will probably destroy some OS structures or buffers.
  21. >If you really want to create your own stack for some reason, do it like this:
  22.  
  23. >    move.l a7,savea7
  24. >    lea    stacke,a7
  25. >    .
  26. >    .
  27. >    .
  28. >    section stack,data
  29. >stack:
  30. >    ds.b    stacksize    ;A few hundred bytes is more than enough for
  31. >                ;assembler programs
  32. >stacke:
  33.  
  34. Martin, if you don't understand other programmers' code, then you
  35. should not critisize it. Lars doesn't want to create his own stack,
  36. he just uses a7 to store the value $1000 for a while, because then
  37. he can use
  38.           sub.w a7,d0
  39.     and
  40.           sub.w a7,d1
  41. instead of
  42.           subi.w #$1000,d0
  43.     and
  44.           subi.w #$1000,d1
  45. which of course makes Lars's code faster.
  46. Before he uses the stack again, he restores the original stack pointer.
  47. This programming technique is perfectly allright.
  48.  
  49.             E.T.
  50.