mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-06 02:20:58 +11:00
8bf6258673
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...
10 lines
342 B
Plaintext
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
|