LDA #arg_C ;load whatever this value is into accumulator PHA LDA #arg_B PHA LDA #arg_A PHA foo: PHX TSX ;stack looks like this: __, X,LOW(PC),HIGH(PC),arg_A,arg_B,arg_C ;stack pointer points to __, as does $100,X after a TSX LDA $0106,X ;LDA #arg_C CLC ADC $0105,X CLC ADC $0104,X ;ADC #arg_A ;we have the desired value in A, now return. PLX