Skip to main content
20 votes
Accepted

What does an ADC (add with carry) instruction following ADD do?

As others have explained, ADC adds its two operands and the carry bit, storing the result in the first operand. Like ADD, it sets the carry bit as appropriate: adding two n-bit values produces a (n+1)-...
Stephen Kitt's user avatar
20 votes

Most modern C compilers targeting DOS 8086, running on DOS 8086 (16-bit)

The most recently-released C compiler I’m aware of for 16-bit DOS (host and target) is HI-TECH Software’s Pacific C, version 7.51, released on 1996-01-20. The IDE, PPD, requires a 286, but PACC, the ...
Stephen Kitt's user avatar
15 votes

How can I reverse-engineer the game Wizardry (1981) for PC, based on UCSD Pascal?

A few hints about how the UCSD system works. What's often called UCSD-Pascal is in fact a stand alone OS with Pascal as one possible language. Others were BASIC, FORTRAN, Ada or Assembler. The whole ...
Raffzahn's user avatar
  • 224k
14 votes

How can I reverse-engineer the game Wizardry (1981) for PC, based on UCSD Pascal?

The background has already been explained, some additional details. I don't know where to get the version you have, but quick googling found a version with a 320K WIZ1.DSK. This one clearly is a UCSD-...
dirkt's user avatar
  • 27.4k
14 votes

Allocate 64 KiB in Watcom C 16-bit DOS

Typically memory allocators need some extra data in addition to the requested allocation size. This is for maintaining a list of allocated blocks on the heap, it's usually a linked-list node along ...
PaulHK's user avatar
  • 302
14 votes

Most modern C compilers targeting DOS 8086, running on DOS 8086 (16-bit)

There's also the Zortech C compiler from Walter Bright at his Digital Mars site. It supports 16 bits (DOS, Windows) and 32 bits (DOS with extender, Windows and OS/2). Walter Bright works now mostly on ...
Patrick Schlüter's user avatar
12 votes

How can I reverse-engineer the game Wizardry (1981) for PC, based on UCSD Pascal?

What an intriguing piece of archaeology you've stumbled upon! COM programs, present an interesting quirk. Despite its code segment being confined to a mere 64KB, they allocated all available free RAM ...
Rui F Ribeiro's user avatar
11 votes
Accepted

Most modern C compilers targeting DOS 8086, running on DOS 8086 (16-bit)

I can confirm that the following C compilers work. I've also indicated the latest version of each which still runs on DOS 8086. Borland Turbo C++ 1.01 released on 1991-02-27. The next version, 3.00 ...
pts's user avatar
  • 1,993
11 votes

How can 8bits = 1byte but also = 255 bytes at the same time?

A one octet word (eight bits, also known as a byte) can take a value 0-255 as you've found. When you use a byte as an address, you can identify 256 different locations. A two-octet word (sixteen bits) ...
value's user avatar
  • 111
9 votes
Accepted

Are there architectures with alignment greater than the size of machine word in the pre-32-bit era?

Are there pre-32-bit era ISAs with That's a bit fuzzy, as 32 bit ISAs are older than most 8 or 16 bit ISAs, not to mention many that are smaller or larger than 32 bit. The text makes it sound you're ...
Raffzahn's user avatar
  • 224k
7 votes

Are there architectures with alignment greater than the size of machine word in the pre-32-bit era?

There are many machines which forbade data structures from crossing certain power-of-two boundaries that were larger than a word. If one wants to use a single 16K DMA buffer to feed audio to a DOS-...
supercat's user avatar
  • 36.3k
7 votes

Allocate 64 KiB in Watcom C 16-bit DOS

I have not tried it but the following trick might work: You can use halloc(0x1000, 0x10) to allocate a "huge" memory block of 0x1000 × 0x10 bytes (= 64 KiB) size. According to the manual ...
Martin Rosenau's user avatar
6 votes

How can I reverse-engineer the game Wizardry (1981) for PC, based on UCSD Pascal?

One additional piece not mentioned in the other answers... The notes on the UCSD Pascal filesystem here have links to Apple II Pascal reference material, notably this monster. You can, for example, ...
fadden's user avatar
  • 9,040
6 votes
Accepted

Microsoft C 6, far pointer, cast to int, warning C4047

Compilers targeting DOS typically provide macros to manipulate the segment and offset of far pointers. FP_SEG(pointer) provides access to the segment portion, FP_OFF(pointer) to the offset. It's also ...
john_e's user avatar
  • 7,688
4 votes

How can 8bits = 1byte but also = 255 bytes at the same time?

An 8-bit (also called a 1-byte) number, can hold one of 256 distinct values, often an integer between 0 and 255. When used as an address, an 8-bit or 1-byte number can address up to 256 different ...
RETRAC's user avatar
  • 13.7k
3 votes

How can I reverse-engineer the game Wizardry (1981) for PC, based on UCSD Pascal?

Just want to point out that while UCSD P-System was indeed intended to be a portable runtime, that, in the end, the binaries were not necessarily completely portable. Notable bit are that the Apple ...
Will Hartung's user avatar
  • 12.3k
3 votes

Allocate 64 KiB in Watcom C 16-bit DOS

A community wiki answer because it includes a lot of useful evidence, but I seem to flub the numbers somewhere: Per OpenWatcom, the definition of _fmalloc is this. Notably: if( amt == 0 || amt > -...
3 votes
Accepted

Was `wchar_t` ever widely adopted by the Unix culture in actual practice?

Is it historically correct to say that Unix programmers, liking to pretend that character strings and byte arrays were the same thing anyway, never really adopted wchar_t and in practice wide use was ...
Raffzahn's user avatar
  • 224k
2 votes

Most modern C compilers targeting DOS 8086, running on DOS 8086 (16-bit)

(As I'm not allowed to comment, I have to "answer".) Turbo C/C++ or Turbo Pascal for DOS can still be downloaded from Embarcadero. I have working links at https://www.bttr-software.de/links/#...
bttr's user avatar
  • 21
2 votes

Are there architectures with alignment greater than the size of machine word in the pre-32-bit era?

From experience with working with several C compilers on 8-bit and 16-bit machines in the 1980s: On 8080, Z80, and the like, nobody ever put padding into data structures. There was no performance ...
John Dallman's user avatar
  • 13.2k
2 votes

Was `wchar_t` ever widely adopted by the Unix culture in actual practice?

I think your question must be put a bit differently for a first step towards an answer, like "was it common to use localized Unix applications from 70ies to nineties?" - In my opinion, the ...
tofro's user avatar
  • 35k
1 vote

What does an ADC (add with carry) instruction following ADD do?

add ax, 0FFFCh adc dx, 0FFFFh ; <-- here add ax,0FFFCh --> Adds ax and FFFC, if ax is at least 4 to start with it will cause an overflow and set the carry flag. adc dx, 0FFFFh --> ...
Jason Goemaat's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible