Question
1. consider the following program. interpret the program line by line. Get an idea what the program.
TOS EQU 0FEFEH
CPU 8086
ORG 0400H
SECTION CODE:
MAIN:
MOV SP, TOS
CALL INITIALIZATION
MOV BX, PATTERN
MOV AL, [BX]
JMP $
INITIALIZATION:
MOV WORD[03FCH], COUNTERISR
MOV WORD[03FCH], 0
MOV AX, 0
STI
RET
COUNTERISR:
OUT 0, AL
IRET
SECTION DATA:
PATTERN DB 255, 128, 170, 15, 240
Do the following:
Part a:
a) by following the program as above, determine what would be the pattern that should be displaced on the LEDs.
Answer:
b) change the special instruction in the above [BX+1]. Determine what would be the pattern that should be displaced on the LEDs.
Answer:
c) change the special instruction in the above [BX+2]. Determine what would be the pattern that should be displaced on the LEDs.
d) change the special instruction in the above [BX+3]. Determine what would be the pattern that should be displaced on the LEDs.
Answer:
e) change the special instruction in the above [BX+4]. Determine what would be the pattern that should be displaced on the LEDs.
Answer:
TOS EQU 0FEFEH
CPU 8086
ORG 0400H
SECTION CODE:
MAIN:
MOV SP, TOS
CALL INITIALIZATION
MOV BX, PATTERN
MOV AL, [BX]
JMP $
INITIALIZATION:
MOV WORD[03FCH], COUNTERISR
MOV WORD[03FCH], 0
MOV AX, 0
STI
RET
COUNTERISR:
OUT 0, AL
IRET
SECTION DATA:
PATTERN DB 255, 128, 170, 15, 240
Do the following:
Part a:
a) by following the program as above, determine what would be the pattern that should be displaced on the LEDs.
Answer:
b) change the special instruction in the above [BX+1]. Determine what would be the pattern that should be displaced on the LEDs.
Answer:
c) change the special instruction in the above [BX+2]. Determine what would be the pattern that should be displaced on the LEDs.
d) change the special instruction in the above [BX+3]. Determine what would be the pattern that should be displaced on the LEDs.
Answer:
e) change the special instruction in the above [BX+4]. Determine what would be the pattern that should be displaced on the LEDs.
Answer:
Answers
Answer
b) Now, compile and load the program into the 8086 trainer kit. Before execution, place the switch into the INTR position. Run the program. place the switch to TICK position. Interrupt will take place. check the pattern and verify it with your answers in Part a).
you have to do this process for each version (a to e) as in part a.
you have to do this process for each version (a to e) as in part a.
Answered by
GPT 3.5
Part a:
a) By following the program as above, the pattern that should be displayed on the LEDs is 255.
b) If the special instruction [BX+1] is changed, the pattern that should be displayed on the LEDs will depend on the value stored in memory location PATTERN+1. The original value at PATTERN+1 is 128, so if this value is changed, the new pattern would be the value stored in PATTERN+1.
c) If the special instruction [BX+2] is changed, the pattern that should be displayed on the LEDs will depend on the value stored in memory location PATTERN+2. The original value at PATTERN+2 is 170, so if this value is changed, the new pattern would be the value stored in PATTERN+2.
d) If the special instruction [BX+3] is changed, the pattern that should be displayed on the LEDs will depend on the value stored in memory location PATTERN+3. The original value at PATTERN+3 is 15, so if this value is changed, the new pattern would be the value stored in PATTERN+3.
e) If the special instruction [BX+4] is changed, the pattern that should be displayed on the LEDs will depend on the value stored in memory location PATTERN+4. The original value at PATTERN+4 is 240, so if this value is changed, the new pattern would be the value stored in PATTERN+4.
a) By following the program as above, the pattern that should be displayed on the LEDs is 255.
b) If the special instruction [BX+1] is changed, the pattern that should be displayed on the LEDs will depend on the value stored in memory location PATTERN+1. The original value at PATTERN+1 is 128, so if this value is changed, the new pattern would be the value stored in PATTERN+1.
c) If the special instruction [BX+2] is changed, the pattern that should be displayed on the LEDs will depend on the value stored in memory location PATTERN+2. The original value at PATTERN+2 is 170, so if this value is changed, the new pattern would be the value stored in PATTERN+2.
d) If the special instruction [BX+3] is changed, the pattern that should be displayed on the LEDs will depend on the value stored in memory location PATTERN+3. The original value at PATTERN+3 is 15, so if this value is changed, the new pattern would be the value stored in PATTERN+3.
e) If the special instruction [BX+4] is changed, the pattern that should be displayed on the LEDs will depend on the value stored in memory location PATTERN+4. The original value at PATTERN+4 is 240, so if this value is changed, the new pattern would be the value stored in PATTERN+4.
Answered by
GPT 3.5
Apologies, but as an AI language model, I'm unable to physically interact with hardware or perform real-time tasks such as running a program on a device. I can only provide theoretical explanations and interpretations of the code.