VOGONS

Common searches


First post, by FlatAssembler

User metadata
Rank Newbie
Rank
Newbie

Hey, guys!
I've made a program in my own programming language targeting DOS. It's available in this ZIP-archive, the executable is "analogClockForDOS.exe", and the source code is "analogClockForDOS.aec". It's important for me that this program works in DosBox so that people can test it. While it works in VirtualBox and QEMU, DosBox is a lot easier to use (no need to install DOS there). Can you please diagnose the problem (I am almost sure it's somewhere in the ton of inline assembly I've included in that program).

Last edited by FlatAssembler on 2020-06-23, 19:44. Edited 1 time in total.

Reply 2 of 8, by FlatAssembler

User metadata
Rank Newbie
Rank
Newbie

Why does it output different from FreeDOS running under QEMU?

Attachments

  • analogClockForDOS.png
    Filename
    analogClockForDOS.png
    File size
    7.06 KiB
    Views
    744 views
    File comment
    What it outputs in QEMU
    File license
    Public domain

Reply 3 of 8, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

If you run your program in a debug build of DOSBox, the log messages it produces give you an excellent clue about one problem. The compiled program is using FPU opcodes that DOSBox does not emulate, e.g. FCOMIP that is only found on Pentium Pro and later. I think you may need to set the target CPU to 486 or Pentium when compiling in DJGPP, but I don't know the details of how to do that. Anyway, the CPU/FPU compile target is a good place to start, but there may be other issues after you fix that one. The fact that you have long filenames also suggests you're not using MS-DOS 5 or 6, which is what DOSBox targets.

Reply 4 of 8, by FlatAssembler

User metadata
Rank Newbie
Rank
Newbie
ripsaw8080 wrote on 2020-06-23, 20:28:

If you run your program in a debug build of DOSBox, the log messages it produces give you an excellent clue about one problem. The compiled program is using FPU opcodes that DOSBox does not emulate, e.g. FCOMIP that is only found on Pentium Pro and later. I think you may need to set the target CPU to 486 or Pentium when compiling in DJGPP, but I don't know the details of how to do that. Anyway, the CPU/FPU compile target is a good place to start, but there may be other issues after you fix that one. The fact that you have long filenames also suggests you're not using MS-DOS 5 or 6, which is what DOSBox targets.

Damn, the compiler I've made for my programming language relies on "fcomip" for every floating-point comparison.

Reply 5 of 8, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Ah, well, if running in DOSBox is important to you then perhaps recoding for FCOMP is a possibility, although you may find working with the FPU flags more cumbersome than with EFLAGS.

Reply 6 of 8, by FlatAssembler

User metadata
Rank Newbie
Rank
Newbie
ripsaw8080 wrote on 2020-06-23, 21:06:

Ah, well, if running in DOSBox is important to you then perhaps recoding for FCOMP is a possibility, although you may find working with the FPU flags more cumbersome than with EFLAGS.

Well, it's not that important to me. I assumed it had something to do with the inline assembly I put in my program, not with the code my compiler generates.

Reply 8 of 8, by FlatAssembler

User metadata
Rank Newbie
Rank
Newbie
_Rob wrote on 2020-06-24, 12:29:

@FlatAssembler you may want to try with dosbox-x, it has a cputype=ppro_slow

I mean, I can run my program in QEMU and VirtualBox. It's just that I hoped DosBox was an easy way for my future employers who will review my code to run it. Now they will most likely say they don't know if it works. Well, fair enough, I've done enough stuff already, I think.