Oxford AQA International A-level · Computer Science (9645)

Assembly language programming:练习题

5 道选择题即时批改,另有 5 道文字题附完整解题步骤,全部围绕「Assembly language programming」。

10 道题目26 免费,无需注册
第 1 题
1

Which of the following statements correctly distinguishes between assembly language and machine code?

第 2 题
1

Register R1 currently holds the value 15 and register R2 holds the value 10. Trace the following instructions:

ADD R1, R1, R2
SUB R1, R1, #3

What is the final value stored in R1?

第 3 题
1

Trace the following assembly code snippet to determine the final value in register R1:

MOV R1, #0
MOV R2, #3
loop:
ADD R1, R1, R2
SUB R2, R2, #1
CMP R2, #0
BNE loop

第 4 题
1

In the context of a processor's instruction set, which part of an assembly language instruction specifies the actual operation to be performed by the CPU?

第 5 题
1

Which logical bitwise instruction and mask should be used to ensure that the least significant bit (bit 0) of an 8-bit value in register R1 is set to 0, while all other bits remain unchanged?

第 6 题
2

Define the term immediate addressing as it is used within an assembly language instruction format.

先自己写一遍答案,再对照解题步骤。

第 7 题
4

Contrast direct addressing and indirect addressing by explaining how the processor identifies the data to be operated on in each mode.

先自己写一遍答案,再对照解题步骤。

第 8 题
5

A programmer uses a logical shift left operation by 3 places on an 8-bit register containing the value \( 00000101_2 \).
State the resulting bit pattern and explain the mathematical effect this has on the original denary value.

先自己写一遍答案,再对照解题步骤。

第 9 题
4

Assembly language is a low-level programming language that uses mnemonics to represent machine code instructions specific to a processor.

(a) Define the term instruction set.
(b) Describe the difference between immediate addressing and direct addressing.
(c) Identify the opcode and the operand in the following assembly instruction:
LDR \(R1\), 100

先自己写一遍答案,再对照解题步骤。

第 10 题
6

A programmer is required to convert a high-level selection structure into assembly language for the OxfordAQA processor.

(a) Write the equivalent assembly language code for the following pseudocode:
IF (\(R1\) > \(R2\)) THEN
    \(R1\) = \(R1\) - \(R2\)
ENDIF


(b) Explain how indirect addressing is used in an instruction such as LDR \(R1\), [\(R2\)].
(c) Describe how the Status Register (SR) is involved in the execution of the CMP and conditional branch instructions used in your answer to part (a).

先自己写一遍答案,再对照解题步骤。

* thinka提供的内容由AI生成,可能并非总是准确或最新。请将其用作辅助资源,并与官方材料进行核实。

你已看过标准答案。现在轮到你的答案被批改。

这一页能告诉你好答案是什么样子,却无法指出你的答案缺了什么。thinka 按真实评分标准批改你的文字答案,约 15 秒完成。

想多做几道同类题目?立即开始练习这个课题,边做边批改。

立即练习