Undocumented 8.1 commands
At the time of this revision for Color 64 v8.1a, there are notably several ML related commands and variables that are not documented from the original 8.0 manuscript, as well as some basic shortcuts and appear to have been introduced from the 8.1 upgrade. A lot of reverse engineering was done by comparing 8.1 code to the predecessor versions.
Below are some of my notes and observations of what the code was in 8.0 or 7.37, and the observed shortcuts implemented in 8.1.
Please note it is a work-in-progress and this part of the wiki gets updated frequently! Some of my observations may still be without conclusion as they are under active investigation! That said, getting to understand some of the modified BASIC can be easy. If you have the ML loaded into your system (loading and running +SHELL), you can write your own program to test out the modified BASIC by having your first line call the ML routine: SYS49923
10 SYS49923 20 #"Test of program" 30 etc....
Topics:
- General Programming (below)
- ML Commands
- ML Variables
- ML Functions
General Programming
| Topic | Notes |
|---|---|
| Simple Addition | All overlays
Color 64 allows simple addition without using < var >=< same var >+< value > So |
| Topic | Notes | ||||
|---|---|---|---|---|---|
| "THEN" with IF | All Main Overlays
Conclusion: “then” statements are not required for “if/then” – if <condition> <action> is legal in most cases. |
| Topic | Notes | ||||||
|---|---|---|---|---|---|---|---|
| if...£ | √bbs.msgs
Observation: Observe the 8.1 authors reversed the checks in variable comparisons as the conditions, with end-result being the same. Conclusion: Serves as an “not” function “(lv is not less than cm%(2,2) and lv not less than cm%(29,2) and fr does not equal 1, then print (P)rivate)” Another example:
|
| Topic | Notes | ||||||
|---|---|---|---|---|---|---|---|
| @ | √bbs.msgs
Conclusion: Seems to serve as an “if” keyword - but testing this theory in a traditional sense resulted in a syntax error. |
| Topic | Notes | ||||||
|---|---|---|---|---|---|---|---|
| [var$] | √bbs.msgs
Conclusion: Can serve as an empty variable check (null) |
ML Commands
| Topic | Notes | ||||
|---|---|---|---|---|---|
| .8 | All Main Overlays
.8 - Session/Input Poll) Previously documented in 8.0 documentation as "Equivalent of the "%" command…", this appears to be rewritten in version 8.1 - and is particularly noticeable in bbs.msgs where comparing the two show that
Polls for typed input (non-blocking, local or remote), normalizes transient input-status states, and refreshes session status. Typically used inside scrolling output/file display loops and before slow operations. Side effects include updating P (0 OK, 1 user abort, 255 carrier lost/timeout) and possibly the same underlying status/character registers used by .00. While further testing is required, theoretically this should fully replace use of |
| Topic | Notes | ||||||
|---|---|---|---|---|---|---|---|
| .9 | All Main Overlays
Previously documented in 8.0 documentation as a "do not use" command that replaces "&" function, this appears to be repurposed for single key command input replacing the traditional "gosub110" routine. .9 – Single-Key Command Input Poll Overview The Previous iterations of Color 64 used When a key is pressed:
When no key is pressed:
Examples (bbs.msgs):
So .9 is essentially the modern ML command that replaced the old sysc(4) “get typed character” behavior, with a nice extra: it can be told “only accept these characters”. |
| Topic | Notes | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| .31 and !55 | √bbs.msgs
Conclusion: .31 – Message-Aware Disk Input (Version 8.1) Earlier documentation listed the ML command .31 as "not used." Analysis of Version 8.1 confirms this is incorrect. In Color 64 v8.1, the Comparison: Version 8.0 vs Version 8.1
|
| Topic | Notes | ||||||
|---|---|---|---|---|---|---|---|
| .36 | √bbs.init
.36 – Prompt-Cycle Housekeeping (Behavior Unconfirmed) Category: ML Command Seen in: All Main Overlays (prompt printing routine) Overview The In testing within the live BBS environment, removing Observed Call Pattern
Testing Notes
Working Hypothesis
Summary
|
| Topic | Notes | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| .38 / .39 / .40 / .41 and “;” variables | √bbs.msgs
Message Relink Commands in v8.1
.38 – Relink Iterator Initialization (v8.1) The It is designed to be used as the first step in a command sequence:
This sequence replaces the more BASIC-driven record scanning logic found in v8.0. What .38 Does
In BBS.MSGS, this binding typically associates:
The ML iterator then uses internal scratch registers such as:
These are later examined by BASIC to determine loop control and branching. In v8.0, message scanning and linking logic was performed directly in BASIC, including character comparisons and explicit loop control. In v8.1, this logic was moved into machine language for speed and structural cleanliness. BASIC now acts primarily as a decision layer while ML handles the iteration mechanics. Important Notes
Summary The It should be understood as a setup command rather than an action command. |
ML Variables
| Topic | Notes |
|---|---|
| !8 | Wrap/Width Threshold
The Example: In the example above, if a line is shorter than !8, they force an explicit newline behavior; if it’s longer, they let natural wrapping do the work. |
| Topic | Notes |
|---|---|
| !46 | Scratch Register
The In those routines, !46 holds a temporary value (lines 710 save a disk channel number while the lines at 8000 use it to store a variable value temporarily) |
| Topic | Notes |
|---|---|
| !55 | !55 – Message Record Delimiter Flag
Refer to .31 command above. |
| Topic | Notes |
|---|---|
| !56 | !56 - Message Editor Command State (True/False) (Editor)
Used in conjunction with !57 and !60, when true this monitors for !57 to invoke a command state. See !57 and !60 for more information. |
| Topic | Notes |
|---|---|
| !57 | !57 - Prefix Trigger Assignment (Editor)
This works in concert with !56 and !60 for the message editor commands. In the unmodified code of 8.1, the prefix trigger assignment is 47 (equates to "/") that makes that our command while in the message editor to trigger a command when !56 is true. The command value is stored in !60. See !56 and !60 for more information. |
| Topic | Notes |
|---|---|
| !58 | !58 - ?? (Editor)
Present in editor functions - specifically during text entry (after hitting RETURN on a line), but overall function / use of this ML variable is unknown. Only resides in bbs.msgs at a subroutine starting at line 310. |
| Topic | Notes |
|---|---|
| !59 | !59 - Text-entry mode flag (Editor)
Present in editor functions - this is set as high by ML routines while in text entry to bypass any code dealing with command menu. |
| Topic | Notes | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| !60 | !60 - Menu Selection Holder (Editor)
Overview In Color 64 v8.1, !60 acts as a state variable for the message editor command interface. It is used to control (and dispatch) the editor's slash-command / CMD> menu behavior, and it appears to be treated as a small integer "mode / selection" value. This logic does not exist in the v8.0 editor flow, indicating it was introduced or substantially expanded in v8.1. Observed behavior in bbs.msgs (v8.1) The editor command prompt section sets up a list of command keywords, reads user input, and then stores the selected command number into !60. Later code uses ON !60 GOTO to jump to the appropriate command handler. Key excerpt (v8.1, around 2930–2939): 2931 !60,.:II$="divider,rap,elete,dit,end,merge":&"...CMD> ..." 2932 [.9,I$: ... :IF!60THEN&@3(DE$,LG) 2933 ... ]2935:\!60,II: ... (stores selection into !60) 2936 IFII<11 !60,.:!56,-(II=9):!57,47 2937 I$="":II$="":RETURN Important notes:
Dispatcher usage v8.1 uses !60 as the selector in a computed jump: 1302 ON!60 GOTO 1314,1305,1306,1365,1310,1312:!60,1:@ This strongly indicates:
Based on the command list order (from line 2931), the implied mapping is:
Slash-command prefix interaction ("/") !60 is also used as a boolean-style flag to enable slash-style command entry behavior. One observed usage: 311 II=GO(!60,47,.) Where:
This supports the interpretation that !60 is not merely a one-shot selection, but the editor command mode state that can be:
Additional references in the editor flow Line 1300 demonstrates !60 being initialized prior to the editor loop and used with other state variables: 1300 !7,FM:A=I:!60,1:[GOSUB311:IFP]... Line 2885/2888 show the same "set !60, then dispatch, then reset" pattern: 2885 ... :!60,1:[GOSUB311:IFP]... 2888 ON!60 GOTO 2890,1305,2889,2895:!60,1:@ Working conclusion In Color 64 v8.1, !60 is a message editor command state / selector variable:
Open questions
This is also used in conjunction with !56 and !57. |
ML Functions
| Topic | Notes | ||||
|---|---|---|---|---|---|
| @31 | @31 – Sequential Read (Enhanced)
Overview: @31 is a machine language function introduced in later Color 64 versions that replaces the older @5 + !40 sequential line-read pattern of version 8.0. It retrieves the next logical record from an open sequential file and updates ST as a side effect. Higher-Level Replacement for @5
It is used prominently in merge message routines within BBS.MSGS. Behavior:
2330 T=@9:[I$=@31:II=ST:GOSUB2400 2335 T=T-LEN(I$):A$(A)=I$:A+:@[II] AND A<ML+4 AND T>=CM%(7,.):GOTO505
1) Sequential File Read
2) Status-Driven Looping
Frequently paired with the enhanced FRE function In comparison:
Notes:
Conclusion: @31 is an enhanced sequential-record read function used primarily in message handling and merge routines. It streamlines record retrieval, updates ST for loop control, and is typically combined with @9-based memory budgeting safeguards. |
| Topic | Notes | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @32 | @32(2,2) – Return Block Count
The @32 ML function is used with an open directory listing (the "$" directory stream) to read and parse a directory entry. It returns a numeric value and advances the internal "current directory entry" pointer so subsequent calls read the next entry. In Color 64 v8.1, @32 is commonly used as a fast replacement for the older BASIC parsing method where a program would GET# fields from a "$" listing and use @6(low$,high$) to build a 16-bit value. In practice, @32 is used to obtain the directory entry's block count (file size in blocks) as an integer. Syntax: Return Value: Returns the current/next directory entry's block count (file size in blocks) as an integer. Status / End-of-List Behavior: @32 works as an iterator over directory entries. When there are no more matching entries (end of directory stream), BASIC's ST is set. Code typically tests ST immediately after calling @32. Typical pattern: A = @32(2,2) IF ST THEN ... :rem end of directory (or no match) Common Usage Patterns 1) Check if a file exists (or get its size) - Open a filtered directory listing and attempt to read the first match. - If ST is set after the call, the file was not found. OPEN 8,DV,8,"$"+DR$+F$+"*" GOSUB 770 :rem read/skip directory header (implementation-specific) A = @32(2,2) IF ST THEN ER=62:A$="NOT IN DIRECTORY: "+F$:GOTO <error handler> 2) Display a directory-style listing (blocks + filename) - Call @32 repeatedly until ST is set. - The returned value is typically printed as the "blocks" column. - The filename is commonly retrieved via @5 after each call (since @32 updates the current entry). B=-3 B=B+1 C=@32(2,2) IF ST THEN PRINT B;" FILES SELECTED":RETURN PRINT C;TAB(6);@5 3) Maintenance checks based on file size (example: caller log trimming) - Compare @32's returned block count against a configured maximum. - Also used in free-space safety checks to avoid dropping below MU (minimum blocks required for uploads). F$="✓CALLER LOG":GOSUB 710 P=A-CM%(8,.) P=-P*(P>.) :rem P is positive only when the file exceeds the configured limit Notes
8.0 Comparison
|
| Topic | Notes |
|---|---|
| @33 | @33 - Return Chr$(0) Null
The @33 is used exclusively in the editor portion of message composure and appears a function of when the user is utilizing the "/" command within the editor where @33 is part of the removal of the prompt from the editing screen. It returns a string length of 1 with a chr$(0). There is no comparative code from earlier versions of Color 64. |






























