简体   繁体   English

M68K:同一个寄存器的预减量

[英]M68K: predecrement on the same register

In M68040 asm, given:在 M68040 asm 中,给出:

mov.l #0x1000, %a0
mov.l -(%a0), -(%a0)

What is the %a0 value after the second mov ?第二个mov之后的%a0值是多少? Is the register decremented twice or once?寄存器减少了两次还是一次?

What instead of mov.l we use one of the few other instructions that support pre-decrement/post-increment on both source and destination?什么不是mov.l我们使用少数其他同时支持源和目标的预递减/后递增的指令之一?

The MC68040 UM states that move16 (%an)+, (%an)+ performs only a single increment, but I could not find any information regarding the general case. MC68040 UM 声明move16 (%an)+, (%an)+仅执行单个增量,但我找不到有关一般情况的任何信息。

I am working on an emulator and do not have an actual CPU.我正在使用模拟器并且没有实际的 CPU。 Also, the general consensus online seems to be that Easy68k is not trustworthy when dealing with this kind of corner case.此外,网上普遍的共识似乎是Easy68k在处理这种极端情况时是不可信的。

In your specific example,在您的具体示例中,

  move.w -(an),-(an)

the register an is indeed decremented twice (so, after the instruction, it is decremented by 4 - or, in your.l example, by 8) on a real 68000 CPU.在真正的 68000 CPU 上,寄存器an确实递减了两次(因此,在指令之后,它递减 4 - 或者,在你的.l 示例中,递减 8)。 The instruction effectively moves memory contents downwards by a word length (verified on real hardware).该指令有效地将 memory 内容向下移动一个字长(在真实硬件上验证)。

move16 is an entirely different beast and only available on the 68040 up. move16 是一个完全不同的野兽,仅在 68040 上可用。 I suppose the specific behavior of the move16 instruction is caused by the 68040 caching mechanisms.我想move16指令的具体行为是由68040缓存机制引起的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM