Write the program in assembly language for 68HC11 microcontroller. We are given
ID: 3825319 • Letter: W
Question
Write the program in assembly language for 68HC11 microcontroller.
We are given a table of Employee's salaries where there are three months of salary per employee. An accountant put the employees' salary in the wrong order. They presently are in the following order. Empl #1 Salary of month #2/Salary of month #3/Salary of month #1, Empl #2 Salary of month #2/Salary of month #3/Salary of month #1 Empl #200 Salary of month #2/Salary of month #3/Salary of month #1. Write a program to assemble the salary table in the following order. Empl #1 Salary of month #1/Salary of month #2/Salary of month #3, EmpI #2 Salary of month #1/Salary of month #2/Salary of month #3 Empl #200 Salary of month #1/Salary of month #2/Salary of month #1. Assume all salaries start at 1000H (SRAM).Explanation / Answer
CODE:
Reset EQU $FFFE ; Set symbol Reset to FFFE16
Program EQU $E000 ; Set symbol Program to E00016
ORG Program ; Set the assembler’s location to the value
; represented by symbol Program
Top: LDAEmpl1 #$1000 ; Load the Empl1 register with 1000
LDAEmpl2 #$2000 ; Load the Empl2 register with 2000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LDAEmpl200 #$200000 ; Load the Empl200 register with 200000
•Loop: LDAEmplSalary #$1000 Load Accumulator Empl#$1 with Salary in #$1000
Count EQU EmplSalary '200000
STAEmpl1 #$1000 ; Store the Empl1 register with 1000
STAEmpl2 #$2000 ; Store the Empl2 register with 2000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
STAEmpl200 #$200000 ; Store the Empl200 register with 200000
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.