As of May 31, 2023, we have updated our Code of Conduct.
118 votes
Accepted

Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?

One use is as a copyright mechanism. Many distributors would steal/copy programs and sell pirate or derivative copies, by changing the text strings inside the code and reordering the blocks, it was ...
LOIS 16192's user avatar
  • 1,202
103 votes
Accepted

Why did DOS use dollar-terminated strings?

The short answer is that DOS was designed to be similar to CP/M, and drawing a quote from here: While 8-bit programs could not run on 16-bit computers, Intel documented how the original software ...
Eugene Styer's user avatar
  • 1,091
82 votes
Accepted

Who is credited for the creation of Assembly Language?

According to Wikipedia, the first assembly language, "Contracted Notation", was developed in 1947 by the late Kathleen Booth (née Britten). The language doesn’t look anything like “modern” ...
Stephen Kitt's user avatar
81 votes
Accepted

What computer system is this from 1984 Doctor Who?

This is an example of BBC BASIC with inline (6502) assembler code. The computer in use would have been a BBC Microcomputer, manufactured by Acorn Computers Ltd. The display was probably a studio ...
Mick's user avatar
  • 2,809
81 votes
Accepted

How did the SNES do the “pixelate” transition effect?

Believe it or not, it's a dedicated hardware feature of the Super Nintendo — it's the mosaic register, at address $2106. The programmer can pick a pixellation value from 1 to 16, which will cause the ...
Tommy's user avatar
  • 34.4k
79 votes
Accepted

Were later MS-DOS versions still implemented in x86 assembly?

C did exist when DOS was developed, but it wasn’t used much outside the Unix world, and as mentioned by JdeBP, wouldn’t necessarily have been considered a good language for systems programming on ...
Stephen Kitt's user avatar
76 votes
Accepted

Why did the MS-DOS API choose software interrupts for its interface?

TL;DR; Using INT comes not only natural due the way the 8086 is designed, but was as well intended by Intel as OS entry point, much like a Supervisor Call (SVC) on /360 type mainframes: (Excerpt from ...
Raffzahn's user avatar
  • 199k
72 votes

Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?

The NES was also from the era where some sound and graphics resources were also executable code. (Typically, this worked the other way around. Identify a needed sound and listen to chunks of the ...
Eric Towers's user avatar
  • 1,129
56 votes
Accepted

Why use static RAM addresses instead of the stack?

The 8 bit 6502 family doesn't have any stack-relative addressing modes that would make it easy to use the stack for variable storage. One can access values on the stack with a sequence such as TSX; ...
pndc's user avatar
  • 10.1k
56 votes

Why weren't 80s arcade games programmed in C?

I think the question I would ask is why would you program arcade gamers in C back in the 80's. Firstly, C was not nearly as popular in the world of microprocessor programming as you might imagine back ...
JeremyP's user avatar
  • 11k
53 votes

Was memory corruption a common problem in large programs written in assembly language?

Coding in assembly is brutal. Rogue pointers Assembly languages rely even more on pointers (through address registers) so you can't even rely on the compiler or static analyzing tools to warn you ...
Jean-François Fabre's user avatar
52 votes
Accepted

Why are first four x86 General Purpose Registers named in such unintuitive order?

There are no technical reasons, as any order would work and result in the same amount of gates. More likely it originated in the process by which the 8086 was developed. A main goal was to allow easy ...
Raffzahn's user avatar
  • 199k
50 votes
Accepted

How was the first assembler for a new home computer platform written?

Gates and Allen used remote terminal access to a minicomputer (Harvard's DEC PDP-10) to cross-assemble, and simulate, their implementation of BASIC for the Altair 8800. Commodore Basic (for the 6502) ...
hotpaw2's user avatar
  • 7,954
48 votes

Why use static RAM addresses instead of the stack?

Off the top of my head I can think of two reasons, there are probably more. The first reason is that these variables may be set by a routine each frame, and then a lot of code uses them during the ...
pipe's user avatar
  • 1,693
48 votes
Accepted

Will PC-DOS run faster on 4 or 8 core modern machines?

No, DOS won't use any additional CPU (*1) ever. (Though it might run faster due them new CPUs being faster) Quite the same way as DOS doesn't take advantage of the extended memory or additional ...
Raffzahn's user avatar
  • 199k
46 votes
Accepted

How slow was the 6502 BASIC compared to Assembly

Yes, BASIC is much slower than assembly for many operations. For an easy example, try out this program on a Commodore 64 or emulator: for i = 1024 to 1984 : poke i,peek(i) or 128 : next You will see ...
cjs's user avatar
  • 23.9k
45 votes

Why can't I invoke the next interrupt service by incrementing the AX register after calling the same interrupt?

When calling the mouse driver interrupt with AX = 0, it returns 0xFFFF in AX if a mouse driver is installed. So if it is installed, the code with INC AX will increment AX back to 0 and then it will ...
Justme's user avatar
  • 25.6k
45 votes
Accepted

Managing registers/memory effectively on the Z80

It's quite a while since I did any Z80, but there's an important difference between classic Z80 systems and modern kinds of computer. Memory is fast. Unlike modern systems where memory accesses take ...
John Dallman's user avatar
  • 9,903
43 votes

How was the first assembler for a new home computer platform written?

As someone who did it.... We wrote an assembler for an 8080, as there was nothing affordable from Intel. We wrote it in ALGOL 60, if I recall, and ran it on a mainframe. the first thing we ran ...
david collier's user avatar
43 votes

Which was the first programming language that had data types?

The premise: Machine language (and Assembly language) don't have the concept of data types is not quite correct, because tagged architecture means exactly this, machine language where the data is ...
Radovan Garabík's user avatar
43 votes

Why is the processor instruction called "move", not "copy"?

Besides the matter of semantics and personal taste, there’s a much more practical reason: some instructions sets claim to be copyrighted, as the Wikipedia Z80 article states: Because Intel claimed ...
Biff Iam's user avatar
  • 1,567
42 votes

When did assembly source code begin to be written in lowercase?

It changed when people learned that a) they HAD lowercase, b) typing in uppercase is a pain in the neck, c) that it doesn't matter what case it's in. It's just the natural progression as capabilities ...
Will Hartung's user avatar
  • 11.8k
