40 likes | 356 Views
Chapters 6 & 7 Assembly Language Programming Examples on LC-3. Example 1: Write an LC-3 assembly language routine to swap the contents two consecutive memory locations Let the address of the first memory location be x3339. The program should start at memory location x3300.
E N D
Chapters 6 & 7Assembly Language Programming Examples on LC-3 Example 1: Write an LC-3 assembly language routine to swap the contents two consecutive memory locations Let the address of the first memory location be x3339. The program should start at memory location x3300.
Assembly Language Programming Examples on LC-3 Example 2: Write an LC-3 assembly language routine to display exactly 100 “Z”s on the screen.The program should start at memory location x3100. The character “Z” is stored in the memory location x3106 and the count 100 is stored in the memory location x3107.
Assembly Language Programming Examples on LC-3 Example 3: Write an LC-3 assembly language routine to test whether R2 is even or odd. The program should start at memory location x3100. The program branches to x3110 if the number in R2 is even and branches to x3120 if the number in R2 is odd.
Assembly Language Programming Examples on LC-3 Example 4: Write an LC-3 assembly language routine to increment each of the numbers stored in memory location A through memory location B. Assume that these memory locations have already been initialized with meaningful numbers. The addresses A and B can be found in memory locations x3100 and x3101. The program starts at x3000.