当前位置:网站首页>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

边栏推荐
- R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和一段文本内容横向组合起来形成最终结果图
- The best time to buy and sell stocks
- Send2vec tutorial
- 化学制品制造业智慧供应商管理系统深度挖掘供应商管理领域,提升供应链协同
- 完整的模型训练套路(一)
- [collection of excellent articles on Digital IC] nearly 500 articles | learning route | basic knowledge | interface | bus | scripting language | chip job search | security | EDA | tools | low power de
- 验证回文串
- 浪潮网络步步为赢
- 老板囑咐了三遍:低調、低調、低調
- [C language] implementation of binary tree and three Traversals
猜你喜欢

Is PMP really useful?

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

Construction and management practice of ByteDance buried point data flow

Innovation and upgrading of supply chain system driven management mode in petrochemical industry and strengthening internal management of enterprises

蔚来潜藏的危机:过去、现在到未来

MIPS汇编语言学习-03-循环

Leetcode 48. Rotate image (yes, resolved)

MIPS汇编语言学习-01-两数求和以及环境配置、如何运行

C语言学习-20-归并排序

C语言学习-19-全排列
随机推荐
Oracle11g数据库使用expdp每周进行数据备份并上传到备份服务器
Combined sum leetcode
Express template engine
[collection of excellent articles on Digital IC] nearly 500 articles | learning route | basic knowledge | interface | bus | scripting language | chip job search | security | EDA | tools | low power de
R language ggplot2 visualization: use the patchwork package (directly use the plus sign +) to horizontally combine a ggplot2 visualization result and a piece of text content to form a final result gra
Spacetutorial (continuous updating...)
With 120billion yuan, she will ring the bell for IPO again
What! 一条命令搞定监控?
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
Curve 替换 Ceph 在网易云音乐的实践
智能化转型被加速,企业需要新的工具箱
R language ggplot2 visualization: use the patchwork package to stack two ggplot2 visualization results vertically to form a composite diagram, and stack one visualization result on the other visualiza
SaaS application management platform solution in the education industry: help enterprises realize the integration of operation and management
Could you tell me whether the batch addition of Oracle such as insert all was not blocked?
R语言使用nnet包的multinom函数构建无序多分类logistic回归模型、使用回归系数及其标准误计算每个系数对应的Z统计量的值
The boss told me three times: low key, low key, low key
PostgreSQL 存储结构浅析
5000倍回报,南非报业投资腾讯赚了一个省
一个bug肝一周...忍不住提了issue
Setsql function and risk of using lamdbaupdatewrapper