more detailed CIA prublems [message #13163] |
Sun, 19 August 2012 17:52  |
rusure
Messages: 1030 Registered: March 2012
Karma: 0
|
Senior Member |
|
|
;please discard my recent posts on my cia difficulties.
;
;for the cia, i use the convention that for am times, the hiorder
;bit of the hour register is clear and for pm times the hour
;hiorder bit is set. the cia represents times by the bcd numeral
;system. my program converts ordinary decimal numerals to bcd.
;when the cia is set to 11:59:45.0 am, the cia rolls over in 15
;seconds to 12 noon pm. when set to 11:59:45.0 pm, the time will
;roll over to 12 midnight am. this works well for most times the
;cia clock is set to. the cia clock gets flaky when setting the
;hour register to 12 midnight am or to 12 noon pm. when the hour
;register is set to 12 am, my progam stores a clear hiorder bit
;in the hour register. the cia then overides my clear hiorder
;bit by setting the hour register hiorder bit for me(?). the
;cia will then roll over to 1 pm. the cia clears the hiorder
;hour register bit when it is set to 12 pm. the cia then rolls
;over to 1 am. this flaw probably came about because it was
;assumed that the cia hour register would only roll over to
;12. the instant the hour register becomes 12, the hiorder bit
;is "exclusive ored". the operation is performed regardless of
;whether a roll over to 12 just occurred or the hour was set.
;two work arounds are available. one work around is to set the
;hour registernd here to 00. i haven't thought of what could go wrong,
;but the cia never rolls over to 00. another way is to set the
;hour to 12 am when 12 pm is needed or 12 pm when the hour should
;be 12 am. i uploaded a movie to google drive to show what
;happens when my c64 program is used to set the cia hour to 12.
;the movie can be found here :
; https://docs.google.com/open?id=0B80L9cEZ8YnvN2hyeVRUTTBCeDg
;a zipped file containing the program source and binary files
;plus a copy of the source as a standard ascii file can be found
;here : https://docs.google.com/open?id=0B80L9cEZ8YnvSEtPSU9vOEI0Unc
|
|
|
Re: more detailed CIA prublems [message #13240 is a reply to message #13163] |
Mon, 20 August 2012 13:28   |
James @ cbm264
Messages: 419 Registered: March 2012
Karma: 0
|
Senior Member |
|
|
On Aug 19, 4:52 pm, rusure <r_u_s...@mybluelight.com> wrote:
> ;for the cia, i use the convention that for am times, the hiorder
> ;bit of the hour register is clear and for pm times the hour
> ;hiorder bit is set. the cia represents times by the bcd numeral
> ;system. my program converts ordinary decimal numerals to bcd.
> ;when the cia is set to 11:59:45.0 am, the cia rolls over in 15
> ;seconds to 12 noon pm. when set to 11:59:45.0 pm, the time will
> ;roll over to 12 midnight am. this works well for most times the
> ;cia clock is set to. the cia clock gets flaky when setting the
> ;hour register to 12 midnight am or to 12 noon pm.
I refer you to a previous discussion:
http://groups.google.com/group/comp.sys.cbm/browse_thread/th read/ef1b1574ab1548ec/
*wink and nudge*
-J
|
|
|
|