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

GDB – Graded Discussion Board CS401 – Computer Architecture & Assembly Language Programming GDB Topic Suppose we have to call the following two subroutines in our assembly code: Bubblesort_S Bubblesort_R There are two basic techniques in order to pass parameters into a subroutine: stack-based and register-based. Bubblesort_S subroutine uses the stack-based technique and Bubblesort_R subroutine uses the register-based approach. Now you are required to choose that which subroutine you will use in your assembly program in order to obtain the following features: The operation must be faster The limited number of parameters Justify your answer with valid reasons. GDB’s Instructions Provide precise and to the point answer, not more than 5 to 6 lines, avoid irrelevant details. Post your answer on the Graded Discussion Board (GDB), not on the Moderated Discussion Board (MDB). GDB will only be open for 48 hours, no more time or grace day will be provided. GDB cannot be accepted via email after the due date. Copy from the internet or other student will get zero marks

+ 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: 2467

.

+ 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)

Replies to This Discussion

come discuss plzzz??

Read Hand out following heading for answer
5.5. PARAMETER PASSING THROUGH STACK

??????

Bubble sort-r

Because it uses register based approach 

registers will always be fastest, because that is where execution "takes place". but registers are VERY limited in terms of storage. e.g. x86 processors only had 4 general purpose registers you could store things in to, and even those were dual-purposed for certain thing.The maximum parameters a subroutine can receive are seven when all the general registers are used. Also, with the subroutines are themselves limited in their use of registers, and this limited increases when the subroutine has to make a nested call thereby using certain registers as its parameters. Due to this, parameter passing by registers is not expandable and generalizable. However this is the fastest mechanism available for passing parameters and is used where speed is important.

baqi khud explain kro

in this case register base subroutine is better to use

Register-based is much faster because the registers where data is stored are directly located on the CPU. Where a stack-based implementation would have to push/pop data from memory (RAM) which is a much slower process. Registers are the fastest possible memory access you can get. 

disadvantage of the call stack mechanism is the increased cost of a procedure call and its matching return The extra cost includes incrementing and decrementing the stack pointer , and accessing the local variables and parameters by frame-relative addresses, instead of absolute addresses. The cost may be realized in increased execution time, or increased processor complexity, or both.

solution

Attachments:

dear Bushra

               plz help me my id and password not work properly bcz some people change my ID and Password not wrok. please help me my brother angry with me .plz help me 

Asslam-u-Alaikum

send you email through your VU email Id they will fix that, or just send your e-mail to misuse@vu.edu.pk they will help you.

Regards,

Omer

v funny..atleast dont guide others wrongly,,

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...','$'

RSS

Latest Activity

Purple Work replied to + M.Tariq Malik's discussion MGT503 Assignment No 01 Fall 2019 Solution & Discussion in the group MGT503 Principles of Management
12 minutes ago
Rameesha joined + M.Tariq Malik's group
12 minutes ago
Rameesha replied to + M.Tariq Malik's discussion MGT211 GDB Fall 2019 Solution & Discussion in the group MGT211 Introduction To Business
14 minutes ago
Rameesha joined + M.Tariq Malik's group
15 minutes ago
ghazni replied to + M.Tariq Malik's discussion CS311 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 15-11-2019 in the group CS311 Introduction to Web Services Development
17 minutes ago
ghazni joined + M.Tariq Malik's group
17 minutes ago
Rameesha posted a status
"Plz moje b reply kar do koi"
24 minutes ago
ghazni left a comment for Nabeel Ahmed
24 minutes ago
= + = Handsom MunDa# updated their profile
26 minutes ago
Sana fatima replied to + M.Tariq Malik's discussion CS304 Assignment No 01 Fall 2019 Solution & Discussion in the group CS304 Object Oriented Programming
26 minutes ago
Rameesha replied to + M.Tariq Malik's discussion Criteria Required for Award Badges, Featured Members & Moderators
30 minutes ago
Rameesha posted a status
"Plz send me solution of assignment no 1 of mth202"
37 minutes ago
Rameesha commented on + M.Tariq Malik's page Past Papers
38 minutes ago
Hamza - BCS (6th) and Saleem Maheen are now friends
41 minutes ago
Rameesha liked Ayaat's profile
42 minutes ago
Rameesha left a comment for Ayaat
42 minutes ago
Uzma liked + M.Tariq Malik's group PSY101 Introduction to Psychology
44 minutes ago
Waseem Aziz added a discussion to the group MGMT627 Project Management
47 minutes ago
Rameesha posted a status
"Plz send me the solution of mgt211 gdb's solution"
47 minutes ago
Waseem Aziz joined + M.Tariq Malik's group
50 minutes ago

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

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