打印不在ARM组件中工作?

时间:2014-03-04 12:00:11

标签: assembly arm codewarrior

我正在尝试使用CodeWarrior开发套件在ARM程序集中实现异常监视器。寄存器r1将具有地址。我需要打印该地址中的值(4个字节)。以下是我写的程序。

            MOV     r1,r3           ;assuming that r3 has the address
            MOV     r0, #0x3        ;select Angel SYS_WRITEC
            MOV     r7, #0x5        ; counter to check if 4 bytes are printed
LOOP        LDRB    r2, [r1,#1]!    ;get next byte
            SUB     r7,r7,#0x1      ;subtract counter
            CMP r7, #0          ;check if four bytes are already printed
            SWINE   SWI_ANGEL       ;if not end print
            BNE     LOOP            ;and loop back
            Exit                    
            ALIGN                   

此代码除了一些垃圾值外不打印任何内容。我做得对吗?是否有更好的方法在寄存器中打印值?

另外,如何在寄存器中保存值以检查我的程序是否正常工作?

0 个答案:

没有答案