- TECHNICAL INFORMATION -
21.0 TECHNICAL INFORMATION
The information in this section is provided for any user interested in
making modifications to the C-NET program, or just to better understand how
it all operates.
21.1 PROGRAMMING TIPS
Here are some tips for ‘safe’ C-NET modification and application
programming:
1) Before you begin, define your variables on paper, their purpose, and
check with the BASIC variables chapter to insure the safety of their use.
2) Memory is not an infinite resource, especially on the 128. As a
general rule, the size (in blocks) of the CN file added to the size of
your largest program file, plus 84 should not exceed 245. Unexplained
‘hangs’ will occur if this rule is not adhered to!
3) Attempt to avoid infinite loops. Specifically, this means you should
somehow account for the chance that the user will simply ‘hang up’
during a GOSUB2100 (input) or GOSUB2200 (get one character), C-NET
immediately returns control to BASIC, with an effective input of null (“
“), or chr$ (1 (RETURN)) for GOSUB2200. If your routine loops around
waiting for the user to enter either ‘Y’ or ‘N’, for example, the
program will loop without escape. If you must have an input (RETURN
isn’t enough) for a default of something, giving AUTOMATIC fall-through
for user-hang-ups, you must then insert a check for a carrier. This is
done as follows:
10 GOSUB2100: IF TR%=0 THEN 30
20 IF AN$ <> “Y” AND AN$ <> “N” THEN PRINT “TRY AGAIN”:GOTO 10
30 ........
Actually, if you FORGET this protection, C-NET will automatically break out
of the infinite loop after seven iterations. This, however, results in a
“can’t continue” error to be logged by C-NET. The error line number will
ALWAYS be 2102 or 2202. Therefore, from the log alone, it is not possible
to determine exactly where the infinite loop occurs in the program.
21.2 MEMORY MAP
This is how memory is utilized in the Commodore 128 version of C-NET:
RAM BANK 0
$0000 - $03FF C-128 usage
$0400 - $04EF C-NET ‘m4.0’ file
$04F0 - $05E9 C-NET Editor Paragraph Markers
$05EA - $05EE UNUSED?
$05EF - $06E9 C-NET Editor Direct-Color Entry Codes
$06EA - $06EE UNUSED?
$06EF - $07FF C-NET usage
$0800 - $09FF BASIC usage
$0A00 - $0AFF C-128 usage, however, in practice it has been observed
that $0A60 - $0AFF may never be changed during normal C-
NET operation. Free for modification use?
$0B00 - $0B3F C-NET variables usage, maybe some free location scattered