From 35ce7d55f908deac35e045007de5c4acbb63cd48 Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Thu, 10 Nov 2016 19:27:40 +0000 Subject: [PATCH] add forgotten file git-svn-id: svn://kolibrios.org@6700 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/import.inc | 68 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 programs/import.inc diff --git a/programs/import.inc b/programs/import.inc new file mode 100644 index 0000000000..e6369a46ff --- /dev/null +++ b/programs/import.inc @@ -0,0 +1,68 @@ + +; Macroinstructions for making import section + +macro library [name,string] + { common + import.data: + forward + local _label + if defined name#.redundant + if ~ name#.redundant + dd RVA name#.lookup,0,0,RVA _label,RVA name#.address + end if + end if + name#.referred = 1 + common + dd 0,0,0,0,0 + forward + if defined name#.redundant + if ~ name#.redundant + _label db string,0 + rb RVA $ and 1 + end if + end if } + +macro import name,[label,string] + { common + rb (- rva $) and 3 + if defined name#.referred + name#.lookup: + forward + if used label + if string eqtype '' + local _label + dd RVA _label + else + dd 80000000h + string + end if + end if + common + if $ > name#.lookup + name#.redundant = 0 + dd 0 + else + name#.redundant = 1 + end if + name#.address: + forward + if used label + if string eqtype '' + label dd RVA _label + else + label dd 80000000h + string + end if + end if + common + if ~ name#.redundant + dd 0 + end if + forward + if used label & string eqtype '' + _label dw 0 + db string,0 + rb RVA $ and 1 + end if + common + end if } + +macro api [name] {}