News for hackers. Stuff that matters.
Re:Understanding the x86's Decimal Adjust after Addition (DA... by larusso on Tuesday January 31, 2023 @01:45AM (#34592030)
I honestly had no idea what this instruction is just by reading the title. While reading I had the „aha“ moment of: „wait a minute that sounds like decimal mode on the 6502“. I had to wrap my had around this once I tried to write an emulator for it (I didn’t end the project but I wasn‘t far off). I wondered about the use-cases but was too far down the well on how to implement it correctly to check for the history. Interesting to know that Intel etc had to keep a two step solution unlike the 6502 with its decimal mode flag. The posts example code makes more sense then the 6502 docs did back then. But it could also be cause I have an understanding about the problem it solves. Decimal mode didn’t click for me in the beginning because my brain tried to overcomplicate the idea of decimal mode :)
Re:Understanding the x86's Decimal Adjust after Addition (DA... by cesaref on Tuesday January 31, 2023 @04:05AM (#34592951)
Back in the 80s, writing 6502 with some other peeps one of the fun windups was when someone was away from their desk was to slip a SED instruction into their source in an obscure function that wasn't called that often.

If you get it right, they spend quite some time trying to track down why their code is misbehaving. A bit of misdirection (e.g 'oh, that target machine was giving problems yesterday, maybe the hardware is failing') can really help :)

Re:Understanding the x86's Decimal Adjust after Addition (DA... by larusso on Tuesday January 31, 2023 @10:42AM (#34596510)
That is pure evil. I like it :)