home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.sys.amiga.demos
- 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
- From: erlebach@Informatik.TU-Muenchen.DE (Thomas Erlebach)
- Subject: Re: Writing a StarField. Which method is best?
- References: <1992Nov7.104910.60476@cc.usu.edu> <1992Nov11.131803.1276@ifi.uio.no> <1948@lysator.liu.se>
- Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
- Organization: Technische Universitaet Muenchen, Germany
- Date: Fri, 13 Nov 1992 09:22:57 GMT
- Message-ID: <erlebach.721646577@unknown>
- Lines: 38
-
- marvil@lysator.liu.se (Martin Vilcans) writes:
-
- >larshaug@ifi.uio.no (Lars Haugseth) writes:
-
-
- >> move.l a7,SAVEA7
- >> lea $1000.w,a7
-
- >Hey, DON'T DO THAT! You will probably destroy some OS structures or buffers.
- >If you really want to create your own stack for some reason, do it like this:
-
- > move.l a7,savea7
- > lea stacke,a7
- > .
- > .
- > .
- > section stack,data
- >stack:
- > ds.b stacksize ;A few hundred bytes is more than enough for
- > ;assembler programs
- >stacke:
-
- Martin, if you don't understand other programmers' code, then you
- should not critisize it. Lars doesn't want to create his own stack,
- he just uses a7 to store the value $1000 for a while, because then
- he can use
- sub.w a7,d0
- and
- sub.w a7,d1
- instead of
- subi.w #$1000,d0
- and
- subi.w #$1000,d1
- which of course makes Lars's code faster.
- Before he uses the stack again, he restores the original stack pointer.
- This programming technique is perfectly allright.
-
- E.T.
-