============================================ Answers for Lab 07 (MARIE assembly language) ============================================ - Ian! D. Allen - idallen@idallen.ca - www.idallen.com Not all questions will be marked - check all your answers against this answer sheet. References: ECOA2e Section 4.1-4.6, 4.8.1-4.9.1, 4.9.3, 4.10, 4.11.1, 5.4.2 and associated Chapter Slides Class Notes (via course home page): text_errata.txt Class Notes under http://teaching.idallen.com/cst8214/07f/ text_errata.txt 1. 1.1. fetch from memory (at location in PC), the instruction into the IR 1.2. increment PC by length of instruction 1.3. decode and execute the instruction from its place in the IR 2. to the instruction that follows the current instruction 3. False (Skipcond uses it differently; Halt doesn't use it at all) 4. the "English" name of the instruction, e.g. Jump, AddI 5. machine code 6. assembly language 7. True 8. an assembler 9. 0x8000 10. MAR<--X, MBR<--M[MAR], AC<--AC+MBR 11. PC<--X 12. 1AB9, 3ABA, 2ABB, 7000, 0023, FFE9, 0000 13. object code; an object file 14. True 15. True 16. AC IR MAR MBR PC load x 0020 1004 004 0020 001 add y 0011 3005 005 FFF1 002 store z 0011 2006 006 0011 003 halt 0011 7000 003 XXXX 004 XXXX = 0011 or 7000 17. 1CF6, 3CF7, 2CF8, 7000, 0020, FFF1, 0000 18. 1A27 3A28 9A25 3A28 2A27 7000 3A27 9A22 0023 0001 19. S2 A22 S1 A25 A A27 One A28 20. PC,MAR only need 12 bits to hold a 12-bit MARIE memory address AC,MBR need to hold a full 16-bit memory content value (data) 21. i) Store 007 ii) Jump 00B iii) Add 009 22. Immediate 2000 Direct 2200 Indirect 2600 Indexed (with R1) 3600 23. MAR <-- X MBR <-- M[MAR] MAR <-- MBR MBR <-- M[MAR] AC <-- MBR 24. Immediate 1000 Direct 1400 Indirect 1300 Indexed (with R1) 1000 25. Immediate 500 Direct 100 Indirect 600 Indexed (with R1) 800