It is currently Mon Oct 20, 2014 5:48 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Fri Mar 19, 2010 12:13 am 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
Another general question. On a beeb, I assume Exmon II is weapon of choice ... but is there a decent 6502 disassembler for beeb machine code which people use on PCs? I have access to Windows/Linux.

I was thinking something along the lines of 65Dis for PC.

Sam.


Top
 
PostPosted: Fri Mar 19, 2010 10:46 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Actually Sam, for a Beeb, I would thoroughly recommend the Ismec Monitor I documented on the wiki as it is 'OS aware' and converts OS calls and OS memory regions to their documented names. Even when you decide on a PC disassembler, Ismec can therfore be a good cross-reference tool.


Top
 
PostPosted: Sat Mar 20, 2010 3:34 pm 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
Hi, Martin.

Yep, on a beeb my toolbox is made up of Exmon II, Ismec Monitor and Toolkit+.

I just thought that one of the many 6502 disassemblers out there for PCs might have been beeb-aware. Apparently not, though from the current responses!

Maybe one for the wish list pile. A BeebDisASM, if you will. ;)

I do find monitor's ability to hex edit the memory very handy! Wish I'd had a copy of it in years past ...

Sam.


Top
 
PostPosted: Sat Mar 20, 2010 4:10 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Ooh - Have a look at this. Although written with the Atari in mind, it has all the system equates etc in a .equ file and I think we could easily create a Beeb one? It comes for example with an Atari file, a 5200 file and an Oric file so I'm guessing it's pretty flexible. I've only had a cursory look but perhaps worth investigating?


Top
 
PostPosted: Sat Mar 20, 2010 4:30 pm 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
I have found that ... and this C64 one, and reading their web pages was what prompted me to ask the question.

Unfortunately, modifying even a data file is somewhat beyond my meagre 6502 skills atm. If it's a matter of laboriously converting some list in the back of a beeb reference manual into a format that the atari disassembler can use, I'd be happy (assuming people think there's a benefit to it) to try doing the dull work - if someone can create basic step-by-step instructions simple enough to get me started.

Sam.


Top
 
PostPosted: Sat Mar 20, 2010 7:23 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
I've got the Atari one working quite well with only a few quick config shortcuts and yes, the bulk of the job will just be defining a list of Beeb OS addresses. You can write out a text file of the labelled disassembly output for processing off-line in any editor so at first look could be a reasonable tool given the absence of a bespoke Beeb one. I'll have a better play and post some details later assuming there's no hidden showstoppers.


Top
 
PostPosted: Sun Mar 21, 2010 2:06 am 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
There are versions 2.1 and 2.2 in the sourceforge download area but 2.2 doesn't seem to want to run under XP so I went straight for the default download of which 2.0 works fine. However, even 2.0 complained that MSVCRTD.DLL was missing so I had to copy this across from BeebEm into my dis6502 folder. (There's no installation as such, just unzip to a folder of your choice.) I’ve quickly modified the ‘atari.equ’ equates file and basically removed all the Atari stuff, left a comment header with some example statements and added a few Beeb OS equates.

Run the exe, select ‘Open Raw File’ and steer to a Beeb file. When it’s loaded you will be asked for an address which is the Load address for the Beeb file. As an example I’ve used the Commstar rom and therefore entered $8000. Next, under ‘Options’ > ‘Assembler Format’ I changed the hex ‘$’ to ‘&’ (I prefer $ but most Beeb stuff uses the & so I’m just following suit) and I unchecked ‘Include Files Allowed’ but that’s just a preference to prevent the output being split into many files if required for re-assembly. Then, in the lower left hex dump display I selected some groups of rom header bytes that I knew were text or just data bytes and using the right-click options set them to string or bytes as required. Finally, I used ‘File’ > ‘Save Disassembly Listing’ and saved the output adding the .txt extension in the filename box.

In the attached zip there is the Commstar disassembly and the modified atari.equ file which should be used to replace the supplied one. Note that the example output file isn’t very Beeb bespoke since I’ve only got a handful of OS calls in the equate file thus far.

Therefore, all that needs to be done is to expand the atari.equ file with as many of the OS routines as possible and with as many of the hardware addresses as possible. You can also create a User equates file and load it separately which could be used for things like BASIC routines and locations but for games it’s probably only sensible to have the OS calls, the OS memory stores and the hardware addresses. Maybe someone (Rich, Tom, Steve etc.) has these already in a text file for use in their assembler such that it could be pretty much pasted in to the atari.equ file? Might need to change things like EQU to ‘=’ but pretty straightforward I would think.

Anyway, have a play and see what you think – no big deal if you don’t fancy it but I’ve already used it once tonight on a spin-off task and it was just what I needed.


Attachments:
equ file and example output.zip [14.77 KiB]
Downloaded 18 times
Top
 
