flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > root directory(memory buffer problem) |
Author |
|
LocoDelAssembly 06 Oct 2008, 02:42
Quote:
I think you should post print and read_sectors too. Code: test byte[si+0x0b],1 shl 3 ;is it a volume label? |
|||
06 Oct 2008, 02:42 |
|
abuashraf 06 Oct 2008, 03:28
Code: read_sectors: @main: mov di,5 @sectorloop: push ax bx cx dx call lbachs mov ah, 0x02 ; BIOS read sector mov al, 0x01 ; read one sector mov ch, BYTE [track] ; track mov cl, BYTE [sector] ; sector mov dh, BYTE [head] ; head mov dl, 0 ; drive int 0x13 ; invoke BIOS jnc @success xor ax,ax int 0x13 dec di pop dx cx bx ax jnz @sectorloop int 0x18 @success: pop dx cx bx ax add bx,0x200 ;add 512 bytes to buffer inc ax loop @main ret Code: lbachs: push dx bx ax cx xor dx,dx mov bx, 18 div bx inc dx push dx xor dx,dx mov bx, 2 div bx mov cx,ax mov bx,dx pop ax mov [sector],al mov [head],bl mov [track],cl pop cx ax bx dx ret I'm pretty sure that this functions are fine,but I think I'm printing from the wrong address... Also I deleted the print function,no need for it. |
|||
06 Oct 2008, 03:28 |
|
LocoDelAssembly 06 Oct 2008, 03:42
With a quick look at the code seems to be OK, but I still don't see where do you set DS with the same value ES has (0x200).
For example, with the source you have shown so far "mov al,[si] ;the buffer address" accesses 0x????:SI address, where "????" means unknown. |
|||
06 Oct 2008, 03:42 |
|
sinsi 06 Oct 2008, 03:58
Yes, somewhere along the line you need
Code: mov bx,0x200 mov ds,bx Any reference to [si] assumes [ds:si] Instead of changing DS with the above code you can use [es:si], which is probably better. |
|||
06 Oct 2008, 03:58 |
|
abuashraf 07 Oct 2008, 02:07
Yeb...that was the problem,
thank you guys for your help. |
|||
07 Oct 2008, 02:07 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.