鱼C论坛

 找回密码
 立即注册
查看: 1500|回复: 1

为啥call s == call offset s?

[复制链接]
发表于 2012-11-7 21:40:34 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
[backcolor=rgb(245, 245, 245) !important]Plain Text code

[backcolor=white !important]1

[backcolor=white !important]2

[backcolor=white !important]3

[backcolor=white !important]4

[backcolor=white !important]5

[backcolor=white !important]6

[backcolor=white !important]7

[backcolor=white !important]8

[backcolor=white !important]9

[backcolor=white !important]10

[backcolor=white !important]11

[backcolor=white !important]12

[backcolor=white !important]13

[backcolor=white !important]14

[backcolor=white !important]15

[backcolor=white !important]16

[backcolor=white !important]17

[backcolor=white !important]18

[backcolor=white !important]19

[backcolor=white !important]20

[backcolor=white !important]21

[backcolor=white !important]22

[backcolor=white !important]23

[backcolor=white !important]24

[backcolor=initial !important]
[backcolor=white !important]assume cs:codesg, ds:datasg, ss:stacksg


[backcolor=white !important]datasg segment

[backcolor=white !important]    dw 0

[backcolor=white !important]datasg ends


[backcolor=white !important]stacksg segment

[backcolor=white !important]    dw 16 dup(0)

[backcolor=white !important]stacksg ends


[backcolor=white !important]codesg segment

[backcolor=white !important]start:

[backcolor=white !important]    mov ax, datasg

[backcolor=white !important]    mov ds, ax

[backcolor=white !important]     

[backcolor=white !important]    mov bx, 0

[backcolor=white !important]    call s

[backcolor=white !important]s:

[backcolor=white !important]    mov ax, 2


[backcolor=white !important]    mov ax, 4c00h

[backcolor=white !important]    int 21h

[backcolor=white !important]codesg ends

[backcolor=white !important]end start


它的机器指令是
[backcolor=white !important][size=1em]
[backcolor=rgb(245, 245, 245) !important]Plain Text code

[backcolor=white !important]1

[backcolor=white !important]2

[backcolor=white !important]3

[backcolor=white !important]4

[backcolor=white !important]5

[backcolor=white !important]6

[backcolor=white !important]7

[backcolor=white !important]8

[backcolor=initial !important]
[backcolor=white !important]-u

[backcolor=white !important]14A0:0000 B89D14        MOV     AX,149D

[backcolor=white !important]14A0:0003 8ED8          MOV     DS,AX

[backcolor=white !important]14A0:0005 BB0000        MOV     BX,0000

[backcolor=white !important]14A0:0008 E80000        CALL    000B

[backcolor=white !important]14A0:000B B80200        MOV     AX,0002

[backcolor=white !important]14A0:000E B8004C        MOV     AX,4C00

[backcolor=white !important]14A0:0011 CD21          INT     21






而[backcolor=white !important][size=1em]
[backcolor=rgb(245, 245, 245) !important]Plain Text code

[backcolor=white !important]1

[backcolor=white !important]2

[backcolor=white !important]3

[backcolor=white !important]4

[backcolor=white !important]5

[backcolor=white !important]6

[backcolor=white !important]7

[backcolor=white !important]8

[backcolor=white !important]9

[backcolor=white !important]10

[backcolor=white !important]11

[backcolor=white !important]12

[backcolor=white !important]13

[backcolor=white !important]14

[backcolor=white !important]15

[backcolor=white !important]16

[backcolor=white !important]17

[backcolor=white !important]18

[backcolor=white !important]19

[backcolor=white !important]20

[backcolor=white !important]21

[backcolor=white !important]22

[backcolor=white !important]23

[backcolor=white !important]24

[backcolor=initial !important]
[backcolor=white !important]assume cs:codesg, ds:datasg, ss:stacksg


[backcolor=white !important]datasg segment

[backcolor=white !important]    dw 0

[backcolor=white !important]datasg ends


[backcolor=white !important]stacksg segment

[backcolor=white !important]    dw 16 dup(0)

[backcolor=white !important]stacksg ends


[backcolor=white !important]codesg segment

[backcolor=white !important]start:

[backcolor=white !important]    mov ax, datasg

[backcolor=white !important]    mov ds, ax

[backcolor=white !important]     

[backcolor=white !important]    mov bx, 0

[backcolor=white !important]    call offset s

[backcolor=white !important]s:

[backcolor=white !important]    mov ax, 2


[backcolor=white !important]    mov ax, 4c00h

[backcolor=white !important]    int 21h

[backcolor=white !important]codesg ends

[backcolor=white !important]end start






编译结果
D:\asm\prj>ml 35.asm
Microsoft (R) Macro Assembler Version 6.15.8803
Copyright (C) Microsoft Corp 1981-2000.  All rights reserved.

Assembling: 35.asm

Microsoft (R) Segmented Executable Linker  Version 5.60.339 Dec  5 1994
Copyright (C) Microsoft Corp 1984-1993.  All rights reserved.

Object Modules [.obj]: 35.obj
Run File [35.exe]: "35.exe"
List File [nul.map]: NUL
Libraries [.lib]:
Definitions File [nul.def]:
LINK : warning L4021: no stack segment


它的机器指令是
[backcolor=white !important][size=1em]
[backcolor=rgb(245, 245, 245) !important]Plain Text code

[backcolor=white !important]1

[backcolor=white !important]2

[backcolor=white !important]3

[backcolor=white !important]4

[backcolor=white !important]5

[backcolor=white !important]6

[backcolor=white !important]7

[backcolor=initial !important]
[backcolor=white !important]14A0:0000 B89D14        MOV     AX,149D

[backcolor=white !important]14A0:0003 8ED8          MOV     DS,AX

[backcolor=white !important]14A0:0005 BB0000        MOV     BX,0000

[backcolor=white !important]14A0:0008 E80000        CALL    000B

[backcolor=white !important]14A0:000B B80200        MOV     AX,0002

[backcolor=white !important]14A0:000E B8004C        MOV     AX,4C00

[backcolor=white !important]14A0:0011 CD21          INT     21






本以为call offset s会跳到此指令下一条的IP+offset s(s到ip=0的编移)去,但是从结果看是跳到此指令下一条+到s的编移地址
同时还发现jmp s与jmp offset s的机器指令一样~.



想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
 楼主| 发表于 2012-11-7 21:43:27 | 显示全部楼层
完了 变乱码了~~~~~~~~~~~~~~~~

问题就是为啥call s与call offset s的机器指令一样~~~~~~~~~~~~
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-10-8 02:22

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表