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 ...
user avatar
  • 1,204
101 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 ...
user avatar
  • 1,071
80 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 ...
user avatar
  • 2,779
80 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 ...
user avatar
  • 32.4k
76 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 ...
user avatar
  • 95.7k
75 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 ...
user avatar
  • 168k
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 ...
user avatar
  • 1,099
70 votes
Accepted

Who is credited for the creation of Assembly Language?

According to Wikipedia, the first assembly language was developed in 1947 by Kathleen Booth (née Britten). The language doesn’t look anything like “modern” assembly though (see the end of this paper); ...
user avatar
  • 95.7k
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; ...
user avatar
  • 9,380
55 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 ...
user avatar
  • 10.1k
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 ...
user avatar
51 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 ...
user avatar
  • 168k
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) ...
user avatar
  • 7,754
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 ...
user avatar
  • 1,699
46 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 ...
user avatar
  • 168k
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 ...
user avatar
  • 21k
44 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 ...
user avatar
  • 17.2k
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 ...
user avatar
42 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 ...
user avatar
41 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 ...
user avatar
  • 10.9k
40 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 ...
user avatar
  • 1,517
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 ...
user avatar
39 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. ...
user avatar
  • 16.6k
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 ...
user avatar
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 ...
user avatar
35 votes

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

A mistake? The instruction $89 on the 6502 is a two-byte NOP. Based on adjacent instructions in the opcode matrix, especially LDA #ii ($A9 ii), it would have been STA #ii, a store to an immediate ...
user avatar
35 votes

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

From The OS/2 Museum page about DOS3: "The new ATTRIB.EXE utility allowed the user to manipulate file attributes (Read-only, Hidden, System, etc.). It is notable for being the first DOS utility ...
user avatar
34 votes

Motorola 6809 two stacks design

From Byte Magazine article on 6809, by Terry Ritter: Point 11: Tell me again about the stack pointers: why two stack pointers? Answer 11: Good Point. The original reason for adding ...
user avatar
  • 441
34 votes
Accepted

What does "jmp *" mean in 6502 assembly?

MADS uses * in three ways (See MADS "Manual") Using the current assembly address for calculation of an address, i.e. the one the actual statement is assembled to. Multiplying in expressions. Mark the ...
user avatar
  • 168k
34 votes

Which was the first programming language that had data types?

Machine language (and Assembly language) don't have the concept of data types, so if you want to add an int and a float variable in Assembly, you have to use the appropriate Assembly instruction that ...
user avatar
  • 168k

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