Skip to main content
119 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,222
105 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,111
84 votes
Accepted

Does this 8088 code in the Leisure Suit Larry 2 game actually do anything?

In a brief email conversation with Al Lowe (yes, the man himself!) he suggested that he probably used the COMMAND.COM file as the basis for this code as it would have been installed on every PC. ...
Noel Whitemore's user avatar
82 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,829
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

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
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
  • 36.9k
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
  • 224k
71 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,119
57 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
  • 224k
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
  • 11.3k
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
  • 11.8k
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

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
  • 8,183
49 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,718
49 votes

Does this 8088 code in the Leisure Suit Larry 2 game actually do anything?

It's most definitely not a program 'written' by a programmer, but rather a listing of some random program segment using the disassembly command of a debugger. Have you tried to find that code within ...
Raffzahn's user avatar
  • 224k
47 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
  • 224k
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
  • 26.4k
46 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
  • 2,209
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
  • 32.1k
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
  • 13.2k
44 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
44 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
  • 12.3k
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
40 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
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
  • 23.1k
39 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
39 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
  • 224k
38 votes

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

MS-DOS (by which I mean the underlying IO.SYS and MSDOS.SYS files) was written in assembly through the first half of the 1990s. In 1995 for Windows 95, which was bootstrapped by what you would call MS-...
skew's user avatar
  • 481

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