简体   繁体   中英

What does the MOVHS command in ARM assembly do?

I'm having a hard time understanding what this command does. I'm guessing it means mov halfword signed into a register, but i'm not sure. Any help would be appreciated!

我认为这是一个正常的举动,只有在当前条件代码指示“更高或相同”(从以前的比较或减法中得出无符号> =)时,才会发生这种情况。

This does not have anything to do with halfword or signed. The ARM info center is always a good place to start if your confused, rather than guessing. Anyway, to answer your question, what this command or mnemonic does is it looks in the CSPR (Current Program Status Register) , and goes off of the value stored in there. Now this could be the result of an earlier call like cmp r0, r1 . Say that this was the case, and cmp r0, r1 was called before the code movhs was called. Now, the status of the cmp call is stored in the CPSR, and when a conditional such as hs or cs is added on as in the case with movhs , what this means is that this statement will only execute if the result in the CPSR is higher or same, ie, in pseudocode, if (r1 >= r0){execute the mov command} .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM