如何将char转换为整数ARM Komodo

时间:2015-11-06 05:23:15

标签: arm komodo

如何将char转换为整数。我正在使用手臂科莫多。到目前为止,我已设法从用户​​那里获取输入并将其打印到屏幕上。但是我需要将这个选择的字符“数字”转换为整数“数字”。我不知道从哪里开始请帮忙!我也知道我有一个不会停止的循环。我稍后会尝试解决这个问题。

    B main

question    DEFB    "How many verses do you want to print?",0
answer      DEFB    "",0
input       DEFB    "a",0
newline     DEFB    "\n",0
done        DEFB    "done\n",0


    ALIGN

main    
loop    ADR R0,question
    SWI 3

    SWI 1

    STR R0,answer

    ADR R0,answer
    SWI 3

    ADR R0,newline
    SWI 3

    B loop

    ADR R0,done
    SWI 3

    SWI 2

0 个答案:

没有答案