Ml command set: Difference between revisions
No edit summary |
No edit summary |
||
| (10 intermediate revisions by the same user not shown) | |||
| Line 21: | Line 21: | ||
| <strong>Get a typed character. </strong> | | <strong>Get a typed character. </strong> | ||
* ASCII value is returned in ML Variable !02 (ASCII Value will be 0 (nu$) if no key was pressed | |||
** All alphabetic characters are converted to uppercase (A through Z) | |||
* Status is returned in ML Variable !01 | |||
* Polls both local keyboard and remote connection for keypress | |||
Example: <strong>.00:P=!01:A$=CHR$(!02) </strong> | Example: <strong>.00:P=!01:A$=CHR$(!02) </strong> | ||
| Line 40: | Line 43: | ||
| <strong>Input a line of text from the user. </strong> | | <strong>Input a line of text from the user. </strong> | ||
Reads from keyboard or remote user. Input ends with CR, CTRL/X, or CTRL/P. | |||
Returns: | |||
• Status in !01 | |||
• Character count in !40 | |||
• Text stored in TX$. | |||
May also use @0 or skip with @8. | |||
Example: <strong> .02:I$=@0 </strong> | Example: <strong> .02:I$=@0 </strong> | ||
|- | |- | ||
| Line 47: | Line 54: | ||
| Equivalent of the "$" command… | | Equivalent of the "$" command… | ||
Expression to be printed must follow the command after a " , " comma. | |||
|- | |- | ||
| .04 | | .04 / .05 | ||
| <strong>Activate protected mode. </strong> | | <strong>Activate / Deactivate protected mode. </strong> | ||
.04 disables the RUN/STOP Key | |||
When in this condition, the program can only be stopped by holding down SHIFT/COMMODORE/CONTROL on the local keyboard. In the event of a system crash, a GOTO9991 which contains the code to reinitialize. | |||
The .05 command disables protected mode. | |||
|- | |- | ||
| .06 | | .06 | ||
| Line 67: | Line 73: | ||
| <strong>Activate terminal mode. </strong> | | <strong>Activate terminal mode. </strong> | ||
Invokes a basic terminal program (Plusterm) on the local system. Term mode will end if the Sysop presses any of the function keys (F1 through F8). The ASCII value of the function key pressed is return in !02. | |||
Plusterm program makes use of the built-in buffer functions (see .23, !27, !28, !29, and !30). Local mode (!12) must not be on, and DTR must be enabled. | |||
|- | |- | ||
| .08 | | .08 | ||
| <strong> | | <strong>Session/Input Poll </strong> | ||
Polls for typed input (non-blocking, local or remote) | |||
See [[Undocumented_8.1_commands#dot8|Undocumented features/commands: .8]] | |||
|- | |- | ||
| .09 | | .09 | ||
| <strong> | | <strong>Single-Key Command Input Poll</strong> | ||
Polls keyboard for a single keypress and returns value to A$ (with high-order bit). | |||
See [[Undocumented_8.1_commands#dot9|Undocumented features/commands: .9]] | |||
|- | |- | ||
| .10 | | .10 / .11 | ||
| <strong>Activate carrier-detect checking interrupt. </strong> | | <strong>Activate / Deactivate carrier-detect checking interrupt. </strong> | ||
.10 activates an interrupt (a program which is executed every 1/60 of a second), which performs the functions necessary to check the status of the modem's carrier detect line. It also handles the Network file transfer timeout, the carrier detect timeout, and the inactivity timeout. Related variables are !13, !22, !00, !11, !24, and !25. | |||
.11 deactivates the interrupt. | |||
|- | |- | ||
| .12 | | .12 | ||
| <strong>Output a sequential file. </strong> | | <strong>Output a sequential file. </strong> | ||
The file number is stored in !14 and the file must already be opened. | The file number is stored in variable !14 and the file must already be opened. | ||
* Set !16 to 1, to prevent user from aborting output; If set to zero, the output can be aborted by pressing the space bar or by typing CTRL/P. | |||
* Set !17 to a non-zero value to activate page-pausing, where the value of !17 is the number of lines. | |||
|- | |- | ||
| .13 | | .13 | ||
| <strong>Dump caller log buffer to disk. </strong> | | <strong>Dump caller log buffer to disk. </strong> | ||
Dumps the temporary caller log buffer to disk file number 98 and clears the buffer. Intended to be used only by the normal BBS caller log routines. | |||
|- | |- | ||
| .14 | | .14 | ||
| <strong>Set level parameters for MCI commands. </strong> | | <strong>Set level parameters for MCI commands. </strong> | ||
Format: .14,<msg level>,<variable level> | |||
* Uses the value of LV (user access level) for the current user's level, which is why LV must be one of the first variables defined. | |||
* <msg level> = level for the message MCI's (£a0, £a1, etc.) | |||
** Add a value of 128 to <msg level> to disable DD$ message MCI (£a6) printing | |||
* <variable level> = level for the variable MCI command (£[) use | |||
|- | |- | ||
| .15 | | .15 / .16 | ||
| <strong>Set the "Chat Begin" text. </strong> | | <strong>Set the "Chat Begin" text. </strong> | ||
Not implemented in versions 8.1 or 8.10a. | |||
|- | |- | ||
| .17 | | .17 | ||
| <strong>Put text into caller log buffer.</strong> | | <strong>Put text into caller log buffer.</strong> | ||
Format: .17,<string> | |||
<string> = Text to be put in the temporary caller log buffer (usually the string is LG$). | |||
Used in conjunction with the variable !20 and the .13 command to handle caller log functions. | |||
Intended to be used only by the normal BBS caller log routines. | |||
|- valign="top" | |||
| .18 / .19 | |||
| <strong>Variable Stack / Killer </strong> | |||
Saves the current BASIC variable memory environment so it can later be restored with the .19 command. | |||
This command operates as a stack. Each time .18 is executed, the entire current variable state is pushed onto an internal stack and a new working environment becomes active. The previous environment remains preserved on the stack while the new environment may be freely modified. The .19 command pops the most recently saved environment off the stack and restores all variable values to that state. | |||
Up to eight stacked environments may exist simultaneously. Attempting a ninth consecutive .18 will generate an error. | |||
{| class="wikitable" | |||
|- | |||
|+ Variable Stack Example | |||
! Stack Level | |||
! Description | |||
! A$ Value | |||
|- | |- | ||
| .18 | | 1 | ||
| | | Initial BBS environment after startup | ||
| "Dog" | |||
|- | |||
| 2 | |||
| .18 executed, A$ modified | |||
| "Cat" | |||
|- | |||
| 3 | |||
| .18 executed again, A$ modified | |||
| "Dead Cat" | |||
|} | |||
Example Behavior: | |||
* At Stack Level 1, variables are in their normal initialized state. | |||
* Executing .18 saves this state and creates Stack Level 2. Variables may now be changed without affecting Level 1. | |||
* Executing .18 again creates Stack Level 3. Stack Level 2 is now preserved on the stack. Variables may now be changed without affecting Levels 1 or 2. | |||
* Executing .19 restores Stack Level 2 (A$ becomes "Cat"). | |||
* Executing .19 again restores Stack Level 1 (A$ becomes "Dog"). | |||
Each .18 pushes a complete variable snapshot. Each .19 restores the most recently saved snapshot. | |||
|- | |- | ||
| .20 | | .20 | ||
| <strong>Set BPS rate for computer to modem communications.</strong> | | <strong>Set BPS rate for computer to modem communications.</strong> | ||
Format: .20,<value> | |||
Values: 0–2 (non-SwiftLink) or 0–7 (SwiftLink) | |||
Maps to 300–38400 baud. | |||
Do not change during active session. | |||
Notes: | |||
• For non-SwiftLink systems, the BPS rate will be set to 2400 if any value above 2 is used. | |||
• For SwiftLink systems, the BPS rate will be set to 38400 if a value above 7 is used. | |||
• Once a BPS rate is set when a user is online, it should not be changed until the user disconnects. | |||
|- | |- | ||
| .21 | | .21 / .22 | ||
| <strong>Activate DTR (Data Terminal Ready).</strong> | | <strong>Activate DTR (Data Terminal Ready).</strong> | ||
DTR is a line to the modem which indicates the readiness of the computer to send and receive data. | DTR is a line to the modem which indicates the readiness of the computer to send and receive data. | ||
.21 = Activate | |||
.22 = Deactivate | |||
|- | |- | ||
| .23 | | .23 | ||
| <strong>Dump buffer contents.</strong> | | <strong>Dump buffer contents.</strong> | ||
This function dumps the contents of the Term mode buffer to file number 3. The Sysop can press the space bar or CTRL/P to abort if output is directed to the screen. | This function dumps the contents of the Term mode buffer to file number 3. The Sysop can press the space bar or CTRL/P to abort if output is directed to the screen. Used by Plusterm. | ||
|- | |- | ||
| .24 | | .24 | ||
| <strong>Wait for end of modem transmit.</strong> | | <strong>Wait for end of modem transmit.</strong> | ||
Ensures output buffer is empty. Used for non-Swiftlink systems. | |||
|- | |- | ||
| .25 | | .25 | ||
| <strong>Cancel modem output. </strong> | | <strong>Cancel modem output. </strong> | ||
Cancel output and clear output buffer immediately. | |||
|- | |- | ||
| .26 | | .26 | ||
| <strong>Clear input buffer.</strong> | | <strong>Clear input buffer.</strong> | ||
Will clear all data holding in the modem input buffer | Will clear all data holding in the modem input buffer. | ||
|- | |- | ||
| .27 | | .27 / .28 | ||
| <strong>Receive a file using current protocol.</strong> | | <strong>Receive / Transmit a file using current protocol.</strong> | ||
Used by the BBS file transfer routines. | Used by the BBS file transfer routines. | ||
|- | |- | ||
| . | | .29 / .30 | ||
| <strong>Transmit a | | <strong>Receive / Transmit a header block (multi punter).</strong> | ||
Used by the BBS file transfer routines. | Used by the BBS file transfer routines. | ||
|- | |- | ||
| . | | .31 (& !55) | ||
| <strong> | | <strong>Message-Aware Disk Input</strong> | ||
Not documented in the original version 8.0 documentation. | |||
See [[Undocumented_8.1_commands#dot31|Undocumented features/commands: .31 and !55]] for more useless information. | |||
|- | |- | ||
| . | | .32 | ||
| <strong> | | <strong>Set DATA Statement Line Number</strong> | ||
Functions similarly to the BASIC RESTORE command, but allows explicit control over the line number from which DATA statements will be read. | |||
If used by itself (.32), the DATA pointer is set to the current line. | |||
If used in the form .32,<number>, where <number> is a BASIC line number, the DATA pointer is set to begin reading DATA statements from that specified line. | |||
Example: <strong>.32,20000 </strong> | Example: <strong>.32,20000</strong> | ||
|- | |- | ||
| .33 | | .33 | ||
| <strong>Activate | | <strong>Activate Extra Variable Memory Mode</strong> | ||
By default, BASIC variable memory begins immediately after the last byte of the "√bbs.init" overlay. This fixed location allows other overlays to be loaded without disturbing variables. | |||
The .33 command relocates the start of BASIC variable memory to immediately after the last byte of the currently loaded overlay. This effectively increases available variable space by the size difference between the current overlay and "√bbs.init". | |||
This command must be used carefully. It should be paired with the variable stack commands (.18 / .19). When .34 is later executed, the variable area is moved back to its original location. If insufficient free space exists at that time, system data or string variables may be overwritten. | |||
See .34 for additional details. | |||
|- | |- | ||
| .34 | | .34 | ||
| <strong>Deactivate | | <strong>Deactivate Extra Variable Memory Mode</strong> | ||
Restores the normal variable memory location established by "√bbs.init", reversing the effect of .33. | |||
A .18 should precede each .33, and a corresponding .19 should precede each .34. This ensures variables are preserved and memory is safely returned to its original configuration. | |||
If .34 is not executed before "√bbs.init" is reloaded, a LOAD OVERFLOW error will occur. | |||
If insufficient free memory exists when .34 is executed, string variables may be overwritten. | |||
|- | |- | ||
| .35 | | .35 | ||
| <strong>Set | | <strong>Set System Rainbow Mode Color List</strong> | ||
Defines the color sequence used by the system’s standard rainbow mode (such as the colors cycled by the F1 and F5 keys). | |||
Format: .35,<string> | |||
<string> must contain exactly eight color control characters. These eight characters determine the rainbow color rotation order. | |||
|- | |- | ||
| .36 | | .36 | ||
| <strong>Unknown</strong> | | <strong>Unknown</strong> | ||
See [[Undocumented_8.1_commands#dot36|Undocumented features/commands: .36]] for more useless information. | |||
|- | |- | ||
| .38 | | .38 | ||
| <strong>Bind / Declare / Register operands (Set up an ML-side descriptor for upcoming operations)</strong> | | <strong>Bind / Declare / Register operands (Set up an ML-side descriptor for upcoming operations)</strong> | ||
Used in conjunction with .39-.40 for performing old-to-new message linking. Slot 0 points to MN, slot 1 points to MR%. ;0K, ;1K, ;0F, are scratch registers used. ;1K = Read flag for message. ;0F = Message number compared. See [[Undocumented_8.1_commands#dot38|Undocumented features/commands: .38]] for more information. | Used in conjunction with .39-.40 for performing old-to-new message linking. | ||
* Slot 0 points to MN, slot 1 points to MR%. | |||
* ;0K, ;1K, ;0F, are scratch registers used. | |||
** ;1K = Read flag for message. | |||
** ;0F = Message number compared. | |||
See [[Undocumented_8.1_commands#dot38|Undocumented features/commands: .38]] for more information. | |||
|- | |- | ||
| .39 | | .39 | ||
| <strong>Run an iterator/scan using the binding</strong> | | <strong>Run an iterator/scan using the binding</strong> | ||
Used in conjunction with .38, .40 and .41 for performing old-to-new message linking. This populates the ";" scratch registers (;0F, ;1K, etc.) that the program loops test. | Used in conjunction with .38, .40 and .41 for performing old-to-new message linking. This populates the ";" scratch registers (;0F, ;1K, etc.) that the program loops test. | ||
See [[Undocumented_8.1_commands#dot38|Undocumented features/commands: .38]] for more information. | See [[Undocumented_8.1_commands#dot38|Undocumented features/commands: .38]] for more information. | ||
|- | |- | ||
| Line 227: | Line 293: | ||
| <strong>Commit/Update step for the scan</strong> | | <strong>Commit/Update step for the scan</strong> | ||
Used in conjunction with .38, .39 and .41 for performing old-to-new message linking. Invoked when a record should be skipped (read already or wrong category), “Advance/commit scan state for K" | Used in conjunction with .38, .39 and .41 for performing old-to-new message linking. Invoked when a record should be skipped (read already or wrong category), “Advance/commit scan state for K" | ||
See [[Undocumented_8.1_commands#dot38|Undocumented features/commands: .38]] for more information. | See [[Undocumented_8.1_commands#dot38|Undocumented features/commands: .38]] for more information. | ||
|- | |- | ||
| Line 232: | Line 299: | ||
| <strong>Finalize/Flush Step</strong> | | <strong>Finalize/Flush Step</strong> | ||
Used in conjunction with .38-.40 for performing old-to-new message linking. Wraps up the relink process. | Used in conjunction with .38-.40 for performing old-to-new message linking. Wraps up the relink process. | ||
See [[Undocumented_8.1_commands#dot38|Undocumented features/commands: .38]] for more information. | See [[Undocumented_8.1_commands#dot38|Undocumented features/commands: .38]] for more information. | ||
|} | |} | ||
Latest revision as of 13:15, 28 February 2026
Programming Features - ML Command Set
The ML commands are a way for BASIC to access the faster and more powerful subroutines built into the Color 64 ML. Some of these commands do complex things and are very useful (such as getting a line of typed input), while others aren't used very often (enabling and disabling interrupts).
All ML commands begin with " . " period character, followed by two digits. Some commands require additional parameters, which follow the command after a " , " comma.
Example: 1000 .01:ifleft$(tx$,1)<>"*"then1000
In this example, the .01 command reads a line of input in from disk, then if the input line did not begin with an asterisk, it would loop back and read another line. This is also an example of how some of the input commands use TX$ as a buffer for input.
The table below provides a summarized listing of all the ML commands:
| CMD | Details | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| .00 | Get a typed character.
Example: .00:P=!01:A$=CHR$(!02) | ||||||||||||
| .01 | Input a line of data from disk.
The file number in !14 used. End of line (EOL) is reached if:
Data is stored in TX$ starting at the first character. The number of characters input is stored in !40. If EOL was reached at the !04 character, such character will not be included in TX$ (e.g. a carriage return will not be part of the input line). If !40 is less than the length of TX$, then the line was terminated with the !04 character or the end of file was reached before another !04 character. You can access the information by using TX$, the @0 function, or you can use the @5 function if you want to assign disk data directly to a variable (and skip the .01 command). Example: .01:SR=ST:A$=@0 | ||||||||||||
| .02 | Input a line of text from the user.
Reads from keyboard or remote user. Input ends with CR, CTRL/X, or CTRL/P. Returns: • Status in !01 • Character count in !40 • Text stored in TX$. May also use @0 or skip with @8. Example: .02:I$=@0 | ||||||||||||
| .03 | Equivalent of the "$" command…
Expression to be printed must follow the command after a " , " comma. | ||||||||||||
| .04 / .05 | Activate / Deactivate protected mode.
.04 disables the RUN/STOP Key When in this condition, the program can only be stopped by holding down SHIFT/COMMODORE/CONTROL on the local keyboard. In the event of a system crash, a GOTO9991 which contains the code to reinitialize. The .05 command disables protected mode. | ||||||||||||
| .06 | Equivalent of the "#" command…
… but the expression to be printed must follow the command after a " , " comma. | ||||||||||||
| .07 | Activate terminal mode.
Invokes a basic terminal program (Plusterm) on the local system. Term mode will end if the Sysop presses any of the function keys (F1 through F8). The ASCII value of the function key pressed is return in !02. Plusterm program makes use of the built-in buffer functions (see .23, !27, !28, !29, and !30). Local mode (!12) must not be on, and DTR must be enabled. | ||||||||||||
| .08 | Session/Input Poll
Polls for typed input (non-blocking, local or remote) See Undocumented features/commands: .8 | ||||||||||||
| .09 | Single-Key Command Input Poll
Polls keyboard for a single keypress and returns value to A$ (with high-order bit). See Undocumented features/commands: .9 | ||||||||||||
| .10 / .11 | Activate / Deactivate carrier-detect checking interrupt.
.10 activates an interrupt (a program which is executed every 1/60 of a second), which performs the functions necessary to check the status of the modem's carrier detect line. It also handles the Network file transfer timeout, the carrier detect timeout, and the inactivity timeout. Related variables are !13, !22, !00, !11, !24, and !25. .11 deactivates the interrupt. | ||||||||||||
| .12 | Output a sequential file.
The file number is stored in variable !14 and the file must already be opened.
| ||||||||||||
| .13 | Dump caller log buffer to disk.
Dumps the temporary caller log buffer to disk file number 98 and clears the buffer. Intended to be used only by the normal BBS caller log routines. | ||||||||||||
| .14 | Set level parameters for MCI commands.
Format: .14,<msg level>,<variable level>
| ||||||||||||
| .15 / .16 | Set the "Chat Begin" text.
Not implemented in versions 8.1 or 8.10a. | ||||||||||||
| .17 | Put text into caller log buffer.
Format: .17,<string> <string> = Text to be put in the temporary caller log buffer (usually the string is LG$). Used in conjunction with the variable !20 and the .13 command to handle caller log functions. Intended to be used only by the normal BBS caller log routines. | ||||||||||||
| .18 / .19 | Variable Stack / Killer
Saves the current BASIC variable memory environment so it can later be restored with the .19 command. This command operates as a stack. Each time .18 is executed, the entire current variable state is pushed onto an internal stack and a new working environment becomes active. The previous environment remains preserved on the stack while the new environment may be freely modified. The .19 command pops the most recently saved environment off the stack and restores all variable values to that state. Up to eight stacked environments may exist simultaneously. Attempting a ninth consecutive .18 will generate an error.
Example Behavior:
Each .18 pushes a complete variable snapshot. Each .19 restores the most recently saved snapshot. | ||||||||||||
| .20 | Set BPS rate for computer to modem communications.
Format: .20,<value> Values: 0–2 (non-SwiftLink) or 0–7 (SwiftLink) Maps to 300–38400 baud. Do not change during active session. Notes: • For non-SwiftLink systems, the BPS rate will be set to 2400 if any value above 2 is used. • For SwiftLink systems, the BPS rate will be set to 38400 if a value above 7 is used. • Once a BPS rate is set when a user is online, it should not be changed until the user disconnects. | ||||||||||||
| .21 / .22 | Activate DTR (Data Terminal Ready).
DTR is a line to the modem which indicates the readiness of the computer to send and receive data. .21 = Activate .22 = Deactivate | ||||||||||||
| .23 | Dump buffer contents.
This function dumps the contents of the Term mode buffer to file number 3. The Sysop can press the space bar or CTRL/P to abort if output is directed to the screen. Used by Plusterm. | ||||||||||||
| .24 | Wait for end of modem transmit.
Ensures output buffer is empty. Used for non-Swiftlink systems. | ||||||||||||
| .25 | Cancel modem output.
Cancel output and clear output buffer immediately. | ||||||||||||
| .26 | Clear input buffer.
Will clear all data holding in the modem input buffer. | ||||||||||||
| .27 / .28 | Receive / Transmit a file using current protocol.
Used by the BBS file transfer routines. | ||||||||||||
| .29 / .30 | Receive / Transmit a header block (multi punter).
Used by the BBS file transfer routines. | ||||||||||||
| .31 (& !55) | Message-Aware Disk Input
Not documented in the original version 8.0 documentation. See Undocumented features/commands: .31 and !55 for more useless information. | ||||||||||||
| .32 | Set DATA Statement Line Number
Functions similarly to the BASIC RESTORE command, but allows explicit control over the line number from which DATA statements will be read. If used by itself (.32), the DATA pointer is set to the current line. If used in the form .32,<number>, where <number> is a BASIC line number, the DATA pointer is set to begin reading DATA statements from that specified line. Example: .32,20000 | ||||||||||||
| .33 | Activate Extra Variable Memory Mode
By default, BASIC variable memory begins immediately after the last byte of the "√bbs.init" overlay. This fixed location allows other overlays to be loaded without disturbing variables. The .33 command relocates the start of BASIC variable memory to immediately after the last byte of the currently loaded overlay. This effectively increases available variable space by the size difference between the current overlay and "√bbs.init". This command must be used carefully. It should be paired with the variable stack commands (.18 / .19). When .34 is later executed, the variable area is moved back to its original location. If insufficient free space exists at that time, system data or string variables may be overwritten. See .34 for additional details. | ||||||||||||
| .34 | Deactivate Extra Variable Memory Mode
Restores the normal variable memory location established by "√bbs.init", reversing the effect of .33. A .18 should precede each .33, and a corresponding .19 should precede each .34. This ensures variables are preserved and memory is safely returned to its original configuration. If .34 is not executed before "√bbs.init" is reloaded, a LOAD OVERFLOW error will occur. If insufficient free memory exists when .34 is executed, string variables may be overwritten. | ||||||||||||
| .35 | Set System Rainbow Mode Color List
Defines the color sequence used by the system’s standard rainbow mode (such as the colors cycled by the F1 and F5 keys). Format: .35,<string> <string> must contain exactly eight color control characters. These eight characters determine the rainbow color rotation order. | ||||||||||||
| .36 | Unknown
See Undocumented features/commands: .36 for more useless information. | ||||||||||||
| .38 | Bind / Declare / Register operands (Set up an ML-side descriptor for upcoming operations)
Used in conjunction with .39-.40 for performing old-to-new message linking.
See Undocumented features/commands: .38 for more information. | ||||||||||||
| .39 | Run an iterator/scan using the binding
Used in conjunction with .38, .40 and .41 for performing old-to-new message linking. This populates the ";" scratch registers (;0F, ;1K, etc.) that the program loops test. See Undocumented features/commands: .38 for more information. | ||||||||||||
| .40 | Commit/Update step for the scan
Used in conjunction with .38, .39 and .41 for performing old-to-new message linking. Invoked when a record should be skipped (read already or wrong category), “Advance/commit scan state for K" See Undocumented features/commands: .38 for more information. | ||||||||||||
| .41 | Finalize/Flush Step
Used in conjunction with .38-.40 for performing old-to-new message linking. Wraps up the relink process. See Undocumented features/commands: .38 for more information. |
Next Section: ML Variables