Hi.

When I started programming in Turbo C 2.0 on my
Commodore PC 5 (IBM PC XT compatible) with
20 MB hard disk and monochrome text monitor
circa 1987, I didn't write any MSDOS or 8086-specific
code at all. Everything I did was C90.

My code worked on the mainframe (MVS) too.

I resisted making platform-specific code.

There were some exceptions, but I don't think I ever made
an MSDOS call, or ever included the non-C90 libraries like
dos.h. Nor the Unix stuff like sys/types.h even when I was
working on Unix systems. It was C90 all the way.

This served me well, and the only fullscreen application I
ever used (sort of) was microemacs. The only important
thing I ever did was programming anyway (sort of).

But there was always going to be a time where I had to
get a fullscreen editor working portably, and I didn't think
that was possible. I knew ANSI X3.64 existed, and I
could activate it by putting ANSI.SYS in my config.sys,
but that seemed to disappear in Windows, and I was
always very confused, and on IBM mainframes it didn't
remotely exist, and I was wondering why they didn't have
a standard for keyboards either.

Eventually the internet thing happened and eventually I
ended up reading the wikipedia on ANSI X3.64 and I was
surprised to find out that keyboards were in fact covered.

I never knew why DOS only had ANSI for output, not input.

I was also surprised to find the ANSI even allowed two escapes
to be generated when you press ESC, so that you didn't need
timing-sensitive code (which doesn't exist in C90).

I was also surprised to find (just in the last month or something),
that an older version of microemacs was public domain.

Anyway, long story short - I have banged microemacs 3.6 into
shape so that it is C90 compliant with the addition of ANSI
escapes for both keyboard and screen, allowing it to run on
both PDOS/386 and z/PDOS (mainframes) with the only
difference being in handling EBCDIC vs ASCII. ie other than
that, all the C source code (when doing the ANSI + C90
target) is completely identical. PDOS/86 was added with
the simple addition of a makefile.

And thanks to assistance already received here, I got the
exact same DOS executable to run under Freedos.

It does require this to be installed:

http://www.sweger.com/ansiplus/AnsiPlus.html

E:\>grep -i ansi config.sys
config.sys: device=C:\ANSIPLUS\ANSIPLUS.exe

E:\>grep -i ansi autoexec.bat
autoexec.bat: path
c:\freedos\bin;c:\hx\bin;c:\winpath;d:\dos;d:\;c:\dospath;c:\watcom\binnt;c:\watcom\binw;c:\ansiplus

E:\>grep -i setaplus autoexec.bat
autoexec.bat: setaplus loadkeys pdoskeys.cfg

E:\>type pdoskeys.cfg
27,27,27
0,72,27,"[A"
0,80,27,"[B"
0,77,27,"[C"
0,75,27,"[D"

E:\>

Since I only run the one fullscreen app, I thought I wouldn't
be affected by reassigning the cursor keys.

However, it turns out that there was something I was using -
freecom! So now I can't do command recall.

If you would like to get hold of this, I have uploaded a new
UC8086 to http://pdos.org

There is an me.exe and c:\devel\memacs

I was thinking that maybe the freecom folk would like to add
ANSI escapes as an option. How else can you handle when
the ctty or whatever the DOS command is to redirect input
to a com port? If you attach a VT100, you will need to handle
the ANSI escapes.

HX apparently does direct hardware manipulation to get to the
keyboard, so that would need to be independently enhanced
to allow ANSI escapes (and note that there is a specific
Windows call, introduced in Win 10, to activate ANSI).

Note that I have a different goal to most people. Most people
want to run DOS-era software. I want to redefine the DOS era
now that the "rush to market" is long over.

Any thoughts?

Thanks. Paul.
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to