flat assembler
Message board for the users of flat assembler.

Index > Main > Where is the misstake?

Author
Thread Post new topic Reply to topic
joachim_neu



Joined: 22 Dec 2003
Posts: 139
joachim_neu 02 Mar 2004, 20:04
Hello,

this code should load 5 sectors from the drive and write it into the monitor. But it don't work... There comes only a beep in WIN and then it ends... This is the code:

Code:

; Load
load:

; Diskdrive reset (Interrupt 13h, 0)
push ds            ; Save DS
mov ax, 0          ; The function (reset)
mov dl, 0          ; This drive
int 13h            ; run the interrupt
pop ds             ; DS recover
jc load            ; Misstake? Again!

load1:
mov ax,0x1000      ; ES:BX = 10000
mov es,ax
mov bx, 0

; read sectors (Interrupt 13h, 2)
mov ah, 2       ; Function 2 (Lesen)
mov al, 5       ; read 5 Sectors
mov cx, 2       ; Cylinder=0, Sector=2
mov dx, 0       ; Head=0, Laufwerk=0
int 13h         ; ES:BX =  Dates of the drive
jc load1        ; misstake? again!

mov ax,0x1000
mov es,ax
mov BP, 0
mov AH,13h
mov AL,0h
mov BL,0h
mov BH,0h
mov CX,0xA00
mov DH,0
mov DL,0
int 10h

    


please help me, I don't find the misstake...

JOACHIM NEU
Post 02 Mar 2004, 20:04
View user's profile Send private message Visit poster's website Reply with quote
S.T.A.S.



Joined: 09 Jan 2004
Posts: 173
Location: Ru#27
S.T.A.S. 03 Mar 2004, 07:59
I guess you have win NT/2k/XP
Post 03 Mar 2004, 07:59
View user's profile Send private message Reply with quote
Rookie



Joined: 21 Aug 2003
Posts: 44
Location: Planet Romania
Rookie 03 Mar 2004, 09:02
Int the NT series, and later 2K&up, you do not have direct access to the system's resources (including access to physical sectors of your HDD), and this is exactly what you are trying to do, as you are using interrupts, not the Windows API. If you don't have a Win9x distribution, a DOS diskette should suffice (if you don't have one of that either, just goolge for 'Win98SE Startup Disk' and download an FD image that you can either write to a FD or use in virtual machine software like Bochs).
Plus, mistake is spelled with only one s (you asked us to let you know about your mistake).

I know all I've done is repeat what S.T.A.S. said, but when you're 13 and learning programming you have a lot of why-s in your head, that need ample answers (at least I had).

_________________
This is who I choose to be.
Post 03 Mar 2004, 09:02
View user's profile Send private message Reply with quote
joachim_neu



Joined: 22 Dec 2003
Posts: 139
joachim_neu 03 Mar 2004, 15:49
hello,

i startet the programm with a DOS-floppy but it still didn't work. it seems that it is writing on the monitor and the cursor jumps, but there comes only black in stead of white text or letters... mybe you can help me again...

JOACHIM NEU
Post 03 Mar 2004, 15:49
View user's profile Send private message Visit poster's website Reply with quote
S.T.A.S.



Joined: 09 Jan 2004
Posts: 173
Location: Ru#27
S.T.A.S. 04 Mar 2004, 21:34
Hi, joachim_neu.

Your program consist of two patrts. The first step to solve problem is to localize it.
Try to fill your buffer with some ASCII chars, don't read from drive.
If you'll see some symbols on screen, then problem is with reading sectors.
Otherwise, there's something wrong with your last call to BIOS.
I'm not sure why you use "mov BH,0h". Also, what does 0h in "mov BL,0h" mean for int 10h/AH=13h?
Post 04 Mar 2004, 21:34
View user's profile Send private message Reply with quote
joachim_neu



Joined: 22 Dec 2003
Posts: 139
joachim_neu 05 Mar 2004, 11:33
hello,

my code was right, the only mistake was that I set BX in the outputpart in 0h, so that that, what was written onto the monitor was in black letters and on black background, so you couldn't see it... But how may I write a string into the ram, my buffer???
Post 05 Mar 2004, 11:33
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.