From d3d7dd43e8947fa046dec7480f776b5741a37f0a Mon Sep 17 00:00:00 2001 From: mothcompute <94941435+mothcompute@users.noreply.github.com> Date: Thu, 9 Jun 2022 03:31:57 -0700 Subject: [PATCH] make bootable --- boot.s | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 boot.s diff --git a/boot.s b/boot.s new file mode 100644 index 0000000..7b02c2a --- /dev/null +++ b/boot.s @@ -0,0 +1,41 @@ +; assemble this and concatenate sp2.com with it to make it bootable! + +[org 0x7C00] +[bits 16] + +NUMSEG equ (1993/512)+1 ; filesize is 1993 bytes + +mov ax, 0x100 +mov ss, ax +mov ds, ax +mov es, ax +mov gs, ax +mov fs, ax +mov bp, 0xF000 +mov sp, bp + +mov bx, 0x100 +mov al, NUMSEG +inc ah +mov cl, ah +xor ch, ch +xor dh, dh +int 13h + +xor cx, cx +mov ds, cx +mov word [ds:0x21*4], int21 +mov word [ds:0x21*4+2], 0 + +inc ch +mov ds, cx +push 0x100 +push 0x100 +retf + +int21: +hlt + +times 510 - ($-$$) db 0 + +dw 0xAA55