Questions tagged [watcom]

Open-source C/C++ and Fortran compilers for multiple 16- and 32-bit x86 target platforms.

The Watcom compiler line originated with University of Waterloo Fortran, or WATFOR, in the 1960s, widely used at universities. WATCOM was spun off into a private company and eventually the products were open-sourced.

65 questions
9
votes
1 answer

Segmented far pointer allocation in 16bit x86 MS-DOS real mode

I'm trying to get my head around programming real mode MS-DOS in C. Using some old books on game programming as a starting point. The source code in the book is written for Microsoft C, but I'm trying to get it to compile under OpenWatcom v2. I've…
IronPug
  • 123
  • 4
9
votes
6 answers

Advantages and disadvantages of Open Watcom

Since in some post on StackOverflow it was recommended to try to support multiple (in this case C/C++) compilers if feasible, since this forces you to code more standard compliant and helps finding bugs. So I was looking for additional free C/C++…
Nubok
  • 3,502
  • 7
  • 27
  • 47
8
votes
5 answers

c++ iterate through a vector of strings

So I recently discovered the use of map and vectors, however, I'm having trouble of trying to figure a way to loop through a vector containing strings. Here's what I've tried: #include #include #include using namespace…
Jason Lee
  • 83
  • 1
  • 1
  • 5
6
votes
1 answer

How do I assemble GAS assembly and link it with the Open Watcom C library?

I am trying to produce 16-bit DOS executables, but using the gcc compiler. So I am using the ancient gcc-4.3 ia16 port. I made a Docker image of my build: https://registry.hub.docker.com/u/ysangkok/ia16-gcc-rask Here's what I am trying: host $ mkdir…
Janus Troelsen
  • 20,267
  • 14
  • 135
  • 196
5
votes
1 answer

Debugging crashed 32-bit DOS executable compiled with OpenWatcom

I have an application that I compile for 32-bit DOS/DPMI target (with DOS32/A extender) using OpenWatcom classic (1.9 - latest stable release). If the program crashes on a bad memory access, I get the CS:EIP of the faulting instruction. How can I…
5
votes
0 answers

cross-compile freetype for DOS with OpenWatcom under Linux

More out of fun than anything I'm writing a program for an old MS-DOS machine. I'm using Linux (Fedora 19) as my development machine and OpenWatcom 1.9 to compile my code. Now, I'd like to use FreeType (2.5.2) for my project but I'm having trouble…
iliis
  • 878
  • 8
  • 19
4
votes
2 answers

16-bit .com C program in real mode OS

I've been working on a real mode OS, writing in assembly and compiling to flat .bin executables with NASM. I would like to write some of the OS in C, and so wrote an experiment program (ctest.c) which I would like to access a string and print the…
user1112148
  • 89
  • 1
  • 6
3
votes
2 answers

How to make C function compiled by OpenWatcom return a double in ST(0)?

The C function double retfp(void) { return 42; } , when compiled with OpenWatcom C compiler for Linux i386: owcc -blinux -fno-stack-check -fsigned-char -march=i386 -Os -W -Wall -Wextra -Werror -mregparm=0 -c -o retfp.owcc.obj retfp.c has code…
pts
  • 80,836
  • 20
  • 110
  • 183
3
votes
1 answer

How to make Watcom C compiler (wcc) and WASM generate the same 8086 machine code?

For this C source code: int add(int a, int b) { return a + b; } , the Watcom C Compiler for 8086 (wcc -s -ms -os -0 prog.c) generates the following machine code (hex): 01 D0 C3, disassembling to add ax, dx (01 D0) + ret (C3). For this assembly…
pts
  • 80,836
  • 20
  • 110
  • 183
3
votes
1 answer

How to define a NORETURN macro in Watcom C

Is it possible to do a #define NORETURN(x) macro that works with the Open Watcom C compiler (not C++)? Based on the fine manual I have this file test.c: #include #ifdef __GNUC__ #define STATIC_NORETURN(sig) static void sig…
Lassi
  • 3,522
  • 3
  • 22
  • 34
3
votes
1 answer

Qemu and Raw Binary File

I am compiling and running binaries (boot sector, stage 1, stage 2) for practice. The boot sector is asm and the first stage is asm which run fine. The second stage loads at 0x1000 and I have some asm which jumps to the start of my C Code. My jumps…
3
votes
2 answers

COM executables with Open Watcom

I'm trying to make a small utility for an old i286 machine running PC-DOS and the target format a plain COM executable. The compiler choice has been Open Watcom and, on the documentation it says it can link DOS .COM files but documentation is…
NeonMan
  • 623
  • 10
  • 24
3
votes
3 answers

XMS allocation in 16-bit DOS

Please forgive my attempts at necromancy, but I actually need to write some code for 16-bit DOS (!). I have to verify that a piece of software executes correctly when built for a 16-bit platform, and I discovered that our XP workstations can…
Christoffer
  • 12,712
  • 7
  • 37
  • 53
3
votes
2 answers

How to do DMA transfers under DOS extender or DPMI environment?

How can a program use DMA transfers while running under a DOS extender+DPMI environment ? I mean how can we allocate and get physical address of the dma buffer allocated, so as to supply that physical address to the DMA controller, or PCI bus…
jacks
  • 294
  • 3
  • 15
2
votes
1 answer

compile bootloader with open watcom for 286 cpu

im trying to build myself a small bootloader/program for my old 286. i started doing this with fasm and quickly grew tired of writing assembly. so i figured i want to write it in c instead, but the choice of c toolchains targeting 286 seems to be…
fredlllll
  • 75
  • 8
1
2 3 4 5