Here the number is based on 16, and is represented in a single character:
Decimal
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Hex
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
The hexadecimal system can break the eight bits of a byte into two blocks of four bits, since 15 is a
four bit number: 1111 binary. The first block indicates the number of complete units of ‘15’, and the
second indicates the ‘remainder’ - and this is where the elegance of binary begins to emerge.
Reconsidering the table that introduced binary notation
Decimal
Binary CPC464-ese
Hexadecimal
0
0
fl
0
1
1
*
1
2
10
*fl
2
3
11
**
3
4
100
*flfl
4
5
101
*fl*
5
6
110
**fl
6
7
111
***
7
8
1000
*flflfl
8
9
1001
*flfl*
9
10
1010
*fl*fl
A
11
1011
*fl**
B
12
1100
**flfl
C
13
1101
**fl*
D
14
1110
***fl
E
15
1111
****
F
16
10000
*flflflfl
10
An 8-bit number 11010110 can be subdivided, and then considered as two 4-bit numbers known as
nibbles , Hex D6. Throughout this guide a hex based number will be introduced by the ‘&’ symbol eg
&D6, and this is the number base most commonly used by programmers using assembly language
techniques. An assembly language program is the nearest most programmers get to programming
directly in machine code, since the assembly language program allows the program to use simple
letter ‘mnemonics’ to specify the actual machine code ‘numbers’.
When using HEX, you must first work out the value of the first digit to obtain the number of 16’s in
the final number, and then add the remainder designated by the second ‘half of the hex notation to
obtain the total decimal equivalent. There’s a powerful temptation to regard a number like &D6 as
13+6, or 136. But it’s (13x16)+(6) = 214.
Содержание CPC464
Страница 1: ......
Страница 32: ...or you can type 3e1 1e1 ENTER 300 2 3000x1000 Type 3e3 1e3 ENTER 3000000 3 3000x0 001 Type 3e3 1e 3 ENTER 3 ...
Страница 102: ...PRINT 10 AND 12 Results in 8 PRINT 10 AND 1000 Results in 8 again ...
Страница 118: ...TO DO DRAW THIS PAGE ...
Страница 219: ...actual value may be made to vary during the execution of a program ...
Страница 240: ...Text and WINDOW planner Mode 2 80 Columns ...
Страница 241: ......
Страница 245: ...Sound envelope Music planner sheet ...