•
Example 1:
void maxmin (long val)
_maxmin
←
the function name
maxmin0
←
the name of val argment
Assume we want to call maxmin (10)
...
extern _maxmin: near
extern maxmin0: byte
; it is ok to declare “byte” although
;
val
is
“long”
it’s
two
bytes.
...
mov
a,10
mov maxmin0,a
;
store
low
byte
mov
a, 0
mov
maxmin0[1],a
;store high byte
call _maxmin
...
•
Example 2:
long foo(int a, int b, int c)
_foo
←
the function name
foo0
←
the name of a argument
foo1
←
the name of b argument
foo2
←
the name of c argument
Assume we want to call foo(1,2,3) in the assembly file and put
the return value in retval variable.
...
dw retval
...
extern _foo: near
extern foo0: byte
extern foo1: byte
extern foo2: byte
extern LH: byte
...
mov
a,1
mov
foo0,a
mov
a,2
mov
foo1,a
mov
a,3
mov
foo2,a
call _foo
mov
retval,a
;store low byte
mov
a,LH
mov
retval[1],a
;store high byte
HT-IDE User’s Guide
114
Summary of Contents for HT-IDE
Page 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Page 12: ...HT IDE User s Guide 2 ...
Page 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Page 24: ...HT IDE User s Guide 14 ...
Page 70: ...HT IDE User s Guide 60 ...
Page 76: ...HT IDE User s Guide 66 ...
Page 92: ...HT IDE User s Guide 82 ...
Page 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Page 94: ...HT IDE User s Guide 84 ...
Page 148: ...HT IDE User s Guide 138 ...
Page 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Page 154: ...HT IDE User s Guide 144 ...
Page 192: ...HT IDE User s Guide 182 ...
Page 194: ...HT IDE User s Guide 184 ...
Page 218: ...HT IDE User s Guide 208 ...
Page 235: ...P a r t V Appendix Part V Appendix 225 ...
Page 236: ...HT IDE User s Guide 226 ...
Page 250: ...HT IDE User s Guide 240 ...