2 ; Ullrich von Bassewitz, 05.08.1998
4 ; CC65 runtime: long conversion routines
8 ; Convert TOS from long to int by cutting of the high 16bit
10 .export tosint, tosulong, toslong, axulong, axlong
11 .import incsp2, decsp2
24 jmp incsp2 ; Drop 16 bit
27 ; Convert TOS from int to long
32 jsr decsp2 ; Make room
52 jsr decsp2 ; Make room
62 lda #$00 ; Positive, high word is zero
71 ; Convert AX from int to long in EAX
80 axlong: cpx #$80 ; Positive?
81 bcc axulong ; Yes, handle like unsigned type