> JLIU@ 0Qbjbj %"Q&
&
&
&
&
&
&
:
:
9866666eee////Ke/38$D:R<8&
C"e 8&
&
66
8
&
6&
6/ / d!h-&
&
.6*ɕ"
<./809T.`L=, RL=0.:
:
&
&
&
&
L=&
.Pey eee88:
:
D~
:
:
COE 205, Term 043
Computer Organization & Assembly ProgrammingProgramming Assignment# 3
Due date: Monday, August 8, 2005
You are required to write an 8086 assembly program to implement a pseudo random generator using Liner Feedback Shift Register (LFSR). An example of an 8-bit LFSR is shown below:
Two important characteristics of an LFSR are the Feedback Polynomial, which determines the FFs that are XORed to compute the shifted bit, and the seed which determines the initial content of the FFs. Depending on the Feedback polynomial, the LFSR can generate a maximal-length sequence without repetition, or it may not. The seed can be any number other than 0.
The 8-bit LFSR shown above is a maximal-length i.e. it is guaranteed to generate a random sequence in the range from 1 to 255 before it repeats again.
The Feedback polynomial for the above LFSR can be represented as 10001101. Note that 1 indicates that there is feedback connection, while 0 indicates that there is no feedback connection.
Write a procedure, RAND8, that implements an 8-bit pseudo random generator. The procedure should be given the Feedback polynomial, and the seed, and it should generate the next random number. Assume that the Feedback polynomial and the seed are passed on the stack such that the Feedback polynoimal is pushed first followed by the seed. Assume also that the generated number will be returned on the stack in the same place of the Feedback polynomial while the seed position is freed.
Write a macro that displays the content of an 8-bit register in decimal.
Using the procedure and macro in (i) and (ii), generate the first 256 random numbers that will be obtained from the feedabck polynomial 10001101 and an initial seed of 00000001. Determine that it generates 255 different numbers before it repeats.
Using the procedure and macro in (i) and (ii), generate the first 256 random numbers that will be obtained from the feedabck polynomial 10001101 and an initial seed of 1010101. Determine that it generates 255 different numbers before it repeats.
Using the procedure and macro in (i) and (ii), generate the first 256 random numbers that will be obtained from the feedabck polynomial 10000001 and an initial seed of 00000001. Determine if this feedback polynomial is maximal sequence or not. Justify your answer.
Ask the user to enter a feedback ploynomial and a seed. Then, ask the user to enter a string of characters. Then, encrypt the string using RAND8 as follows. Each character is encrypted by XORing the least significant 4-bits of the ASCII code of the character with the lest significant 4 bits of the generated random number. For example, assume the character to be encrypted is A=41H and the random number is AAH. Then, the encrypted character will have the ASCII code 4BH = K. To decrypt the character, the decrypted character 4BH=character K, will be XORed with the same corresponding random number used for encryption i.e. AA and this will generate the original character 41H= character A. As an example show the encryption of the string Hello COE-205!!. Then, rerun your program giving it the encrypted string and it should correctly decrypt it to Hello COE-205!!. Try this with the feedback polynomial 10001101 and a seed of 10101010.
The solution should be well organized and your program should be well documented. Submit a soft copy of your solution in a zip file. The soft copy should include a Readme file indicating the file names containing the solution and whether it works or not. The Readme file should also contain your name and ID. Submit both source code file (i.e. .asm) and the executable file (i.e. .exe).
@VXY[eklmntuv{|}~
3 4 8 F
M
h
i
79·͡·͙{{{whHUh|jhq/CJUhkhq/h^=h]}wh]}wCJaJhk5CJ\aJh3N5CJ\aJh|e5CJ\aJh]^5CJ\aJh]}w5CJ\aJhHUCJaJhkCJaJh]^CJaJh]}wCJaJhOICJaJ.[}~0 1 2 3 5 6 7 8
:
(h^hgd$
&F
a$gd|$a$gd'N$a$gd|gdq/gd]^gdkQ9ef"*4
(^RgoOPQĳhh|CJaJhh]^5CJ\aJh]^56CJ\]aJ hP'h]^56CJ\]aJh56CJ\]aJh]}w56CJ\]aJhhq/hhHUh]}wh|h'Nhk+PQgd$^a$gd]^
&F
&F
gd# 0&P/ =!"#$%@@@Normal_HmHnHsH tH u\@\Heading 1,Question$$@&a$CJKHaJR@R Heading 2$$x@&^a$CJaJuR@R Heading 3$
&F<@&5CJ\aJX@X Heading 4$
&F<@&56CJ\]aJP@P Heading 5
&F<@&CJOJQJaJV@V Heading 6
&F<@&6CJOJQJ]aJH@H Heading 7
&F<@&OJQJN@N Heading 8
&F<@&6]OJQJV @V Heading 9
&F<@&6CJOJQJ]aJDA@DDefault Paragraph FontVi@VTable Normal :V44
la(k(No List6O6 Dspace-NI
`LOLDspace$dhx*$`a$CJaJ6O6Author$a$CJaJO"Figuren$
&Fh>T0Figurea$F>@2FTitle$<a$5CJ KH\aJ&P$@BPEnvelope Address
$^CJaJOR
References$
&F
hhdhx>Th[]^h`a$CJaJHC@bHBody Text Indent
`CJOr
Definitionh
&F>T
0Definition`DOD Sspace.NI$
a$CJaJOQ Questionso@d>T8@Q..^@`OListai>T8h()^`O Question1c
&F@& >T2B@2 Body TextCJ:P@:Body Text 2CJaJQ"[}~01235678:( PS00000000000000000
0
0
0
00
0
0000x0xPS{00
0%T9QQ
Q8ae@-dV(
T nd
d#"Z ld
cldZ l
blB` h|
#l
4
hH
"4
| ZB
SDH
`
#
B
B
@ `B
c$D@ZB
SDZ |
a|B
B
W|`B
c$DW`B
c$Dkt
##"4
4
@ ZB
SD@ZB
SD`B
+
c$DdTB
1
CD<[PTB
4
CD^xn PD
8#"nbB2
9
PDTB
:
CDPDTB
;B
CD@@xn PD
G#"(nbB2
H
PDTB
I
CDPDTB
JB
CD@@ZB
K
SD;ZB
M
SD;ZB
NB
SD^<^TB
QB
CD^^ZB
WB
SDZ<ZZB
[
SDlxn PD
\#"nbB2
]
PDTB
^
CDPDTB
_B
CD@@ZB
`
SDOB
S ?3Qd$d47X~"eS|S8*urn:schemas-microsoft-com:office:smarttagsdate20058DayMonthYearSS[~8
SS Aseel NET Aseel NET Aseel NET Aseel NET Aseel NET Aseel NET Aseel NET Aseel NET
coe-aimaneAiman pflI`KhH]:()!"}8b-z2?/=b2d#\b
dS..@0^`056CJOJQJo(Q..@P^`P56CJOJQJo(()@P0^P`0.@
0^
`0)@0^`0()@0^`0()@0^`0()@`0^``0()@00^0`0()^`5o(.hh^h`56.808^8`0o(()^`.pLp^p`L.@@^@`.^`.L^`L.^`.^`.PLP^P`L.0 0^`0o(()^`.0 L ^ `L.^`.xx^x`.0HLH^H`L.^`.^`.0L^`L.0^`05o(()^`o(.@P^`P56CJOJQJo(()@P0^P`0.@
0^
`0)@0^`0()@0^`0()@0^`0()@`0^``0()@00^0`0() 88^8`5o(()`P^`P56CJOJQJo(()`P0^P`0.`
0^
`0)`0^`0()`0^`0()0`0^`0()``0^``0()0`00^0`0()@h^`56CJOJQJo(()
Id#\-d#\4b?/=pf
dS)!] hX >
q/OI'N]}w^=|eHU|]^3Nk&8S@HP LaserJet 1200 Series PCL 6Ne00:winspoolHP LaserJet 1200 Series PCL 6HP LaserJet 1200 Series PCL 6?dXXLetter.HP LaserJet 1200 Series PCL 6P&2%xeO.CQJoJʠNxt(v`0wyi{^묝}vdmxCK8M5c[$.sE48#%>Na.DeC4r5upAwvՆW}wFC";xS8}~%p%H
6qxBj:oG}|4<.۶ײҙ4}7[E*xi_CA4ytNޅIHP LaserJet 1200 Series PCL 6?dXXLetter.HP LaserJet 1200 Series PCL 6P&2%xeO.CQJoJʠNxt(v`0wyi{^묝}vdmxCK8M5c[$.sE48#%>Na.DeC4r5upAwvՆW}wFC";xS8}~%p%H
6qxBj:oG}|4<.۶ײҙ4}7[E*xi_CA4ytNޅIPPPPQP@UnknownGz Times New Roman5Symbol3&z ArialM`@Traditional Arabic3z Times"h*fgC*#.#.!r4dJJ 3QH(?q/,KING FAHD UNIVERSITY OF PETROLEUM & MINERALSHassan R. Barada
coe-aimane0 Oh+'0, @L
ht
-KING FAHD UNIVERSITY OF PETROLEUM & MINERALSd 1INGHassan R. BaradaITYassassNormal.dotacoe-aimanea7e-Microsoft Word 10.0@| @>3}@xy2@
ɕ#.՜.+,0$
px
F4J{
-KING FAHD UNIVERSITY OF PETROLEUM & MINERALSTitle
!"#$%&'()*+,-./012345678:;<=>?@BCDEFGHKRoot Entry FɕMData
1Table|=WordDocument%"SummaryInformation(9DocumentSummaryInformation8ACompObjj
FMicrosoft Word Document
MSWordDocWord.Document.89q