#include <v2_18g3.asm> #define PACTL REGBASE+0x26 #define PACNT REGBASE+0x27 #define TMSK2 REGBASE+0x24 #define TFLG2 REGBASE+0x25 .sect .data msg: .asciz "Pulse Accumulator Test Program\n\n" .sect .text main: ldx #msg // pointer to output message jsr OUTSTRING // write program name out ldx #BUTTONISR // interrupt for interrupt button press stx ISR_JUMP15 ldx #PA_OVRISR // interrupt for pulse accumulator overflow stx ISR_JUMP4 // called when PACNT goes from 255 to 0 ldaa #0xf0 // Turn on pulse accumulator staa PACTL ldaa TMSK2 // Turn on overflow interrupts oraa #0x20 staa TMSK2 /* Event spin loop */ loop: // every time PACNT is 0 (every 256 ticks), we print '.' // Gives you an idea of how fast the pulse accumulator is. ldaa PACNT bne loop ldaa #'.' jsr OUTCHAR bra loop /* Interrupt Service Routine called each time the pulse accumlator overflows or about every 10 ms. */ PA_OVRISR: // if you don't reset these flags (see description in HC11 manual), // nasty stuff happens, e.g. Ctrl-X reset can get disabled ldaa TFLG2 oraa #0xc0 // clear PAOVF staa TFLG2 rti /* ISR called each time the IRQ pin is pulled low (button pushed). Do as little as possible in this interrupt; LCD functions called here may crash. Could use this interrupt to save current value of PACNT as a "random" number. */ BUTTONISR: ldab PACNT clra jsr CONSOLEINT // output value of pulse accumulator count (PACNT) rti
Standard input is empty
prog.asm:1: error: label or instruction expected at start of line prog.asm:3: error: label or instruction expected at start of line prog.asm:4: error: label or instruction expected at start of line prog.asm:5: error: label or instruction expected at start of line prog.asm:6: error: label or instruction expected at start of line prog.asm:9: error: attempt to define a local label before any non-local labels prog.asm:9: error: parser: instruction expected prog.asm:10: error: parser: instruction expected prog.asm:13: error: parser: instruction expected prog.asm:15: error: parser: instruction expected prog.asm:16: error: parser: instruction expected prog.asm:18: error: symbol `ldx' redefined prog.asm:18: error: parser: instruction expected prog.asm:19: error: parser: instruction expected prog.asm:21: error: symbol `ldx' redefined prog.asm:21: error: parser: instruction expected prog.asm:22: error: symbol `stx' redefined prog.asm:22: error: parser: instruction expected prog.asm:24: error: parser: instruction expected prog.asm:25: error: parser: instruction expected prog.asm:26: error: symbol `ldaa' redefined prog.asm:26: error: parser: instruction expected prog.asm:27: error: parser: instruction expected prog.asm:28: error: symbol `staa' redefined prog.asm:28: error: parser: instruction expected prog.asm:30: error: label or instruction expected at start of line prog.asm:32: error: label or instruction expected at start of line prog.asm:33: error: label or instruction expected at start of line prog.asm:34: error: symbol `ldaa' redefined prog.asm:34: error: parser: instruction expected prog.asm:37: error: symbol `ldaa' redefined prog.asm:37: error: parser: instruction expected prog.asm:38: error: symbol `jsr' redefined prog.asm:38: error: parser: instruction expected prog.asm:41: error: label or instruction expected at start of line prog.asm:42: error: comma, colon or end of line expected prog.asm:44: error: label or instruction expected at start of line prog.asm:45: error: label or instruction expected at start of line prog.asm:46: error: symbol `ldaa' redefined prog.asm:46: error: parser: instruction expected prog.asm:47: error: symbol `oraa' redefined prog.asm:47: error: parser: instruction expected prog.asm:48: error: symbol `staa' redefined prog.asm:48: error: parser: instruction expected prog.asm:51: error: label or instruction expected at start of line prog.asm:52: error: parser: instruction expected prog.asm:53: error: parser: instruction expected prog.asm:54: error: label or instruction expected at start of line prog.asm:56: error: parser: instruction expected prog.asm:58: error: symbol `jsr' redefined prog.asm:58: error: parser: instruction expected prog.asm:59: error: symbol `rti' redefined
Standard output is empty