circulation.asm 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. XDEF Circulation
  2. XREF __SEG_END_SSTACK,show_temperature,display_string,disp,dc_on,pw_set,PORT_T,PORT_S
  3. Circulation: ;push register and accumulator values for retention
  4. PSHA
  5. PSHB
  6. PSHD
  7. PSHX
  8. PSHY
  9. ;bail if the password is not set
  10. LDAA pw_set
  11. CMPA #$FF
  12. LBNE Return
  13. ;
  14. ;run the motor and stuff like that here
  15. ;(the motor should run whether or not
  16. ;the temperature is displayed)
  17. ;
  18. LDAA dc_on
  19. CMPA #$FF
  20. BNE PulseOff
  21. PulseOn:
  22. BSET PORT_T,#$8 ;set bit 3 of Port T
  23. ;MOVB #$0F,PORT_S
  24. BRA PrintTemperature ;exit the interrupt routine
  25. PulseOff:
  26. BCLR PORT_T,#$8 ;clear bit 3 of Port T
  27. ;MOVB #$F0,PORT_S
  28. BRA PrintTemperature ;exit the interrupt
  29. PrintTemperature:
  30. ;check if the temperature should show
  31. LDAA show_temperature
  32. CMPA #$00
  33. LBEQ Return
  34. ;print the temperature
  35. movb #'T',disp
  36. movb #'e',disp+1
  37. movb #'m',disp+2
  38. movb #'p',disp+3
  39. movb #'e',disp+4
  40. movb #'r',disp+5
  41. movb #'a',disp+6
  42. movb #'t',disp+7
  43. movb #'u',disp+8
  44. movb #'r',disp+9
  45. movb #'e',disp+10
  46. movb #':',disp+11
  47. movb #' ',disp+12
  48. movb #' ',disp+13
  49. movb #' ',disp+14
  50. movb #' ',disp+15
  51. ;next line
  52. movb #'X',disp+16
  53. movb #'Y',disp+17
  54. movb #'Z',disp+18
  55. movb #' ',disp+19
  56. movb #'d',disp+20
  57. movb #'e',disp+21
  58. movb #'g',disp+22
  59. movb #'r',disp+23
  60. movb #'e',disp+24
  61. movb #'e',disp+25
  62. movb #'s',disp+26
  63. movb #' ',disp+27
  64. movb #' ',disp+28
  65. movb #' ',disp+29
  66. movb #' ',disp+30
  67. movb #' ',disp+31
  68. movb #0,disp+32 ;string terminator, acts like '\0'
  69. LDD #disp ;both of these steps are necessary to
  70. jsr display_string ;print to the LCD screen
  71. Return: ;restore registers and accumulators
  72. PULY
  73. PULX
  74. PULD
  75. PULB
  76. PULA
  77. RTS