当前位置:网站首页>gnu汇编-基本数学方程-乘法
gnu汇编-基本数学方程-乘法
2020-11-10 08:45:00 【osc_uie90flw】
文章目录
简介
乘法运算是整数运算中很重要的一种运算。和加法和减法运算不一样的是,乘法运算对于有符号整数和无符号整数运算符是不一样的。
使用mul进行无符号运算
MUL命令用于将两个无符号的整数相乘。MUL乘法如下所示:
mul source
其中source可以是8位的,也可以是16位的,也可以是32位的。
这里source是被乘数,而乘数的值来源于EAX寄存器。
实例:
.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
结果最终放在了EDX和EAX组合起来的8字节内容,其中EDX是存放结果的高位,EAX存放结果的低位。
使用imul进行有符号运算
版权声明
本文为[osc_uie90flw]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4274857/blog/4710496
边栏推荐
- Incomplete Polyfill of proxy
- 极验无感验证破解
- 解决Coursera视频无法观看的三种方法(亲测有效)
- 使用call、apply和bind解决js中烦人的this,事件绑定时的this和传参问题
- [paper reading notes] a multilayered informational random walk for attributed social network embedding
- [elixir! 0073] beam built-in memory database ETS
- Enter C abstract to understand the similarities and differences between abstract classes and interfaces
- CSDN bug5: to be added
- 从零开始学习 YoMo 系列教程:开篇
- On fedlearner, the latest open source federated machine learning platform of byte
猜你喜欢
![竞争性编程的思考:那些神话和令人震惊的事实[图]](/img/3b/00bc81122d330c9d59909994e61027.jpg)
竞争性编程的思考:那些神话和令人震惊的事实[图]

csdn bug7:待加

推动中国制造升级,汽车装配车间生产流水线 3D 可视化
![[论文阅读笔记] Network Embedding with Attribute Refinement](/img/71/760f29f8a13b366cf3bad4fb48bd63.jpg)
[论文阅读笔记] Network Embedding with Attribute Refinement

Overview of the most complete anomaly detection algorithm in history

对于程序员,那些既陌生又熟悉的计算机硬件

csdn bug8:待加

Network security engineer Demo: original * * controls your server like this! (2)

csdn bug1:待加

CSDN bug3: to be added
随机推荐
CSDN bug8: to be added
[paper reading notes] a multilayered informational random walk for attributed social network embedding
[论文阅读笔记] Large-Scale Heterogeneous Feature Embedding
Gets the property value of a column in the list collection object
竞争性编程的思考:那些神话和令人震惊的事实[图]
JMeter interface test -- a solution with token
Assign the corresponding key and value in the map to the object
Ineuos industrial interconnection platform, web configuration (ineuview) increases the function of importing and exporting engineering views, as well as optimization and repair. Release: v3.2.1
CSDN bug3: to be added
What's the difference between delete, truncate, and drop, and what to do if you delete data by mistake
CUDA_主机内存
推动中国制造升级,汽车装配车间生产流水线3D可视化
工厂方法模式
Problems and solutions in configuring FTP server with FileZilla server
假如需要一百万个对象
[论文阅读笔记] RoSANE, Robust and scalable attributed network embedding for sparse networks
CSDN BUG1: to be added
Coding style: SSM environment in MVC mode, code hierarchical management
Connection to XXX could not be established. Broker may not be available
CSDN bug10: to be added