==================================================== Notes and answers for Lab 10 (video memory exercise) ==================================================== - 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 Not all questions will be marked - check all your answers against the answer sheet when it is posted. ----------------------------------------------------------------------------- Review of addition, base 16 (hexadecimal): ABCD + EEFE A = 10, B = 11, C = 12, D = 13, E = 14, F = 15 Do each column, right-to-left, in hex, and propagate the carry: 1111 ABCD + EEFE ------ 9ACB ------ 1. D+E = 13+14 = 27 decimal = 16+11 = 1B hex, write B carry 1 2. 1+C+F = 1+12+15 = 28 decimal = 16+12 = 1C hex, write C carry 1 3. 1+B+E = 1+11+14 = 26 decimal = 16+10 = 1A hex, write A carry 1 4. 1+A+E = 1+10+14 = 25 decimal = 16+9 = 19 hex, write 9 carry 1 5. Carry flag comes on (addition needs 17 bits). ----------------------------------------------------------------------------- Review of multiplication, base 16 (hexadecimal): 43h * 8h Do each column, right-to-left, in hex, and propagate the carry: 21 43h x 8h --- 8 <-- 3 x 8 = 24 decimal = 16+8 = 18 hex, write 8 carry 1 21 <-- 1 + 4 x 8 = 33 decimal = 32+1 = 21 hex, write 1 carry 2 --- 218h ----------------------------------------------------------------------------- Segment:Offset addresses and 20-bit addresses: A123:0115 | +----> 0115 (this is called the "offset" part) +---------> + A1230 (shift segment left 4 bits before adding) ------- A1345 (result of adding seg+off is a 20-bit address) ------- Other seg:off addresses that give the same 20 bit answer A1345: A123:0115 = A1230+0115 = A1345 A134:0005 = A1340+0005 = A1345 A130:0045 = A1300+0045 = A1345 A100:0345 = A1000+0345 = A1345 A000:1345 = A0000+1345 = A1345 9F00:2345 = 9F000+2345 = A1345 ...etc... ----------------------------------------------------------------------------- DOS ROM Video Character Table: ROM bit map table for ASCII characters (and others) starts at FFA6E. 8x8 bit map for ASCII letter 'A' (41h) is 8 bytes at FFC76. Table start address FFA6E + (41h x 8) = FFC76. Dump of FFC76 gives 8 bytes: 30 78 CC CC FC CC CC 00 30h = _ _ 1 1 _ _ _ _ 78h = _ 1 1 1 1 _ _ _ CCh = 1 1 _ _ 1 1 _ _ CCh = 1 1 _ _ 1 1 _ _ FCh = 1 1 1 1 1 1 _ _ CCh = 1 1 _ _ 1 1 _ _ CCh = 1 1 _ _ 1 1 _ _ 00h = _ _ _ _ _ _ _ _ 8x8 bit map for ASCII letter 'K' (??h) is 8 bytes at ?????. Table start address FFA6E + (??h x 8) = ?????. Dump of ????? gives 8 bytes: ?? ?? ?? ?? ?? ?? ?? ?? Draw the 8x8 bit map for this character.