2
Name, Last name, Student #: 01.06.2017 I'" v~ j"d Grade/Toplarn 4 4 f3 PLO I PO<;: Karadeniz Technical University Faculty of Engineering Department of Computer Engineering COM/SiL 2000 Final Exam 1. Express in one sentence the basic advantage of using interrupt initiated data transfer over data transfer under program control without an interrupt. (33 points) 1*1 Kesme ile baslanlan veri aktanrrurun kesmesiz program denetimi ile yapilan veri aktanrruna gore temel avantajrru bir cumlede ifade ediniz. (33 puan) \}e.ri o.k.-\-o.'rClco.k C;\'o.z..ll"'\ 'vICiZ.\\" oll,.(~ oIVV'lCld'3''''t kOI'\-\-'('I:)\ e.tr't'\esi 5"l"ekW\eC:\\'§i ~f.i", da!"C\. 02. l<.C<~"CI\.c. l<..uIIQV\vY\C\.s' 2. It is necessary to transfer a 32KB data block from the buffer of a magnetic disk to a memory section starting from address 34A46 by means of 16-bit DMA transfer. 1*1 Bir manyetik disk tamponundan 32kB'llk bir blok verinin 3A4<:;6adresinden baslayan bir bellek kisrruna 16-bit DMA ile aktanlmasi gerekmektedir. a. Give the initial values that the CPU must transfer to the DMA controller. (33 points) 1*1 CPU'nun DMA denetleyiciye aktarmasi gereken baslanqu; deqerlertnl veriniz. (33 puan) 13<X~\c("'31C; Ctclas\ kctjd<diciSi.,e, 3ALfC dc.5c:.'t': vc:. blo\.. bojl..\ ~JcLcAisiV1e 32 \..~ /2. (16 b;\:\ik \)MA 6\'r o.~-tc.,.,..\••••. c\e~ 2. b~h~ Cl.k.t~r, ••. ) 1638t, 'QQ,uh.,... b. Give the step-by-step account of actions taken during the input of the first two words. (34 points) 1*1 ilk iki kelimenin okunrnasi sirasmda yaptlan eylemleri adirn adrrn veriniz. (34 puan) »MA d,•... eileji,d Cld r( S ~olul1~ sA4C o..dC'fSil'"li ~,k~T'" II"". II 1/ ~ ~2.Mo, i ~are.+i ile 1b bi+lik V~Y'i~i b~lle~e ~ct2.a r. adces I<-Cij d~ dici '5 i V\'I 2 Qrhrlr. " II blok bl)~fi l.c.l\jd ~c\\ ci s i V\ ; ~ atc:d+1Y , 1/ 1/ C\cl(~s ~o\t.(.., C\ 3 A4E: ad re5h""j C.,k~ yo I r. 'I ,/ , ; FC((e~ i i Ie \ b ~itlik , b~llej e Jct2.W\D. l/eYi~1 ~ Ct'Z.4.r. If II c.dr~s lC\ jd c c\ i c i s i 11'1 2 OIr{lY"I r, /1 1/ b \0 k bO~\A kCtJd eJ:c.\ s' t'\~ ~ QZC\ l.. h v: . I, II

v~ulutas/Courses/UnderGraduate/MicroProce… · (5 points) 1*1 Arguman olarak aktanlan iki 64-bit tarnsayidan kucuk olaru geri donduren bir assembly dili proqrarru kcdlaymrz. (5 puan)

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: v~ulutas/Courses/UnderGraduate/MicroProce… · (5 points) 1*1 Arguman olarak aktanlan iki 64-bit tarnsayidan kucuk olaru geri donduren bir assembly dili proqrarru kcdlaymrz. (5 puan)

Name, Last name, Student #: 01.06.2017

I'" v~j"d Grade/Toplarn

4 4 f3 PLO I PO<;:

Karadeniz Technical UniversityFaculty of Engineering

Department of Computer EngineeringCOM/SiL 2000 Final Exam

1. Express in one sentence the basic advantage of using interrupt initiated data transfer over data transfer under program control without aninterrupt. (33 points) 1*1 Kesme ile baslanlan veri aktanrrurun kesmesiz program denetimi ile yapilan veri aktanrruna gore temel avantajrrubir cumlede ifade ediniz. (33 puan)

