“PET-Globe” Demo
An avidly spinning globe for the Commodore PET — and some bit-vectors.
(Posts tagged “6502“. All posts. RSS feed: Subscribe.)
An avidly spinning globe for the Commodore PET — and some bit-vectors.
Well, another one…
(Foreshadowing not totally out of question, but also not guaranteed. I mean, the year isn’t even a day old! :-) )
WDC and Rockwell related additions to the 6502 instruction set sheet.
Just added Western Design Center (WDC) and Rockwell extensions to the standard instruction set of the 6502 processor to the well-received 6502 Instruction Set page.
There’s now an additional view option for the instruction table, as well as new sections providing details on WDC 65C02(S) specifics and Rockwell extensions (linked at the top of the page) for their respective variants of the venerable 6502. Moreover, in order to avoid confusion, the section on “illegal” opcodes is now marked as specific to the original NMOS version.
While WDC’s 65C02 is really the only version of the 6502 still in production, the fact that WDC-datasheets are neither the clearest, nor the most complete, may have contributed to a relative obscurity of the additional instructions and behavioral differences. Maybe, including them in a one-stop documentation will help, just a bit? Or even eight? ;-)
Also, as a minor improvement, the page should be now easier to tab through (lots of tabinidces).
A new game for the Commodore PET, also, how to detect keyboards on a Commodore PET.
Rumors that I am might be writing a game (or is it a playable joke?) are not entirey unfounded. Also, another (maybe helpful) note on PET keybords and how to detect them.
A visual tour.
So a few words on the debugger for the PET 2001 emulator: this is meant to help you around with 6502 machine code on the virtual PET, both for exploring existing software and testing your own code.
Be my guest on a visual tour…
Adventures in MS BASIC (Commodore PET edition).
As it happens, I recently added a debugger to the PET 2001 emulator, with the expressed purpose of facilitating code reverse engineering. To celebrate this, we’ll risk a glimpse into a peculiar bug — or is it a feature? — of the BASIC flavor found on Commodore’s PET computers. Particularly, it’s about BASIC bailing out into a warm start, whenever an empty string is entered by just pressing RETURN on the INPUT prompt.
New 6502 emulator feature: Instruction preview with resolved operands.
A new feature for the 6502 emulator: Now, there’s an instant preview for the effects of the next instruction to be executed, with effective values and operands resolved.
E.g., given the following memory and register content,
$2004: $88 $0044: $04 ;<$2004 $0045: $20 ;>$2004 X: $04
the emulator will show the following preview for the instruction `A1 40
` or “LDA ($40,X)
”:
A ⇐ $88
resolving the X-indexed addressing and showing the effective value, which will be assigned to the A
register (accumulator).
Or, for an ASL
instruction, it may show this (depending on the content of A
):
A ⇐ C < |10001000| < 0
And, for the instruction `CE 04 20
` or “DEC $2004
”, it may show:
[2004] ⇐ $88 - 1
Thanks to this preview of the effective values, which will be actually used, complex behavior may be followed more easily and common errors, like forgetting “#
” to mark up immediate operands in the assembler (and using zeropage mode instead — the dreaded “LDX $00
”), should become pretty obvious.
(I’m not aware, whether there is prior art for this idea or not.)
And, by popular demand, there is now a “RST” button, sending a RESET signal to the emulator.
☛ Try the 6502 emulator.
A few new features for the 6502 online disassembler.
Another update to the “virtual 6502” disassembler, which has obtained a few new features regarding symbol tables:
+1
” address (optionally). This may be useful with any code setting up pointers, etc, where only the low-address is declared as a symbol (as is often the case with zero-page system addresses.)Object code (start address 0x0800): A9 01 85 B8 A9 40 85 B9 Symbol table: SETPTR = $0800 POINTER = $B8 Disassembly: * = $0800 0800 A9 01 SETPTR LDA #$01 0802 85 B8 STA POINTER 0804 A9 40 LDA #$40 0806 85 B9 STA POINTER+1 .END
CXP0FB = $02 ;read register WSYNC = $02 w ;write access only
.DATA $2040 ;exclude a single address .DATA $2040 ... $240F ;exclude range $2040 … $240F (inclusive) .DATA $2040, $240F ;as above .DATA D1 ... D1+4 ;expressions are allowed
A comment with a binary representation of the respective byte (e.g., “;%01110101
”) will be added to any verbose output format, in order to help identifying sprites and similar patterns.
This should be a useful for drilling down on some code: just keep adding “.DATA” statements to your symbol table as you identify a data section and keep on disassembling.
(Again, such a DATA pseudo-instruction is ignored by the assembler to assure compatibility.)
Moreover, all the “virtual 6502” apps now support input and output in “&…
” hex notion to comfort those who were tragically mislead by the BBC (while MOS made it quite clear that is “$…
”). ;-)
(Seriously, I’ve really the highest respect for the BBC Micro, which was an enormous achievement.)
By this, the disassembler looks much like feature-complete.
Another major update to the venerable “Virtual 6502” emulator – assembler – disassembler suite.
I may have been a bit unresponsive over the last few days, but there is a reason for this. Namely, I invested most of my available time into another round of updates to the “Virtual 6502” suite, consisting of an emulator of the MOS 6502 MPU, an old-school assembler, and a respective disassembler. And this has been a major round of updates. Suffice to say, I think these venerable programs, which had been a bit basic and even dated by now, do now for a competent little suite of programs.
+++ Updated for an even improved version of the disassembler. (June 25, 2021) +++
A closer look at the “illegal” opcodes and undocumented instructions of the MOS 6502 MPU.
The instruction table of the MOS 6502 MPU, designed by MOS Technology and introduced in 1975 (the CMOS version, 65C02, was developed by Western Design Center) has some obvious gaps, with just 56 intructions documented in various address modes. This leaves 105 undocumented slots — and the 6502 community has been eager to fill these gaps, ever since.
Still, there’s some mystery left and there are questions unanswered, like, were at least some of them intentional (especially, since some of them are handy for block transfer, something the Z80 has dedicated instructions for) or are they all by accident, how do they behave, and why so? Here, we’ll try to come up with some answers to these questions.
Further improvements on the Virtual 6502 suite.
Never at a loss to improve and always afraid to miss out on features or correctness ;-), I added another bunch of improvements to the Virtual 6502 suite.
This time, it has been about the emulator, which received a watchdog to monitor breakpoints and other conditions (like register contents or stack underflow), and support for interrupts. Also, stack operations in conjunction to the implementation of the break flag have been improved. (Moreover, all the applications now enjoy — hopefully as much as the user — fancy UI buttons and custom dialogs. Besides looking period appropriately pretty — this is sort of a sympathetic restoration —, these also provide some extended functionallity that is essential to some of these improvements, like the dialog for editing the watchdog’s conditions.)
In addition to this, the 6502 Instruction Set Sheet now features all kind of information on “illegal” opcodes: there’s now a checkbox below the instruction table to include them in the view, a new section with details on those undocumented instructions, and two three more decoding tables showing, where these fit in, and providing deeper insight into the internal operations.
I guess, next steps will be to implement support for these illegal opcodes for the emulator, assembler, and disassembler as an option.
Improving one of the oldest 6502 tool sets on the web.
The Virtual 6502 suite maybe the oldest 6502 tool set on the web still in existence. It may be also one of the earlier ones, at least, when I was doing it, I hadn’t found another one. Reason enough, to give these venerable web pages a bit of an update treatment.
Some work for better accessibility.
It looks about the same, but much has changed behind the scenes. What started out as a pure text file is now a properly marked up document with suitable semantics. E.g, the instruction details where formerly just a run of preformatted text, but are now a definition list. Each entry has its own summary paragraph, a synopsis, a flags-table and the instruction table proper with all the address modes. All tables come with proper headers, where appropriate also with scopes for columns, rows, and even groups. Many tables have changed to definition lists and there’s additional ARIA annotation available. (Some more broad scale information has been included before, but as an addition to this, all the new bits are labeled properly to tell what these are.)
And, since you can’t beat simple things, thanks to the wonders of CSS it still looks like a simple run of text.
— *phew!* —
See the 6502 Instruction Sheet: www.masswerk.at/6502/6502_instruction_set.html.