================================ Notes for Lab 08 (DOS Debug Lab) ================================ - Ian! D. Allen - idallen@idallen.ca - www.idallen.com ----------------------------------------------------------------------------- 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 decimal = 1B hex, write B carry 1 2. 1+C+F = 1+12+15 = 28 decimal = 16+12 decimal = 1C hex, write C carry 1 3. 1+B+E = 1+11+14 = 26 decimal = 16+10 decimal = 1A hex, write A carry 1 4. 1+A+E = 1+10+14 = 25 decimal = 16+9 decimal = 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 hex carry: 21 43h x 8h --- 8 <-- 3 x 8 = 24 decimal = 16+8 decimal = 18 hex, write 8 carry 1 21 <-- 1 + 4 x 8 = 33 decimal = 32+1 decimal = 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. ASCII letter 'Z' is 5Ah and each character takes up 8 bytes. To locate 'Z', use table start address FFA6E + (5Ah x 8) = FFD3E Therefore the 8x8 bit map for ASCII letter 'Z' is 8 bytes at FFD3E. Dump of FFD3E gives 8 bytes: FE C6 8C 18 32 66 FE 00 Draw the 8x8 bit map for this character. Write the eight bytes down, top-to-bottom, and expand each one: FEh = 1 1 1 1 1 1 1 _ C6h = 1 1 _ _ _ 1 1 _ 8Ch = 1 _ _ _ 1 1 _ _ 18h = _ _ _ 1 1 _ _ _ 32h = _ _ 1 1 _ _ 1 _ 66h = _ 1 1 _ _ 1 1 _ FEh = 1 1 1 1 1 1 1 _ 00h = _ _ _ _ _ _ _ _ Your character (font) may not appear exactly as shown.