Machine Language Swaperoo Lab

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

Machine Language Swaperoo Lab Please use the following boxes to document your logic on the Swaperoo program.

I have started the program for you. The specific problem choice is 4 and 5. We will load beginning in address location !. So" we put the 4 in location ! and the 5 in location #. Then" we need subse$uent instructions to cause the 4 and the 5 to swap locations such that the 5 winds up in location ! and the 4 winds up in location #. %dd rows to the table as re$uired to complete the program. &ou won't need any other commands besides ()* and ST) +and a ,(T at the end-. When finished" you should have a 5 in location ! and a 4 in location #. We won't care what is in any other locations. Instruction ()*01 4 ST) ! %ddress ! 2 4 %ddress # 2 2 %ddress / 2 2 %ccumulator 4 4 *escription Puts the number 4 into the accumulator 3a4es a copy of the 4 in the accumulator and stores this copy in address location ! Puts the number 5 in the accumulator" writing over the 4 3a4es a copy of the 5 in the accumulator and stores this copy in address location #

()*01 5

ST) #

You might also like