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 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.
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
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...
Write an ARM assembly program that calculates the number of leading ones in a 64-bit integer.
Write an ARM assembly program that calculates the number of leading ones in a 64-bit integer.
Write a mips assembly language program that asks the user to enter and integer number and...
Write a mips assembly language program that asks the user to enter and integer number and read it. Then ask him to enter a bit position (between 0 and 31) and display the value of that bit.
Write a MIPS Assembly Language program which runs interactively to convert between decimal, binary, and hexadecimal....
Write a MIPS Assembly Language program which runs interactively to convert between decimal, binary, and hexadecimal. 1. Request input data type. 2. Request input data. 3. Request output data type. 4. Output the data. The suggested approach was to take the input data as a string. But I am really lost as to how to process the string and then converting it to another data type. Thanks for the help!
In Assembly x86 please Write an assembly program(call it lab6_file1.asm)that contains 10 double words in memory...
In Assembly x86 please Write an assembly program(call it lab6_file1.asm)that contains 10 double words in memory in the .data section where the first five initialized to 0 and the last five are initialized to 1. In addition, reserve ten uninitialized double words in .bss section. Using a loop, write an assembly program that copies the ten initialized values into the ten reserved double words, starting at the last position, moving to the first(reverse order the data in your uninitialized array)....
In Java. Write a program that reads-in a times table-number. The program, using this table-number will...
In Java. Write a program that reads-in a times table-number. The program, using this table-number will produce the following report (as shown). The first item in the report is a number with starting value 1. Second column is the word “ X ” (representing the times symbol). Third column is the table-number (itself). Following is an equal sign “ = “ (representing a result). Last column is the result of the operation for that line or row which is the...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT