------------------------- Week 09 Notes for DAT2343 ------------------------- -Ian! D. Allen - idallen@idallen.ca - www.idallen.com The second midterm test is this week (Week 9) Thursday November 4. Simple hardware calculators are permitted but not necessary. Multi-function devices, computers, tablets, and phones are not permitted. Topics ------ Second Midterm Test (Thursday) Review Second Midterm Test (Friday) self_mark.txt Self-mark of Assignment NN (participation mark) 363_LMC_indirect.txt LMC Indirection Tricks 364_LMC_bootstrap.html The Bootstrap Process (including LMC) 365_Bootstrap_Process.ppt 365_Bootstrap_Process.wmv ----------------------------------- Midterm Test #2 - November 4, 2010 ----------------------------------- Answer Sheet (unverified - are these all correct?) 1. 80F + 7F1 = 000 Z C OK_SIGN 9B1 + B1A = 4CB C O FFF + FFF = FFE C S OK_SIGN 794 + 516 = CAA S O OK_UNSIGN 800 + 800 = 000 Z C O 2. 16 bit means 2**16 numbers, but half are negative, so 2**15 are positive, but that includes zero, so the answer is (2**15)-1 or 32,767 3. 16 bits 4. 0xC1 0x41 5. running programs larger than physical memory 6. call saves the return address 7. only ADD and SUB 8. see notes for LMC cycle 9. JMP and CALL would not work 10. 00 119 WHILE LDA TEN 01 416 SUB COUNT 02 802 SKP 03 912 JMP ENDWH 04 115 LDA SUM 05 316 ADD COUNT 06 316 ADD COUNT 07 215 STO SUM 08 116 LDA COUNT 09 317 ADD ONE 10 216 STO COUNT 11 900 JMP WHILE 12 115 ENDWH LDA SUM 13 600 OUT 14 700 HLT 15 000 SUM DAT 000 16 001 COUNT DAT 001 17 001 ONE DAT 001 18 002 TWO DAT 002 19 010 TEN DAT 010 11. Add up double the numbers from 1 to 10, inclusive. 12. 11 13. no - one is a constant, the other is a variable 14. 00 116 LDA H6 01 415 SUB H5 02 217 STO X 03 600 OUT 04 800 SKN 05 600 OUT 06 500 IN 07 417 SUB X 08 217 STO X 09 801 SKZ 10 600 OUT 11 417 SUB X 12 802 SKP 13 600 OUT 14 700 HLT 15 500 H5 DAT 500 ; constant 16 600 H6 DAT 600 ; constant 17 700 X DAT 700 ; variable 15. 100 100 200 16. 03FF 17. 039D 18. '3' 19. not an ASCII character 20. 'N' 21. -1 22. 10 23. -6 24. F89BC01A Class results from the second midterm test: ------------------------------------------ 76.2 67.6 60 55.2 54.3 42.9 33.3 31.4 -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/