Understanding Your Spectrum 2
Understanding Your Spectrum 2
YOUR SPECTRUM
yn*->yoy/
60 LET 3aed=Seed-l
70 PRINT Seed/65536,RND
PROGRAM TO DEFINE A GRAPHIC CHARACTER
10 DATA BIN 000001
n
la
BATA BIN 00010
DATA BIN 00000100
13 DATA BIN 00000100
l# DATA BIN 00001000
15 DATA BIN 01001000
16 DATA BIN 00101000
17 DATA BIN 00010000
18 KBH. A-0 TO 7: HEAD B: POKE
Vm "A"+A,B: NEXT A
19 PRINT OER0 144: REM = "A"
ijll
130 FOR tel ©3 4
140 Lfe H0( A)'~0HR0 (H(A’|+#*7*
H(A)>3))
HEX-TO-DECIMAL PROGRAM
10 RIM H0U)
2<0 INPUT "Hex. charac-teSs0SH0
30 IF OOJ’2 ll'A 32 THEN GO TO 20
#0 LET D-0
30 FOR A=1 SO 4
.60 IF H0(A)=OHR0 32 BfHl 5# Wf
100
70 IF H0(A)<"0" OR H0(A)>'.*8-w $
ID H0(A)<"A<' OR H0(A)>**F«- THEN G
5 TQ 1S0
80 LBS D=R+16t(4-A)*(CODE H0(A
The BASIC interpreter of the SPECTRUM system uses five bytes to represent
bers or integers outside the integral range are held as five byte floating-point
10 INPUT N
20 IF NoINT N OR N<-65535 OR
THEN GO TO 10
30 PRINT "Number chosen-=",It
40 LET V=PEEK 23627+256*PBEK 2
3628
50 FOR A=1 M §
60 PAINT A;".";TAB 5;P3BK (A+V)
80 00 TO 10
I? s
c) 'Indexed addressing' - the address of the location is to be computed by
adding the displacement value, d, to the base address already held in the
sal
the SPECTRUM systei
90 PRINT AT 10,0;"The C
i
§1 II
ilililii
7. UNDERSTANDING -
! copyright r
CLOSEd in the correct way.
SPECTRUM
mill
2634 - 2667
CALCULATOR is u
III! II 111
must be held in the B register before the 'RST 0028' instruction is used.
Printing numbers:
f i gg
The 'SCREENS' error, (credit Stephen Kelly and others.)
As a result of the error the string obtained by using SCREENS is stored