<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.amstrad-cpc.net/index.php?action=history&amp;feed=atom&amp;title=SYMBiFACE_II%3ARTC_routines</id>
	<title>SYMBiFACE II:RTC routines - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.amstrad-cpc.net/index.php?action=history&amp;feed=atom&amp;title=SYMBiFACE_II%3ARTC_routines"/>
	<link rel="alternate" type="text/html" href="https://wiki.amstrad-cpc.net/index.php?title=SYMBiFACE_II:RTC_routines&amp;action=history"/>
	<updated>2026-09-05T01:30:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.amstrad-cpc.net/index.php?title=SYMBiFACE_II:RTC_routines&amp;diff=19563&amp;oldid=prev</id>
		<title>Polluks: typo</title>
		<link rel="alternate" type="text/html" href="https://wiki.amstrad-cpc.net/index.php?title=SYMBiFACE_II:RTC_routines&amp;diff=19563&amp;oldid=prev"/>
		<updated>2015-04-15T12:44:34Z</updated>

		<summary type="html">&lt;p&gt;typo&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:44, 15 April 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l18&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rtc_status_c    equ #0c     ;Status C&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rtc_status_c    equ #0c     ;Status C&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rtc_memtest     equ #0f     ;ram test&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rtc_memtest     equ #0f     ;ram test&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rtc_mil         equ #32     ;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;millenium &lt;/del&gt;(19-20)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rtc_mil         equ #32     ;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;millennium &lt;/ins&gt;(19-20)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;timadr  db rtc_status_b,rtc_sec,rtc_hour,rtc_min,rtc_month,rtc_day,rtc_year,rtc_mil,rtc_status_b&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;timadr  db rtc_status_b,rtc_sec,rtc_hour,rtc_min,rtc_month,rtc_day,rtc_year,rtc_mil,rtc_status_b&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         add hl,bc&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         add hl,bc&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         ld a,19&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         ld a,19&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;timset2 ld h,a              ;L=year, H=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;millenium&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;timset2 ld h,a              ;L=year, H=&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;millennium&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         ld (timreg+5),hl&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         ld (timreg+5),hl&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         ld bc,timrtcadr&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         ld bc,timrtcadr&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Polluks</name></author>
	</entry>
	<entry>
		<id>https://wiki.amstrad-cpc.net/index.php?title=SYMBiFACE_II:RTC_routines&amp;diff=19562&amp;oldid=prev</id>
		<title>Prodatron at 15:08, 28 August 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.amstrad-cpc.net/index.php?title=SYMBiFACE_II:RTC_routines&amp;diff=19562&amp;oldid=prev"/>
		<updated>2006-08-28T15:08:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;These are the [[SYMBiFACE II]] realtime clock routines of [[SymbOS]], written by [[Prodatron]]. They show how to read and set the date and time of the RTC.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timrtcadr       equ #fd15&lt;br /&gt;
&lt;br /&gt;
rtc_sec         equ #00     ;actual second (0-59)&lt;br /&gt;
rtc_sec_alarm   equ #01     ;alarm  second (0-59)&lt;br /&gt;
rtc_min         equ #02     ;actual minute (0-59)&lt;br /&gt;
rtc_min_alarm   equ #03     ;alarm  minute (0-59)&lt;br /&gt;
rtc_hour        equ #04     ;actual hour (0-23)&lt;br /&gt;
rtc_hour_alarm  equ #05     ;alarm  hour (0-23)&lt;br /&gt;
rtc_day_week    equ #06     ;day of the week&lt;br /&gt;
rtc_day         equ #07     ;day of the month (1-31)&lt;br /&gt;
rtc_month       equ #08     ;month (1-12)&lt;br /&gt;
rtc_year        equ #09     ;year (0-99)&lt;br /&gt;
rtc_status_a    equ #0a     ;Status A&lt;br /&gt;
rtc_status_b    equ #0b     ;Status B&lt;br /&gt;
rtc_status_c    equ #0c     ;Status C&lt;br /&gt;
rtc_memtest     equ #0f     ;ram test&lt;br /&gt;
rtc_mil         equ #32     ;millenium (19-20)&lt;br /&gt;
&lt;br /&gt;
timadr  db rtc_status_b,rtc_sec,rtc_hour,rtc_min,rtc_month,rtc_day,rtc_year,rtc_mil,rtc_status_b&lt;br /&gt;
        db #87&lt;br /&gt;
