Questions tagged [c]

For questions regarding the use or installation of the C language on retrocomputers.

Filter by
Sorted by
Tagged with
4
votes
2answers
333 views

How can I malloc() a block that's guaranteed to lie within a single DMA segment in Turbo C 2.01?

I'm following root42's videos about DOS programming using Turbo C 2.01. I've written my own Soundblaster 1.xx driver following the Creative Labs documentation, and I'm confused about memory allocation....
0
votes
3answers
233 views

Should C be regarded as an Intermediate Language? [closed]

Should C be regarded as an intermediate language on a virtual machine named PDP-11 Architecture (which have a plain memory space and stacks), like opcode to jvm, msil to dotnet, asm.js to v8, which ...
2
votes
0answers
146 views

Hitting the CMS Limits of Portable Code

I wrote this arbitrary precision arithmetic utility on BSD in my postgraduate days, then after graduating ported it to DOS using TurboC. Was proud that it would do the same thing with 16bit word ...
1
vote
1answer
156 views

Working on programming a retro z80 computer (SDCC error)

I am working on coding a driver of sorts for a Z80 based computer I am making. I am compiling with SDCC and I have been getting the following? ASlink-Warning-Undefined Global 'data' referenced by ...
2
votes
1answer
219 views

How to implement a 'write' function in pdp-11 / MACRO-11 / ODT using simh?

So, I'm working on a project where I'm aiming to get the first winner of the IOCCC (obfuscated c code contest) dissected down to the last detail... The program is mullender.c which you can find by ...
5
votes
1answer
205 views

What is the format of the static libraries shipping with legacy Microsoft C for DOS?

I have installed Microsoft C 5.10 on DOS 6.22. It created a 'LIB' directory with static libraries to link against. Now I need to extract the symbols and the code for the functions from them, but can't ...
0
votes
1answer
105 views

Do any of the open source Sinclair ZX Spectrum emulators support both TR-DOS and 3DOS?

The number of Spectrum emulators has been growing for decades now so there's quite a lot for different platforms and written in different languages. I'm interesting in learning about two of the disk ...
2
votes
3answers
229 views

C/C++ UI library similar to Visual Basic for DOS

I'm looking for a UI library that offers a similar "experience" to that provided by Microsoft's infamous, Visual Basic for DOS RAD environment. I mean, it's such a compelling environment, ...
0
votes
4answers
332 views

What is the earliest implementation of the stack data structure in C? [closed]

I am trying to find the source code for the earliest implementation of the stack data structure in C, but I can't find anything. I am particularly interested in knowing if the member variables of the ...
8
votes
4answers
1k views

Imaging a HDD from DOS over Serial

I have recently fixed an old IBM Clone, which has an MFM hard drive. The PC booted up fine, but then I saw, that a few years back, I have deleted a few important files (probably by mistake). The ...
4
votes
2answers
249 views

ZX Spectrum scroll waiting for user input problem

I'm trying to compile a C program with z88dk for the ZX Spectrum. Using printf(), when the text hits the bottom line of the screen on line 24 the program stops executing until a key is pressed on the ...
4
votes
5answers
551 views

Z88DK ZX Spectrum “%f” printf not working

I'm attempting to compile a program in C for the ZX Spectrum using Z88DK. However, I'm facing an issue when trying to use printf to print out the value of a float. The code I'm trying to compile: #...
13
votes
3answers
1k views

Memory models for assembly libraries for Turbo C

Turbo C follows the Intel Memory Model where in Tiny, Small and Compact models calling a function is near but in Medium, Large and Huge models calling a function uses far calls. If I want to develop ...
6
votes
2answers
289 views

Why isn't the 'restrict' keyword useful in SDCC when compiling for Z80 target? [closed]

Context SDCC claims to support C11. I use it to write games on Z80 target (for fun and experience). C11 defines restrict C11 specifies the restrict keyword on pointers, which can improve generated ...
16
votes
0answers
630 views

Oxford C compiler for Commodore 64

I kept one floppy from my Commodore 128 (which I used mostly in C64 mode), which is written Oxford C compiler. It is a 5.25" floppy. Don't ask me why I kept just this one; probably because I ...
11
votes
1answer
664 views

cprintf printing invisible characters in C program on VIC 20

I want to compile and run a Hello World program in C with the cc65 compiler for an unexpanded VIC-20 model. For printing I'm using the conio.h function cprintf, since the conio implementation requires ...
28
votes
1answer
3k views

Did DOS zero out the BSS area when it loaded a program?

As an example, say we have a DOS MZ EXE file that's around 20 KiB in size. The EXE header contains the value 0x1400 at offset 0x0A indicating that the program is requesting 5,120 paragraphs (or 80 KiB)...
29
votes
9answers
10k views

How did early x86 BIOS programmers manage to program full blown TUIs given very few bytes of ROM/EPROM?

I've always wondered how so much functionality and relative luxuries(CMOS Configuration Utilities. See: https://geekprank.com/bios/ for an example) included with most popular x86 BIOSes could be ...
6
votes
3answers
497 views

Why is modulo operation an operator for integer types but only a function for floating-point ones?

In C, we have the % operator which finds remainder of division. But it's only applicable to integral types. For floating-point types we have to use fmod function from math.h. This makes an impression ...
29
votes
3answers
8k views

Was Dennis Ritchie being too modest in this quote about C and Pascal?

In his 1993 conference proceeding The Development of the C Language, Dennis Ritchie stated Successors C and even B have several direct descendants, though they do not rival Pascal in ...
59
votes
5answers
13k views

Why did C use the -> operator instead of reusing the . operator?

