Question

Write an Assembly program that will produce all divisors for a 1-digit decimal number. For example,...

Write an Assembly program that will produce all divisors for a 1-digit decimal number. For example, if the number is 6, then the outputs will be 1,2,3,6 which are the divisors of 6.

ASSEMBLY program

Homework Answers

Answer #1

The Assembly Program will be as follows :

Try to understand it before implementing it will help you alot

.MODEL SMALL

.STACK 100

.DATA

NUMBER DW 54

.CODE

MAIN PROC

MOV AX,@DATA

MOV DS,AX

MOV AX, NUMBER

MOV BX, 1

MOV CX, 0

WHILE

MOV DX, 0

DIV BX

CMP DX, 0

JE CHECK

MOV AX, NUMBER

INC BX

CMP BX, AX

JL WHILE_

JMP END_

CHECK:

CMP AX, BX

JG INC_

JE INC2_

JMP END_

INC:

ADD CX, 2

MOV AX, NUMBER

INC BX

CMP BX, AX

JL WHILE_:

JMP END_

INC2_:

INC CX

JMP END_

END_:

ADD CX, 48

MOV AH,2

MOV DX, CX

INT 21H

MOV AH, 4CH

INT 21H

MAIN ENDP

END MAIN

RET

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
WRITE A JAVA PROGRAM: The last digit of a credit card number is the check digit,...
WRITE A JAVA PROGRAM: The last digit of a credit card number is the check digit, which protects against transaction errors. The following method is used to veryfy credit card numbers. For the simplicity we can assume that the credit card has 8 digits instead of 16. Following steps explains the algorithm in determining if a credit card number is a valid card.  Starting from the right most digit, form the sum of every other digit. For example, if...
Write an assembly language program that reverses all the bits of a 32-bit number. (Without using...
Write an assembly language program that reverses all the bits of a 32-bit number. (Without using RBIT instruction) Write an assembly language program that checks whether an unsigned number is perfect square or not.
1. Given variables A and B, each holding an 8-bit unsigned number. Write an assembly program...
1. Given variables A and B, each holding an 8-bit unsigned number. Write an assembly program to find the minimum value and put the result into variable C. Example if A > B then C = B. Assume that all variables are stored in registers. - embedded system -
Write a program in Mars MIPS Assembly Language that asks the user for an 8-digit hexadecimal...
Write a program in Mars MIPS Assembly Language that asks the user for an 8-digit hexadecimal and then prints out its 32-bit binary representation, the operation of the function, the format (I, R, or J), the fields associated with the format (op, rs, rt, imm, shamt, funct), and the instruction associated with the hexadecimal. All five parts must be written as functions.
Assembly Language Programming Write a complete assembly program that inputs a small signed integer n, whose...
Assembly Language Programming Write a complete assembly program that inputs a small signed integer n, whose value can fit within 8 bits, and outputs the value of the expression n2 – n + 6. (This is not C++ or Java. Has to be masm file)
given an integer, write a program that displays the number as follows first line         all digits...
given an integer, write a program that displays the number as follows first line         all digits second line   all except first digit third line        all except first two digits ..... last line          the last digit ex) 5 6 7 8 6 7 8 7 8 8
3) Write a program to print out a random number from 1..100. USING ASSEMBLY LANGUAGE
3) Write a program to print out a random number from 1..100. USING ASSEMBLY LANGUAGE
Write the following ANNA assembly language programs. 1.HighestnumberWrite an ANNA assembly program (high.ac) that will continuously...
Write the following ANNA assembly language programs. 1.HighestnumberWrite an ANNA assembly program (high.ac) that will continuously prompt the user for numbers. When the user enters a negative number, print the highest positive number entered by the user and exit the program. Print a zero if they did not enter any positive numbers. 2.DivisionWrite an ANNA assembly program (div.ac) that divides two positive numbers that come from user input and returns both the quotient and the remainder. For example, if the...
given an integer, write a program in C++ that displays the number as follows first line        ...
given an integer, write a program in C++ that displays the number as follows first line         all digits second line   all except first digit ... last line          last digit ex) 5 6 7 8 6 7 8 7 8 8
IN PYTHON : Write a program that asks the user for a number. Write the number...
IN PYTHON : Write a program that asks the user for a number. Write the number to a file called total.txt. Then ask the user for a second number. Write the new number on line 2 with the total for both numbers next to it separated by a comma. Then ask the user for a third number and do the same. Keep asking for numbers until the person puts in a zero to terminate the program. Close the file. Be...