Ghidra: the location bar is not the selection
The location bar is the cursor address. A selection is a span. Name which one you wrote down.
The location bar follows the cursor
The location bar shows the address of the cursor. Move the cursor one row and the bar changes. That number is the address you type into Go To when you want the same row again. It is one address, even when a selection covers more.
Clicking inside a selection can leave the cursor on one end while the span stays highlighted. Look at both readouts before you write a single number down.
A selection is a span with a length
A drag in the Listing selects a range. The status line reports how many bytes are in it. That count is a length. It is not an address, and it is not the size of whichever instruction the cursor happens to sit on.
Clear the selection when you meant one row. If you keep the span, label it as a span. A later reader should not have to guess whether 12 was an address or a length.
Say which readout you mean
The notebook line names the cursor address, and it names the selection length only when a selection is active. If you are quoting one instruction, say the selection was cleared, or quote the bytes column of that single row instead of the span length.
Lab: twelve selected bytes and one cursor
In the lab program, click one instruction and read the location bar. Then drag so the selection covers that instruction and more, until the status line reports a length longer than the one row. Leave the cursor on the original address.
Write both numbers with labels. Correct a draft that says the instruction is as long as the selection. Clear the selection and confirm the location bar still shows the cursor you meant.
A cursor inside a longer selection location bar: 00101520 selection: 12 bytes, still active instruction under the cursor: shorter than 12 bytes write: cursor and selection as two facts not: the instruction is 12 bytes
Diagram
The cursor and the span are different readouts
Read the location bar and the selection length as separate facts.
Location bar
00101520
The cursor address.
- One address.
- Not a length.
- Not the whole span if a selection is active.
Selection
12 bytes selected
A span starting at the anchor.
- 12 is a length.
- It can cover more than the instruction under the cursor.
Notebook
cursor 00101520; selection 12 bytes, still active
Both facts, labeled.
- Say which number is the address.
- Do not file 12 as the instruction size.
location bar: 00101520 selection: 12 bytes, still active instruction under the cursor: shorter than 12 bytes write: cursor and selection as two facts not: the instruction is 12 bytes
Check yourself
1. The location bar shows 00101520. What is that number?
2. The status line says 12 bytes selected. What is 12?
3. You meant the single instruction under the cursor, but a selection is still active. What do you write?