标志寄存器_8085微处理器的标志寄存器

news/2024/12/1 10:45:09/

标志寄存器

The Flag register is basically a special type of register or we can also say that they are Special Purpose Register. And based upon the value of result after any type of arithmetic and logical operation the value of flag bits become either set (1) or reset (0). In 8085 microprocessor, flag register basically consists of 8 bits and from these 8 bit, only 5 of them are useful.

标志寄存器基本上是一种特殊类型的寄存器,或者我们也可以说它们是特殊用途寄存器。 根据任何算术和逻辑运算后的结果值,标志位的值将变为设置(1)或复位(0)。 在8085微处理器中,标志寄存器基本上由8位组成,从这8位中,只有5位是有用的。

These 5 flags are:

这五个标志是:

1)标志旗 (1) Sign Flag)

Represented by the symbol S. After any type of arithmetic operation or logical operation if the value of D7 becomes 1 it basically shows that the number is negative and the sign flag is now set, if the value of D7 becomes is 0, it basically shows that the number is positive and the sign flag is now reset.

用符号S表示。在任何类型的算术运算或逻辑运算之后,如果D7的值变为1,则基本上表示数字为负,并且现在设置了符号标志;如果D7的值变为0,则基本上表示该数字为正,并且现在重置符号标志。

Example:

例:

    MVI A 40 (load the value40H in register A)
MVI B 30 (load the value 30H in register B)
SUB B (A = A – B)

These set of instructions willbasically reset the sign flag to 0 as 40 – 30 is always apositive number.

这些指令集将基本上将符号标志重置为0,因为40 – 30始终是正数。

2)零标记(Z) (2) Zero Flag (Z))

After any type of arithmetical or logical operation if the output becomes 0 (00)H, then zero flag is said to be set with value 1, if not it becomes reset with the value 0.

在进行任何类型的算术或逻辑运算后,如果输出变为0(00)H,则将零标志设置为值1,否则将其重置为值0。

Example:

例:

    MVI A 40 (load the value of40H in register A)
SUB A 

These set of instructions will basically set the zero flag to the value 1 as 40H – 40H is always gives result as 00H.

这些指令集基本上会将零标志设置为值1,因为40H – 40H始终给出结果为00H。

3)辅助龋标志(AC) (3) Auxiliary Cary Flag (AC))

This type of flag is basically used in the BCD number system(0-9). If after any type of arithmetic or logical operation D3 generates any carry and passes on to D4 this flag becomes set with value 1, otherwise, it will become reset with value 0. This is the only flag register which is not used or accessed by the programmer.

此类标志基本上用在BCD编号系统(0-9)中。 如果在进行任何类型的算术或逻辑运算后,D3产生任何进位并传递到D4,则该标志设置为值1,否则将被复位为值0。这是唯一的标志寄存器,其不被使用或访问。程序员。

Example:

例:

    MOV A 2C (load the value 2CH in register A)
MOV B 38 (load the value 38H in register B)
ADD B (A = A + B)

These set of instructions will set the auxiliary carry flag and set the value to 1, as on adding 2C and 38, addition of these lower order will generate a carry.

这组指令将设​​置辅助进位标志并将其值设置为1,因为加2C和38时,这些低位的加法将产生进位。

4)奇偶校验标志(P) (4) Parity Flag (P))

After any type of arithmetic or logical operation if the result is even parity, means it has even number of 1 bit, the parity register becomes set with value 1, otherwise, it becomes reset with value 0.

经过任何类型的算术或逻辑运算后,如果结果为偶校验,则表示其偶数为1位,奇偶校验寄存器将设置为值1,否则,将复位为值0。

Example:

例:

    MVI A 06 (load 06H value in register A)

This instruction will set the value of parity flag to 1 as the BCD code of 06H is 00000110, which contains even number of ones here the no of 1s is 2.

