Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to clear screen in Gforth Dos

171 views
Skip to first unread message

Leland Williams

unread,
Feb 19, 2002, 12:24:39 AM2/19/02
to
I am using the dos executable of Gforth-0.4.0 in a Ms-DOS window in
windows 95, but the supplied word for 'page' which is supposed to
clear the screen only mangaes to put garbage on the screen. I think it
an other screen commands use the 'ESC[' word which emits a esc
sequence, but it only puts garbatge on the screen.

Can anyone suggest an alternate definition for page and at-xy ?

Anton Ertl

unread,
Feb 19, 2002, 3:30:28 AM2/19/02
to
In article <588e78af.02021...@posting.google.com>,

lwil...@jpusa.org (Leland Williams) writes:
>I am using the dos executable of Gforth-0.4.0 in a Ms-DOS window in
>windows 95, but the supplied word for 'page' which is supposed to
>clear the screen only mangaes to put garbage on the screen. I think it
>an other screen commands use the 'ESC[' word which emits a esc
>sequence, but it only puts garbatge on the screen.

AFAIK you need to put ANSI.SYS in your CONFIG.SYS for the escape
sequences to work.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html

Joel Rubin

unread,
Feb 19, 2002, 2:13:40 PM2/19/02
to
On 19 Feb 2002 08:30:28 GMT, an...@mips.complang.tuwien.ac.at (Anton
Ertl) wrote:

>In article <588e78af.02021...@posting.google.com>,
> lwil...@jpusa.org (Leland Williams) writes:
>>I am using the dos executable of Gforth-0.4.0 in a Ms-DOS window in
>>windows 95, but the supplied word for 'page' which is supposed to
>>clear the screen only mangaes to put garbage on the screen. I think it
>>an other screen commands use the 'ESC[' word which emits a esc
>>sequence, but it only puts garbatge on the screen.
>
>AFAIK you need to put ANSI.SYS in your CONFIG.SYS for the escape
>sequences to work.
>

Of course, the trouble is that few people in 2002 have ANSI.SYS
installed.

Try

MOV AH,0FH
INT 10h
XOR AH,AH
INT 10h

The first int 10h gets the current video mode in AL; the second one
sets the current video mode to the one in AL.

If you know in advance that the video mode is 3 (80x25 color), you can
just:

mov ax,3
int 10h


Marcel Hendrix

unread,
Feb 19, 2002, 4:33:01 PM2/19/02
to

Joel Rubin wrote:

[ clear screen without using ANSI.SYS ]

> MOV AH,0FH
> INT 10h

Learning something new everyday. You mean, Gforth 0.5.0 runs in 16-bit mode
on DOS? Even if it comes with a DOS extender (GO32?) I'd have expected this
to cause trouble.

-marcel

Leland Williams

unread,
Feb 19, 2002, 5:58:27 PM2/19/02
to
Thank you very much. I'll try it tomorrow.

Leland

Leland Williams

unread,
Feb 20, 2002, 12:23:33 AM2/20/02
to
To tell the truth, I haven't tried using it on my Dos Box. I
downloaded the 0.4.0 dos executable-only package, since it fit on a
floppy, and have been using it in a MS-Dos window in Windoze. It does
have a 32-bit cell size, but I don't know if it is running in 16-bit
mode or not since, again, I haven't tried it in pure DOS.


m...@iaehv.iae.nl (Marcel Hendrix) wrote in message news:<hwzc8.2457$Yf1....@typhoon.bart.nl>...

Leland Williams

unread,
Feb 20, 2002, 12:30:47 AM2/20/02
to
In case I'm feeling lazy or rushed, how can I incorporate that into a
colon definition? I have never gotten around to using CODE yet and am
not sure if I am supposed to enter mnemonics or Hex Codes.

Thanks again for your attention.

Leland Williams

Joel Rubin <jmr...@ix.netcom.com> wrote in message news:<v4857ussrv7op545u...@4ax.com>...

Gary Chanson

unread,
Feb 20, 2002, 1:52:45 AM2/20/02
to

"Leland Williams" <lwil...@jpusa.org> wrote in message
news:588e78af.02021...@posting.google.com...

Assuming that GForth is a simple Win32 console program, all you need to
do is load an ANSI console drive (either in the DOS box before launching
GForth or in AUTOEXEC.BAT or CONFIG.SYS).

--

-GJC
-gch...@TheWorld.com

-War is the last resort of the incompetent.


Gary Chanson

unread,
Feb 20, 2002, 2:09:15 AM2/20/02
to

"Marcel Hendrix" <m...@iaehv.iae.nl> wrote in message
news:hwzc8.2457$Yf1....@typhoon.bart.nl...

This code is the same in either 16 bit or 32 bit segments. If it is in
a 32 bit segment, the assembler has to add override opcodes to force 16 bit
processing. Regardless, the DOS function still takes the same parameters
and the source code looks the same.

Marcel Hendrix

unread,
Feb 20, 2002, 3:16:16 AM2/20/02
to
"Gary Chanson" <gcha...@no.spam.TheWorld.com> wrote in message news:a4vh83$8e7$1...@pcls4.std.com...

>
> "Leland Williams" <lwil...@jpusa.org> wrote in message
> news:588e78af.02021...@posting.google.com...
[..]

> > Can anyone suggest an alternate definition for page and at-xy ?
>
> Assuming that GForth is a simple Win32 console program, all you need to
> do is load an ANSI console drive (either in the DOS box before launching
> GForth or in AUTOEXEC.BAT or CONFIG.SYS).

Won't work on NT4 or W2K, unless 'an ANSI console driver' is a recent
development, specifically for these OS's.

-marcel


Leland Williams

unread,
Mar 1, 2002, 1:13:35 AM3/1/02
to
I'm sorry, but I can't figure out what AFAIK stands for.


an...@mips.complang.tuwien.ac.at (Anton Ertl) wrote in message news:<a4t2f4$f1e$1...@news.tuwien.ac.at>...

Leland Williams

unread,
Mar 1, 2002, 1:16:54 AM3/1/02
to
"Marcel Hendrix" <m...@iae.nl> wrote in message news:<3c735bc2$0$223$4d4e...@read-nat.news.nl.uu.net>...

Hey, ansi works! Thanks Anton !

marcel, the computer at work has an out of the box Windows 98 OS, and
it has ANSI.SYS. I don't know how NT$ or W2K work, but see if they
have a Dos Mode option, and put a device= to the file in the
config.sys box.

Jerry Avins

unread,
Mar 1, 2002, 10:43:43 AM3/1/02
to

AFAIK: as far as I know. (Read that any way you like.)

Jerry
--
Engineering is the art of making what you want from things you can get.
-----------------------------------------------------------------------

Jerry Avins

unread,
Mar 1, 2002, 11:32:39 AM3/1/02
to

AFAIK: as far as I know. (Read that any way you like.)
http://users.erols.com/jyavins/acronyms.html

0 new messages