; Wrapper for use of PrintRadix in C.
; X-Calibre, Phrozen Crew 2000

; C prototype of these functions:
; extern unsigned int __stdcall PrintRadixUnsignedC(char *lpBuffer, unsigned __int64 number, unsigned int radix);
; extern unsigned int __stdcall PrintRadixSignedC(char *lpBuffer, signed __int64 number, unsigned int radix);

.386
.Model Flat, StdCall

.code
include PrintRadix.asm

PrintRadixUnsignedC		PROC	lpBuffer:PTR BYTE, number:QWORD, radix:DWORD
	push	ebp
	mov		ecx, dword ptr [number]
	push	ebx
	mov		ebx, dword ptr [number+sizeof DWORD]
	push	esi
	mov		esi, [radix]
	push	edi
	mov		edi, [lpBuffer]

	call	PrintRadixUnsigned

	pop		edi
	pop		esi
	pop		ebx
	pop		ebp

	ret
PrintRadixUnsignedC		ENDP

PrintRadixSignedC		PROC	lpBuffer:PTR BYTE, number:QWORD, radix:DWORD
	push	ebp
	mov		ecx, dword ptr [number]
	push	ebx
	mov		ebx, dword ptr [number+sizeof DWORD]
	push	esi
	mov		esi, [radix]
	push	edi
	mov		edi, [lpBuffer]

	call	PrintRadixSigned

	pop		edi
	pop		esi
	pop		ebx
	pop		ebp

	ret
PrintRadixSignedC		ENDP

END