In the C programming language, the syntax to access the member of a structure is structure.member However, a member of a structure referenced by a pointer is written as pointer->member ...
10
votes
3answers
2k views

DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch?

I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this? For instance the pipe() command from unistd.h isn't present in ...
1
vote
2answers
120 views

DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch? [duplicate]

I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this? For instance the pipe() command from unistd.h isn't present in ...
11
votes
9answers
989 views

Alternatives for TurboVision on DOS

TurboVision was a library by Borland for developing TUI's (Text User Interfaces). It was included with their C++ and Pascal compilers. Were there any other TUI libraries that supported multiple ...
87
votes
20answers
18k views

Have programming languages driven hardware development?

Programming language development has been influenced by hardware design. One example from this answer mentions how C pointers were, at least in part, influenced by the design of the PDP-11. Has the ...
5
votes
3answers
1k views

Were some Atari 2600 games written in C?

I thought all Atari 2600 games had been programmed in 6502/6507 assembly language (plus whatever activated the Stella sound system), but at a party recently, a friend indicated that some 2600 ...
3
votes
1answer
354 views

How to read disk files using CBM specific functions in cc65 with proper error checking

TL:DR What is the reason my kernel_read() function ignoring file errors? I'm trying to understand how to work with files in cc65 using CBM specific functions. My target is Commodore 64 with 1541 ...
-3
votes
2answers
742 views

gcc: installation problem, cannot exec 'as': No such file or directory

How do I compile my code that I have typed on my SGI Indy computer? I have already tried to install the GCC/G++ compilers, but when I run my application, I get the error that says: gcc: ...
1
vote
1answer
416 views

How do I compile C code with the IRIX X Window System?

I have typed out a rather large file in C code that is defining OpenGL graphics and will draw a triangle on the screen. While I know all of the functions of the X Windowing System, I do not know how ...
3
votes
4answers
672 views

Was there ever a compiler type that was just large enough to contain a memory segment?

From this answer, Hark back to the days of segmented 16-bit architectures for example: an array might be limited to a single segment (so a 16-bit size_t would do) BUT you could have multiple ...
18
votes
6answers
3k views

What caused the downfall of Pascal? [closed]

From 1985 to 1990 Borland's Turbo Pascal was at least as popular as C for DOS systems. Turbo Pascal was especially popular because of it's ground breaking BGI graphics interface while C was stalled in ...
8
votes
1answer
933 views

What was the name of the object-oriented C language I used in the 1980s on the Mac

I clearly recall working with an object-oriented C derivative on the Mac but I cannot find any definitive references to it. It was back in the days of System 7 and later System 8. It had both ...
32
votes
2answers
5k views

Why was UNIX never backported to the PDP-7?

Originally, UNIX was written in PDP-7 assembly, and then in PDP-11 assembly, but then when UNIX V4 began to be re-written in C in 1973 and was run mostly on the PDP-11. So far as I can tell, there ...
82
votes
8answers
30k views

Why do C to Z80 compilers produce poor code?

When reading some other questions about compiling C for the Z80, How much benefit should be expected on a more advanced compiler for z80/r800 based computers? Native C compiler for Sinclair ZX ...
13
votes
3answers
4k views

Native C compiler for Sinclair ZX Spectrum

I am looking for a native C compiler for the Spectrum 128. I would like one which: Has good support for the latest C standard at the time. Is not limited to compiling ridiculously short source code. ...
46
votes
5answers
14k views

Why did C have the return type before functions?

In general, there are two types of syntax of defining functions - Something like C, C++, C#, or Java (int functionName(char arg)) vs the ML (and others) tradition of defining the return type after the ...
41
votes
7answers
8k views

The history of the NULL pointer

As we know, in C to dereference a null pointer is undefined behaviour. From what I understand, the PDP-7 and the PDP-11 both have ordinary memory that can be written to and read from at address 0. On ...
30
votes
4answers
8k views

Why (historically) include the number of arguments (argc) as a parameter of main?

A comment on this answer to a StackOverflow question made me curious. According the C99 standard, section 5.1.2.2.1: The function called at program startup is named main. The implementation ...
41
votes
2answers
23k views

Why were the /\ (min) and the \/ (max) operators abandoned in the C language?

In the UNIX V7 version of the C language (but not yet in the V6 version), there were the /\ (min) and the \/ (max) operators. In the source of the scanner part of the compiler, case BSLASH: if (...
29
votes
5answers
5k views

How was the C language ported to architectures with non-power-of-2 word sizes?

By the time the C language started to gain popularity outside of the PDP-11 circles (mid-1970s), mainframes with "weird" word sizes, and no capability to address individual bytes efficiently were ...
13
votes
2answers
816 views

Are there any public tools for the TMS34010?

I am interested to learn about the Texas Instruments TMS34010, a 32-bit fully functional CPU with built-in graphics manipulation capabilities, which appeared in Atari's Hard Drivin' arcade boards ...
28
votes
2answers
7k views

Which tools were used to create the C language?

Was the original C compiler written in some old assembly language and now later flex and bison are used instead?
15
votes
1answer
3k views

What was the first C compiler for the Mac?

When did a C compiler first become commercially available for the Apple Macintosh? And what was its name? The only programming languages that I recall were available for the Mac at launch (January ...
27
votes
10answers
15k views

How to get started writing C for the IBM PC in 1980-81

Suppose it's late 1980 to early 1981, you've got some software you want to write for the IBM PC which will be released later in 1981, want to get started ASAP, and believe C is the right language for ...
18
votes
2answers
2k views

What was the first C compiler for the IBM PC?

When did a C compiler first become available for the IBM PC? I have fond memories of Turbo C, but that didn't become available until the mid to late eighties; it definitely wasn't the first one. ...