When I changed from that huge if...then tree, to the select case (with a little modification however) the code was small enough to fit in the 2k code size, and he problem went away.

this is what I had to do to make the ports come on, and go off, otherwise all other things are the same:

Code:
if T_zone > 0 then
select case current_zone
case 1
HIGH P_zone1
case 2
HIGH P_zone2
case 3
HIGH P_zone3
case 4
HIGH P_zone4
case 5
HIGH P_zone5
case 6
HIGH P_zone6
case 7
HIGH P_zone7
case 8
HIGH P_zone8
case 9
HIGH P_zone9
case 10
HIGH P_zone10
case 11
HIGH P_zone11
case 12
HIGH P_zone12
case 13
HIGH P_zone13
case 14
HIGH P_zone14
case 15
HIGH P_zone15
case 16
HIGH P_zone16
case 17
HIGH P_zone17
case 18
HIGH P_zone18
end select
endif

if T_Zone = 0 then
LOW P_zone1 : LOW P_zone2 : LOW P_zone3 : LOW P_zone4 : LOW P_zone5 : _
LOW P_zone6 : LOW P_zone7 : LOW P_zone8 : LOW P_zone9 : LOW P_zone10 : _ 
LOW P_zone11 : LOW P_zone12 : LOW P_zone13 : LOW P_zone14 : LOW P_zone15 : _
LOW P_zone16 : LOW P_zone17 : LOW P_zone18
endif