Skip to main content

Questions tagged [binary-coded-decimal]

For questions about the binary-coded-decimal (BCD) numeric representation.

19 votes
2 answers
5k views

The NES CPU was a copy of the 6502 with the BCD circuitry removed. As I understand it, this modification was motivated by a theory that BCD was the only part of the 6502 that was actually patented, so ...
rwallace's user avatar
  • 65.3k
11 votes
3 answers
2k views

A common idiom in 6502 assembly code is to protect sequences of code that rely on decimal mode from being interrupted. This because an interrupt handler typically clears decimal mode (cld), and thus ...
Brian H's user avatar
  • 62.1k
6 votes
2 answers
1k views

Many of the earliest computers stored and manipulated numbers in various decimal codings rather than in pure binary. Examples include the Mark I and ENIAC, as well as some UNIVAC and IBM models. ...
DrSheldon's user avatar
  • 17k
0 votes
1 answer
1k views

The 6502 has the decimal mode, which causes the ALU to always output valid BCD if it's given valid BCD. Of course, you can turn it off, as any sane person always does. I was just looking at the ...
Omar and Lorraine's user avatar
4 votes
3 answers
460 views

I'm just curious why the 8086 seems to be lacking in an adjust opcode for fixing up packed BCD multiplication. It seems like it would be a useful thing, and packed BCD seems to be more common to begin ...
8086fan's user avatar
  • 43
7 votes
4 answers
2k views

Furthering my reading of MS BASIC and Woz's FP code and comparing the two leads to another question specific to the 6502... From what I can see looking over the 6502 instruction guides, it appears ...
Maury Markowitz's user avatar
18 votes
3 answers
2k views

I know the Atari's FP package used BCD for rather dubious reasons, but does anyone know of other examples of basic "operating system" level code on common platforms that used BCD? I suspect BCD was ...
Maury Markowitz's user avatar
4 votes
3 answers
733 views

Early computers often had hardware support for decimal arithmetic. This was usually in the form of BCD, 1 decimal digit per 4 bits, e.g. the 6502 and Z80, tightly constrained by transistor count as ...
rwallace's user avatar
  • 65.3k
6 votes
1 answer
1k views

I know from this answer that, Modern x86 CPUs are binary compatible with 8086. You can literally run 8086 binaries on a modern PC, in real mode. (The species analogy is a stretch here, but works if ...
Evan Carroll's user avatar
  • 3,516
6 votes
4 answers
2k views

I'm just curious if there was ever other instructions that were more ASCII-centric than the CISC associated ones we're left with now? Specifically, all the Binary Coded Decimal (BCD) instructions ...
Evan Carroll's user avatar
  • 3,516
20 votes
5 answers
5k views

The Z80 apparently had a 4-bit ALU, and computes 8-bit values in two stages. The half-carry bit preserves the carry from bits 3 to 4. Why did the designers of this chip choose to preserve that value ...
Omar and Lorraine's user avatar
14 votes
1 answer
5k views

The Ricoh 2A03 (and the 2A07) is the CPU in the well-known Nintendo Entertainment System. Apparently, the die is very similar indeed, as the slides in this video suggest https://www.youtube.com/watch?...
Omar and Lorraine's user avatar