Einzelnen Beitrag anzeigen

neolithos

Registriert seit: 31. Jul 2003
Ort: Dresden
1.386 Beiträge
 
Delphi 7 Architect
 
#1

BootSector selbstbau [ASM16]

  Alt 19. Nov 2003, 16:52
Ich versuche gerade zu verstehen wie so ein kleiner Boot-Sector tickt. Dazu habe ich das folgende Testprogramm geschrieben.
Dummerweise gehen aber die Interrupt rufe schief! Warum?

Code:
;
;
; Boot-Code
;
org 07C0h
bootsector:
   jmp   skip_data

        db 'TSTSYS',0,1 ; OEM-ID
banner: db 'TST-Sys 0.1 sagt Hallo Welt!', 10, 13
      db 'Das Sytem steht...'
size:   dw $-banner
skip_data:
   mov ax, cs
   mov ds, ax
   mov ss, ax
   mov sp, 4 * 512 
   ; Melde dich
   mov bl, 0FFh
   call beep
;
; Ausgabe einer Meldung mit Hilfe eines BIOS-Aufrufs
;
   mov ah,03h      ; Lesen der Cursor-Position
   xor bh,bh
   int 10h

   mov ah, 09h
   xor bh, bh
   mov al, '#'
   mov cx, 40
   mov bl, 07h
   int 10h
   

   mov cx, [size]   
   mov bx,000Ah ; page 0, attribute 10 (Hg:Schwarz, Schrift: Grün)
   mov ax, 07c0h
   mov es, ax
   mov bp, banner
   mov ax, 1301h   ; Ausgabe des Textes, Cursor bewegen
   int 10h

   mov bl, 0FFh
   call beep
   
    hlt
beep:   
   push ax
   push cx
   mov al,0B6h          ; Set up square wave
   out 43h,al
   mov ax,528h          ; Tone
   out 42h,al
   mov al,ah            ; Tone
   out 42h,al
   in al,61h
   push ax
   or AL,3
   out 61h,AL            ; Turn speaker on
   xor CX,CX

BEEP_1: LOOP BEEP_1
   dec bl
   jnz BEEP_1
   pop ax
   out 61h, al            ; Turn speaker off
   pop cx
   pop ax
   ret
   
unused:
   times bootsector+510-$ db 0

mark:
   dw 0aa55h
- ciao neo -
Es gibt niemals dumme Fragen, sondern nur dumme Antworten!
  Mit Zitat antworten Zitat