Výlet po paměti (A Trip Through Memory)

Type
Utility
Category
Live memory viewer using the display list
Author
Jiří Toman
Published in
Flop (Czech disk magazine for 8-bit Atari), issue 1
Year
1986
Language
Atari BASIC
Requirements
Atari XL/XE with Atari BASIC (the HELP key is used); joystick in port 1
Title page reading VYLET PO PAMETI with Czech instructions about joystick up and down, HELP and START

About the program

Výlet po paměti means "a trip through memory", and that's exactly what it is. The program doesn't PEEK and PRINT. Instead it points the screen itself at the part of memory you want to see, so every byte shows up as a character and changes as it changes. Push the joystick and the view slides through memory 256 bytes at a time, from address 0 to 65535. The REMs credit Jiří Toman (© 1986). The program appeared on the first issue of the Czech disk magazine Flop.

Czech text in the program

Czech English
Tento program Vám umožní prohlížet pomocí Joysticku celou oblast paměti This program lets you browse the whole of memory with the joystick
ORGANIZACE ZOBRAZOVÁNÍ · ADRESA 0000 … FFFF Screen layout: address 0000 … FFFF
JOY NAHORU = JDEŠ K 0000 · JOY DOLŮ = JDEŠ K FFFF Joystick up = towards 0000 · joystick down = towards FFFF
PODROBNĚJI – ZMÁČKNI HELP · JINAK STISKNI START For details press HELP · otherwise press START
JSI MIMO ROZSAH !!! · zmáčkni start You're out of range! · press START
Na obrazovku se vejdou necelé 4 bloky po 256 bytech The screen holds not quite four 256-byte blocks
…u znaků 18,19,20 vidět činnost interního časovače …at bytes 18, 19, 20 you can watch the internal clock running
Na adresách D000 až D7FF lze vidět činnost GTIA, POKEY, PIA, ANTIC At D000–D7FF you can watch GTIA, POKEY, PIA and ANTIC at work
Tento program využívá modifikaci obrazového programu DLIST This program works by modifying ANTIC's display list

Typing it in

The listing is plain ASCII with some inverse-video text (type it between presses of the Atari key). The original REMs in lines 29270–29300 contained the author's 1986 home address and telephone numbers. They have been left blank here, which doesn't affect the program.

How to use it

Press START to begin. Push the joystick up to move towards address 0 and down to move towards 65535 ($FFFF). The screen shows nearly four 256-byte pages at once. Hold the joystick button to switch to a large-text display of the start addresses of the four pages on view, and release it to go back. Moving past either end triggers the TRAP and shows "JSI MIMO ROZSAH" (out of range). Press START to begin again. HELP shows the instructions at any time.

Things the program suggests looking at:

  • Page 0, bytes 18–20: the real-time clock, ticking away. It carries on counting even after BREAK.
  • $D000–$D7FF: the GTIA, POKEY, PIA and ANTIC registers flickering.
  • Press BREAK while viewing some other area and the display stays where it is. You can type BASIC commands blind and watch their effect on memory, but they won't appear on screen, so take care.

How it works

ANTIC finds the screen through the address in the display list's first LMS instruction, at bytes 4 and 5 of the list. Line 29050 just POKEs the low byte with 0 and the high byte with the page number A, so the text screen starts at A×256. ANTIC then draws whatever bytes it finds there as characters. No copying is involved, which is why the clock and hardware registers appear to come alive. When the button is pressed, line 29130 puts the normal screen address ($9C40) back so that ordinary printing works again. This is a lovely demonstration that on the Atari the "screen" is only a pointer.

Listing

