Answer
Flashcards · 9645 · AS Topic 8
Machine code and assembly language (AS Level) flashcards
9 cards on AS Topic 8. Pick a subtopic or study them all.
Study mode needs JavaScript. Every card is listed below, so you can still cover the answers and test yourself.
Choose your cards
Session complete
Worth another look:
All 9 cards
For a quick read-through or printing. Cover the right-hand side to test yourself.
Topic 8: Machine code and assembly language
- Opcode vs operand
- The opcode says which operation to perform. The operand is the data it works on: a value, a memory address or a register.
- Why is machine code processor specific?
- It is written for one processor's instruction set (all the instructions it can carry out), so it is not generally usable on another processor type.
- Immediate vs direct vs indirect addressing
- Immediate: the operand is the value itself (MOV R0, #12). Direct: the operand is the address or register holding the value (LDR R0, 12). Indirect: a register holds the memory address (LDR R0, [R4]).
- R4 holds 70 and location 70 holds 5. What do LDR R0, [R4] and MOV R0, R4 put in R0?
- LDR R0, [R4] puts 5 in R0 (indirect). MOV R0, R4 puts 70 in R0.
- LDR vs STR
- LDR loads a value from memory into a register. STR stores a value from a register into memory.
- What do ORR, EOR and MVN do?
- ORR is bitwise OR; EOR is bitwise XOR (exclusive OR); MVN is bitwise NOT.
- How do you clear, set and toggle chosen bits?
- Clear: AND with 0s in those positions. Set: ORR with 1s in those positions. Toggle: EOR with 1s in those positions.
- What do LSL and LSR do to a value?
- LSL Rd, Rn, #n shifts left n places, multiplying by 2ⁿ. LSR shifts right n places, dividing by 2ⁿ and losing the remainder. Zeros come in; bits falling off are lost.
- How does CMP work with a conditional branch?
- CMP Rn, operand2 compares the two and sets up the following branch, such as BEQ, BNE, BGT or BLT, whose condition reads "Rn compared with operand2".
Revise Machine code and assembly language further
- Study guideOxfordAQA A-Level Computer Science: Machine code and assembly language (9645)
- Revision notesOxfordAQA A-Level Computer Science: Machine code and assembly language (9645) – Revision Notes
- Practice questionsOxfordAQA A-Level Computer Science: Machine code and assembly language (9645) – Practice Questions