Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program bootloader<0x7C00>;
- // 0x7C00 => ORG 0x7C00
- type
- FATEntry = record
- Filename: Byte[8];
- Extension: Byte[3];
- Flags: Byte;
- Reserved: Byte;
- CrTime1: Byte;
- CrTime2: Word;
- CrDate: Word;
- AcDate: Word;
- Unused: Word;
- ChTime: Word;
- ChDate: Word;
- Cluster: Word;
- Size: DWord;
- end;
- var
- fat: FATEntry;
- globVar: Word;
- Str: Byte[12] = 'Hallo Haze!',0;
- /*
- Manche Features sind noch nicht in der EBNF aufgenommen
- Wie z.B. die Initialisierung von globalen Variablen mit einem Wert. (s.o)
- Die Zahl in den Klammern hinter "codesec" gibt an, ob 16,32 oder 64 Bit Code
- erzeugt werden soll.
- */
- codesec<16>
- procedure BIOSPrint(Str: Word);
- asm
- mov si, Str
- mov ah, 0x0E
- .loop:
- lodsb
- or al, al
- jz .lend
- int 0x10
- jmp .loop
- .lend:
- end;
- procedure SimplePrint(Str: Word);
- var vid: DWord;
- begin
- vid := 0xB8000;
- while Byte(Str)^ <> 0 do
- begin
- Byte(vid)^ := Byte(Str)^;
- Byte(vid+1)^ := 0x0F;
- vid := vid + 2;
- Str := Str + 1;
- end;
- end;
- begin
- BIOSPrint(@Str[0]);
- SimplePrint(@Str[0]);
- asm
- jmp $
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement