Guest User

Untitled

a guest
Mar 13th, 2010
387
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program bootloader<0x7C00>;
  2.  
  3. // 0x7C00 => ORG 0x7C00
  4.  
  5. type
  6.   FATEntry = record
  7.     Filename: Byte[8];
  8.     Extension: Byte[3];
  9.     Flags: Byte;
  10.     Reserved: Byte;
  11.     CrTime1: Byte;
  12.     CrTime2: Word;
  13.     CrDate: Word;
  14.     AcDate: Word;
  15.     Unused: Word;
  16.     ChTime: Word;
  17.     ChDate: Word;
  18.     Cluster: Word;
  19.     Size: DWord;
  20.   end;
  21.  
  22. var
  23.   fat: FATEntry;
  24.   globVar: Word;
  25.   Str: Byte[12] = 'Hallo Haze!',0;
  26.  
  27.   /*
  28.     Manche Features sind noch nicht in der EBNF aufgenommen
  29.     Wie z.B. die Initialisierung von globalen Variablen mit einem Wert. (s.o)
  30.    
  31.     Die Zahl in den Klammern hinter "codesec" gibt an, ob 16,32 oder 64 Bit Code
  32.     erzeugt werden soll.      
  33.   */
  34.  
  35. codesec<16>
  36.        
  37.   procedure BIOSPrint(Str: Word);
  38.   asm
  39.     mov si, Str
  40.     mov ah, 0x0E
  41.     .loop:
  42.       lodsb
  43.       or al, al
  44.       jz .lend
  45.       int 0x10
  46.       jmp .loop
  47.     .lend:
  48.   end;
  49.  
  50.   procedure SimplePrint(Str: Word);
  51.   var vid: DWord;
  52.   begin
  53.     vid := 0xB8000;
  54.     while Byte(Str)^ <> 0 do
  55.     begin
  56.       Byte(vid)^   := Byte(Str)^;
  57.       Byte(vid+1)^ := 0x0F;
  58.       vid := vid + 2;
  59.       Str := Str + 1;
  60.     end;
  61.   end;
  62.  
  63. begin
  64.   BIOSPrint(@Str[0]);
  65.   SimplePrint(@Str[0]);
  66.   asm
  67.     jmp $
  68.   end;
  69. end.
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×