;	WinSTon

;	UNLK An

;	XNZVC
;	-----

PUBLIC _unlk_an

;-----------------------------------------------------------------------
;UNLK An
_unlk_an PROC NEAR
	mov		edx,DECODE_1[ecx]						;An 'edx'
		
	mov		ebx,[edx]								;An		
	mov		ebp,ebx									;An(SP)
	MASK_24BIT_ADDR(ebp)							;as 24-bit address in PC memory

	mov		ebp,DWORD PTR _STRam[ebp]				;(SP) (wrong endian)
	bswap	ebp
	mov		[edx],ebp								;An = (SP)

	add		ebx,SIZE_LONG							;Error in Devpac handbook? Listed as SIZE_WORD
	mov		_Regs[REG_A7*4],ebx						;Save SP
	FRET
_unlk_an ENDP
