We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Computer Architecture and Assembly Language Programming (CS401)

Assignment # 03

 

Total marks = 20                                       Deadline Date

20th of July,

2017

 

Please carefully read the following instructions before attempting assignment.

 

RULES FOR MARKING

It should be clear that your assignment would not get any credit if:

  • The assignment is submitted after the due date.
  • The submitted assignment does not open or file is corrupt.
  • Strict action will be taken if submitted solution is copied from any other student or from the internet.

 

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

 

You are supposed to submit your assignment in .doc or docx format.

Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.

 

Topic Covered:

·         BIOS and DOS interrupts

·         Hardware Interrupts

·         Ports

NOTE

 

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

 

If you people find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

 

For any query, feel free to email at:

cs401@vu.edu.pk

 

 

Questions No 01                                                    20 marks

 

Suppose, you are interfacing an old monochrome dot matrix printer (receipt printer) with your computer’s parallel port. The stated dot matrix printer will print receipts character wise, so the system will transmit each character parallelly.

 

The printer will be operated as under:

 

1. First, you should select the printer by setting “select printer” pin on your parallel port.

2. Initialize printer by sending initialize signal.

3. Read “acknowledge” pin.

4. Transmit ASCII character data to the data port of the parallel port.

5. Clear initialize signal.

6. Deselect printer.

 

You should write a subroutine to print

 

“Welcome to Virtual University of Pakistan”

 

Your subroutine will get each character as an input from keyboard using interrupt mechanism and transmit it to the printer port according to the stated working mechanism.

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 11212

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Attachments:

Replies to This Discussion

bhai lecture b 2 bar soun liye hain google b itna kiya hai samjh hi nahi arahi

semajh aya gee bhee nahi ..... kiun kay yeah solution kahen per nahi hai...... sara net chaan mara kaheen printing kaa code nahi mil....

mila too yeah mila

prnstr macro msg
mov ah, 09h
lea dx, msg
int 21h
endm

data segment
msg1 db "Enter string to be printed : $"
msg2 db 0dh, 0ah, "I/O Error or Paper out...$"
msg3 db 0ah, "Printing string...$"
buf db 80
db 0
db 80 dup(' ')
data ends

code segment
assume cs:code, ds:data, es:data
start :
mov ax, data
mov ds, ax
mov es, ax

prnstr msg1
mov ah, 0ah
lea dx, buf
int 21h
mov si, offset buf + 2
mov ch, 00h
mov cl, byte ptr [si-1]

mov dx, 0000h
again :
mov ah, 02h
int 17h

test ah, 00101001b
jz cont
prnstr msg2
jmp again
cont :
mov ah, 00h
mov dx, 0000h
next :
mov ah, 00h
mov al, [si]
int 17h
inc si
loop next

mov ax, 4c00h
int 21h
code ends
end start

hope this will work

Abh tk solution nh mla????

LED ONN OFF WALAY PROGRAM KE EXTIONTENTION HA YEH SAWAL...

cs401 idea solution

Attachments:

copied

bhia 
thnx

Please uplod solution 

cs401 Idea Solution
subroutine Idea COmplet Your Own
;;;;CODE;;;;
busy bit P1.5
strobe bit P1.4
portData equ P2
;
org 0h
start:
call word_Welcome ; to print ' Welcome To '
call enter ; new line feed
call word_Lab ; to print ' Computer Laboratory '
call enter ; new line feed
;
quit: sjmp Quit ; Hang Forever until reset pressed
;
;===========================================================
;This subroutine is used to print single character
;trough Port Data
;before printing a character,a busy signal must be detected
;till a low logic received, than a strobe ( --__-- ) pulse
;must be generate to starts printing a character.

BITS 16 ;Set code generation to 16 bit mode
ORG 0x0100 ;Set code start address to 0000h

MAIN:
jmp START

DISP:
mov ah,09h ;String Print int service
int 21h
ret

OFF:
mov al,00h ;All LEDs OFF
mov dx, 378h
out dx, al
jmp MAIN
ON:
mov al,0FFh ;All LEDs ON
mov dx, 378h
out dx, al

START:
lea dx,[msg1] ;Display message
call DISP
mov ah, 01h ;keyboard interrupt
int 21h
cmp al,'1' ;press 1 to ON
je ON
cmp al,'0' ;press 0 to OFF
je OFF
END:
mov al, 00h ;OFF LEDs and motor
mov dx, 378h
out dx, al
mov ah, 4Ch ;End of program
int 21h

section .data
msg1 db 13,10,'Press 1/0(press any key to exit): ','$'

; Description : A simple example of
;parallel interfacing file programmed

