Memory access from various files on floppy in Assembly

100 views Asked by At


I can't resolve my problem with memory mapping on the floppy when I try to access to it from assembly.
BTW, there are bare bones of my OS project.

main.asm:

start:
mov ax, 07C0h
mov ds, ax

mov ah, 02h
mov al, 1
mov ch, 0
mov cl, 2
mov dh, 0
mov bx, 0x0500
mov es, bx
xor bx, bx
int 0x13 ; read second sector

jmp 0x0500:0 ; Everything work good
times 510 - ($ - $$) db 0
db 0x55
db 0xAA

Everything work for now.

second.asm:
mov ax, 0x0500
mov ds, ax
xor si, si

mov ah, 0Eh
mov al, [msg]
int 0x10 ; It's work

jmp end ; Im avoid variable declaration because this stopping program (can you explain me why?)
msg db 'y'
end:

And now, in the third file, I'm trying to print another variable but it's printing random character.

third.asm:
mov ah, 0Eh
mov al, [msg2] ; This don't print my var
int 0x10

jmp $
msg2 db 'b'

Every file I'm recording to the floppy image and booting in qemu-system-i386 emulator for Linux.

0

There are 0 answers