Assembly Code Explanation

I started to learn assembly. I came across these lines.

;*************************************************;
;   OEM Parameter block / BIOS Parameter Block
;*************************************************;

TIMES 0Bh-$+start DB 0

bpbBytesPerSector:      DW 512
bpbSectorsPerCluster:   DB 1
bpbReservedSectors:     DW 1

I got confused in the first line of the msgstr declaration "bpbBytesPerSector: DW 512". Here I think DW defines a word. So DW 512 means 512 words means 1024 bytes. Now the label is "bpbBytesPerSector". Bytes per sector should be 512 (this is what I think). Similarly, I cannot understand the following two lines. I am completely confused by this. Can someone explain to me. Thanks in advance.

+3
source share
2 answers

, dw 512. , 512.

BIOS (BPB) :

0000                         TIMES 0Bh-$+start DB 0     ; allocate 11 zero bytes.
000B  bpbBytesPerSector:     DW 512                     ; define one word 512
000D  bpbSectorsPerCluster:  DB 1                       ; define one byte 1
000E  bpbReservedSectors:    DW 1                       ; define one word 1
0010
+6

@paxdiablo, - . / 512 , , - :

myarray dw 512 dup(?)

512 - , ? - , ( "?" " ", , ).

0

Source: https://habr.com/ru/post/1773186/


All Articles