Talk:Getting Started

From SizeCoding
Revision as of 13:09, 4 June 2021 by Maroonbells (talk | contribs) (Initial AX/BX register values)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Initial register values AX=0000 and BX=0000 is not 100% correct. Through several DOS versions, I've observed them to be:

AH=see explanation AL=see explanation BX=AX

The value for AL is linked to the 1st command line parameter, and the value for AH is linked to the 2nd parameter. The value for AL is 00 unless the 1st command line parameter begins with a path pointing to an unmapped drive letter. The value for AH is created the same way, except for linking to the 2nd command line parameter instead of the 1st. examples:

program.com foo bar or program.com

AX=0000 because of the 1st or 2nd command line parameters neither are/begin-with drive letters

program.com z: program.com foo z: Assuming the Z drive is not mapped, the 1st example sets AX=00FF, while the 2nd example sets AX=FF00.

In all examples, the BX register is defined to match whatever value was placed into AX.