Simple Frequency Generator #1

RCA 1802 Program

For use on the Elf2000

 

Mem    Instructions                          Explanation

00        90 B6                                  Put R0.0 (‘00’) into Reg 6 high

02        F8 30 A6                            Load ‘30’ into D and place into R6 low

05        E0                                       Set X to Reg 0

06        64 01                                   Output ‘01’ to LEDs

08        E6                                       Set X to Reg 6

09        3F 09                                  If EF4 Input is Null go to 09 – i.e., wait until toggled

0B       6C                                       Get input from the Toggle switches (Data Bus)

0C       64                                        Display the data out the LED’s

0D       26                                        Decrement Reg 6

0E        37 0E                                  Wait here until the main Input Toggle Switch goes low

10        F0 A1                                 Load the byte entered from M(R(X)) which is Reg 6 into D

                                                        Place D into Reg 1.0 as a counter to work down from

12        7B                                       Switch Q light ON

13        32 22                                   If D is ‘00’ then skip down to End (‘22’)

15        21 81                                   Decrement Reg 1, and then get Reg 1.0 into D

17        3A 15                                  If D is NOT Null then go back and keep decrementing R1

19        F0 A1                                 Load the original byte entered from M(R(X)) (Reg 6) into D

                                                        Place D into Reg 1.0 as a counter to work down from

1B       7A                                       Switch Q Light OFF

1C       21 81                                   Decrement Reg 1, and then get Reg 1.0 into D

1E        3A 1C                                 If D is NOT Null then go back and keep decrementing R1

20        3F 10                                  If EF4 is Null then go back to 10 and keep this up

22        30 00                                   Else, Go to 00 and start over