95b7f764 |
1 | #include <stdio.h> |
52147402 |
2 | #include <unistd.h> |
95b7f764 |
3 | |
4 | void output(unsigned short * data){ |
5 | int c; |
6 | char zero=0; |
7 | unsigned char first_word=020; |
95b7f764 |
8 | for (c=0; c<100; c++) write (1,&zero,1); |
9 | write (1,&first_word,1); // Anfangsadresse ausgeben |
10 | c=020; |
11 | while (data[c]){ |
12 | unsigned char lower=data[c] & 0xff; |
13 | unsigned char upper=(data[c] >> 8) & 0xff; |
14 | write (1,&upper,1); |
15 | write (2,"Locat geschrieben\n",18); |
16 | write (1,&lower,1); |
17 | c++; |
18 | } |
19 | for (c=0; c<100; c++) write (1,&zero,1); // Abspann |
20 | } |
21 | |
22 | void prepare_1(unsigned short * mem){ |
23 | mem[020]=0002010; // Loop back to read boot-strap (must be here!) |
ba1e3143 |
24 | mem[021]=0004026; // Load A with fancy pattern |
95b7f764 |
25 | mem[022]=0024027; // Increment and skip if zero 027 |
26 | mem[023]=0002022; // Loop |
27 | mem[024]=0040677; // Right rotate a |
28 | mem[025]=0002022; // Loop back |
29 | mem[026]=0052000; // Bit pattern to move around |
30 | } |
31 | |
ba1e3143 |
32 | void prepare_2(unsigned short * mem){ |
33 | mem[020]=0002010; // Loop back to read boot-strap (must be here!) |
34 | mem[021]=0024027; // Increment and skip if zero 027 |
35 | mem[022]=0002021; // Loop |
36 | mem[023]=0141206; // Add one to A |
37 | mem[024]=0002022; // Loop back |
38 | mem[025]=0000000; // End |
39 | } |
40 | |
41 | void prepare_3(unsigned short * mem){ |
42 | mem[020]=0002010; // Loop back to read boot-strap (must be here!) |
43 | mem[021]=0004027; // Load Precount |
44 | mem[022]=0024027; // Increment and skip if zero 027 |
45 | mem[023]=0002021; // Loop |
46 | mem[024]=0141206; // Add one to A |
47 | mem[025]=0141340; // Change characters in A |
48 | mem[026]=0002021; // Loop back |
49 | mem[027]=0077777; // End |
50 | mem[030]=0000000; |
51 | } |
52 | |
53 | |
95b7f764 |
54 | int main(){ |
55 | unsigned short memory[0100]; |
6c110227 |
56 | prepare_2(memory); |
95b7f764 |
57 | output(memory); |
58 | return 0; |
59 | } |