1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-27 20:48:05 +11:00
collapseos/blk/461
Virgil Dupras 8bf6258673 Add word TICKS
Adding a delay such as the 20ms one we have in AVR programmer's
initialization routine is tricky without a word like TICKS.

This implementation is highly inaccurate, but more accurate and
reliable than a "ballpark" DO..LOOP...
2020-09-25 17:31:06 -04:00

10 lines
342 B
Plaintext

( See comment in B321. TODO: test on real hardware. in qemu,
the resulting delay is more than 10x too long. )
CODE TICKS 1 chkPS, ( n=100us )
SI DX MOVxx, ( protect IP )
AX POPx, BX 100 MOVxI, BX MULx,
CX DX MOVxx, ( high ) DX AX MOVxx, ( low )
AX 0x8600 MOVxI, ( 86h, WAIT ) 0x15 INT,
DX SI MOVxx, ( restore IP )
;CODE