lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Nick,

Thanks a whole bunch. That's super cool stuff. It should make things easier.

Zed


On Friday, May 2, 2003, at 01:09 PM, Nick Trout wrote:



ZS> Alright, I'll read through that.  I guess I should probably
start with
writing a disassembler then.

For Lua? There is one already. Read the docs for luac.

You can experiment with WebLua:
http://doris.sourceforge.net/lua/weblua.php

E.g.,

 Lua script:

for i=1,10 do print(i) end

luac generates the follow output:

main <0:@/tmp/wlTCSViV> (9 instructions/36 bytes at 0x8052af0)
0 params, 5 stacks, 3 locals, 1 string, 0 numbers, 0 functions, 3 lines
     1	[2]	PUSHINT    	1
     2	[2]	PUSHINT    	10
     3	[2]	PUSHINT    	1
     4	[2]	FORPREP    	4	; to 9
     5	[2]	GETGLOBAL  	0	; print
     6	[2]	GETLOCAL   	0	; i
     7	[2]	CALL       	3 0
     8	[2]	FORLOOP    	-4	; to 5
     9	[2]	END


-----
Zed A. Shaw
http://www.zedshaw.com/