Home » Archimedes archive » Acorn User » AU 1997-11 A.adf » Regulars1 » MikeC/Software/TEST-C
MikeC/Software/TEST-C
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn User » AU 1997-11 A.adf » Regulars1 |
Filename: | MikeC/Software/TEST-C |
Read OK: | ✔ |
File size: | 09A7 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
; PROGRAM TO TEST OPERATION OF EMULATOR ; ; By Bill Jeffs ; ; Test of the SLEEP mode ; PortB,7 hi the sleep mode is enabled ; When watchdog timer reaches time out (set to 40 or so) Sleep LED is off ; and then goes on again. ; ;============================= ; ; DEFINITIONS ; ;-------MICROPROCESSOR-------- ; LIST P=16C84 ; ;-------GENERIC--------------- ; W EQU 0 F EQU 1 ; ;-------REGISTERS------------- ; RTCC EQU H'01' ; REGISTERS DEFINED USING STATUS EQU H'03' ; HEX NOTATION PORTA EQU H'05' PORTB EQU H'06' INTCON EQU H'0B' WSAVE EQU H'0C' SSAVE EQU H'0D' SWSTAT EQU H'0E' DELAY EQU H'0F' OPTREG EQU H'01' ; ACTUAL ADDRESS H'81' SO SET TO PAGE 1 TRISA EQU H'05' ; ACTUAL ADDRESS H'85' SO SET TO PAGE 1 TRISB EQU H'06' ; ACTUAL ADDRESS H'86' SO SET TO PAGE 1 FUSES EQU H'2007' ; ;-------STATUS BITS----------- ; C EQU 0 Z EQU 2 TOIF EQU 2 RP0 EQU 5 TOIE EQU 5 GEI EQU 7 BIT0 EQU 0 BIT1 EQU 1 BIT2 EQU 2 BIT3 EQU 3 BIT4 EQU 4 BIT5 EQU 5 BIT6 EQU 6 BIT7 EQU 7 ; ;-------START----------------- ; ORG FUSES EQUB H'0D' ORG H'00' ; START VECTOR GOTO MAIN ; ;-------TEST PROGRAM---------- ; ORG H'06' ; ;-------MAIN PROGRAM---------- ; MAIN CALL INIT LOOPM CLRWDT BCF PORTA,BIT0 BTFSC PORTB,BIT7 CALL BYEBYE GOTO LOOPM ; ;-------INITIALISE------------ ; INIT BSF STATUS,RP0 ; SET FOR REGISTER PAGE 1 MOVLW B'00001001' ; SET SCALER TO WDT, COUNT 2 MOVWF OPTREG ; OPTREG IS IN PAGE 1 CLRW MOVWF TRISA ; SET PORTA FOR OUTPUT MOVLW H'FF' MOVWF TRISB ; SET PORTB FOR INPUTS BCF STATUS,RP0 ; RETURN TO PAGE 0 CLRW MOVWF PORTA ; CLEAR PORT A FOR CLEAN START MOVWF PORTB ; CLEAR PORT B FOR CLEAN START RETURN ; ;-------CHECK SLEEP MODE------ ; BYEBYE BSF PORTA,BIT0 SLEEP RETURN ; END
00000000 3b 20 50 52 4f 47 52 41 4d 20 54 4f 20 54 45 53 |; PROGRAM TO TES| 00000010 54 20 4f 50 45 52 41 54 49 4f 4e 20 4f 46 20 45 |T OPERATION OF E| 00000020 4d 55 4c 41 54 4f 52 0a 3b 0a 3b 20 42 79 20 42 |MULATOR.;.; By B| 00000030 69 6c 6c 20 4a 65 66 66 73 0a 3b 0a 3b 20 54 65 |ill Jeffs.;.; Te| 00000040 73 74 20 6f 66 20 74 68 65 20 53 4c 45 45 50 20 |st of the SLEEP | 00000050 6d 6f 64 65 0a 3b 20 50 6f 72 74 42 2c 37 20 68 |mode.; PortB,7 h| 00000060 69 20 74 68 65 20 73 6c 65 65 70 20 6d 6f 64 65 |i the sleep mode| 00000070 20 69 73 20 65 6e 61 62 6c 65 64 0a 3b 20 57 68 | is enabled.; Wh| 00000080 65 6e 20 77 61 74 63 68 64 6f 67 20 74 69 6d 65 |en watchdog time| 00000090 72 20 72 65 61 63 68 65 73 20 74 69 6d 65 20 6f |r reaches time o| 000000a0 75 74 20 28 73 65 74 20 74 6f 20 34 30 20 6f 72 |ut (set to 40 or| 000000b0 20 73 6f 29 20 53 6c 65 65 70 20 4c 45 44 20 69 | so) Sleep LED i| 000000c0 73 20 6f 66 66 0a 3b 20 61 6e 64 20 74 68 65 6e |s off.; and then| 000000d0 20 67 6f 65 73 20 6f 6e 20 61 67 61 69 6e 2e 0a | goes on again..| 000000e0 3b 0a 3b 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |;.;=============| 000000f0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| 00000100 0a 3b 0a 3b 20 20 20 20 20 20 20 44 45 46 49 4e |.;.; DEFIN| 00000110 49 54 49 4f 4e 53 0a 3b 0a 3b 2d 2d 2d 2d 2d 2d |ITIONS.;.;------| 00000120 2d 4d 49 43 52 4f 50 52 4f 43 45 53 53 4f 52 2d |-MICROPROCESSOR-| 00000130 2d 2d 2d 2d 2d 2d 2d 0a 3b 0a 20 20 20 20 20 20 |-------.;. | 00000140 20 20 4c 49 53 54 20 50 3d 31 36 43 38 34 0a 3b | LIST P=16C84.;| 00000150 0a 3b 2d 2d 2d 2d 2d 2d 2d 47 45 4e 45 52 49 43 |.;-------GENERIC| 00000160 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |---------------.| 00000170 3b 0a 20 20 20 20 20 20 20 20 57 20 20 20 20 20 |;. W | 00000180 20 20 45 51 55 20 20 20 20 20 30 0a 20 20 20 20 | EQU 0. | 00000190 20 20 20 20 46 20 20 20 20 20 20 20 45 51 55 20 | F EQU | 000001a0 20 20 20 20 31 0a 3b 0a 3b 2d 2d 2d 2d 2d 2d 2d | 1.;.;-------| 000001b0 52 45 47 49 53 54 45 52 53 2d 2d 2d 2d 2d 2d 2d |REGISTERS-------| 000001c0 2d 2d 2d 2d 2d 2d 0a 3b 0a 20 20 20 20 20 20 20 |------.;. | 000001d0 20 52 54 43 43 20 20 20 20 45 51 55 20 20 20 20 | RTCC EQU | 000001e0 20 48 27 30 31 27 20 20 20 3b 20 52 45 47 49 53 | H'01' ; REGIS| 000001f0 54 45 52 53 20 44 45 46 49 4e 45 44 20 55 53 49 |TERS DEFINED USI| 00000200 4e 47 0a 20 20 20 20 20 20 20 20 53 54 41 54 55 |NG. STATU| 00000210 53 20 20 45 51 55 20 20 20 20 20 48 27 30 33 27 |S EQU H'03'| 00000220 20 20 20 3b 20 48 45 58 20 4e 4f 54 41 54 49 4f | ; HEX NOTATIO| 00000230 4e 0a 20 20 20 20 20 20 20 20 50 4f 52 54 41 20 |N. PORTA | 00000240 20 20 45 51 55 20 20 20 20 20 48 27 30 35 27 0a | EQU H'05'.| 00000250 20 20 20 20 20 20 20 20 50 4f 52 54 42 20 20 20 | PORTB | 00000260 45 51 55 20 20 20 20 20 48 27 30 36 27 0a 20 20 |EQU H'06'. | 00000270 20 20 20 20 20 20 49 4e 54 43 4f 4e 20 20 45 51 | INTCON EQ| 00000280 55 20 20 20 20 20 48 27 30 42 27 0a 20 20 20 20 |U H'0B'. | 00000290 20 20 20 20 57 53 41 56 45 20 20 20 45 51 55 20 | WSAVE EQU | 000002a0 20 20 20 20 48 27 30 43 27 0a 20 20 20 20 20 20 | H'0C'. | 000002b0 20 20 53 53 41 56 45 20 20 20 45 51 55 20 20 20 | SSAVE EQU | 000002c0 20 20 48 27 30 44 27 0a 20 20 20 20 20 20 20 20 | H'0D'. | 000002d0 53 57 53 54 41 54 20 20 45 51 55 20 20 20 20 20 |SWSTAT EQU | 000002e0 48 27 30 45 27 0a 20 20 20 20 20 20 20 20 44 45 |H'0E'. DE| 000002f0 4c 41 59 20 20 20 45 51 55 20 20 20 20 20 48 27 |LAY EQU H'| 00000300 30 46 27 0a 20 20 20 20 20 20 20 20 4f 50 54 52 |0F'. OPTR| 00000310 45 47 20 20 45 51 55 20 20 20 20 20 48 27 30 31 |EG EQU H'01| 00000320 27 20 20 20 3b 20 41 43 54 55 41 4c 20 41 44 44 |' ; ACTUAL ADD| 00000330 52 45 53 53 20 48 27 38 31 27 20 53 4f 20 53 45 |RESS H'81' SO SE| 00000340 54 20 54 4f 20 50 41 47 45 20 31 0a 20 20 20 20 |T TO PAGE 1. | 00000350 20 20 20 20 54 52 49 53 41 20 20 20 45 51 55 20 | TRISA EQU | 00000360 20 20 20 20 48 27 30 35 27 20 20 20 3b 20 41 43 | H'05' ; AC| 00000370 54 55 41 4c 20 41 44 44 52 45 53 53 20 48 27 38 |TUAL ADDRESS H'8| 00000380 35 27 20 53 4f 20 53 45 54 20 54 4f 20 50 41 47 |5' SO SET TO PAG| 00000390 45 20 31 0a 20 20 20 20 20 20 20 20 54 52 49 53 |E 1. TRIS| 000003a0 42 20 20 20 45 51 55 20 20 20 20 20 48 27 30 36 |B EQU H'06| 000003b0 27 20 20 20 3b 20 41 43 54 55 41 4c 20 41 44 44 |' ; ACTUAL ADD| 000003c0 52 45 53 53 20 48 27 38 36 27 20 53 4f 20 53 45 |RESS H'86' SO SE| 000003d0 54 20 54 4f 20 50 41 47 45 20 31 0a 20 20 20 20 |T TO PAGE 1. | 000003e0 20 20 20 20 46 55 53 45 53 20 20 20 45 51 55 20 | FUSES EQU | 000003f0 20 20 20 20 48 27 32 30 30 37 27 0a 0a 3b 0a 3b | H'2007'..;.;| 00000400 2d 2d 2d 2d 2d 2d 2d 53 54 41 54 55 53 20 42 49 |-------STATUS BI| 00000410 54 53 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 3b 0a |TS-----------.;.| 00000420 20 20 20 20 20 20 20 20 43 20 20 20 20 20 20 20 | C | 00000430 45 51 55 20 20 20 20 20 30 0a 20 20 20 20 20 20 |EQU 0. | 00000440 20 20 5a 20 20 20 20 20 20 20 45 51 55 20 20 20 | Z EQU | 00000450 20 20 32 0a 20 20 20 20 20 20 20 20 54 4f 49 46 | 2. TOIF| 00000460 20 20 20 20 45 51 55 20 20 20 20 20 32 0a 20 20 | EQU 2. | 00000470 20 20 20 20 20 20 52 50 30 20 20 20 20 20 45 51 | RP0 EQ| 00000480 55 20 20 20 20 20 35 0a 20 20 20 20 20 20 20 20 |U 5. | 00000490 54 4f 49 45 20 20 20 20 45 51 55 20 20 20 20 20 |TOIE EQU | 000004a0 35 0a 20 20 20 20 20 20 20 20 47 45 49 20 20 20 |5. GEI | 000004b0 20 20 45 51 55 20 20 20 20 20 37 0a 20 20 20 20 | EQU 7. | 000004c0 20 20 20 20 42 49 54 30 20 20 20 20 45 51 55 20 | BIT0 EQU | 000004d0 20 20 20 20 30 0a 20 20 20 20 20 20 20 20 42 49 | 0. BI| 000004e0 54 31 20 20 20 20 45 51 55 20 20 20 20 20 31 0a |T1 EQU 1.| 000004f0 20 20 20 20 20 20 20 20 42 49 54 32 20 20 20 20 | BIT2 | 00000500 45 51 55 20 20 20 20 20 32 0a 20 20 20 20 20 20 |EQU 2. | 00000510 20 20 42 49 54 33 20 20 20 20 45 51 55 20 20 20 | BIT3 EQU | 00000520 20 20 33 0a 20 20 20 20 20 20 20 20 42 49 54 34 | 3. BIT4| 00000530 20 20 20 20 45 51 55 20 20 20 20 20 34 0a 20 20 | EQU 4. | 00000540 20 20 20 20 20 20 42 49 54 35 20 20 20 20 45 51 | BIT5 EQ| 00000550 55 20 20 20 20 20 35 0a 20 20 20 20 20 20 20 20 |U 5. | 00000560 42 49 54 36 20 20 20 20 45 51 55 20 20 20 20 20 |BIT6 EQU | 00000570 36 0a 20 20 20 20 20 20 20 20 42 49 54 37 20 20 |6. BIT7 | 00000580 20 20 45 51 55 20 20 20 20 20 37 0a 3b 0a 3b 2d | EQU 7.;.;-| 00000590 2d 2d 2d 2d 2d 2d 53 54 41 52 54 2d 2d 2d 2d 2d |------START-----| 000005a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 3b 0a 20 |------------.;. | 000005b0 20 20 20 20 20 20 20 4f 52 47 20 20 20 20 20 46 | ORG F| 000005c0 55 53 45 53 20 20 20 20 20 20 20 20 20 20 20 0a |USES .| 000005d0 20 20 20 20 20 20 20 20 45 51 55 42 20 20 20 20 | EQUB | 000005e0 48 27 30 44 27 20 20 20 20 20 20 20 20 20 20 0a |H'0D' .| 000005f0 0a 20 20 20 20 20 20 20 20 4f 52 47 20 20 20 20 |. ORG | 00000600 20 48 27 30 30 27 20 20 20 20 20 20 20 20 20 20 | H'00' | 00000610 20 3b 20 53 54 41 52 54 20 56 45 43 54 4f 52 0a | ; START VECTOR.| 00000620 20 20 20 20 20 20 20 20 47 4f 54 4f 20 20 20 20 | GOTO | 00000630 4d 41 49 4e 0a 3b 0a 3b 2d 2d 2d 2d 2d 2d 2d 54 |MAIN.;.;-------T| 00000640 45 53 54 20 50 52 4f 47 52 41 4d 2d 2d 2d 2d 2d |EST PROGRAM-----| 00000650 2d 2d 2d 2d 2d 0a 3b 0a 20 20 20 20 20 20 20 20 |-----.;. | 00000660 4f 52 47 20 20 20 20 20 48 27 30 36 27 0a 3b 0a |ORG H'06'.;.| 00000670 3b 2d 2d 2d 2d 2d 2d 2d 4d 41 49 4e 20 50 52 4f |;-------MAIN PRO| 00000680 47 52 41 4d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 3b |GRAM----------.;| 00000690 0a 4d 41 49 4e 20 20 20 20 43 41 4c 4c 20 20 20 |.MAIN CALL | 000006a0 20 49 4e 49 54 0a 4c 4f 4f 50 4d 20 20 20 43 4c | INIT.LOOPM CL| 000006b0 52 57 44 54 0a 20 20 20 20 20 20 20 20 42 43 46 |RWDT. BCF| 000006c0 20 20 20 20 20 50 4f 52 54 41 2c 42 49 54 30 0a | PORTA,BIT0.| 000006d0 20 20 20 20 20 20 20 20 42 54 46 53 43 20 20 20 | BTFSC | 000006e0 50 4f 52 54 42 2c 42 49 54 37 0a 20 20 20 20 20 |PORTB,BIT7. | 000006f0 20 20 20 43 41 4c 4c 20 20 20 20 42 59 45 42 59 | CALL BYEBY| 00000700 45 0a 20 20 20 20 20 20 20 20 47 4f 54 4f 20 20 |E. GOTO | 00000710 20 20 4c 4f 4f 50 4d 0a 3b 0a 3b 2d 2d 2d 2d 2d | LOOPM.;.;-----| 00000720 2d 2d 49 4e 49 54 49 41 4c 49 53 45 2d 2d 2d 2d |--INITIALISE----| 00000730 2d 2d 2d 2d 2d 2d 2d 2d 0a 3b 0a 49 4e 49 54 20 |--------.;.INIT | 00000740 20 20 20 42 53 46 20 20 20 20 20 53 54 41 54 55 | BSF STATU| 00000750 53 2c 52 50 30 20 20 20 20 20 20 3b 20 53 45 54 |S,RP0 ; SET| 00000760 20 46 4f 52 20 52 45 47 49 53 54 45 52 20 50 41 | FOR REGISTER PA| 00000770 47 45 20 31 0a 20 20 20 20 20 20 20 20 4d 4f 56 |GE 1. MOV| 00000780 4c 57 20 20 20 42 27 30 30 30 30 31 30 30 31 27 |LW B'00001001'| 00000790 20 20 20 20 20 3b 20 53 45 54 20 53 43 41 4c 45 | ; SET SCALE| 000007a0 52 20 54 4f 20 57 44 54 2c 20 43 4f 55 4e 54 20 |R TO WDT, COUNT | 000007b0 32 0a 20 20 20 20 20 20 20 20 4d 4f 56 57 46 20 |2. MOVWF | 000007c0 20 20 4f 50 54 52 45 47 20 20 20 20 20 20 20 20 | OPTREG | 000007d0 20 20 3b 20 4f 50 54 52 45 47 20 49 53 20 49 4e | ; OPTREG IS IN| 000007e0 20 50 41 47 45 20 31 0a 20 20 20 20 20 20 20 20 | PAGE 1. | 000007f0 43 4c 52 57 0a 20 20 20 20 20 20 20 20 4d 4f 56 |CLRW. MOV| 00000800 57 46 20 20 20 54 52 49 53 41 20 20 20 20 20 20 |WF TRISA | 00000810 20 20 20 20 20 3b 20 53 45 54 20 50 4f 52 54 41 | ; SET PORTA| 00000820 20 46 4f 52 20 4f 55 54 50 55 54 0a 20 20 20 20 | FOR OUTPUT. | 00000830 20 20 20 20 4d 4f 56 4c 57 20 20 20 48 27 46 46 | MOVLW H'FF| 00000840 27 0a 20 20 20 20 20 20 20 20 4d 4f 56 57 46 20 |'. MOVWF | 00000850 20 20 54 52 49 53 42 20 20 20 20 20 20 20 20 20 | TRISB | 00000860 20 20 3b 20 53 45 54 20 50 4f 52 54 42 20 46 4f | ; SET PORTB FO| 00000870 52 20 49 4e 50 55 54 53 0a 20 20 20 20 20 20 20 |R INPUTS. | 00000880 20 42 43 46 20 20 20 20 20 53 54 41 54 55 53 2c | BCF STATUS,| 00000890 52 50 30 20 20 20 20 20 20 3b 20 52 45 54 55 52 |RP0 ; RETUR| 000008a0 4e 20 54 4f 20 50 41 47 45 20 30 0a 20 20 20 20 |N TO PAGE 0. | 000008b0 20 20 20 20 43 4c 52 57 0a 20 20 20 20 20 20 20 | CLRW. | 000008c0 20 4d 4f 56 57 46 20 20 20 50 4f 52 54 41 20 20 | MOVWF PORTA | 000008d0 20 20 20 20 20 20 20 20 20 3b 20 43 4c 45 41 52 | ; CLEAR| 000008e0 20 50 4f 52 54 20 41 20 46 4f 52 20 43 4c 45 41 | PORT A FOR CLEA| 000008f0 4e 20 53 54 41 52 54 0a 20 20 20 20 20 20 20 20 |N START. | 00000900 4d 4f 56 57 46 20 20 20 50 4f 52 54 42 20 20 20 |MOVWF PORTB | 00000910 20 20 20 20 20 20 20 20 3b 20 43 4c 45 41 52 20 | ; CLEAR | 00000920 50 4f 52 54 20 42 20 46 4f 52 20 43 4c 45 41 4e |PORT B FOR CLEAN| 00000930 20 53 54 41 52 54 0a 20 20 20 20 20 20 20 20 52 | START. R| 00000940 45 54 55 52 4e 0a 3b 0a 3b 2d 2d 2d 2d 2d 2d 2d |ETURN.;.;-------| 00000950 43 48 45 43 4b 20 53 4c 45 45 50 20 4d 4f 44 45 |CHECK SLEEP MODE| 00000960 2d 2d 2d 2d 2d 2d 0a 3b 0a 42 59 45 42 59 45 20 |------.;.BYEBYE | 00000970 20 42 53 46 20 20 20 20 20 50 4f 52 54 41 2c 42 | BSF PORTA,B| 00000980 49 54 30 0a 20 20 20 20 20 20 20 20 53 4c 45 45 |IT0. SLEE| 00000990 50 0a 20 20 20 20 20 20 20 20 52 45 54 55 52 4e |P. RETURN| 000009a0 0a 3b 0a 45 4e 44 0a |.;.END.| 000009a7