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

Intel''s 8237 dma controller-microprocessor, Intel's 8237 DMA controller : ...

Intel's 8237 DMA controller : 1) The 8237 contain 4 independent I/O channels 2) It contains 27 registers, 7 of which are system-wide registers and 5 for each channel. 3)

Programming assembly language, Write an 8086 program to find out the number...

Write an 8086 program to find out the number of positive numbers and negative numbers from a given series of signed numbers include flow chart ..

Dec-arithmetic instruction-microprocessor, DEC:  Decrement :- The decremen...

DEC:  Decrement :- The decrement instruction subtracts 1 from the contents of the particular memory location or register. All the conditions code flags except carry flag are affec

Rics/cisc architecture-microprocessor, RICS/CISC Architecture An essent...

RICS/CISC Architecture An essential aspect of computer architecture is the design of the instruction set for the processor.  The instruction set selected for a specific compute

Convert into hex pairs, Convert 751 to hex and show what it would look like...

Convert 751 to hex and show what it would look like stored at TheNumber WORD ? (hint: answer in hex pairs)

Program which allows the user to select from menu, Write a 32-bit program w...

Write a 32-bit program which when run, allows the user to select from a menu: (1)    Enter a Binary Number (2)    Enter a Decimal Number (3)    Enter a Hexadecimal Number

Project 1: Text Conversion, I need a text conversion program written in ass...

I need a text conversion program written in assembly language

Lods-stos-string manipulating instruction-microprocessor, LODS : Load Stri...

LODS : Load String Byte or String Word:- The LODS instruction loads AL/AX register by the content of a string pointed to by DS:SI register pair. The SI is automatically modifie

Group-assemblers directive-microprocessor, GROUP : Group the Related Segme...

GROUP : Group the Related Segments:- The directive which is used to form logical groups of segments with same purpose or type. This isused to inform the assembler to form a log

Solotuon, using 8086 assembly language that interchange upper four bits to ...

using 8086 assembly language that interchange upper four bits to lower four bits. assume that data store in byte memory and it written back to same location. and assume the data as

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