Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Self-modifying code
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Notes== {{reflist|group="nb"|refs= {{r|group="nb"|name="NB_DR-DOS_386"|r=For example, when running on [[i386|386]] or higher processors, later [[Novell DOS 7]] updates<!-- not the early updates, and not OpenDOS 7.01 --> as well as [[DR-DOS 7.02]]<!-- actually since Matthias R. Paul's Alpha 1 --> and higher will dynamically replace some default sequences of 16-bit <code>REP MOVSW</code> ("copy words") instructions in the kernel's runtime image by 32-bit <code>REP MOVSD</code> ("copy double-words") instructions when copying data from one memory location to another (and half the count of necessary repetitions) in order to speed up disk data transfers. [[Edge case]]s such as odd counts are taken care of.<ref name="Caldera_1997_DOSSRC"/><ref name="Paul_1997_OD-A3"/>}} {{r|group="nb"|name="NB_DR-DOS_707"|r=As an example, the [[DR-DOS]] [[master boot record|MBR]]s and [[volume boot record|boot sector]]s (which also hold the [[partition table]] and [[BIOS Parameter Block]], leaving less than 446<!-- MBR --> respectively 423<!-- 512-87-2 (ignoring the 3-byte-jump which can be counted as code) in the case of FAT32, a bit more with FAT12/FAT16 --> bytes for the code) were traditionally able to locate the boot file in the [[FAT12]] or [[FAT16]] file system by themselves and load it into memory as a whole, in contrast to their [[MS-DOS]]/[[PC DOS]] counterparts, which instead relied on the system files to occupy the first two directory entries in the file system and the first three sectors of [[IBMBIO.COM]] to be stored at the start of the data area in contiguous sectors containing a secondary loader to load the remainder of the file into memory (requiring [[SYS (DOS command)|SYS]] to take care of all these conditions). When [[FAT32]] and [[logical block addressing|LBA]] support was added, [[Microsoft]] even switched to require [[Intel 80386|386]] instructions and split the boot code over two sectors for size reasons, which was not an option for DR-DOS as it would have broken [[backward compatibility|backward]]- and cross-compatibility with other operating systems in [[multi-boot]] and [[chain load]] scenarios, as well as with older [[IBM PC compatible|PC]]s. Instead, the [[DR-DOS 7.07]] boot sectors resorted to self-modifying code, [[opcode]]-level programming in [[machine language]], controlled utilization of (documented) [[side effect (computer science)|side effect]]s, multi-level data/code [[instruction overlapping|overlapping]] and algorithmic [[fold (function)|fold]]ing techniques to still fit everything into a physical sector of only 512 bytes without giving up any of their extended functionality<!-- and adding some more -->.}} {{r|group="nb"|name="NB_CHOICE"|r=Later versions of DOS (since version 6.0) introduced the external [[CHOICE (DOS command)|CHOICE]] command (in [[DR-DOS]]<!-- 6.0 and higher --> also the internal command and [[CONFIG.SYS]] directive [[SWITCH (CONFIG.SYS directive)|SWITCH]]), so, for this specific example application of a menu system, it was no longer necessary to refer to self-modifying batchjobs, however for other applications it continued to be a viable solution.}} }}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)