# Square root of a number (Assembly Language)

; Program to compute squareroot of a number DATA SEGMENT ;INITIALIZE DATA SEGMENT NUM1 DD 125.0 ;INTIALIZE NUM1 ANY DATA. ;WHEN DATA DOUBLE IS DEFINED, DEFINE THE NUMBER WITH DECIMAL RES DD ? ;INITIALIZE RES DATA ENDS ;END OF DATA SEGMENT CODE SEGMENT ;INITIALIZE CODE SEGMENT START: ;START THE CODE ASSUME CS:CODE,DS:DATA ;ASSUMPTION OF CODE AND DATA MOV AX,DATA ;MOVE DATA INTO ACCUMULATOR AX REGISTER … Continue reading Square root of a number (Assembly Language)

# Factorial using FAR PROCEDURE (Assembly Language)

; Program to compute factorial of a number using FAR Procedure DATA SEGMENT ;INITIALIZE DATA SEGMENT NUM1 DW 05H ;INITIALIZE NUM1 ANY DATA RESULT DW ? ;INITIALIZE RESULT DATA ENDS ;END OF DATA SEGMENT MY SEGMENT ;DEFINING OUR OWN SEGMENT ;SYNTAX – XX(SEGMENT NAME) SEGMENT FACT PROC FAR ;DEFINING FAR PROCEDURE ;SYNTAX – XXX(PROCEDURE NAME) PROC FAR(METHOD) MUL CX ;MULTIPLY THE CONTENT OF CX REGISTER … Continue reading Factorial using FAR PROCEDURE (Assembly Language)

# 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)

# 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)