40 votes

When and why did high-level language compilers start targeting assembly language rather than machine code?

why did high-level language compilers start targeting assembly language rather than machine code Well, the answer is probably: to avoid developing a high level language to binary converter for each ...
Jean-François Fabre's user avatar
40 votes
Accepted

What 8086 instructions accept REP?

All of them. But it will only have an effect with a select few. Contrary to what the question implies, the rep prefix is not an orthogonal looping construct that can be combined with any instruction. ...
user3840170's user avatar
  • 20.5k
37 votes
Accepted

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

The architecture of the original IBM PC (and its clones) let the BIOS access the video memory directly. So making nice text layouts did not require positioning the cursor or making a sequence of ...
Christophe's user avatar
37 votes
Accepted

Why is the processor instruction called "move", not "copy"?

Because "move" is the typical necessary function It isn't always this way, of course, but especially with earlier CPUs, there were limited destinations for data from a particular operation - e.g., ...
manassehkatz-Moving 2 Codidact's user avatar
37 votes

Was there any automated unit testing prior to 1972?

Yes: The Apollo Guidance Computer Update: Computers in Spaceflight: The NASA Experience confirms that unit testing was performed on the Apollo software: The simulations followed individual unit tests ...
DrSheldon's user avatar
  • 15.5k
37 votes
Accepted

Why are the Intel 8080's rotate instructions called opposite to intuition?

What historical reason is there for these instructions being called that? "Historical Reason" is the right key word here, as ... TL;DR: It's Piled Up Heritage The 8080 inherited the ...
Raffzahn's user avatar
  • 199k
36 votes

Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?

I'm just speculating here, but one possible reason for using a 2-byte NOP would be if you wanted to change an existing 2-byte instruction into a NOP (to fix a bug, for instance), without changing the ...
Mitchell Spector's user avatar
36 votes

Why are assemblers called assemblers?

The first use seems to be in "Wilkes, M. V., D. J. Wheeler, and S. Gill, The Preparation of Programs for an Electronic Digital Computer. Reading, MA.: Addison-Wesley, 1951". This book can ...
RETRAC's user avatar
  • 12.9k

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