Question

Example An sbit signed int array of size 1024 elements is starting at slooh, Write apiece of code to sort the array asending

Write code by Assembly language

Microprocessor - 8086

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here we are going to use bubble sort algorithm:-

MOV SI,8100H ;point 8100H using the SI register

MOV CL,400H ; store 400 into cl ,here 400 is the hexadecimal of 1024 i.e size of array

MOV CH,00 ;clear CH register

MOV AL,[SI] ; load data from array to AL

DEC CL ; decrease CL by 1

INC SI ; point to next element

L1: CMP AL,[SI] ; compare AL and the next byte

JNC SKIP ; if CL=0 ,jump to skip

MOV AL,[SI] ;otherwise take the memory element into AL

SKIP: INC SI ;point to next location

LOOP L1 ; Go to loop until CL is not 0

MOV [9000],AL ;store AL into memory 9000H

HLT ; Terminate the program

  

Add a comment
Know the answer?
Add Answer to:
Write code by Assembly language Microprocessor - 8086 Example An sbit signed int array of size...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT