Howto run KB9 Basic V 3.0 on Micro-KIM

Discuss problems with your Micro-KIM here

Howto run KB9 Basic V 3.0 on Micro-KIM

Postby Norbert » Mar Tue 29, 2011 11:55 pm

I am trying to run version 3 of the KB9 basic and after starting the program I get the question where memory ends. Using the 32k ram card I expect that something like $9FFF, 40959 or -24576 should be entered, but nothing I enter is accepted. Is there a manual for this version or could somebody give me a hint what is necessary to run it? Or is this version simply not runable on a KIM or must be modified before running?
Norbert
 
Posts: 17
Joined: Feb Tue 15, 2011 3:17 am

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby hanso » Mar Thu 31, 2011 2:05 pm

V3.0 is my version, not an official Microsoft version.

I took V1.0, corrected some nasty habits and simple additions after studying the nearly equivalent CBM Basic.

The patches were published in the dutch KIM User Club Magazine, I only have those sources on paper (somewhere :) )

I should dig it up and publish it! On my list to do.

Sorry, KB9 V1.0 is nearly the same.

(if you want a lok at the source of those 6502 Basic interpreters for all machines for those days including KB9 (as dumped by me), checkout pagetable.com
http://www.pagetable.com/?p=46
hanso
 
Posts: 71
Joined: Sep Sat 22, 2007 1:35 pm
Location: Weesp The Netherlands

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby uridium » Mar Sat 03, 2012 12:52 am

I have merstly the same issue. I converted the data to paper tape format, did the two loads, then ran and was asked for memory size and the system then goes into comatose state.. really not sure.

I've communicated with Norbert, hopefully he or someone will point out the (most likely) very simple mistake.

Log: http://deviate.fi/~uridium/log.txt

Ideas and constructive abuse is now solicited ! :)

Al.
--
Al Boyanich
adb -w -P "world> " -k /dev/meta/galaxy/ksyms /dev/god/brain
User avatar
uridium
 
Posts: 12
Joined: Aug Mon 01, 2011 12:21 am
Location: Sydney N.S.W, Australia

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby uridium » Aug Sun 04, 2013 12:00 pm

Okay. Got it. Should have posted here.

http://deviate.fi/~uridium/KB9LOG.TXT

Al
--
Al Boyanich
adb -w -P "world> " -k /dev/meta/galaxy/ksyms /dev/god/brain
User avatar
uridium
 
Posts: 12
Joined: Aug Mon 01, 2011 12:21 am
Location: Sydney N.S.W, Australia

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby Rich Cini » Oct Thu 03, 2013 9:49 pm

All --

I just tried the revised KB9 from the above post and I still get stuck at the "MEMORY SIZE?" prompt. No input seems to work (producing a "SYNTAX ERROR"), other than "A" which produces a credits screen (naming Wieland & Gates).

It's weird because long ago I had it working (there is even a post to this effect) but it no longer does, and I can't see why because the setup and configuration is the same. I'm using HyperTerminal @ 9600N81 and ASCII delays of 25ms character and 75ms line. I've also tried 1200 baud but BASIC seems to need 9600 to work properly.

Any idea what's going on?

Thanks!
Rich
Rich
http://www.classiccmp.org/cini/
http://www.classiccmp.org/altair32/
Rich Cini
 
Posts: 6
Joined: Mar Tue 07, 2006 12:27 pm
Location: Long Island, NY

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby maskddingo » Oct Fri 11, 2013 9:52 pm

Hmmm... That's no fun...

I was able to load the KB9 basic through minicom on linux at 1200 8N1 with a char delay of 20 and line delay of 200. That may be a bit extreem, but it worked. Whenever I am able to see the memory prompt, the rest works. I assume you are loading it at 0200 and starting it at 045E?
maskddingo
 
Posts: 15
Joined: Aug Tue 27, 2013 12:51 pm

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby Rich Cini » Oct Fri 11, 2013 10:02 pm

Thanks! I will definitely try the 12008N1 and 20/200 settings.

Are you sure about the addresses though? The PAP file shows a load location of $2000 and the instructions show a start of $405E.

Rich
Rich
http://www.classiccmp.org/cini/
http://www.classiccmp.org/altair32/
Rich Cini
 
Posts: 6
Joined: Mar Tue 07, 2006 12:27 pm
Location: Long Island, NY

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby maskddingo » Oct Sat 12, 2013 12:13 pm

