当前位置:网站首页>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, %eaxretIt 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.
边栏推荐
- 知识点滴 - 如何写项目总结
- 无需支付688苹果开发者账号,xcode13打包导出ipa,提供他人进行内测
- Redis Cache Expiration and Retirement Policy
- 【1413. 逐步求和得到正数的最小值】
- PHP completes missing dates in date ranges/returns missing dates
- yolov5训练并生成rknn模型以及3588平台部署
- Use SourceTree to add SSH public key and clone the code cloud project (note finishing)
- 快捷键修改typora字体----自制脚本
- 面试官:Redis 大 key 要如何处理?
- 关于聊天机器人,跨境电商人必须知道这些…
猜你喜欢
随机推荐
MySQL 5.5 series installation steps tutorial (graphical version)
AVL树的插入操作
视频聊天源码——一对一直播如何提高直播质量?
Selenium的安装
想通这点,治好 AI 打工人的精神内耗
B019 - 甲醛甲烷煤气温湿度时间测试仪
MySQL 5.5系列安装步骤教程(图解版)
2022-08-09日报:做学术OR去公司 ? 想通这点,治好 AI 打工人的精神内耗
总结了 110+ 公开专业数据集
1.1、VIFB: A Visible and Infrared Image Fusion Benchmark(一个可见光与红外图像融合Benchmark)文章阅读
Knowledge Bits - How to Write a Project Summary
【1413. 逐步求和得到正数的最小值】
OpenCV 图像变换之 —— 直方图均衡化
Numpy数组索引/切片 多维度索引
网络——TCP拥塞控制
[1413. Stepwise summation to get the minimum value of positive numbers]
B43 - 基于STM32单片机的自动视力检测仪
网络——IPV4地址(二)
3种特征分箱方法!
网络——介质访问控制








