assignment fact.txt

Embed Size (px)

Citation preview

  • .model smallstack 200.datamsg1 db 13,10,'ENTER NUMBER $',13,10msg2 db 13,10,'ANSWER= $',13,10f db ?n1 db ?n2 db ?ten db 10hndrd db 100.codestart:mov ax,@datamov ds,axmov dx,offset msg1mov ah,09hint 21hmov ah,01hint 21hsub al,48mov ah,00mov f,almov al,fL1: dec f mul f mov cl,f cmp cl,1jnz L1mov bl,almov dx,offset msg2mov ah,09hint 21h

    mov ah,00div hndrdmov n1,ahmov dl,n1mov ah,00mov al,dldiv tenmov dl,ahmov n2,dladd dl,48mov ah,02hint 21h

    mov ah,4chint 21hend start