timreg  ds 7&lt;br /&gt;
        db #07&lt;br /&gt;
&lt;br /&gt;
;### TIMSET -&amp;gt; Updates SYMBiFACE II RTC&lt;br /&gt;
;### Input      A=seconds, B=minutes, C=hours, D=day (1-31), E=month (1-12), HL=year (1900-2099)&lt;br /&gt;
;### Destroyed  AF,BC,DE,HL,IY&lt;br /&gt;
timset  ld (timreg+0),a         ;*** realtime clock (CPC version)&lt;br /&gt;
        ld (timreg+1),bc&lt;br /&gt;
        ld (timreg+3),de&lt;br /&gt;
        call timset0&lt;br /&gt;
        ld bc,2000&lt;br /&gt;
        or a&lt;br /&gt;
        sbc hl,bc&lt;br /&gt;
        ld a,20&lt;br /&gt;
        jr nc,timset2&lt;br /&gt;
        ld bc,100&lt;br /&gt;
        add hl,bc&lt;br /&gt;
        ld a,19&lt;br /&gt;
timset2 ld h,a              ;L=year, H=millenium&lt;br /&gt;
        ld (timreg+5),hl&lt;br /&gt;
        ld bc,timrtcadr&lt;br /&gt;
        ld iy,timadr&lt;br /&gt;
        ld e,9&lt;br /&gt;
timset3 ld a,(iy+0)&lt;br /&gt;
        out (c),a&lt;br /&gt;
        dec c&lt;br /&gt;
        ld a,(iy+9)&lt;br /&gt;
        out (c),a&lt;br /&gt;
        inc c&lt;br /&gt;
        inc iy&lt;br /&gt;
        dec e&lt;br /&gt;
        jr nz,timset3&lt;br /&gt;
        ret&lt;br /&gt;
&lt;br /&gt;
;### TIMGET -&amp;gt; Read SYMBiFACE II RTC&lt;br /&gt;
;### Output     CF=0 -&amp;gt; A=seconds, B=minutes, C=hours, D=day (1-31), E=month (1-12), HL=year (1900-2099)&lt;br /&gt;
;###            CF=1 -&amp;gt; time is currently been updated; please try again later&lt;br /&gt;
;### Destroyed  F,IY&lt;br /&gt;
timget  ld bc,timrtcadr         ;*** realtime clock (CPC version)&lt;br /&gt;
        ld a,rtc_status_a&lt;br /&gt;
        out (c),a&lt;br /&gt;
        dec c&lt;br /&gt;
        in a,(c)&lt;br /&gt;
        inc c&lt;br /&gt;
        rla&lt;br /&gt;
        ret c                   ;time is currently been updated -&amp;gt; abort&lt;br /&gt;
        ld iy,timadr+1&lt;br /&gt;
        ld e,7                  ;read 7 registers&lt;br /&gt;
timget3 ld a,(iy+0)&lt;br /&gt;
        out (c),a&lt;br /&gt;
        dec c&lt;br /&gt;
        in a,(c)&lt;br /&gt;
        inc c&lt;br /&gt;
        ld (iy+9),a&lt;br /&gt;
        inc iy&lt;br /&gt;
        dec e&lt;br /&gt;
        jr nz,timget3&lt;br /&gt;
        ld hl,(timreg+5)        ;calculate year&lt;br /&gt;
        ld a,h&lt;br /&gt;
        ld h,0&lt;br /&gt;
        ld bc,1900&lt;br /&gt;
        cp 19&lt;br /&gt;
        jr z,timget2&lt;br /&gt;
        ld bc,2000&lt;br /&gt;
timget2 add hl,bc&lt;br /&gt;
        ld a,(timreg+0)         ;get registers&lt;br /&gt;
        ld bc,(timreg+1)&lt;br /&gt;
        ld de,(timreg+3)&lt;br /&gt;
        or a&lt;br /&gt;
        ret&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Programming:SYMBiFACE_II|SYMBiFACE II documentations]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]]&lt;/div&gt;</summary>
		<author><name>Prodatron</name></author>
	</entry>
</feed>