Hi sayzer,

Thanks for sending me the link to Melanie's code.

Yea its way over my head, I don't understand the BCD system at all. I checked out BCD on the net and it says it can be used to save RAM space which can result in using half the storage space as compared to storing the same value in hex. If I read and understood that correctly then it would make sense to use it. This is the site where I read that: http://www.danbbs.dk/~erikoest/bcd.htm#top its got links to a lot of useful stuff that you didn't want to know! But I guess its all relevant if you want to learn programming.

This is the BCD code that I didn't understand when I first looked at Melanie's code:
Code:
 ' Subroutine Converts back to BCD
 ' -------------------------------
  ' CounterA is the entry variable
  ' CounterB holds the converted BCD result on exit
ConvertBCD:
 CounterB=CounterA DIG 1
 CounterB=CounterB<<4
 CounterB=CounterB+CounterA DIG 0
 Return
It looks a little similar to this routine below that I found on the link that I posted above:
Code:
SUBROUTINE PACKIT
On Entry: 

Register B contain the upper byte of the BCD number. 
Register C contains the lower byte of the BCD number. 

On Exit: 

Register A contains the Packed BCD Number. 

To pack the number we must: 

A <= (B) 
Rotate A Left 4 times 
A <= (A) + (C) 

That's all. We could enhance our routine by checking to see if 
the first number is zero. If it is, we do not need to rotate
4 times.
I have another question for you if you understand Melanie's ConvertBCD: subroutine above, what does the DIG 1 & DIG 0 do? I've seen it used in some of the code posted here on the forum but I don't understand what its function is?

Oh, and another question, you didn't confirm or not if my last post was a correct way to set the hours registry?

Thanks
jessey