Re: Aw: Re: [stella] OT: Programming, CS theory

Subject: Re: Aw: Re: [stella] OT: Programming, CS theory
From: Erik Mooney <erik@xxxxxxxxxx>
Date: Fri, 26 Oct 2001 14:57:07 -0400
10/26/2001 1:40:20 PM, "Glenn Saunders" <cybpunks@xxxxxxxxxxx> 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.

Naturally.  There's why assembler programs require very liberal doses of
comments.  Look at my INV source, which delineates those reasonably well.

>It's also a little hard to think of a subroutine as not having to have a 
>singular startpoint.  You can seek into and JSR into any line of a 
>subroutine you want.  You can't do that in any other language I know of.

GW-BASIC (and Apple ][, C-64, TI-99, etc BASIC.)  More fundamentally, any
line-number-based language will allow that, and assembler is inherently so
because every instruction has an address.

>(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.

Yup, and there is no one best way; it varies greatly depending on the
routine and situation.  Which only practical programming experience can
tell you.  All three are sometimes best for use in 2600 programming, and the
only way to make it clear in the assembly source is to comment it.



-
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread