95b7f764 |
1 | #include <stdio.h> |
2 | |
3 | |
4 | void output(unsigned short * data){ |
5 | int c; |
6 | char zero=0; |
7 | unsigned char first_word=020; |
8 | unsigned short akt=0; |
9 | for (c=0; c<100; c++) write (1,&zero,1); |
10 | write (1,&first_word,1); // Anfangsadresse ausgeben |
11 | c=020; |
12 | while (data[c]){ |
13 | unsigned char lower=data[c] & 0xff; |
14 | unsigned char upper=(data[c] >> 8) & 0xff; |
15 | write (1,&upper,1); |
16 | write (2,"Locat geschrieben\n",18); |
17 | write (1,&lower,1); |
18 | c++; |
19 | } |
20 | for (c=0; c<100; c++) write (1,&zero,1); // Abspann |
21 | } |
22 | |
23 | void prepare_1(unsigned short * mem){ |
24 | mem[020]=0002010; // Loop back to read boot-strap (must be here!) |
25 | mem[021]=0004026; // Load A with dancy pattern |
26 | mem[022]=0024027; // Increment and skip if zero 027 |
27 | mem[023]=0002022; // Loop |
28 | mem[024]=0040677; // Right rotate a |
29 | mem[025]=0002022; // Loop back |
30 | mem[026]=0052000; // Bit pattern to move around |
31 | } |
32 | |
33 | int main(){ |
34 | unsigned short memory[0100]; |
35 | prepare_1(memory); |
36 | output(memory); |
37 | return 0; |
38 | } |