PostPosted: Sun Mar 21, 2010 3:47 pm 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
MartinB wrote:
There are versions 2.1 and 2.2 in the sourceforge download area but 2.2 doesn't seem to want to run under XP so I went straight for the default download of which 2.0 works fine. However, even 2.0 complained that MSVCRTD.DLL was missing so I had to copy this across from BeebEm into my dis6502 folder.

Yeah, that's because they're distributing a debug build of the executable instead of generating a release build (which wouldn't require that DLL).

MartinB wrote:
In the attached zip there is the Commstar disassembly and the modified atari.equ file which should be used to replace the supplied one. Note that the example output file isn’t very Beeb bespoke since I’ve only got a handful of OS calls in the equate file thus far.

Therefore, all that needs to be done is to expand the atari.equ file with as many of the OS routines as possible and with as many of the hardware addresses as possible.

Ah-hah, that's the dull work I thought I could do. OK, so the question is - where's the most definitive list of OS routines? I believe there are undocumented ones and such which should probably be included, that I wouldn't find in the official Acorn manuals?

MartinB wrote:
You can also create a User equates file and load it separately which could be used for things like BASIC routines and locations but for games it’s probably only sensible to have the OS calls, the OS memory stores and the hardware addresses.

Hmm ... I assume that's because you mean that games/complex apps wouldn't make use of the standard BASIC routines. Assuming it's just more that would be added to the list, though, wouldn't we just include them anyway, even if they weren't used? Why separate them into another list?

MartinB wrote:
Maybe someone (Rich, Tom, Steve etc.) has these already in a text file for use in their assembler such that it could be pretty much pasted in to the atari.equ file? Might need to change things like EQU to ‘=’ but pretty straightforward I would think.

OK, let's give it a few days and see if anyone has the list already ... otherwise, I don't mind typing them up.

MartinB wrote:
Anyway, have a play and see what you think – no big deal if you don’t fancy it but I’ve already used it once tonight on a spin-off task and it was just what I needed.

Exactly. I just thought a PC-based one might prove to be a bit easier to read ... maybe even then load into a text editor like Notepad++ and come up with a colour code for syntax highlighting ...

Sam.


Top
 
PostPosted: Sun Mar 21, 2010 4:55 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Sam wrote:
Hmm ... I assume that's because you mean that games/complex apps wouldn't make use of the standard BASIC routines. Assuming it's just more that would be added to the list, though, wouldn't we just include them anyway, even if they weren't used? Why separate them into another list?
The problem with BASIC is that it's mapped into $8000-$BFFF as with all other sideways roms and the disassembler wouldn't be able to differentiate between roms. For example, if I had a BASIC list in the equ file when I did the Commstar rom there could have been lots of erroneously mapped label substitutions. You would only load a list including BASIC if you were sure that this was the mapped rom in use for the code being being disassembled.

I have a good book which documents all the OS1.2 memory usage (zero page and the low pages etc.) and I'm more than happy to chip in with those. As you say, we'll wait to see if anyone has some pre-prepared list for all the official calls and the hardware I/O stuff.


Top
 
PostPosted: Sat Jul 31, 2010 8:16 pm 
Offline
 Profile

Joined: Sat Aug 22, 2009 7:45 pm
Posts: 34
Samwise wrote:
is there a decent 6502 disassembler for beeb machine code which people use on PCs?

I tend to use Mon65 and MkSrc65 (http://mdfs.net/Software/Assembler/DisAssem/) which, being BBC BASIC, run on BBC, RISC OS, DOS, Unix, Windows, ZX Spectrum, NC100, Unix......


Top
 
PostPosted: Sun Aug 01, 2010 10:25 am 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
Thanks for the tip, JGH. I somehow got past the disassembly stage in my current project, but I'll remember to take a look at those next time.

Will be interesting to compare with Ismec Monitor ...

Sam.


Top
 
PostPosted: Sun Sep 05, 2010 10:52 pm 
Offline
 Profile

Joined: Sat Sep 04, 2010 5:28 pm
Posts: 92
The last time I needed this I used dis6502, it's a bit clunky and Atari-ish, but with a bit of effort you can set up the MOS addresses.

If you're using RISC OS, I have a copy of 6502dis, written in ARM assembler, which I wrote one bored Sunday afternoon, many years ago, followed by some tuning from Ian Jeffray to WIMPise it. We were going to release it as part of an commercial ARM assembler/debugger package, but ended up not finishing either product. (I have the source code too.)


Top
 
PostPosted: Mon Oct 25, 2010 3:39 pm 
Offline
 Profile

Joined: Sat Sep 04, 2010 5:28 pm
Posts: 92
If anybody uses 6502dis, the attached .equ files contains some of the Acorn OS routines and vectors. I expand it when I need to, but it may be useful for somebody else.

To use, load them as "user equates".


Attachments:
acorn.zip [482 Bytes]
Downloaded 9 times
Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 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:  
cron