********************************* * MICROMON * * original PET version * * by Bill Seiler * ********************************* Ported to PAL-1 and documentation by Dave Hassler, 2022 COMMANDS AND USAGE Conventions All addresses must be entered as four hexidecimal digits; C00 is not the same as 0C00. Data is always entered as hex digits. AAAA = address 1111 = number MMM = Mnemonic OOOOO = operand [x] = option Note: MICROMON, as ported, is unforgiving of errors on input; there is no working backspace. Mistakes in entry, if detected, should have the key pressed immediately and hope for the best. Often, MICROMON will respond with a '?' and wait for a command, but sometimes odd and long 'listings' will result, and occasionally the program crashes. If the latter happens, simply clear the status/flag register, enter $6000 as the active address from the PAL-1 monitor, and type 'G'. A - SIMPLE ONE-LINE ASSEMBLER Use: A AAAA MMM OOOOO Output: .A 0200 A9 42 LDA #$42 Note: must use '$' in operand to denote hex number or address, even though no other base is accepted. Does not auto-populate the next address for entry; just drops to command prompt '.' C - COMPARE MEMORY Use: C AAAA BBBB CCCC, with AAAA being the start adress of block 1, BBBB the end address of block 1, and CCCC the start of the second, comparison block. Output: a list of all locations where two the blocks differ. Note: possible use includes when one has two versions of a program and wishes to know where they differ. One version could be loaded and then transfered to another location, the second version then loaded, then the two blocks compared. D - DISASSEMBLER Use: D AAAA [BBBB] (D AAAA will list only a single line) Output: x lines of disassembly, with hex and mnemonics. E.g.: ., 0200 A9 42 LDA #$42 . . . Note: there are no page breaks, or the ability to break out of a long listing, but that's useful for text-capturing the output on a serial terminal. F - FILL MEMORY BLOCK Use: F AAAA BBBB 11, with AAAA being the start adress of the block, BBBB the end address, and 11 being any hex number. Output: fills defined block of memory with an 8-bit hex number. G - GO Use: G AAAA Note: JMPs to address, rather than JSRs. H - HUNT RANGE OF MEMORY Use: A) H AAAA BBBB 11 22 33 [hunt for sequence of bytes] B) H AAAA BBBB 'Lmno@42 [hunt for ASCII string, excluding tick mark] Output: addresses of instances found. Note: 'Hunting' will occasional break the program. Tap 'RS' on the PAL-1, set $6000 as the active memory address, and type 'G'. M - MEMORY DUMP Use: M AAAA BBBB Output: 16 bytes of hex digits, followed by 16 corresponding ASCII characters, per line. Note: Output will continue through the range specified -- AAAA through BBBB -- and will continue listing without break, but that's also useful for text-capturing the output on a serial terminal. N - NEW LOCATOR Use: N AAAA BBBB 1111 CCCC DDDD[W] where AAAA to BBBB is the range of memory to scan, 1111 is a 16-bit hex "offset" number, and CCCC/DDDD is the range of references that are to be adjusted. If W is present at the end of the command, the scanned range will be treated as a table of "words"/data with no op-codes. Note: this command converts absolute address references from one range of memory to another. It is best used AFTER transfering a range of memory in RAM with the T command. E.g., one wishes to move a program that starts at $2000, ends at $34FB, but has a jump table beginning at $34A0 to now start at $7000: T 2000 34FF 7000 N 7000 849F 5000 2000 34FB N 84A0 84FB 5000 2000 34FBW New Locator will stop and disassemble any instruction if it hits a bad op-code. When moving/relocating a program *down* in memory -- from $6000 to $1000, say -- the offset for that example is $B000, which will roll past $FFFF another 10 pages to adjest the addresses correctly. For downward moves, OFFSET = ($10000 - origin addr) + new start addr O - BRANCH OFFSET CALCULATOR Use: O AAAA BBBB Output: the proper offset for a Bxx branching op-code, given two 16-bit addresses. A '?' will be displayed of the branch would be out-of-range. T - TRANSFER (COPY) MEMORY Use: T AAAA BBBB CCCC where AAAA to BBBB is the range of memory to copy that will start at target address CCCC. Output: none. X - EXIT MICROMON Use: X Output: returns to KIM-1 monitor. ? - COMMANDS LIST Use: ? Output: a brief and abbreviated list of MICROMON commands. : - MODIFY MEMORY Use: : AAAA 11 22 33 ... Output: none. Check with M or D commands. , - WRITE ONE LINE OF ASSEMBLY Use: , AAAA 11 [22] [33] Output: E.g., 0200 20 A0 1E JSR $1EA0 Note: all this command does is modify memory and provide feedback, if one is unsure one had the correct op-code or address to input. # - CONVERT DECIMAL NUMBER Use: # 11111 (decimal) Output: the number in hexidecimal, ASCII, and 16-bit binary. Note: the decimal number can be from 1-5 digits. " - CONVERT ONE ASCII CHARACTER Use: " X (where X is any character within the KIM-1 character set) Output: the hexidecimal value of the entered character. % - CONVERT BINARY NUMBER Use: % xxxxxxxxxxxxxxxx (where x is a 1 or 0) Output: the hexidecimal value of the binary entered. Note: the binary number can be from 1 to 16 digits in length. + - ADD TWO HEX NUMBERS Use: + AAAA BBBB Output: the sum, with carry if >$FFFF. - - SUBSTRACT ONE HEX NUMBER FROM ANOTHER Use: - AAAA BBBB Output: the result of AAAA minus BBBB, with carry if <$0000. MORE NOTES AND THOUGHTS: Being an old (ancient?) Commodore user, MicroMON strikes me as eerily similar to HES MON, "by" Terry Peterson and put out by Human Engineered Software in 1982 ... and for which I paid a then-"teenager bundle" for on a VIC-20 cartridge in 1984. I no longer have the cartridge, but I still have the manual, and the commands are almost identical. The only additions to MicroMON are an "External Relinker," which is definitely cool for those porting programs between PET/VIC/64, and two "test RAM" routines. Otherwise, they are the same. Also, I took out the Commodore-specific tape save/load routines, as well as the register display/edit. The former can easily be executed in the KIM-1 TTY monitor, and the latter, well, the PET had no way to access the 6502 registers directly off zero page, like the KIM-1, so that would have to be completely rewritten. Maybe that's a job for you? :^) The other obvious deficiency is the simple assembler will not auto-advance to the next write location; I just couldn't figure it out. For me, the greatest utility of this program is the New Locator feature. Used with Transfer, it's super-powerful, and if one is trying to move a program inside of the PAL-1/microKIM, and *not* use an external cross assembler, this is the only way to go. It's like Jim Butterfield's original "Relocator" program on steroids. The Hunt command is also very good. Plus, it's less than half the size of other, similar programs for the PAL-1 that do, essentially, the same things. I hope you find it useful. -- DHH, '22