Je fais une affectation de programmation système mais je suis confronté à un léger problème.assembly charger un programme à partir d'un secteur et retourner
J'ai réussi à écrire mon secteur de démarrage et capable d'appeler un autre secteur que j'ai lu en utilisant int 13. Toutes les instructions s'exécutent et le code revient au secteur de démarrage.
Mais je ne peux pas accéder à ma variable déclarée dans le deuxième secteur à utiliser dans le secteur 2
ici est le code
[bits 16]
[org 0x7c00]
mov ah,2
mov al,1 ;Number of sectors to read
mov ch,0 ;Cylinder number (10 bit value; upper 2 bits in CL)
mov cl,2 ;Starting sector number
mov dh,0 ;Head number
mov dl,0 ;Drive number
mov bx,cs
mov es,bx
mov bx,here
int 13h
jc error
call here
error:
mov ah,0eh
mov al,'E'
mov bl,7
mov bh,0
int 10h
jmp $
exit:
mov ah,0eh
mov al,'F'
mov bl,7
mov bh,0
int 10h
jmp $
here:
jmp $
times 510 - ($-$$) db 0
dw 0xaa55
Sector2.asm
[bits 16]
mov bx,cs
mov ds,bx
jmp start
msg db "Welcome to my OSD",0
start:
mov si,0
mov si,msg
mov ah,0eh
mov al,':'
int 10h
mov ah,0eh
mov al,[si] ;; HERE IS THE PROBLEM IT PRINTS GARBAGE
int 10h
inc si
mov ah,0eh
mov al,[si] ;; HERE IS THE PROBLEM IT PRINTS GARBAGE
int 10h
inc si
mov ah,0eh
mov al,[si] ;; HERE IS THE PROBLEM IT PRINTS GARBAGE
int 10h
ret
times 510-($-$$) db 0
dw 0x0055