|
发表于 2018-11-19 23:49:40
|
显示全部楼层
测不准原理?
什么是测不准原理?
测不准的根本原因是因为你的测量工具不行
- [section code align=16]
- jmp 0x07c0: start
- start:
- mov bx, 16
-
- xor dx, dx
- mov ax, 0x7c00 + section.stack.start
- div bx
- mov ss, ax
- mov sp, 16
- xor dx, dx
- mov ax, 0x7c00 + section.data.start
- div bx
- mov ds, ax
-
- mov bx, 0
- mov cx, 8
- s:
- push word [bx]
- add bx, 2
- loop s
-
- mov bx, 0
- mov cx, 8
- s0:
- pop word [bx]
- add bx, 2
- loop s0
- .L:
- cli
- hlt
- jmp .L
-
- [section data align=16]
- dw 0123h, 0456h, 0789h, 0abch, 0defh, 0fedh, 0ebah, 0987h
-
- [section stack align=16]
- dw 0, 0, 0, 0, 0, 0, 0, 0
复制代码
下面是调试记录
- E:\tmp\asm>make debug
- bochsdbg -q -f bochsrc.bxrc
- ========================================================================
- Bochs x86 Emulator 2.6.9
- Built from SVN snapshot on April 9, 2017
- Compiled on Apr 9 2017 at 09:49:25
- ========================================================================
- 00000000000i[ ] reading configuration from bochsrc.bxrc
- 00000000000i[ ] installing win32 module as the Bochs GUI
- 00000000000i[ ] using log file bochsout.txt
- Next at t=0
- (0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0
- <bochs:1> b 0x7c00
- <bochs:2> c
- (0) Breakpoint 1, 0x0000000000007c00 in ?? ()
- Next at t=60706119
- (0) [0x000000007c00] 0000:7c00 (unk. ctxt): jmpf 0x07c0:0005 ; ea0500c007
- <bochs:3> u/30
- 00007c00: ( ): jmpf 0x07c0:0005 ; ea0500c007
- 00007c05: ( ): mov bx, 0x0010 ; bb1000
- 00007c08: ( ): xor dx, dx ; 31d2
- 00007c0a: ( ): mov ax, 0x7c50 ; b8507c
- 00007c0d: ( ): div ax, bx ; f7f3
- 00007c0f: ( ): mov ss, ax ; 8ed0
- 00007c11: ( ): mov sp, 0x0010 ; bc1000
- 00007c14: ( ): xor dx, dx ; 31d2
- 00007c16: ( ): mov ax, 0x7c40 ; b8407c
- 00007c19: ( ): div ax, bx ; f7f3
- 00007c1b: ( ): mov ds, ax ; 8ed8
- 00007c1d: ( ): mov bx, 0x0000 ; bb0000
- 00007c20: ( ): mov cx, 0x0008 ; b90800
- 00007c23: ( ): push word ptr ds:[bx] ; ff37
- 00007c25: ( ): add bx, 0x0002 ; 83c302
- 00007c28: ( ): loop .-7 ; e2f9
- 00007c2a: ( ): mov bx, 0x0000 ; bb0000
- 00007c2d: ( ): mov cx, 0x0008 ; b90800
- 00007c30: ( ): pop word ptr ds:[bx] ; 8f07
- 00007c32: ( ): add bx, 0x0002 ; 83c302
- 00007c35: ( ): loop .-7 ; e2f9
- 00007c37: ( ): cli ; fa
- 00007c38: ( ): hlt ; f4
- 00007c39: ( ): jmp .-4 ; ebfc
- 00007c3b: ( ): add byte ptr ds:[bx+si], al ; 0000
- 00007c3d: ( ): add byte ptr ds:[bx+si], al ; 0000
- 00007c3f: ( ): add byte ptr ss:[bp+di], ah ; 0023
- 00007c41: ( ): add word ptr ss:[bp+4], dx ; 015604
- 00007c44: ( ): mov word ptr ds:[bx], ax ; 8907
- 00007c46: ( ): mov sp, 0xef0a ; bc0aef
- <bochs:4> s
- Next at t=60706120
- (0) [0x000000007c05] 07c0:0005 (unk. ctxt): mov bx, 0x0010 ; bb1000
- <bochs:5>
- Next at t=60706121
- (0) [0x000000007c08] 07c0:0008 (unk. ctxt): xor dx, dx ; 31d2
- <bochs:6>
- Next at t=60706122
- (0) [0x000000007c0a] 07c0:000a (unk. ctxt): mov ax, 0x7c50 ; b8507c
- <bochs:7>
- Next at t=60706123
- (0) [0x000000007c0d] 07c0:000d (unk. ctxt): div ax, bx ; f7f3
- <bochs:8>
- Next at t=60706124
- (0) [0x000000007c0f] 07c0:000f (unk. ctxt): mov ss, ax ; 8ed0
- <bochs:9>
- Next at t=60706125
- (0) [0x000000007c11] 07c0:0011 (unk. ctxt): mov sp, 0x0010 ; bc1000
- <bochs:10>
- Next at t=60706126
- (0) [0x000000007c14] 07c0:0014 (unk. ctxt): xor dx, dx ; 31d2
- <bochs:11>
- Next at t=60706127
- (0) [0x000000007c16] 07c0:0016 (unk. ctxt): mov ax, 0x7c40 ; b8407c
- <bochs:12>
- Next at t=60706128
- (0) [0x000000007c19] 07c0:0019 (unk. ctxt): div ax, bx ; f7f3
- <bochs:13>
- Next at t=60706129
- (0) [0x000000007c1b] 07c0:001b (unk. ctxt): mov ds, ax ; 8ed8
- <bochs:14>
- Next at t=60706130
- (0) [0x000000007c1d] 07c0:001d (unk. ctxt): mov bx, 0x0000 ; bb0000
- <bochs:15> sreg
- es:0x0000, dh=0x00009300, dl=0x0000ffff, valid=1
- Data segment, base=0x00000000, limit=0x0000ffff, Read/Write, Accessed
- cs:0x07c0, dh=0x00009300, dl=0x7c00ffff, valid=1
- Data segment, base=0x00007c00, limit=0x0000ffff, Read/Write, Accessed
- ss:0x07c5, dh=0x00009300, dl=0x7c50ffff, valid=1
- Data segment, base=0x00007c50, limit=0x0000ffff, Read/Write, Accessed
- ds:0x07c4, dh=0x00009300, dl=0x7c40ffff, valid=1
- Data segment, base=0x00007c40, limit=0x0000ffff, Read/Write, Accessed
- fs:0x0000, dh=0x00009300, dl=0x0000ffff, valid=1
- Data segment, base=0x00000000, limit=0x0000ffff, Read/Write, Accessed
- gs:0x0000, dh=0x00009300, dl=0x0000ffff, valid=1
- Data segment, base=0x00000000, limit=0x0000ffff, Read/Write, Accessed
- ldtr:0x0000, dh=0x00008200, dl=0x0000ffff, valid=1
- tr:0x0000, dh=0x00008b00, dl=0x0000ffff, valid=1
- gdtr:base=0x00000000000f9a37, limit=0x30
- idtr:base=0x0000000000000000, limit=0x3ff
- <bochs:16> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0123 0x0456 0x0789 0x0abc 0x0def 0x0fed 0x0eba 0x0987
- <bochs:17> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
- <bochs:18> s
- Next at t=60706131
- (0) [0x000000007c20] 07c0:0020 (unk. ctxt): mov cx, 0x0008 ; b90800
- <bochs:19>
- Next at t=60706132
- (0) [0x000000007c23] 07c0:0023 (unk. ctxt): push word ptr ds:[bx] ; ff37
- <bochs:20> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
- <bochs:21> s
- Next at t=60706133
- (0) [0x000000007c25] 07c0:0025 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:22> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0123
- <bochs:23> s
- Next at t=60706134
- (0) [0x000000007c28] 07c0:0028 (unk. ctxt): loop .-7 (0x00007c23) ; e2f9
- <bochs:24>
- Next at t=60706135
- (0) [0x000000007c23] 07c0:0023 (unk. ctxt): push word ptr ds:[bx] ; ff37
- <bochs:25>
- Next at t=60706136
- (0) [0x000000007c25] 07c0:0025 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:26> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0456 0x0123
- <bochs:27> s
- Next at t=60706137
- (0) [0x000000007c28] 07c0:0028 (unk. ctxt): loop .-7 (0x00007c23) ; e2f9
- <bochs:28>
- Next at t=60706138
- (0) [0x000000007c23] 07c0:0023 (unk. ctxt): push word ptr ds:[bx] ; ff37
- <bochs:29>
- Next at t=60706139
- (0) [0x000000007c25] 07c0:0025 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:30> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0000 0x0000 0x0000 0x0000 0x0000 0x0789 0x0456 0x0123
- <bochs:31> s
- Next at t=60706140
- (0) [0x000000007c28] 07c0:0028 (unk. ctxt): loop .-7 (0x00007c23) ; e2f9
- <bochs:32>
- Next at t=60706141
- (0) [0x000000007c23] 07c0:0023 (unk. ctxt): push word ptr ds:[bx] ; ff37
- <bochs:33>
- Next at t=60706142
- (0) [0x000000007c25] 07c0:0025 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:34> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0000 0x0000 0x0000 0x0000 0x0abc 0x0789 0x0456 0x0123
- <bochs:35> s
- Next at t=60706143
- (0) [0x000000007c28] 07c0:0028 (unk. ctxt): loop .-7 (0x00007c23) ; e2f9
- <bochs:36>
- Next at t=60706144
- (0) [0x000000007c23] 07c0:0023 (unk. ctxt): push word ptr ds:[bx] ; ff37
- <bochs:37>
- Next at t=60706145
- (0) [0x000000007c25] 07c0:0025 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:38> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0000 0x0000 0x0000 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:39> s
- Next at t=60706146
- (0) [0x000000007c28] 07c0:0028 (unk. ctxt): loop .-7 (0x00007c23) ; e2f9
- <bochs:40>
- Next at t=60706147
- (0) [0x000000007c23] 07c0:0023 (unk. ctxt): push word ptr ds:[bx] ; ff37
- <bochs:41>
- Next at t=60706148
- (0) [0x000000007c25] 07c0:0025 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:42> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0000 0x0000 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:43> s
- Next at t=60706149
- (0) [0x000000007c28] 07c0:0028 (unk. ctxt): loop .-7 (0x00007c23) ; e2f9
- <bochs:44>
- Next at t=60706150
- (0) [0x000000007c23] 07c0:0023 (unk. ctxt): push word ptr ds:[bx] ; ff37
- <bochs:45>
- Next at t=60706151
- (0) [0x000000007c25] 07c0:0025 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:46> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0000 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:47> s
- Next at t=60706152
- (0) [0x000000007c28] 07c0:0028 (unk. ctxt): loop .-7 (0x00007c23) ; e2f9
- <bochs:48>
- Next at t=60706153
- (0) [0x000000007c23] 07c0:0023 (unk. ctxt): push word ptr ds:[bx] ; ff37
- <bochs:49>
- Next at t=60706154
- (0) [0x000000007c25] 07c0:0025 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:50> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:51> s
- Next at t=60706155
- (0) [0x000000007c28] 07c0:0028 (unk. ctxt): loop .-7 (0x00007c23) ; e2f9
- <bochs:52>
- Next at t=60706156
- (0) [0x000000007c2a] 07c0:002a (unk. ctxt): mov bx, 0x0000 ; bb0000
- <bochs:53> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0123 0x0456 0x0789 0x0abc 0x0def 0x0fed 0x0eba 0x0987
- <bochs:54> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:55> sreg
- es:0x0000, dh=0x00009300, dl=0x0000ffff, valid=1
- Data segment, base=0x00000000, limit=0x0000ffff, Read/Write, Accessed
- cs:0x07c0, dh=0x00009300, dl=0x7c00ffff, valid=1
- Data segment, base=0x00007c00, limit=0x0000ffff, Read/Write, Accessed
- ss:0x07c5, dh=0x00009300, dl=0x7c50ffff, valid=7
- Data segment, base=0x00007c50, limit=0x0000ffff, Read/Write, Accessed
- ds:0x07c4, dh=0x00009300, dl=0x7c40ffff, valid=3
- Data segment, base=0x00007c40, limit=0x0000ffff, Read/Write, Accessed
- fs:0x0000, dh=0x00009300, dl=0x0000ffff, valid=1
- Data segment, base=0x00000000, limit=0x0000ffff, Read/Write, Accessed
- gs:0x0000, dh=0x00009300, dl=0x0000ffff, valid=1
- Data segment, base=0x00000000, limit=0x0000ffff, Read/Write, Accessed
- ldtr:0x0000, dh=0x00008200, dl=0x0000ffff, valid=1
- tr:0x0000, dh=0x00008b00, dl=0x0000ffff, valid=1
- gdtr:base=0x00000000000f9a37, limit=0x30
- idtr:base=0x0000000000000000, limit=0x3ff
- <bochs:56> s
- Next at t=60706157
- (0) [0x000000007c2d] 07c0:002d (unk. ctxt): mov cx, 0x0008 ; b90800
- <bochs:57>
- Next at t=60706158
- (0) [0x000000007c30] 07c0:0030 (unk. ctxt): pop word ptr ds:[bx] ; 8f07
- <bochs:58>
- Next at t=60706159
- (0) [0x000000007c32] 07c0:0032 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:59> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0987 0x0456 0x0789 0x0abc 0x0def 0x0fed 0x0eba 0x0987
- <bochs:60> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:61> s
- Next at t=60706160
- (0) [0x000000007c35] 07c0:0035 (unk. ctxt): loop .-7 (0x00007c30) ; e2f9
- <bochs:62>
- Next at t=60706161
- (0) [0x000000007c30] 07c0:0030 (unk. ctxt): pop word ptr ds:[bx] ; 8f07
- <bochs:63>
- Next at t=60706162
- (0) [0x000000007c32] 07c0:0032 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:64> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0987 0x0eba 0x0789 0x0abc 0x0def 0x0fed 0x0eba 0x0987
- <bochs:65> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:66> s
- Next at t=60706163
- (0) [0x000000007c35] 07c0:0035 (unk. ctxt): loop .-7 (0x00007c30) ; e2f9
- <bochs:67>
- Next at t=60706164
- (0) [0x000000007c30] 07c0:0030 (unk. ctxt): pop word ptr ds:[bx] ; 8f07
- <bochs:68>
- Next at t=60706165
- (0) [0x000000007c32] 07c0:0032 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:69> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0abc 0x0def 0x0fed 0x0eba 0x0987
- <bochs:70> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:71> s
- Next at t=60706166
- (0) [0x000000007c35] 07c0:0035 (unk. ctxt): loop .-7 (0x00007c30) ; e2f9
- <bochs:72>
- Next at t=60706167
- (0) [0x000000007c30] 07c0:0030 (unk. ctxt): pop word ptr ds:[bx] ; 8f07
- <bochs:73>
- Next at t=60706168
- (0) [0x000000007c32] 07c0:0032 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:74> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0def 0x0fed 0x0eba 0x0987
- <bochs:75> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:76> s
- Next at t=60706169
- (0) [0x000000007c35] 07c0:0035 (unk. ctxt): loop .-7 (0x00007c30) ; e2f9
- <bochs:77>
- Next at t=60706170
- (0) [0x000000007c30] 07c0:0030 (unk. ctxt): pop word ptr ds:[bx] ; 8f07
- <bochs:78>
- Next at t=60706171
- (0) [0x000000007c32] 07c0:0032 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:79> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0fed 0x0eba 0x0987
- <bochs:80> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:81> s
- Next at t=60706172
- (0) [0x000000007c35] 07c0:0035 (unk. ctxt): loop .-7 (0x00007c30) ; e2f9
- <bochs:82>
- Next at t=60706173
- (0) [0x000000007c30] 07c0:0030 (unk. ctxt): pop word ptr ds:[bx] ; 8f07
- <bochs:83>
- Next at t=60706174
- (0) [0x000000007c32] 07c0:0032 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:84> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0eba 0x0987
- <bochs:85> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:86> s
- Next at t=60706175
- (0) [0x000000007c35] 07c0:0035 (unk. ctxt): loop .-7 (0x00007c30) ; e2f9
- <bochs:87>
- Next at t=60706176
- (0) [0x000000007c30] 07c0:0030 (unk. ctxt): pop word ptr ds:[bx] ; 8f07
- <bochs:88>
- Next at t=60706177
- (0) [0x000000007c32] 07c0:0032 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:89> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0987
- <bochs:90> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:91> s
- Next at t=60706178
- (0) [0x000000007c35] 07c0:0035 (unk. ctxt): loop .-7 (0x00007c30) ; e2f9
- <bochs:92>
- Next at t=60706179
- (0) [0x000000007c30] 07c0:0030 (unk. ctxt): pop word ptr ds:[bx] ; 8f07
- <bochs:93>
- Next at t=60706180
- (0) [0x000000007c32] 07c0:0032 (unk. ctxt): add bx, 0x0002 ; 83c302
- <bochs:94> x/8hx 0x7c40
- [bochs]:
- 0x0000000000007c40 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:95> x/8hx 0x7c50
- [bochs]:
- 0x0000000000007c50 <bogus+ 0>: 0x0987 0x0eba 0x0fed 0x0def 0x0abc 0x0789 0x0456 0x0123
- <bochs:96> s
- Next at t=60706181
- (0) [0x000000007c35] 07c0:0035 (unk. ctxt): loop .-7 (0x00007c30) ; e2f9
- <bochs:97>
- Next at t=60706182
- (0) [0x000000007c37] 07c0:0037 (unk. ctxt): cli ; fa
- <bochs:98>
- Next at t=60706183
- (0) [0x000000007c38] 07c0:0038 (unk. ctxt): hlt ; f4
- <bochs:99>
- Next at t=60706184
- (0) [0x000000007c39] 07c0:0039 (unk. ctxt): jmp .-4 (0x00007c37) ; ebfc
- <bochs:100>
复制代码
asm.zip
(7.65 KB, 下载次数: 1)
看不懂?
没关系,继续往后学吧,后面的内容更精彩
^_^
|
|