SANDBOX is a utility, written in ASM, to test and debug your code, experimenting and even learning how M68K processor works. It's an enviroment with tools to see Registers and RAM space. You can write your ASM-code and then run in it SANDBOX, but here, besides normal ASM-comands, you'll have extra commands, like OUT, which can show the values of registers, bytes from RAM, ROM, almost everything. You'll also be able to pause your program at any point, write text strings and even more.
Place your programs in Proj folders, any ASM-files there will be included into SANDBOX after the compilation.
When the ROM is compiled, run it in any SMD Emulator. I'd recommend you Regen, because it's closest to the hardware, with it, you could learn to write a proper code, that will be the most compatible with the real hardware. After opening SANDBOX in emulator, select any program and run it. Controls are show in the bottom status bar.
Here some notes for you to avoid confuses in the future:
Outputs constant string into console.
Examples:
out "I'm writing text in the console!" out 'Now the calculations will be done'
Outputs numeric value in the console.
You also can combine flags with "+" or "|" operators (I personally prefer +), so if you want the outputing number to be binary and trimmed, you may write: bin+trim.
Examples:
move.b #$FF,d0 ; move $FF to d0 outb d0,signed ; display it as signed number outw #$1010 ; display in default mode: unsigned hex outl #$-1000000,dec+signed ; this will display the number as signed decimal
Moves cursor to the next row.
Clears the console.
Interrupts the program, and waits until you press C-button. During this period, you can switch to alternative modes in SANDBOX, like "RAM View" or "Registers".
Warning: Don't call this command from subprogram (when bsr/jsr was launched).
Examples:
pause ; you can pause here bsr.s Subprogram pause ; you can pause here rts Subprogram: pause ; this will cause fatal error rts ; ----------------------- moveq #5,d0 Loop: delay 10 ; Cycle, not subprogram. You can delay it here! dbf d0,Loop ; ----------------------- move.w d0,-(sp) ; move d0 into the stack pause ; ERROR!!! move.w (sp)+,d0 ; get d0 from the stack pause ; correct!
Delays program for the amount of frames.
Warning: Don't call this command from subprogram.