Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Commodore » Commodore 8-bit » Setting the clock in the afternoon
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Setting the clock in the afternoon [message #12810] Thu, 16 August 2012 03:19 Go to next message
rusure is currently offline  rusure
Messages: 1030
Registered: March 2012
Karma: 0
Senior Member
;when i run the c128 program below, the cia clock is
;set to a time in the wee hours of the morning. i am
;trying to set the hiorder bit of the cia hour register
;to 1, for an afternoon start time. can this be done?

;for a movie of the a program run, please go to
; https://docs.google.com/open?id=0B80L9cEZ8Ynvb29tQmM1ckJMdE0
;the binary and source files are zipped and avalable here
; https://docs.google.com/open?id=0B80L9cEZ8YnvYXhFUUtHWjhDNWM
*=$1c01
;10 sys7181
..dby $0b1c,$0a00
..byt $9e,'7181',$00,$00,$00
ldy #3
intiaz lda inicia,y
sta $dc08,y
dey
bpl intiaz
lda #$93;clear / home
read01 ldy #$03;cia hours, minutes, seconds, tenths
bplus jsr $ffd2
lda $dc08,y
jsr $b8c2;rom hex byte printer
lda #$3a;delimit cia bytes with colons
dey
bpl bplus
lda #$13
ldx $91;continue until r/s is pressed
bmi read01
rts
inicia .dby $0045,$5992
..end
Re: Setting the clock in the afternoon [message #12811 is a reply to message #12810] Thu, 16 August 2012 03:47 Go to previous messageGo to next message
rusure is currently offline  rusure
Messages: 1030
Registered: March 2012
Karma: 0
Senior Member
On Thursday, August 16, 2012 1:19:44 AM UTC-6, rusure wrote:
> ;for a movie of the a program run, please go to

> ; https://docs.google.com/open?id=0B80L9cEZ8Ynvb29tQmM1ckJMdE0

> ;the binary and source files are zipped and avalable here

> ; https://docs.google.com/open?id=0B80L9cEZ8YnvYXhFUUtHWjhDNWM


For mysterious reasons, the zipped web site only works if it's pasted into the browser's go to field. The movies web site works as expected
Re: Setting the clock in the afternoon [message #13678 is a reply to message #12810] Fri, 24 August 2012 09:11 Go to previous messageGo to next message
ceratophyllum is currently offline  ceratophyllum
Messages: 4
Registered: March 2012
Karma: 0
Junior Member
On 2012-08-16, rusure <r_u_sure@mybluelight.com> wrote:
>

> ;when i run the c128 program below, the cia clock is

> ;set to a time in the wee hours of the morning. i am

> ;trying to set the hiorder bit of the cia hour register

> ;to 1, for an afternoon start time. can this be done?

>

> ;for a movie of the a program run, please go to

> ; https://docs.google.com/open?id=0B80L9cEZ8Ynvb29tQmM1ckJMdE0

> ;the binary and source files are zipped and avalable here

> ; https://docs.google.com/open?id=0B80L9cEZ8YnvYXhFUUtHWjhDNWM

> *=$1c01

> ;10 sys7181

> .dby $0b1c,$0a00

> .byt $9e,'7181',$00,$00,$00

> ldy #3

> intiaz lda inicia,y

> sta $dc08,y

> dey

> bpl intiaz

> lda #$93;clear / home

> read01 ldy #$03;cia hours, minutes, seconds, tenths

> bplus jsr $ffd2

> lda $dc08,y

> jsr $b8c2;rom hex byte printer

> lda #$3a;delimit cia bytes with colons

> dey

> bpl bplus

> lda #$13

> ldx $91;continue until r/s is pressed

> bmi read01

> rts

> inicia .dby $0045,$5992

> .end


Shouldn't you be looping through DC0B down to DC09 to set
Time-of-Day?

I'm looking here:

http://http://cbm.csbruce.com/cbm/ftp/reference/assembly.txt

at

DC08 56328 Time-of-Day Clock: 1/10 Seconds
DC09 56329 Time-of-Day Clock: Seconds
DC0A 56330 Time-of-Day Clock: Minutes
DC0B 56331 Time-of-Day Clock: Hours + AM/PM Flag (Bit 7)

Which assembler is that you're using? I'd like to try this out and see
what happens.
Re: Setting the clock in the afternoon [message #13875 is a reply to message #13678] Sun, 26 August 2012 04:00 Go to previous messageGo to next message
Spiro Trikaliotis is currently offline  Spiro Trikaliotis
Messages: 380
Registered: December 2011
Karma: 0
Senior Member
Hello,

Michael Grossman schrieb:
> On 2012-08-16, rusure <r_u_sure@mybluelight.com> wrote:


> Shouldn't you be looping through DC0B down to DC09 to set

> Time-of-Day?


Exactly. The TOD has to be READ and WRITTEN always in the order from
hour to 1/10th seconds.

Why? Because when reading the hour, the TOD is latched. It is unlatched
if reading the 1/10th seconds.

The same occurs when writing: Writing the hours stops the TOD, writing
the 1/10th of seconds restarts it.

This is documented in the 6526 data sheet (cf.
http://zimmers.net/anonftp/pub/cbm/documents/chipdata/, file 6526.zip,
page 6, last paragraph, continued on page 7)

Regards,
Spiro.

--
Spiro R. Trikaliotis
http://www.trikaliotis.net/
Re: Setting the clock in the afternoon [message #13952 is a reply to message #13875] Sun, 26 August 2012 23:53 Go to previous message
rusure is currently offline  rusure
Messages: 1030
Registered: March 2012
Karma: 0
Senior Member
On Sunday, August 26, 2012 2:00:35 AM UTC-6, Spiro Trikaliotis wrote:
> Hello,

>

>

>

> Michael Grossman schrieb:

>

>> On 2012-08-16, rusure <r_u_sure@mybluelight.com> wrote:

>

>

>

>> Shouldn't you be looping through DC0B down to DC09 to set

>

>> Time-of-Day?

>

>

>

> Exactly. The TOD has to be READ and WRITTEN always in the order from

>

> hour to 1/10th seconds.

>

>

>

> Why? Because when reading the hour, the TOD is latched. It is unlatched

>

> if reading the 1/10th seconds.

>

>

>

> The same occurs when writing: Writing the hours stops the TOD, writing

>

> the 1/10th of seconds restarts it.

>

>

>

> This is documented in the 6526 data sheet (cf.

>

> http://zimmers.net/anonftp/pub/cbm/documents/chipdata/, file 6526.zip,

>

> page 6, last paragraph, continued on page 7)

>

>

>

> Regards,

>

> Spiro.

>

>

>

> --

>

> Spiro R. Trikaliotis

>

> http://www.trikaliotis.net/


I was going to write an article about the CIA, when I discovered my ignorance about was more complete than I had known. The program that I had written, purposely delayed referencing the CIA tenths register. The CIA doesn't merely resume keeping time when the tenths register is referred to, time is updated to the Bermuda triangle time that was tracked by either the CIA or computer. Elsewhere on the group, I had started a new thread concerning the CIA when set to 12 midnight am or 12 noon pm. Turns out, I had initiated a CIA thread years ago that covered the same topic. My recent remake of the older thread is definitely inferior.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Release: New version of VICEtoPS
Next Topic: more detailed CIA prublems
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Feb 21 23:53:12 EST 2025

Total time taken to generate the page: 0.02538 seconds