www.retrosoftware.co.uk
http://www.retrosoftware.co.uk/forum/

Patch for CMOS opcodes
http://www.retrosoftware.co.uk/forum/viewtopic.php?f=17&t=386
Page 1 of 1

Author:  KevinB [ Wed Dec 02, 2009 5:57 pm ]
Post subject:  Patch for CMOS opcodes

Okay, I've patched BeebAsm to do all the CMOS opcodes, as I needed them, and was getting bored of doing "EQUB PHX". Includes the usual aliases (CLR/STZ and DEA/DEC A). Other adjustments:

* CPU <n> directive (same syntax MASM from the 6502 Development Package) - default of 0 disallows extra instructions, 1 allows them.

* EQUD added.

* Make SKIP print the PC, so I can see where my variables are. (Alternative would be to make labels print the PC to their left, but I like having labels outdented). Should SKIPTO do the same? Not sure.

What should I do with this patch? Just post it here? What form would be most convenient? Context diff, complete modified 1.03 src files?

Also looking at a patch to add ELIF, to avoid my ENDIF:ENDIF:ENDIF chains. ELIF is more appropriate than ELSEIF, as COMAL, BBC BASIC's spiritual ancestor, uses ELIF, and obviously it's easier for a parser/tokeniser.

(The usual advice for BASIC programmers is to use CASE TRUE OF, but that's always felt a bit too weird to me, and not relevant here. Hmm, I probably should have taken opportunity to add ELIF to BBC BASIC while I worked at Acorn/Pace/Tematic/Castle).

Author:  RichTW [ Wed Dec 02, 2009 6:19 pm ]
Post subject:  Re: Patch for CMOS opcodes

'zat you Mr Bracey? :)

Think we had contact yonks ago about a Sega Master System emulator I wrote for RISC OS...

Good work! I never got round to adding the 65C12 opcodes as I didn't need them myself! Yeah, lazy, I know... Are they all implemented, including the unindexed indirect modes? (and strange stuff like TRB/TSB?)

If it all seems to work well, then why not upload it to the wiki yourself, and modify the BeebAsm page as appropriate :) There's no merging to be done my side, as I haven't made any further changes since 1.03. One day I'll add these label scope promoting things we were talking about a while ago.

Perhaps the future for BeebAsm is to create an SVN repository for it on Google Code, or somewhere like that, so that it can be developed / merged easily. Any thoughts?

Author:  KevinB [ Wed Dec 02, 2009 7:50 pm ]
Post subject:  Re: Patch for CMOS opcodes

Oui, c'est moi. (That was a French accent, wasn't it?)

I certainly know your name, but afraid I don't quite recall the details of the Sega emulator contact. Hmm, was it something to do with you providing it for one of our embedded Network Computer-type things? Rings a bell.

Yes, it's a complete implementation of the universal CMOS set (but not the Rockwell oddities). Seemed pointless to do half a job. Basically it's what I think BBC BASIC IV provides. Thought for a few seconds about going to 65816 for the benefit of Mr Kortink's copro, then saw sense.

That includes the extra modes - I've got some minor use for the zero page unindexed indirect, and I've got a major use for the pre-indexed indirect jump.

TSB/TRB aren't that weird, apart from the stupid mnemonics. We already know you "Clear" bits from CLI etc, not "Reset" them. And why "Test" - the existing test opcode is "BIT". It's a cut-down BIT followed by a set/clear of the same bits. So surely the opcodes should have been something like BIS and BIC? Or maybe BTS and BTC, if you think BIT is short for "BIt Test". Yes, that's probably better.

Anyway, they're useful enough just to set and clear flags. Test a flag with BIT m:BMI, set it with LDA #&80:TSB m and clear it with LDA #&80:TRB m. Two bytes and 1 cycle less than LDA/ORA/STA, even before you try to get clever with the flag behaviour.

My needs are quite heavy-weight - ROM, Tube, on-the-fly code copying, multiple build variants, lots of conditional compilation. And I'm cursing at the lack of macros. Part of me just wonders where I can get a copy of the 6502 Development Package to use MASM...

But BeebAsm is pretty neat, and being able to go to straight to disk image is handy for quick emulator turnaround. (Single-stepping in an emulator really spoils you).

I've just got ELIF working to my satisfaction. I'll put something up shortly. I wasn't aware this was such a hippy free-for-all in the code management area. Guess it's not that high traffic. :lol:

Author:  Samwise [ Wed Dec 02, 2009 9:15 pm ]
Post subject:  Re: Patch for CMOS opcodes

RichTW wrote:
Perhaps the future for BeebAsm is to create an SVN repository for it on Google Code, or somewhere like that, so that it can be developed / merged easily. Any thoughts?

Yep, that's already been asked for - watch this space ... ;)

Sam.

Author:  KevinB [ Wed Dec 02, 2009 10:39 pm ]
Post subject:  Re: Patch for CMOS opcodes

Okay, I've created version 1.04 and uploaded it. Enjoy...

Author:  RichTW [ Wed Dec 02, 2009 11:19 pm ]
Post subject:  Re: Patch for CMOS opcodes

Good stuff! ...and neat solution on the extra opcodes - it all works very nicely.

Re: the SMS emulator (!Miracle) - I seem to remember it was something to do with Pace acquiring rights to some of the Sega back catalogue, and you wanting to incorporate the emulator into the set top boxes, but it exploited features which only worked with 26-bit PC so it probably wouldn't have worked, and besides, my contract with Sony forbade me from such nefarious moonlighting!

Re: macros - a few people asked for them but, being interested in developing games, I tend to shun them as they hide the actual code being assembled and so you can miss vital optimisations. Do feel free to add them if you can think of a quick and simple of way of implementing them!

Probably I'll do very little more with BeebAsm now as it meets my needs perfectly - but I'm happy to see it take on a life of its own as more people add features in.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/