Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1186 | savelij | 1 | cpu micropdp-11/93 |
2 | page 0 |
||
3 | |||
4 | ; Load RADIX 50 code page and the macro's definition: |
||
5 | |||
6 | include "radix50.inc" |
||
7 | |||
8 | ; RADIX 50 packs three characters into one machine word, |
||
9 | ; with the encoding ch[0]*40^2 + ch[1]*40^1 + ch[2]*40^0. |
||
10 | ; So the expected outcome is |
||
11 | ; 1*40^2 + 2*40^1 + 3*40^0 = 1683 = 0x693, |
||
12 | ; and 4*40^2 + 5*40^1 + 6*40^0 = 6606 = 0x19ce: |
||
13 | |||
14 | radix50 "ABCDEF" |
||
15 | |||
16 | ; If the number of characters is not a multiple of three, |
||
17 | ; the string is padded with spaces, which encode as zero. |
||
18 | ; So the expected outcome is |
||
19 | ; 30*40^2 + 0*40^1 + 0*40^0 = 48000 = 0xbb80: |
||
20 | |||
21 | radix50 "0" |
||
22 | |||
23 | ; ...and here, it is |
||
24 | ; 27*40^2 + 28*40^1 + 0*40^0 = 44320 = 0xad20: |
||
25 | |||
26 | radix50 "$." |
||
27 | |||
28 | ; unencodable characters should produce an error: |
||
29 | |||
30 | expect 9990 |
||
31 | radix50 "ABc" |
||
32 | endexpect |
||
33 |