INVOKE expression [, arguments]
其中:expression—地址表达式,通常为子程序名;
arguments—传递的各参数之间用逗号','分开,参数可以是寄存器、表达式或ADDR标识符等。
该伪指令是调用基于堆栈的子程序的方法,它把所有参数压栈,子程序结束时,又把参数自动弹出堆栈。
在参数传递时,汇编程序将根据子程序的原型进行数据类型检查。若需要进行参数类型转换的话,汇编程序则会自动生成一段代码来满足其数据类型转换的要求。
例如:
INVOKE TEST, AX, 12+34, ADDR MSG
其中:TEST是子程序名,寄存器AX和表达式“12+34”是参数,“ADDRMSG”是传递变量MSG的地址。
例7.6 编写一个累加参数数值的子程序。其中参数的个数不定,参数的个数由第一个参数来确定。
解:
http://www.zznews.cn/hyzx/jkxx/5348241718.html
http://www.zznews.cn/hyzx/jkxx/5347227324.html
http://www.zznews.cn/hyzx/jkxx/5347234827.html
http://www.fengone.com/bj/jsqy/2014/0411/493967.html
http://www.zznews.cn/hyzx/jkxx/5346187258.html
http://www.yltvb.com/xwbk/redianxinwen/5346328135.html
http://www.yltvb.com/xwbk/redianxinwen/5346328135.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/787594.html
http://blog.sina.com.cn/s/blog_ecd6fa280101ihti.html
http://blog.sina.com.cn/s/blog_ecd6fa280101ihtg.html
http://blog.sina.com.cn/s/blog_ecd6fa280101ihtc.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/785817.html
http://www.yltvb.com/xwbk/redianxinwen/5367119014.html
http://www.zznews.cn/hyzx/jkxx/5343714630.html
http://www.fengone.com/bj/jsqy/2014/0411/491840.html
http://www.lhrb.com.cn/qyxw/fhrl/5351567039.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/787013.html
http://www.rznews.cn/yszx/stbk/5346544280.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/787469.html
http://www.yltvb.com/xwbk/redianxinwen/5346150844.html
http://www.zznews.cn/hyzx/jkxx/5346167770.html
http://www.fengone.com/bj/jsqy/2014/0411/493967.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/787511.html
http://www.yltvb.com/xwbk/redianxinwen/5346274547.html
http://www.zznews.cn/hyzx/jkxx/5346174030.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/787514.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/787517.html
http://www.yltvb.com/xwbk/redianxinwen/5346281904.html
http://www.zznews.cn/hyzx/jkxx/5346187258.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/787578.html
http://www.yltvb.com/xwbk/redianxinwen/5346328135.html
http://www.yltvb.com/xwbk/redianxinwen/5346328135.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/787594.html
http://www.yltvb.com/xwbk/redianxinwen/5346910236.html
http://www.zznews.cn/hyzx/jkxx/5346202792.html
http://www.lfxww.com/2014/shichangshangxun/2014/0411/787627.html
http://www.lhrb.com.cn/qyxw/fhrl/5351734683.html
http://blog.sina.com.cn/s/blog_ecd6fa280101ihti.html
http://blog.sina.com.cn/s/blog_ecd6fa280101ihtg.html
http://blog.sina.com.cn/s/blog_ecd6fa280101ihtc.html
.MODEL SMALL .STACK 256 .CODE | ||||
;第一个参数parmcount确定其后面参数parmvalues中所含参数的个数 | ||||
ADDUP | PROC NEAR C, parmcount:WORD, parmvalues:VARARG | |||
XOR | AX, AX | |||
XOR | SI, SI | |||
MOV | CX, parmcount | |||
.REPEAT | ||||
ADD AX, parmvalues[SI] ADD SI, 2 | ||||
.UNTILCXZ | ||||
RET | ||||
ADDUP | ENDP | |||
.STARTUP | ||||
INVOKE | ADDUP, 3, 5, 2, 4 | ;调用子程序ADDUP,计算5+2+4 | ||
INVOKE | ADDUP, 4, 1, 2, 3, 4 | ;调用子程序ADDUP,计算1+2+3+4 | ||
.EXIT 0 | ||||
.END |