(WIP) disk menu/ loader (learn ing ML)

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
R'zo
Vic 20 Nerd
Posts: 514
Joined: Fri Jan 16, 2015 11:48 pm

(WIP) disk menu/ loader (learn ing ML)

Post by R'zo »

I will soon be releasing a compilation of programs that I have written in the last year on a d64 disk image. I have been wanting to learn ML and I think this would be a good opportunity to start by creating a disk menu/ loader program to be placed at the top of the disk so that load"*",8...run or auto attaching in vice would automatically bring up the loader menu making use of the disk a little more "user friendly".

I would like the program to...
-if possible it needs to fit into the tape buffer so that it will work with both expanded and unexpanded vic. I also need it to not interfere with any program that it is loading into basic.
-read the disk directory and list all .prg files on the disk.
-have an easy way to select the file to be loaded(i.e. scroll cursor to highlight or point at program or use an input command to select the number of the program to be loaded.
-load and run the program selected
-redefine the run stop key to clear the screen, turn of sound channels, clear basic and go back to the menu/loader.

This will be my first ML program. I have read many pdfs on ML with the vic and would first like to start with...
-What would be the best monitor/ assembler / compiler programs for my needs (I will most likely be writing this in VICE if it makes a difference)?
-I have noticed that VICE has it's own monitor, do I need to use a monitor program to run it?
-Do I need any other programs or tools to accomplish this.

Any advise would be greatly appreciated.

Here is a demo of the compilation disk if any one is interested-rzos vic v1 demo

I have been spending the last year teaching my self basic with the Vic and I am looking forward to moving on to ML.
R'zo
I do not believe in obsolete...
User avatar
pixel
Vic 20 Scientist
Posts: 1343
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: (WIP) disk menu/ loader (learn ing ML)

Post by pixel »

I'd suggest you stick with CBM prg Studio and VICE. :)
R'zo wrote: I would like the program to...
-if possible it needs to fit into the tape buffer so that it will work with both expanded and unexpanded vic. I also need it to not interfere with any program that it is loading into basic.
It might be possible to squeeze a loader for the loader in there. :) Your program sure as hell won't fit into the 178 bytes. So, stretch out, relax, DON'T optimize for size or speed unless you really have to.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: (WIP) disk menu/ loader (learn ing ML)

Post by Boray »

You can make an ML program run at any memory position with a few tricks, for example only using branches instead of JMP.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Mike
Herr VC
Posts: 4831
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: (WIP) disk menu/ loader (learn ing ML)

Post by Mike »

Writing such a disk menu/loader is surely a good opportunity to learn the details of disk I/O, but you should be aware that a good part of your wish list is already covered by nbla000's CBM FileBrowser. ;)

Regards memory usage: you'd still place the main part of the file browser into BASIC mem. Just when a file has been selected to run, a small part of the file browser is copied down to the tape buffer, which then makes the necessary calls to BASIC and KERNAL to load the intended file and then run it.

If the disk (image) contains programs that are not only one-filers, it might be feasible to preprocess the directory and include it into the browser executable for a fancy selector program, which only shows the file names of the first program part of each program (assumed, that they themselves then automatically load the next part(s)). This is what I did for the menu of my Games Collection.

Cheers,

Michael
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: (WIP) disk menu/ loader (learn ing ML)

Post by Boray »

My Vic Menu does the same things too, but is just partly ML:
http://www.boray.se/commodore/vicmenu.html
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
pixel
Vic 20 Scientist
Posts: 1343
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: (WIP) disk menu/ loader (learn ing ML)

Post by pixel »

Directory listing in 61 bytes: http://www.pagetable.com/?p=273
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1343
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: (WIP) disk menu/ loader (learn ing ML)

Post by pixel »

pixel wrote:Directory listing in 61 bytes: http://www.pagetable.com/?p=273
Am sorry right there. Didn't pay attention. It's for the C64. m(

Found a cleaner version at http://codebase64.org/doku.php?id=base: ... _directory instead. Also, for the C64 but if you replace the call to $BDCD by a call to $DDCD it works like a charm. :)
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
Post Reply