al__nasim

mp_lab_2

Jun 29th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 3.20 KB | None | 0 0
  1. \documentclass[12pt]{article}
  2. \usepackage[english]{babel}
  3. \usepackage[utf8x]{inputenc}
  4. \usepackage{amsmath}
  5. \usepackage{graphicx}
  6. \usepackage[colorinlistoftodos]{todonotes}
  7. %\usepackage{fullpage}
  8. \usepackage{multirow}
  9.  
  10.  
  11. \begin{document}
  12.  
  13. \begin{titlepage}
  14. \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
  15.  
  16. \center
  17.  
  18. \textsc{\LARGE Ahsanullah Univerity of Science \& Technology}\\[1.5cm]
  19. \textsc{\Large CSE 3108}\\[0.5cm]
  20. \textsc{\large Microprocessor Lab}\\[0.5cm]
  21.  
  22.  
  23. \HRule \\[0.4cm]
  24. { \huge \bfseries Assembly to Machine code using loop}\\[0.4cm]
  25. \HRule \\[1.5cm]
  26.  
  27.  
  28. \begin{minipage}{0.4\textwidth}
  29. \begin{flushleft}
  30. \emph{Submitted by:}
  31.  \vspace{1ex}
  32.  
  33.    \textsc{MD Abdullah Al Nasim}\\
  34.    \textsc{15.01.04.085}\\
  35.      \vspace{1ex}
  36.     \textsc{Masud Rana}\\
  37.    \textsc{15.01.04.090}\\
  38.      \vspace{1ex}
  39.     \textsc{Murad Hossain}\\
  40.    \textsc{15.01.04.102}\\
  41.      \vspace{1ex}
  42.     \textsc{Sovon Chakraborty}\\
  43.    \textsc{15.01.04.104}\\
  44.      \vspace{1ex}
  45.     \textsc{Amit Niloy}\\
  46.    \textsc{15.01.04.105}\\
  47.    
  48. \end{flushleft}
  49. \end{minipage}
  50. ~
  51. \begin{minipage}{0.4\textwidth}
  52. \begin{flushright} \large
  53. \emph{Supervisor:} \\
  54. \textsc{Sujan Sarker}
  55.  
  56. \HRule \\[2cm]
  57.  
  58. \includegraphics[scale =.2]{LogoAust.jpg}
  59.  
  60. \end{flushright}
  61. \end{minipage}\\[2cm]
  62.  
  63.  
  64.  
  65.  
  66. %\title{Assembly to machine code using loop}
  67. %\author{MD Abdullah Al Nasim}
  68. {\large \today}\\[1.5cm]
  69.  
  70. \end{titlepage}
  71.  
  72.  
  73.  
  74.  
  75.  
  76. \maketitle
  77.  
  78.  
  79.  
  80.  
  81. \section{Problem Description}
  82. Suppose five numbers(8 bit) are stored in memory started from 0000:1A0F
  83.  
  84.  
  85. 1)Write a code in assembly to add those numbers using loop.
  86.  
  87. 2)Convert the assembly code into its equivalent machine code(Hex Code).
  88.  
  89. 3)Load your code into 8086-bit's memory and run.
  90.  
  91.  
  92. \subsection{Assembly code}
  93.  
  94. MOV AL,00H \\[0.1cm]
  95. MOV CX,05H \\[0.1cm]
  96. MOV SI,1A0F \\[0.1cm]
  97. ADD AL,[SI] \\[0.1cm]
  98. INC SI \\[0.1cm]
  99. LOOP DIS \\[0.1cm]
  100.  
  101.  
  102. \subsection{Code Conversion}
  103.  
  104. \begin{table}[h]
  105. \centering
  106. \begin{tabular}{|l|l|l|l|}
  107. \hline
  108. \multirow{2}{*}{Instruction No.} & \multirow{2}{*}{Assembly Code} & \multicolumn{2}{l|}{Machine Code} \\ \cline{3-4}
  109. &  & Binary Code & Hexadecimal Code \\ \hline
  110. $ 1^{st} $ & MOV AL,00H & 1011 0000 0000 & B0 00 \\ \hline
  111. $ 2^{nd} $ & MOV CX,05H & 1011 1001 0500 & B90500 \\ \hline
  112. $ 3^{rd} $ & MOV SI,1A0F & 101111100F1A & BE0F1A \\ \hline
  113. $ 4^{th} $ & ADD AL,{[}SI{]} & 0000001000000100 & 0204 \\ \hline
  114. $ 5^{th} $& INC SI & 01000110 & 46 \\ \hline
  115. $ 6^{th} $ & LOOP DIS & 1110001011111011 & E2FB \\ \hline
  116. \end{tabular}
  117. \caption{Assembly to Machine Code}
  118. \label{my-label}
  119. \end{table}
  120.  
  121.  
  122. \begin{table}[]
  123. \centering
  124. \begin{tabular}{|l|l|l|}
  125. \hline
  126. \multicolumn{2}{|l|}{Address} & \multirow{2}{*}{Data} \\ \cline{1-2}
  127. Segment & Offset &  \\ \hline
  128. 0000 & 1A0F & B0 \\ \hline
  129. 0000 & 1A10 & 00 \\ \hline
  130. 0000 & 1A11 & B9 \\ \hline
  131. 0000 & 1A12 & 05 \\ \hline
  132. 0000 & 1A13 & 00 \\ \hline
  133. 0000 & 1A14 & BE \\ \hline
  134. 0000 & 1A15 & 0F \\ \hline
  135. 0000 & 1A16 & 1A \\ \hline
  136. 0000 & 1A17 & 02 \\ \hline
  137. 0000 & 1A18 & 04 \\ \hline
  138. 0000 & 1A19 & 46 \\ \hline
  139. 0000 & 1A1A & E2 \\ \hline
  140. 0000 & 1A1B & FB \\ \hline
  141. \end{tabular}
  142. \caption{Memory Table}
  143. \label{Memory Table}
  144. \end{table}
  145.  
  146. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment