Results 1 to 11 of 11

Thread: Old DOS program and the 2003 error-integer divide by zero.

  1. #1
    Premium Member
    Join Date
    Aug 2021
    Posts
    387
    Thanks
    114
    Thanked 81 Times in 44 Posts
    Rep Power
    77
    Reputation
    1630

    Default Old DOS program and the 2003 error-integer divide by zero.

    Been too long since I was coding for DOS and I am trying to get an old dos program to run.
    This error hits at startup. A stand alone .exe program I have been trying to debug but not having any luck.
    Any oldtime coders have any idea where I might look to solve this ?
    Cheers.



Look Here ->
  • #2
    Premium Member
    wotnot's Avatar
    Join Date
    Nov 2019
    Location
    Scenic Rim, SE Qld
    Posts
    3,236
    Thanks
    1,462
    Thanked 2,935 Times in 1,510 Posts
    Rep Power
    1335
    Reputation
    58710

    Default

    What program is it? Do you have the source code for it?

  • #3
    Premium Member
    Join Date
    Aug 2021
    Posts
    387
    Thanks
    114
    Thanked 81 Times in 44 Posts
    Rep Power
    77
    Reputation
    1630

    Default

    Quote Originally Posted by wotnot View Post
    What program is it? Do you have the source code for it?
    The file is RADMBL.exe, a Radius radio CPS so no source code.
    I have been using IDA PRO for decades for things like disassembly and hex dumps, but for some odd reason, the debugger function is not working.
    3rd party debugger, Bochs, but can't seem to configure it properly for the task.
    The RADMBL trying to run on a DOS 6.22 drive.
    Often these errors are clock speed too fast, but I have the DOS drive configured to change speeds. I tried everything from 66 Mhz to 400 Mhz Pentium pro mode and doesn't matter.

  • #4
    Premium Member
    wotnot's Avatar
    Join Date
    Nov 2019
    Location
    Scenic Rim, SE Qld
    Posts
    3,236
    Thanks
    1,462
    Thanked 2,935 Times in 1,510 Posts
    Rep Power
    1335
    Reputation
    58710

    Default



    Seems to run fine under dosbox (linux, same would be so for the windows port of dosbox), using the standard config file for dosbox....

    ...this infers the radmbl.exe program launched in 16bit raw mode at time of invocation -- what is not clear, is whether the executable toggled the CPU emulation into 32bit protected mode (but there's probably a way to trace that in dosbox) -- in either case, no 16bit raw mode or no way to toggle CPU into protected mode, is likely to cause the divide by zero error.

    A good treatise on this, see answer 4 ->

  • The Following User Says Thank You to wotnot For This Useful Post:

    Hunchback Tech (22-03-22)

  • #5
    Premium Member
    Join Date
    Aug 2021
    Posts
    387
    Thanks
    114
    Thanked 81 Times in 44 Posts
    Rep Power
    77
    Reputation
    1630

    Default

    Hi
    switching to protected mode something I was considering in looking through the disassembly. This is where tracing would be handy.
    Let me try DosBox and see what happens. so far, trying to run it in Vdos and the dos boot drive, it fails.
    73s

  • #6
    Premium Member
    wotnot's Avatar
    Join Date
    Nov 2019
    Location
    Scenic Rim, SE Qld
    Posts
    3,236
    Thanks
    1,462
    Thanked 2,935 Times in 1,510 Posts
    Rep Power
    1335
    Reputation
    58710

    Default

    Just thinking aloud...the way M carry on, the old executable may have been compiled & stripped of debug hooks...you might want to look at the debug build of dosbox for windows, depends on what you're trying to achieve ->

  • #7
    Premium Member
    Join Date
    Aug 2021
    Posts
    387
    Thanks
    114
    Thanked 81 Times in 44 Posts
    Rep Power
    77
    Reputation
    1630

    Default

    HEY ! This runs in DosBox, only issue is no com1 serial activity.
    As for my debugging with IDA, it won't debug DOS programs.
    I have a 3rd party dos debugger I can also run in DosBox.
    Next step is see if I need settings in dosbox or the radmbl to enumerate com1
    A good step though, at least I see the program will run.
    My goal is getting a dump of the radios configuration block that sets the radios com parameters. Using terminal, none of my com settings talk to the radio.
    Cheers

  • #8
    Premium Member
    wotnot's Avatar
    Join Date
    Nov 2019
    Location
    Scenic Rim, SE Qld
    Posts
    3,236
    Thanks
    1,462
    Thanked 2,935 Times in 1,510 Posts
    Rep Power
    1335
    Reputation
    58710

    Default

    Just dig through the dosbox wiki ~ default is to set com ports as dummies -->

  • The Following User Says Thank You to wotnot For This Useful Post:

    Hunchback Tech (23-03-22)

  • #9
    Premium Member
    Join Date
    Aug 2021
    Posts
    387
    Thanks
    114
    Thanked 81 Times in 44 Posts
    Rep Power
    77
    Reputation
    1630

    Default

    Quote Originally Posted by wotnot View Post
    Just dig through the dosbox wiki ~ default is to set com ports as dummies -->
    That may be my missing key, thanks.
    Another question ( I know, I can be a pain sometimes)
    Have you ever used debugx. enhanced version of MS debug)
    It seems to work for me, but I just can't get output to a text file or route to printer.
    I recall doing that decades back with the DOS debug, can't remember how.
    Working my way through debug tutorials, nothing relative yet.
    I have reason for hacking this old stuff as it looks like it can apply to the new stuff.
    Thanks my hero.
    Last edited by Hunchback Tech; 23-03-22 at 05:07 PM.

  • #10
    Premium Member
    wotnot's Avatar
    Join Date
    Nov 2019
    Location
    Scenic Rim, SE Qld
    Posts
    3,236
    Thanks
    1,462
    Thanked 2,935 Times in 1,510 Posts
    Rep Power
    1335
    Reputation
    58710

    Default

    Quote Originally Posted by Hunchback Tech View Post
    That may be my missing key, thanks.
    Another question ( I know, I can be a pain sometimes)
    Have you ever used debugx. enhanced version of MS debug)
    It seems to work for me, but I just can't get output to a text file or route to printer.
    I recall doing that decades back with the DOS debug, can't remember how.
    Working my way through debug tutorials, nothing relative yet.
    I have reason for hacking this old stuff as it looks like it can apply to the new stuff.
    Thanks my hero.
    I have never really used MSDOS in my life =) I just see all this from a hardware perspective...

    ..dosbox was never really created in an attempt to provide accurate emulation of i386/i486 hardware ; rather, it was created to be 'sufficient' enough to run older DOS based games. As such, and considering most old DOS games don't require a printer port, this is largely unimplemented in dosbox ..I believe there's a print to file function, and there's some tutes out there on how to get printer working in dosbox via win3.1x drivers...so it appears that it can be made to work...

    ...then again and however, because the dosbox CPU emulation is what it is (not a 'perfect' emulation of the hardware), and aimed towards facilitating DOS games to work, things like compilers, debuggers and disassemblers, are known to behave very badly =) The dosbox-debug build is about as good as it gets, because you can visualize the ASM at/on the actual (software) CPU level...ie; this debugger looks at the synthesized CPU knowing it's source code -- real DOS programs, expect to find real hardware 8) Remember too, dosbox isn't using MSDOS either, and sometimes small things like that matter (dosbox will be using free/open dos instead)

    Something like Bochs () has a more complete CPU emulation, and even VMs like qemu or virtualbox are worth a try here.

    AFAIK, once you setup the com port settings in dosbox.conf, the serial port stuff works, but it has to be the hardware UART ('legacy') serial port

  • #11
    Premium Member
    Join Date
    Aug 2021
    Posts
    387
    Thanks
    114
    Thanked 81 Times in 44 Posts
    Rep Power
    77
    Reputation
    1630

    Default

    I have Bochs, I sort of put it aside after a days work trying to configure it to run.
    Dosbox will run most dos programs and a work in progress for all code that runs under dos.
    Now I am old school, and started assembly coding with the very first MS DOS (DR-DOS). Before the IBM PC. My mentor (a neighbor) was Peter Norton.(yea, Norton software) (Note here the guy that coded DOS for Digital Research went to Microsoft and coded MS DOS)
    He helped me code (assembly) a text editor on a Commodore 128. I even upgraded it to edit HEX. I migrated to CPM and Z-80 and started into embedded controllers like Intel 8048/9. That is when I entered the 'hacker' world. That was about the time LMR and controllers got married, so right up my alley. I have done things with an old GE Delta SX the engineers said couldn't be done. This current project is about the same vintage.
    I did redo the serial in dosbox config, and now do get my serial port data. Still won't talk to the radio, and think this software uses hardware flow control pins as busy functions, a feature in the Moto RIB. (mine is homebrew and lack that.) Maybe some mods will fix that or (gulp) fix the software to ignore busy.
    This culminates in a "one wire" asynchronous link between radio and RIB.
    Things are starting to work so not going to open a new can of worms. This progress goes to your credit, so many thanks.
    Hey, any emulator that can accurately interpret DOS commands and accurately code to a given processor will work.
    I have a box full of emulators for various controllers, but this is getting into machine code.
    73s
    Last edited by Hunchback Tech; 24-03-22 at 03:33 PM.

  • Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •