all repos — xyw @ f7ccbf798fee75d4683cbd94112348d3160bfc57

A minimal virtual machine and assembler for terminals.

examples/lib/macros.xyw

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
;;; Devices

;system
.macro system.state           $00
.macro system.error           $01
.macro system.ssp             $02
.macro system.usp             $03
.macro system.page            $04
.macro system.random          $05
.macro system.on_error        $06

;terminal
.macro terminal.input          $10
.macro terminal.output         $11
.macro terminal.on_keypress    $12
.macro terminal.on_argument    $14

;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
.macro file.path              $30
.macro file.operation         $32
.macro file.state             $33
.macro file.type              $34
.macro file.read              $35
.macro file.write             $36
.macro file.append            $37

;beeper
.macro beeper.state           $40
.macro beeper.samples         $41
.macro beeper.n_samples       $43
.macro beeper.on_stop         $45

;;; Other macros

.macro MOD DIV POP
.macro LBYTE SWP POP
.macro PUTC $11 STB
.macro NL $0A PUTC
.macro SP $20 PUTC
.macro arg.sep $1E
.macro arg.end $1D