6502cloud

Bringing the 80's to the cloud

Have you ever wanted to process your data in 6502 assembly? Well now you can.

Memory layout

  • The memory consists of 64k, 0x0000 - 0xFFFF
  • All 64k will be initialized to 0x00.
  • Zero page lies between 0x0000 and 0x00FF
  • The stack lies between 0x0100 and 0x01FF
  • Kernel routines start at FF00, but the memory is still available for use as data. You can't use it for your own subroutines.

Storage

  • All data stored will expire after 24 hours.
  • Data is stored in 4k chunks.

Kernel

The kernel 'lives' in the $FF00-$FFFD block. The kernel is a virtual kernel, as in the code that gets executed is not actually stored in memory. The memory locations of the routines are intercepted by the emulator, and call native routines. This means that you can use the memory area for storage. If you try to use it to store subroutines, they will probably fail when you call them.

Kernel costs

The kernel routines are of zero cycle cost. When counting cycles, you only need to count the cost of the JSR to the routine itself, and a matching RTS.

Kernel APIs

$FF00 - Save memory block

  • Input: A register: The memory block to store. Memory is stored in 4k chucks. The high byte of the memory chuck to store will be passed in the A register. Note that you can only request $00-$F0
  • Output: A register: 'A' will contain $00 on success, $01 on a bad request (Requested data chuck out of range), $02 on storage error.
  • Output: 0x0080: Conatins an ASCII encoded, zero terminated UUID that can be used to retrieve the data.

$FF02 - Get memory block

  • Input: A register: Where to store the memory block. Memory is stored in 4k chucks. The high byte of the memory chuck to store will be passed in the A register. Note that you can only request $00-$F0
  • Input: 0x0080: Conatins an ASCII encoded, zero terminated UUID of that data to retrieve
  • Output: A register: 'A' will contain $00 on success, $01 on a bad request (Requested data chuck out of range), $02 on storage error.

$FF04 - Delete block

  • Input: 0x0080: Conatins an ASCII encoded, zero terminated UUID of that data to delete
  • Output: A register: 'A' will contain $00 on success, $01 on a bad request (Requested data chuck out of range), $02 on storage error.