1
0
mirror of https://github.com/cc65/cc65.git synced 2026-03-11 08:41:58 +00:00
Files
cc65/libsrc/runtime/tosint.s
2025-06-22 21:34:41 +00:00

34 lines
624 B
ArmAsm

;
; Ullrich von Bassewitz, 25.10.2000
;
; CC65 runtime: Convert tos from long to int
;
.export tosint
.import incsp2
.importzp c_sp
.macpack cpu
; Convert TOS from long to int by cutting of the high 16bit
.proc tosint
pha
.if (.cpu .bitand ::CPU_ISET_65SC02)
lda (c_sp)
.else
ldy #0
lda (c_sp),y ; c_sp+1
.endif
ldy #2
sta (c_sp),y
dey
lda (c_sp),y
ldy #3
sta (c_sp),y
pla
jmp incsp2 ; Drop 16 bit
.endproc