当前位置:网站首页>GNU assembly basic mathematical equations multiplication
GNU assembly basic mathematical equations multiplication
2020-11-10 08:45:00 【osc_uie90flw】
List of articles
brief introduction
Multiplication is an important operation in integer operation . What's different from addition and subtraction is , Multiplication is not the same for signed and unsigned integer operators .
Use mul To perform an operation without sign
MUL
The command is used to multiply two unsigned integers .MUL The multiplication is as follows :
mul source
among source It can be 8 Bit , It can also be 16 Bit , It can also be 32 Bit .
here source It's the multiplier , And the value of the multiplier comes from EAX register .
example :
.code32
.section .data
data1:
.int 10
data2:
.int 20
answer:
.quad 0
output:
.asciz "The result is %qd\n"
.section .text
.globl _start
_start:
nop
movl data1,%eax
mull data2
movl %eax, answer
movl %edx,answer+4
pushl %edx
pushl %eax
pushl $output
call printf
add $12,%esp
pushl $0
call exit
as -o multest.o multest.s -gstabs --32
ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o multest -L/lib -lc multest.o
The result is finally put in EDX and EAX Combined 8 Byte content , among EDX It's the high place where the results are stored ,EAX The low position of the result .
Use imul Do signed operations
版权声明
本文为[osc_uie90flw]所创,转载请带上原文链接,感谢
边栏推荐
- Gets the property value of a column in the list collection object
- JS solves the problem of automatic pagination in browser printing
- 编码风格:Mvc模式下SSM环境,代码分层管理
- csdn bug1:待加
- Fire knowledge online answer activity small program
- 【LeetCode】 93 平衡二叉树
- 推动中国制造升级,汽车装配车间生产流水线 3D 可视化
- 注册滴滴加不上车怎么办?要怎么处理?
- JMeter的简单使用
- CSDN bug8: to be added
猜你喜欢
小度“破圈”提速,IoT迎来新故事
Promote China manufacturing upgrade, 3D visualization of production line in automobile assembly workshop
Promote China manufacturing upgrade, 3D visualization of production line in automobile assembly workshop
Youtube订阅——解决在弹窗内使用Youtube订阅按钮高度显示不全的问题
痞子衡嵌入式:RT-UFL - 一个适用全平台i.MXRT的超级下载算法设计
csdn bug8:待加
使用call、apply和bind解决js中烦人的this,事件绑定时的this和传参问题
Thinking about competitive programming: myths and shocking facts
分布式文档存储数据库之MongoDB索引管理
csdn bug4:待加
随机推荐
Bartender2021实现安全远程标签打印,年终全新发布
C++ STL容器篇
利用尾巴作为时间序列进行处理来识别鲸鱼
分布式文档存储数据库之MongoDB索引管理
ServiceManagerProxy中mRemote变量指的什么?
Connection to XXX could not be established. Broker may not be available
编码风格:Mvc模式下SSM环境,代码分层管理
If you need a million objects
假如需要一百万个对象
Oschina: my green plants are potatoes, ginger and garlic
js解决浏览器打印自动分页的问题
小度“破圈”提速,IoT迎来新故事
Notes on Python cookbook 3rd (2.2): String start or end match
Mongodb index management of distributed document storage database
One image can hold 16x16 words! ——Transformers for large scale image scaling recognition (a brief review of ICLR 2021 papers)
区块链论文集【三十一】
Explanation of Z-index attribute
leetcode1-两数之和
坚持追查7年,近10亿美元比特币终被美国政府没收充公
[论文阅读笔记] RoSANE, Robust and scalable attributed network embedding for sparse networks