Page 1 of 1

ML

Posted: Thu Mar 30, 2017 11:02 am
by Floopy
Since my last post on the IF function (not "statement" " did not think about that until after), I have tried to learn machine language a little. My problem is that I can't find anyway to write machine language on my Vic-20. I can't seem to find software to do this for me, and when I do they are expensive cartridges. Is their any cassette or floppy software out their for writing machine language??
Thank you!

Re: ML

Posted: Thu Mar 30, 2017 12:19 pm
by srowe
All you need to write machine code directly is a machine code monitor, you can download VICMON from here.

http://www.zimmers.net/anonftp/pub/cbm/ ... index.html

Using a monitor is a bit laborious, assemblers that allow you to define symbols and have comments are easier to use. I haven't used a native assembler for decades, perhaps someone else can recommend one.

I find it far easier to write code on my PC, assemble it and copy the binaries across. In that way I can use modern editors, revision control etc.

Re: ML

Posted: Thu Mar 30, 2017 1:07 pm
by beamrider
I would suggest starting with. CbmPrg and if you outgrow that or are not on a windows environment, move to ca65

Re: ML

Posted: Thu Mar 30, 2017 1:16 pm
by Mike
srowe wrote:All you need to write machine code directly is a machine code monitor, [...]
All it needs is an opcode table, pen and paper, working out all branch offsets by hand, collecting the instructions and their operands in (decimal) numbers into DATA lines, and finally POKEing all these numbers into the given memory range (preferably protected from BASIC use). :twisted:

... :lol:

How did they code ML games back in the old days? (and take a good look at Lee's reply. ;))

Re: ML

Posted: Thu Mar 30, 2017 6:07 pm
by Floopy
Thanks everybody :D

Re: ML

Posted: Thu Mar 30, 2017 9:54 pm
by darkatx
Ahhh the late great Leeeeee, gone but not forgotten!

Re: ML

Posted: Tue Apr 04, 2017 10:25 pm
by Forbidden64
There is a way to do this with no investment required, and nothing but an unexpanded vic with tape. There are also multiple ways to do it...most people here have EVERYTHING for the vic, and forget that some people just plain don't, nor are they willing to spend hundreds of dollars on modern interfacing add-ons, or build cables etc..

TINYMON, for example, was I believe the earliest monitor for the vic, and runs in native ram. It is aptly named...In fact it came out before ram expansions were widely adopted, and cost around 80$ extra on top of your 300$ for the computer, and 129$ for the datasette, or, originally required the typer to know someone with a PET, which would have enough memory to insert all the data statements and then poke them all into memory and save it...but someone thought of a way!

Given that today most people have at least SOME manner of ram expander...this latter step isn't normally talked about or even viable in an era where even fewer people have a PET. Even if you don't have a ram expander, you can still type it in the native vic. TINYMON gives you a full monitor, but not assembler..IE you are typing in machine language, and converting mnemonics probably using notepad's find and replace... , and fits onto the VIC screen, while only using around 750 bytes. In fact, that revision to the text came out in the compilation of compute's gazette. Here is the book, which contains the program on page 195( or page 203 of the actual PDF). Immediately following are instructions for typing it into a vic with no ram expander:


http://commodore.bombjack.org/books/com ... of_VIC.zip

The way I got it onto mine was by using a regular tape recorder, and a program called 'tap dancer' for droid phones. You put your phone in airplane mode, and then you can write files from the web in .tap/ .t64 file extensions directly to tape. Some volume control fiddling is usually required, although for me, writing TINYMON worked the first try.

This is a good starter book:
http://commodore.bombjack.org/books/com ... puters.zip

Of course once you have any monitor, you can enter core dumps of anything you like directly. In fact, you can do that with the hex to dec converter/poker in the first book of vic.
Like this one for instance, which is full of memory core dumps you can key back in very quickly...no fluff, just hex, although it provides a twin listing disassembled for easier reading:
http://commodore.bombjack.org/books/com ... nd_128.zip

and these ones which all combined, will give you a decent machine code library to cobble things together (you can just enter the hex codes in the core dump listings/in the display of the disassembly:
for example: 4096 A9 07 LDA #$07
you could just put: '4096 A9 07' xx xx xx ...and so on until you run out of line space. Several of these actually have straight up core dumps that you can enter directly into tinymons style of interface.

http://commodore.bombjack.org/books/com ... he_C64.zip

http://commodore.bombjack.org/books/com ... or_C64.zip

Re: ML

Posted: Thu Apr 06, 2017 3:44 am
by Mike
Tinymon is also available on zimmers: link.

One game, DEFENDER, that I had as type-in in a magazine in the 80ies even came with an own HEX monitor (including checksums), the listing itself spanned four pages as hex dump. :shock:

Re: ML

Posted: Sat Apr 29, 2017 10:59 pm
by ravenxau
The Usborne book, "Machine Code For Beginners" shows how to write code and use a hex loader to make it all work...I was able to get ML stuff working as a 12 year old in the 80's....interestingly, I still have my copy of the book as a reference to this day...