Sponsored Links


Results 1 to 4 of 4

Thread: CS401 Computer Architecture and Assembly Language Assignmnet 6 Deadline 22 July 2010

  1. #1
    Senior Member viki's Avatar
    Join Date
    May 2010
    Posts
    2,132

    Adrive2 CS401 Computer Architecture and Assembly Language Assignmnet 6 Deadline 22 July 2010

    Sponsored Links1


    Assignment

    Write assembly language program that get the attribute of an existing file and also modify its hidden attribute.


    What to Submit:
    Submit Microsoft Word document containing the assembly language code for the above mentioned program.

    Sponsored Links
    :o:o--------------------------------------------------------------------------------------:o:o
    [B]The more knowledge you have, the greater will be your fear of Allah.[/B]

    Please Join My [B]Group Vuhelp[/B][B], Birthday Wishing, Daily Hadees[/B] [CODE][B]http://vuhelp.net/groups/vuhelp.html[/B]
    [B]http://vuhelp.net/groups/birthday-wishing.html[/B]
    [B]http://vuhelp.net/groups/daily-hadees.html[/B][/CODE]
    [CENTER][B][COLOR="Red"][SIZE="4"]Email: [email]viki@vuhelp.net[/email][/SIZE][/COLOR][/B][/CENTER]

  2. #2
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,239
    That's good to know this assignment has been uploaded. Lets see what happen.

  3. #3
    Senior Member viki's Avatar
    Join Date
    May 2010
    Posts
    2,132
    hona kiya hai dear all the same jasy har assignment main hota hia
    :o:o--------------------------------------------------------------------------------------:o:o
    [B]The more knowledge you have, the greater will be your fear of Allah.[/B]

    Please Join My [B]Group Vuhelp[/B][B], Birthday Wishing, Daily Hadees[/B] [CODE][B]http://vuhelp.net/groups/vuhelp.html[/B]
    [B]http://vuhelp.net/groups/birthday-wishing.html[/B]
    [B]http://vuhelp.net/groups/daily-hadees.html[/B][/CODE]
    [CENTER][B][COLOR="Red"][SIZE="4"]Email: [email]viki@vuhelp.net[/email][/SIZE][/COLOR][/B][/CENTER]

  4. #4
    Senior Member viki's Avatar
    Join Date
    May 2010
    Posts
    2,132

    Adrive2 Idea Solution Try To Make Your Self

    13.3.8.12 Change/Get File Attributes
    Function (ah): 43h
    Entry parameters:
    al- Subfunction code
    0- Return file attributes in cx
    1- Set file attributes to those in cx
    cx- Attribute to be set if AL=01
    ds:dx- address of pathname
    Exit parameters:
    If carry set,
    ax contains one of the following error codes:
    1- Invalid function
    3- Pathname not found
    5- Access denied
    If the carry is clear and the subfunction was zero,
    cx will contain the file's attributes.
    This call is useful for setting/resetting and reading a file's attribute bits. It can be used to set a file to read-only, set/clear the archive bit, or otherwise mess around with the file attributes.



    2nd code
    To create a file if it does not exist or leave it on 0 length if it exists, Handle.
    Call registers:
    AH = 3CH
    CH = File attribute
    DSX = Pointer to an ASCII specification.
    Return registers:
    CF = 0 and AX the assigned number to handle if there is no error, in case there is, CF ill be 1 and AX will contain the error code: 3 path not found, 4 there This function substitutes the 16H function. The name of the file is specified on an ASCII chain, which has as a characteristic being a conventional chain of bytes ended with a 0 character.
    The file created will contain the attributes defined on the CX register in the following manner:
    Value Attributes
    00H Normal
    02H Hidden
    04H System
    06H Hidden and of system
    The file is created with the reading and writing permissions. It is not possible to create directories using this function.



    3rdcode

    Create/Truncate File
    Code:
    C:\>debug
    -a 0100
    xxxx:0100 mov ah,3c     ;Create file func.
    xxxx:0102 mov cx,2      ;Archive file attribute
    xxxx:0105 mov dx,010f   ;Points to filename
    xxxx:0108 int 21        ;Do it
    xxxx:010A mov ax,4c00
    xxxx:010D int 21
    xxxx:010F db "C:\Users\jakash3\newfile1.txt",00
    -n mkf.com
    -r cx
    CX 0000
    :002D
    -w
    Writing 001A bytes.
    -q
    Note:
    File attributes are specified by the hex value of a bit array.
    0 1 2 3 4 5 6 7
    +---+---+---+---+---+---+---+---+
    | ? | ? | ? | 0 | 0 | ? | 0 | 0 |
    +---+---+---+---+---+---+---+---+
    0 – Read Only
    1 – Hidden
    2 – System
    3 – Volume label (ignored)
    4 – Reserved, must be zero (directory)
    5 – Archive
    6 – Unused
    7 – Unused
    A Read-Only Archive file: 10000100
    In hex that would be: 84
    So 84 would be the value for CX in the 3C function of Int 21.

    4th code.
    File Attributes

    Bit Hex Description
    7 6 5 4 3 2 1 0
    . . . . . . . 1 01 Read-only
    . . . . . . 1 . 02 Hidden
    . . . . . 1 . . 04 System
    . . . . 1 . . . 08 Volume label
    . . . 1 . . . . 10 Directory
    . . 1 . . . . . 20 Archive

    Read-only Files that are marked as read-only can be read, but
    not altered. Attempts to open read-only files for
    output, or to create a file with the same name,
    result in an error. Read-only files do appear in
    normal directory searches, however.

    Hidden Hidden files do not appear in DOS's directory
    listings, nor do they appear in normal file
    searches.

    System
    Marks files that are used by the system, such as
    IBMBIO.COM and IBMSYS.COM. Such files do not appear
    in normal file searches.

    Volume label Used for the 11-character volume label on a disk.
    All other information in a volume label's directory
    entry is ignored. Volume labels are not files, per
    se--they use one entry in the directory, but have no
    additional data.

    Directory The directory entry refers to a subdirectory.
    Subdirectories are normally excluded from file
    searches.

    Archive This bit, when set, indicates that the file has been
    changed since the last time it was backed up. This
    bit is set whenever a file is written to and then
    closed.

    Bits 6, 7 These bits are reserved for future use and must be
    set to 0.

    --------------------------------------------------------------------------

    Notes: File searches with the search attribute set to 0
    will find all files with no attribute, or files with
    the read-only and/or archive attribute set.

    The directory and volume-label bits cannot be
    changed using the CHMOD function (43h) DOS call.
    Last edited by viki; 07-21-2010 at 03:06 PM.
    :o:o--------------------------------------------------------------------------------------:o:o
    [B]The more knowledge you have, the greater will be your fear of Allah.[/B]

    Please Join My [B]Group Vuhelp[/B][B], Birthday Wishing, Daily Hadees[/B] [CODE][B]http://vuhelp.net/groups/vuhelp.html[/B]
    [B]http://vuhelp.net/groups/birthday-wishing.html[/B]
    [B]http://vuhelp.net/groups/daily-hadees.html[/B][/CODE]
    [CENTER][B][COLOR="Red"][SIZE="4"]Email: [email]viki@vuhelp.net[/email][/SIZE][/COLOR][/B][/CENTER]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 07-04-2012, 11:33 PM
  2. Replies: 4
    Last Post: 11-23-2010, 01:04 PM
  3. Replies: 2
    Last Post: 08-14-2010, 06:49 AM
  4. Replies: 2
    Last Post: 07-27-2010, 10:29 PM
  5. Replies: 0
    Last Post: 05-11-2010, 12:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft