Title : MLX II - Version 1.1
System: Commodore 64
Author: Ottis R. Cowper 
Publication: COMPUTE! and COMPUTE!’s Gazette, from December 1995 onward. These particular scans were taken from the October, 1989 issue.
Page Scans: 69-72
Preserved By: Bryon Thur [eboy71]
Recommended Emulator: VICE [https://vice-emu.sourceforge.io/]


Loading the application:
* Mount the disk image (Compute MLX II v-11.d64) in your emulator. In VICE, this is done by selecting File → Attach Disk Image
* Load the app by typing LOAD”MLX II V1.1”,8
* Once loaded, type RUN to start


Details:
* MLX II is a utility for entering machine language programs published in COMPUTE! and COMPUTE!’s Gazette
* It is the second major version of the program.
   * The first version of MLX was published in December, 1983 and supported a decimal-based entry system
   * MLX II was first published in December, 1985, which supported a much more efficient hexadecimal entry system and an improved checksum.
   * A REM statement at the beginning of the program indicates that this is version 1.1, with the following changes:
      * 10 REM VERSION 1.1: LINES 830, 950 MODIFIED, LINES 485-487 ADDED 
   * Lines 485-487 added support for optional keypad functionality. These were introduced in March, 1986
* For instructions about its use, consult the article text below.
* Note that the code listing for the program includes checksums, which are for use with COMPUTE!’s “Automatic Proofreader” utility.


Article Text:
“MLX” is a labor-saving utility that allows almost fail-safe entry of machine language programs. Included are versions for the Commodore 64 and 128. [ed. only the Commodore 64 version is included in the scans]


Type in and save some copies of whichever version of MLX is appropriate for your computer (you'll want to use it to enter future ML programs from COMPUTE!'s GAZETTE). Program 1 is for the Commodore 64, and Program 2 is for the 128 (128 MLX can also be used to enter Commodore 64 ML programs for use in 64 mode). When you're ready to enter an ML program, load and run MLX, It asks you for a starting address and an ending address, These addresses appear in the article accompanying the MLX-format program listing you’re typing.


If you're unfamiliar with machine language, the addresses (and all other values you enter in MLX) may appear strange. Instead of the usual decimal numbers you're accustomed to, these numbers are in hexadecimal—a base 16 numbering system commonly used by ML programmers. Hexadecimal—hex for short—includes the numerals 0-9 and the letters A-F. But don’t worry— even if you know nothing about ML or hex, you should have no trouble using MLX.


After you enter the starting and ending addresses, you'll be offered the option of clearing the workspace. Choose this option if you're starting to enter a new listing. If you're continuing a listing that's partially typed from a previous session, don’t choose this option.


A functions menu will appear. The first option in the menu is ENTER DATA, If you're just starting to type in a program, pick this. Press the E key, and type the first number in the first line of the program listing. If you've already typed in part of a program, type the line number where you left off typing at the end of the previous session (be sure to load the partially completed program before you resume entry). In any case, make sure the address you enter corresponds to the address of a line in the listing you are entering. Otherwise, you'll be unable to enter the data correctly. If you pressed E by mistake, you can return to the command menu by pressing RETURN alone when asked for the address. (You can get back to the menu from most options by pressing RETURN with no other input.)


Entering A Listing


Once you're in Enter mode, MLX prints the address for each program line for you. You then type in all nine numbers on that line, beginning with the first two-digit number after the colon (:). Each line represents eight data bytes and a checksum. Although an MLX format listing appears similar to the “hex dump” listings from a machine language monitor program, the extra checksum number on the end allows MLX to check your typing. (Commodore 128 users can enter the data from an MLX listing using the built-in monitor if the rightmost column of data is omitted, but we recommend against it. It's much easier to let MLX do the proofreading and error checking for you.) When you enter a line, MLX recalculates the checksum from the eight bytes and the address and compares this value to the number from the ninth column, If the values match, you'll hear a bell tone, the data will be added to the workspace area, and the prompt for the next line of data will appear. But if MLX detects a typing error, you'll hear a low buzz and see an error message. The line will then be redisplayed for editing.


Invalid Characters Banned


Only a few keys are active while you're entering data, so you may have to unlearn some habits. You do not type spaces between the columns; MLX automatically inserts these for you, You do not press RETURN after typing the last number in a line; MLX automatically enters and checks the line after you type the last digit.


Only the numerals 0-9 and the letters A-F can be typed in. If you press any other key (with some exceptions noted below), you'll hear a warning buzz. To simplify typing, 128 MLX redefines the function keys and + and — keys on the numeric keypad so that you can enter data one-handed. (The 64 version incorporates the keypad modification from the March 1986 “BugSwatter” column, lines 485-487.) In either case, the keypad is active only while entering data. Addresses must be entered with the normal letter and number keys. The figures above show the keypad configurations for each version.


MLX checks for transposed characters. If you're supposed to type in AO and instead enter 0A, MLX will catch your mistake. There is one error that can slip past MLX: Because of the checksum formula used, MLX won't notice if you accidentally type FF in place of 00, and vice versa, And there’s a very slim chance that you could garble a line and still end up with a combination of characters that adds up to the proper checksum, However, these mistakes should not occur if you take reasonable care while entering data.


