用于计算因子错误的ARM7汇编代码:A1163E:未知的操作码循环,期望操作码或宏 [英] ARM7 Assembly code that computes the Factorial error: A1163E: Unknown opcode loop , expecting opcode or Macro

查看:273
本文介绍了用于计算因子错误的ARM7汇编代码:A1163E:未知的操作码循环,期望操作码或宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 AREA factorial,CODE 
ENTRY
;程序找到阶乘
MOV R0,#1; int c = 1
MOV R1,#6 ; int n = 1
MOV R3,#1; int fact = 6
BL循环
B out

循环;错误是什么
MUL R4,R3,R0
ADD R0,R0,#1
CMP R0,R1
BLE循环
MOV PC,LR

END

解决方案

  loop ;什么  错误 





试试1)(注意冒号)



循环:;错误是什么





2)RTFM !!!!


 区域  factorial  CODE  
ENTRY
; program to find factorial
MOV R0 ,#< span class =code-leadattribute> 1 ; int c = 1
MOV R1 ,# 6 ; int n = 1
MOV R3 ,# 1 < span class =code-leadattribute>; int fact = 6
BL loop
B STOP

loop
MUL R4 R3 R0
MOV R3 R4
ADD R0 R0 ,# 1
CMP R0 R1
BLE loop
MOV PC LR
STOP B STOP ; R4 IS FINAL ANSWER

END


    AREA factorial,CODE
ENTRY
                       ;program to find factorial
    MOV  R0,#1             ;int c =1
    MOV  R1,#6             ;int n=1
    MOV  R3,#1             ;int fact=6
    BL loop
    B out

loop                                         ;what is the error
        MUL R4,R3,R0
        ADD R0,R0,#1
        CMP R0,R1
        BLE loop
         MOV PC,LR

END

解决方案

loop                                         ;what is the error



try 1) (note the colon)

loop:                                         ;what is the error



2) RTFM !!!!


AREA factorial,CODE
    ENTRY
                           ;program to find factorial
    MOV  R0,#1             ;int c =1
    MOV  R1,#6             ;int n=1
    MOV  R3,#1             ;int fact=6
    BL loop
    B STOP

loop
        MUL R4,R3,R0
        MOV R3,R4
        ADD R0,R0,#1
        CMP R0,R1
        BLE loop
        MOV PC,LR
STOP B STOP                 ;R4 IS FINAL ANSWER

    END


这篇关于用于计算因子错误的ARM7汇编代码:A1163E:未知的操作码循环,期望操作码或宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