Questions tagged [c]
The C programming language: its historical aspects and use on/targetting retro platforms.
108 questions
13votes
1answer
3kviews
Was there ever a C compiler written in Pascal?
When C was gaining popularity across various computer architectures and it was being ported to those architectures, was it always done via cross-compiling, or was there a known case of a C compiler ...
18votes
5answers
3kviews
Why did ancient Unix perform BSS segment initialization?
I just came across this good question at SO: Why are global and static variables initialized to their default values? But I don't like any of the answers and I actually think it remains unanswered: ...
13votes
5answers
2kviews
Did any processor (ISA) ever exist which didn't have well-defined signed overflow?
The C language always labelled signed overflow/underflow of integers "undefined behavior". I usually argue and say that this is an artificial construct created by C. On the assembler level ...
6votes
2answers
1kviews
C, recursion and the HP-1000
Was there ever a C compiler for the HP-1000? If so, what did the code for function calls look like? In particular, how did it handle recursion? If I have properly understood the documentation I have ...
10votes
1answer
1kviews
How to set/force EXE stack size with 1988 Turbo C 2.0 for a reverse engineering project
I am trying to reconstruct C source of a Turbo C 2.0 DOS small-memory-model executable as exactly as possible from disassembly (it’s a DOS reverse-engineering project and I’m using IDA Pro for ...
5votes
0answers
450views
Rationale for requiring struct prefix in C [closed]
In C, if you declare a struct like: struct point { int x, y; }; you also have to use struct when referring to point, e.g.: struct point p; // declare p as struct point because all struct, union,...
12votes
3answers
2kviews
What happens when I declare multiple register variables in C on older compilers?
I know that in modern compilers with optimizations, declaring a variable as register is merely a suggestion, and the compiler may ignore it, placing the variable in RAM instead of an actual register. ...
13votes
2answers
3kviews
What was the main implementation programming language of old 16-bit Windows versions (Windows 1 - Windows 3.11)?
It seems that MS-DOS was primarily written in assembly even in its last versions. I understand that new versions of Windows such as the NT-based versions currently in use, and Windows 95 .. ME which ...
12votes
2answers
1kviews
Is there a pre-defined compiler macro for legacy Microsoft C 5.10 to get the compiler's name and version number?
In Microsoft Visual C++, I can use the macros _MSC_VER for compiler identification and _MSC_FULL_VER for its version number to retrieve the data of the used compiler at runtime of my C program. But ...
19votes
6answers
5kviews
How did the `long` and `short` integer types originate in C?
I was wondering why C has the long and short integer type in addition to the plain int, and came across the following quote in the C99 Rationale (thanks to this answer here): [...] In the 1970s, 16-...
4votes
1answer
391views
How to use external asm function in "vscode-amiga-debug" cross compiler?
I would like to write functions in assembly along with the c source code, but somehow I can't find the syntax. I tried e.g. in the fname.asm file (simplified): fill_bmap: rts In the fname.c ...
5votes
1answer
300views
Where to find the Cray arithmetic library?
Given a Cray simulator and a pre-installed UniCOS HD image, attempting to compile Steven Pemberton's ENQUIRE (literally, the second thing to try after "Hello, Cray") fails with CC-1153 cc: ...
3votes
1answer
757views
What do the pins D0-D7 on the Intel 8080 exactly signify?
I am currently trying to create a FPGA styled simulator of the 8080 in C. I have a couple of questions regarding the D0-D7 pins. As far as I can see the D0-D7 lines are used in order to store data (a ...
15votes
2answers
1kviews
Has the “entry” keyword ever been implemented in C?
I posted this question on StackOverflow, but someone commented and advised me to publish it here. Here the terms K&R1 and K&R2 refer to a book written by the C creators about the language. K&...
4votes
2answers
2kviews
Gameboy Key Input Causes Crash
I made a Key Tester using the STDIO header included with GBDK. It works... Until it doesn't. All the keys register and print to the screen, except the Left(5) and Right(4) Directional Keys, which ...