]> git.sur5r.net Git - cc65/blob - libsrc/runtime/tosint.s
Added mouse module from C64
[cc65] / libsrc / runtime / tosint.s
1 ;
2 ; Ullrich von Bassewitz, 25.10.2000
3 ;
4 ; CC65 runtime: Convert tos from long to int
5 ;
6
7         .export         tosint
8         .import         incsp2
9         .importzp       sp
10
11 ; Convert TOS from long to int by cutting of the high 16bit
12
13 .proc   tosint
14
15         pha
16 .ifpc02
17         lda     (sp)
18 .else
19         ldy     #0
20         lda     (sp),y          ; sp+1
21 .endif
22         ldy     #2
23         sta     (sp),y
24         dey
25         lda     (sp),y
26         ldy     #3
27         sta     (sp),y
28         pla
29         jmp     incsp2          ; Drop 16 bit
30
31 .endproc