Home
About
Blogs
Home
Mega Menu
Facebook
Random Posts
3/random/post-list
Popular Posts
Contactor Inner Views
March 10, 2021
June 24, 2013
June 24, 2013
Contact form
Name
Email
*
Message
*
Home
Dhruvang Suthar
March 08, 2012
Arrange in Descending order
Statement
:
Arrange an array of 8 bit unsigned no in descending order
START:MVI B, 00
; Flag = 0
LXI H, 4150
; Count = length of array
MOV C, M
DCR C
; No. of pair = count -1
INX H
; Point to start of array
LOOP:MOV A, M
; Get kth element
INX H
CMP M
; Compare to (K+1) th element
JNC LOOP 1
; No interchange if kth >= (k+1) th
MOV D, M
; Interchange if out of order
MOV M, A
;
DCR H
MOV M, D
INX H
MVI B, 01H
; Flag=1
LOOP 1:DCR C
; count down
JNZ LOOP
;
DCR B
; is flag = 1?
JZ START
; do another sort, if yes
HLT
; If flag = 0, step execution
Post a Comment
0 Comments
Social Plugin
Certificate of Completion
Certificate No.CERT001561786-EMI
🇮🇳Welcome To My Blogs.🇮🇳
🥇BE-Electrical🥈 PGDM-Marketing. 🥉Data Scientists. 🏅MEP-Electrical.
Total Pageviews
This Page is a little effort to make you Sharing of some own materials .This is just a Kick-Start to make the aware of Practical World !!! Best of luck.-DHRUVANG SUTHAR
Close Menu
0 Comments