该指令会将奇偶校验标志的值设置为1,因为06H的BCD码为00000110,其中包含偶数个,此处1的编号为2。

5)进位标志(CY) (5) Carry Flag (CY))

Carry is generated only when while performing n bit operations if it will lead to a result which has more than n bits, then this flag becomes set with value 1, otherwise it becomes reset with value 0.

进位仅在执行n位操作时产生,如果会导致结果的位数超过n位,则该标志将设置为值1,否则将重置为值0。

Example:

例:

    MVI A 40 (load 40H value in register A)
MVI B 60 (load 60H value in register B)
SUB B (A = A – B)

These set of instructions will set the carry flag with value 1 as 40 – 60 generates answer with borrow.

这些指令集将值1的进位标志设置为40 – 60,借位生成答案。

翻译自: https://www.includehelp.com/embedded-system/flag-registers-of-8085-microprocessor.aspx

标志寄存器


http://www.ppmy.cn/news/416174.html

相关文章

东部公交采购管理系统为企业降本增效

深圳市东部公共交通有限公司(以下简称“东部公交”)是经深圳市人民政府授权,于2007年9月正式挂牌成立的公交特许经营企业,系深圳市国资委直管企业。 东部公交牢牢抓住粤港澳大湾区建设、深圳建设中国特色社会主义先行示范区和区域…

更优雅的Wordpress主题模板_WP中文主题_zibll主题_子比主题钻石代理会员

子比主题钻石代理购买链接 通过代理购买可以比官网优惠10块钱 https://www.zibll.com?ref618 现在是有活动,价格也便宜,想入手的抓紧时间。必须通过上面的代理链接,才会优惠。 zibll主题,子比主题,Wordpress主题,wordpress主题下载,wordpr…

400计算机毕业设计

PHPsqlB2B网络交易平台(全套计算机毕业设计).rar http://dl.vmall.com/c0alglgagy ASP网上服装商城_服装销售系统(SQL和ACCESS,任选)(任务书,开题报告,毕业论文,程序,源码).rar http://dl.vmall.com/c0ombcawhi Linux下的简单网络管理控制系统的设计与开发(开题报告…

mp运营【快速版】

文章目录 引言I mp命名1.1 教育II 简介2.1 育儿2.2 通识教育III mp运营3.1 赞赏账户3.2 自动回复3.3 绑定的微信号3.4 注册数量提升申请IV mp url4.1 常用链接格式(__biz参数)4.2 来源(scene参数 )引言 I mp命名 没有认证的企业订阅号只能修改一次名字。 设置名字之后立马…

十亿级视频播放技术优化揭密

导语:QCon是由InfoQ主办的全球顶级技术盛会,每年在伦敦、北京、东京、纽约、圣保罗、上海、旧金山召开。自 2007年 3月份首次举办以来,已经有超万名高级技术人员参加过QCon大会。QCon内容源于实践并面向社区,演讲嘉宾依据热点话题…

如何实现智能家居的网状网络?

文章路径:https://mp.weixin.qq.com/s?__bizMzU4NjMxNjA2NQ&mid2247484539&idx1&sn17a0ade996db2a5e52f13f418d7e841a&chksmfdfc6435ca8bed236188084c8b74657ed281dc684fe9291b64124b14196b32224151c38c4252#rd 网状网络是一种理想的住宅设计方案&…

Flutter插件汇总

❀ ❀ 尽可能收集好用的插件以便更快的开发效率,85%亲测,持续添加中 如果有好的插件或者建议,可以直接评论 ❀❀ Github地址:https://github.com/jahnli/awesome-flutter-plugins 文章源地址: https://juejin.im/pos…

史诗手册!微信小程序新手自学入门宝典!你想要的都在这里

一、小程序官方指南 1:官方开发工具下载: https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html?t201714 0.12.1304Win版:https://pan.baidu.com/s/1miNleBY 0.12.1304Mac版:https://pan.baidu.com/s/1qYNIQZy 2&a…