*12456789012345678901245678901234567890124567890123456789 #INCLUDE 'A:\VAR_DEF.ASM' * Define program variables ORG DATA VAL1 RMB 1 ; 1st channel VAL2 RMB 1 ; 2nd channel VAL3 RMB 1 ; 3rd channel VAL4 RMB 1 ; 4th channel * Main program ORG PROGRAM START LDX #REGBAS * switch on A/D converter BSET OPTION,X,%10000000 * Perform a scanned A/D conversion on PE1 ADC LDAA #%00110000 ; SCAN=1, MULT=1 STAA ADCTL,X * Store the conversion values on the four channels LABEL2 LDAA ADR1,X STAA VAL1 LDAA ADR2,X STAA VAL2 LDAA ADR3,X STAA VAL3 LDAA ADR4,X STAA VAL4 BRA LABEL2 ;back to the top SWI ORG RESET ; reset vector FDB START ; set to start of program