当前位置:网站首页>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:实验思路
四、实验源程序
边栏推荐
猜你喜欢
![[Qualcomm][Network] 网络拨号失败和netmgrd服务分析](/img/76/49054ff8c7215eca98cc479ab1d986.png)
[Qualcomm][Network] 网络拨号失败和netmgrd服务分析

API 网关 APISIX 在Google Cloud T2A 和 T2D 的性能测试

【ASP.NET Core】选项类的依赖注入

【AGC】增长服务2-应用内消息示例

typescript入门之helloworld

基于.NetCore开发博客项目 StarBlog - (16) 一些新功能 (监控/统计/配置/初始化)

【HMS core】【FAQ】HMS Toolkit Typical Questions Collection 1

梅科尔工作室-看鸿蒙设备开发实战笔记七——网络应用开发

现在报PMP还来得及参加9月的考试吗?分享敏捷全真模拟题

208. 实现 Trie (前缀树)
随机推荐
Adaptive Control - Simulation Experiment 1 Designing Adaptive Laws Using Lyapunov's Stability Theory
第2章 常用安全工具
[Qualcomm][Network] 网络拨号失败和netmgrd服务分析
Transfer Learning技术研修
oracle 导出dmp文件类型为“故障转储文件”
XYplorer 23多语言,最好的管理软件之一
MySQL database maintenance
分布式限流 redission RRateLimiter 的使用及原理
mysql与redis 区别
Database transactions, JDBC operations and data types
WebAPI 复习
高能产出!腾讯内部的MyCat中间件手册,理论实操齐下
The configuration process and related syntax of writing markdown format notes in vscode
TestNg整合Retry代码
原生js 创建表格
干货|语义网、Web3.0、Web3、元宇宙这些概念还傻傻分不清楚?(中)
从数据流中快速查找中位数
第3章 信息收集
淘宝/天猫淘宝评论问答列表接口 API
Still using Swagger?I recommend this interface management artifact with zero code intrusion

