shakedown.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community for live music fans with roots in the jam scene. Shakedown Social is run by a team of volunteers (led by @clifff and @sethadam1) and funded by donations.

Administered by:

Server stats:

269
active users

#mos6502

0 posts0 participants0 posts today
Replied in thread

@jbqueru @gumnos @mms Well, it has a PC of course, which is technically an "address register" 😏 not a general-purpose one though.

Instructions are simple 8bit values (operation and mode combined to one opcode) and regarding which modes are available for which operation, I'd say you get quickly used to it. It's (partially) related to the purposes of the registers. None is really "general purpose", only A comes close, but yep, it can't do one thing X and Y can do: count.

#mos6502 coders use the "#zeropage" in a way you'd otherwise use additional registers, which makes a lot of sense. The clocks for RAM and CPU are the same, RAM accesses need few clock cycles, and for the zeropage even fewer. There you can have your "address registers", 16 bits stored in little-endian.

The first stage of my CPC ZERO build - a hypothetical 6502 based Amstrad CPC taking inspiration from the prototype 6502 board and the final Z80 based CPC464.

I'm using period appropriate hardware, wire wrapping the build, and solving design challenges the way they had to in the eighties.

In this zero-th part I state my design goals, choose a build method and build out the CPU and ROM.

bread80.com/2024/11/01/cpc-zer

bread80.comCPC ZERO Part 0: Intro, CPU and ROM – Bread80.com

Attempting a rewrite of my 8-bit multi-platform, multi-ISA, assembler's instruction parser. #v80 uses a static tree for mapping instructions into opcodes (2nd image) which is very fast and efficient but hairy to write.

The new approach (1st image), uses an alphabetical list of instructions with a byte to state how many chars of the previous entry are re-used since alphabetically, the left-most chars repeat the most.

There's no guarantee this will even save space (#Z80 ISA is currently 4KB, #MOS6502 is about 1.7KB) and it will likely be slower as more lines will need to be skipped vs. a char-by-char branching approach, but it may help for very large ISAs, the size of which can balloon drastically with lots of shared prefixes, something I'm worried about with adding #eZ80 support. The alternative is adding 'macro' characters for shared-prefixes, but that bloats the native code that needs to be ported between architectures.

In many of the early RPGs like D&D and the computer RPGs that followed in its mould, magic spells had to be prepared before hand because once cast they were immediately forgotten. I feel like this is how the compare instruction works on the 6502 & Z80. Nothing, absolutely nothing, can permanently commit to memory the knowledge of which way the carry-flag goes when you want to do <= / >= / < / >

#mos6502#z80#asm
Continued thread

#v80 is uniquely architected as an assembler in that ISAs are easily swapped and ported. A static data table maps instructions to opcodes which can be re-used as-is on other architectures. Less than 128 bytes of code are unique to supporting the #Z80 ISA, just 20 bytes for #MOS6502

I don't know how many of you out there regularly write both #Z80 and #MOS6502 and have to juggle the two different syntaxes; my multi-platform, multi-ISA assembler #v80 uses a custom syntax designed for parsing speed and simplicity, and in some way unifies instruction syntax between Zilog & MOS ISAs.

v80’s syntax, for example uses "*" for a memory dereference, so that `ld.HL* $nnnn` = Zilog `ld HL, [$nnnn]` (v80 can use optional brackets for clearer intent here) and because instructions can't be split between parameters, `ld*$.HL $nnnn` is used for `ld [$nnnn], HL`.

For 6502 syntax I'm wondering what the best choice is, either `adc*$.x $nnnn` for MOS `adc $nnnn, x` or should I go with `adc.x* $nnnn` for something simpler but not as consistent with Z80 syntax?

Just a sampling of the #hashtags I used and followed during the past year...

** Current Tech
- #SwiftUI
+ #Arduino

** #RetroComputing
- #AppleII
+ #pdp10 #tops20
+ #8bit #z80 #mos6502

** #RetroGaming
- #TextAdventure
- #InteractiveFiction
- #Zork
+ #Inform7

** Miscellany
- #WrexhamAFC
- #GenX
- #GenerationJones
+ #Jewish
+ #Hanukkah
+ #Mazeldon
+ #Secondhand
+ #Thrifting

If you're not following hashtags or including them in your posts, you're really missing out on the best part of Mastodon!

How about an open source card for your Apple II that can give you VGA output or emulate a fast Z80 AppleCard CP/M card. Really awesome work and hats off to David Kuder, the creator behind the card. Great demonstration of all the capabilities by Adrian of Adrian's Digital Basement too. If either of them are on the fediverse I'd love to follow them. #RetroComputing #Apple2Forever #Apple2 #RetroHardware #mos6502 #z80 #cpm #OpenSource
Add VGA and a fast Z80 CPU to your Apple II with this open source project