\}e.ri o.k.-\-o.'rClco.k C;\'o.z..ll"'\ 'vICiZ.\\" oll,.(~ oIVV'lCld'3''''t kOI'\-\-'('I:)\ e.tr't'\esi 5"l"ekW\eC:\\'§i ~f.i", da!"C\.02. l<.C<~"CI\.c. l<..uIIQV\vY\C\.s'

2. It is necessary to transfer a 32KB data block from the buffer of a magnetic disk to a memory section starting from address 34A46 by meansof 16-bit DMA transfer. 1*1 Bir manyetik disk tamponundan 32 kB'llk bir blok verinin 3A4<:;6adresinden baslayan bir bellek kisrruna 16-bitDMA ile aktanlmasi gerekmektedir.

a. Give the initial values that the CPU must transfer to the DMA controller. (33 points) 1*1 CPU'nun DMA denetleyiciye aktarmasi gerekenbaslanqu; deqerlertnl veriniz. (33 puan)

13<X~\c("'31C; Ctclas\ kctjd<diciSi.,e, 3ALfC dc.5c:.'t': vc:. blo\.. bojl..\ ~JcLcAisiV1e32 \..~ /2. (16 b;\:\ik \)MA 6\'r o.~-tc.,.,..\••••.c\e~ 2. b~h~ Cl.k.t~r, ••.) 1638t, 'QQ,uh.,...

b. Give the step-by-step account of actions taken during the input of the first two words. (34 points) 1*1 ilk iki kelimenin okunrnasi sirasmdayaptlan eylemleri adirn adrrn veriniz. (34 puan)

»MA d, •...eileji,d Cld r ( S ~olul1~ sA4C o..dC'fSil'"li ~,k~T'" II"".

II 1/ ~ ~2.Mo, i ~are.+i ile 1b bi+lik V~Y'i~i b~lle~e ~ct2.a r.

adces I<-Cij d~ dici '5 iV\'I 2 Qrhrlr.

" II

blok bl)~fi l.c.l\jd ~c\\ci s iV\ ; ~ atc:d+1Y ,1/ 1/

C\cl(~s ~o\t.(.., C\ 3 A4E: ad re5h""j C.,k~ yo Ir.'I ,/

,

; FC((e~ i iIe \ b ~itlik , b~llej eJct2.W\D.

l/eYi~1 ~ Ct'Z.4.r.If II

c.dr~s lC\ jd c c\ ic is i11'1 2 OIr{lY"I r,/1 1/

b \0 k bO~\A kCtJd eJ:c.\ s' t'\~ ~ QZC\ l..h v: .I, II

Page 2: v~ulutas/Courses/UnderGraduate/MicroProce… · (5 points) 1*1 Arguman olarak aktanlan iki 64-bit tarnsayidan kucuk olaru geri donduren bir assembly dili proqrarru kcdlaymrz. (5 puan)

3.a. Assembly language runs extremely fast even though it is tedious to code with limited number of registers and instructions. That is why, it isreserved for critical sections of an algorithm which needs to respond very fast. On the other hand, high level programming languages runslower (compared to Assembly) but they are easier to learn and code. Both high level and low level languages can be used together by callingeach other's functions as an external function for improved efficiency. Explainin one sentence, the reason why fast call convention ispreferred by most of the modern compilers to pass arguments from a high level language (eg. C++)to a function coded in Assembly. (5points) f*f Srrurhsayida kaydedici ve emirleri ile Assembly dilinde kodlama cok zor olmasma kars: cahsrna hrz: cok yuksektir. Bu nedenle biralqorltrnarun cok hrzh cevap vermesi gereken kritik krsirnlan icln aynlmrstrr. Diger yandan yuksek seviyeli programlama dilleri, (Assemblydiline kiyasla) daha yavas ~all;;lr fakat ogrenmesi ve kodlanmasi daha kolaydir. Iyilestirllrnis verim lctn hem yuksek seviyeli hem de du;;ukseviyeli diller, diqer dildeki fonksiyonlan drsta (external) tarumlanan fonksiyon olarak ~aglrarak birlikte kullarulabllirler. Yuksek seviyelidillerden (orn, C++)Assembly dilinde kodlanrrus bir fonksiyona argumanlan qecirrnek icin neden modern derleyicilerin ~ogunditllzl!~aglrma (fast call) kuralmm tercih edildiqini bir cumlede aciklayrruz. (5 puan)

, .1 c 11'1,

b. Fill out Intel x86fx64 architecture register names corresponding toarguments and return value of functions used by 32f64-bit compilerswith fast call convention in the table below. (5 points) f*f Hrzh ~aglrma kurahm kullanan 32f64-bit derleyicilerin, arqurnanlar ve fonksiyongeri donus deqeri icin kullandiklan Intel x86/x&4 mimarisi kaydedici isimlerini asaqrdaki tabloda doldurunuz. (5 puan)

X64 reg. / kayo X86 reg. / kayo- ------- --.-.~~~--+--~~e C\,XReturn value / Geri donus deqerl

1stArgument / 1. Arquman rex e. c X-- --- --~-~

2nd Argument! 2. Arqurnan r d'X e d X

3~~~~g~~m~_=~n-t-/~_3~~~~rg~~-~~a-n~_-__ -_==-_~\_-8·--t---Y"'-~d-j1'X ~b i<;.;" c\~Yl(~irse

4t~~rgume_nt_/_~~~g~u~·m~a~n ._._'1_9 f' 9 d _ ) Q.ldc;..1'"\\W\o2. ':J'3'VlC44+ Argument / 4+ Arqurnan c;+c..c k s tGtck

._ ~ ~.___ ~~--L_. ~~~~ _

ka~c.\tc\tc.i ~l.~(i",d("i-ti \ ir.

C. Code an x64 assembly function to return the minimum of two 64-bit integers passed as arguments. (5 points) 1*1 Arguman olarak aktanlaniki 64-bit tarnsayidan kucuk olaru geri donduren bir assembly dili proqrarru kcdlaymrz. (5 puan)

CVV\p e c x I ec\'X CW\r e C ~ I ed 'X

. L1. i e. L1.j~ ve~a 'fV\oV €c\X I eelxrY\ 0" eO-X I e c X- I 1...2

\ \..2 yv'\?j I'V\ I:>e.d x Li', Y'Y\" V eo. x I e.c x

L~ : rr'lO v ecl.'x I L 2 ~ reo\:L. 2 " ret