Download Print this page

Commodore VIC-RELAY-CASSETTE User Manual page 4

Advertisement

relay two is added to existing data). You can get further explanation about
the OR function in your VIC-manual. As you will be reading about the OR
function, why not take the opportity to read about the AND function also.
If
you want to reset all the relays, just write: POKE 37136,0
But if you only want to reset a particular relay and leave the others in their
actual state (see fig-4 and) write:
POKE 37163,PEEK(37163) AND 8
In this case only relay no. 4 will be reset. (poke data for relay no. 4
==
8.
(see fig-3).
All the numbers which you write on the screen are in decimal. These are
then interpreted by the VIC as hexadecimal or binary numbers.
Vic's user-port is a register containing
8
bits (1 byte).
OK! With this in mind we'll have a look at the convertion table:
FIG·5.
DECIMAL
HEXADECIMAL
BINARY
1
01
00000001
2
02
00000010
3
03
00000011
4
04
00000100
5
05
00000101
6
06
00000110
7
07
00000111
8
08
00001000
9
09
00001001
10
OA
00001010
11
08
00001011
12
OC
00001100
13
00
00001101
14
OE
00001110
15
OF
00001111
16
10
0001 0000
17
11
0001 0001
Etc.
Let us return to the first example. You switch on relay (1) with the code
I or 0000 0001 (as the VIC sees it). This data is placed in the register which
correspofldens to the VIC's user-port. A close up: NOTE reversed data!!
FIG-6.
0
0
0
0
0
0
0
<=
VIC USER-PORT
WITH DATA.
R
R
R
R
R
R
I
I
E
E
E
E
E
E
N
N
L
L
L
L
L
L
P
P
A
A
A
A
A
A
U
U
Y
Y
Y
Y
Y
Y
T
T
2
3
4
5
6
2
10000000
=
POKE DATA 1 (poke dat,l).
3

Advertisement

loading