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
how to code

* * * * **** * * * * * How can i print this help me pls

$NOMOD51 $NOSYMBOLS ;***************************************************************************** ; Spring 2013 Project ; ; FILE NAME : Project.ASM ; DATE : 3/30/20

8279 Keyword /Display Controller : Figure shows the structure of 8279 and its interface to the bus. Addressing is according to the table given below. CS        RD

You have to write a subroutine (assembly language code using NASM) for the following equation.

Write a MC68H12 assembly language program to find the largest number in an array of ten 8-bit numbers. The array is stored in memory locations starting at address $1100. Use branch

INT N : Interrupt Type N:- In the interrupt structure of 8086/8088, 256 interrupts are distinct equivalent to the types from OOH to FFH. When an instruction INT N is executed,

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

Write an Lc-3 assembly language program to read in a sequence of single-digit positive integers from the keyboard(one integer per line) until the sentinel value of 0 is reached and

Ask 2. Exchange higher byte of AX and higher byte of BX registers by using memory location 0160 in between the transfer. Then stores AX and BX registers onto memory location 0174 o