; SPDX-License-Identifier: WTFPL ; nasm sertest.asm -o sertest.img section .text use16 jmp short start nop ; disk description table (to emulate floppy) db "TESTCODE" ; OEMLabel dw 512 ; BytesPerSector db 1 ; SectorsPerCluster dw 1 ; ReservedForBoot db 2 ; NumberOfFats dw 224 ; RootDirEntries dw 2880 ; LogicalSectors db 0f0h ; MediumByte dw 9 ; SectorsPerFat dw 18 ; SectorsPerTrack dw 2 ; Sides dd 0 ; HiddenSectors dd 0 ; LargeSectors dw 0 ; DriveNo db 41 ; Signature dd 0 ; VolumeID db "TESTCODE000" ; VolumeLabel db "FAT12 " ; FileSystem start: xor dx, dx ; com0 mov al, '>' call put_char wait_for_key: xor ah, ah int 16h cmp al, '0' jb wait_for_key cmp al, '7' jg wait_for_key call put_char ; bit[0:3] of al: baudrate value ; 000 110 ; 001 150 ; 010 300 ; 011 600 ; 100 1200 ; 101 2400 ; 110 4800 ; 111 9600 set_baudrate: shl al, 5 or al, 03h xor ah, ah int 14h mov cx, 64 wait_for_tx: mov ah, 3 int 14h test ah, 20h jz wait_for_tx send_character: mov al, 'U' mov ah, 1 int 14h loop wait_for_tx jmp wait_for_key put_char: mov ah, 0eh xor bh, bh int 10h ret ; end of boot sector and blank contents times 510 - ($ - $$) db 0 dw 0aa55h times (2879 * 512) db 0xe5