If I use the LCD to check, I get 21 for both values of AlarmH1 and alarmhour, so the two do match... and I've tried PortB.5 just in case port D wasn't set for output (well it's been along day !)

Code:
LCDOut $FE, $D4,"value = ",  # alarmh1, #alarmhour