Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. You have to load the memory location $1500 to either accumulator A or B, and use the mask to modify (toggle, set, or clear)
1. You have to load the memory location $1500 to either accumulator A or B, and use the mask to modify (toggle, set, or clear) certain bits of the accumulator. Remember to restore the result back to $1500. a) Write the mask value to toggle bits 7,6, 1, and 0 of memory location $1500, and clear the other four bits (5, 4, 3 & 2) of the same location. Mask to toggle: bit 7 6 5 4 3 2 1 0 Mask to clear: bit | 7 6 5 4 3 2 1 0 b) Write an instruction sequence to toggle bits 7, 6, 5, and 4 of memory location $1500, and let the other four bits (3, 2, 1, & 0) unchanged of the same location. Mask to toggle: bit | 7 6 5 4 3 2 1 0 c) Write an instruction sequence to toggle bits 7, 6, 5, and 4 of memory location at $1500 and set the other four bits (3, 2, 1, & 0) of the same location. Mask to toggle: bit 7 6 5 4 3 2 1 0 Mask to set: bit 76 5 4 3 2 1 0 d) Write an instruction sequence to toggle bits 3, 2, 1, and 0 of memory location at $1500 and set the other four bits (7, 6, 5, & 4) of the same location. Mask to toggle: bit | 7 6 5 4 3 2 10 Mask to set: bit7 6 5 4 3 2 1 0 e) Write an instruction sequence to set bits 7,5, 3 and 1 of a memory location and clear the other four bits of the same location. Mask to set: bit 7 6 5 4 3 2 1 0 Mask to clear: bit 7 6 5 4 3 2 1 2. Determine the total number of E cycles for the following program. ldy Idaa pshb #5000 #250 loop2 loop1 pulb pshb pulb pshb pulb pshb pulb ; 2 E cycles ;1 E cycles ; 2 E cycles ;3 E cycles ; 2 E cycles ;3 E cycles ; 2 E cycles ;3 E cycles ; 2 E cycles ; 3 E cycles ; 2 E cycles ; 3 E cycles ; 2 E cycles ;3 E cycles ;3 E cycles ;3 E cycles 33 1+33+3 E cycle E cycles pshb pulb pshb pulb dbne dbne a, loopl y, loop2 Show all your work: 1. You have to load the memory location $1500 to either accumulator A or B, and use the mask to modify (toggle, set, or clear) certain bits of the accumulator. Remember to restore the result back to $1500. a) Write the mask value to toggle bits 7,6, 1, and 0 of memory location $1500, and clear the other four bits (5, 4, 3 & 2) of the same location. Mask to toggle: bit 7 6 5 4 3 2 1 0 Mask to clear: bit | 7 6 5 4 3 2 1 0 b) Write an instruction sequence to toggle bits 7, 6, 5, and 4 of memory location $1500, and let the other four bits (3, 2, 1, & 0) unchanged of the same location. Mask to toggle: bit | 7 6 5 4 3 2 1 0 c) Write an instruction sequence to toggle bits 7, 6, 5, and 4 of memory location at $1500 and set the other four bits (3, 2, 1, & 0) of the same location. Mask to toggle: bit 7 6 5 4 3 2 1 0 Mask to set: bit 76 5 4 3 2 1 0 d) Write an instruction sequence to toggle bits 3, 2, 1, and 0 of memory location at $1500 and set the other four bits (7, 6, 5, & 4) of the same location. Mask to toggle: bit | 7 6 5 4 3 2 10 Mask to set: bit7 6 5 4 3 2 1 0 e) Write an instruction sequence to set bits 7,5, 3 and 1 of a memory location and clear the other four bits of the same location. Mask to set: bit 7 6 5 4 3 2 1 0 Mask to clear: bit 7 6 5 4 3 2 1 2. Determine the total number of E cycles for the following program. ldy Idaa pshb #5000 #250 loop2 loop1 pulb pshb pulb pshb pulb pshb pulb ; 2 E cycles ;1 E cycles ; 2 E cycles ;3 E cycles ; 2 E cycles ;3 E cycles ; 2 E cycles ;3 E cycles ; 2 E cycles ; 3 E cycles ; 2 E cycles ; 3 E cycles ; 2 E cycles ;3 E cycles ;3 E cycles ;3 E cycles 33 1+33+3 E cycle E cycles pshb pulb pshb pulb dbne dbne a, loopl y, loop2 Show all your work
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