The content below is taken from the original (6502 Retrocomputing Goes to the Cloud), to continue reading please visit the site. Remember to respect the Author & Copyright.
In what may be the strangest retrocomputing project we’ve seen lately, you can now access a virtual 6502 via Amazon’s Lambda computing service. We don’t mean there’s a web page with a simulated CPU on it. That’s old hat. This is a web service that takes a block of memory, executes 6502 code that it finds in it, and then returns a block of memory after a BRK opcode or a time out.
You format your request as a JSON-formatted POST request, so anything that can do an HTTP post can probably access it. If you aren’t feeling like writing your own client, the main page has a form you can fill out with some sample values. Just be aware that the memory going in and out is base 64 encoded, so you aren’t going to see instantly gratifying results.
You may not be familiar with Amazon Lambda. It is the logical extension of the Amazon cloud services. Time was that you paid to have a server in a data center. The original Amazon cloud services let you spin up a virtual server that could come into existence when needed. You could also duplicate them, shut them down, and so on. However, Lambda is even one step further. You don’t have a server. You just have a service. When someone makes a request, the Amazon servers handle it. They also handle plenty of other services for other people.
There’s some amount of free service, but eventually, they start charging you for every 100 ms of execution you use. We don’t know how long the average 6502 program runs.
Is it practical? We can’t think of why, but we’ve never let that stop us from liking something before. Just to test it, we put the example code into an online base64 decoder and wound up with this:
a9 01 8d 00 02 a9 05 8d 01 02 a9 08 8d 02 02
Then we went over to an online 6502 disassembler and got:
* = C000 C000 A9 01 LDA #$01 C002 8D 00 02 STA $0200 C005 A9 05 LDA #$05 C007 8D 01 02 STA $0201 C00A A9 08 LDA #$08 C00C 8D 02 02 STA $0202 C00F .END
We then ran the 6502cloud CPU and decoded the resulting memory output to (with a bunch of trailing zeros omitted):
01 05 08 00 00 00 00 00
So for the example, at least, it seems to work.
We’ve covered giant 6502s and small 6502 systems. We have even seen that 6502 code lives inside Linux. But this is the first time we can remember seeing a disembodied CPU accessible by remote access in the cloud.
Filed under: internet hacks, Microcontrollers