News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Writing to hard disk

Started by nurul, July 16, 2005, 05:59:03 AM

Previous topic - Next topic

nurul

Hi all,

I have a small assignment that my lecturer gave me about writing an array into memory in hard disk or floppy disk. Can anybody help me because i'm just learn assembler.
Thanks..

hutch--

nurul,

Its a very simple task but members will not do your homework for you. Tell us what you have learnt and what you are learning and someone may be able to help you. Is it 16 or 32 bit assembler ? Is it for Windows or for DOS ?
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Jeff

here's a list of API functions that you will find useful:
CreateFile  (create/open a file)
WriteFile  (write to the file)
CloseHandle  (close the file)

nurul

Sorry...
I'm doing it for 16 bit in DOS. I found out we can use int 13H . can it be implemented?

hutch--

OK,

You must have some course guidelines to work by, which assembler and how much do you know so far.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

loveprince

hi guys i have something as him, itried to work it but it dowsnt write the text to the file i specfied

here is the code i did:

;append some text to a file
   prints msg2                                ; printing some text that ask the user to write what he wants to add to the file
   mov ah, 0ah                                ; and then storing it in a string named appnd
   lea dx, appnd
   int 21h
   mov ah, 42h                          ; this the part where i am facing the problem
   mov bx , handle                     ; i am workingaccordingto the steps given in the norton guide
   lea dx, appnd                        ; where ah = 42h the function, ds:dx the offset from the start<<< i think this the mistake
   mov al, 2                               ;al is from where i wana to add
   int 21h
   jc err
   mov AH,3Eh
                mov BX ,handle                 ; this for closing the handle ??>>>i dont know if it right or know to close it
   int 21h


please help us in resloving this problem i dont have much time left

thanks