watcom

COM executables with Open Watcom

会有一股神秘感。 提交于 2020-08-07 09:43:35
问题 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 either ambiguous or doesn't work as the examples show, so I end up with either a .EXE file (with MZ header) or multiple linker/compiler errors. So, How can I make a .COM executable with Open Watcom compiler? 回答1: The system com option is probably invalid

COM executables with Open Watcom

▼魔方 西西 提交于 2020-08-07 09:43:04
问题 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 either ambiguous or doesn't work as the examples show, so I end up with either a .EXE file (with MZ header) or multiple linker/compiler errors. So, How can I make a .COM executable with Open Watcom compiler? 回答1: The system com option is probably invalid

Generating FAR jump instruction in 32-bit Open Watcom C

淺唱寂寞╮ 提交于 2019-12-25 05:17:16
问题 I need to generate a far jump instruction to jump to another ISR(Interrupt Service Routine). I'm developing a 32-bit FreeDOS application. After reading OW manuals(cguide.pdf and clr.pdf), I figured out two ways that compiled successfully w/o any warning or error . /* Code Snippet #1 */ #pragma aux old08 aborts ; void (__interrupt __far *old08)(void); // function pointer declaration void __interrupt __far new08(void) { /* Do some processing here ... */ (*old08)(); /* OW will now generate a

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

限于喜欢 提交于 2019-12-23 08:46:57
问题 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 results host $ docker run -v $PWD/results:/results -it ysangkok/ia16-gcc-rask container $ cd results I don't include the header, cause gcc can't use OpenWatcom's libc headers. container $ echo 'main() { printf("lol"); }' > test.c I don't link

Open Watcom Inline assembly SEG and OFFSET operators

爱⌒轻易说出口 提交于 2019-12-23 02:49:20
问题 Today, I have learned that the SEG operator in MASM by default returns the address of the GROUP and not the address of the SEGMENT of the expression in question, and that there are options and methods to override that. Since I am currently doing a complex project in Open Watcom 1.9 / 16 bit DOS where C and assembly (inline and standalone) are mixed (actually, DOS is only needed for startup, then my own MINI-OS takes control), and since I know that WASM is somewhat MASM compatible, I have the

惊艳的Open WATCOM C/C++

好久不见. 提交于 2019-12-03 08:46:48
成立于1981年的WATCOM公司于1988年推出PC版的C语言编译器,或许是专心研究的缘故, Watcom C/C++是以在DOS下能够产生最佳化程序代码闻名于世的,许多写游戏和DOS Extender的厂商都指名要使用Watcom C/C++,因为不论是Borland C/C++还是Visual C/C++,它们产生的最佳化程序代码都比Watcom C/C++的最佳化程序代码差上一截。再加上当时最有名的DOS Extender厂商PharLap公司也是使用Watcom C/C++,因此Watcom C/C++在专业的C/C++程序员以及系统程序员心中是第一品牌的C/C++开发工具。 然而,惨烈的C/C++编译器四国圣战,WATCOM C++还有 Symantec C/C++,Broland C/C++最终不敌Microsoft C/C++,(这并不是由于编译器的原因,个中原由,大家可以去看一下台湾著名程序员 李维的《C/C++ 圣战》。)卖掉的卖掉,转行的转行,如今, Symantec 早就不搞C/C++了,诺顿就是Symantec的品牌,WATCOM被Sybase收购后, 开发了 Optima++, 据说当时看来是非常不错的开发工具,能够直接拖拽控件,当时Sybase终究不是个有眼光的公司,1.5开发后就放弃了,当然这时期的编译器还是叫WATCOM,直到1999前年

Why direct access I/O works incorrectly with Intel Visual Fortran

南笙酒味 提交于 2019-11-26 23:39:38
问题 This program program test real a(10) open(1, file='f1',access='direct', recl=20) do i=1, 10 a(i) = i-1 end do write(1, rec=1)(a(i),i=1,5) write(1, rec=2)(a(i),i=6,10) close(1) open(1, file='f1',access='direct',recl=8) read(1, rec=4)(a(i),i =5,9,4) print*,a end works incorrect in visual Fortran (incorrect): 0.0000000E+00 1.000000 2.000000 3.000000 9.000000 5.000000 6.000000 7.000000 0.0000000E+00 9.000000 Result in WATCOM (correct): 0.0000000 1.0000000 2.0000000 3.0000000 6.0000000 5.0000000 6