Can you see the assembler code that a spin program generates ?
Bean
Posts: 8,129
I was wondering if you can see the assembler code that a spin file generates ?
Like SX/B does.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com
"I reject your reality, and substitute my own." Mythbusters
·
Like SX/B does.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com
"I reject your reality, and substitute my own." Mythbusters
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
I am curious why you say "semi-interpreted" (even in quotes) which would imply some sort of hybrid language? I've not seen any indication from Parallax to describe SPIN as anything but an interpretive language or interpreter per se. Is there something we're not seeing here?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
The Basics of old, on the C64, Sinclair ZX series computers, The BBC and such are all 'purely interpretive' as they work on the source-code. The same can probably be said about PHP, Pyton and Perl, too.
Java, OPL(Psion Organisers, Symbian smartphones), REXX, PBasic and Spin all use some sort of intermediary code, whether it be Bytecode, Q-Code or tokens...
Actually, REXX is both intepretive, and semi-interpretive(On OS/2 at least) as the first time it is run, it uses the original source(.cmd file), but during running it translates it line for line into tokens, and these are stored in the original file's Extended Attributes for faster processing the next time...
Whether my definitions matters, well... that's open for interpretation...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com
"I reject your reality, and substitute my own." Mythbusters
·
As I said, I was just curious to understand your point of view, or to refresh any erroneous information I might have had about SPIN. In the end, the only thing that really differs is how we (you and I) define how an interpreter operates, or perhaps how it is defined.
My own formal computer education pre-dates languages like Rexx, Perl, PHP, Python and other similar languages by quite a few DECADES, so I'm from an era when we were taught the following, or something like it:
An interpreter translates high-level instructions into an intermediate form, which it then executes directly. By comparison, a compiler translates high-level instructions directly or indirectly into machine language. Generally speaking, most interpretive languages are used for fast development, and in the field of education for teaching programming language concepts.
Thanks for the update!
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
After all, the speed difference between a 'pure interpreter' which parses the instructions as it encounters them, and one which parses it first, then 'executes' that intermediate code can be rather large. (Sometimes an order of magnitude or more)
BTW: REXX predates a lot of the members of this site...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
Keep in mind that the Interpreter itself is a pasm program that runs in the 512 words of COG memory. That is quite an accomplishment in efficiency. After you allow for the machinery to read the tokens from the main RAM, the ratio of Spin instructions to available words in the COG is quite low, something like 1:4 or 1:5, so there is not room to implement long routines to implement individual Spin instructions. For example WAITCNT(...) is both a Spn instruction and a pasm instruction. If you create a Spin Pub that contains nothing, you get a memory map that occupies 12 program bytes. If you then add one instruction WAITCNT (2000+cnt), the size of the memory map increases by exactly one long, 4 bytes. And you can pick out the last program bytes "91 39 07 D0 EC 23 32" where "07 D0" is 2000 in hex. Change it to WAITCNT (200000+cnt) and you can pick out "91 3A 03 0D 40 EC 23 32 00 00 00", where "03 0D 40" is 200000 in hex. So Terry, while there is not assembly code to look at, you can have lots of fun dissecting the tokens!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com