6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 3:15 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Mon May 02, 2011 7:17 am 
Offline

Joined: Thu Mar 31, 2011 8:09 pm
Posts: 85
According to Lee's EhBasic site, in order to run it on a 6502 SBC like the Micro UK101 I just completed, I the addresses of routines for input and output. Unfortunately I can't yet decipher 6502 machine code so the CEGMON disassembly so I can't see where the i/o routines are. I assume you have to give these addresses to the assembler when building the interpreter. Is there a convention for parameter passing for these functions that Lee's BASIC is expecting?

Also, for burning the EEPROM, I'm not sure where to put the BASIC. I guess it needs to be at the same address as the 8k Microsoft incumbent (that would be 0xA000), but it's a guess.

Can anyone offer some clues?

Thanks

JonB


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 02, 2011 8:28 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
The vectors are normally found near the top of memory, and so it is in this case: you want
FFEB INVEC
FFEE OUTVEC
and the calling convention is to pass the parameter/result in A.
(With high degree of confidence, but not certainty)

As for the base address, just be sure that EhBASIC doesn't overrun the monitor at F800 and you should be OK.

Oh, and you need to be able to enter EhBASIC somehow. Cegmon has 0xBD11 burned in as the cold reset entry point (for 'C') at address 7f3a / ff3a. But I suppose you can enter using the monitor.

Cheers
Ed


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 02, 2011 10:10 am 
Offline

Joined: Thu Mar 31, 2011 8:09 pm
Posts: 85
Well, the CEGMON cold reset point is changeable as it is a vector, right? So that's fine, I can amend prior to burning the EPROM. What about warm reset vector? My intention is for it to work like the existing basic so I don't need to drop into the monitor to launch BASIC. I'm sure Lee has a ROM for the MUK101; he refers to it somewhere in my build thread.

Seems to me that I'd always want CEGMON in there for pretty well anything I want to burn on the EEPROM. But all I really need is the I/O routine, as I can't imagine why I need to use the monitor if I'd developed the actual program on an emulator (which I would).

Cheers

JonB


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat May 07, 2011 3:35 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
Why not create a micro-monitor with just simple I/O routines? Unless you plan to use CEGMON, you don't need it.

_________________
Bill


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat May 07, 2011 8:14 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
I think I want to do this too. If I get done before you Jon, I'll give you a hand of even send you my HEX file to burn. I'm going to do it without CEGMON though.

_________________
Bill


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun May 08, 2011 7:34 am 
Offline

Joined: Thu Mar 31, 2011 8:09 pm
Posts: 85
BillO wrote:
Why not create a micro-monitor with just simple I/O routines? Unless you plan to use CEGMON, you don't need it.


Indeed.. but I haven't got any 6502 experience yet (I know, it's a good start point, but this is why I bought a BBC Micro).

I would be very interested in a working binary of your finished ROM. I'm not really interested in Ceggy anyway, it's just a board for mucking about in BASIC. Although, writing a decent screen editor and patching it into the interpreter might be fun. I like the Sinclair Spectrum's approach to editing program lines (not too sure about all the tokenised keywords though)... and I think it should do syntax checking when you enter the line rather than at runtime (this'd speed it up). So, ultimately I may end up hacking EhBasic about a little anyway.


Top
 Profile  
Reply with quote  
 Post subject: NEW IDENTITY
PostPosted: Sun May 08, 2011 8:06 am 
Offline

Joined: Thu Mar 31, 2011 8:09 pm
Posts: 85
Guys, I am going to start using a new identity on 6502.org. From now on, I will be using the forum account "jonb" as it seems better than "micro_brain" (dunno why I chose that one..).

Cheers

JonB


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun May 08, 2011 8:08 am 
Offline

Joined: Sun May 08, 2011 7:39 am
Posts: 104
Here I am.. :D


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 09, 2011 1:43 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
Okay, had a chance to look at this.

Grant's decoding looks like it produces a memory map like this:

0000 - 7FFF : RAM
8000 - 9FFF : Nothing
A000 - BFFF : ROM (BASIC is here)
C000 - EFFF : Nothing
F000 - F7FF : ACIA selected many times
F800 - FFFF : ROM (CEGMON is here)

Now I remember why I modified his decoding. EhBASIC will not fit into this map because it assembles to more than 8K.

Jon, I altered Grant's decoding considerably. It's not more complicated but just works better. My decoding fills in those holes with ROM. The original ROM still works, but it gives you a whole lot more room for other things. It looks like this:

0000 - 7FFF : RAM
8000 - EFFF : ROM
F000 - F7FF : Eight 256 byte I/O blocks (ACIA is at F000 + F001)
F800 - FFFF : ROM

I can send you the revised decoding logic, but it will require you to make some substantial changes to your board wiring, or build a second board. Let me know if you are interested in doing that, but I can't fit EhBASIC into the original micro-UK101.

_________________
Bill


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 09, 2011 6:05 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
Okay, I had a few more minutes and ...

Wrote the code to initialize the 6850 and the basic I/O routines.
Edited these into Lee's mini_mon.asm
Changed basic.asm to put EhBASIC at $8000
Assembled it in Michal Kowalski's emulator
Burned into a 27C256
And now ...

I have EhBasic running on my board! Works well too. Thanks for writing this interpreter Lee.

_________________
Bill


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 09, 2011 7:43 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
Jon,

I have figured out a way to get your board to run either ROM just by adding 1 chip and only making minor wiring changes.

You’ll need a 74LS30 (8 input nand gate) added to the board. Connect pin 7 to ground and pin 14 to VCC.

These changes are assuming you wired things exactly as Grant instructed.

1) Disconnect pins 12 and 13 of the 74LS00 from pins 12 and 13 of the 74LS138
2) Disconnect pin 11 of the 74LS00 from pin 12 of the 74LS02.
3) Connect pin 7 of the 74LS30 to ground and pins 12 and 14 to VCC.
4) Connect pins 9 thru 15 of the 74LS138 to pins 1 thru 6 and pin 11 of the 74LS30, order is not important.
5) Connect pin 8 of the 74LS30 to pin 12 of the 74LS02

Test this with the UK101 ROM. It should work fine.

This will make the memory map like mine except the I/O select block.

PM me with an e-mail address and I will send you the EhBASIC BIN file and the modified source files

_________________
Bill


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 10, 2011 11:28 am 
Offline

Joined: Sun May 08, 2011 7:39 am
Posts: 104
Ahh, this could be fun... PM sent!

Hmm, to be fair, the ACIA should occupy only what it needs and not be copied over a range. I realise this means more decoding logic, but it's better to have more space for ROM. Could you send me your new glue schematic as well, please? I may redo this board if it looks straightforward enough.

Thanks

JonB


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: