当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 分布式文档存储数据库之MongoDB索引管理
- lodash.js源码-flatten
- Wu Enda's refining notes on machine learning 4: basis of neural network - Zhihu
- 编码风格:Mvc模式下SSM环境,代码分层管理
- 自己上手写性能测试工具(二)
- Mongodb index management of distributed document storage database
- 图-无向图
- ASP.NET Core framework revealed [blog Summary - continuous update]
- CSDN bug11: to be added
- 消防知识线上答题活动小程序复盘
猜你喜欢
For programmers, those unfamiliar and familiar computer hardware
[leetcode] 92 integer inversion
CSDN BUG1: to be added
完美日记母公司逸仙电商招股书:重营销、轻研发,前三季度亏11亿
初级工程师如何在职场生存
CSDN bug9: to be added
csdn bug4:待加
Solution of MAC terminal iterm2 supporting RZ and sz
《Python Cookbook 3rd》笔记(2.2):字符串开头或结尾匹配
关于centos启动报错:Failed to start Crash recovery kernel arming的解决方案
随机推荐
Difficulties in heterogeneous middleware implementation of Bifrost site management (1)
CUDA_主机内存
z-index属性详解
Connection to XXX could not be established. Broker may not be available
解决Coursera视频无法观看的三种方法(亲测有效)
CSDN bug5: to be added
[论文阅读笔记] RoSANE, Robust and scalable attributed network embedding for sparse networks
On fedlearner, the latest open source federated machine learning platform of byte
区块链论文集【三十一】
Simple use of JMeter
The length of the last word in leetcode
注册滴滴加不上车怎么办?要怎么处理?
坚持追查7年,近10亿美元比特币终被美国政府没收充公
[elixir! 0073] beam built-in memory database ETS
自己上手写性能测试工具(二)
小度“破圈”提速,IoT迎来新故事
JMeter的简单使用
Graph undirected graph
[python学习手册-笔记]001.python前言
Getiservicemanager () source code analysis