X-Git-Url: http://git.squeep.com/?p=dcpu16;a=blobdiff_plain;f=docs%2Fclock.txt;fp=docs%2Fclock.txt;h=71bbc8ba22a4088132420b6d48adefa5df0b62d6;hp=0000000000000000000000000000000000000000;hb=19bb0a4e64c9ab3e62ff4bbd959289704ee5b8f1;hpb=0a6b0889c67675bd71681ec41774d2ea57ce5335 diff --git a/docs/clock.txt b/docs/clock.txt new file mode 100644 index 0000000..71bbc8b --- /dev/null +++ b/docs/clock.txt @@ -0,0 +1,17 @@ +Name: Generic Clock (compatible) +ID: 0x12d0b402 +Version: 1 + +Interrupts do different things depending on contents of the A register: + + A | BEHAVIOR +---+---------------------------------------------------------------------------- + 0 | The B register is read, and the clock will tick 60/B times per second. + | If B is 0, the clock is turned off. + 1 | Store number of ticks elapsed since last call to 0 in C register + 2 | If register B is non-zero, turn on interrupts with message B. If B is zero, + | disable interrupts +---+---------------------------------------------------------------------------- + +When interrupts are enabled, the clock will trigger an interrupt whenever it +ticks.