R1,R2,R3 are registers
START : POP R1
POP R2
COMPARE R2,0
JUMP_EQ DONE_Z
PUSH R2
PUSH R1
SUBTRACT R2,1
PUSH R2
CALL START
POP R3
POP R1
POP R2
MULTIPLY R3,R2
JUMP DONE
DONE_Z:MOVE R3,1
DONE:PUSH R3
PUSH R1
RETURN
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 2 of 2
Thread: Assembly code output
|
Click Here to Expand Forum to Full Width |