View Single Post
Old 07 July 2019, 17:48   #1153
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 51
Posts: 1,146
You can use this code, if you want, and if it works.


Code:
; Input d1=longword
; Output d1=longword reversed
REVERSE_LONGWORD:
	movem.l	d0/a0,-(a7)
	lea	BYTE_REVERSE_TAB(a4),a0

	moveq	#0,d0
	move.b	d1,d0
	move.b	(a0,d0.w),d1
	ror.w	#8,d1
	move.b	d1,d0
	move.b	(a0,d0.w),d1
        swap    d1
	move.b	d1,d0
	move.b	(a0,d0.w),d1
	ror.w   #8,d1
	move.b	d1,d0
	move.b	(a0,d0.w),d1
	movem.l	(a7)+,d0/a0
	rts
Don_Adan is offline  
 
Page generated in 0.03990 seconds with 11 queries