当前位置:网站首页>MIPS assembly language learning-03-cycle
MIPS assembly language learning-03-cycle
2022-06-28 15:11:00 【Sunshine clover lxgzxj】
One 、 Preface
How to run on a computer MIPS assembly language , I won't repeat it here , Please refer to the previous blog link , There are related installation packages and operation methods :MIPS Assembly language learning -01- Sum of two numbers
Two 、 Source code
# Function realization :
# Realization 1 Add up to 10000, Finally, print the cumulative result
.text
# according to C We define two variables to Sum,i,MaxValue.
# Now let's use $t0 : Sum, $t1 : i, $t2 : MaxValue Three registers for correspondence .
li $t0, 0
li $t1, 1
li $t2, 10000
# Now customize a label WhileLoop To execute the code in the loop body .
# What needs to be implemented is :Sum = Sum + i; i = i + 1;
WhileLoop:
add $t0, $t0, $t1
add $t1, $t1, 1
# This way IF Judge the condition ,i <= 100.
#ble The function of the function is to realize less than or equal to , Three parameters :
# The first parameter value is less than or equal to the second parameter value , Execute the tag of the third parameter .
# The first parameter value is less than or equal to the second parameter value , The third parameter label is not executed , Go straight down .
ble $t1, $t2, WhileLoop
# End of cycle print results
# The method of printing integers was described in the previous chapter , You can look through .
li $v0, 1
move $a0, $t0
syscall
This time the code comments have been written , I will not take out a chapter to explain it , Actually, it's a lazy thief .
3、 ... and 、 Running effect

边栏推荐
- 从莫高窟到太平洋,海量数据找到了新家园
- C语言学习-20-归并排序
- spark sql 生成 json
- How to solve the following problems in the Seata database?
- Summary of technical difficulties of wearable neural signal and behavior data detection and recording system for birds in flight
- WSUS客户端访问服务端异常报错-0x8024401f「建议收藏」
- R语言ggplot2可视化:patchwork包将一个ggplot2可视化结果和一个plot函数可视化结果横向组合起来形成最终结果图、两个可视化的组合结果对齐、并为组合图像的每个子图添加标题
- 美国乔布斯,殁了;中国乔布斯,卖了
- R language ggplot2 visualization: the patchwork package is used to customize and combine the three ggplot2 visualization results to form a composite graph. After the horizontal combination of two sub
- Cross cluster deployment of helm applications using karmada
猜你喜欢

SaaS application management platform solution in the education industry: help enterprises realize the integration of operation and management

GCC efficient graph revolution for joint node representationlearning and clustering

How can the digital intelligent supply chain management platform of the smart Park optimize process management and drive the development of the park to increase speed and quality?

Not being a meta universe now is like not buying a house 20 years ago!

Leetcode 48. Rotate image (yes, resolved)

Express template engine

5000倍回报,南非报业投资腾讯赚了一个省

3. caller service call - dapr

Leetcode 705. Design hash collection

halcon 基础总结(一)裁切图片并旋转图像
随机推荐
华为能成“口红一哥”,或者“带货女王”吗?
Experiment 6 8255 parallel interface experiment [microcomputer principle] [experiment]
老板囑咐了三遍:低調、低調、低調
halcon 基础总结(一)裁切图片并旋转图像
老板嘱咐了三遍:低调、低调、低调
C#/VB.NET 将PDF转为Excel
[C language] how to generate normal or Gaussian random numbers
C#/VB. Net to convert PDF to excel
Li Kou today's question -522 Longest special sequence
How to solve the following problems in the Seata database?
vector详解+题目
Could you tell me whether the batch addition of Oracle such as insert all was not blocked?
R language ggplot2 visualization: the patchwork package horizontally combines a ggplot2 visualization result and a plot function visualization result to form a final result graph, aligns the two visua
利用MySqlBulkLoader实现批量插入数据的示例详解
环保产品“绿色溢价”高?低碳生活方式离人们还有多远
Classmate Zhang hasn't learned to be an anchor yet
Setsql function and risk of using lamdbaupdatewrapper
Vscode writes markdown file and generates pdf
Innovation and upgrading of supply chain system driven management mode in petrochemical industry and strengthening internal management of enterprises
当下不做元宇宙,就像20年前没买房!