;	WinSTon

;	JSR <ea>

;	XNZVC
;	-----

PUBLIC _jsr_ea

;-----------------------------------------------------------------------
;JSR <ea>
_jsr_ea PROC NEAR
	LEFFADDR_LONG									;Load <ea>

	sub		DWORD PTR _Regs[REG_A7*4],SIZE_LONG		;SP-=4
	mov		ebp,_Regs[REG_A7*4]						;SP
	MASK_24BIT_ADDR(ebp)							;as 24-bit address in PC memory
	sub		esi,STRAM_OFFSET						;As ST address space
	and		[_PC],0ff000000h						;Retain top byte of program counter
	or		esi,[_PC]
	bswap	esi										;into wrong endian
	mov		DWORD PTR _STRam[ebp],esi				;Save PC as full 32-bit value

	mov		[_PC],ebx								;Retain top byte of program counter
	MASK_24BIT_ADDR(ebx)
	add		ebx,STRAM_OFFSET						;As PC address space
	mov		esi,ebx									;New program counter
	FRET
_jsr_ea ENDP
