XDEF Circulation XREF __SEG_END_SSTACK,show_temperature,display_string,disp,dc_on,pw_set,PORT_T,PORT_S Circulation: ;push register and accumulator values for retention PSHA PSHB PSHD PSHX PSHY ;bail if the password is not set LDAA pw_set CMPA #$FF LBNE Return ; ;run the motor and stuff like that here ;(the motor should run whether or not ;the temperature is displayed) ; LDAA dc_on CMPA #$FF BNE PulseOff PulseOn: BSET PORT_T,#$8 ;set bit 3 of Port T ;MOVB #$0F,PORT_S BRA PrintTemperature ;exit the interrupt routine PulseOff: BCLR PORT_T,#$8 ;clear bit 3 of Port T ;MOVB #$F0,PORT_S BRA PrintTemperature ;exit the interrupt PrintTemperature: ;check if the temperature should show LDAA show_temperature CMPA #$00 LBEQ Return ;print the temperature movb #'T',disp movb #'e',disp+1 movb #'m',disp+2 movb #'p',disp+3 movb #'e',disp+4 movb #'r',disp+5 movb #'a',disp+6 movb #'t',disp+7 movb #'u',disp+8 movb #'r',disp+9 movb #'e',disp+10 movb #':',disp+11 movb #' ',disp+12 movb #' ',disp+13 movb #' ',disp+14 movb #' ',disp+15 ;next line movb #'X',disp+16 movb #'Y',disp+17 movb #'Z',disp+18 movb #' ',disp+19 movb #'d',disp+20 movb #'e',disp+21 movb #'g',disp+22 movb #'r',disp+23 movb #'e',disp+24 movb #'e',disp+25 movb #'s',disp+26 movb #' ',disp+27 movb #' ',disp+28 movb #' ',disp+29 movb #' ',disp+30 movb #' ',disp+31 movb #0,disp+32 ;string terminator, acts like '\0' LDD #disp ;both of these steps are necessary to jsr display_string ;print to the LCD screen Return: ;restore registers and accumulators PULY PULX PULD PULB PULA RTS