%macro dhl 1.nolist db (%1) >> 8 db (%1) & 0xFF %endmacro %macro dhla 1.nolist db ((%1)-_f0) >> 8 db ((%1)-_f0) & 0xFF %endmacro SECTION .data global _f0 _f0: ;; lua: return gsub(strings.Cdefs, "#", "%%") %define H_C0 0x00 %define H_DROPPING 0x01 %define H_LUAC0 0x02 %define H_LUAC1 0x03 %define H_LUAC2 0x04 %define H_LUAC3 0x05 %define H_C1 0x06 %define H_RSR 0x07 %define H_COL 0x08 %define FIP_RETURN 0xFFFF %define FIP_RSREXIT 0xFFFE %define FIP_FIPDROP 0xFFFD %define SF_EXIT 0xFF %define SF_DUP 0xFE %define F_EXIT 0xFDFF %define F_STO 0xFDFE %define F_DUP 0xFDFD %define F_PLUS 0xFDFC %define F_1 0xFDFB %define F_TOS 0xFDFA %define F_lua_statex21 0xFDF9 %define F_0 0xFDF8 ;; lua: return strings.nasmbytecode ADR_lua_open: db H_C0 extern lua_open dd lua_open ADR_lua_close: db H_DROPPING db H_LUAC0 extern lua_close dd lua_close ADR_lua_stdlibsopen: db H_DROPPING db H_LUAC0 extern lua_stdlibsopen dd lua_stdlibsopen ADR_lua_gettop: db H_LUAC0 extern lua_gettop dd lua_gettop ADR_lua_stackspace: db H_LUAC0 extern lua_stackspace dd lua_stackspace ADR_lua_settop: db H_DROPPING db H_LUAC1 extern lua_settop dd lua_settop ADR_lua_pushvalue: db H_DROPPING db H_LUAC1 extern lua_pushvalue dd lua_pushvalue ADR_lua_remove: db H_DROPPING db H_LUAC1 extern lua_remove dd lua_remove ADR_lua_insert: db H_DROPPING db H_LUAC1 extern lua_insert dd lua_insert ADR_lua_pushlstring: db H_DROPPING db H_LUAC2 extern lua_pushlstring dd lua_pushlstring ADR_lua_pushstring: db H_DROPPING db H_LUAC1 extern lua_pushstring dd lua_pushstring ADR_lua_pushusertag: db H_DROPPING db H_LUAC2 extern lua_pushusertag dd lua_pushusertag ADR_lua_pushnil: db H_DROPPING db H_LUAC0 extern lua_pushnil dd lua_pushnil ADR_lua_dofile: db H_LUAC1 extern lua_dofile dd lua_dofile ADR_lua_dostring: db H_LUAC1 extern lua_dostring dd lua_dostring ADR_lua_dobuffer: db H_LUAC3 extern lua_dobuffer dd lua_dobuffer ADR_lua_getglobal: db H_DROPPING db H_LUAC1 extern lua_getglobal dd lua_getglobal ADR_lua_setglobal: db H_DROPPING db H_LUAC1 extern lua_setglobal dd lua_setglobal ADR_lua_getglobals: db H_DROPPING db H_LUAC0 extern lua_getglobals dd lua_getglobals ADR_lua_setglobals: db H_DROPPING db H_LUAC0 extern lua_setglobals dd lua_setglobals ADR_lua_gettable: db H_DROPPING db H_LUAC1 extern lua_gettable dd lua_gettable ADR_lua_rawget: db H_DROPPING db H_LUAC1 extern lua_rawget dd lua_rawget ADR_lua_settable: db H_DROPPING db H_LUAC1 extern lua_settable dd lua_settable ADR_lua_rawset: db H_DROPPING db H_LUAC1 extern lua_rawset dd lua_rawset ADR_lua_newtable: db H_DROPPING db H_LUAC0 extern lua_newtable dd lua_newtable ADR_lua_rawgeti: db H_DROPPING db H_LUAC2 extern lua_rawgeti dd lua_rawgeti ADR_lua_rawseti: db H_DROPPING db H_LUAC2 extern lua_rawseti dd lua_rawseti ADR_lua_getn: db H_LUAC1 extern lua_getn dd lua_getn ADR_lua_call: db H_LUAC2 extern lua_call dd lua_call ADR_lua_rawcall: db H_DROPPING db H_LUAC2 extern lua_rawcall dd lua_rawcall ADR_lua_error: db H_DROPPING db H_LUAC1 extern lua_error dd lua_error ADR_lua_settagmethod: db H_DROPPING db H_LUAC2 extern lua_settagmethod dd lua_settagmethod ADR_lua_gettagmethod: db H_DROPPING db H_LUAC2 extern lua_gettagmethod dd lua_gettagmethod ADR_lua_copytagmethods: db H_LUAC2 extern lua_copytagmethods dd lua_copytagmethods ADR_lua_next: db H_LUAC1 extern lua_next dd lua_next ADR_lua_concat: db H_DROPPING db H_LUAC1 extern lua_concat dd lua_concat ADR_strlen: db H_C1 extern strlen dd strlen ADR_0x24: db H_RSR ADR_S0x24: db H_COL dhl F_STO db SF_DUP db SF_DUP dhl ADR_strlen -_f0 dhl F_PLUS dhl F_1 dhl F_PLUS dhl F_TOS db SF_EXIT global ADR_DEMO ADR_DEMO: db H_COL dhl ADR_lua_open -_f0 dhl F_lua_statex21 dhl ADR_lua_stdlibsopen -_f0 dhl ADR_0x24 -_f0 db 'print',0 dhl ADR_lua_getglobal -_f0 dhl ADR_0x24 -_f0 db 'Hello',0 dhl ADR_lua_pushstring -_f0 dhl F_1 dhl F_0 dhl ADR_lua_call -_f0 db SF_EXIT