To correct typing mistakes before finishing a line, use the INST/DEL key to delete the character to the left of the cursor. (The cursor-left key also deletes.) If you mess up a line really badly, press CLR/HOME to start the line over. The RETURN key is also active, but only before any data is typed on a line. Pressing RETURN at this point returns you to the command menu. After you type a character of data, MLX disables RETURN until the cursor returns to the start of a line. Remember, you can press CLR/HOME to quickly get to a line number prompt.


More editing features are available when correcting lines in which MLX has detected an error, To make corrections in a line that MLX has redisplayed for editing, compare the line on the screen with the one printed in the listing, then move the cursor to the mistake and type the correct key, The cursor left and right keys provide the normal cursor controls. (The INST/ DEL key now works as an alternative cursor-left key.) You cannot move left beyond the first character in the line. If you try to move beyond the rightmost character, you'll reenter the line. During editing, RETURN is active; pressing it tells MLX to recheck the line. You can press the CLR/HOME key to clear the entire line if you want to start from scratch, or if you want to get to a line number prompt to use RETURN to get back to the menu.


Display Data


The second menu choice, DISPLAY DATA, examines memory and shows the contents in the same format as the program listing (including the checksum). When you press D, MLX asks you for a starting address. Be sure that the starting address you give corresponds to a line number in the listing. Otherwise, the checksum display will be meaningless. MLX displays program lines until it reaches the end of the program, at which point the menu is redisplayed. You can pause the display by pressing the space bar. (MLX finishes printing the current line before halting.) Press space again to restart the display. To break out of the display and get back to the menu before the ending address is reached, press RETURN.


Other Menu Options


Two more menu selections let you save programs and load them back into the computer. These are SAVE FILE and LOAD FILE; their operation is quite straightforward. When you press S or L, MLX asks you for the filename. You'll then be asked to press either D or T to select disk or tape.


You'll notice the disk drive starting and stopping several times during a load or save (save only for the 128 version). Don’t panic; this is normal behavior. MLX opens and reads from or writes to the file instead of using the usual LOAD and SAVE commands (128 MLX makes use of BLOAD). Disk users should also note that the drive prefix 0: is automatically added to the filename (line 750 in 64 MLX), so this should not be included when entering the name. This also precludes the use of @ for Save-with-Replace, so remember to give each version you save a different name. The 128 version makes up for this by giving you the option of scratching the existing file if you want to reuse a filename.


Remember that MLX saves the entire workspace area from the starting address to the ending address, so the save or load may take longer than you might expect if you've entered only a small amount of data from a long listing. When saving a partially completed listing, make sure to note the address where you stopped typing so you'll know where to resume entry when you reload.


MLX reports the standard disk or tape error messages if any problems are detected during the save or load. (Tape users should bear in mind that Commodore computers are never able to detect errors during a save to tape.) MLX also has three special load error messages: INCORRECT STARTING ADDRESS, which means the file you're trying to load does not have the starting address you specified when you ran MLX; LOAD ENDED AT address, which means the file you're trying to load ends before the ending address you specified when you started MLX; and TRUNCATED AT ENDING ADDRESS, which means the file you're trying to load extends beyond the ending address you specified when you started MLX. If you see one of these messages and feel certain that you've loaded the right file, exit and rerun MLX, being careful to enter the correct starting and ending addresses.


The 128 version also has a CATALOG DISK option so you can view the contents of the disk directory before saving or loading.


The QUIT menu option has the obvious effect—it stops MLX and enters BASIC. The RUN/STOP key is disabled, so the Q option lets you exit the program without turning off the computer. (Of course, RUN/STOP-RESTORE also gets you out:) You'll be asked for verification; press Y to exit to BASIC, or any other key to return to the menu. After quitting, you can type RUN again and reenter MLX without losing your data, as long as you don’t use the clear workspace option.


The Finished Product


When you've finished typing all the data for an ML program and saved your work, you're ready to see the results. The instructions for loading and using the finished product vary from program to program. Some ML programs are designed to be loaded and run like BASIC programs, so all you need to type is LOAD “filename”,8 for disk (DLOAD “filename” on the 128) or LOAD “filename” for tape, and then RUN. Such programs will usually have a starting address of 0801 for the 64 or 1C01 for the 128. Other programs must be reloaded to specific addresses with a command such as LOAD “filename”,8,1 for disk (BLOAD “filename” on the 128) or LOAD “‘filename’’,1,1 for tape, then started with a SYS to a particular memory address, On the Commodore 64, the most common starting address for such programs is 49152, which corresponds to MLX address C000. In either case, you should always refer to the article which accompanies the ML listing for information on loading and running the program.


An Ounce of Prevention


By the time you finish typing in the data for a long ML program, you may have several hours invested in the project. Don’t take chances—use our “Automatic Proofreader” to type the new MLX, and then test your copy thoroughly before first using it to enter any significant amount of data. Make sure all the menu options work as they should. Enter fragments of the program starting at several different addresses, then use the Display option to verify that the data has been entered correctly. And be sure to test the Save and Load options several times to ensure that you can recall your work from disk or tape. Don’t let a simple typing error in the new MLX cost you several nights of hard work.