browser

Devices

devices
calendarsave
xyw provides a way to interface with external systems using memory-mapped devices, just like Uxn. Devices are always mapped to page $FF, and can typically be easily accessed via macros. The xyw specification defines five default devices, each taking up to 16 bytes of memory (a row of a memory page), but an additional eleven devices could be implemented and mapped to the remaining rows. The following sections describe each device and their mapped addresses. === system
;system
.macro system.state           $00
.macro system.error           $01
.macro system.page            $03
.macro system.random          $04
.macro system.on_error        $06
=== terminal
;terminal
.macro terminal.input          $10
.macro terminal.output         $11
.macro terminal.on_keypress    $12
.macro terminal.on_argument    $14
=== clock
;clock
.macro clock.year             $20
.macro clock.month            $22
.macro clock.monthday         $23
.macro clock.weekday          $24
.macro clock.hour             $25
.macro clock.minute           $26
.macro clock.second           $27
.macro clock.timer            $28
.macro clock.on_timer         $2A
=== file
;file
.macro file.path              $30
.macro file.type              $32
.macro file.size              $33
.macro file.success           $35
.macro file.length            $37
.macro file.read              $39
.macro file.write             $3B
.macro file.operation         $3D
=== beeper
;beeper
.macro beeper.pitch           $40
.macro beeper.length          $42
.macro beeper.level           $44