Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
