24.05.2026
---------------------------------------------------------------------------------------------------
NOTE {by mzretro.ch}
IMPORTANT INFORMATION:
This is the official MiniMon {For Commodore VIC-20} cartridge instruction!
Do not use SYS 38912 to start the floppy disk version of the MiniMon!
Monitor commands are the same and that is the only reason why you can download this here!
In case you want a cartridge version of MiniMon or just need some more information:
https://sleepingelephant.com/ipw-web/bulletin/bb/viewtopic.php?t=9325
https://sourceforge.net/projects/vic-2020-minimon-cartridge/
----------------------------------------------------------------------------------------------------
MINIMON
- INTRODUCTION
- USING MINIMON
- MINIMON COMMAND LIST
- COMMAND DESCRIPTIONS
- APPENDIX A: ERROR MESSAGES
- APPENDIX B: EXAMPLES
- APPENDIX C: KERNAL I/O REDIRECTION
- APPENDIX D: TECHNICAL INFORMATION
- APPENDIX E: HEX <-> DEC CONVERSION TABLE
- APPENDIX F: MINIMON CARTRIDGE HARDWARE
INTRODUCTION
MINIMON is a machine language utility which lets you easily write your own
machine language programs on the VIC-20. MINIMON includes a machine language
monitor, a mini assembler, and a disassembler.
Machine language programs written using MINIMON can run by themselves, or be
used as very fast 'subroutines' for BASIC programs since MINIMON has the ability
to coexist peacefully with BASIC.
USING MINIMON
1. Enter MINIMON by typing:
SYS38912
MINIMON will respond by displaying the 6502 registers and flashing the cursor.
The cursor is your prompt that lets you know that MINIMON is waiting for your
commands.
MINIMON COMMAND LIST
A or . ASSEMBLE Assemble a line of 6502 code
C COMPARE Compare two sections of memory and report differences
D DISASSEMBLE Disassemble a line of 6502 code
F FILL Fill memory with a specified byte or byte pattern
G GO Start execution at the specified address
H HUNT Hunt through memory for all occurences of certain bytes
L LOAD Load a file from tape or disk
M / > MEMORY Display/Edit the hexadecimal values of memory locations
R / ; REGISTERS Display/Change the 6502 registers
S SAVE Save a file to tape or disk
T TRANSFER Transfer code or data from one section of memory to another
V VERIFY Verify a file on tape or disk with memory
X EXIT eXit MINIMON
COMMAND DESCRIPTIONS
A or . ASSEMBLE Assemble a line of 6502 code
Syntax: A
[]
. []
is a hexadecimal number indicating the location in memory to place the
instruction. is a standard MOS assembly language mnemonic eg. LDA,
STX, ROR, etc. , when required, can be of any of the legal addressing
modes. For zero-page modes, a 2 digit hex number whose value is less than $100
is required. For non-zero-page addresses, 4 digit hex numbers are required.
Press [RETURN] to enter the assembly line. If there are any errors on the line,
a question mark is displayed to indicate an error, and the cursor moves to the
next line. The screen editor can be used to correct any errors on the line.
After a line of code is successfully assembled, the assembler will print a
prompt containing the next legal memory location for an instruction, so A and
the address do not have to be typed more than once when typing assembly language
programs into the VIC. See APPENDIX B for examples for you to try out.
C COMPARE Compare two sections of memory and report differences
Syntax: C
is a hex number indicating the start address of the area of memory to
compare against. is a hex number indicating the end address of the area of
memory to compare against. is a hex number indicating the start address
of the other area of memory to compare with.
If the two memory areas compare equal, then MINIMON will just print an empty
line and the flashing cursor reappears. The addresses of any bytes in the two
areas which are different are printed out on screen.
D DISASSEMBLE Disassemble a line of 6502 code
Syntax: D [ []]
is a hexadecimal number setting the address to start the disassembly.
is an optional hexadecimal ending address of code to be disassembled.
The format of the disassembly is only slightly different than the input format
of an assembly. The difference is that the first character of a disassembly is a
full stop rather than an A (for readability).
The disassembly listing can be modified using the screen editor. Make any
changes to the mnemonic or operand on the screen, then confirm the line by
pressing [RETURN]. This will enter the line and call the assembler for further
modifications.
The disassembly can be paged. Entering D on its own will cause the next page of
disassembly to scroll onto the screen.
Example:
D F659 F669
. F659 LDY $B7
. F65B BEQ $F669
. F65D LDY #$00
. F65F LDA ($BB),Y
. F661 JSR $FFD2
. F664 INY
. F665 CPY $B7
. F667 BNE $F65F
. F669 RTS
Note the disassembly output does not include the hexadecimal bytes that make up
the instructions because of the limited line length of the VIC-20 screen. You
can use the M command instead, which displays a hexadecimal memory dump.
F FILL Fill memory with a specified byte or byte pattern
Syntax: F []*
F '
is the first location to fill with a single byte or pattern. is
the last location to fill with a single byte or pattern. []* is a
list containing at least 1 and up to 16 hexadecimal byte values. ' is a
non-empty ASCII string preceded by a single quote up to 16 characters.
This command is useful for initializing data structures or any other RAM area.
Example: F 1300 1DFF EA
Fills memory locations from $1300 to $1DFF with $EA (a NOP instruction).
G GO Start execution at the specified address
Syntax: G []
is an optional argument specifying the new value of the program
counter and address where execution is to start. When is left out,
execution will begin at the current program counter (the current PC can be
viewed using the R command).
The G command will restore all other registers from the register dump and begin
execution at the specified address. Upon executing a BRK instruction, the
program will re-enter MINIMON and update the register dump (including PC).
Example: G 1810
Execution begins at location $1810.
H HUNT Hunt through memory for all occurences of certain bytes
Syntax: H []*
H '
is the beginning address of the search procedure. is the ending
address of the search procedure. []* or ' are the data to
search for, a list of hexadecimal bytes or an ASCII string. An ASCII string is
specified by preceding the first character with a single quote, e.g., 'STRING.
The search pattern must be non-empty and may contain up to 16 hexadecimal byte
values or characters.
Example:
H C000 FFFF 'ERROR Search for ASCII string
C36B F179
H C000 FFFF A9 FF 4C Search for data $A9, $FF, $4C
D079
L LOAD Load a file from tape or disk
Syntax: L [""[,]]
is any legal CBM filename. is a byte value indicating the
device to load from. 1 is tape, 8 is disk (or 9, etc. - use hexadecimal for
higher device numbers).
The L command causes a file to be loaded into memory. The load address is
contained in a two byte header of the file (a PRG file) preceding the actual
memory data. In other words, the L command always loads a file into the same
place it was saved from. This is very important in machine language work, since
few programs are completely relocatable (if you need a data block at some
different place, the T command can be used for this). The file will be loaded
into memory until EOF is found.
Example:
L "HELLO.PRG",1 reads a file from tape.
L "HELLO.PRG",8 reads a file from disk drive.
M MEMORY Display the hexadecimal values of memory locations
Syntax: M [ []]
is the first address of the memory dump. Optional. If omitted, a
paragraph of half a screen height will be displayed and the first byte printed
will be from the last address printed plus 1. is the last address of the
memory dump. Optional. If omitted, a paragraph of half a screen height will be
displayed. The first byte printed will be the data beginning at .
Memory is displayed in the following format:
>1810 A2 00 BD 00 18
Note the memory display does not include an ASCII character output because of
the limited line length of the VIC-20 screen. See Appendix B for a small
transient utility program, which displays a paged ASCII view (256 bytes/page).
A _stack dump_ is displayed by first investigating the stack pointer with the R
command, prepending the implied $01 high byte and then issuing an M command with
the full stackpointer as start address and $01FF as end address:
R
PC SR AC XR YR SP
;==== == == == == F6
M 01F6 01FF
>01F6 == 43 E1 E9 C7
>01FB C7 79 C6 80 E3
As with the D command, you can page down by entering M on its own.
> MEMORY Edit the hexadecimal values of memory locations
Syntax: > []*
is the first address of memory to change. []* is a list
containing up to 5 hexadecimal byte values.
Memory content may be edited using the screen editor. Enter the > command on its
own or move the cursor to the data of a memory dump (see the M command) which is
to be modified, type the desired correction and press [RETURN].
The > command only allows for hexadecimal input. If you want to place ASCII
strings in memory, a combination of the H and T commands can be used for that
(see the "HELLO, WORLD!" example in APPENDIX B).
R REGISTERS Display the 6502 registers
Syntax: R
Show the 6502 registers as stored in the register dump. The program counter
(PC), program status register (SR), the accumulator (AC), the X and Y index
registers (XR and YR, respectively) and the stack pointer (SP) are displayed.
The R command does not take any parameters.
Note SP is displayed without its implied high byte ($01).
Example:
R
PC SR AC XR YR SP
;181F 33 0D 10 00 F6
; REGISTERS Change the 6502 registers
Syntax: ; [ [ [ [ []]]]]
Change the 6502 register dump. Enter new values for the program counter (PC),
status register (SR), accumulator (AC), index registers (XR and YR) and stack
pointer (SP). These changes only take effect when a machine code program is
executed with the G command (see there).
S SAVE Save a file to tape or disk
Syntax: S "",,,
is any legal CBM filename. To save the data, must be
enclosed in double quotes. is the device number to save to. Possible
devices are tape and disk. To save on tape, use device 1. The device number of
the CBM disk drive is usually 8. However, this can be changed (i.e. when using
more than one drive. See the VIC-1540 User's Manual). is the starting
address of memory to be saved. is the ending address of memory to be
saved, plus 1. Note, the end address given is exclusive (for example, use the
parameter list "...,1000,2000" to save from $1000 to $1FFF). This matches the
convention used by many other monitors.
The file created by this command is a CBM PRG file. A header of two bytes
contains the load address of the data. The file may be recalled using
the L command.
Example: S "HELLO.PRG",8,1800,181E
Saves memory from $1800 to $181D onto disk.
T TRANSFER Transfer code or data from one section of memory to another
Syntax: T
is the starting address of data to be moved. is the ending address
of data to be moved. is the starting address of the new location (where
the data will go). The memory contents between (and including) and
are transferred to the memory block starting at .
Overlapping transfers work in both directions.
Example: T 1400 1600 1401
Shifts data from $1400 up to and including $1600 one byte higher in memory.
V VERIFY Verify a file on tape or disk with memory
Syntax: V [""[,]]
is any legal CBM filename. is a hex number indicating the
device the file is on.
The V command compares a file to memory content. If the file does not match
memory, ERROR is printed.
Examples: V "HELLO.PRG",8
V "HELLO.PRG",1
X EXIT eXit MINIMON
Syntax: X
Exit to the "READY." prompt of BASIC.
The X command does not take any parameters.
APPENDIX A: ERROR MESSAGES
MINIMON will flag mistakes in input with a question mark (?) and advance the
cursor to the next line.
When an error occurs during file operations (with the L, S or V command), one
of the following error messages is displayed:
I/O ERROR #4 ^= ?FILE NOT FOUND
I/O ERROR #5 ^= ?DEVICE NOT PRESENT
I/O ERROR #8 ^= ?MISSING FILENAME
I/O ERROR #9 ^= ?ILLEGAL DEVICE NUMBER
APPENDIX B: EXAMPLES
1. A "Hello, World!" program in 6502 machine language
MINIMON has no dedicated command to place (or modify) a plain ASCII text string
in memory. A combination of the H and T commands can be used instead: with the H
command, a single quote (') allows to search for a given plain text string, and
a search in $0000 to $03FF shows, where it keeps that string to compare it with
memory. The T command then moves the string to the intended position.
The H command will usually return _two_ occurrences. One at $020x, which is from
the command line input buffer, and the other one at $0248, which is the actual
search pattern buffer. Only use this buffer at $0248, as the command line buffer
is overwritten when you enter the following T command!
Control characters are entered by using double quotes or placeholder characters.
SYS38912
MONITOR
PC SR AC XR YR SP
;==== 00 == == == F6
H 0000 03FF '**HELLO, WORLD!*
020D 0248
T 0248 0257 1800
M 1800 180F
>1800 2A 2A 48 45 4C <- replace all occurrences of $2A
>1805 4C 4F 2C 20 57 with $0D and reenter the lines
>180A 4F 52 4C 44 21 by pressing [RETURN]
>180F 2A == == == ==
M 1800 180F <- check
>1800 0D 0D 48 45 4C
>1805 4C 4F 2C 20 57
>180A 4F 52 4C 44 21
>180F 0D == == == ==
A 1810 LDX #$00
A 1812 LDA $1800,X
A 1815 JSR $FFD2
A 1818 INX
A 1819 CPX #$10
A 181B BCC $1812
A 181D BRK
A 181E
G 1810
HELLO, WORLD!
BREAK
PC SR AC XR YR SP
;181F 33 0D 10 == F6
2. A small transient utility to produce a page-wise ASCII dump
Do not enter the comments after the semicolons!
.02A1 BRK
.02A2 NOP
.02A3 LDY #$00 ; G 02A3 to start the utility
.02A5 STY $FB
.02A7 STA $FC ; AC contains high byte of memory page to display
.02A9 LDA #$0D
.02AB JSR $FFD2 ; start dump with ASCII 13 (^= carriage return)
.02AE LDA $FC
.02B0 JSR $02EA ; output high ...
.02B3 TYA
.02B4 JSR $02EA ; ... and low byte in hexadecimal
.02B7 LDA #$3A
.02B9 JSR $FFD2 ; delimit address with a colon (ASCII 58)
.02BC LDX #$10
.02BE LDA ($FB),Y ; load byte from memory
.02C0 INY
.02C1 PHA
.02C2 AND #$7F ; is byte
.02C4 CMP #$20 ; printable?
.02C6 PLA
.02C7 BCS $02CB ; yes
.02C9 LDA #$2E ; no - replace by full stop (ASCII 46)
.02CB JSR $FFD2 ; print character in accumulator
.02CE DEX
.02CF BNE $02BE ; until 16 characters per line
.02D1 LDA #$0D
.02D3 JSR $FFD2 ; advance to next line
.02D6 CPY #$00
.02D8 BNE $02AE ; until 256 bytes displayed
.02DA LDA #$47
.02DC STA $0277 ; place "G" into keyboard buffer
.02DF LDA #$01
.02E1 STA $C6 ; one outstanding keypress
.02E3 INC $FC
.02E5 LDA $FC ; advance page
.02E7 JMP $02A1 ; and return to MINIMON. [RETURN] shows next page.
.02EA PHA ; save AC to stack for later use
.02EB LSR ; extract
.02EC LSR ; :
.02ED LSR ; :
.02EE LSR ; upper hexadecimal digit
.02EF JSR $02F5 ; print digit
.02F2 PLA ; retrieve original AC from stack and ...
.02F3 AND #$0F ; ... extract lower hexadecimal digit
.02F5 CMP #$0A ; is it 0..9?
.02F7 BCC $02FB ; yes
.02F9 ADC #$06 ; no, adjust for A..F
.02FB ADC #$30 ; add ASCII base value of "0"
.02FD JMP $FFD2 ; print character in accumulator
With
S "ASCII.PRG",X,02A1,0300
you can save the utility to tape (X=1) or disk (X=8) for later use.
Use G 02A3 to start the utility. Press [RETURN] to show the next page. In
between pages, change AC in the register dump to select another high byte for
the page to display.
APPENDIX C: KERNAL I/O REDIRECTION
Keyboard input and screen output of MINIMON can be redirected to other devices.
For example, it is possible to produce a line printer output of the ASCII dump
utility as follows:
OPEN4,4:CMD4:SYS38912 enter in one line!
D 02A1 02FF
X
PRINT#4:CLOSE4 again enter in one line.
The prompt of MINIMON with the register dump and the disassembly listing will be
output on the line printer instead of the screen.
For more advanced uses, refer to the KERNAL CHKOUT and CHKIN routines in the
VIC-20 Programmer's Reference Guide.
APPENDIX D: TECHNICAL INFORMATION
MINIMON only uses workspace at rather unusual places, at the bottom of stack
($0100..$011E) and in the BASIC input buffer ($0200..$0258) where for other
programs normally it is no good idea to keep code or data there, for obvious
reasons. The often used buffers at $02A1 and $033C are kept free.
The usage of zero-page addresses has been minimized. The only exception are some
addresses, which are anyhow necessary to communicate with the KERNAL during file
operations. Especially $FB..$FE are kept free.
When MINIMON has been started the first time, the BRK vector at $0316 and the
NMI vector at $0318 are redirected to point into MINIMON. Upon executing a BRK
instruction, the VIC-20 does not anymore cause a BASIC warmstart, but 'breaks'
into the monitor and displays the register dump. From there, you can investigate
the interrupted program code, its workspace and the stack contents.
The NMI vector is also redirected to keep the changed BRK vector (and itself)
'life' across a BASIC warmstart initiated by pressing [STOP] and [RESTORE].
You can revert to the original BRK and NMI vectors with POKE783,4:SYS65234.
APPENDIX E: HEX <-> DEC CONVERSION TABLE
+-------------------------------------------+
| # $X... $.X.. $..X. $...X |
| |
| 0 0 0 0 0 |
| 1 4096 256 16 1 |
| 2 8192 512 32 2 |
| 3 12288 768 48 3 |
| 4 16384 1024 64 4 |
| 5 20480 1280 80 5 |
| 6 24576 1536 96 6 |
| 7 28672 1792 112 7 |
| 8 32768 2048 128 8 |
| 9 36864 2304 144 9 |
| A 40960 2560 160 10 |
| B 45056 2816 176 11 |
| C 49152 3072 192 12 |
| D 53248 3328 208 13 |
| E 57344 3584 224 14 |
| F 61440 3840 240 15 |
+-------------------------------------------+
EXAMPLES:
HEX -> DEC: $C0DE = 49152+208+14 = 49374
DEC -> HEX: 47710 - 45056 ($B...) = 2654
2654 - 2560 ($.A..) = 94
94 - 80 ($..5.) = 14
14 = $...E
=> 47710 = $BA5E
APPENDIX F: MINIMON CARTRIDGE HARDWARE
Perform the following actions only when the VIC-20 is switched off:
- inserting/removing the MINIMON cartridge into/from the VIC-20 cartridge port,
- inserting/removing a cartridge into/from the MINIMON cartridge extender,
- inserting/removing a memory chip into/from the MINIMON cartridge's ZIF socket,
- changing the jumper setting between the positions "PGM" and "PCT".
Insert the memory chip into the ZIF socket with the notch pointing to the left.
A user supplied secondary cartridge goes into the cartridge extender with its
label facing to the computer.
Only operate the MINIMON cartridge with the jumper fitted to either PGM or PCT.
The PCT position is intended for EPROMs (2716s) or already programmed EEPROMs
(2816s or adapted 2864s). With EEPROMs, this setting provides a hardware write
protect. The PGM position is intended for RAMs (6116s) or EEPROMs that are
supposed to be programmed.
The switch labeled "MON<-I/O->CART" maps the MINIMON firmware into the I/O area
when set to "MON", or the resources of the secondary cartridge when set to the
"CART" position. It is up to the informed user to decide which position is
appropriate. As a rule, when there is any chance that a more complex secondary
cartridge might require access to its resources in the I/O area, the switch
should be set to the "CART" position. With simpler secondary cartridges, like
RAM expanders, the switch can be left in the "MON" position at all times. It is
in order to change the switch setting while the VIC-20 is powered on.
The RESET button has two operating modes. A short press will perform a normal
reset which affects the VIC-20 and any connected peripherals, including the
secondary cartridge. Holding the button for longer than 1 second lights up the
blue FREEZE LED to indicate the button release will perform a freeze reset. The
freeze reset inhibits an eventual autostart of the secondary cartridge and
excepts it from receiving the reset signal: internal logic chips of more complex
secondary cartridges retain their state, easing analysis with MINIMON.