electronics lab help (need screen shots of lab) - 62095

Request Posted by


Request Detail
Price: $15
  • From: ,
  • Due on: Tue 22 Apr, 2014 (09:41pm)
  • Asked on: Tue 22 Apr, 2014
  • Due date has passed, but you can still Post Solution.

Lab 5

  1. Watch videos entitled “Introduction” and “Procedures
  2. Using the microprocessor simulator, open the program 06proc.asm.
  3. Step through its execution to understand its current operation.
  4. Modify the traffic light program from Module 4 to utilize the code in 06proc.asm to establish a realistic time delay.
  5. Include all of the following in a Word document entitled “Lab5_StudentID”. Where your student id is substituted in the file name.
    • A screenshot of the modified assembly code
    • A few screenshots that show the traffic lights on Port 1 as the program is stepped through

      Module 4 traffic light program:

            CLO          ; close unwanted windows


                 MOV BL,10    ; START BL REGISTER AT 10

                              ; TURN OFF ALL TRAFFIC LIGHTS

                 MOV AL,10    ; COPY 00000000 INTO THE AL REGISTER

                 OUT 01       ; SEND AL TO PORT ON


         MOV BL,0A ; BL=TEN


                                                               ; TURN RED LIGHTS ON

                               MOV AL,90            ; COPY 10010000 INTO THE AL REGISTER

                               OUT 01                  ; SEND AL TO PORT ONE

                               MOV AL,10            ; DELAY


                                                               ; TURN ON AMBER LIGHTS

                              MOV AL,48             ; COPY 01001000 INTO THE AL REGISTER

                              OUT 01                   ; SEND AL TO PORT ONE

                              MOV AL,10              ; DELAY


                                                                ; TURN ON GREEN LIGHTS

                              MOV AL,24               ; COPY 00100100 INTO AL REGISTER

                              OUT 01                    ; SEND AL TO PORT ONE

                              MOV AL,10              ; DELAY


                              DEC BL                    ; SUBTRACT ONE FROM BL

                               JNZ LOOP              ; JUMP BACK TO LOOP IF BL WAS NOT ZERO

                              END                          ; PROGRAM ENDS



      ; When the procedure terminates, the CPU registers are
      ; restored to the same values that were present before
      ; the procedure was called. Push, Pop, Pushf and Popf
      ; are used to achieve this. In this example one procedure

      ; is re-used three times. This re-use is one of the main
      ; advantages of using procedures.

      ;------ The Main Program ----------------------------------------
          MOV    AL,8    ; A short delay.

          CALL    30    ; Call the procedure at address [30]

          MOV    AL,10    ; A middle sized delay.
          CALL    30    ; Call the procedure at address [30]

          MOV    AL,20    ; A Longer delay.
          CALL    30    ; Call the procedure at address [30]

      JMP    Start    ; Jump back to the start.

      ; ----- Time Delay Procedure Stored At Address [30] -------------
          ORG    30    ; Generate machine code from address [30]

          PUSH    AL    ; Save AL on the stack.
          PUSHF        ; Save the CPU flags on the stack.
          DEC    AL    ; Subtract one from AL.
          JNZ    REP    ; Jump back to Rep if AL was not Zero.

          POPF        ; Restore the CPU flags from the stack.
          POP    AL    ; Restore AL from the stack.

          RET        ; Return from the procedure.
      ; ---------------------------------------------------------------
      ; ---------------------------------------------------------------


      15)    Re-do the traffic lights program and use this procedure
          to set up realistic time delays. 02tlight.asm

      16)    Re-do the text input and display program with procedures.
          Use one procedure to input the text and one to display it.

      ; ---------------------------------------------------------------

    • Additional Software

      Microprocessor Simulator - Version 5.0 - http://www.softwareforeducation.com/

      Microsoft Visual C++ 2010 Express

Please Login or Register to Submit the Solution for the Request