SHENZHEN I/O

SHENZHEN I/O

评价数不足
ALU-I386-A
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
10.346 KB
2024 年 3 月 20 日 上午 3:06
2024 年 3 月 20 日 上午 6:26
4 项改动说明 ( 查看 )

订阅以下载
ALU-I386-A

在 cyxw 的 1 个合集中
Intel® 8086 ALU Based on Chengshang Micro™
4 件物品
描述
你:老板!诚尚的东西太难用了!
王:咋了?
你:寄存器只有一两个就算了,计算连个标志位都没有,以至于他们指令集有点过于幽默了!
你:瞧瞧人家英特尔,同样是嵌入式芯片,人家8086的功能多好用!
王:那你复刻一个?
你:……没准会大卖呢!



基于诚尚Micro™的Intel® 8086 ALU——算数型
  • 准确运算字节数据!
  • 支持加减法!
  • 同时输出三个标志位!


你:老板,这玩意的功能我们可能得拆成几个板子来做……
2 条留言
cyxw  [作者] 2024 年 6 月 18 日 上午 5:05 
@transcendentalConstant314 All data considered byte signed data, if a num is bigger than 127, then maybe its sign flag……
transcendentalConstant314 2024 年 6 月 17 日 下午 5:45 
On the first test run, there is a set of inputs that is

OPR1 = 239
OPR2 = 176
MODE = 100

and naturally this means calculate 239 + 176. Now, my code does yield the right RESULT, that being 159. But I don't quite understand why the flags are supposed to be set the way they are, in the specificaion as written. I understand why ZF should be 0, I understand why CF should be 100, but I don't understand why SF should be 100. For the first input triplet, that one being (196, 142, 100), the result should be (82, 100, 0, 0), where 82 is RESULT, 100 is CF, and the last two 0 entries being ZF and SF, respectively. Why should this input require SF to be 0, but the input I listed first requiring SF to be 100?