6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Nov 05, 2024 5:51 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Good 65816 monitor?
PostPosted: Mon Jun 17, 2024 7:25 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1042
Location: near Heidelberg, Germany
I am looking for a 65816 machine language monitor with 4k size at max (given that load/save/character out/keybd in are provided by the OS). And it should be open source.

I have a 6502 monitor in 4k with some advanced features that I could take out, but I can imagine that a 65816 assembler/disassembler requires quite more space than just 6502.

My goal is to integrate it into my Micro-PET ROM, replacing the @mon I currently use but which is 6502 only.

Any suggestions?

Thanks
André

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Mon Jun 17, 2024 10:57 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1746
Location: Sacramento, CA
My SBC-3 monitor used a modified version of the SBC-2 monitor and included disassembly of 65816 code. I would not classify is as "Good", but the source is given and you can take out the parts you don't need and most likely get it under 4k. it was loosely based on the Apple 2 Monitor. It is dumb in relation to 8 bit and 16 bit immediate values, but I worked around it with 2 disassembly commands - one forced 8 bit and the other forced 16 bit.

Feel free to have a look. https://sbc.rictor.org/download/sbc3.zip ... in the SysMon folder.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Tue Jun 18, 2024 6:20 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8474
Location: Midwestern USA
fachat wrote:
I am looking for a 65816 machine language monitor with 4k size at max (given that load/save/character out/keybd in are provided by the OS). And it should be open source.

How about Supermon 816?

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Tue Jun 18, 2024 8:49 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
BigDumbDinosaur wrote:
How about Supermon 816?

Undoubtedly brilliant, unfortunately 641 bytes too heavy. Unless 4 KB isn't a strict limit.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Tue Jun 18, 2024 11:05 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1042
Location: near Heidelberg, Germany
The plan is to have it in 4k.

But with all the other extensions I'm building into the ROM I may need to re-shuffle the memory map. I'll have a look what's most needed and maybe try to strip it.

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Tue Jun 18, 2024 5:36 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8474
Location: Midwestern USA
barrym95838 wrote:
BigDumbDinosaur wrote:
How about Supermon 816?

Undoubtedly brilliant, unfortunately 641 bytes too heavy. Unless 4 KB isn't a strict limit.

If the S-record loader isn’t needed, it wouldn’t be a challenge to excise those bytes.  I haven’t test-assembled without the loader, so I can’t say for sure 641 bytes would be removed.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Tue Jun 18, 2024 6:14 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8474
Location: Midwestern USA
fachat wrote:
The plan is to have it in 4k.

But with all the other extensions I'm building into the ROM I may need to re-shuffle the memory map. I'll have a look what's most needed and maybe try to strip it.

How much ROM do you have?  When I morphed my POC V1.1 unit into V1.2 (with four TIA-232 channels and SCSI), I shuffled the memory map to increase ROM space from 8 KB to 12 KB.  That gave me more-than-ample room for the extra code needed to go with the hardware expansion, as well as to accommodate the monitor, to which I had added low-level SCSI command processing.  I retained the V1.2 memory map for V1.3, the latter which has 64KB of extended RAM, for a usable total of 112KB RAM, 12KB ROM and 2KB I/O space.

I wrote Supermon 816 with a focus on functional capabilities, with footprint a secondary consideration.  I suspect there are areas in the code that could be massaged to shrink the footprint, but I haven’t been motivated to undertake that process.  The source code is thoroughly commented, so please feel free to do some massaging if it will help.

I have attached a version that doesn’t have the S-record loader, but is otherwise identical to the version linked in my earlier post.  Removal of the loader shrinks the object code to 4,064 bytes.

Attachment:
File comment: SUPERMON 816, no S-record loader
supermon816c_no_srec.asm [171.66 KiB]
Downloaded 31 times

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Wed Jun 19, 2024 4:46 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1042
Location: near Heidelberg, Germany
BigDumbDinosaur wrote:
fachat wrote:
The plan is to have it in 4k.

But with all the other extensions I'm building into the ROM I may need to re-shuffle the memory map. I'll have a look what's most needed and maybe try to strip it.