23310 REM
28000 GRAPHICS 0:POKE 752,1:D=PEEK(560)+256*PEEK(561)+4:POKE D-1,71:POKE D+2,6
28010 ? "VYLET PO PAMETI":POSITION 23,0:?:POKE 710,0
28020 ?:?:? " Tento program Vam umozni":? " prohlizet pomoci Joysticku":? " celou oblast pameti."
28030 ?:? " {inv}ORGANIZACE ZOBRAZOVANI{/inv}"
28040 ?:? " ADRESA 0000":? " ....":? " ....":? " FFFF"
28050 ?:? " {inv}JOY NAHORU=JDES K 0000{/inv}":? " {inv}JOY DOLU  =JDES K FFFF{/inv}"
28060 ?:? " PODROBNEJI-ZMACKNI HELP":?:?:? " {inv}JINAK STISKNI START{/inv}"
28070 POKE 752,1:POKE 764,255:POKE 53279,7:POKE 732,0
28080 IF PEEK(53279)=6 THEN 29000
28090 IF PEEK(732)=17 THEN 30000
28100 GOTO 28080
29000 TRAP 29230
29010 GRAPHICS 0
29012 POKE 732,0
29020 A=0
29030 IF STRIG(0)=0 THEN GOSUB 29120
29037 IF PEEK(732)=17 THEN 30000
29040 DL=PEEK(560)+256*PEEK(561)
29050 POKE DL+4,0:POKE DL+5,A
29060 REM {inv}TEST PACKY JOYSTICK{/inv}
29070 TE=STICK(0)
29080 IF TE=14 THEN A=A-1
29090 IF TE=13 THEN A=A+1
29100 FOR N=1 TO 50:NEXT N
29110 GOTO 29030
29120 REM {inv}ADRESA BLOKU DAT{/inv}
29130 POKE DL+4,64:POKE DL+5,156
29140 GRAPHICS 18:COLOR 1:POSITION 7,1:? #6;256*A
29150 POSITION 7,4:? #6;256*(A+1):POSITION 7,7:? #6;256*(A+2):POSITION 7,10:? #6;256*(A+3)
29160 IF STICK(0)=14 THEN A=A-1
29170 IF STICK(0)=13 THEN A=A+1
29180 IF STRIG(0)=0 THEN GOTO 29120
29190 GRAPHICS 0
29200 RETURN
29210 STOP
29230 GRAPHICS 18:COLOR 1:? #6;" JSI MIMO ROZSAH !!!":POSITION 0,5:? #6;" {inv} * zmackni start * {/inv}"
29240 IF PEEK(53279)=6 THEN 29000
29250 GOTO 29240
29260 REM {inv} (C) 1986 Toman Jiri {/inv}
29270 REM
29280 REM
29290 REM
29300 REM
29310 REM
30000 GRAPHICS 0:REM {inv}SUB.HELP{/inv}
30010 ? "Tento program umoznuje nahlednout do":? "op.systemu ATARI 800 XL a zobrazovat"
30020 ? "znakove celou pamet 0 - 65535.":?
30030 ? "Pomoci Joysticku se lze prochazet po":? "pameti smerem k 0000 nebo FFFF(H)":?
30040 ? "{inv}Drzime-li tl.START na JOY{/inv}, objevi se":? "misto znakoveho vypisu pocatecni"
30050 ? "adresy jednotlivych bloku."
30060 ? "{inv}NA OBRAZOVKU SE VEJDOU NECELE 4 BLOKY{/inv}":? "{inv}PO 256 BYTECH.{/inv}":?
30070 ? "Vypisy adres pri drzeni START tl.":? "na JOYSTICKU jsou umisteny shruba"
30080 ? "{inv}DO STREDU jednotlivych bloku.{/inv}"
30082 POKE 752,1:?:?:?:? "** STISKNI NEKTEROU KLAVESU **"
30085 IF PEEK(764)=255 THEN 30085
30090 ?:? "{inv}VYUZITI{/inv}(napr.): "
30100 ? " Zobrazovani pametovych mist pri":? "zpustenem programu. Napr.na bloku"
30110 ? "s adr.0 je u znaku 18,19,20 videt":? "cinnost interniho casovace."
30120 ? "Ten zustava v cinnosti i po stisku":? "tlacitka BREAK."
30130 ? "Stiskem BREAK lze zastavit na":? "kteremkoli miste pameti a z klaves-"
30140 ? "nice zadavat Basicove prikazy."
30150 ? "Ty se nam samozrejme neobjevuji na":? "obrazovce a proto je treba pri mani-"
30160 ? "pulaci davat pozor."
30170 ? "Napr.na adresach D000 az D7FF lze":? "videt cinnost GTIA,POKEY,PIA,ANTIC."
30180 ? "Na vypisu lze i pozorovat cinnost":? "mapovaciho systemu ATARI 800 XL."
30190 ? "{inv} TENTO PROGRAM VYUZIVA MODIFIKACI   {/inv}":? "{inv}OBRAZOVEHO PROGRAMU DLIST OBRAZOVEHO{/inv}":? "{inv}PROCESORU ANTIC.    {/inv}"
30195 ?:? "** STISKNI START NEBO HELP **"
30200 POKE 732,0:POKE 53279,7:POKE 764,255
30210 IF PEEK(732)=17 THEN 30000
30220 IF PEEK(53279)=6 THEN 29000
30230 GOTO 30210
30240 END

Credits