MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / CmdJSR

Function CmdJSR

source/Debugger/Debug.cpp:2786–2803  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

2784
2785//===========================================================================
2786Update_t CmdJSR (int nArgs)
2787{
2788 if (! nArgs)
2789 return Help_Arg_1( CMD_JSR );
2790
2791 WORD nAddress = g_aArgs[1].nValue & _6502_MEM_END;
2792
2793 // Push PC onto stack
2794 WriteByteToMemory(regs.sp, ((regs.pc >> 8) & 0xFF));
2795 regs.sp--;
2796 WriteByteToMemory(regs.sp, ((regs.pc >> 0) - 1) & 0xFF);
2797 regs.sp--;
2798
2799 // Jump to new address
2800 regs.pc = nAddress;
2801
2802 return UPDATE_ALL;
2803}
2804
2805
2806//===========================================================================

Callers

nothing calls this directly

Calls 2

Help_Arg_1Function · 0.85
WriteByteToMemoryFunction · 0.85

Tested by

no test coverage detected