[ first install gnusim8085 using
#sudo apt-get install gnusim8085 (ubuntu)
#yum install gnusim8085 (fedora)
]
now just assemble and run the written code below:
lxi sp,27ffh lda var2 cpi 02h jc last mvi d,00h mov e,a dcr a mov c,a call facto xchg shld var jmp end last: lxi h,0001h end: shld var hlt facto: lxi h,0000h mov b,c back: dad d dcr b jnz back xchg dcr c cnz facto ret var: db 00h var2: db 03h ; input the number 3 here, donot give number more than 5



Recent Comments