What is a register?
- a file saved on the disk
- a tiny fast slot inside the processor
- a cable to the printer
Which line is a typical assembly instruction?
- add the register to the running total
- print the total with a friendly message
- solve the whole problem at once
One line of high level code usually becomes several assembly instructions.
Circle one: True False
You hand run a listing. After three lines the total register holds 6 and the counter holds 3. What do you do on line four?
- guess the final answer from the pattern
- update the table from here line by line
- restart from line one with new guesses
In a loop adding 1 to 5, what do compare and branch do?
- compare prints the total and branch stops the program
- compare loads the next number and branch stores the total
- compare sets flags and branch jumps back to repeat
The line total = total + counter becomes load, add, store. Why three instructions?
- hidden load, add, store each need a line
- assembly repeats every line three times for safety
- registers can only hold one program ever
A friend hand runs a listing and reports only the final total, skipping flags and memory. Why is the report untrustworthy?
- final totals are never needed
- memory cells cannot change
- branch choices depend on flags, so untracked flags mean untracked jumps
A loop adding 1 to 5 ends with the counter at 5 but the total at 10. The branch jumps back while the counter is below 5. What is the most likely bug?
- the compare tests the wrong limit or the wrong register
- assembly cannot add past 10
- the halt line runs too early