Answered step by step
Verified Expert Solution
Question
1 Approved Answer
B 2 . 2 ) Write a macro called ADD 2 PORT that reads first value from an input port and the second value from
B Write a macro called ADDPORT that reads first value from an input port and the second value from the
CSEG table and add the two values before displaying the output on the output port.
Usage example: ADDPORT PINA, Z PORTC
include mdef.inc"
cseg
org x
rjmp init
org x
table: db xxxxxx
endtable:
org x
init:
ldi ZL lowtable
ldi ZH hightable
ldi RxFF
out DDRC R
ldi Rx
out DDRA, R
read: ; call the macro ADDPORT
ADDPORT PINA, Z PORTC
rjmp read
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started