The log file that is included in this thread is the one I used... I just cut the program bytes out and created a text file to upload. In the log, you can see that the user has started to load at 0200 which is what I was trying to convey, (though I don't think this really matters as it does look like the first address loaded in the file is 2000).

And yes, the start addr is 405E. It was late and that's just my dyslexia... sorry for the confusion.
maskddingo
 
Posts: 15
Joined: Aug Tue 27, 2013 12:51 pm

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby Rich Cini » Oct Sat 12, 2013 4:02 pm

Thanks <maskddingo> for the help. Ok, this time I started from scratch with the log file in this thread, and here's what I did.

I first set $17FA/FB and $17FE/FF to $1C00 for good measure. Then, I loaded the file with line settings of 12008N1 with a delay of 20/200 using HyperTerminal PE. Once it loaded, I began execution at $405E but I got nothing on-screen. So, I changed the line settings to 9600N81, hit RS, hit <ENTER>, changed to $405E, hit G<ENTER> and I got the "MEMORY SIZE?" prompt. So far, so good.

I hit <ENTER> and then got "SYNTAX ERROR". Arrrgh.

So, there's at least one anomaly in that KB9 BASIC seems to like only specific line settings. I don't know if anyone else has experienced this.
Rich
http://www.classiccmp.org/cini/
http://www.classiccmp.org/altair32/
Rich Cini
 
Posts: 6
Joined: Mar Tue 07, 2006 12:27 pm
Location: Long Island, NY

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby maskddingo » Oct Sat 12, 2013 10:09 pm

Wow this is verry interesting. Today I tried again just to make sure I wasn't leading you astray... given i fudged the menory locations in my original post. I was able to load 8k basic again today with 1200 8N1 (no hardware control) and the extreem delays i mentioned. After loading it at 1200 baud, I tried to increase to 9600, but nothing worked. I did not ty to load at 9600 from scratch tho.

Do you have the expqnded menory for the micro-kim? (I'mrunnig out of ideas)
Maybe some ram is bad? I just don't know.

I really hope you get this working.
maskddingo
 
Posts: 15
Joined: Aug Tue 27, 2013 12:51 pm

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby Rich Cini » Oct Sun 13, 2013 9:04 am

It is weird isn't it. I do have the 32k expansion and I/O board on a mini-expander. On your suggestion I pulled out the First Book of KIM memory test and tested $2000-$9FFF...alone and with the expander...and it passed. So, it's not the memory as far as I can tell. Hmmmm...

Thanks!
Rich
Rich
http://www.classiccmp.org/cini/
http://www.classiccmp.org/altair32/
Rich Cini
 
Posts: 6
Joined: Mar Tue 07, 2006 12:27 pm
Location: Long Island, NY

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby maskddingo » Oct Sun 13, 2013 6:20 pm

So this just gets better and better... This morning I went to load basic as normal (1200 baud) from my laptop, and all I got after hitting 'G' was a bunch of garbled characters. I tried to load it a few more times with the same result. Then, without reloading the program, I decided to mess with my baud rate. Tuning it up to 9600 and the kim just responded with a line of unknown characters. I then bumped it down to 4800 and this time upon running the program, I was greeted with the MEMORY SIZE? Prompt. When I hit enter, I got the exact same thing you are describing...

?SYNTAX ERROR
MEMORY SIZE?

At this point, I was at a loss. I had no idea why it had suddenly stopped working. However, I was intrigued that I was able to produce exacly what you were seeing. What I did then was put the decimal clear command D8 at F000 followed by a LDA of 00 for no particular reason. I didn't make sure there was a halt after this and I have no idea where it ran off to... However, when I ran it from F000, basic launched! I got the memory prompt and was able to progress as normal to entering a "hello world" program without error. I turned it off then, so no further testing. The remainder of the day, I have had no problems loading basic. And I've done it at least 4 times so far.

I can not begin to explain why this might have worked (aside from something having to do with decimal mode?). I can only report that it did work. I can upload the log to show it happening.
maskddingo
 
Posts: 15
Joined: Aug Tue 27, 2013 12:51 pm

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby Rich Cini » Oct Sun 13, 2013 6:36 pm

Interesting indeed! I looked at the KB9 manual and the only thing it said to do before loading was to set the vector addresses 17FA/FB, FC/FD and FE/FF to $1C00. It also says to hit <RUBOUT> rather than <ENTER> to set the baud rate.

I'm going to try this, plus CLD/BRK and see if that helps.

...later...

Ok, it now works. Here's how I did it. First, when resetting the KIM, use RUBOUT (backspace) rather than ENTER. I'm using 12008N1 but I will try faster speeds later.

Next, set all three vectors as above ($1C00). Once you do that, enter and run a small 2-byte program at $0200 to clear the decimal flag ($D8/$00). Since the vectors are set, it will BRK back to the KIM monitor.

Then, I loaded and ran BASIC per the original instructions. Once it finished initializing, it showed free memory of 24,800 bytes.

Maybe the above steps with RUBOUT and CLD are standard when working with the KIM. If they are standard, it would probably make sense to include these steps in the usage instructions somewhere even as a reminder to not-regular users of the KIM.

Thanks for the help!
Rich
http://www.classiccmp.org/cini/
http://www.classiccmp.org/altair32/
Rich Cini
 
Posts: 6
Joined: Mar Tue 07, 2006 12:27 pm
Location: Long Island, NY

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby maskddingo » Oct Sun 13, 2013 8:40 pm

Great!
I'm glad you got it working.

That's some good info. The decimal mode clear seemed to be the thing that made it start to work for me, but I did not have the vectors set.That might be why it jumped to BASIC after my CLD.

My other thought was to just put a jump to basic (4C 5E 40) at $0201 after the decimal clear.

I'll make sure to try the backspace and vectors as well when i try to increase the speed.
maskddingo
 
Posts: 15
Joined: Aug Tue 27, 2013 12:51 pm

Re: Howto run KB9 Basic V 3.0 on Micro-KIM

Postby Paul Förster » Apr Mon 28, 2014 8:20 am

Hi,

warming up an obviously old thread... :)

I can' get the modified versions 2 and 3 to work. I also can't use Hans Otten's kimpaper because I'm mostly on a Mac (sometimes Linux) and don't have Windows/DOS available. Also, I don't want to install some emulation software just for this purpose. So I wrote my own version of converting a binary to paper tape format in C, which should then be able to compile on any machine which has a C compiler. The basics are working properly already. I will post it on the forum once it's finished and polished and can do everything I want it to do.

So I converted the kb9.bin to kb9.pap and had a hard time trying to figure out what was wrong. I either received a garbled startup message or was not able to get beyond the memory size question. It was not my paper tape converter because the .pap file loaded properly. I did a lot of error checking. Also, the Micro-KIM reported no errors during loading, so checksums were ok too. No, the load was definitely fine!

It took me quite a while to figure out what was wrong. It was the NMI and IRQ vectors as well as the CPU's decimal mode. The former two need to be set (setting the RESET vector is not necessary) and the latter has to be cleared. So I added a little modification (see below) to the end of my .pap file which does exactly that and then launches Microsoft BASIC.

Here's what to do:
    - Load kb9.pap
    - 4272<space>
    - G
    - Hit CR for auto memory size (should give 24510 bytes for BASIC with 32 KB RAM module installed)
The modification is as follows:

Code: Select all
4272  d8        cld      ; Clear decimal flag
4273  a9 00     lda #$00 ; Load vector low byte
4275  8d fa 17  sta 17fa ; Set NMI low byte
4278  8d fe 17  sta 17fe ; Set IRQ low byte
427b  a9 1c     lda #$1c ; Load vector high byte
427d  8d fb 17  sta 17fb ; Set NMI high byte
4280  8d ff 17  sta 17ff ; Set IRQ hih byte
4283  4c 5e 40  jmp 405e ; Launch BASIC

And here's my session protocol. Note the last lines of the paper tape file. These contain the modification starting at address 4272, which is also the new starting address:

Code: Select all
;184268E420662465AC04A403F9D8A9008DFA178DFE17A91C8DFB170C2A
;0642808DFF174C5E400355
;0001710072 KIM

KIM
0171 02 4272
4272 D8 G
WRITTEN BY WEILAND & GATES

MEMORY SIZE?

TERMINAL WIDTH? 80

WANT SIN-COS-TAN-ATN? Y


 24510 BYTES FREE

MOS TECH 6502 BASIC V1.1
COPYRIGHT 1977 BY MICROSOFT CO.

OK
10 PRINT "Hello Micro-KIM! ";

20 GOTO 10

RUN

Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-
KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello M
icro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! He
llo Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KI
M! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Mic
ro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hell
o Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM! Hello Micro-KIM!


LIST


10 PRINT "Hello Micro-KIM! ";
20 GOTO 10
OK

Btw., ctrl-c does not work with this BASIC. I found that simply sending a break signal on the serial line (cmd-b in CoolTerm on a Mac) does the job.

Also, I played around with different serial speeds as suggested in this thread and it turned out that the serial connection speed has exactly zero impact. I tried with 1200/8N1, 2400/8N1 and 4800/8N1. Going higher would only produce garbage, not related with BASIC but generally. So I can use BASIC now at a whopping 4800/8N1, which makes it load in a minute or so (didn't exactly check).

As for the character delays, I use CoolTerm on the Mac, which seems to be the only not too costly (it's free, but I would pay $20 for a good one if it's worth it, but not the $80+ commercial versions) serial terminal software available on the Mac (no, please no "screen"! screen works fine, but it's a pain to use). I set the character delays to 1 and it works fine!

If someone want's this modified .pap file of the original V1.1, then please drop me a line. I could also attach it here if enough people would be interested.

Still, I followed all instructions and tried out a lot of things but I just can't get V2 and V3 to work. I have all the symptoms mentioned elsewhere in this thread and no remedy. :( Anyway, at least the original V1.1 now works fine now. :)

Cheers,

Paul
User avatar
Paul Förster
 
Posts: 17
Joined: Mar Wed 19, 2014 12:35 pm
Location: Switzerland


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 2 guests

cron