]> git.sur5r.net Git - cc65/blob - libsrc/geos-common/process/processsleep.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / geos-common / process / processsleep.s
1 ;
2 ; Maciej 'YTM/Elysium' Witkowiak
3 ;
4 ; 30.10.99, 15.8.2003
5
6 ; void Sleep (int jiffies);
7
8             .importzp ptr1
9             .importzp tmp1
10             .export _Sleep
11
12             .include "jumptab.inc"
13             .include "geossym.inc"
14
15 _SleepExit:
16         jsr Sleep               ; call Sleep
17         ldx tmp1
18         txs                     ; restore stack pointer
19         jmp (ptr1)              ; when timeouts control will reach here
20
21 _Sleep:
22         sta r0L                 ; store data
23         stx r0H
24         pla
25         sta ptr1
26         pla
27         sta ptr1+1              ; preserve return address
28         inc ptr1
29         bne @L0
30         inc ptr1+1              ; fix return address
31 @L0:    tsx
32         stx tmp1                ; preserve stack pointer
33         jsr _SleepExit          ; call Sleep
34         jmp MainLoop            ; immediate return here - go to idle loop