WIP: VIC-2020 MINIMON cartridge

Modding and Technical Issues

Moderator: Moderators

User avatar
Mike
Herr VC
Posts: 4831
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

WIP: VIC-2020 MINIMON cartridge

Post by Mike »

Here's my newest project, the VIC-2020 MINIMON cartridge:

Image

Some highlights:
  • MINIMON is only 2 KB in size!
  • Per default, MINIMON is located in $9800..$9FFF, which is unused by most regular software on the VIC-20. Start with SYS 38912.
  • MINIMON features all commands usually expected from a debugger/monitor: Memory dump and edit, Register dump and edit, Execute code from monitor, Direct Assembler and Disassembler (all documented opcodes of the NMOS 6502), Transfer/Compare/Fill/Hunt in memory blocks, Use of breakpoints with the BRK instruction, Load/Save/Verify with any storage device.
  • Special care has been taken to minimize the intrusiveness of MINIMON. The operation of BASIC and KERNAL is completely unaffected, memory addresses often used by other ML programs have been kept clear - this especially means the usual suspects of $FB..$FE in the zeropage, also the so-called program indirects ($02A1..$02FF) and the tape buffer ($033C..$03FF) are still available for your own use.
  • Input and output of MINIMON can be redirected: this enables batch processing with files, printer dumps, even remote debugging over RS232 is possible!
The prototype you see above was built using the VIC-1210 3K RAM Expansion Cartridge as carrier. The reference design will feature a 44-pin cartridge connector intended to take up another cartridge. Any standard memory cartridge will run in combination with MINIMON. When a slave cartridge happens to use the I/O area, MINIMON can be made temporarily invisible with a switch.

Here are two videos showing MINIMON in action:
  • Loading the "Birds" example from here into MINIMON, a disassembly, execution and stop back into the command line (birds.avi, ~21 MB),
  • Batch assembly of a re-implemented square root function for BASIC (using Heron's algorithm), test with the square root of two (heron.avi, ~12 MB).
Stay tuned! :mrgreen:

Cheers,

Michael
User avatar
tokra
Vic 20 Scientist
Posts: 1123
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: WIP: VIC-2020 MINIMON cartridge

Post by tokra »

Looking forward to trying this out @ Revison :mrgreen: I will bring my XPANDER-VIC so we can try how it works together with MegaCart and other carts!
User avatar
majikeyric
Vic 20 Afficionado
Posts: 350
Joined: Fri Oct 24, 2014 2:08 pm
Website: http://majikeyric.free.fr
Location: France

Re: WIP: VIC-2020 MINIMON cartridge

Post by majikeyric »

Very cool! I want ! :lol:

@Tokra : could you try with UltimeM as well ? :mrgreen:
User avatar
Mike
Herr VC
Posts: 4831
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: WIP: VIC-2020 MINIMON cartridge

Post by Mike »

@majikeyric: tokra and I successfully soft-loaded a *.prg image file of MINIMON into Ultimem.

The installer first re-enables the registers (in case they've been hidden before), enables full RAM expansion (+35K and RAM in I/O2 and I/O3), loads the monitor 'below' the Ultimem registers (utilizing a temporary mirror in BLK5), write protects I/Ox and finally simultaneously hides the Ultimem registers and resets into the start-up prompt.

Works, and tokra approves! :mrgreen:
User avatar
majikeyric
Vic 20 Afficionado
Posts: 350
Joined: Fri Oct 24, 2014 2:08 pm
Website: http://majikeyric.free.fr
Location: France

Re: WIP: VIC-2020 MINIMON cartridge

Post by majikeyric »

Yeaaah! \o/ that's great Mike !!!!! I definitely want to make extended use of MINIMON ! Thanks Mike & Tokra ! :wink:
User avatar
Mike
Herr VC
Posts: 4831
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: WIP: VIC-2020 MINIMON cartridge

Post by Mike »

O.K. :)

We refrained however to operate the prototype MINIMON cartridge alongside another cartridge with tokra's XPANDER. Tokra got a version with obstructed DIP switches, and it's no good idea to have two cartridges select on the same signal (even if just by mistake).

The reference design of MINIMON will cleanly multiplex the I/Ox select signals, which then either go to the EPROM or to the slave cartridge.
User avatar
majikeyric
Vic 20 Afficionado
Posts: 350
Joined: Fri Oct 24, 2014 2:08 pm
Website: http://majikeyric.free.fr
Location: France

Re: WIP: VIC-2020 MINIMON cartridge

Post by majikeyric »

Will MiniMon be available to public one day ? :wink:
User avatar
Mike
Herr VC
Posts: 4831
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: WIP: VIC-2020 MINIMON cartridge

Post by Mike »

majikeyric wrote:Will MiniMon be available to public one day? :wink:
That's indeed the plan, and the "2020" cartridge number is also a hint to the (still) intended release year. :)
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: WIP: VIC-2020 MINIMON cartridge

Post by chysn »

Mike wrote: Tue Feb 11, 2020 3:22 am
majikeyric wrote:Will MiniMon be available to public one day? :wink:
That's indeed the plan, and the "2020" cartridge number is also a hint to the (still) intended release year. :)
Sweet!
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
User avatar
majikeyric
Vic 20 Afficionado
Posts: 350
Joined: Fri Oct 24, 2014 2:08 pm
Website: http://majikeyric.free.fr
Location: France

Re: WIP: VIC-2020 MINIMON cartridge

Post by majikeyric »

Mike wrote: Tue Feb 11, 2020 3:22 am That's indeed the plan, and the "2020" cartridge number is also a hint to the (still) intended release year. :)
ohhh yeahhh 8) :P
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: WIP: VIC-2020 MINIMON cartridge

