Write an assembler program that will turn on and off the four leds on your proto
ID: 3812830 • Letter: W
Question
Write an assembler program that will turn on and off the four leds on your proto-board in an infinite loops sequentially. Do this sing the registers as we did in class. You will have to initialize three pins as outputs then turn on and off the LEDs in an infinite loop. The LEDs will be turning on an off faster than your eye can see. So practice with the debugger in codewarrior to single-step through your code. Practice using breakpoints and the continue feature.
Also send me the comments of assembly code
Explanation / Answer
CALL DELAY
MOV AL,BFH
MOV DX,PORTA
OUT DX,AL
MOV AL,BFH
MOV DX,PORTB
OUT DX,AL
MOV CL,15H
CALL DELAY
JMP TOP
MOV AL,FFH
MOV DX,PORTA
OUT DX,AL
MOV AL,AFH
MOV DX,PORTC
OUT DX,AL
MOV AL,EEH
MOV DX,PORTA
OUT DX,AL
MOV AL,EEH
MOV DX,PORTB
OUT DX,AL
MOV CL,02H
CALL DELAY
DELAY:
MOV BX,10H
D1:
MOV CX,0FFFFH
D2:
LOOP D2
DEC BX
JNZ D1
INT 03H
END START
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.