Random demo
Random demo
Random game
source: Hexer Hexer Hexer Hexer
Listing 1
10 REM HEXER
20 REM (c) ATARI USER
30 REM
40 GRAPHICS 0
50 DIM A$(10),NUMB$(10)
60 OPEN #1,4,0,"K:"
100 ? :? "You may:-":?
110 ? "1. Enter code"
120 ? "2. Examine code"
130 ? "3. Alter code"
140 ? "4. Run code"
150 ? "5. End program"
160 ?
170 GET #1,A
180 IF A<ASC("1") OR A>ASC("5") THEN GOTO 170
190 ? CHR$(A):A=A-48:DFLAG=0
200 ON A GOSUB 300,400,600,800,220
210 GOTO 100
220 CLOSE #1:END
300 ? "Start Addres";
310 INPUT A$
320 GOSUB 1000:START=RES
330 PRINT "byte ";:INPUT NUMB$
340 IF NUMB$="S" OR NUMB$="" OR LEN(NUMB$)>2 THEN ? "Terminated":RETURN
350 A$=NUMB$:GOSUB 1000
360 IF RES>255 THEN ? :? "Terminated":RETURN
370 POKE START,RES
380 START=START+1:GOTO 330
400 ? "Start Address"
410 INPUT A$:DFLAG=1
420 GOSUB 1000:START=RES
430 A=INT(START/256):GOSUB 2000
440 A=START:GOSUB 2000
450 FOR LOOP=0 TO 7
460 ? ;" ";
470 A=PEEK(START+LOOP):GOSUB 2000
480 NEXT LOOP:?
490 START=START+8
500 GET #1,A
510 IF A<>ASC("S") THEN GOTO 430
520 RETURN
600 ? "Start Address"
610 INPUT A$
620 GOSUB 1000:START=RES
630 A=INT(START/256):GOSUB 2000
640 A=START:GOSUB 2000
645 ? ;" ";
650 A=PEEK(START):GOSUB 2000
660 ? ;"  byte ";:INPUT NUMB$
670 IF NUMB$="S" OR NUMB$="" OR LEN(NUMB$)>2 THEN ? "Terminated":RETURN
680 A$=NUMB$:GOSUB 1000
690 IF RES>255 THEN ? :? "Terminated":RETURN
700 POKE START,RES
710 START=START+1
720 GOTO 630
800 ? "Start Address"
810 INPUT A$
820 GOSUB 1000
830 ? :? "Are you sure (Y/N) ?"
840 GET #1,A
850 IF A<>ASC("Y") THEN ? :? "Aborted":RETURN
860 ? :? "In M/C routine"
870 START=RES:A=USR(START)
880 ? :? "Out of M/C routine"
890 RETURN
1000 REM EVALUATE A HEX NUMBER
1010 IF A$="" AND DFLAG=0 THEN RES=16384:? :? "Start =$4000":? :GOTO 1110
1015 IF A$="" AND DFLAG=1 THEN RES=16376:? :? "Start =$3FF8":? :GOTO 1110
1020 IF LEN(A$)>4 THEN ? :? "Too many digits":A$="":GOTO 1000
1030 RES=0:FOR L=1 TO LEN(A$)
1040 NUM=ASC(A$(L,L))
1050 IF NUM<48 OR NUM>70 THEN GOTO 1080
1060 IF NUM<58 THEN NUM=NUM-48:GOTO 1090
1070 IF NUM>64 THEN NUM=NUM-55:GOTO 1090
1080 PRINT :PRINT "Invalid HEX !":POP :POP :RETURN
1090 RES=RES+(NUM*(16^(LEN(A$)-L)))
1100 NEXT L
1110 RETURN
2000 A=((A/256)-INT(A/256))*256›2010 SAFE=A:A=INT(A/16):GOSUB 2040:A=SAFE
2020 IF A>15 THEN A=A-16:GOTO 2020
2030 GOSUB 2040:RETURN
2040 IF A<9.5 THEN A=A+48:GOTO 2060
2050 A=A+55
2060 PRINT ;CHR$(A);
2070 RETURN	

This is non-commercial site, its content is based on Atari 8-bit home computer contents and references.
If you feel your rights are violated by showing/using any part of contents of your product represented on this page, please contact me immediatelly so I can remove it!