如何循环此循环,直到输出1个人为止

时间:2015-10-30 19:30:14

标签: assembly arm

我有生成下面输出的代码。如何再循环代码以产生如下所示的输出。

  verses    DEFW    4
    temp    DEFW    0
    text    DEFB    " men went to mow a meadow\nWent to mow a meadow\n",0
    text1   DEFB    " men, ",0
    text2   DEFB    "1 man and his dog, spot\nWent to a meadow",0



        ALIGN

    main    LDR R0,verses   
        SWI 4

        ADR R0,text
        SWI 3

        LDR R0,verses
        SWI 4

        ADR R0,text1
        SWI 3

        LDR R0,verses



    loop SUB R0,R0,#1
        SWI 4
        STR R0,verses
        ADR R0,text1
        SWI 3
        LDR R0,verses
        CMP R0,#2
        BNE loop

        ADR R0,text2
        SWI 3

        SWI 2

这是当前的输出

enter image description here

我想实现这一点,不知道如何。

enter image description here

0 个答案:

没有答案