Sponsored Links


Results 1 to 3 of 3

Thread: cs401 Computer Architecture and Assembly Language Assignment No. 03 June 2012

  1. #1
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578

    Icon2 cs401 Computer Architecture and Assembly Language Assignment No. 03 June 2012

    Sponsored Links1


    Question:

    DC motor (fig 1) is operated through two terminals, whenever the potential difference is created (through batteries, cells etc) across these terminals the motor starts its motion.





    Suppose we have connected a DC motor to our system’s parallel port through a secure circuitry (fig 3).

    Sponsored Links

    We wish to operate the DC motor through our parallel port (fig 2) using some input through our keyboard. Like “F” key for running motor in “Forward Direction”, “R” for “Reverse Direction”, “S” for “Stop” and “E” for “Exit from code”.

    We have suggested that we will use parallel port’s Pin 2 and Pin 3 (the last 2 pins of parallel port’s data check fig 2 and table 1).


    Pin 2 Pin 3 Outcome
    0 0 Stop
    0 1 Forward
    1 0 Reverse
    1 1 No Operation
    Table 1

    You have to write a code in assembly language that take an input character from keyboard (S, F, R and E) and on the basis of these characters transmit the code (with respect to the truth table) to the parallel port to operate that connected DC motor.
    Attached Files Attached Files

  2. #2
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578
    03345705890


    contact this number for assignment

  3. #3
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578
    ; show scancode on external LEDs connected through parallel port
    Code:
    [org 0x0100]
    jmp  start
    
    oldisr:       dd   0                  ; space for saving old ISR
    
    ; keyboard interrupt service routine
    kbisr:        push ax
    push dx
    
    in   al, 0×60           ; read char from keyboard port
    mov  dx, 0×378
    out  dx, al             ; write char to parallel port
    
    pop  ax
    pop  dx
    jmp  far [cs:oldisr]    ; call original ISR
    
    start:        xor  ax, ax
    mov  es, ax             ; point es to IVT base
    mov  ax, [es:9*4]
    mov  [oldisr], ax       ; save offset of old routine
    mov  ax, [es:9*4+2]
    mov  [oldisr+2], ax     ; save segment of old routine
    cli                     ; disable interrupts
    mov  word [es:9*4], kbisr ; store offset at n*4
    mov  [es:9*4+2], cs     ; store segment at n*4+2
    sti                     ; enable interrupts
    
    mov  dx, start          ; end of resident portion
    add  dx, 15             ; round up to next para
    
    and keyboard comprisan code for this problems are
    
    e = 0×012
    
    r= 0×13
    
    f= 0×21
    
    s=0x1f

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 05-22-2014, 02:48 PM
  2. Replies: 0
    Last Post: 11-22-2012, 02:18 PM
  3. Replies: 0
    Last Post: 11-06-2012, 04:02 PM
  4. Replies: 4
    Last Post: 07-03-2012, 11:01 PM
  5. Replies: 11
    Last Post: 01-20-2011, 03:27 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