Running a simple BASIC script on a 6502 Emulator
This runs collatz2.bas piped into the command line, an image is written for each 64 write accesses to memory.
r6502, commit ec1e36780a6ba5b2967694115fc3607fe3c64c20
Script, piped/redirected to r6502:
POKE 256*120-127-4-256*5 ,255
POKE 256*120-127+4-256*5 ,255
POKE 256*120-127-2*256 ,255
POKE 256*120-127-1*256 ,255
POKE 256*120-127 +256*3 ,255
POKE 256*120-127-1 +256*3 ,255
POKE 256*120-127-2 +256*3 ,255
POKE 256*120-127-3-256 +256*3 ,255
POKE 256*120-127+3-256 +256*3 ,255
POKE 256*120-127+2 +256*3 ,255
POKE 256*120-127+1 +256*3 ,255
1 GOTO 100
5 INPUT "N=", N
10 IF (N MOD 2=0) THEN M=N/2
20 IF (N MOD 2=1) THEN M=3*N+1
30 IF (N=1) THEN GOTO 90
40 N=M
50 PRINT N
60 GOTO 10
90 RETURN
100 GOSUB 5
REM the line after RUN, is what INPUT will read
RUN
27
REM opcode 0x02 is JAM
RUN
15
POKE 11111,2
CALL 11111