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
Using the windows32 framework, write a complete 80x86 program for Programming Exercises 4.3 number 3, on pages 130-131 of the textbook. Follow all coding conventions mentioned in

what is double hashing

Assembly Code for Reading Flow & Generating Serial Output The timer is timer 1 is set for the baud rate 9600, as the crystal used is of 11.0592 Hz.  Then the timer 1 is starte

Write a program that will input a number from the keyboard, and then display the number in binary form, as well as the number of one's in the number. Hint: Shift the value left (or

#write a program 8086 to find the largest number

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

RCR: Rotate Right through Carry:- This instruction rotates the contents  bit-wise of the destination operand right by the specified count through carry flag (CF). For each operati

Intel 8259 interrupt controller :  The 8088 processor has only two interrupt control inputs, and interrupt request (INTR) and non mask able interrupt (NMI). NMI are interrupts t

Program : Write a program to perform a one byte BCD addition. Solution : It is consider that the operands are in BCD form, but the CPU considers it as hexadecimal and acco

;StrNCpyAsm - copy zero terminated string2 to zero terminated string1, ; but copy no more than count (parameter) characters ; or the length of string2, whi