\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Syshella} \pdfinfo{ /Title (ensamblador-simplez.pdf) /Creator (Cheatography) /Author (Syshella) /Subject (Ensamblador SIMPLEZ Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{0F4B99} \definecolor{LightBackground}{HTML}{F0F3F8} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Ensamblador SIMPLEZ Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Syshella} via \textcolor{DarkBackground}{\uline{cheatography.com/128892/cs/25692/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Syshella \\ \uline{cheatography.com/syshella} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 15th December, 2020.\\ Updated 15th December, 2020.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{p{0.79363 cm} p{0.79363 cm} p{0.79363 cm} x{1.79611 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{5.377cm}}{\bf\textcolor{white}{Instrucciones}} \tn % Row 0 \SetRowColor{LightBackground} \{\{bb\}\}{\bf{CO (bin)}} & \{\{bb\}\}{\bf{CO (oct)}} & \{\{bb\}\}{\bf{CO (nem)}} & \{\{bb\}\}{\bf{Descripción \{\{nl\}\}.}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} 000 & 0 & ST & Guarda AC en la dirección CD \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} 001 & 1 & LD & Carga el contenido de la dirección CD en AC \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} 002 & 2 & ADD & Suma al AC el contenido de la dirección en CD. Actualiza AC \tn % Row Count 12 (+ 4) % Row 4 \SetRowColor{LightBackground} 003 & 3 & BR & Bifurca a la dirección en CD. AC se mantiene \tn % Row Count 15 (+ 3) % Row 5 \SetRowColor{white} 004 & 4 & BZ & Bifurca si la útilma operación es 0, en caso contrario, sigue el flujo normal \tn % Row Count 20 (+ 5) % Row 6 \SetRowColor{LightBackground} 005 & 5 & CLR & Pone a 0 el AC \tn % Row Count 21 (+ 1) % Row 7 \SetRowColor{white} 006 & 6 & DEC & Decrementa en 1 el contenido de AC. Actualiza el valor al acabar el ciclo \tn % Row Count 26 (+ 5) % Row 8 \SetRowColor{LightBackground} 007 & 7 & HALT & Para la máquina \tn % Row Count 27 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.16956 cm} p{0.75186 cm} x{1.00248 cm} x{1.2531 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{5.377cm}}{\bf\textcolor{white}{DIsponibilidad de Lectura y Escritura}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Dirección}} & {\bf{Valor}} & {\bf{Estado}} & {\bf{Dispositivo}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} 508 & 1 & \seqsplit{Preparado} & Pantalla \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} 508 & 0 & No \seqsplit{preparado} & Pantalla \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} 509 & & Mostrar & Pantalla \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} 510 & 1 & \seqsplit{Preparado} & Teclado \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} 510 & 0 & No \seqsplit{preparado} & Teclado \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} 511 & & Leer & Teclado \tn % Row Count 10 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}----} \SetRowColor{LightBackground} \mymulticolumn{4}{x{5.377cm}}{Hay que comprobar la disponibilidad del dispositivo antes de usarlo} \tn \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Recordatorio}} \tn % Row 0 \SetRowColor{LightBackground} ; {\emph{Esto es un comentario}} & Comentarios \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} RES {\emph{X}} & Reserva un número {\emph{X}} de direcciones \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} DATA {\emph{5}} & Indica que esta dirección es un dato de valor {\emph{5}} \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} {\emph{X}} EQU {\emph{Y}} & Asocia a la etiqueta {\emph{X}} el valor {\emph{Y}} \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} {\emph{FIN}} HALT & Etiqueta {\emph{FIN}} \tn % Row Count 10 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Sintaxis}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{MODULE {\emph{NOMBREPROGRAMA}} \newline \newline {\emph{LD /10}} \newline {\emph{ADD /11}} \newline {\emph{ST /12}} \newline {\emph{HALT}} \newline \newline \newline END} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\emph{Todo en mayúsculas \newline }}NombrePrograma igual a nombre de archivo \newline *Salto de línea tras END} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ejemplo lectura y escritura}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{LD /508 ;COMPRUEBO EL ESTADO DE PANTALLA \newline BZ /D \newline LD /DATO ;SI ESTA LIBRE, ESCRIBO EN PANTALLA \newline ST /509 \newline \newline \newline LD /510 ;COMPRUEBO EL ESTADO DEL TECLADO \newline BZ /D \newline LD /511 ;SI HAN INTRODUCIDO UN CARACTER, LO GUARDO \newline ST /DATO} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Ejemplo bucle}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{MODULE BUCLE \newline \newline CONT DATA 5 \newline \newline INI LD /CONT ; Carga el contador \newline DESC ; Decrementa en 1 \newline BZ /INI ;Si el bucle no ha acabado vuelva a INI \newline BR /FIN ;Si el bucle llega a 0 (fin de bucle), va a FIN \newline \newline FIN HALT} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Distribución Instrucción}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/syshella_1607860592_COCD.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{3.38436 cm} x{1.59264 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Buses por defecto}} \tn % Row 0 \SetRowColor{LightBackground} Bus Direcciones & 9 bits \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Bus Control & 15 bits \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Bus Datos & 12 bits \tn % Row Count 3 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{CO + CD = 12 (Tamaño del bus de datos) \newline Como bus de direcciones = 9 bits(CD) =\textgreater{} 3 bits (CO)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} x{4.4793 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Extensiones}} \tn % Row 0 \SetRowColor{LightBackground} .SIM & Creado al guardar nuestro código. Fichero de texto. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} .ENS & Versión ensamblador autogenerada \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} .OBS & Versión ensamblador autogenerada. Se monta para generar el LNS \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} .LNS & Generado al montar el fichero. Lo usa simplez para simular. \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} .VMS & Generar manualmente guardando desde el LNS con el formato .VMS \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Generar simulación}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{1.}} Herramientas / Editor de Programas \newline % Row Count 1 (+ 1) {\bf{2.}} Escribir programa \newline % Row Count 2 (+ 1) {\bf{3.}} Guardar. Genera .ENS \newline % Row Count 3 (+ 1) {\bf{4.}} Ensamblar. Genera .ENS y .OBS \newline % Row Count 4 (+ 1) {\bf{5.}} Montar fichero. Genera .LNS \newline % Row Count 5 (+ 1) {\bf{6.}} Rellenar memorias y ejecutar fichero en simulador% Row Count 7 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}