# Factorial using MACRO (Assembly Language)

; Program to compute factorial of a number using macro FACT MACRO F ;DEFINING FACT MACRO ;SYNTAX – XX(NAME OF MARCO) MACRO XX(OBJECT) UP: ;KIND OF LABEL TO LOOP BACK TO THE DESIRED LOCATION MUL F ;MULTIPLY THE NUMBER IN THE F REGISTER DEC F ; DECREMENT THE NUMBER JNZ UP ; JUMP IF NOT ZERO TO UP BACK ENDM ; END OF MACRO DATA … Continue reading Factorial using MACRO (Assembly Language)

# Fibonnaci Sequence of a given number (Assembly Language)

; Program to compute fibonnaci sequence of a given number DATA SEGMENT ;INITIALIZE DATA SEGMENT COUNT DW 0AH ;INITIALIZE COUNT TO 0AH ANY DATA RES DB 10 DUP(?) ;INITIALIZE RESULT DATA ENDS ;END OF DATA SEGMENT CODE SEGMENT ;INTIALIZE CODE SEGMENT START: ;START THE CODE ASSUME CS:CODE,DS:DATA ;ASSUMPTION OF CODE AND DATA MOV AX,DATA ;MOVE DATA INTO THE ACCUMULATOR AX REGISTER MOV DS,AX ;MOVE AX … Continue reading Fibonnaci Sequence of a given number (Assembly Language)

# Compute 2x (Assembly Language)

; Program to compute 2x DATA SEGMENT ;INITIALIZE DATA SEGMENT NUM1 DD 0.5 ;INTIALIZE NUM AS 0.5H ;NOTE IN EXAM DONT INITIALIZE NUM1 MORE THAN 0.9 ;RANGE SHOULD BE 0.1-0.9H ONLY ;REASON BECAUSE THE COMMAND F2XM1 WHERE ;X SHOULD BE SPECIFIED WITHING 0 > X < 1 RES DD ? ;INITIALIZE RES DATA ENDS ;END OF DATA SEGMENT CODE SEGMENT ;INITIALIZE CODE SEGMENT START: ;START … Continue reading Compute 2x (Assembly Language)

# Division of 16-bit Nos (Assembly Language)

; Program to compute 16 bit division of the data. DATA SEGMENT                            ;INITIALIZE DATA SEGMENT NUM1 DW 4567H , 2345H         ;INITIALIZE NUM1 ANY DATA.WE HAVE INITIALIZED DIVIDEND AS 32 BIT – 23454537H NUM2 DW 4111H                           … Continue reading Division of 16-bit Nos (Assembly Language)

# Multiplication of 16-bit Nos (Assembly Language)

; Program to compute 16 bit multiplication of the data. DATA SEGMENT                ;INITIALIZE DATA SEGMENT NUM1 DW 4537H               ;INITIALIZE NUM1 ANY DATA NUM2 DW 2222H               ;INITIALIZE NUM2 ANY DATA RESULT DW 2 DUP(0)     ;INITIALIZE RESULT AS DATA WORD WITH OFFSET=2. ;IF RESULT … Continue reading Multiplication of 16-bit Nos (Assembly Language)