× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



let me answer a "how do you emulate MI in C and Windows" question ...

other than some major, show stopping difficulties, it is possible.

The primitive MI opcodes like CPYBLA, CPYNV, ADDN and ADDSPP can be mimic'd
as C functions.

Spaces can be mimiced on an OS like windows by memory mapping stream files.

All the independent index instructions are doable as i/o to an indexed file.
The free FOXPRO database runtime that microsoft provides would do.

CALLX can be accomplished as calls into a DLL using the LoadLibrary and
GetProcAddress in WIN32.

RSLVSP could be implemented by first opening a small stream file that is the
equivalent of the object header.  If resolving to a space object, the header
would just contain the name of another disk stream file. A program would
contain the name of the DLL and procedure name that represents the program.
If an independent index, the object header contains the name of database
file.

SETSPPFP, in the case of a space, would memory map the disk file that
represents the space object.

The PCO of the job ( process in windows ), being a space, would be
implemented by creating and memory mapping the PCO space at process start.

CALLI I think could be done as a function call in C.  But you have to adjust
for the fact that CALLI is just a jump that also sets an instruction pointer
to a return, jump back to when done, address.

SETIP and B, I am not sure specifically how that would be done. In C you can
set a function pointer, and in Windows you can use ::GetThreadContext( ) and
SetThreadContext( ) to get and set registers of the CPU.  So there must be a
way.

So I think you can take a user written MI program, materialize the MI code
( MATPG ) and then translate each instruction, one at a time, to C function
calls.

The problem is all the external calls ( CALLX ) to OS400 that any program
running on the as400 will execute.  The MI emulator on a PC would have to be
able to materialize the MI code of the system programs.

And of course there is the half completed, now forgotten by IBM mgmt, ILE
beast. Even after all these years, it is still considered top secret by IBM,
so who knows what would be needed to emulate it.

Hope this helps.

-Steve


-----Original Message-----
From: mi400-bounces+srichter=autocoder.com@xxxxxxxxxxxx
[mailto:mi400-bounces+srichter=autocoder.com@xxxxxxxxxxxx]On Behalf Of
Olivier THEBAULT
Sent: Wednesday, October 08, 2003 5:22 PM
To: MI Programming on the AS400 / iSeries
Subject: [MI400] Re: MI emulator



OS/400 doesn't run on MI ?

----- Original Message -----
From: "Leif Svalgaard" <leif=vPETv0UHqg8@xxxxxxxxxxxxxxxx>
Newsgroups: gmane.comp.lang.as400.mi
Sent: Tuesday, October 07, 2003 11:10 PM
Subject: Re: MI emulator


> Olivier THEBAULT <othebault=39ZsbGIQGT5GWvitb5QawA@xxxxxxxxxxxxxxxx> wrote
in message
> news:blv049$7ln$1=WnDAp88bSu0nT+UIioQ8UA@xxxxxxxxxxxxxxxx
> > Is it possible to create a MI emulator on Intel processor ?
> >
>
> yes, and not all that difficult. I guess that your real question is
> if by having an MI-emulator one could run "normal" AS/400
> programs on Intel. The answer to that is "no", because OS/400
> is not written in MI and would have to be written for the Intel
> processor. This is not easy because so much of OS/400 is
> undocumented and also because OS/400 is so HUGE.
>
>
> _______________________________________________
> This is the MI Programming on the AS400 / iSeries (MI400) mailing list
> To post a message email: MI400=Zwy7GipZuJhWk0Htik3J/w@xxxxxxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/mi400
> or email: MI400-request=Zwy7GipZuJhWk0Htik3J/w@xxxxxxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/mi400.
>
>


_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.