added doc files, test for display
[dcpu16] / docs / clock.txt
diff --git a/docs/clock.txt b/docs/clock.txt
new file mode 100644 (file)
index 0000000..71bbc8b
--- /dev/null
@@ -0,0 +1,17 @@
+Name: Generic Clock (compatible)\r
+ID: 0x12d0b402\r
+Version: 1\r
+\r
+Interrupts do different things depending on contents of the A register:\r
+\r
+ A | BEHAVIOR\r
+---+----------------------------------------------------------------------------\r
+ 0 | The B register is read, and the clock will tick 60/B times per second.\r
+   | If B is 0, the clock is turned off.\r
+ 1 | Store number of ticks elapsed since last call to 0 in C register\r
+ 2 | If register B is non-zero, turn on interrupts with message B. If B is zero,\r
+   | disable interrupts\r
+---+----------------------------------------------------------------------------\r
+\r
+When interrupts are enabled, the clock will trigger an interrupt whenever it\r
+ticks.\r