UK Vintage Radio Repair and Restoration Discussion Forum

UK Vintage Radio Repair and Restoration Discussion Forum (https://www.vintage-radio.net/forum/index.php)
-   Vintage Computers (https://www.vintage-radio.net/forum/forumdisplay.php?f=16)
-   -   MK14 examples sources (https://www.vintage-radio.net/forum/showthread.php?t=183689)

Slothie 10th Sep 2021 10:58 pm

MK14 examples sources
 
1 Attachment(s)
I've been trying to re-teach myself how to program the MK14,, and in the process have typed in and converted to SBASM compatible form all the programs in the V2 manuals
Code:

alarmclock_f20.asm
dectohex_f50.asm
divide.asm
duckshoot_f12.asm
function_e80.asm
gcd.asm
mastermind_f1c.asm
message_f20.asm
moonlanding_f52.asm
multiply.asm
musicbox_f46.asm
organ_f20.asm
pulsedelay_f20.asm
randomnoise_f20.asm
reaction_f20.asm
relocator_f20.asm
replicate_f12.asm
serin.asm
serout.asm
silverdollar_f28.asm
sqroot.asm

I've used the format naming the files with the execution address suffix on code that are complete programs that some seem to use as it is a useful reminder. However all sources that are relevant contain the necessary statements to generate the "fake" bytes at FFFE and FFFF to tell Sirius's uploader program to execute the program at the start address.

I have typed in all these programs and done a byte-by-byte comparison from the listings to confirm they are correct, but as yet haven't necessarily ran all these programs or code fragments.

As I mentioned these are designed to be assembled with SBASM, and I have included a Makefile in the archive that will assemble all the program if you have a suitable unix-like environment (I can't see why Cygwin on windows wouldn't work). The archive also contains all the generated hex files too for those who don't want to.

If you want to convert the examples to suit a different assembler you prefer, that should be fairly straightforward, so feel free and maybe post your versions here!

If you spot any glaring errors then please inform me....

SiriusHardware 11th Sep 2021 8:34 am

Re: MK14 examples sources
 
Good work, and a good idea. I think Tim has 'done' many of the historic programs which were NOT in the manual, such as OneArm, Segtris, Life, many snippets of code from magazines like PE, plus just about everything which was written to run on the VDU so maybe he could add those, time allowing, to make this the 'MK14 software repository thread'. A lot of stuff has been posted before but it is scattered all over the place.

Timbucus 11th Sep 2021 3:13 pm

Re: MK14 examples sources
 
1 Attachment(s)
I will draw them together - for a start here is the 2D Life Game I love playing....

Timbucus 11th Sep 2021 3:18 pm

Re: MK14 examples sources
 
1 Attachment(s)
Here is Mr Robson's SEGTRIS converted to SBASM - It needs the full 512K memory

Attachment 241080

Timbucus 11th Sep 2021 3:25 pm

Re: MK14 examples sources
 
1 Attachment(s)
For those with full 1.5K memory expansion - PicoBASIC is a great thing to play with - again converted from Mr Robson's source - the original magazine scan was too big for the archive - except the front cover on which it features - yes an MK14 program - so I include a capture of the relevant retyped pages from Mr Robson's now defunct website.

Timbucus 11th Sep 2021 4:04 pm

Re: MK14 examples sources
 
1 Attachment(s)
This is Karen Orton's 2007 Babbage Difference Engine simulation...

Timbucus 11th Sep 2021 4:11 pm

Re: MK14 examples sources
 
1 Attachment(s)
Here is the great little Maze game mentioned in Compliment and Add, which is where the instructions are from as Computing Today May 1979 failed to include them. Note it was a Hex listing only so I disassembled and commented it. This is the one I refer to in my Adventure Video on my channel https://youtu.be/P7XvHifN78k playing this will be in my planned MK14 video when I get five minutes...

Slothie 11th Sep 2021 5:01 pm

Re: MK14 examples sources
 
Quote:

Originally Posted by Timbucus (Post 1405861)
Here is the great little Maze game mentioned in Compliment and Add, which is where the instructions are from as Computing Today May 1979 failed to include them. Note it was a Hex listing only so I disassembled and commented it. This is the one I refer to in my Adventure Video on my channel https://youtu.be/P7XvHifN78k playing this will be in my planned MK14 video when I get five minutes...

If anyone could find an Adventure for the MK14, Tim could! This actually looks quite fun. Imagine what could be done with the 1.5k expanded memory.....!

Timbucus 11th Sep 2021 6:06 pm

Re: MK14 examples sources
 
Quote:

Originally Posted by Slothie (Post 1405873)
Quote:

Originally Posted by Timbucus (Post 1405861)
Here is the great little Maze game mentioned in Compliment and Add, which is where the instructions are from as Computing Today May 1979 failed to include them. Note it was a Hex listing only so I disassembled and commented it. This is the one I refer to in my Adventure Video on my channel https://youtu.be/P7XvHifN78k playing this will be in my planned MK14 video when I get five minutes...

If anyone could find an Adventure for the MK14, Tim could! This actually looks quite fun. Imagine what could be done with the 1.5k expanded memory.....!

:) it is fun - try playing it before you study the source too closely - making a map is interesting...

Slothie 13th Sep 2021 5:13 pm

Re: MK14 examples sources
 
1 Attachment(s)
There are a few problems with the moonlander source that cause it not to load properly using the loader, I've fixed that problem but the program shows a corrupted display when run. I'll upload it here anyhow, in case someone else wants to give it a go, 2 minds are better than 1 I am told!

SiriusHardware 13th Sep 2021 6:16 pm

Re: MK14 examples sources
 
When I SBASMed Moon Landing myself I could not reconcile the assembly language code with the hex code listing, because (I think) at least one of the jump destination labels was at the wrong address - I can't remember the specific problem though.

It's long been suggested that the programs in the manual were hand coded and then written up as assembly listings afterwards, not always completely accurately.

Tim has a useful method of starting off by converting the original hex code listing to .DB statements, assembling that and seeing if that works, and then replacing the .DB statements instruction by instruction with an equivalent line of assembly language, although I imagine he only normally uses that for programs / routines for which only the hex code was ever supplied.

Slothie 13th Sep 2021 7:39 pm

Re: MK14 examples sources
 
Quote:

Originally Posted by SiriusHardware (Post 1406361)
When I SBASMed Moon Landing myself I could not reconcile the assembly language code with the hex code listing, because (I think) at least one of the jump destination labels was at the wrong address - I can't remember the specific problem though.

It's long been suggested that the programs in the manual were hand coded and then written up as assembly listings afterwards, not always completely accurately.

Tim has a useful method of starting off by converting the original hex code listing to .DB statements, assembling that and seeing if that works, and then replacing the .DB statements instruction by instruction with an equivalent line of assembly language, although I imagine he only normally uses that for programs / routines for which only the hex code was ever supplied.

I've come to that conclution too, so I was trying to ensure that the hex codes in the manual were the same as those produced by the assembler. I was assuming someone would have verified the hex was correct, I have also found a couple of places where the assembly code is wrong for the hex codes being produced.

JohnBHanson 13th Sep 2021 8:07 pm

Re: MK14 examples sources
 
1 Attachment(s)
Just to help out - I used to have a mk14 which I bought in about 1983 and
gave away to someone in portsmouth in 1996 or so.

Anyway I wrote an assmbler for it - and have attached the listings
for the programs in the manual. Actually used it to check my assembler
was generating correct code. I have attached the listing files here for reference

Slothie 13th Sep 2021 8:17 pm

Re: MK14 examples sources
 
1 Attachment(s)
Well I have had a look again and found the problems, a bad data byte and a wrong placement of a label. Here's the correct Hex and Asm files.

John - thanks for the listings, I will attempt to use them to validate my sources too.

Slothie 13th Sep 2021 8:22 pm

Re: MK14 examples sources
 
One thing I have noticed is that the programs that rely on timing all seem to assume a clock speed of 4MHz. It's almost like the MK14 was designed to run at 4MHz but someone turned up at Clives office with a suitcase full of 4.433619MHz crystals and only wanted a tenner for them....

circuitryboy 13th Sep 2021 9:07 pm

Re: MK14 examples sources
 
Exactly so. The PAL reference crystals were cheaper.

SiriusHardware 14th Sep 2021 8:00 am

Re: MK14 examples sources
 
While the assumption re: 4.43MHz crystals is true - they were used in their millions in colour TVs at one time, so very widely made and therefore cheap - I'm fairly sure programs like Digital Clock - where software timing was used for the clock to run at the right speed - and 'Music Box' - where software timing was used to produce the right note pitches - worked properly with the original 4.43MHz clock.

Of course, I could just be completely tone deaf.

SiriusHardware 14th Sep 2021 8:26 am

Re: MK14 examples sources
 
Quote:

a bad data byte and a wrong placement of a label
Wrong placement of one jump destination label would cause the relevant jump destination offset value to be different to the original one in the hex listing, so, provided that jump instruction is the only one which targets that label, those two things match up very neatly.

Slothie 14th Sep 2021 10:04 am

Re: MK14 examples sources
 
Well it seems to be working now. However, If I worked at NASA the surface of the moon would be scattered with the wreckage of lots of moon landers!

SiriusHardware 14th Sep 2021 6:57 pm

Re: MK14 examples sources
 
Moon Landing:

I usually let it freefall and accelerate until the altitude is about 540, then hit '7' and watch as the rate of descent decreases all the way down to '1', by which time the altitude is rather low. At that point, hit '5' to steady the rate of descent and coast gently down to the surface with about 1 unit of fuel remaining.

Once you know how to do this you can do it every time, so the game really needs the introduction of a random element, such as a semi-random starting altitude, to make it more of a challenge.


All times are GMT +1. The time now is 4:06 pm.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.