How much ROM do you have?  When I morphed my POC V1.1 unit into V1.2 (with four TIA-232 channels and SCSI), I shuffled the memory map to increase ROM space from 8 KB to 12 KB.  That gave me more-than-ample room for the extra code needed to go with the hardware expansion, as well as to accommodate the monitor, to which I had added low-level SCSI command processing.  I retained the V1.2 memory map for V1.3, the latter which has 64KB of extended RAM, for a usable total of 112KB RAM, 12KB ROM and 2KB I/O space.

I wrote Supermon 816 with a focus on functional capabilities, with footprint a secondary consideration.  I suspect there are areas in the code that could be massaged to shrink the footprint, but I haven’t been motivated to undertake that process.  The source code is thoroughly commented, so please feel free to do some massaging if it will help.

I have attached a version that doesn’t have the S-record loader, but is otherwise identical to the version linked in my earlier post.  Removal of the loader shrinks the object code to 4,064 bytes.

Attachment:
supermon816c_no_srec.asm


I briefly looked at it - looks very nice.

I noticed some macros - which assembler does it need to build?

In the intro it says it's native mode - so if I normally run in emulation, I'll have to create a wrapper. Anything in particular to look at when exiting? Does it exit at a single location only ("X" command)?

Thanks
André

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Thu Jun 20, 2024 4:07 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8474
Location: Midwestern USA
fachat wrote:
I noticed some macros - which assembler does it need to build?

It builds in the Kowalski assembler, version 1.3.4 or later, available on Daryl’s website.  Kowalski’s macro language is straight-forward, so it shouldn’t represent much of an obstacle to building in some other assembler.  I’m gathering that you want to be able to assemble it in the xa assembler.  That shouldn’t be too difficult to achieve.

Quote:
In the intro it says it's native mode - so if I normally run in emulation, I'll have to create a wrapper.

Yes, the monitor is 100 percent native mode.  It will not run in emulation mode, unless you are prepared to do a lot of modification.

Quote:
Anything in particular to look at when exiting? Does it exit at a single location only ("X" command)?

The exit via the X command is the only exit back to the environment.  The exit uses JML to allow an exit to code in any bank, including the one in which Supermon 816 is running.

Your main concern will be what happens if running in emulation mode and a BRK instruction kicks you into the monitor.  That will not end well, since the monitor implictly expects the 816 to be in native mode when a BRK is processed.  The stack will be all wrong if BRK occurs in emulation mode.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Sun Jul 21, 2024 12:03 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1042
Location: near Heidelberg, Germany
I've been working on porting supermon816 to a Commodore PET clone using a 65816. Here's some notes / comments:

- There's an awful lot of zeropage usage. So I'll set the DP pointer to some free space (actually planning to use page 1, and use the lower half of the stack space for the about 64 bytes of used zp) I found that moving some of those out of zeropage increases overall length of the binary over the desired limit...
- Is clearing the "workspace" required for proper operation? Otherwise this code could be left out.
- How much variable space could potentially be combined? (maybe moot as DP can be relocated)
- I think the entry points should be separated out more: I am not sure setting the brk vector belongs into the monitor proper - maybe good for some 816 systems, but what on systems that do not behave like specified in the comment of that routine?
- vecbrkia is in the middle of the binary - so this prevents write-protecting the address space used for the monitor itself. This should probably also be left to the "outer shell" or "binding" to the host system?
- Some weird kowalski assembler syntax I had to adapt. How active is this assembler actually? Does it make sense to move to another assembler altogether?

I'll keep you posted.

Anyway, here is the repo: https://github.com/fachat/upet_supermon816

André

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
 Post subject: Re: Good 65816 monitor?
PostPosted: Sun Jul 21, 2024 12:05 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1042
Location: near Heidelberg, Germany
P.S.: it would be interesting (for me) to have a Jump or Go instruction that jumps to the code in emulation mode.
P.P.S.: terminal control codes could be expected from an "outer" shell as defined macros, to adapt to potentially differenty host systems (edit)

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


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: