Popular Electronics
POPULAR ELECTRONICS
[42] [43] [44] [45]
[Part 1] [Part 2] [Part 3] [Part 4] [Part 4a]

The numbers in the program flow chart (right) refer to the line numbers in the program. The program can be set up to shift or roll, or shift and roll. The program is loaded into locations 78 through F7. (Try using the program for the starship shown in Table II of the Pixie article.) Only the data loaded into 78 through F7 is shifted, but the entire area from 00 through FF is rolled.

Loading the program exactly as it is listed here will enable the shift routine only. Loading a 38 (SKP instruction) in location 5F (line 111) will enable both shift and roll routines. Loading 30 61 (BR ROLL) in locations 3C and 3D (line 82) will enable only the roll routine.

After loading and running the program, animation of the display will begin after any nonzero byte is loaded via the INPUT switches and operation of the INPUT pushbutton. By varying the INPUT bit pattern, you can control the speed of the animation.

If you have never seen a stack in "motion" when a program is running, take a look at displayed location 13. Then vary the speed. •




3F   F878         84              LDI   A.0(BEGSFT)
41   A9           85              PLO   R9            ..R9=FIRST LINE
42   F810         86              LDI   16            ..TO SHIFT.   
44   A6           87              PLO   R6            ..SHIFT 16 LINES.
45   99           88       MXTLNE:GHI   R9
46   BA           89              PHI   RA       ..SAVE ADDRESS OF 1st
47   89           90              GLO   R9       ..ON LINE IN RA
48   AA           91              PLO   RA
49   F807         92              LDI   7        ..R7=BYTES TO SHIFT-1.
4B   A7           93              PLO   R7
4C   09           94              LDN   R9
4D   B8           95              PHI   R8       ..SAVE 1ST BYTE ON
4E   76           96              SHRC           ..LINE IN R8.1
4F   19           97     MXTBYT:INC  R9          ..POINT R9 TO NEXT BYTE.
50   09           98            LDN  R9          ..LOAD NEXT BYTE.
51   76           99            SHRC             ..SHIFT RIGHT.
52   59           100           STR  R9          ..STORE BYTE
53   27           101           DEC  R7
54   87           102           GLO  R7          ..CHECK IF ALL BYTES
55   3A4F         103           BNZ  MXTBYT      ..SHIFTED.
57   98           104           GHI  R8          ..PUT BIT 0 of 8TH
58   76           105           SHRC             ..BYT ON BIT 7 OF
59   5A           106           STR  RA          ..1ST BYT ON LINE.
5A   19           107           INC  R9          ..R9=BYTE 0 NXT LINE.
5B   26           108           DEC  R6
5C   86           109           GLO  R6          ..CHECK IF 16 LINES
5D   3A45         110           BNZ  NXTLNE      ..SHIFTED.
5F   3033         111           BR   SFREAD      ..SKP 38 ROLL AND SHIFT.
61   84           112    ROLL:GLO    R4          ..INCREMENT R4 ONE LINE       
62   FC08         113           ADI  8           ..ROLL SCREEN UP.
64   A4           114           PLO  R4
65   94           115           GHI  R4          ..CHANGE LNNO 116 TO
66   F800         116           LDI  00          ..ADCI 0 7C00 IF MORE
68   B4           117           PHI  R4          ..THAN 256 BYTES.
69   3233         118           BZ   SFREAD
6B   84           119           GLO  R4
6C   B4           120           PHI  R4
6D   3033         121           BR   SFREAD
6F   00           122           DC   #00
                  123 ..ENTER IMAGE TO BE SHIFTED IN LOCATIONS
                  124 ..X'78' - x'F7'.
                  125           END


[42] [43] [44] [45]
[Part 1] [Part 2] [Part 3] [Part 4] [Part 4a]
44 POPULAR ELECTRONICS