will load AND start the program at line 10 or at the specified label10 which will then print Hello on your screen. As a matter of fact you can use even non-existing line numbers when saving. LOAD will go to the first available line after the one you entered if that doesn't exist in your program and attempt to run from there. If the line number you entered is higher than the last line number in your program, LOAD will just not execute the program, just simply loading it as if the LINE modifier was never specified. SAVE filespec LINE number will NOT accept a number greater than 65535 however and it will return a B Integer out of range, 0:1 error if such a value is supplied for number or 0:1 No Label error if the label doesn't exist.
It is noteworthy, that a particular type is not forced upon the file when using SAVE, so a NextBASIC file for example will not automatically carry the type .bas. That being said, as we saw earlier a standard set of types is known to the NextZXOS browser. These, help it automatically launch files using the appropriate commands. It is therefore a good idea to either adopt these, or modify the ones known to NextZXOS to be the ones you prefer. Remember however that every time you update System/Next™, the known associations to file types are being overwritten with the default ones, so always keep a backup of the browser.cfg file located in c:/nextzxos/ if you indeed make these changes.
As we saw earlier, storing screens requires the use of either the SCREEN$ (for Layer 0) or the LAYER (for all other layers) modifier directives. From our examples, you may have already assumed that the LAYER modifier this can also be substituted by the BANK or CODE modifiers. While this is true for Layers 0 and 1, there's no functional way this can be done for Layer 2 with CODE or BANK as the latter occupies more than one banks and CODE only works within the main memory map.
The most compatible way to save screens is therefore the use of the LAYER modifier directive as follows:
LAYER desired_layer
<statements generating graphical content>
SAVE filename.ext LAYER
Remember, that you must already be in the layer that you intend to save before initiating a SAVE...LAYER command. Also, as you can find from looking at browser.cfg, NextZXOS already recognises some types as belonging to a specific layer screen file. The table below lists them in order:
| Type/Extension | Layer |
|---|---|
| .SCR | ULA (Layer 0) |
| .SLR | LoRes (Layer 1,0) |
| .SHR | HiRes (Layer 1,1) |
| .SHC | HiColour (Layer 1,2) |
| .SL2 | Layer 2 |
Table 14 – Automatically recognisable screen file types
By this time and given the time we spent discussing the CODE modifier, you've probably figured out that it's not reserved for machine code programs and instead will save or load the raw data that's located in the memory address you specify whether this is graphics, machine code, a NextBASIC program, variables, NextZXOS system variables or just random numbers or even nothing (0s).
Unlike its LOAD equivalent, SAVE ... CODE requires both parameters, that is a legal address and valid length. It takes the form:
SAVE filespec CODE start_address, length
10 Labels can be anywhere in a line however SAVE filespec LINE @label will place the autostart pointer to the beginning of the line where the label is located and not at the location of the label.
ZX Spectrum Next User Manual, 3rd Edition (ISBN 978-1-5272-5496-1), written and illustrated by Phoebus R. Dokos. Copyright © 2020-2024 Phoebus Dokos / SpecNext Ltd. Licensed under CC BY-NC-SA 4.0. This is a transcription and can contain errors; check any doubt against the printed page.