Wednesday, June 23, 2010

Factorial

Buzz It
#make_COM#
; COM file is loaded at CS:0100h
ORG 100h
mov bx,[2000h]
mov ax,01h
mov cx,bx
xx:mul cx
loop xx
mov [2002h],ax
mov [2004h],dx
hlt

Input
[2000H]=05

Output
[2002H]=78

0 comments:

Post a Comment