Difference between revisions of "Dobbertin Smart Watch:RTC routines"

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search
(Created page with "These are the low level routines of FutureOS to read and write the Dobbertin RTC, written by TFM. They show how to read and write the RTC itself. <pre> ;TFM of Futur...")
 
Line 1: Line 1:
These are the low level routines of [[FutureOS]] to read and write the Dobbertin RTC, written by [[TFM]]. They show how to read and write the RTC itself.
+
These are the low level routines of [[FutureOS]] to read and write the [[Dobbertin Smart Watch|Dobbertin RTC]], written by [[TFM]]. They show how to read and write the RTC itself.
  
 
<pre>
 
<pre>

Revision as of 13:39, 17 June 2016

These are the low level routines of FutureOS to read and write the Dobbertin RTC, written by TFM. They show how to read and write the RTC itself.


;TFM of FutureSoft - part of FutureOS
;All rights reserved

;Dobb.Uhr Daten ins RAM ab UHR_00 ; AKT_ROM ein
;Mani; AF,BC,DE,HL

LUHR LD BC,(UHR_ROM)

 OUT  (C),C
 LD   A,(&C004)
 LD   DE,&C000
 LD   HL,&C001
 CALL KOAS
 CALL KOAS
 LD   E,4  ;DE=&C004

     LD HL,UHR_00
     LD B,8
RDUL LD A,(DE)

 RRA
 RR  C
 LD  A,(DE)
 RRA
 RR  C
 LD  A,(DE)
 RRA
 RR  C
 LD  A,(DE)
 RRA
 RR  C
 LD  A,(DE)
 RRA
 RR  C
 LD  A,(DE)
 RRA
 RR  C
 LD  A,(DE)
 RRA
 RR  C
 LD  A,(DE)
 RRA
 RR  C
 LD  (HL),C
 INC HL

 DJNZ RDUL
 LD   BC,(AKT_ROM)
 OUT  (C),C
 RET

KOAS LD A,(HL)

 LD A,(DE)
 LD A,(HL)
 LD A,(DE)
 LD A,(DE)
 LD A,(DE)
 LD A,(HL)
 LD A,(HL)
 LD A,(DE)
 LD A,(HL)
 LD A,(DE)
 LD A,(HL)
 LD A,(HL)
 LD A,(HL)
 LD A,(DE)
 LD A,(DE)
 LD A,(HL)
 LD A,(HL)
 LD A,(DE)
 LD A,(DE)
 LD A,(DE)
 LD A,(HL)
 LD A,(DE)
 LD A,(HL)
 LD A,(DE)
 LD A,(DE)
 LD A,(HL)
 LD A,(HL)
 LD A,(HL)
 LD A,(DE)
 LD A,(HL)
 LD A,(DE)

 RET


;Uhr-Daten schreiben
;-------------------
;DE=8 Bytes in.Page, Dobb.komp
;Mani; AF,BC,E,HL,BC',DE',HL'
;AKT_ROM aktiv

SUHR EXX

 LD BC,(UHR_ROM):OUT (C),C
 LD A,(&C004)
 LD DE,&C000
 LD HL,&C001
 CALL KOAS
 CALL KOAS
 EXX
 LD BC,&0800
 LD H,&C0

SUGL LD A,(DE):SCF
SUNB RR A:JR Z,SUZZ

 LD L,C
 RL L
 LD L,(HL)
 JR SUNB

SUZZ INC E

 DJNZ SUGL
 LD BC,(AKT_ROM):OUT (C),C
 RET