1 %macro dhl 1.nolist 2 db (%1) >> 8 3 db (%1) & 0xFF 4 %endmacro 5 %macro dhla 1.nolist 6 db ((%1)-_f0) >> 8 7 db ((%1)-_f0) & 0xFF 8 %endmacro 9 SECTION .data 10 global _f0 11 _f0: 12 13 ;; lua: return gsub(strings.Cdefs, "#", "%%") 14 %define H_C0 0x00 15 %define H_DROPPING 0x01 16 %define H_LUAC0 0x02 17 %define H_LUAC1 0x03 18 %define H_LUAC2 0x04 19 %define H_LUAC3 0x05 20 %define H_C1 0x06 21 %define H_RSR 0x07 22 %define H_COL 0x08 23 %define FIP_RETURN 0xFFFF 24 %define FIP_RSREXIT 0xFFFE 25 %define FIP_FIPDROP 0xFFFD 26 %define SF_EXIT 0xFF 27 %define SF_DUP 0xFE 28 %define F_EXIT 0xFDFF 29 %define F_STO 0xFDFE 30 %define F_DUP 0xFDFD 31 %define F_PLUS 0xFDFC 32 %define F_1 0xFDFB 33 %define F_TOS 0xFDFA 34 %define F_lua_statex21 0xFDF9 35 %define F_0 0xFDF8 36 37 ;; lua: return strings.nasmbytecode 38 ADR_lua_open: 39 00000000 00 db H_C0 40 extern lua_open 41 00000001 [00000000] dd lua_open 42 ADR_lua_close: 43 00000005 01 db H_DROPPING 44 00000006 02 db H_LUAC0 45 extern lua_close 46 00000007 [00000000] dd lua_close 47 ADR_lua_stdlibsopen: 48 0000000B 01 db H_DROPPING 49 0000000C 02 db H_LUAC0 50 extern lua_stdlibsopen 51 0000000D [00000000] dd lua_stdlibsopen 52 ADR_lua_gettop: 53 00000011 02 db H_LUAC0 54 extern lua_gettop 55 00000012 [00000000] dd lua_gettop 56 ADR_lua_stackspace: 57 00000016 02 db H_LUAC0 58 extern lua_stackspace 59 00000017 [00000000] dd lua_stackspace 60 ADR_lua_settop: 61 0000001B 01 db H_DROPPING 62 0000001C 03 db H_LUAC1 63 extern lua_settop 64 0000001D [00000000] dd lua_settop 65 ADR_lua_pushvalue: 66 00000021 01 db H_DROPPING 67 00000022 03 db H_LUAC1 68 extern lua_pushvalue 69 00000023 [00000000] dd lua_pushvalue 70 ADR_lua_remove: 71 00000027 01 db H_DROPPING 72 00000028 03 db H_LUAC1 73 extern lua_remove 74 00000029 [00000000] dd lua_remove 75 ADR_lua_insert: 76 0000002D 01 db H_DROPPING 77 0000002E 03 db H_LUAC1 78 extern lua_insert 79 0000002F [00000000] dd lua_insert 80 ADR_lua_pushlstring: 81 00000033 01 db H_DROPPING 82 00000034 04 db H_LUAC2 83 extern lua_pushlstring 84 00000035 [00000000] dd lua_pushlstring 85 ADR_lua_pushstring: 86 00000039 01 db H_DROPPING 87 0000003A 03 db H_LUAC1 88 extern lua_pushstring 89 0000003B [00000000] dd lua_pushstring 90 ADR_lua_pushusertag: 91 0000003F 01 db H_DROPPING 92 00000040 04 db H_LUAC2 93 extern lua_pushusertag 94 00000041 [00000000] dd lua_pushusertag 95 ADR_lua_pushnil: 96 00000045 01 db H_DROPPING 97 00000046 02 db H_LUAC0 98 extern lua_pushnil 99 00000047 [00000000] dd lua_pushnil 100 ADR_lua_dofile: 101 0000004B 03 db H_LUAC1 102 extern lua_dofile 103 0000004C [00000000] dd lua_dofile 104 ADR_lua_dostring: 105 00000050 03 db H_LUAC1 106 extern lua_dostring 107 00000051 [00000000] dd lua_dostring 108 ADR_lua_dobuffer: 109 00000055 05 db H_LUAC3 110 extern lua_dobuffer 111 00000056 [00000000] dd lua_dobuffer 112 ADR_lua_getglobal: 113 0000005A 01 db H_DROPPING 114 0000005B 03 db H_LUAC1 115 extern lua_getglobal 116 0000005C [00000000] dd lua_getglobal 117 ADR_lua_setglobal: 118 00000060 01 db H_DROPPING 119 00000061 03 db H_LUAC1 120 extern lua_setglobal 121 00000062 [00000000] dd lua_setglobal 122 ADR_lua_getglobals: 123 00000066 01 db H_DROPPING 124 00000067 02 db H_LUAC0 125 extern lua_getglobals 126 00000068 [00000000] dd lua_getglobals 127 ADR_lua_setglobals: 128 0000006C 01 db H_DROPPING 129 0000006D 02 db H_LUAC0 130 extern lua_setglobals 131 0000006E [00000000] dd lua_setglobals 132 ADR_lua_gettable: 133 00000072 01 db H_DROPPING 134 00000073 03 db H_LUAC1 135 extern lua_gettable 136 00000074 [00000000] dd lua_gettable 137 ADR_lua_rawget: 138 00000078 01 db H_DROPPING 139 00000079 03 db H_LUAC1 140 extern lua_rawget 141 0000007A [00000000] dd lua_rawget 142 ADR_lua_settable: 143 0000007E 01 db H_DROPPING 144 0000007F 03 db H_LUAC1 145 extern lua_settable 146 00000080 [00000000] dd lua_settable 147 ADR_lua_rawset: 148 00000084 01 db H_DROPPING 149 00000085 03 db H_LUAC1 150 extern lua_rawset 151 00000086 [00000000] dd lua_rawset 152 ADR_lua_newtable: 153 0000008A 01 db H_DROPPING 154 0000008B 02 db H_LUAC0 155 extern lua_newtable 156 0000008C [00000000] dd lua_newtable 157 ADR_lua_rawgeti: 158 00000090 01 db H_DROPPING 159 00000091 04 db H_LUAC2 160 extern lua_rawgeti 161 00000092 [00000000] dd lua_rawgeti 162 ADR_lua_rawseti: 163 00000096 01 db H_DROPPING 164 00000097 04 db H_LUAC2 165 extern lua_rawseti 166 00000098 [00000000] dd lua_rawseti 167 ADR_lua_getn: 168 0000009C 03 db H_LUAC1 169 extern lua_getn 170 0000009D [00000000] dd lua_getn 171 ADR_lua_call: 172 000000A1 04 db H_LUAC2 173 extern lua_call 174 000000A2 [00000000] dd lua_call 175 ADR_lua_rawcall: 176 000000A6 01 db H_DROPPING 177 000000A7 04 db H_LUAC2 178 extern lua_rawcall 179 000000A8 [00000000] dd lua_rawcall 180 ADR_lua_error: 181 000000AC 01 db H_DROPPING 182 000000AD 03 db H_LUAC1 183 extern lua_error 184 000000AE [00000000] dd lua_error 185 ADR_lua_settagmethod: 186 000000B2 01 db H_DROPPING 187 000000B3 04 db H_LUAC2 188 extern lua_settagmethod 189 000000B4 [00000000] dd lua_settagmethod 190 ADR_lua_gettagmethod: 191 000000B8 01 db H_DROPPING 192 000000B9 04 db H_LUAC2 193 extern lua_gettagmethod 194 000000BA [00000000] dd lua_gettagmethod 195 ADR_lua_copytagmethods: 196 000000BE 04 db H_LUAC2 197 extern lua_copytagmethods 198 000000BF [00000000] dd lua_copytagmethods 199 ADR_lua_next: 200 000000C3 03 db H_LUAC1 201 extern lua_next 202 000000C4 [00000000] dd lua_next 203 ADR_lua_concat: 204 000000C8 01 db H_DROPPING 205 000000C9 03 db H_LUAC1 206 extern lua_concat 207 000000CA [00000000] dd lua_concat 208 ADR_strlen: 209 000000CE 06 db H_C1 210 extern strlen 211 000000CF [00000000] dd strlen 212 ADR_0x24: 213 000000D3 07 db H_RSR 214 ADR_S0x24: 215 000000D4 08 db H_COL 216 000000D5 FDFE dhl F_STO 217 000000D7 FE db SF_DUP 218 000000D8 FE db SF_DUP 219 000000D9 00CE dhl ADR_strlen -_f0 220 000000DB FDFC dhl F_PLUS 221 000000DD FDFB dhl F_1 222 000000DF FDFC dhl F_PLUS 223 000000E1 FDFA dhl F_TOS 224 000000E3 FF db SF_EXIT 225 global ADR_DEMO 226 ADR_DEMO: 227 000000E4 08 db H_COL 228 000000E5 0000 dhl ADR_lua_open -_f0 229 000000E7 FDF9 dhl F_lua_statex21 230 000000E9 000B dhl ADR_lua_stdlibsopen -_f0 231 000000EB 00D3 dhl ADR_0x24 -_f0 232 000000ED 7072696E7400 db 'print',0 233 000000F3 005A dhl ADR_lua_getglobal -_f0 234 000000F5 00D3 dhl ADR_0x24 -_f0 235 000000F7 48656C6C6F00 db 'Hello',0 236 000000FD 0039 dhl ADR_lua_pushstring -_f0 237 000000FF FDFB dhl F_1 238 00000101 FDF8 dhl F_0 239 00000103 00A1 dhl ADR_lua_call -_f0 240 00000105 FF db SF_EXIT