bits 16 ; Set 16 bit code generation
org 0x0100 ; Set code start address to ; 100h (COM file)


MAIN:
jmp START ; Jump to label 'START'

DISPLAY: ; Subroutine program
lea dx,[msg1] ; string print
mov ah,09h ; service no 09h
int $21 ; interrupt 21h
ret

DELAY: ;Delay program
MOV CX, 01Fh ;outer loop
.NEXT: MOV BX,0FFFFH ;inner loop
.NEXT2: NOP
NOP
NOP
DEC BX
JNZ .NEXT2
LOOP .NEXT
RET

END: ;Define label 'END'
mov ah, $4C ;service no =4ch
int $21
ret ;return to calling

PATTERN:
;1st pattern
mov dx,$378 ;set data port address
mov al,$03 ;set two LEDs ON
out dx,al ;output to data port
call DELAY ;call delay subroutine


;2nd pattern
mov dx,$378 ;set data port address
mov al,$02 ;set one LED = OFF, another LED=ON
out dx,al ;output to data port
call DELAY ;call delay subroutine
;3rd pattern
mov dx,$378 ;set data port address
mov al,$01 ;set one LED = ON, another LED=OFF
out dx,al ;output to data port
call DELAY ;call delay subroutine
;4th pattern
mov dx,$378 ;set data port address
mov al,$00 ;set two LEDs = OFF
out dx,al ;output to data port
call DELAY ;call delay subroutine
ret

START:
call DISPLAY ; display message on screen
call PATTERN ; display pattern
call END ; end program

section .data
msg1 db 13,10,Program running? ','$'

BITS 16 ;Set code generation to 16 bit mode
ORG 0x0100 ;Set code start address to 0000h


[section .text]

MAIN:
jmp START

DISP:
mov ah,09h ;String Print int service
int 21h
ret


ON2:
lea dx,[msg3] ;Display message
call DISP
mov al,0F0h ;2nd 7-seg ON
mov dx, 378h
out dx, al
jmp MAIN

ON1:
lea dx,[msg2] ;Display message
call DISP
mov al,0Fh ;1st 7-seg ON
mov dx, 378h
out dx, al


START:
lea dx,[msg1] ;Display message
call DISP

mov ah, 01h ;keyboard interrupt
int 21h

cmp al,'1' ;press 1 to ON1
je ON1
cmp al,'2' ;press 2 to ON2
je ON2

END:
mov al, 00h ;LEDs OFF
mov dx, 378h
out dx, al
mov ah, 4Ch ;End of program
int 21h

section .data
msg1 db 13,10,'Press 1/0: ','$'
msg2 db 13,10,'First 7-SEG ON...','$'
msg3 db 13,10,'Second 7-SEG ON...','$'

koi solution upload kr do 

is this solution is right ? plz guide us . humble request to you all :( 

RSS

Latest Activity

Ateeqa replied to + M.Tariq Malik's discussion رزلٹ آنے پر آپ لوگوں کے لئے ہمت افزا تحریر
43 minutes ago
stylo posted a discussion
1 hour ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! AG + liked Balaj Naveed's discussion mth622
3 hours ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! AG + liked иαвєєℓ αнмє∂'s discussion !!!!!"Aey Dil Tumhari MaRzI"!!!!
3 hours ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! AG + liked + M.Tariq Malik's discussion رزلٹ آنے پر آپ لوگوں کے لئے ہمت افزا تحریر
3 hours ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! AG + liked + ! ! ! ! PsyChO ! ! ! ! +'s discussion kya aysa kisi or k sath b hai?????????
3 hours ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! AG + liked ♦_"Tooba"_♦'s discussion ""Izzat nafas ka byaan""
3 hours ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! AG + liked + "αяsαℓ " Ќąƶµяɨ •"'s discussion Why should i quit smoking :P
3 hours ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! AG + liked + Drama Queen ! ! ! ! ! ! ! ! !'s discussion ❤️❤️❤️❤️❤️HapPiii BIrthday INNO BHAI ❤️❤️❤️❤️❤️❤️ Our Beloved MOD!!!!!!❤️❤️❤️❤️❤️❤️❤️❤️❤️
3 hours ago
+ ! ! AɳƓєℓ ❥ liked Balaj Naveed's discussion mth622
5 hours ago
+ ! ! AɳƓєℓ ❥ liked + M.Tariq Malik's discussion رزلٹ آنے پر آپ لوگوں کے لئے ہمت افزا تحریر
5 hours ago
+ ! ! AɳƓєℓ ❥ liked + ! ! ! ! PsyChO ! ! ! ! +'s discussion kya aysa kisi or k sath b hai?????????
5 hours ago

Today Top Members 

© 2020   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.