Lord Orwell
Mar 2nd, 2001, 03:18 AM
I am not nearly as good a programmer in c++ as i am in vb. I would like to make a c++ .dll that does this:
it would incorporate the following in-line assembly:
Int 21h Function 440Dh Minor Code 61h (FAT32)
[Windows 95 only.]
Reads data from a track on the specified device and places the data in memory.
mov bx, Drive ;See below
mov ch, DeviceCat ;See below
mov cl, 61h ;Read track on logical drive
mov dx, seg ReadBlock ;See below
mov ds, dx
mov dx, offset ReadBlock ;ds:dx points to RWBLOCK structure
mov ax, 440Dh ;IOCTL for block device
int 21h
jc error_handler ;carry set means error
Parameters
Drive
Specifies the drive to be read from (0 = default drive, 1 = A, 2 = B, and so on).
DeviceCat
Specifies a FAT16, FAT12 or FAT32 drive. Value Description
08h FAT16 or FAT12 drive. (Will fail on a FAT32 drive).
48h FAT32, FAT16, or FAT12 drive. This value is supported on Windows 95 OEM Service Release 2 and later.
ReadBlock
Points to an RWBLOCK structure that contains information specifying the sectors to be read from. The RWBLOCK structure has the following form:
RWBLOCK STRUC
rwSpecFunc db 0 ;special functions (must be zero)
rwHead dw ? ;head to read/write
rwCylinder dw ? ;cylinder to read/write
rwFirstSector dw ? ;first sector to read/write
rwSectors dw ? ;number of sectors to read/write
rwBuffer dd ? ;address of buffer for read/write data
RWBLOCK ENDS
Basically, i want to make this in-line assembly into a function. If anyone can show me (or better yet, post the source code to do this) then let me know. I am trying to convert a program i wrote in dos that called interrupts, and have yet to be able to call interrupts with vb. A c++ dll can, however. If i just had a sub to read a disk sector, and another to write a disk sector, i would be in business.
If someone were to write the .dll for me, i would have no problem using them in the credits as a co-author. I plan on releasing the program as shareware. There could be a potential future financial gain in it for you.
The best design for the .dll would be one that would take one parameter for each register and one for the interrupt to call. That way, i could write sectors, etc. all with the same function.
Any takers?
it would incorporate the following in-line assembly:
Int 21h Function 440Dh Minor Code 61h (FAT32)
[Windows 95 only.]
Reads data from a track on the specified device and places the data in memory.
mov bx, Drive ;See below
mov ch, DeviceCat ;See below
mov cl, 61h ;Read track on logical drive
mov dx, seg ReadBlock ;See below
mov ds, dx
mov dx, offset ReadBlock ;ds:dx points to RWBLOCK structure
mov ax, 440Dh ;IOCTL for block device
int 21h
jc error_handler ;carry set means error
Parameters
Drive
Specifies the drive to be read from (0 = default drive, 1 = A, 2 = B, and so on).
DeviceCat
Specifies a FAT16, FAT12 or FAT32 drive. Value Description
08h FAT16 or FAT12 drive. (Will fail on a FAT32 drive).
48h FAT32, FAT16, or FAT12 drive. This value is supported on Windows 95 OEM Service Release 2 and later.
ReadBlock
Points to an RWBLOCK structure that contains information specifying the sectors to be read from. The RWBLOCK structure has the following form:
RWBLOCK STRUC
rwSpecFunc db 0 ;special functions (must be zero)
rwHead dw ? ;head to read/write
rwCylinder dw ? ;cylinder to read/write
rwFirstSector dw ? ;first sector to read/write
rwSectors dw ? ;number of sectors to read/write
rwBuffer dd ? ;address of buffer for read/write data
RWBLOCK ENDS
Basically, i want to make this in-line assembly into a function. If anyone can show me (or better yet, post the source code to do this) then let me know. I am trying to convert a program i wrote in dos that called interrupts, and have yet to be able to call interrupts with vb. A c++ dll can, however. If i just had a sub to read a disk sector, and another to write a disk sector, i would be in business.
If someone were to write the .dll for me, i would have no problem using them in the credits as a co-author. I plan on releasing the program as shareware. There could be a potential future financial gain in it for you.
The best design for the .dll would be one that would take one parameter for each register and one for the interrupt to call. That way, i could write sectors, etc. all with the same function.
Any takers?