GRASS (programming language): Difference between revisions

Content deleted Content added
Line 30:
Most BASIC [[interpreter (computer software)|interpreters]] of the era converted the input text into a ''[[Lexical analysis|tokenized]]'' version in which each of the commands was replaced by a single number (typically one [[byte]] long). This made the program run faster because it didn't have to continually decode the commands from the strings every time. Zgrass's use of string-based macros made this difficult, so they didn't bother with tokenization. Instead, they included a [[compiler]] which could be used on any particular macro, speeding it up many times. Programs would often consist of a mix of compiled and uncompiled macros.
 
Line numbers were optional in Zgrass, and typically only appeared on lines that were the target of a <code>GOTO</code>. Most BASIC interpreters required line numbers for every line of code, but this was due to their use in the "line editor"&ndash;if you needed to edit ''that''a particular line, the only way to refer to it was by number. Zgrass used a more advanced full-screen editor that eliminated this need. Zgrass allowed any string to act as a "line number", <code>GOTO 10</code> and <code>GOTO MARKER</code> were both valid. Zgrass also included nameless branches, using the <code>SKIP</code> instruction, which would move forward or back a given number of lines.
 
In keeping with its original purpose as a graphics language, Zgrass included numerous commands for simple drawing. Zgrass's coordinate system had one point for each pixel in the high-resolution mode of Nutting's graphics chip, giving a 320&times;202 grid. The Astrocade, by design, could only use that chip's low-resolution mode, a 160&times;101 display. To avoid potential mapping problems, the coordinate space's zero point was placed in the center of the screen. &minus;160 to 160 were valid X locations, and -101 to 101 valid Y locations. For use on the Astrocade you used the positive locations only, whereas on the UV-1 the entire space was available.