NASM assembly language programming, Assembly Language

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
Posted Date: 10/17/2012 11:10:57 AM | Location : United States

Related Discussions:- NASM assembly language programming, Assignment Help, Ask Question on NASM assembly language programming, Get Answer, Expert's Help, NASM assembly language programming Discussions

Write discussion on NASM assembly language programming
Your posts are moderated
Related Questions
Write a program to mask bits D3D2D1D0 and to set bits D5D4 and to invert bits D7D6 of ax register

take an integer and its base and the base in which you want to convert the number from user and perform conversion.

SHR : Shift Logical Right: This instruction performs bit-wise right shifts on the operand word or byte that might be reside inĀ  a memory location or a register, by the specified c

Why is the capability to relocate processes desirable?

Write a nonrecursive version of the Factorial procedure (Section 8.3.2) that uses a loop. (A VideoNote for this exercise is posted on the Web site.) Write a short program that inte

Cache Memory Caching is a technology based on the memory subsystem of any computer. The majoraim of a cache is to accelerate the computer while keeping the cost of the computer

As an instance of the normal priority mode, imagine that initially AEOI is equal to 0 and all the ISR and IMR bits are clear. Also consider that, as shown in given figure, requests

Program Translation Sequence Developing a software program to accomplish a particular task, the implementer chooses an appropriate language, develops the algorithm (a sequence

Basic Microprocessor Architecture and Interface : Introduction: Intel launches its first 4-bit microprocessor 4004 in the year 1971 and 8-bit microprocessor 8008 in the y

PC Bus and Interrupt System The PC Bus utilized a bus controller, address latches, and data transceivers (bidirectional data buffers). 1) Bus controller : ( Intel 8288 Bus