从 except ... end 跳回 try ... 的例子
来源:互联网 发布:java 国内 大牛博客 编辑:程序博客网 时间:2024/05/16 11:16
从 except ... end 跳回 try ... 的例子
//=====================================================================
// MicroTip#7 从 except ... end 跳回 try ... 的例子
// Http://www.cnpack.org
// Written by SkyJacker 2007.05.17
// QQ Discuss Group: 130970
// 欢迎讨论 Win/Delphi SEH, QQ: 6705517 MSN&EMail: HeMiaoYu@gmail.com
//=====================================================================
函数流程:
try
ProcA <----+
except |
ProcB ----+
end;
流程描述: ProcA 发生异常后,进入异常处理函数 ProcB,然后再从 ProcB 跳回 ProcA。
下面函数演示:从异常处理函数返回到异常发生处的下一条指令。
procedure ExceptToTry;
var
MyAddr: Cardinal;
sTitle: string;
sCaption: string;
begin
sTitle := 'Test';
sCaption := 'Info';
try
asm
call @CurrAddr;
@CurrAddr:
pop MyAddr // 获得本条指令的地址
xor ecx, ecx
idiv ecx
push 0
push sCaption
push sTitle
push 0
Call MessageBox
end;
except
asm
mov eax, [MyAddr]
add eax, 7
jmp eax
end;
end;
end;
// MicroTip#7 从 except ... end 跳回 try ... 的例子
// Http://www.cnpack.org
// Written by SkyJacker 2007.05.17
// QQ Discuss Group: 130970
// 欢迎讨论 Win/Delphi SEH, QQ: 6705517 MSN&EMail: HeMiaoYu@gmail.com
//=====================================================================
函数流程:
try
ProcA <----+
except |
ProcB ----+
end;
流程描述: ProcA 发生异常后,进入异常处理函数 ProcB,然后再从 ProcB 跳回 ProcA。
下面函数演示:从异常处理函数返回到异常发生处的下一条指令。
procedure ExceptToTry;
var
MyAddr: Cardinal;
sTitle: string;
sCaption: string;
begin
sTitle := 'Test';
sCaption := 'Info';
try
asm
call @CurrAddr;
@CurrAddr:
pop MyAddr // 获得本条指令的地址
xor ecx, ecx
idiv ecx
push 0
push sCaption
push sTitle
push 0
Call MessageBox
end;
except
asm
mov eax, [MyAddr]
add eax, 7
jmp eax
end;
end;
end;
- 从 except ... end 跳回 try ... 的例子
- python的try...except
- try...except遇到的问题
- try except
- try except
- pb 的try catch finally end try
- Delphi try except 与 finally的区别
- 【Python】对于不确定的内容,try .. except ..
- Python中try...except...else的用法
- Python中try...except...finally的理解
- python try/except/finally的用法
- Python中try...except...else的用法
- python中 if-else 与 try-except的转换 while 与 whileTrue-try-except的转换
- try except and try catch
- try ... except 用法
- C++ 之try-except
- try,except异常处理
- try except 语法
- 将ASP代码移植为VB COM组件(1)
- 批处理,解决启动web服务的简单方法
- Compare xpo with system objects
- SWT 和 JFace,第 4 部分: ToolBar、SashForm 以及其他控件和对话框
- Fedora Core 5, WebSphere MQ 6 Linux x86, AMQ8101: WebSphere
- 从 except ... end 跳回 try ... 的例子
- asp.net中同时上传多个文件
- String.prototype使用
- Use X++ to control word drawing Chart
- 准备TMT初赛中
- 关于Unicode字符集编程
- 深入了解struts中的struts-config.xml
- 与转移地址有关的寻址方式
- 宽字符处理函数函数与普通函数对照表