当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- delete、truncate、drop 有什么区别,误删数据怎么办
- Collection of blockchain theory [31]
- 使用call、apply和bind解决js中烦人的this,事件绑定时的this和传参问题
- 编码风格:Mvc模式下SSM环境,代码分层管理
- 安卓快速关机APP
- [paper reading notes] community oriented attributed network embedding
- Problems and solutions in configuring FTP server with FileZilla server
- Difficulties in heterogeneous middleware implementation of Bifrost site management (1)
- ServiceManagerProxy中mRemote变量指的什么?
- Python cookbook 3rd note (2.1): using multiple qualifiers to split strings
猜你喜欢
利用尾巴作为时间序列进行处理来识别鲸鱼
csdn bug1:待加
推动中国制造升级,汽车装配车间生产流水线 3D 可视化
Collection of blockchain theory [31]
The length of the last word in leetcode
Exception: invalid or unexpected token
Coding style: SSM environment in MVC mode, code hierarchical management
One image can hold 16x16 words! ——Transformers for large scale image scaling recognition (a brief review of ICLR 2021 papers)
Commodity management - merge purchase demand into purchase order
YouTube subscription: solve the problem of incomplete height display of YouTube subscription button in pop-up window
随机推荐
ServiceManagerProxy中mRemote变量指的什么?
竞争性编程的思考:那些神话和令人震惊的事实[图]
【操作教程 】国标GB28181协议安防视频平台EasyGBS订阅功能介绍及开启步骤
Coding style: SSM environment in MVC mode, code hierarchical management
编码风格:Mvc模式下SSM环境,代码分层管理
An unsafe class named unsafe
csdn bug4:待加
csdn bug3:待加
csdn bug9:待加
工厂方法模式
On fedlearner, the latest open source federated machine learning platform of byte
Simple use of JMeter
Experiment 2
lodash.js源码-flatten
编码风格:Mvc模式下SSM环境,代码分层管理
坚持追查7年,近10亿美元比特币终被美国政府没收充公
jmeter接口测试--带有token的解决方法
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
Seam engraving algorithm: a seemingly impossible image size adjustment method
假如需要一百万个对象