Skip to content

Latest commit

 

History

History
executable file
·
242 lines (130 loc) · 5.98 KB

system.md

File metadata and controls

executable file
·
242 lines (130 loc) · 5.98 KB

Time, Alarms and System Commands

Date format

The date format is YYYYMMDD, with an optional fractional part defining the time, as in YYYYMMDD.HHMMSS.

Note: the date format is intentionally different from the format on the HP-48.

Time format

The time format is HH.MMSS with optional hundredths of a second as in HH.MMSSCC.

SetDate

Set current system date.

The date format is YYYYMMDD, with an optional fractional part defining the time, as in YYYYMMDD.HHMMSS. If the fractional part is zero, then the time is not changed.

Note: the date format is intentionally different from the format on the HP-48.

Date+

Add days to a date. The date format is YYYYMMDD, with an optional fractional part defining the time, as in YYYYMMDD.HHMMSS, and an optional unit, as in YYYMMDD_date.

SetTime

Set current time from a stack value HH.MMSSCC.

An HMS value can also be given, as returned by the Time command.

ToHMS

Convert decimal time to HH.MMSS format.

FomHMS

Convert time in HH.MMSS format to decimal time.

HMS+

Add time in HH.MMSS format.

HMS-

Subtract time in HH.MMSS format

Ticks

Return system clock in milliseconds

TEVAL

Perform EVAL and measure elapsed time

Date

Return the current system date as a unit object in the form YYYYMMDD_date. This displays on the stack according to date format settings, in a way similar to what is shown in the header, e.g. 23/Feb/2024 or 2024-02-23.

DateTime

Return the current system date as a unit object in the form YYYYMMDD_date. This displays on the stack according to date format settings, in a way similar to what is shown in the header, e.g. 23/Feb/2024 or 2024-02-23.

DDays

Number of days between dates.

Time

Return the current system time as a unit object in the form HH.MMSS_hms. This displays on the stack as HH:MM:SS.

TSTR

JulianDayNumber

Return the Julian day number for the given date and time

ACK

Acknowledge oldest alarm (dismiss)

ACKALL

Acknowledge (dismiss) all alarms

RCLALARM

Recall specified alarm

STOALARM

Create a new alarm

DELALARM

Delete an existing alarm

FINDALARM

Get first alarm due after the given time

Version

Return DB48X version information as text.

"Version information"

FreeMemory

Return the number of bytes immediately available in memory, without performing a cleanup of temporary values (garbage collection).

See also: GarbageCollect, FreeMemory

AvailableMemory (MEM)

Return the number of bytes available in memory.

Remark: The number returned is only a rough indicator of usable memory. In particular, recovery features consume or release varying amounts of memory with each operation.

Before it can assess the amount of memory available, AvailableMemory removes objects in temporary memory that are no longer being used. Like on the HP48, you can therfore use MEM DROP to force garbage collection. However, there is also a dedicated command for that, GarbageCollect.

See also: FreeMemory, GarbageCollect

GarbageCollect

Perform a clean-up of temporary objects and return number of bytes reclaimed.

In order to speed up normal operations, temporaries are only discarded when necessary to make room. This clean-up process, also called garbage collection, occurs automatically when memory is full. Since garbage collection can slow down calculator operation at undesired times, you can force it to occur at a desired time by executing GarbageCollect.

See also: FreeMemory, Purge

Bytes

Return the size of the object and a hash of its value. On classic RPL systems, teh hash is a 5-nibbles CRC32. On DB48X, the hash is a based integer of the current wordsize corresponding to the binary representation of the object.

For example, the integer 7 hash will be in the form #7xx, where 7 is the value of the integer, and xx represents the integer type, as returned by the Type command.

XHash Size

Type

Return the type of the object as a numerical value. The value is not guaranteed to be portable across versions of DB48X (and pretty much is guarantteed to not be portable at the current stage of development).

If the CompatibleTypes setting is active, the returned value roughly matches the value returned by the HP50G. It always returns 29 for arrays, not 3 (real array) nor 4 (complex array). It returns 1 for both polar and rectangular complex numbers, irrespective of their precision. 128-bit decimal values return 21 (extended real), 32-bit and 64-bit return 0 (real number). The separation between 18 (built-in function) and 19 (built-in command) may not be accurate.

If the DetailedTypes setting is active, the return value is negative, and matches the internal representation precisely. For example, distinct values will be returned for fractions and expressions.

Note The TypeName command returns the type as text, and this is less likely to change from one release to the next. DB48X-only code should favor the use of TypeName, both for portability and readability.

TypeName

Return the type of the object as text. For example, 12 type returns "integer".

PEEK

Low-level read memory address

POKE

Low level write to memory address

NEWOB

Make a new copy of the given object

USBFWUPDATE

PowerOff (OFF)

Turn calculator off programmatically

SystemSetup

Display the built-in system setup

SaveState

Save the machine's state to disk, using the current state if one was previously loaded. This is intended to quickly save the state for example before a system upgrade.

ScreenCapture

Capture the current state of the screen in a dated file stored on the flash storage under the SCREENS/ directory. This is activated by holding 🟨 and O simultaneously. Pressing the keys one after another activates the DisplayMenu.