170 likes | 309 Views
COMPSCI 210 Semester 1 - 2014. Tutorial 4: Exercises from CH 6 and 7. Exercise 6.14 - Solution. Solution Exercise 6.15. Exercise 7.2 - Solution.
E N D
COMPSCI 210Semester 1 - 2014 Tutorial 4: Exercises from CH 6 and 7
Exercise 7.2 - Solution The instruction loads R1 with the value of ASCII which is the location of the instruction itself. Remember that the offset (the bottom 9 bits of the instruction) is added to the PC but the PC will already have moved on. So ASCII is x4F08, PC is x4F09 so the offset is -1. Which as a 9 bit value is 1 1111 1111. Therefore the instruction is LD R1, #-1 and machine code is 0010 001 1 1111 1111