flat assembler
Message board for the users of flat assembler.

Index > Main > Admin, can you make FASM interpreter?

Author
Thread Post new topic Reply to topic
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9
Just curious, i am dying to know. ;)

--
Post 31 Jul 2004, 11:15
View user's profile Send private message Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc
That would basically be x86 emulation, not an easy thing to achieve. Why would you want an interpreter anyway? It wouldn't make testing any easier than just using a debugger to step through the code.
Post 31 Jul 2004, 12:05
View user's profile Send private message Visit poster's website Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9
Thank you ask for it,
it's because of IDE, have to compile asm, always go out of editor, and type something it on shell.

So maybe interpreter is not my goal.
anyway, happy to said 'Just curious'.
Post 31 Jul 2004, 12:25
View user's profile Send private message Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
fasm9 see my reply to the emacs post Smile now you can run the compile from emacs and see the output directly Smile
Post 31 Jul 2004, 13:56
View user's profile Send private message Visit poster's website Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9
Thanks again!

Googling didn't much help me out. ;)

--
regards
Post 31 Jul 2004, 14:06
View user's profile Send private message Reply with quote
Ralph



Joined: 04 Oct 2003
Posts: 86
Ralph
Why would you have to write an emulator? The following seems like a fairly straight forward way to me:
1. Enter a line of assembly
2. Assemble
3. Save interpreter context, load application context
4. Execute one instruction, return to interpreter
Then you could also display register status, memory, etc and update it after every instruction. You could come up with some creative way to handle labels too like maybe initially only use @@ and change its behaviour a little to allow for forward referencing (eg jmp @f would compile a long jump and @@ would patch it up when reached).
You could even save multiple contexts so you can backstrace and correct problems or just rerun up to a certain point.

A tool like this might make it easier to learn assembly because you could immediately see what certain instructions do especially on intel where many instructions have implied affects (eg rep lods modifies 3 registers based on direction flag). It could make it easier/faster to write certain routines because you don't have to assemble, verify, go back and fix bugs, repeat.

Just some thoughts..
Post 31 Jul 2004, 23:05
View user's profile Send private message Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc
Emulation would be needed when you're under Linux or Windows and the code involves port I/O, or "priviliged" instructions. Most of the code could be handled the way you suggest, but not all of it. I must admit though, I loved the old DEBUG tool, which could be used a lot like your example, though it was only for 16- bit 808x, not the 32-bit instructions.
Post 01 Aug 2004, 06:45
View user's profile Send private message Visit poster's website Reply with quote
evil__donkey



Joined: 07 Dec 2003
Posts: 26
evil__donkey
An emulator could be used as an aid to tutor assembly language.
Post 01 Aug 2004, 06:58
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote
lilainst



Joined: 29 Jul 2004
Posts: 11
lilainst
crc wrote:
Emulation would be needed when you're under Linux or Windows and the code involves port I/O, or "priviliged" instructions. Most of the code could be handled the way you suggest, but not all of it. I must admit though, I loved the old DEBUG tool, which could be used a lot like your example, though it was only for 16- bit 808x, not the 32-bit instructions.


Then what about writing a 32-bit DEBUG, as an assistent of fasm on both Linux and Win32 platform. Actually, there isn't an good assembler-level Debuger can both run under Linux and Windows


Last edited by lilainst on 24 Aug 2004, 07:24; edited 1 time in total
Post 08 Aug 2004, 15:57
View user's profile Send private message Reply with quote
halyavin



Joined: 21 Aug 2004
Posts: 42
halyavin
I have unit in delphi which emulate almost all commands. And this module can be usily converted to .dll library. All you need - load segments of code. (It can debug program also) Do you need it?
Post 23 Aug 2004, 17:13
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.