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

I am having with this assembling coding. I used the HCS12 Microcontrollers and E

ID: 2246893 • Letter: I

Question

I am having with this assembling coding. I used the HCS12 Microcontrollers and Embedded Systems, 1st Edition. This book allows me to understand instruction like the LDAA, STAB, and CLI but I am struggling to understand the TSCR1(Timer System Control Register 1), TSCR2(Timer System Control Register 2), TIOS(Timer Input/output Select Register).  I need a help to solve this problem and it is due 11:59pm?

What kind of tasks does/do this/these Assembly code instruction instruction(s) perform? LDAB #si #961 0000000 STAB TSCR1 LDAB #%00000 1 1 0 STAB TSCR2 BCLRTIOS.%01000000 LDAB #%00100000 STAB TCTL3 LDAB #%01000000 STAB TIE CLI

Explanation / Answer

NOTE:- TSCR1,TSCR2,TIOS are address labels which are defined earlier in the program.They just point the memory location .These values are vendor specific.

1)
LDAB #%10000000 = it loads 8 bits of data 10000000 ; into B register
STAB TSCR1 = it stores 8 bits of data from B register into LOCATION ADDRESS represented by TSCR1

2)
LDAB #%00000110 = it loads 8 bits of data 00000110 ; into B register
STAB TSCR1 = it stores 8 bits of data from B register into LOCATION ADDRESS represented by TSCR2

3)
BCLR TIOS,%01000000 = it clears the 7 bit of the value holded by the address label TIOS i.e if TIOS is pointing to address 11000000 which contains value 01110000 then 01110000 -> 00110000

4)
LDAB #%00100000 = it loads 8 bits of data 00100000 ; into B register
STAB TCTL3 = it stores 8 bits of data from B register into LOCATION ADDRESS represented by TCTL3

5)
LDAB #%01000000 = it loads 8 bits of data 01000000 ; into B register
STAB TIE = it stores 8 bits of data from B register into LOCATION ADDRESS represented by TIE

NOTE:-
IN all these instructions ; we are just updating the values of registers and nothing else.WE are taking a value into register and then we are updating it into the register