Write a program to send the following listed data stored at
Write a program to send the following listed data stored at memory locations $2100-$210F to a subroutine that adds them up. Store the result at memory location $21FF. Use \"md\" to see the result and include in your report. Data (numbers are in decimal): 10,15,34,4,5,6,9,23,38,2,11,14,15,9,7. using Assembly language for 68HC11 microcontroller. (using assembly language)
Solution
Assembly language program for 68HC11 microcontroller
ORG $2100
 x_dat FCB 10   
 FCB 15   
 FCB 34
 FCB 4
 FCB 5   
 FCB 6
 FCB 9   
 FCB 23
    FCB 38
    FCB 2
    FCB 11,14,15,9,7
ORG $2100 program starts here (location $2100)
 CLRA clear acc A
 LDX #x_dat X points to first number (immediate)
 LDAA 0,X first number in acc A (indexed)
 INX X points to next number
 again ADDA 0,X add next number to acc A (indexed)
 INX increment pointer
 CPX $21FF
 BNE again if not, add next number (relative)
 STAA $21FF store acc A in $21FF (extended)
md 21FF
END
Thanks

