There are various calculations we do while working with boot sector of a floppy, like
XOR DX,DX
DIVW 0x7C18
INC DL
MOV 0x7C3B, DL
XOR DX, DX
DIVW 0x7C1A
MOV 0x7C2A,DL
MOV 7C39,AX
RET
This is just a sample of code, as obvious there is much more calculations as we go through the code, we find various DIV and MUL instructions, My question is what we are trying to calculate, and how it will be calculated, Thanks
That specific piece of code is converting an LBA address into a CHS address.
An LBA address (or Linear Block Address) is where each sector on the disk is given a number from 0 to max. (e.g. from 0 to 2879 for a 1.44 KB floppy disk that has a total of 2880 sectors). A CHS address ("Cylinder, Head, Sector") is closer to how a floppy disk works mechanically (and is used by old BIOS disk functions) but is less convenient for higher level software.
The calculation is:
With common sub-expression elimination this becomes:
For other calculations, it's impossible to guess - I'd expect a few more pieces for disk IO (e.g. calculating how many sectors are needed from the size of a file in bytes); maybe some calculations for memory management (aligning things to page boundaries, converting real mode "segment:offset" into 32-bit physical addresses); maybe some for keeping track of time, ...