Interrupt Physical
Vector
Address Segment:Offset
| Offset 1401 | 00000
2B41 : 412B Print Proc Far
| Segment A114 | 00002
:
|
| 00004
Iret
|
| 00006
Print Endp
|
| 00008
|
| 0000A
2BAD : 12B4 Break Proc Far
|
| 0000C
:
|
| 0000E
Iret
|
| 00010
Break Endp
|
| 00012
|
| 00014
A114 : 1401 Divide Proc Far
|
| 00016
:
| Offset 1234 | 00018
Iret
| Segment 5678 | 0001A
Divide Endp
2. (4) Show the stack contents and indicated registers after the execution of the Int 6 instruction below.
101A <- Sp Segment : Offset
|
| 1018
412C : A2B4 Int 6
|
| 1016
412C : A2B6 Mov Ax, 178
|
| 1014
|
| 1012
Sp
Cs ___________
|
| 1010
|
| 100E
IF
Ip ___________
3. (4) Give the Assembly code fragment that uses the BIOS Int 10h to
read the character at cursor position row 10, column 42 on video page 0.
4. (2) Using DOS Int 21h, give the code fragment to set the system time
to 5:30:45 pm.
5. (1) Using the DOS Int 21h interrupt, give the code fragment to wait
for any key to be pressed and read the key that was pressed.
6. (5) In the following:
- What device of the Launchpad does P1DIR.6 refer? ________________
- What device of the Launchpad does P1DIR.3 refer? ________________
- What device of the Launchpad does P1IN.3 refer? ________________
- What assembly instruction turns on the green LED? ________________
- What does the following code perform? ________________
.sect ".reset"
.short main
.cdecls C,LIST, "msp430G2231.h" .text main mov.w #0280h,SP ; Set stackpointer (128B RAM device) mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer bis.b #01000000b,&P1DIR ; Set P1DIR.6 = 1 bic.b #00001000b,&P1DIR ; Set P1DIR.3 = 0 bic.b #00001000b,&P1SEL ; Select Port 1 P1.3 bic.b #01000000b,&P1OUT ; Set P1OUT.6 = 0 _while ; while(1) { _if mov.b &P1IN, R15 ; if( P1IN.3 == 0) and.b #00001000b, R15 ; P1OUT.6 = 1 jz _then ; else jmp _else ; P1OUT.6 = 0 _then bis.b #01000000b, &P1OUT ; } jmp _endif _else bic.b #01000000b, &P1OUT _endif jmp _while _endwhile; Interrupt Vectors .sect ".reset" ; MSP430 RESET Vector .short main .end
7. (5) In the following:
- What device of the Launchpad does &CCR0 refer? ________________
- What device of the Launchpad does &TACTL refer? ________________
- What device of the Launchpad does &CCTL0 refer? ________________
- &CCR0 count to generate a 2 second interrupt ? ________________
- What does the following code perform? ________________
bis.w #CPUOFF+GIE,SR
.cdecls C,LIST, "msp430g2231.h" .text ; Progam Start main mov.w #0280h,SP ; Initialize stackpointer mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop Watch Dog Timer bis.b #01000001b,&P1DIR ; P1.0 and P1.6 output bic.b #00000001b,&P1OUT ; Set green LED off bis.b #01000000b,&P1OUT ; Set red LED onmov.w #10h,&CCTL0 ; CCR0 interrupt enabled, bit 4 = 1 mov.w #12000,&CCR0 ; Count 12000 to CCR0 mov.w #TASSEL_1+MC_1,&TACTL ; ACLK source (~12KHz), UP mode (count up to CCR0 value) bis.w #CPUOFF+GIE,SR ; CPU off, interrupts enabled TA0 xor.b #01000001b,&P1OUT ; Toggle P1.0 and P1.6 reti ; Interrupt Vectors .sect ".reset" ; MSP430 RESET Vector .short main ; .sect ".int09" ; Timer_A0 Vector .short TA0 .end