Instruction MOV AL, 255
has the equivalent binary code: B0 FF (1011 0000 1111 1111)
Instruction MOV BX, 500
becomes => BB F4 01
looking at an emu program segment
[ 7] 0100: BB F4 01 mov bx, 500
[ 8] 0103: 05 03 00 add ax, 3
[ 9] 0106: 8A 2E 0B 01 mov ch, x
[ 10] :
[ 11] 010A: C3 ret
[ 12] :
[ 13] 010B: 63 x db 99
OP CODES (emu) HEX OP CODE LIST Intel Instruction LIST
What goes on here?
mov al, 5
cbw
mov al, 255
cbw
[ 7] 0100: B0 05 mov al,5
[ 8] 0102: 98 cbw
[ 9] 0103: B0 FF mov al,255
[ 10] 0105: 98 cbw
Have to 'know the code'...
Examples: What does '0100 0001' represent?
a number? which one?
signed int? unsigned int? floating point?
is it the ASCII/Unicode code for a character?
or is it some instruction?
addsub.obj -- object file created by the assembler
00000000 4C 01 06 00 8B F4 7D 3D-D0 0B 00 00 1C 00 00 00 L.....}=........
00000010 00 00 00 00 2E 74 65 78-74 00 00 00 00 00 00 00 .....text.......
00000020 00 00 00 00 22 00 00 00-04 01 00 00 26 01 00 00 ....".......&...
00000030 62 01 00 00 06 00 07 00-20 00 30 60 2E 64 61 74 b....... .0`.dat
00000040 61 00 00 00 22 00 00 00-00 00 00 00 10 00 00 00 a..."...........
00000050 8C 01 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000060 40 00 30 C0 53 54 41 43-4B 00 00 00 32 00 00 00 @.0.STACK...2...
00000070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000080 00 00 00 00 00 00 00 00-40 00 30 C0 2E 64 65 62 ........@.0..deb
00000090 75 67 24 53 32 00 00 00-00 00 00 00 51 01 00 00 ug$S2.......Q...
000000A0 9C 01 00 00 EE 02 00 00-00 00 00 00 0A 00 00 00 ................
000000B0 40 00 10 42 2E 64 65 62-75 67 24 54 83 01 00 00 @..B.debug$T....
000000C0 00 00 00 00 70 08 00 00-52 03 00 00 00 00 00 00 ....p...R.......
000000D0 00 00 00 00 00 00 00 00-40 00 10 42 2E 64 72 65 ........@..B.dre
000000E0 63 74 76 65 F3 09 00 00-00 00 00 00 0E 00 00 00 ctve............
000000F0 C2 0B 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000100 00 0A 00 00 A1 00 00 00-00 03 05 00 00 00 00 2B ...............+
00000110 05 00 00 00 00 A3 00 00-00 00 E8 00 00 00 00 6A ...............j
00000120 00 E8 00 00 00 00 01 00-00 00 0F 00 00 00 06 00 ................
00000130 07 00 00 00 10 00 00 00-06 00 0D 00 00 00 12 00 ................
SO, HOW DOES a COMPUTER KNOW WHAT a BYTE of ONES and ZEROES MEANS?
CONTEXT! IP!