Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   BootSector selbstbau [ASM16] (https://www.delphipraxis.net/12054-bootsector-selbstbau-%5Basm16%5D.html)

neolithos 19. Nov 2003 16:52


BootSector selbstbau [ASM16]
 
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

d3g 19. Nov 2003 21:26

Re: BootSector selbstbau [ASM16]
 
Ich bin jetzt ja nicht so die Assembler-Leuchte, aber hier mein Kommentar.
Zitat:

Zitat von neolithos
Delphi-Quellcode:
;
; Ausgabe einer Meldung mit Hilfe eines BIOS-Aufrufs
;
   mov   ah,03h      ; Feststellen der Cursor-Position
   xor   bh,bh
   int   10h

Der hier scheint mir richtig, wenn auch sinnlos.

Zitat:

Zitat von neolithos
Delphi-Quellcode:
   mov     ah, 09h
   xor     bh, bh
   mov     al, '#'
   mov     cx, 40
   mov     bl, 07h
   int     10h

Der hier scheint mir auch richtig zu sein und sogar nicht sinnlos *g*

Zitat:

Zitat von neolithos
Delphi-Quellcode:
   mov   cx,47   
   mov   bx,000Ah ; page 0, attribute 10 (Hg:Schwarz, Schrift: Grün
   mov   ax, banner
   mov   es,ax
   mov   bp,0
   mov   ax,1301h   ; Ausgabe des Textes, Cursor bewegen
   int   10h

Aus dem werde ich nicht schlau: ES:BP soll auf den String zeigen, aber bei dir zeigt es auf AX:0, wo die Parameter für int 10h stehen. Außerdem müssen die Strings in der Definition doch mit '$' abgeschlossen sein, oder? Und dann ist da noch die Big-Endian/Little-Endian-Frage ist bei AX=1301h nun AL oder AH gleich 13h?

neolithos 19. Nov 2003 21:53

Re: BootSector selbstbau [ASM16]
 
Habe es etwas abgeändert!

Siehe ersten Thread!
Trotzdem piept es nur zweimal und kein Text erscheint! :wall:

Warum? :(


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:06 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz