News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Amazing options in FLAT or UNREAL Mode

Started by Gunther, March 01, 2021, 02:56:07 PM

Previous topic - Next topic

Gunther

The last days I had to do with an embedded DOS system and wrote a test program for it. There I could experiment a bit with the FLAT or UNREAL mode.

The application is a small DOS program written in PB 3.5; but the real dirty work is done by the assembly language procedures. So I think the 16-bit DOS
sub-forum is the right place for the upload. However, Hutch might also think that it belongs in the PB subforum. In principle it doesn't matter.

The program establishes the FLAT mode, copies an array over 1 MB and restores it. After that the Barnsley fern is calculated in VGA 640x480, 16 colors
and the whole screen is saved over 1 MB. Finally, the Mandelbrot set is computed, once with 256 colors and once then in a True Color mode, each time
with the linear frame buffer that VESA offers. That brings considerable time advantages. In the True Color mode the Mandelbrot set is colored with a
continuous color gradient.

The program works under plain DOS with HIMEM.SYS and in a virtual machine under the direction of VMWare, VirtualBox, VirtualPC, Bochs etc. Also DOSBox
version 0.74 works quite well, although DOSBox has some bugs in the emulation. I have already written to the authors and I'm working on an
error report.

The archive is vbe.zip contains the following files:

VBE.ASM: Assembly language source
VBE.BAS: PowerBASIC source
VBI.INC: INCLUDE file for the compiler
VBE.OBJ: OBJ file
VBE.EXE: The running application

I had to assemble the assembly language source with the old TASM 4, because JWASM for DOS doesn't like the system instruction:

lgdt pword ptr ds:[GDTadr]

Therefore I packed the OBJ into the archive.

I have tested the program under different configurations and it runs stable and well, for example on NVIDIA GeForce GT 1030 or
AMD Radeon HD 7570. Tests on other hardware are always welcome.

Gunther
You have to know the facts before you can distort them.

jj2007

Quote from: Gunther on March 01, 2021, 02:56:07 PMI had to assemble the assembly language source with the old TASM 4, because JWASM for DOS doesn't like the system instruction:

lgdt pword ptr ds:[GDTadr]

Remember the old db x, y, z trick... I can't test what you are doing, but it sounds interesting :thumbsup:

Gunther

Jochen,

Quote from: jj2007 on March 01, 2021, 04:34:09 PM
Remember the old db x, y, z trick... I can't test what you are doing, but it sounds interesting :thumbsup:

yes, of course, but but the whole thing with JWASM is ridiculous. After all, the old TASM can do it.

You can always install Oracle VirtualBox and FreeDOS in it. Both are free.

Gunther
You have to know the facts before you can distort them.

nidud

#3
deleted

Gunther

You have to know the facts before you can distort them.

Gunther

Jochen,

A very simple way is to install DOSBox. It is a native 32-bit Windows program. The respective DOS application then runs in this sandbox and cannot do
any damage. The configuration effort is minimal and the data exchange between DOS and Windows is no problem, because this emulated DOS is connected
to a directory of your choice. You should definitely try this once.

Gunther
You have to know the facts before you can distort them.

jj2007

Gunther,

I've installed DosBox now, but whenever I try to launch an exe, it tells me "illegal command". I managed to mount a drive, and can run 16-bit programs created with RichMasm, but there is no editor, and I can't run an assembler...

In contrast, I can build and run very easily \Masm32\MasmBasic\Res\HelloWorld16.asc by opening it in RichMasm and hitting F6 - on Win7-64. The secret is called msdos.exe, and it works just fine with 16-bit exe or com, even passing a commandline is straightforward, as shown below :cool:

There is also a 16-bit COM example that works out-of-the-box, see \Masm32\MasmBasic\Res\HelloWorldCOM.asc

OPT_Run \Masm32\bin\msdos.exe HelloWorld16.exe Hello World, how are you today?  ; download; use binary\i486_x64\msdos.exe

Gunther

Jochen,

that has to do with your settings.

In your users directory (here is my path: c:\users\Gunther\AppData\Local) you'll find a file dosbox-0.74.conf with your configuration settings.

At the end of that file I've written that:

mount c e:\dos
c:
set path=c:\;c:\nc;c:\basic\bin;c:\tasm\bin;c:\nasm\bin;c:\jwasm\bin

first I've mounted drive C to a directory e:\dos
The next command is to change the drive. Then set the PATH variables, so that the needed paths are open.

If that's done, you can fire up the application.

Hope that helps.

Gunther
You have to know the facts before you can distort them.

jj2007


HSE

Quote from: jj2007 on March 02, 2021, 10:59:19 AM
Which editor do you use in DosBox?
Edit ?


But you can open with RichMasm because DosBox don't limit file access.

If you create a new file that must be inside DosBox, but if you have a config file is more easy to create new file out of DosBox, close DosBox and open again.
Equations in Assembly: SmplMath

jj2007

illegal command: edit
RichMasm: This program cannot be run in DOS mode.

HSE

Open RichMasm like every day, then open or save file in the directory that in DosBox you mounted as a "theorethical" drive.
I have to say that I use qEditor     :biggrin:
Equations in Assembly: SmplMath

Gunther

Jochen,

what the hell are you going to do? DOSBox emulates a DOS for you. Why do you want to edit files in DOSBox with a DOS editor?
If you need to edit something, do it under Windows, copy the result into your mounted directory (with the appropriate paths open) and run the DOS compiler or assembler over it.

But if you absolutely want to edit under DOS, try EDIT from FeeDos. It's halfway ok, but it's an old DOS editor.
DOSBox is designed to run the old DOS games or other old DOS applications. But it is also suitable for testing software and my program VBE.EXE runs under DOSBox, both in the
window and in full screen mode (switch with ALT+ENTER).

Gunther
You have to know the facts before you can distort them.

Gunther

Jochen,

another possibility - under whatever operating system - to emulate DOS is VirtualBox from Oracle. This is faster and nicer than DOSBox, but also trickier to establish.
You need an image, preferably of FreeDOS, and install FreeDOS inside VirtualBox, using the network tools.

Then a very nicely emulated DOS runs inside VirtualBox. But then the problems start. The data exchange between host and guest is not so simple.
DOS has hardly any USB drivers. Some in the experimental stage, others don't like sticks over 2 GB, for still others you have to pay. The NTFS disks are not recognized by DOS anyway.
So what to do to move files back and forth? If you have installed the network tools, FreeDOS (but only those) offers an FTP server. This is started and with a FTP client under Windows
the data exchange works then very well, fast and comfortably.

I didn't want to put you through all that. That's why I suggested DOSBox, because the data exchange works well there. How should I know that you want to edit under DOS?

Gunther
You have to know the facts before you can distort them.

jj2007

Quote from: Gunther on March 02, 2021, 01:01:37 PM
Jochen,

what the hell are you going to do? DOSBox emulates a DOS for you. Why do you want to edit files in DOSBox with a DOS editor?
If you need to edit something, do it under Windows, copy the result into your mounted directory (with the appropriate paths open) and run the DOS compiler or assembler over it.

Gunther,

I don't want to edit anything under DOS. But the method you suggest (edit in 32- or 64-bit mode, copy the asm file to DOSBOX, launch the build process there) is very, very clumsy compared to what I am using right now with msdos.exe:
- open the source in RichMasm
- edit whatever you need (no need to save)
- hit F6, and half a second later you see the output of the running file.exe or .com...

Test it, the source is attached. You need MasmBasic and msdos.exe: put binary\i486_x64\msdos.exe into \Masm32\bin\msdos.exe (923,648 bytes, 2 January 2021).