8085中的辅助进位和进位标志 [英] auxiliary carry and carry flags in 8085

查看:380
本文介绍了8085中的辅助进位和进位标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据说在8085中以2的补码执行减法,因此必须根据操作设置标志. 但是,在所示的图中,我无法弄清楚辅助进位标志设置为"0"的原因,进位标志也是如此.当我执行2的补码运算时,我发现进位= 1(在2的补码中未考虑在内),并且我还发现1的进位从低半字节转换为高位,因此我认为辅助进位为1.但是我发现对他们俩来说则相反.

It is said that the subtraction is performed in 2's complement in 8085 and so the flags must be set according to the operation. However,in the figure shown, i am unable to figure out the reason behind auxiliary carry flag being set to '0' and the same goes for carry flag. When i performed 2's complement operation, i found carry=1 (which is not taken into consideration in 2's complement) and i also found carry of 1 shifting from lower nibble to upper and so i thought auxiliary carry to be 1. But i found just the opposite for both of them.

类似地,在下面显示的第二种情况下,手动将进位设置为零,而将进位标志设置为1.

Similarly in the second case shown below, manually i got the carry to be zero whereas the carry flag was set to 1.

推荐答案

根据在此处检查以获取错误列表我很久以前在v1.3.7中找到的

According to 8085 manual here in page 118, the operation should be set. It looks like that GNUSim8085 has a bug. GNUSim8085 had several bugs, some of which they fixed in the latest version (including the bug with the DAA instruction), but it looks like there are still more auxiliary carry related bugs. Check here for a list of bugs which I found long ago with v1.3.7

我建议在此处 https://gsim85.soft112.com/使用gsim85这已正确执行了辅助进位操作.不过,这可能有点难以使用.

I would recommend using gsim85 here https://gsim85.soft112.com/, as it seems that this has implemented the auxiliary carry operation correctly. This may be a bit difficult to use though.

此外,如果您不想使用模拟器,但想要像8085培训工具包这样的界面,请查看我大约在9〜10年前写的Dirty8085 ,最近修复了辅助进位更新.

Also, if you do not want a simulator but want an interface like the 8085 trainer kits, have a look at Dirty8085, which I wrote around 9 ~ 10 years ago, and recently fixed the auxiliary carry update.

这篇关于8085中的辅助进位和进位标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