当前位置:网站首页>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:实验思路
四、实验源程序
边栏推荐
- Classes and Objects - 6 Default Member Functions
- 360闷声干大事获赞无数,数字安全如何保障?还得看企业安全云
- 湖仓一体电商项目(一):项目背景和架构介绍
- 单片机开发之ADC0808/9信号采集
- 分布式限流 redission RRateLimiter 的使用及原理
- OC - Manual Reference Counting Memory Management
- Still using Swagger?I recommend this interface management artifact with zero code intrusion
- Selected System Design | Design of CAN Bus Controller Based on FPGA (with Code)
- Basemap和Seaborn
- 干货|语义网、Web3.0、Web3、元宇宙这些概念还傻傻分不清楚?(中)
猜你喜欢

RY-D1/1 Voltage Relay

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

WARN: Establishing SSL connection without server's identity verification is not recommended when connecting to mysql

张量篇-初步

Typroa 替代工具marktext

神经网络学习笔记3——LSTM长短期记忆网络

活动速递| Apache Doris 性能优化实战系列直播课程初公开,诚邀您来参加!

关于verilog的时延研究

第3章 信息收集

RY-D1/1电压继电器
随机推荐
mysql分页查询倒序_【Mysql笔记】MySQL实现分页查询[通俗易懂]
STM32F1读取MLX90632非接触式红外温度传感器
【AGC】增长服务2-应用内消息示例
spark udf accepts and handles null values.
RY-D1/1电压继电器
Transfer Learning技术研修
【数据库基础】redis使用总结
ABP学习资源整理
Pytorch中 nn.Transformer的使用详解与Transformer的黑盒讲解
Drools 规则引擎一文读懂
TensorFlow custom training function
正则表达式快速入门笔记
Drag and drop events, dataTransfer, getBoundingClientRect
单片机开发之LCD1602显示实验
Telerik2022 R2,有效的自动化测试
电压继电器SRMUVS-100VAC-2H2D
Scrapy crawler website image crawling
第2章 常用安全工具
久经沙场的程序员居然也被某鱼的假程序员骗了,程序员之间的信任应该是最高的,他一个人毁了这种信任感
Selected System Design | Design of CAN Bus Controller Based on FPGA (with Code)

