I have slightly modified your code to work with FASM. Hope this helps. According to the MS Terms of Service, you are not allowed to create an OS with MASM. Therefore, it is not recommended to do it, and then advertise in open chat. But FASM works great. Here is your "fixed" code so you can compile it into FASM.
use16 format binary org 7c00h ; Boot entry point. Address 07c0:0000 on the computer memory somelabel: xor ax, ax ; Zero out ax mov ds, ax ; Set data segment to base of RAM jmp start ; Jump to the first byte after DOS boot record data ; -------------------------------------- ; DOS boot record data ; -------------------------------------- brINT13Flag db 90h ; 0002h - 0EH for INT13 AH=42 READ brOEM db 'FASMv1.6' ; 0003h - OEM name & LOS version (8 chars) brBPS dw 512 ; 000Bh - Bytes/sector brSPC db 1 ; 000Dh - Sectors/cluster brResCount dw 1 ; 000Eh - Reserved (boot) sectors brFATs db 2 ; 0010h - FAT copies brRootEntries dw 0E0h ; 0011h - Root directory entries brSectorCount dw 2880 ; 0013h - Sectors in volume, < 32MB brMedia db 240 ; 0015h - Media descriptor brSPF dw 9 ; 0016h - Sectors per FAT brSPH dw 18 ; 0018h - Sectors per track brHPC dw 2 ; 001Ah - Number of Heads brHidden dd 0 ; 001Ch - Hidden sectors brSectors dd 0 ; 0020h - Total number of sectors db 0 ; 0024h - Physical drive no. db 0 ; 0025h - Reserved (FAT32) db 29h ; 0026h - Extended boot record sig brSerialNum dd 404F18EAh ; 0027h - Volume serial number (random) brLabel db 'FASM_DISK_1' ; 002Bh - Volume label (11 chars) brFSID db 'FAT12 ' ; 0036h - File System ID (8 chars) ;------------------------------------------- ; Boot code ; ------------------------------------------ msg1 db ' This is a test of FASM 1.6',0 start: mov ax,msg1 MOV si,ax display11: lodsb test al, al jnz disp0 jmp finish disp0: mov ah, 0xE mov bx, 7 int 10h jmp display11 finish: jmp $ ;This tells times to compare the end here with the ;beginning up there called somelabel ( NOTE : entry by ;itself is not allowed because FASM uses it. ) ; ------------------------------------ ; Boot record signature ; ------------------------------------ size equ $ + somelabel times (512 - size - 2) db 0 ;needed to padd the first 512 sector with 0's ;AFTER the jmp $ command. ( size equ $+entry ) ;then is takes size away from 512 as well as ;takes 2 bytes away for the boot sig and your done. dw 0AA55h ; Boot record signature
Compile this with FASM 1.6+ and it will become the name of the file you named, and also turn it into a BIN file. I use PowerISO to create CD images, and it allows you to insert a BIN file so that you can make the CD bootable. (TIP: It will show that you have only BIF files of your choice, just select. And in any case, select the BIN file and you will go there.) Then use the free virtual virtual machine VM to mount and test the CD .:-)
source share