• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

BPB in nasm

Hey I am trying to  put a bpb in my bootsec program so I can get to the disk in dos. Some one sent me some code, but it does not work in nasm. Here it is:
JMP label           ; 3 BYTES
bsOEM db 8 DUP(20h) ; OEM String
bsSectSize  dw 512  ; Bytes per sector
bsClustSize db 1    ; Sectors per cluster
bsRessect   dw 1    ; # of reserved sectors
bsFatCnt    db 2    ; # of fat copies
bsRootSize  dw 224  ; size of root directory
bsTotalSect dw 2880 ; total # of sects. if<32 meg
bsMedia     db 0xF0 ; Media Descriptor
bsFatSize   dw 9    ; Size of each FAT
bsTrackSect dw 18   ; Sectors per track
bsHeadCnt   dw 2    ; number of read-write heads
bsHidenSect dd 0    ; number of hidden sectors
bsHugeSect  dd 0    ; if bsTotalSect is 0 this
                    ; value is the number of
                    ; sectors
bsBootDrv   db 0    ; holds drive that the bs
                    ; came from
bsReserv    db 0    ; not used for anything
bsBootSign  db 29h  ; boot signature 29h
bsVolID     dd 0    ; Disk volume ID
bsVoLabel   db 11 DUP(20h) ; Volume Label
bsFSType    db "FAT12   "  ; File System type
                           ; 8 BYTES
nasm complains about DUP(20h)
What should I do?
  • 2
1 Solution
bsVoLabel times 20h db 11

in nasm, times is the functional equivalent for dup, and can do much more...
argh sorry....

it should be
bsVoLabel times 11 db 20h

and the bsOEM 8 dup(20h) should be
bsOEM times 8 db 20h

just to confirm: 8 dup(20h) means
20h, 20h, ...20h (8 times) correct?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The Firewall Audit Checklist

Preparing for a firewall audit today is almost impossible.
AlgoSec, together with some of the largest global organizations and auditors, has created a checklist to follow when preparing for your firewall audit. Simplify risk mitigation while staying compliant all of the time!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now