Difference between revisions of "OSWORD &0F"

From BeebWiki
Jump to: navigation, search
(Function code to set date is 15, not 16)
(Tidied up.)
Line 1: Line 1:
 
[[Category:OSWORD]]
 
[[Category:OSWORD]]
 
{{PageTitle|OSWORD &0F (15): Write Real-Time clock}}
 
{{PageTitle|OSWORD &0F (15): Write Real-Time clock}}
 +
__NOTOC__
 
  On entry:
 
  On entry:
   XY?0=length of data passed - function code
+
   XY?0=length of data at XY+1
   XY+1.. value to use.
+
   XY?0=3  Set alarm XY+1=3-byte BCD alarm block
  Functions are:
+
  XY?0=5  Set from XY+1=5-byte centisecond time
  5 - Set time to value in centisecond count since 00:00:00 01-Jan-1900 (where supported)
+
  XY?0=7  Set from  XY+1=7-byte BCD date block, year 1980-2079
  8 - Set time to value in format "HH:MM:SS"
+
  XY?0=8  Set from  XY+1=8-byte BCD date block with century
   15 - Set date to value in format "Day,DD Mon Year"
+
  XY?0=8  Set from  XY+1="hh:mm:ss"
   24 - Set time and date to value in format "Day,DD Mon Year.HH:MM:SS"
+
   XY?0=11  Set from  XY+1="dd mmm yyyy"
 +
  XY?0=15 Set from  XY+1="DDD,dd mmm yyyy"
 +
  XY?0=20  Set from  XY+1="dd mmm yyyy.hh:mm:ss"
 +
   XY?0=24 Set from  XY+1="DDD,dd mmm yyyy.hh:mm:ss"
  
The caller should simply store the length of the passed string at XY?0 and store
+
The caller should simply store the length of the passed data at XY?0 and store
the passed string or data at XY+1. The caller must not put any interpretation on
+
the passed data at XY+1. The caller must not put any interpretation on the data
the string and length it passes, that is entirely the responsibility of the code
+
and length it passes, that is entirely the responsibility of the code that
that implements the call, ''not'' the caller.
+
implements the call, ''not'' the caller.
 +
 
 +
===Data format===
 +
The date string format is "DDD,dd mmm yyyy.hh:mm:ss". The punctuation is normally
 +
irrelevant, the position of the component values is fixed.
 +
 +
BCD date block format:
 +
  +0 year    &00-&99
 +
  +1 month  &01-&12
 +
  +2 date    &01-&31
 +
  +3 day    &01-&07 Sun-Sat or &00 for unsupported
 +
  +4 hour    &00-&59
 +
  +5 minute  &00-&59
 +
  +6 second  &00-&59
 +
  +7 century &19-&20, if omitted, year is 1980-2079
 +
 +
BCD alarm block format:
 +
  +0 hour    &00-&59 or &C0-&FF for 'any'
 +
  +1 minute  &00-&59 or &C0-&FF for 'any'
 +
  +2 second  &00-&59 or &C0-&FF for 'any'
 +
 
 +
==Implementation==
 +
On a system without a Real Time Clock, the MOS passes OSWORD 14 to sideways
 +
ROMs for support.
 +
 
 +
===Master MOS===
 +
The Master MOS 3 and MOS 4 implements subcalls 8,15,24.
 +
 
 +
===Master Compact===
 +
The Master MOS 5 passes all calls to sideways ROMs.
 +
 
 +
===SoftRTC===
 +
The SoftRTC module stores the time and date with the system TIME timer. It
 +
implements subcalls 7,8,11,15,20,24. The SoftRTC module included in HADFS
 +
sets the date with *SETDATE.
 +
 
 +
===I2C Control ROM===
 +
 
 +
===RISC OS===
 +
Implements subcodes 5,8,15,24. The century is read from the system configuration.
 +
 
 +
==Notes==
 +
Have not yet found information to document implementations supporting turning
 +
alarm on/off, and reading alarm setting.
  
 
==See Also==
 
==See Also==
 
* [[OSWORD &0E]]
 
* [[OSWORD &0E]]
* http://mdfs.net/Docs/Comp/BBC/Oswords
+
* https://mdfs.net/Docs/Comp/BBC/Osword/RTCOswords
  
 
[[User:Jgharston|Jgharston]] 12:57, 26 May 2009 (UTC)
 
[[User:Jgharston|Jgharston]] 12:57, 26 May 2009 (UTC)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 00:16, 7 January 2023 (CET)

Revision as of 00:16, 7 January 2023

OSWORD &0F (15): Write Real-Time clock
On entry:
 XY?0=length of data at XY+1
 XY?0=3   Set alarm XY+1=3-byte BCD alarm block
 XY?0=5   Set from  XY+1=5-byte centisecond time
 XY?0=7   Set from  XY+1=7-byte BCD date block, year 1980-2079
 XY?0=8   Set from  XY+1=8-byte BCD date block with century
 XY?0=8   Set from  XY+1="hh:mm:ss"
 XY?0=11  Set from  XY+1="dd mmm yyyy"
 XY?0=15  Set from  XY+1="DDD,dd mmm yyyy"
 XY?0=20  Set from  XY+1="dd mmm yyyy.hh:mm:ss"
 XY?0=24  Set from  XY+1="DDD,dd mmm yyyy.hh:mm:ss"

The caller should simply store the length of the passed data at XY?0 and store the passed data at XY+1. The caller must not put any interpretation on the data and length it passes, that is entirely the responsibility of the code that implements the call, not the caller.

Data format

The date string format is "DDD,dd mmm yyyy.hh:mm:ss". The punctuation is normally
irrelevant, the position of the component values is fixed.

BCD date block format:
 +0 year    &00-&99
 +1 month   &01-&12
 +2 date    &01-&31
 +3 day     &01-&07 Sun-Sat or &00 for unsupported
 +4 hour    &00-&59
 +5 minute  &00-&59
 +6 second  &00-&59
 +7 century &19-&20, if omitted, year is 1980-2079

BCD alarm block format:
 +0 hour    &00-&59 or &C0-&FF for 'any'
 +1 minute  &00-&59 or &C0-&FF for 'any'
 +2 second  &00-&59 or &C0-&FF for 'any'

Implementation

On a system without a Real Time Clock, the MOS passes OSWORD 14 to sideways ROMs for support.

Master MOS

The Master MOS 3 and MOS 4 implements subcalls 8,15,24.

Master Compact

The Master MOS 5 passes all calls to sideways ROMs.

SoftRTC

The SoftRTC module stores the time and date with the system TIME timer. It implements subcalls 7,8,11,15,20,24. The SoftRTC module included in HADFS sets the date with *SETDATE.

I2C Control ROM

RISC OS

Implements subcodes 5,8,15,24. The century is read from the system configuration.

Notes

Have not yet found information to document implementations supporting turning alarm on/off, and reading alarm setting.

See Also

Jgharston 12:57, 26 May 2009 (UTC) Jgharston (talk) 00:16, 7 January 2023 (CET)