Post by eslapion »

Mike wrote: Tue Feb 11, 2020 3:22 am
majikeyric wrote:Will MiniMon be available to public one day? :wink:
That's indeed the plan, and the "2020" cartridge number is also a hint to the (still) intended release year. :)
Given a schematic, I'd be glad to make a contribution.
Be normal.
User avatar
Mike
Herr VC
Posts: 4831
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: WIP: VIC-2020 MINIMON cartridge

Post by Mike »

eslapion wrote:Given a schematic, I'd be glad to make a contribution.
Thank you for your offer, I'll come up with details in PM in the next days. :)
User avatar
majikeyric
Vic 20 Afficionado
Posts: 350
Joined: Fri Oct 24, 2014 2:08 pm
Website: http://majikeyric.free.fr
Location: France

Re: WIP: VIC-2020 MINIMON cartridge

Post by majikeyric »

great collaboration in perspective :D :mrgreen:
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Re: WIP: VIC-2020 MINIMON cartridge

Post by eslapion »

Mike wrote: Mon Feb 17, 2020 3:18 pm
eslapion wrote:Given a schematic, I'd be glad to make a contribution.
Thank you for your offer, I'll come up with details in PM in the next days. :)
One month has passed... :(
Be normal.
User avatar
Mike
Herr VC
Posts: 4831
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: WIP: VIC-2020 MINIMON cartridge

Post by Mike »

tokra wrote:Looking forward to trying this out @ Revison :mrgreen:
majikeyric wrote:Will MiniMon be available to public one day? :wink:
eslapion wrote:Given a schematic, I'd be glad to make a contribution.
chysn wrote:Sweet!
I'd guess these four responses signal interest in the hardware being realised.

So, who else wants a MINIMON cartridge?

I'd like to have some more responses in that matter here in the thread, especially from my beta testers. At one point, eslapion and me will have to agree upon a price tag, and that at least partly depends on the number of interested people for the first batch.

As a refresher, here is the command set of the monitor:

Code: Select all

A <address> <mnemonic> [<operand>]
. <address> <mnemonic> [<operand>] - assemble instruction to address, give
prompt for next instruction,

C <start> <end> <start2> - compare memory block between start and end with
memory block starting at start2, list different addresses,

D [<start> [<end>]] - disassemble instructions from memory,

F <start> <end> <byte> [<byte>]*
F <start> <end> '<string> - fill memory with a single byte or a pattern,

G [<address>] - execute code at address, use the BRK instruction to return
to the monitor,

H <start> <end> <byte> [<byte>]*
H <start> <end> '<string> - search pattern in given address range,

L ["<file name>" [<dev.-#>]] - load file into memory,

M [<start> [<end>]] - dump memory as hex bytes, 5 bytes/line,

> <address> [<byte>]* - change up to 5 bytes in memory, beginning at
address,

R - show register dump,

;<pc> [<sr> [<ac> [<xr> [<yr> [<sp>]]]]] - change register dump,

S "<file name>" <dev.-#> <start> <end+1> - save memory to file. Note, 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,

T <start> <end> <start2> - transfer memory block between start and end to
memory block starting at start2. Overlapping transfers work in both
directions,

V ["<file name>" [<dev.-#>]] - compare file with data in memory, and,
finally,

X - exit monitor.
Some remarks:

MINIMON pretty much implements all of the VICMON/HESMON feature set with a few exceptions: the "new locator" and "instruction trace" facilities had to go. IMO, they simply don't deliver, no "new locator" would be able to detect when immediate operands form part of a address (that still takes good guesswork when re-engineering source from 6502 object code!) and the instruction trace facility wouldn't work with interrupt routines because of resource clash (interrupt vectors and VIA timers), which prohibits tracing the most interesting cases, namely cycle exact raster interrupts. The breakpoint facility is implemented in a minimal way with the BRK instruction.

I left out other "goodies" like the scrolling disassembler for good. IMO, scrolling to lower addresses can't be done 100% accurate (the disassembler could "hook" onto operand fields mistaken for opcodes), and personally, I like to use cursor down to make room on screen when working in the monitor and don't like an automatic insertion of further disassembled lines onto screen. "D" on its own disassembles roughly half a screenheight full of instructions from the last known address, that's good enough for me. :)

The A and D commands don't display the hex values of the instruction. With a proper line layout, that simply wouldn't fit into 22 chars/line, requiring two lines per instruction. Having more lines of code on screen is more valuable, IMO. If one wants to know the hex values, the M command still can be used for that.

The M command doesn't feature a PETSCII dump at the end of each line. I wrote a small utility program that fits into $02A1..$02FF, which displays a whole page as PETSCII (page number in A), uses the breakpoint facility, places a "G" into the keyboard buffer and auto-increments the page, so one can quickly scan a bigger memory range for text strings by repeatedly tapping RETURN. :mrgreen:

MINIMON changes the BRK and NMI vectors, the latter one to keep itself and the BRK vector 'life' even when STOP/RESTORE is pressed.

As stated in the OP, input and output of MINIMON can be redirected for batch processing with files, printer dumps and remote debugging over RS232.

Now for the best part:

Exactly *no* relevant zeropage addresses are used by MINIMON, with the exception of a few ones that would be necessary anyhow to communicate with the KERNAL during file operations. Especially $FB..$FE are kept free.

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/data there for obvious reasons. The often used buffers at $02A1 and $033C are kept free.

I thus took quite some precautions that MINIMON interoperates well with most other programs, not only by placing it into the I/O range, but also by minimizing resource conflicts in other memory ranges. :)

Cheers,

Michael
Post Reply