The 8051 and Z80 fill similar roles today --- when even the cheapest ARM core is too expensive.
The 8051 and Z80 fill similar roles today --- when even the cheapest ARM core is too expensive.
Not knocking JSON. Just thinking it wouldn’t be the right thing for this situation.
After trying several other solutions I ended up with JSON over USB serial.
I tried several of the binary JSON-like variants, but they were all a PITA to port or ended up eating a lot of space, either in RAM or Flash or both. For this project I wasn't too concerned about message size or performance as such, as long as it could be read or generated in small portions.
I ended up adapting two JSON libraries, a one for parsing and for generating. The parser was SAX-like, so worked just fine for incremental parsing. Worked quite well, in total considerably smaller both in RAM and Flash than the alternatives.
A custom binary protocol would certainly be smaller but would take a lot more time to develop and debug.
Seriously though, it's been a while since I've had to work with assembly or IDA but JSON is great as an interoperable data format. Sure, it's not maximally efficient, but what needs to be?
I'm guessing most things written for a 6502
Until it does, like with limited hardware.
As it happens, I'm coding on the 6502 for fun (demo maker :-)). And of course, I want to build my own super coll tools to help my development. However, I always come to the same conclusion : developping tools makes sense only if other people will use it (ie the effort I put in that must be amortized).
Now, if you say the 6502 is still a thing, then I may have some incentive to complete these tools...
This is a bit of a reach.
There is no world in which these and JSON appropriately intersect. If you’re parsing json then you’re probably dealing with enough need for sanitization that you have already fucked up if you’re at the point of an 8 bit MCU — how did the json get there in the first place?
The 6502 used to be a General purpose CPU, so for some retro hacking stuff that may be different.