当前位置:网站首页>Assembly to implement bubble sort
Assembly to implement bubble sort
2022-07-30 11:16:00 【HUAWEI CLOUD】
一、题目
The assembler implements bubble sort
二、要求
片内RAM30H开始的32A random signed distribution is distributed among the cells8位二进制数,按从小到大的顺序进行排序,The sorted data is still saved to30H开始的32个单元中(Low addresses store small data)
三、过程及结果记录
1. Build one in program memoryTABLE,The form has32randomly generated8位二进制数,如:TABLE :DB 1,3,9,2,17,4,11,6
DB 5,20,100,64,21,14,79,35
DB 92,7,91,23,65,16,13,18
DB 18,73,65,101,27,19,62,69
2. 利用查表指令“MOVC A,@A+DPTR”Read the numbers in the table separately30H~4FH单元中.
3. 使用“冒泡排序法”Just sort them.“冒泡排序法”的基本原理是:
遍历所有32find the largest of them,And make a note of where the largest data is stored,This max data is then placed in the last cell,同时,Save the original data of the last unit to the original location of this maximum value,完成第一轮排序.
4. Traverse the front except the last cell31units of data and find the largest of them,and note its location.After traversing this pass, the largest data found is stored in the penultimate cell,And save the original data of the penultimate unit in the original position of the maximum value just found,Complete the second round of sorting.依次类推,Sort all the data in the same way.Each round will pop up the largest number that is currently unsorted,So a total of bubbling is required31轮.
The experimental results of bubble sort are as follows:
图1:排序结果
The overall idea of the experiment is as follows:
图2:实验思路
四、实验源程序
边栏推荐
猜你喜欢
随机推荐
Telerik2022 R2,有效的自动化测试
4. yolov5-6.0 ERROR: AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor' solution
[ASP.NET Core] Dependency Injection for Option Classes
鸿湖万联扬帆富设备开发板正式合入OpenHarmony主干
mysql与redis 区别
R语言怎么绘图(一个r语言完整的命令有什么)
Vim plugin GrepIt
久经沙场的程序员居然也被某鱼的假程序员骗了,程序员之间的信任应该是最高的,他一个人毁了这种信任感
安全提示:Qt中的FreeType
FPGA刷题——计数器(简易秒表、可置位计数器、加减计数器)
湖仓一体电商项目(一):项目背景和架构介绍
张量篇-初步
Selected System Design | Design of CAN Bus Controller Based on FPGA (with Code)
数据库事务,JDBC操作和数据类型
ESP32CAM 1838接收红外遥控器信号
Easy gene: human tRNA gene loci showed age-related high DNA methylation | research articles
Still using Swagger?I recommend this interface management artifact with zero code intrusion
The method of parameter passing
简述controller,service,repository注解的用法(谈谈application.properties的作用)
单片机开发之LCD1602显示实验



![[Qualcomm][Network] 网络拨号失败和netmgrd服务分析](/img/76/49054ff8c7215eca98cc479ab1d986.png)







