NASM assembly language programming, Assembly Language

Assignment Help:
NASM assembly language program:

Consider a sequence of 19 strictly positive decimal digits, most likely
stored in an array. There are obviously duplicates, and the sequence is
unsorted. You may use the sequence length in your program.

Your job is to compute and print the _median_ of this sequence. Since the
sequence length is odd, the median occupies the central position when the
sequence is sorted.

Sorting the sequence might be challenging as your first assembly-language
program, but there is an easier way. All you need to master is looping,
array indexing, adding 1, and comparing.

Give yourself an auxiliary array ''count'' that records the number of times
each digit appears in the sequence.

A linear scan through the sequence is sufficient to compute ''count''.
A second linear scan through ''count'' is sufficient to compute the median.

This program is to be written in NASM.

Here is an outline of the NASM source text:

segment .data
seq dd 0, 1, 9, 1, 9, 1, 9, 3, 8, 3,
3, 8, 4, 7, 5, 7, 5, 6, 5, 4 ; array of length 20
count dd 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; array of length 10

segment .text
...

Related Discussions:- NASM assembly language programming

CONSTANTS, Ask question #MinimuWHAT ARE CONSTANTS AND WHAT DO THEY DO?m 100...

Ask question #MinimuWHAT ARE CONSTANTS AND WHAT DO THEY DO?m 100 words accepted#

Write an assembly program to simulate a microwave, 1. The microwave has a c...

1. The microwave has a clock (hh:mm:ss am/pm) and the user should be able to change the clock at any time. 2. For cooking the user should first enter the time. The user can ente

Embeded programming, i want to develop traffic light system so which kind o...

i want to develop traffic light system so which kind of software is needed to develop this project?

Program that will display a list of the decades , Write an assembly languag...

Write an assembly language program that will display (print) a list of the Decades 2010, 2020, 2030... 2100 to the screen using a while loop.

Program, Write a program to separate out positive and negative numbers from...

Write a program to separate out positive and negative numbers from a given series of 16-bit hexadecimal numbers.

Cryptography, Write a program that allows a user to encrypt/decrypt a mess...

Write a program that allows a user to encrypt/decrypt a message using a shift cipher. The user should specify the key and the message. Your program should be able to handle messa

Odd and even numbers, hi, i''m new to assembly language and my teacher told...

hi, i''m new to assembly language and my teacher told us to look for an example of the odd and even numbers program using debug.exe in ms dos as a guide since we just started. plea

Data copy/transfer instructions-microprocessor, Data copy/transfer Instruct...

Data copy/transfer Instructions MOV: This data transfer instruction transfers data from one register or memory location to another register or memory location. The source can

2 homework assignements, I have two homework assignments due in 10 hours fo...

I have two homework assignments due in 10 hours for the x86 processor assembly language

Cobol, #I submitted my assignment this morning and it is still processing. ...

#I submitted my assignment this morning and it is still processing. How long does it take?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd