Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (44 sloc) 1.07 KB
;#######################################
;# func_pusha #
;# #
;# Description: #
;# Pushes all registers to the stack #
;# and removes the value pushed by JSR #
;# fom calling this function. #
;#######################################
:pusha_ret_address
.dat 0
.globl func_pusha
:func_pusha
SET [pusha_ret_address], POP
SET PUSH, A
SET PUSH, B
SET PUSH, C
SET PUSH, X
SET PUSH, Y
SET PUSH, Z
SET PUSH, I
SET PUSH, J
SET PC, [pusha_ret_address]
;#######################################
;# func_popa #
;# #
;# Description: #
;# Pops all registers to the stack #
;# and removes the value pushed by JSR #
;# fom calling this function. #
;#######################################
:popa_ret_address
.dat 0
.globl func_popa
:func_popa
SET [popa_ret_address], POP
SET J, POP
SET I, POP
SET Z, POP
SET Y, POP
SET X, POP
SET C, POP
SET B, POP
SET A, POP
SET PC, [popa_ret_address]