I have a question.
If my alarmS == 60 i need to switch inc alarmM and reset the alarmS but I have a question
increment_alarm_second:
inc alarmS ; increment alarmS
cpi alarmS , 0x5A ; 0x3C ; Compare alarmS to 60
breq increment_alarm_minute ; If true, jump incMinute
swap alarmS ; swap here to save registers ( swap nibbles )
cpi alarmS , 0xA0 ; compares alarmS register to an inverted 10
brlo endIncSecal ; branch if lower then an inverted 10 to endIncSecal
incSecTenal:
andi alarmS, 0x0F ; does an AND + increment on the alarmS register
inc alarmS ; increments the alarmS register
swap alarmS ; swaps alarm_s register
ret ; returns from the calll
endIncSecal:
swap alarm_s ; swap back
ret
why is cpi alarmS , 0x5A ? and not 0x3C which is 60..
after that we swap the nibbles and compare it with , 0xA0?? why is this?
Thanks in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…