;; Kelvin Sherlock;;	case on; void swapint(int *);; Byteswap an integer;;swapint	START_d	equ 1_rtlb	equ 3intPtr	equ 7	phb		;even up the stack	phd	tsc	tcd		lda [<intPtr]	;deref it	xba		;swap it	sta [<intPtr]	;store it	pld		;clean up the stack	pla	sta 3,s	pla	sta 3,s	plb	rtl		;bye	END	; void swaplong(long *);; Byteswap a long int;;swaplong	START_d	equ 1_rtlb	equ 3longPtr	equ 7	phb		;even up the stack	phd	tsc	tcd		ldy #2	lda [<longPtr]	xba	tax		;store it temporarily	lda [<longPtr],y	;deref it	xba	        	;swap it	sta [<longPtr]	;store it	txa	sta [<longPtr],y	pld		;clean up the stack	pla	sta 3,s	pla	sta 3,s	plb	rtl		;bye	END;;; long swap3 (void *);; turn 12 34 56 into 56 34 12swap3	START_d	equ 1_rtlb	equ 3Ptr	equ 7	phb		;even up the stack	phd	tsc	tcd		lda [<Ptr]	;A=$3412	and #$00ff	;A=$0012	tax		;X=$0012	ldy #1	lda [<Ptr],y	;A=$5634	xba		;A=$3456	tay		;temp storage	pld		;clean up the stack	pla	sta 3,s	pla	sta 3,s	plb	tya	rtl		;bye	END;;; long swaplong2 (long *);swaplong2	START_d	equ 1_rtlb	equ 3longPtr	equ 7	phb		;even up the stack	phd	tsc	tcd		ldy #2	lda [<longPtr],y	;loword	xba	tay	lda [<longPtr]	;hiword of long	xba	tax	pld		;clean up the stack	pla	sta 3,s	pla	sta 3,s	plb	tya	rtl		;bye	END               
