Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Locomotive BASIC
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Text handling == Text moves through the system using a concept of "streams" numbered 0β9, appropriate commands use the hash <code>#</code> symbol to pre-fix the stream number. Streams 0-7 are text windows. The TEXT_VDU firmware pack allows for the creation of multiple text windows each with their own cursor, dimensions, content, colours etc. An individual window is addressed using its stream number, e.g. <code>PRINT#3,"Hello World!"</code>. Omitting the stream number defaults to stream 0 - <code>PRINT"Hello World!"</code> being equivalent to <code>PRINT#0,"Hello World!"</code>. Text windows are simple screen areas and can overlap but there is no built in provision to preserve the contents of windows "under" others, thus careful attention is required to avoid corruption. Later, machine code routines became available to intercept the firmware calls (by [[Patch (computing)|patching]] the jump block) and preserve the content of a window just before another was drawn over it, restoring it when the new window closed. This gave the much more useful "Windows" look to which we have grown accustomed - being mindful of the times; "pop-ups" were a novel concept in 1984. When using the text windows, screen scrolling relies on software (as only part of the screen content is moved) rather than using the hardware to scroll the entire screen by adjusting the screen-base address in the CRT controller. Two SCREEN_PACK firmware calls are provided for the two forms; $BC4D SCR_HW_ROLL (scrolls the entire screen up or down by eight pixel rows i.e. one character line) - being hardware reliant, the scroll is very fast. $BC50 SCR_SW_ROLL (Scrolls part of the screen up or down by eight pixel lines). The latter can result in a pronounced on-screen "ripple" when scrolling large areas. Stream 8 is the centronics parallel port. To send a line of text to the printer one could use the command <code>PRINT#8,"Hello World!"</code>. Creating a printed listing was simply a matter of LISTing the program to stream 8, e.g. <code>LIST#8</code>. This flexible method dispenses with the legacy BASIC commands <code>LPRINT</code> and <code>LLIST</code>. When later, serial interfaces became available and opened up access to a greater range of printers and other devices, #8 could be diverted by patching $BD2B MC_PRINT_CHAR in the MACHINE_PACK jumpblock. Stream 9 is the currently open file (either cassette or disc, input or output) and relevant commands are context sensitive; e.g. it is possible to have both input and output files open simultaneously with <code>PRINT#9</code> and <code>INPUT#9</code> routing text accordingly.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)