Because the first sector is only 512 bytes while the rest of the code is huge, I think I need a separated assembler code for the .lst file. I'm not sure that this is called binding but I want to bind this assembler file when I make a .img file with NASM.
first one
ORG 0x7c00
start:
JMP entry
DB 0x90
; Start of BIOS Parameter Block
DB "MyOS "
DW 512
DB 1
DW 1
DB 2
DW 224
DW 2880
DB 0xf0
DW 9
DW 18
DW 2
DD 0
DD 2880
DB 0,0,0x29
DD 0xffffffff
DB "MyOS-Vol "
DB "FAT12 "
TIMES 18 DB 0
; End of BIOS Parameter Block
entry:
MOV AX, 0
MOV SS,AX
MOV SP,0x7c00
MOV DS,AX
MOV ES,AX
MOV SI,msg
loop:
MOV AL,BYTE [SI]
ADD SI, 1
CMP AL,0
JE fin
MOV AH, 0x0e
MOV BX, 0xe1
INT 0x10
JMP putloop
fin:
HLT
JMP fin
msg:
DB 0x0a, 0x0a
DB "hello, world"
DB 0x0a
DB 0
maker:
TIMES 0x01fe-(maker-start) DB 0
DB 0x55, 0xaa
second one
DB 0xf0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00
TIMES 4600 DB 0
DB 0xf0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00
TIMES 1469432 DB 0
How can I append second code to first code? Not by copy-pasting the text but like when it links the object file together.
For those who are looking for fat12 disk format. DOS Boot Record Format for FAT12 and FAT16