Hex Binary Decimal Octal --- ------ ------- ----- 0 0 0 0 1 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 9 9 A B C D E F Hex to Binary table ==================== Hex Binary --- ------ 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 A 1010 B 1011 C 1100 D 1101 E 1110 F 1111 /////////////////////////////////////////////////////// Take the hex no. ABBA and convert it to binary. A--> 1010 B--> 1011 B--> 1011 A--> 1010 1010 1011 1011 1010 1010101110111010 (BASE 2/BINARY) = ABBA (BASE 16/HEX.) /////////////////////////////////////////////////////// Take the hex no. 0000 and convert it to binary. (using the technique we have just used) 0000 (BASE 16/HEX) = 0000 0000 0000 0000 (BASE 2/BINARY) Take the hex no. 0200 and convert it to binary. 0200 (BASE 16/HEX) = 0000 0010 0000 0000 (BASE 2/BINARY) /////////////////////////////////////////////////////// AX 16 BITS LONG BX " CX " DX " AX could contain anything in the range 0000 0000 0000 0000 up to 1111 1111 1111 1111 We can refer to two different parts of AX - AH (HIGH PART OF AX) - AL (LOW PART OF AX) AX - AH (HIGH) AL (LOW PART) BX - BH (HIGH) BL (LOW PART) CX - CH (HIGH) CL (LOW PART) DX - DH (HIGH) DL (LOW PART) The first instruction was mov ah, 02h Initially AX Contained What (in binary) ? 0000 0000 0000 0000 The first instruction : mov ah,02h affects which part of the register? The high part? Which part is the high part? 0000 0000 0000 0000 <-------> <-------> First 8 Last 8 Answer: First 8 ////////////////////////// After the instruction mov ah,02h has been executed? What is contained in the register AX? Write your answer down as both a binary number AND a hex. number. Hint: For you binary you will have a 16 bit number For your hex you will have a 4 digit number e.g. Binary: 0000 0000 0000 0000 Hex: 0000 Answer is..... Binary 0000 0010 0000 0000 Hex: 0200 (1st instruction executed ) ////////////////////////// After the 2nd instruction has been executed? mov dl,041h Which register is affected here? AX, BX CX, OR DX? The D tells us its DX. The L tells us its the LOW PART of DX. What is contained in the register DX? Write your answer down as both a binary number AND a hex. number. You can ignore the zero (041h).... 41h (41 in hex.) Binary: 0000 0000 0100 0001 Hex: 0041 ////////////////////////// The next instruction is int 21h (We will ignore this until next week). ////////////////////////// The next instruction is mov ax,4c00h Which register is affected here? Obviously AX. What is contained in the register AX? Write your answer down as both a binary number AND a hex. number. Binary: 0100 1100 0000 0000 Hex: 4C00