1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vikki [24]
3 years ago
14

Write an HLA Assembly language program that prompts for a specific int8 value named n and then displays a repeated digit pattern

starting with that number. The repeated digit pattern should show all the numbers from 1 up to n
Computers and Technology
1 answer:
yan [13]3 years ago
3 0

Answer:

Output:

123456

123456

123456

123456

123456

123456

Explanation:

C Code:

#include <stdio.h>

int main() {

int n,i,j;

printf("Gimme a decimal value to use as n:");

scanf("%d",&n);

for(i=0;i<n;i++){

for(j=1;j<=n;j++){

printf("%d",j);

}

printf("\n");

}

return 0;

}

Equivalent assembly program:

.LC0:

.string "Gimme a decimal value to use as n:"

.LC1:

.string "%d"

main:

push rbp

mov rbp, rsp

sub rsp, 16

mov edi, OFFSET FLAT:.LC0

mov eax, 0

call printf

lea rax, [rbp-12]

mov rsi, rax

mov edi, OFFSET FLAT:.LC1

mov eax, 0

call scanf

mov DWORD PTR [rbp-4], 0

.L5:

mov eax, DWORD PTR [rbp-12]

cmp DWORD PTR [rbp-4], eax

jge .L2

mov DWORD PTR [rbp-8], 1

.L4:

mov eax, DWORD PTR [rbp-12]

cmp DWORD PTR [rbp-8], eax

jg .L3

mov eax, DWORD PTR [rbp-8]

mov esi, eax

mov edi, OFFSET FLAT:.LC1

mov eax, 0

call printf

add DWORD PTR [rbp-8], 1

jmp .L4

.L3:

mov edi, 10

call putchar

add DWORD PTR [rbp-4], 1

jmp .L5

.L2:

mov eax, 0

leave

ret

Input:

6

The program was first written with a c code, anf and subsequently translated to an assembly language.

You might be interested in
Charles is having a lot of problems with errors in a very complicated spreadsheet that he inherited from a colleague, and he tur
Kobotan [32]

Charles is having a lot of problems with errors in a very complicated spreadsheet that he inherited from a colleague, and he turns to another co-worker, Seymour, for tips on how to trace errors in the sheet. Seymour tells Charles that all error values begin with the same symbol, so they can be easily identified as errors.

The symbol is A)#.

Explanation:

  • An error is something you have done which is considered to be incorrect or wrong, or which should not have been done.
  • Generally errors are classified into three types: systematic errors, random errors and blunders
  • Error values begin with the same symbol as they are easy to identify. Once an error is identified, it can be corrected.
  • Error correction is the process of detecting errors in transmitted messages and reconstructing the original error-free data. Error correction ensures that corrected and error-free messages are obtained at the receiver side.
  • Error Correction can be handled in two ways: Backward error correction: Once the error is discovered, the receiver requests the sender to retransmit the entire data unit. Forward error correction: In this case, the receiver uses the error-correcting code which automatically corrects the errors.

3 0
4 years ago
Write a pseudocode to add the first 100 even numbers.
Allushta [10]

Even numbers are numbers whigh are divisible by 2. Therefore, the first even number is 2. A pseudocode which adds the first 100 even numbers can be written thus :

counter = 0

sum = 0

interval = 2

while counter < 100 :

sum = sum + interval

interval += 2

counter +=1

print(sum)

  • A counter takes count of the number of values summed

  • Initializes a variable which holds the sum of even values

  • Since even numbers are divisible by 2; every factor ; increase every added value by 2

  • The program ends once counter is 100

Learn more : brainly.com/question/25327166

6 0
2 years ago
Advantages and disadvantages of using the command-line interface to manage files and folders
EastWind [94]
Some advantages are that you will have more control, you can quickly access documents and files, and you can easily preform more advance commands. Some downside are not GUI, you have to know exactly what to type to do the action you need, and you have to experience error codes sometimes with will need you to google what they mean


Hope this helps! And I hope to get brainliest!
5 0
3 years ago
An indicator is a comprehensive analysis of critical information
ioda

Answer:

True.

Explanation:

An indicator is a comprehensive analysis of critical information by an adversary normally providing the whole picture of an agency's capabilities.

Hope this helps!

3 0
4 years ago
What IEEE 802.11 wireless standard supports devices only in the 5GHz range with speeds up to 4.9Gb/s because of accepting data f
yKpoI14uk [10]

The answer is 802.11ac  

802.11ac is a type if IEEE 802.11 wireless standards that supports Multiple Input, Multiple Output antennas on sending and receiving data. This type of wireless connection supports 2.4GHz signal or frequency and data speed transfer up to 4.9Gbps. Each device or antenna can run up to 400Mbps each and the maximum device it can handle is up to 8 antennas.

8 0
3 years ago
Other questions:
  • Rebecca completed work on a computer and is verifying the functionality of the system when she finds a new problem. This problem
    13·1 answer
  • Sending an email to customer support before looking through the site and reading the frequently asked questions is an example of
    5·1 answer
  • Place the following discoverers in the correct chronological order of the timeframe for their discoveries, from earliest to most
    5·1 answer
  • When a person visits a Web site, his or her IP address and the links he or she clicked on are automatically recorded. This is an
    9·1 answer
  • What does the binary odometer show about representing large numbers?
    8·1 answer
  • Brad is joining a big website design firm. He is worried that he may not be able to adapt to the company culture. What can he do
    15·1 answer
  • Segregation based on laws is called _____
    11·2 answers
  • PLZ PLZ PLZ PLZ HELP will mark brainlist What component contains the ROM (Read Only Memory)?
    5·1 answer
  • Heuristics are not always completely accurate.<br><br><br> Correct or wrong?
    10·2 answers
  • What should software firm design for the VR sample at Museum?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!