汇编语言中的CPA。 CPA和累加器如何工作?

时间:2018-10-12 05:24:35

标签: pep8-assembly

根据这本书, 在汇编语言中,操作码CPA比较内存中的操作数和累加器中的数据。 我想知道指令CPA如何影响A寄存器(累加器)

BR main 

NUM1: .block 2

NUM2: .block 2

MSG1: .ascii “A register is less than 0\0x00”

MSG2: .asciiA register is more than 0\0x00”

Compared: .block2 

main: 

      DECI NUM1,d.    ; for example, 1

      DECI NUM2,d.          ; for example, 4

      LDA NUM1,d

      CPA NUM2,d.      ;after comparing num1(which is now in - 
                    -Accumulator) and num 2(in the memory)


      STA Compared,d.  ;if i store the contents in the Accumulator,
                  Whih figure would accumulator have? 3 or 2?


      BRlT lessThan 
      BR   End

LessThan: 

      STRO msg1,d

      DECO compared,d

          BR END


END: 

      stop 

      .End

根据PEP / 8仿真器, 结果是“寄存器小于0”,而累加器仍为1。

使用CPA会怎样?请帮助我((

0 个答案:

没有答案
相关问题