Einzelnen Beitrag anzeigen

sancho1980

Registriert seit: 7. Feb 2006
429 Beiträge
 
#12

Re: bootsektor schreiben

  Alt 3. Okt 2006, 13:49
also ich versteh immer noch nicht so ganz, was hier genau abgeht:

wie gesagt, die "hello cyberspace" nachricht bekomm ich jetzt..aber es schein als würde der das in einer endlosschleife auf den bildschirm schreiben..eigentlich sollte er ja sich aufhängen, wenn er am ende des strings angekommen ist...

ich hab jetz mal das programm etwas umgeändert und ein loop unrolling gemacht..um zu sehen was hier genau vorgeht..aber es tun sich mir immer neue rätsel auf..die abänderung ist folgendermaßen:

Zitat:
; start hellocyberspace.asm
; 2.ASM
; Print "Hello Cyberspace!" on the screen and hang

; Tell the compiler that this is offset 0.
; It isn't offset 0, but it will be after the jump.
[ORG 0]

jmp 07C0h:start ; Goto segment 07C0

; Declare the string that will be printed
msg db 'Hello Cyberspace!'


start:
; Update the segment registers
mov ax, cs
mov ds, ax
mov es, ax


mov si, msg ; Print msg


lodsb ; AL=memory contents at DS:SI

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

mov ah, 0Eh ; Print AL
mov bx, 7
int 10h

hang:
jmp hang

times 510-($-$$) db 0
dw 0AA55h
; end hellocyberspace.asm
wenn ich das vom stick boote, bekomm ich auf dem bildschirm (!!) folgendes:

LLLLLLLLLLLLLLLL

also 16 mal großes L...und das obwohl in 'Hello Cyberspace!' kein einziges großes L vorkommt!
was genau macht eigentlich int 10h? gibt es irgendwo eine liste aller interrupt handlers, in der steht, was da genau ausgeführt wird? vor dem interrupt-aufruf steht ja noch:

Zitat:
mov ah, 0Eh ; Print AL
mov bx, 7
int 10h
mir ist schleierhaft, was 0E in ah soll und wozu 7 in bx geladen wird...bitte erklärt mir das mal

und was hat es mit den folgenden drei mov-instructions auf sich:

Zitat:
; Update the segment registers
mov ax, cs
mov ds, ax
mov es, ax
wär echt nett wenn sich einer mal die zeit nimmt!

danke,

martin
Um Rekursion zu verstehen, muss man zunächst Rekursion verstehen.
  Mit Zitat antworten Zitat