## 題目 subeq r0, r1, #2 編碼結果為何? 以16進位表示 ### ![](https://i.imgur.com/GUu2p6v.png) --- ## 1.cond subeq r0, r1, #2 因為是subeq,所以查表中查到0000 |cond|00|l|opcode|s|rn|rd|operand2| |-----|--------|--------|--------|--------|--------|--------|--------| |_**0000**_|X|X|X|X|X|X| X| ![](https://i.imgur.com/INpXN8e.png) --- ## 2.00 subeq r0, r1, #2 直接寫00 |cond|00|l|opcode|s|rn|rd|operand2| |-----|--------|--------|--------|--------|--------|--------|--------| |0000|_**00**_|X|X|X|X|X|X| --- ## 3.l subeq r0, r1, #2 **#2**要使用立即模式,所以是**1** |cond|00|l|opcode|s|rn|rd|operand2| |-----|--------|--------|--------|--------|--------|--------|--------| |0000|00|_**1**_|X|X|X|X|X| --- ## 4.opcode subeq r0, r1, #2 opcode查表中,查到**sub**是**0010** |cond|00|l|opcode|s|rn|rd|operand2| |-----|--------|--------|--------|--------|--------|--------|--------| |0000|00|1|_**0010**_|X|X|X|X| ![](https://i.imgur.com/ALOX1N2.png) --- ## 5.s subeq r0, r1, #2 |cond|00|l|opcode|s|rn|rd|operand2| |-----|--------|--------|--------|--------|--------|--------|--------| |0000|00|1|0010|_**0**_|X|X|X| --- ## 6.rn subeq r0, r1, #2 取**r0** |cond|00|l|opcode|s|rn|rd|operand2| |-----|--------|--------|--------|--------|--------|--------|--------| |0000|00|1|0010|0|_**0001**_|X|X| --- ## 7.rd subeq r0, r1, #2 取**r1** |cond|00|l|opcode|s|rn|rd|operand2| |-----|--------|--------|--------|--------|--------|--------|--------| |0000|00|1|0010|0|0001|_**0000**_|X| --- ## 8.operand2 subeq r0, r1, #2 取#2,並轉為二進制=>**0000 00000010** |cond|00|l|opcode|s|rn|rd|operand2| |-----|--------|--------|--------|--------|--------|--------|--------| |0000|00|1|0010|0|0001|0000|_**0000 00000010**_| --- ## 9.整理code subeq r0, r1, #2 |cond|00|l|opcode|s|rn|rd|operand2| |-----|--------|--------|--------|--------|--------|--------|--------| |0000|00|1|0010|0|0001|0000|_**0000 00000010**_| ---------------------------------------------------------------- |二進制|0000|0010|0100|0001|0000|0000|0000|0010| |--|-----|--------|--------|--------|--------|--------|--------|--------| |十六進制|0|2|4|1|0|0|0|2| --- ## 10.轉換格式 subeq r0, r1, #2 |十六進制|0|2|4|1|0|0|0|2| |--|-----|--------|--------|--------|--------|--------|--------|--------| |答案|0|2|0|0|4|1|0|2|
{"metaMigratedAt":"2023-06-16T11:29:53.745Z","metaMigratedFrom":"Content","title":"Untitled","breaks":true,"contributors":"[{\"id\":\"b6ef21d0-10bf-4164-ac1c-475cad7818b6\",\"add\":4594,\"del\":2328}]"}
    157 views