assembly language n(n-1) best version

making return function in assembly make me work so hard with it.
it's simple to give you example of factorial
example: 5! write in assembly language
mov cx,5
push cx
call 200
@
200 push bp
mov bp,sp
cmp cx,0
je ##
sub cx,1
push cx
call 200
#
add sp,2
mov ax,[bp+4]
mul dl ==>ex: ax=al*dl = 1*1
jmp ###
## mov dx,1
### pop bp
ret

0 comments em “assembly language n(n-1) best version”

Post a Comment

 

Personal I.T blogs Copyright © 2011 -- Template created by O Pregador -- Powered by Blogger