当前位置:网站首页>TMin - whether TMin overflows
TMin - whether TMin overflows
2022-08-09 18:38:00 【leehyukshuai】
At first consider the principle of two's complement subtraction: a − t b = a +t ( − t b ) a-^tb=a+^t(-^tb) a−tb=
But when learning the setl
instruction, the book says that setb
is judged according to SF^OF
, so I think, cmpl $0x80000000, $0x80000000
(ie operation $0x80000000 - $0x80000000
), OF=1, SF=0, then the result of setb
should beis 1, so you get the paradox $0x80000000 < $0x80000000
.
I struggled for a long time until I actually typed the assembly code:
get_OFxorSF:movl %ecx, %eaxsubl %edx, %eaxsetl %almovzbq %al, %eaxretget_SF:movl %ecx, %eaxsubl %edx, %eaxsets %almovzbq %al, %eaxret
It turns out that when 0x80000000-0x80000000
, both OF^SF and SF are set to 0.Therefore OF is also 0, ie TMin-TMin does not overflow.
And when I change the subl
of the above command to addl
, the result is: OF^SF is set to 1, SF is set to 0, that is, >TMin+TMin overflowed.
In conclusion, this kind of entanglement is due to insufficient understanding of the definition of overflow. Overflow means that the result obtained by computer calculation is different from the result obtained by simple arithmetic operation.So of course TMin-TMin=0
will not generate overflow.
边栏推荐
- Video chat source code - how to improve the quality of one-to-one live broadcast?
- CocosCreator接入微信小游戏
- 网络——流量控制&可靠传输&滑动窗口
- 网络——介质访问控制
- 现在,怎么挑选舞台租赁LED显示屏?
- 【1413. 逐步求和得到正数的最小值】
- B45 - 基于STM32单片机的家庭防火防盗系统的设计
- 价值10亿美元 美国向乌克兰提供单次最大规模安全援助
- The use of websocket in uni-app Disconnection, reconnection, heartbeat mechanism
- 网络——涉及的相关协议和设备汇总
猜你喜欢
uni-app中websocket的使用 断开重连、心跳机制
网络——2021年大题解析
NFT+IDO预售代币合约模式系统开发
shopee引流方式有哪些,商家如何为自己店铺做引流?
A51 - 基于STM32的DHT11和LCD显示串口通信仿真
知识点滴 - 如何写项目总结
[Server data recovery] Data recovery case of file system data loss caused by SAN LUN mapping error
Became CTO, was killed by my boss in 6 months, I lost 10 million
ESP8266-Arduino编程实例-MQ-5液化天然气传感器驱动
Jenkins使用pipeline部署服务到远程服务器
随机推荐
Using Prometheus skillfully to extend the kubernetes scheduler
Knowledge Bits - How to Write a Project Summary
图像几何校正
The Chinese Academy of Sciences slaps Google in the face: ordinary computers catch up with quantum superiority, and can solve calculations that would have taken 10,000 years in a few hours...
「我觉得AI领域乙烷」网友:你说的太多了,让AI来总结一下
网络——虚拟专用网和地址转换NAT
微信开发者工具程序开发好后,不报错,但是黑屏「建议收藏」
Installation and use of Lombok plugin in IDEA
成为CTO,6个月被老板干死,我损失了1000万
零基础爬虫regex练习「音乐抓取」
网络——流量控制&可靠传输&滑动窗口
快捷键修改typora字体----自制脚本
Optimization of a piece of JDBC code (Part 1)
August 9, 2022: Build .NET apps in C# -- use the Visual Studio Code debugger to interactively debug .NET apps (won't, fail)
SQL抖音面试题:送你一个万能模板,要吗?(重点、每个用户每月连续登录的最大天数)
【Web渗透】信息收集篇——Google搜索引擎(一)
B024 – STM32温湿度控制体温检测烟雾报警系统
AVL树的插入操作
B40 - 基于STM32单片机的电热蚊香蓝牙控制系统
@AllArgsConstructor and @NoArgsConstructor