RaysternWong / STM8-Simulator

This is a simulator project, which simulate the architerature of STM8 in software form.
https://trello.com/b/TbeS9137/stm8-simulator
GNU General Public License v3.0
4 stars 2 forks source link

关于PUSH POP指令的疑惑。 #3

Closed JiaDuo closed 3 years ago

JiaDuo commented 3 years ago

最近学习stm8的指令,有个问题觉得比较奇怪,想和你讨论下。

关于PUSH POP指令,在对CC I1 I0的操作上有一些奇怪的行为。

1、PUSH CC指令在入栈的时候会将I1 I0设置为1再入栈。 比如CC=0,那么PUSH CC后,栈中的值变成了0X28。

2、POP CC指令从栈中POP值的时候会将CC的I1 I0清空。 比如CC=0,栈中的值为0x2b,那么POP CC后,CC的值变成了0x3

你有注意到这个行为吗。

RaysternWong commented 3 years ago

太久没有注意这个项目,现在已经没有相关的知识,无法协助呀

On Thu, Jul 22, 2021, 2:10 PM jiaduo @.***> wrote:

最近学习stm8的指令,有个问题觉得比较奇怪,想和你讨论下。

关于PUSH POP指令,在对CC I1 I0的操作上有一些奇怪的行为。

1、PUSH CC指令在入栈的时候会将I1 I0设置为1再入栈。 比如CC=0,那么PUSH CC后,栈中的值变成了0X28。

2、POP CC指令从栈中POP值的时候会将CC的I1 I0清空。 比如CC=0,栈中的值为0x2b,那么POP CC后,CC的值变成了0x3

你有注意到这个行为吗。

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RaysternWong/STM8-Simulator/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2GECCH7KEK3MDTMYWRNVLTY6Y6TANCNFSM5AZKPYKQ .

JiaDuo commented 3 years ago

嗯嗯,好的。