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 秒で採点します。

同じような問題をもっと解きたい?このトピックの新しい問題を、解きながら採点。

練習を始める