Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given four memory locations that hold a 4-digit decimal counter value: D1 equ 0x

ID: 1813154 • Letter: G

Question

Given four memory locations that hold a 4-digit decimal counter value:

D1 equ 0x71

D2 equ 0x72

D3 equ 0x73

D4 equ 0x74


Which represent the four digits of a decimal number: D1 D2 D3 D4


For example:

If D1 = 5, D2 = 1, D3 = 0, and D4 = 9, the number '5109' is represented.

If D1 = 9, D2 = 7, D3 = 8, and D4 = 1, the number '9781' is represented.


1. Write a SUBROUTINE that increments the counter value (D1 D2 D3 D4) every time the subroutine is called updating each of the individual digits ( D1, D2, D3, and D4):


'0000'

'0001'

'0002'

....

'0010'

'0011'

'0012'

.....

'0099'

'0100'

'0101'

....

'9998'

Note: rollover from '9999' '9999'

to '0000' ----- '0000'

'0001'

'0002'


Explanation / Answer

A

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote