The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: 0x401000 on January 15, 2010, 02:09:36 PM

Title: four stack interpretation
Post by: 0x401000 on January 15, 2010, 02:09:36 PM
How can I translate this code http://www.jwdt.com/~paysan/4stack.html to assembler? Someone studying similar realization? I would like to make a full emulator of this processor in assembly language. But I do not know where to start.
Title: Re: four stack interpretation
Post by: hutch-- on January 17, 2010, 12:23:01 AM
Try writing a single stack first, allocate a block of memory, allocate a pointer to locate it then simulate what a PUSH and POP instruction do, a PUSH writes the data to memory and changes the pointer to point to it, a POP does it in reverse.
Title: Re: four stack interpretation
Post by: 0x401000 on January 17, 2010, 10:17:29 AM
Hi! Thank you, from that already started, I'll write here later  :dance:
Title: Re: four stack interpretation
Post by: 0x401000 on January 23, 2010, 11:02:19 AM
The scheme was not complicated. But questions in the course of programming. How do I connect x86 model and model type VLIW together? This course is already in a certain processor, in which processor core with 4 stack, and the shell of ordinary processors. Thus there is a bridge, which can run as a command processor VLIW, also with the CISC and RISC commands?

Another question, how then can we realize the parallel execution of code, without using the API WIN Threads? How can I choose whether to do a forward one that should be fulfilled now. Thank you!
Title: Re: four stack interpretation
Post by: hutch-- on January 25, 2010, 11:05:12 AM
Short of writing uyour own operating system you can't run threads without the Windows API functions to do this.
Title: Re: four stack interpretation
Post by: Slugsnack on January 25, 2010, 12:16:07 PM
How about _beginthread/_beginthreadex :
http://msdn.microsoft.com/en-us/library/kdzttdcb(VS.80).aspx
Title: Re: four stack interpretation
Post by: dedndave on January 25, 2010, 01:44:19 PM
it would seem that those functions eventually use API calls, no ?
Title: Re: four stack interpretation
Post by: donkey on January 25, 2010, 03:17:13 PM
I read a bit of the 4 stack model papers (though not much as I find it only moderately interesting) and from what I saw you will probably need to implement it in some flavor of VHDL, not an easy or inexpensive task. You can start looking for a Windows based VHDL compiler at model.com, it may be able to use the Verilog implementation on the site.

http://model.com/

Edgar
Title: Re: four stack interpretation
Post by: Slugsnack on January 25, 2010, 06:46:30 PM
Quote from: dedndave on January 25, 2010, 01:44:19 PM
it would seem that those functions eventually use API calls, no ?
Haha.. so it does..
Title: Re: four stack interpretation
Post by: dedndave on January 25, 2010, 06:57:07 PM
it could be written with masm - although - no way to parallel process without using threads
i don't really think that has to be a requirement
it is an emulator, so it is not like you expect it to be fast - lol
i would think it would be very similar to an interpreter
if i had to do it, i think i would get the basics set up with a few instructions (push, pop, add, sub, call/ret, jmp)
once you have that up and running, it is a matter of adding instructions to the list
depending on how large the instruction sets are, it could be quite a task   :bg
Title: Re: four stack interpretation
Post by: FORTRANS on January 25, 2010, 10:55:03 PM
Hi,

   As it is an emulator, you could process things that are
intended to be in parallel processors in a strict round-
robin fashion.  Or you could process multiple results as
a very long array of boolean valuse.  That could simulate
multiple processes in parallel.

Regards,

Steve N.