main:
days_checks: if b3=0 then goto monday
if b3=1 then goto tuesday
if b3=2 then goto wednesday
if b3=3 then goto thursday
if b3=4 then goto friday
if b3=5 then goto saturday
if b3=6 then goto sunday
Checks: if pin5=1 then goto set_hours
if pin3=1 then goto show_alarm1
if pin6=1 then goto show_alarm2
goto alarm
show_alarm1: serout 7,N2400,(#b5,":",#b4)
alarm_set1: if pin1=1 then goto alarm_hours1
goto alarm1
alarm_hours1: let b4=b4+1
if b4=25 then goto alarm_hours_reset1
goto alarm
alarm_hours_reset1: let b4=0
alarm1: if pin2=1 then goto alarm_minuites1
goto alarm
alarm_minuites1: let b5=b5+1
if b5=60 then goto alarm_minuites_reset1
goto alarm
alarm_minuites_reset1: let b5=0
goto alarm
show_alarm2: serout 7,N2400,(#b7,":",#b6)
alarm_set2: if pin1=1 then goto alarm_hours2
goto alarm2
alarm_hours2: let b6=b6+1
if b6=25 then goto alarm_hours_reset2
goto alarm
alarm_hours_reset2: let b6=0
alarm2: if pin2=1 then goto alarm_minuites2
goto alarm
alarm_minuites2: let b7=b7+1
if b7=60 then goto alarm_minuites_reset2
goto alarm
alarm_minuites_reset2: let b7=0
alarm: if pin0=1 then goto alarm_check1
if pin7=1 then goto alarm_check2
goto seconds
alarm_check1: if b3<5 and b4=b2 and b5=b1 then goto wake_up
goto seconds
alarm_check2: if b3>4 and b6=b2 and b7=b1 then goto wake_up
goto seconds
wake_up: high 1
goto seconds
lock_time: if pin5=1 then goto set_hours
goto alarm
set_hours: if pin1=1 then goto add_hour
goto set_minuites
add_hour: let b2=b2+1
goto set_minuites
set_minuites: if pin2=1 then goto add_minuite
goto set_days
add_minuite: let b1=b1+1
goto set_days
set_days: if pin4=1 then goto add_day
goto alarm
add_day: let b3=b3+1
goto alarm
seconds: let b0=b0+1
pause 1000
if b0=60 then goto minuites
goto main
minuites: let b0=0
let b1=b1+1
serout 7,N2400,(#b1,":",#b2)
if b1=60 then goto hours
goto main
hours: let b1=0
let b2=b2+1
if b2=24 then goto days
goto main
days: let b2=0
let b3=b3+1
goto main
'This was the bit I'm not sure on...
monday: serout 7, N2400, ("Monday ")
goto checks
tuesday: serout 7, N2400, ("Tuesday ")
goto checks
wednesday: serout 7, N2400, ("Wednesday")
goto checks
thursday: serout 7, N2400, ("Thursday ")
goto checks
friday: serout 7, N2400, ("Friday ")
goto checks
saturday: serout 7, N2400, ("Saturday ")
goto checks
sunday: serout 7, N2400, ("Sunday ")
goto checks