当前位置:网站首页>Logic and arithmetic
Logic and arithmetic
2022-08-06 21:32:00 【Tri-state gate】
Logical & Arithmetic Operations
1, mul operation instruction
In the Assembly language, the multiplication operation is convenient to store the value, and the high and low bits of the value are generally distinguished in different registers
Multiplication Prestore:
The number to be multiplied the number of digits is the same (8bits/16bits)
In the case of eight bits, one is stored in AL, and the other is docked and placed in a memory unit or register;
In the case of sixteen bits, the number two is stored in AX, and the other is placed in a 16-bit register or memory unit
Data results:
If the multiplication operation is multiplied by 8-bit data, the result is placed in AX by default; if it is 16-bit data, the high-order result is placed in DX by default, and the position is in AX by default
mov ax , 100 mov bx , 1000 mul bx ---->ax = 4240H dx = 000FH
2, adc command
Use the flag register CF (carry flag) to carry out the addition operation with carry
①Low-order addition
②The carry value generated by the addition of the upper and lower bits and the upper and lower bits
adc ax , bx ; ( ax ) = ( ax ) + ( bx ) + CF
3, sbb instruction
Use the flag register CF (carry flag) to carry out the subtraction operation with borrowing
sbb ax , bx ; ( ax ) - ( bx ) - CF
For multi-digit subtraction calculations:
003E1000H - 00202000H
mov bx 003EH mov ax 1000H sub ax , 2000H sbb bx , 0020H
4. cmp command
Subtraction and comparison operations, logarithmic subtraction, do not save the result, record the cmp result by changing the register bit value of ZF, CF, SF, etc.
cmp ax , ax zf = 1,pf = 1,sf = 0,cf = 0, of = 0
The rewriting of a single register by cmp cannot get the correct result, and it needs to be combined with multiple bits of the flag register before making a judgment
OF and SF cmp command judgment: (cmp ah , bh)
①sf = 1,of = 0---->ah
③sf = 0,of = 0---->ah
The actual result caused by the overflow is the opposite of the logical true result
边栏推荐
- 正确按照字典顺序比较字符串之 localeCompare
- 4.【opencv打开美女热舞视频以及摄像头】
- 硅谷课堂第二课-搭建项目环境和开发讲师管理接口
- vscode 1.70变化与关注点(人工折叠/粘性滚动等)
- 2. 线性表的基本概念 + 基本操作
- idea中启动多个微服务(开启RunDashBoard管理)
- [BPU部署教程] 一文带你轻松走出模型部署新手村
- EXT.js学习【笔记】
- uniapp Jiugongge lottery controllable probability effect demo (sorting)
- Four cases of adjustment after the AVL tree is inserted into a new node (left single rotation, right single rotation, double rotation)
猜你喜欢

iQOO Neo6评测:产品力稳步升级 同价位不错的选择

微信小程序发布动态页面模板

亿流量大考(5):百亿流量全链路99.99%高可用架构最佳实践

STM32MP157A driver development | 03-usb host interface use (U disk)

硅谷课堂第十五课-腾讯云部署

硅谷课堂第二课-搭建项目环境和开发讲师管理接口

(一)音视频:解码H264文件流程 渲染和拿到解码后源数据YUV 完整Demo

0x0000008e蓝屏代码是什么意思 蓝屏代码0x0000008e解决方法

如何在IDEA中创建接口和接口实现类

Flume (1) --------- Flume overview
随机推荐
论如何提升学习的能力
如何使用 saplink 安装其他网站上提供的 ABAP 程序
BUU刷题记6
阿里云服务器搭建 图文详细教程
iQOO Neo6 evaluation: product strength has been steadily upgraded, a good choice at the same price
LoRa组网解决方案
2. 双链表的定义+ 代码实现
【How to use Medooze to realize multi-party video conference】
逻辑&算术运算
一文带你了解webrtc基本原理(动手实现1v1视频通话)
后出海时代:“陡坡式增长”失速,“阶梯式增长”到来
硅谷课堂第二课-搭建项目环境和开发讲师管理接口
uniapp Jiugongge lottery controllable probability effect demo (sorting)
Cascade WPF 】 【 Combobox and its linkage with ListView
罗技键盘怎么调灯光 罗技k845怎么切换灯光
June Broker Gold Works Picks
从To C到To B、To G,多多云科技如何实现转型
[WPF] Combobox default style study notes (Presenter and Trigger)
4G DTU的特点及应用方法
Servlet中上传文件(用到DiskFileItemFactory)