In the `update` subroutine, how is the correct value from the `norm-array` selected for autoscaling?

Correct answer: The `update-offset` is used as an index into the array after being converted to a word offset.

Explanation

The `update` subroutine is responsible for scaling the collected data for display. In autoscale mode, it needs to know how many sweeps have been averaged for each data point. This information is stored in the `norm-array`, and the `update-offset` variable acts as an index to retrieve the correct value for the point being displayed.

Other questions

Question 1

In the analog signal averager design, what was the primary reason for putting the display refresh task inside the interrupt handler instead of the main loop?

Question 2

According to the global register usage list in Program 11.3, what is the function of data register D7?

Question 3

What is the memory address assigned to the `stop-flag` variable in the RAM location definitions of Program 11.3?

Question 4

In the program's main loop, what is the purpose of the `BTST #START-BIT, CIO-PA-DATA` instruction followed by `BNE wait-for-zero`?

Question 5

What is the reason given for using indirect addressing through a register (e.g., `MOVE.B (A3),D0`) instead of absolute addressing (e.g., `MOVE.B ADCO,DO`) for accessing ports?

Question 6

In the `get-data-int` interrupt handler routine, after an ADC value is read and added to the accumulator, what is the next step if the dwell count is not yet zero (BNE z_pulse)?

Question 7

What is the calculated execution time for the `idle` interrupt handler entry, including vectoring and return?

Question 8

In the software debounce routine, after waiting for the START switch to be open, how many loops does the `check-debounce` routine execute to ensure the switch remains open before proceeding?

Question 9

What is the purpose of the `bad-int` interrupt handler routine?

Question 10

What value is loaded into CIO-CNTRL to configure the direction of Port B, and what does this configuration achieve?

Question 12

What is the initial value loaded into the `int5-vect` location during the `reset-entry` sequence?

Question 13

Which condition leads to the longest execution time (114 microseconds) for the interrupt service routine?

Question 14

Why is the `clear-arrays` subroutine considered a 'fastest looping primitive'?

Question 15

In the `stop-sweep` routine, what is the purpose of the instruction `ST stop-flag`?

Question 16

What does the `decode-tbl` lookup table in the assembly program contain?

Question 17

When initializing the timer, two bytes are written to set the counting modulus of 400. What are these two bytes?

Question 18

What is the function of address register A2 in the global register usage plan?

Question 19

At the very beginning of the ROM code, what two 32-bit values are defined before the first executable statement?

Question 20

In the `comp-and-save` subroutine, what is the purpose of the `BCHG #7, D1` instruction?

Question 21

What is the memory address defined for the `data-array` in the program listing?

Question 22

In the `wait-trig-int` routine, what happens if the external trigger signal (EXT-TRIGGER) is NOT present?

Question 23

What is the primary pathology of using a software pulse for the Z-axis if interrupts are running?

Question 24

How many times per second is the complete 256-point graph displayed when the refresh is handled by the interrupt routine?

Question 25

In the `auto-scale` section of the `update` subroutine, why does the code perform `TST.W D2` before the `DIVS D2, D1` instruction?

Question 26

What is the defined memory address for the LED port?

Question 27

Which address register is reserved to point to the `NORM` array?

Question 28

When checking for a manual abort at the end of a sweep, the code tests the STOP-BIT. If the bit is set, to which routine does the program branch?

Question 29

What is the specified purpose of the `1's catching` input option for the STOP switch?

Question 30

What does the instruction `MOVE.B #$E0, CIO-CNTRL` accomplish in the Port A initialization sequence?

Question 31

What is the purpose of address register A3, according to the global register usage plan?

Question 32

In the `idle-int` routine, what is the purpose of the instruction `ADDQ.B #1, D4`?

Question 33

What is the starting address of the `norm-array` in RAM?

Question 34

In the `sweep-start-int` routine, what is the primary action taken before falling through to `get-data-int`?

Question 35

What is the execution time for the `getdata` interrupt handler entry at the end of a bin?

Question 36

According to the `main-loop` logic, after the START switch is pressed and the control panel is read, what is the next major step before entering the `update-loop`?

Question 37

In the `z_pulse` routine, what instructions are used to clear the timer's interrupt request?

Question 38

What is the function of the `ASL.W #1, DO` instruction when reading the control panel?

Question 39

Which port bit assignment corresponds to the `SWEEP-BIT` output?

Question 40

What is the primary function of the `re-trigger` routine at the end of a sweep?

Question 41

In Program 11.3, what is the value of `DACO_OFFSET`?

Question 42

What does the instruction `EXT.L D3` accomplish in the `get-data-int` routine?

Question 43

How is the `dwell_per_bin` parameter determined by the main program?

Question 44

What instruction is used to turn off the SWEEP LED at the end of a sweep?

Question 45

In the `vect-init-loop`, the `DBF` instruction loops until the D0 register equals what value?

Question 46

What action does the `CLR.B stop-flag` instruction perform in the final setup before data collection?

Question 47

What is the purpose of the `NOP` instruction in the `get-data-int` handler?

Question 48

Which bit of Port A is assigned to the START button input?

Question 49

What does the `BRA main-loop` instruction at the end of the `update-loop` signify?

Question 50

In the Port C initialization, what value is loaded to set the port's direction, and what is the result?