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

边栏推荐
- functools:对callable对象的高位函数和操作(持续更新ing...)
- 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
- How to solve the following problems in the Seata database?
- After QQ was stolen, a large number of users "died"
- 使用Karmada实现Helm应用的跨集群部署
- 实验6 8255并行接口实验【微机原理】【实验】
- 新零售线下店逆势起飞,通膨乌云下的消费热情
- R语言ggplot2可视化:使用patchwork包将两个ggplot2可视化结果纵向堆叠起来(stacking)形成组合图、一个可视化结果堆叠在另外一个可视化结果上
- 一文教你快速生成MySQL数据库关系图
- 不要使用短路逻辑编写 stl sorter 多条件比较
猜你喜欢
Technical trendsetter

Leetcode 705. Design hash collection

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

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?
Oracle11g database uses expdp to back up data every week and upload it to the backup server

With a return of 5000 times, the South African newspaper invested in Tencent to make a province

使用Karmada实现Helm应用的跨集群部署

Fleet |「后台探秘」第 3 期:状态管理

MIPS汇编语言学习-02-逻辑判断-前台输入

S2b2c system website solution for kitchen and bathroom electrical appliance industry: create s2b2c platform Omni channel commercial system
随机推荐
R language ggplot2 visualization: use the patchwork package to horizontally form two ggplot2 visualization results into a new result visualization combination diagram (using the | symbol)
【算法篇】刷了两道大厂面试题,含泪 ”重学数组“
Successful cases of rights protection of open source projects: successful rights protection of SPuG open source operation and maintenance platform
C#/VB.NET 将PDF转为Excel
ROS知识点——使用VScode搭建ROS开发环境
QQ被盗号后群发黄图,大批用户“社死”
SAP MTS/ATO/MTO/ETO专题之九:M+M模式前后台操作,策略用50,提前准备原材料和半成品
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
化学制品制造业智慧供应商管理系统深度挖掘供应商管理领域,提升供应链协同
Smart supplier management system for chemical manufacturing industry deeply explores the field of supplier management and improves supply chain collaboration
Longest continuous sequence
Is PMP really useful?
How does Seata server 1.5.0 support mysql8.0?
seata-server 1.5.0 如何支持mysql8.0?
MySQL主从切换的超详细步骤
Classmate Zhang hasn't learned to be an anchor yet
Validate palindrome string
Not being a meta universe now is like not buying a house 20 years ago!
halcon 基础总结(一)裁切图片并旋转图像
环保产品“绿色溢价”高?低碳生活方式离人们还有多远