ORG $7510 THERM DC.L 0 ; address (and space) for reading temperature LENNOX DC.L 0 ; address (and space) for airconditioner on/off SETPT DC.L 0 ; address (and space) for thermostat setting ORG $6000 START MOVE.B #78,SETPT ; put 78 degrees as thermostat setting MOVE.B #85,THERM ; put 85 degrees as current temperature BSR AIRCTRL MOVE.B #75,THERM ; put 75 degrees as current temperature BSR AIRCTRL TRAP #9 ORG $6100 AIRCTRL MOVEM.L D0/D1,-(A7) MOVE.B THERM,D0 ; get current temperature MOVE.B SETPT,D1 ; get thermostat setting ADDQ.B #2,D1 ; convert setting to upper limit CMP.B D1,D0 ; too hot? BGE TURNON ; turn unit on SUBQ.B #4,D1 ; convert setting to lower limit CMP.B D1,D0 ; too cold? BLE TURNOFF ; turn unit off BRA AIRDONE TURNON MOVE.B #1,LENNOX ; set on/off port to on BRA AIRDONE TURNOFF MOVE.B #0,LENNOX ; set on/off port to off AIRDONE MOVEM.L (A7)+,D0/D1 RTS