Search code examples
debuggingassemblyx86dos

DEBUG DOS program to view memory


I have just started studying X86 Assembly Language.

My doubt -

When I am using the DOS DEBUG program to look at memory location, I am getting slightly different values on examining the same memory location using two different segment:offset addresses. I.e.-

Aren't D 40[0]:17 and D 41[0]:7 supposed to give exactly same output? since both of them give same address on adding segment + offset = 400+17 = 410+7 = 417H

The results which I get - (notice they are slightly different)

-D 40:17
0040:0010                       00-00 00 1E 00 1E 00 0D 1C          .........
0040:0020  44 20 20 39 34 05 34 05-3A 27 39 0A 0D 1C 44 20   D  94.4.:'9...D
0040:0030  20 39 34 05 30 0B 3A 27-31 02 37 08 0D 1C 00 00    94.0.:'1.7.....
0040:0040  93 00 C3 00 00 00 00 00-00 03 50 00 00 10 00 00   ..........P.....
0040:0050  00 18 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
0040:0060  0F 0C 00 D4 03 29 30 00-00 00 00 00 91 DA 10 00   .....)0.........
0040:0070  00 00 00 00 00 00 08 00-14 14 14 14 01 01 01 01   ................
0040:0080  1E 00 3E 00 18 10 00 60-F9 11 0B 00 50 01 00 00   ..>....`....P...
0040:0090  00 00 00 00 00 00 10                              .......
-D 41:7
0041:0000                       00-00 00 2C 00 2C 00 44 20          ...,.,.D
0041:0010  20 39 34 05 31 02 3A 27-37 08 0D 1C 0D 1C 44 20    94.1.:'7.....D
0041:0020  20 39 34 05 30 0B 3A 27-31 02 37 08 0D 1C 00 00    94.0.:'1.7.....
0041:0030  08 00 C3 00 00 00 00 00-00 03 50 00 00 10 00 00   ..........P.....
0041:0040  00 18 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
0041:0050  0F 0C 00 D4 03 29 30 00-00 00 00 00 1C DB 10 00   .....)0.........
0041:0060  00 00 00 00 00 00 08 00-14 14 14 14 01 01 01 01   ................
0041:0070  1E 00 3E 00 18 10 00 60-F9 11 0B 00 50 01 00 00   ..>....`....P...
0041:0080  00 00 00 00 00 00 10                              .......

Solution

  • You are looking at the BIOS data area, whose contents changes over time since it contains things like the state of shift/control/alt keys, the read/write positions of the keyboard buffer and the timer.