Hi Miro,
I don't know what assembler you're using, or even if this will help you, but most assemblers that can handle both 6502 AND 65816 instructions will let you choose which "mode" you access the SuperCPU in; whether that be Native (65816) or Emulation (6502) modes.
In my assembler (CROSS-32 Meta-Assembler), you can switch the SuperCPU into Emulation mode by simply preceding an instruction with "<", or switch it to Native mode by preceding an instruction with ">". You should always have the SuperCPU in Emulation mode before calling any kernal routines. Here is a brief example from the 65816 table in the CROSS-32 Meta-Assembler that describes how to switch the CPU into both Native and Emulation modes. Your assembler may do it differently:
Hope this helps!
- Will
I don't know what assembler you're using, or even if this will help you, but most assemblers that can handle both 6502 AND 65816 instructions will let you choose which "mode" you access the SuperCPU in; whether that be Native (65816) or Emulation (6502) modes.
In my assembler (CROSS-32 Meta-Assembler), you can switch the SuperCPU into Emulation mode by simply preceding an instruction with "<", or switch it to Native mode by preceding an instruction with ">". You should always have the SuperCPU in Emulation mode before calling any kernal routines. Here is a brief example from the 65816 table in the CROSS-32 Meta-Assembler that describes how to switch the CPU into both Native and Emulation modes. Your assembler may do it differently:
Code Select
; NOTE! THE 65816 TABLE IS WRITTEN WITH THE PROCESSOR
; IN NATIVE MODE WITH M = 0. THEREFORE, MOST
; OF THE OPERANDS IN THE IMMEDIATE ADDRESSING
; INSTRUCTIONS ARE TWO BYTES LONG. TO SPECIFY AN
; IMMEDIATE INSTRUCTION IN EMULATION MODE WITH A
; ONE BYTE OPERAND PLEASE USE A < SIGN.
; I.E.
ADC #<33 ;EMULATION
ADC #33 ;NATIVE
Hope this helps!

- Will