Subject: Re: Aw: Re: [stella] OT: Programming, CS theory From: Thomas Jentzsch <tjentzsch@xxxxxx> Date: Fri, 26 Oct 2001 20:58:44 +0100 |
Glenn Saunders wrote: > If we're talking about syntax, what I dislike the most about assembly syntax > vs. high level languages is how hard it is to visualize the differences > between a plain old label and a subroutine. > There is no "Function DrawScreen()" sort of syntax. A label is a label is a > label. > So if you have a big subroutine it's hard to differentiate the natural > startpoint from internal labels used by loops and branching stuff. There is a solution, use SUBROUTINE! (DASM rocks!) Now you can give all local labels a name starting with ".". Only the subroutine labels and the extra startpoints get a normal name without the point. Now the code is much easier to read, look at my Pitfall! disassembly to see what I mean. > (An example of where this is used is in Manuel's horizontal positioning > subroutine. It seeks to a different startpoint for P0 vs. P1.) > Plus it's hard to think about function parameters either, since there are no > rules for how to pass parameters to assembly subroutines. You can use the > stack, use the registers, or use general RAM. The best way, is to comment your code. Give every subroutine a comment header where you describe the input and output parameters (registers, variables and flags), and the functionality of course. Have fun! Thomas _______________________________________________________ Thomas Jentzsch | *** Every bit is sacred ! *** tjentzsch at web dot de | - Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Aw: Re: [stella] OT: Programmin, Chris Wilkson | Thread | Re: Aw: Re: [stella] OT: Programmin, Erik Mooney |
Re: Aw: Re: [stella] OT: Programmin, Chris Wilkson | Date | [stella] network emulator?, Maxime Beauvais |
Month |