Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

blem Definition: Write a program to calculate composite numbers. First, the user is instructed to enter the number of composites to be displayed, and is prompted to enter an integer in the range [...

1 answer below »
blem Definition: Write a program to calculate composite numbers. First, the user is instructed to enter the number of composites to be displayed, and is prompted to enter an integer in the range [ XXXXXXXXXX]. The user enters a number, n, and the program verifies that 1 ≤ n ≤ 400. If n is out of range, the user is reprompted until s/he enters a value in the specified range. The program then calculates and displays all of the composite numbers up to and including the nth composite. The results should be displayed 10 composites per line with at least 3 spaces between the numbers.
Answered Same Day Jul 12, 2021

Solution

Neha answered on Jul 13 2021
144 Votes
INCLUDE Irvine32.inc
.data
    MAX    EQU    400
    MIN    EQU    1
    PAGE_MAX EQU    50
    COL_MAX    EQU    10        
    INTRO    BYTE        "Composite Numbers", 13, 10,
                    "Authored by StudentName", 0
                                            
    INPUT    BYTE    "Enter the amount of composite numbers you would like to see.", 13, 10,
                    "I will accept orders up to 400 composites.", 0
    INPUTERROR    BYTE    "Enter the number of composite numbers you would like to display.", 13, 10,
                    "[1...400]: ", 0
    RANGE    BYTE    "You are out of bounds. Try again. [1..400]", 0
    NEWPAGE    BYTE "Press any key for the next page.", 0
    NUMBER        DWORD    ?
    EXIT        BYTE    "Results certified by StudentName. GoodBye.", 0
    COLUMN        DWORD    0    
    TESTVALUE        DWORD    4    
    COUNT        DWORD    ?    
    PAGING        DWORD    ?    
    primes        DWORD    2, 3, 5, 7, 0
    
    colBuffer1    BYTE    " ", 0
    colBuffer2    BYTE    " ", 0
    colBuffer3    BYTE    " ", 0
.code
introduction    PROC    
    mov    edx, OFFSET INTRO
    call WriteString
    call CrLf
    call CrLf
    
    mov edx, OFFSET intro_EC
    call WriteString
    call CrLf
    mov edx, OFFSET intro_EC2
    call WriteString
    call CrLf
    call...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here