TAK(x,y,z)

Hey I am currently working on the Recursive Takeuchi function with three parameters in Protected mode. I am not sure I am working in the correct direction. Could some one please give me some guidance?

the code I have so far:

title Lab2.asm ;Recursive Takeuchi function with three parameters
; By: [Danielle Jones]
;
.386
.model flat, stdcall

.stack 4096
ExitProcess PROTO, dwExitCode: DWORD

.data
Num byte 00H, 00H, 00H

.code

mov eDx, offset Num

TAK proc Near C, X:byte, Y:byte, Z:byte
@@if: cmp X , Y //is x < y?
jle @@then
jmp @@else

@@then: mov [eDx],Z //if x < y, return z
inc eDx
jmp @@endIf

@@else: mov eAx, X //if x > y, tak(tak(x-1,y,z), tak(y-1, z,x), tak(z-1, x,y))
dec eAx
mov eBx, Y
dec eBx
mov eCx, Z
dec eCx

push X
push Y
push Z
push eAx
push eBx
push eCx
pushfd

push X
push Y
push Z
push eAx
push eBx
push eCx
pushfd

CALL TAK, eAx, Y, Z
CALL TAK, eBx, Z, X
CALL TAK, eCx, X, Y

dec eDx
dec eDx
dec eDx

mov X, [eDx]
inc eDx
mov Y, [eDx]
inc eDx
move Z, [eDx]
jmp @@if

@@endIf:
Ret
popfd
pop eCx
pop eBx
pop eAx
pop Z
pop Y
pop X

TAK Endp

main proc

;have not even thought about

INVOKE ExitProcess, 0

main endp
end main

~GirlDani
[1788 byte] By [GirlDani2005] at [2007-11-20 11:00:50]