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

Introduction to microprocessor, Introduction to Microprocessor: Micropr...

Introduction to Microprocessor: Microprocessor works like a CPU in a microcomputer. It's present as a single IC chip in a microcomputer. Microprocessor is the soul of the machi

Control transfer or branching instruction-microprocessor, Control Transfer ...

Control Transfer or Branching Instruction Control transfer instructions transfer the flow of execution of the program to a new address specified in the instruction indirectly o

Shell script, write shell to calculate basic salary from given .

write shell to calculate basic salary from given .

The processor 8088-microprocessor, The processor 8088 The launching of ...

The processor 8088 The launching of the processor 8086 is consider as a remarkable step in the development of high speed computing machines. Before the introduction  of 8086 mo

input and output, Description: LC3 allows input from keyboard and out...

Description: LC3 allows input from keyboard and output to display on the screen. This lab will exercise the input/output capability using LC-3 Assembly language. Procedure

8251 programmable/communication interface-microprocessor, 8251 Programmable...

8251 Programmable/Communication Interface As an instance of a serial interface device let us suppose Intel's 8251 A programmable communication interfaces. The 8251A is diagram

Program to generate waveforms connected, Write a 68hc11 assembly language p...

Write a 68hc11 assembly language program which generation of the following waveforms connected to your DAC i)   Square wave ii)  Saw tooth waveform iii) Sine wave iv) U

Assignment, Write an assembly program that adds the elements in the odd ind...

Write an assembly program that adds the elements in the odd indices of the following array. Use LOOP. What is the final value in the register?

Relocate program and data, ) What is the difference between re-locatable pr...

) What is the difference between re-locatable program and re-locatable data?

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