Stories
Slash Boxes
Comments

SoylentNews is people

posted by janrinok on Saturday January 08 2022, @08:10PM   Printer-friendly
from the PC-introns dept.

https://www.os2museum.com/wp/unidentified-pc-dos-1-1-boot-sector-junk-identified/

Anyone trying to disassemble the PC DOS 1.1 boot sector soon notices that at offsets 1A3h through 1BEh there is a byte sequence that just does not belong. It appears to be a fragment of code, but it has no purpose in the boot sector and is never executed. So why is the sequence of junk bytes there, and where did it come from?

The immediate answer is "it came from FORMAT.COM". The junk is copied verbatim from FORMAT.COM to the boot sector. But those junk bytes are not part of FORMAT.COM, either. So the question merely shifts to "why are the junk bytes in FORMAT.COM, and where did they come from?"

It is not known if anyone answered the question in the past, but the answer has been found now, almost 40 years later—twice independently.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Interesting) by Snotnose on Saturday January 08 2022, @10:33PM (2 children)

    by Snotnose (1623) on Saturday January 08 2022, @10:33PM (#1211141)

    TRS-80, early model (type II? I forget). I disassembled the BASIC Z-80 assembly code. Lots of things like "jmp 0xsomewhere", except the code would jump to "some". In other words, the code would execute the first byte of a jump address.

    I never knew if I should bow down in front of Paul or Bill, but that code was A) magnificent; and B) unmaintainable.

    --
    My ducks are not in a row. I don't know where some of them are, and I'm pretty sure one of them is a turkey.
    Starting Score:    1  point
    Moderation   +1  
       Interesting=1, Total=1
    Extra 'Interesting' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 2) by driverless on Sunday January 09 2022, @02:43AM (1 child)

    by driverless (4770) on Sunday January 09 2022, @02:43AM (#1211178)

    That was a standard programming technique back then, you could bypass branches and/or individual instructions by prepending a byte that made the instruction that followed the operand of some no-op equivalent. Depending on whether you jumped to location n or n+1 you'd get a different effect.

    • (Score: 4, Informative) by Mojibake Tengu on Sunday January 09 2022, @03:28AM

      by Mojibake Tengu (8598) on Sunday January 09 2022, @03:28AM (#1211184) Journal

      This technique was common in assembly as imitation of procedures and subprograms with multiple entrypoints in certain high languages.

      When naive functionalists defeated sanity, the whole concept of procedures as subprograms (together with multiple entrypoints idea) vanished from this reality.

      --
      Respect Authorities. Know your social status. Woke responsibly.