;Program to find out factorial of number in 8086 assembly language
data segment
number dw 04h
ends
stack segment
dw 128 dup(0)
ends
code segment
assume cs:code, ds:data
start:
; set segment registers:
mov ax, data
mov ds, ax
mov cx,number
call fact
mov ax, 4c00h ; exit to operating system.
int 21h
;procedure for factorial program
;assume cx contains input number
;assume Dx contains result
fact proc near
cmp cx, 01h
jne cont
mov dx,01h
ret
cont: push cx ; for backup
dec cx
call fact
pop ax ; backup of cx ie n
mul dx ; n*(n-1)!
mov dx, ax ; result into dx
ret
fact endp
ends
end start ; set entry point and stop the assembler.
data segment
number dw 04h
ends
stack segment
dw 128 dup(0)
ends
code segment
assume cs:code, ds:data
start:
; set segment registers:
mov ax, data
mov ds, ax
mov cx,number
call fact
mov ax, 4c00h ; exit to operating system.
int 21h
;procedure for factorial program
;assume cx contains input number
;assume Dx contains result
fact proc near
cmp cx, 01h
jne cont
mov dx,01h
ret
cont: push cx ; for backup
dec cx
call fact
pop ax ; backup of cx ie n
mul dx ; n*(n-1)!
mov dx, ax ; result into dx
ret
fact endp
ends
end start ; set entry point and stop the assembler.
Role of Parser
ReplyDeleteFlat Panel Display
Naming Distributed system
Conversion from NFA to DFA (Thompson’s rule)
virtual mode 80386
time shared common bus
mapping cardinality
rsa algorithm
Give the outpolute in this program pleas
ReplyDeleteGive the output in this program
ReplyDeleteOnline Baccarat at Bet365 - Get $10 Free - FEBCasino
ReplyDeleteYou'll find Baccarat online now as you can for most of the time and it has been entertaining to learn the rules and the rules as well. 바카라 룰 Bet365 Casino is the new