Programación Avanzada En Lenguaje Ensamblador

Total Page:16

File Type:pdf, Size:1020Kb

Programación Avanzada En Lenguaje Ensamblador Programación Avanzada en Lenguaje Ensamblador Ramón Medina Reservados todos los derechos. Ni la totalidad ni parte de este libro puede reproducirse o transmitirse por ningún procedimiento electrónico o mecánico, incluyendo fotocopia, grabación magnética o cualquier medio de almacenamiento de información o sistema de recuperación, sin permiso escrito del autor. El autor de este libro ha hecho el máximo esfuerzo posible para la obtención de un texto y unos programas en correcto funcionamiento y sin errores. Las teorías y programas presentados en el libro han sido desarrollados y comprobados individualmente para determinar su efectividad. Aun así, el autor no asume ninguna responsabilidad por daños producidos por, o como consecuencia de la utilización o aplicación de las ideas o programas presentadas en este libro. Copyright (C) 1992, Ramón Medina Dedicatoria A mis cuatro más grandes amores: DIOS, Marilys, Luis Alejandro y Cristian Adrián. ii Prefacio Los programadores se pasan la vida argumentando acerca de cual es el mejor lenguaje. Si se le pregunta a un programador de C acerca del PASCAL y dirá que este nunca será lo suficientemente flexible. Si a un partidario del PASCAL se le comenta acerca de la facilidad del BASIC, seguramente traerá a colación los GOTO. Y si a un fanático del FORTH, se le dice que el suyo es un lenguaje raro y obscuro, poco adecuado para trabajos serios, probablemente sea la última vez que le dirija la palabra. Supongamos, que en lugar de programadores, tenemos a un grupo de chef de cocina, discutiendo acerca de si las recetas deben ser escritas en francés, inglés o español. Por supuesto que resulta tonto. El sabor de la comida será el mismo independientemente del idioma en que haya sido escrita la receta. Lo mismo ocurre en programación. Todos los lenguajes de alto nivel, debe convertir sus instrucciones en código de máquina para poder ser ejecutado por el microprocesador instalado en la computadora. Como podemos ver, todos los lenguajes de programación hablan el mismo idioma. Por todo esto, tiene sentido aprender a programar en lenguaje ensamblador, sea cual sea el lenguaje de alto nivel de su preferencia, ya que es el único lenguaje de programación que le permite hablar en el idioma nativo del microprocesador y explotar todo su potencial. En los próximos capítulos trataremos de explicar desde los conceptos básicos hasta tópicos avanzados de la programación en lenguaje ensamblador, desde los sistemas de numeración y arquitectura interna de un computador, hasta librerías de aplicaciones y programas residentes. Para los principiantes, añado lo siguiente: Si alguna vez ha oído que el lenguaje ensamblador es difícil, no lo crea. Con las características y herramientas de programación disponibles hoy en día, en poco tiempo se sorprenderá desarrollando aplicaciones en este lenguaje con toda libertad. iii Contenido Capítulo I: Conceptos Básicos, 1. Sistemas de Numeración, 1. Cambios de base de numeración, 2. Estructura de la memoria del computador, 3. Bit, 3. Byte, 4. Nibble, 4. Suma de números binarios, 4. Número negativos, 4. Numeración BCD, 5. BCD empaquetado, 5. BCD desempaquetado, 5. Caracteres ASCII, 5. Funciones Lógicas, 5. Función AND o producto lógico, 5. Función OR o suma lógica, 6. Función NOT o inversión, 6. Función XOR u o-exclusiva, 6. Capítulo II: Organización interna del computador, 7. Arquitectura fundamental de un computador, 7. Unidad Central de Procesamiento, 8. Unidad de Control, 8. Unidad Aritmético-Lógica, 8. Memoria, 8. Memoria ROM, 9. Memoria RAM, 9. Periféricos, 9. Buses, 9. Bus de Datos, 9. Bus de Direcciones, 9. Bus de Control, 9. Capítulo III: La familia de microprocesadores 80x86, 11. Características Generales, 11. Arquitectura Interna Básica, 12. Modos Real y Protegido, 12. Registros Internos, 12. Registros de Datos, 13. Registros Indice, 14. Registro de Estado, 15. Registros de Segmento, 15. Función de los registros de segmento, 16. Modos de direccionamiento, 16. Direccionamiento registro, 16. Direccionamiento inmediato, 16. Direccionamiento directo, 16. Direccionamiento indirecto, 17. Direccionamiento indirecto a registro, 17. Direccionamiento indirecto relativo a base, 17. Direccionamiento indexado, 17. Direccionamiento indexado a base, 17. Contrarrestación de segmentos, 18. Interrupciones, 18. Tabla de vector de interrupciones, 19. Tipos de interrupciones, 19. Interrupciones por software, 20. Interrupciones por hardware, 20. Instrucciones del microprocesador, 20. Instrucciones de transferencia de datos, 21. Instrucciones aritméticas, 21. Instrucciones lógicas, 21. Instrucciones para manejo de cadenas, 21. El prefijo REP, 21. Instrucciones para control del contador de programa, 21. Instrucciones de salto condicional, 22. Instrucciones de control del procesador, 22. Instrucciones de entrada y salida, 22. Instrucciones para generación de interrupciones por software, 22. Instrucciones de rotación y desplazamiento, 22. Capítulo IV: Introducción a la programación en lenguaje ensamblador, 23. Escribiendo el primer programa en lenguaje ensamblador 23. Ensamblando el primer programa, 24. Enlazando el primer programa, 24. Ejecutando el primer programa, 25. Modificaciones al primer programa, 25. El segundo programa en lenguaje ensamblador: REVERSE.ASM, 26. Capítulo V: Programando para MS-DOS, 28. Estructura del MS-DOS, 28. BIOS, 28. El núcleo del DOS (kernel), 28. El procesador de comandos (COMMAND.COM), 29. Estructura de los programas de aplicación para MS-DOS, 30. El prefijo de segmento de programa (PSP), 30. Estructura de un programa con extensión COM, 32. Ejemplo de un programa con extensión COM, 33. Estructura de un programa con extensión EXE, 33. Segmentos de programa, 35. Capítulo VI: Herramientas de Programación, 37. Editor de Textos, 37. Ensamblador, 37. Turbo Assembler, 37. Opciones, 38. Archivo de Listado, 38. Archivo de Referencia Cruzada, 38. Enlazador, 39. Turbo Link, 39. Opciones, 39. MAKE, 40. Depurador, 41. Librerías, 41. Turbo Librarian, 42. Operaciones, 42. Capítulo VII: Programación en Lenguaje Ensamblador, 43. Archivos Fuente, Objeto y Ejecutable, 43. Contenido de un Archivo Fuente., 43 Tipos de Sentencias Fuente, 43. Instrucciones, 43. Campo Etiqueta, 44. Campo Nombre, 44. Campo de Operandos, 44. Directivas, 45. Tipos de Operandos, 44. Campo Comentario, 45. Constantes, 45. Operadores, 45. Tipos de Directivas, 46. Directivas de Datos, 46. Directivas Condicionales, 46. Directivas de Listado, 47. Directivas de Macros, 47. Macros, Procedimientos y Herramientas para Programación Modular, 47. Macros, 48. Etiquetas Locales, 49. Directivas de Repetición, 49. Otras directivas de Macros, 51. Directivas de Compilación Condicional, 51. Archivos de Inclusión, 53. Procedimientos, 53. Pasos para Escribir un Procedimiento, 54. Pase de parámetros, 55. A través de registros, 55. A través de Variables Globales, 55. A Través de la Pila, 55. Parámetros por Valor y por Referencia, 57. Parámetros por Valor, 57. Parámetros por Referencia, 57. iii Funciones versus Procedimientos, 57. Retornando Datos en Registros, 57. Retornando Datos en la Pila, 57. Reporte por Excepción, 58. Capítulo VIII: Aplicaciones. Templates para programas COM y EXE, 59. Template para programas COM, 59. Template para programas EXE, 60. Estructuras de Control, 60. Estructura IF-THEN-ELSE, 61. Estructura WHILE-DO, 62. Aplicaciones, 62. Teclado, 63. Video, 66. Manejo de archivos, 81. Directorios, 91. Acceso a disco, 95. Manejo dinámico de memoria, 98. Uso de las funciones de asignación dinámica de memoria, 98. Ajuste de la memoria ocupada por el programa de aplicación, 98. Impresora y puerto serial, 101. Ratón, 105. Conversión de datos, 107. Cadenas, 119. Misceláneos, 125. Programas residentes, 135. Generalidades de un programa residente, 135. Reglas básicas para la escritura de programas TSR, 136. Template para escritura de programas residentes, 138. Interfaz con lenguajes de alto nivel, 148. Interfaz con PASCAL, 148. Mapa de memoria de un programa en PASCAL, 148. PSP, 148. Segmento de código, 148. Segmento de datos, 148. La pila, 148. Espacio de memoria para overlays, 149. Bloque de memoria dinámica, 149. Uso de los registros del microprocesador, 149. Atributo de los procedimientos (NEAR o FAR), 149. La directiva $L y el atributo external, 150. La directiva PUBLIC, 150. La directiva EXTRN, 150. Pase de parámetros, 150. Parámetros por valor, 150. Parámetros por referencia, 151, Limpieza de la pila, 151. La directiva ARG, 151. La directiva MODEL, 151. Resultado de un función en PASCAL, 152. Variables locales, 152. Variables estáticas, 152. Variables volátiles, 152. Interfaz con lenguaje C y C++, 154. Reglas para mezclar programas en C++ con lenguaje ensamblador, 154. En lace de módulos en C++ con módulos en lenguaje ensamblador, 154. Uso de la directiva extern "C" para simplificar el enlace, 155. Modelos de memoria y segmentos, 155. Directivas simplificadas y C++, 156. Símbolos públicos y externos, 157. Carácter de subrayado y Lenguaje C, 157. Mayúsculas y minúsculas, 157. Pase de parámetros, 157. Uso de registros , 158, Retorno de valores, 158. Apéndice A: Instrucciones de la familia de microprocesadores 80x86. Apéndice B: Turbo Assembler: Operadores. Apéndice C: Turbo Assembler: Directivas. Apéndice D: Turbo Assembler: Opciones. Apéndice E: Turbo Link: Opciones. Apéndice F: Funciones del DOS. Apéndice G: Funciones del BIOS y del Ratón. Apéndice H: Lecturas de Referencia. iv Conceptos Básicos Los sistemas basados en microprocesadores están englobados dentro de lo que en electrónica se conoce como sistemas digitales.
Recommended publications
  • 2. Assembly Language Assembly Language Is a Programming Language That Is Very Similar to Machine Language, but Uses Symbols Instead of Binary Numbers
    2. Assembly Language Assembly Language is a programming language that is very similar to machine language, but uses symbols instead of binary numbers. It is converted by the assembler into executable machine- language programs. Assembly language is machine-dependent; an assembly program can only be executed on a particular machine. 2.1 Introduction to Assembly Language Tools Practical assembly language programs can, in general, be written using one of the two following methods: 1- The full-segment definition form 2- The simplified segment definition form In both methods, the source program includes two types of instructions: real instructions, and pseudo instructions. Real instructions such as MOV and ADD are the actual instructions that are translated by the assembler into machine code for execution by the CPU. Pseudo instructions, on the other hand, don’t generate machine code and are only used to give directions to the assembler about how it should translate the assembly language instructions into machine code. The assembler program converts the written assembly language file (called source file) into machine code file (called object file). Another program, known as the linker, converts the object file into an executable file for practical run. It also generates a special file called the map file which is used to get the offset addresses of the segments in the main assembly program as shown in figure 1. Other tools needed in assembling coding include a debugger, and an editor as shown in figure 2 Figure 2. Program Development Procedure There are several commercial assemblers available like the Microsoft Macro Assembler (MASM), and the Borland Turbo Assembler (TASM).
    [Show full text]
  • C++ Builder 2010 Professional Getting Started
    C++ Builder 2010 Professional Getting started. Kjell Gunnar Bleivik: http://www.kjellbleivik.com/ October 18. 2010. Fixed broken link. Status: Most probably finished. Look at the date in case more should be added. Follow me on Twitter and join my C++ Builder group on Facebook: Twitter: http://twitter.com/kbleivik FaceBook: http://www.facebook.com/people/Kjell-Gunnar-Bleivik/1244860831 Mini network: http://www.digitalpunkt.no/ 1. Installing C++Builder 2010, the help system etc. I ordered my upgrade of Borland C++ Builder Prosessional 2010 on September 21 2009 so I could choose an additional free product. I choose Delphi PHP 2.0, since I am fairly used to PHP. In order to install C++ Builder 2010, I had to upgrade my 2009 version. I have made an 2009 and 2010 upgrade shortcut on my desktop. You should find your upgrade program: | your start menu or in | the all program category | CodeGear RAD studio 2009 | Check for updates | Program | When finished upgrading the 2009 Builder, I could run the C++ Builder 2010 Setup program. In addition, I installed the additional first three programs that I also find in the Install Folder. Look at the screendumps below, so you get it correct. • Help_Setup Program • dbpack_setup Program • boost_setup Program • Additional_Products HTML document. • ERStudio_Interbase HTML document 2. Getting started with C++ Builder 2010 Professional. If you learn to use the welcome page efficiently, that may be all you need. On the “documentation” menu, you should start with, yes “Getting started” and then “RAD Studio Help” and so on. As an example click: | Documentation | … and try to locate this http://docs.embarcadero.com/products/rad_studio/ page with Wiki pages, PDF documents, zipped code examples for download, PDF documents since C++Builder 6 (scroll down to the bottom) and CHM http://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help files.
    [Show full text]
  • Optimizing Subroutines in Assembly Language an Optimization Guide for X86 Platforms
    2. Optimizing subroutines in assembly language An optimization guide for x86 platforms By Agner Fog. Copenhagen University College of Engineering. Copyright © 1996 - 2012. Last updated 2012-02-29. Contents 1 Introduction ....................................................................................................................... 4 1.1 Reasons for using assembly code .............................................................................. 5 1.2 Reasons for not using assembly code ........................................................................ 5 1.3 Microprocessors covered by this manual .................................................................... 6 1.4 Operating systems covered by this manual................................................................. 7 2 Before you start................................................................................................................. 7 2.1 Things to decide before you start programming .......................................................... 7 2.2 Make a test strategy.................................................................................................... 9 2.3 Common coding pitfalls............................................................................................. 10 3 The basics of assembly coding........................................................................................ 12 3.1 Assemblers available ................................................................................................ 12 3.2 Register set
    [Show full text]
  • X86 Disassembly Exploring the Relationship Between C, X86 Assembly, and Machine Code
    x86 Disassembly Exploring the relationship between C, x86 Assembly, and Machine Code PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Sat, 07 Sep 2013 05:04:59 UTC Contents Articles Wikibooks:Collections Preface 1 X86 Disassembly/Cover 3 X86 Disassembly/Introduction 3 Tools 5 X86 Disassembly/Assemblers and Compilers 5 X86 Disassembly/Disassemblers and Decompilers 10 X86 Disassembly/Disassembly Examples 18 X86 Disassembly/Analysis Tools 19 Platforms 28 X86 Disassembly/Microsoft Windows 28 X86 Disassembly/Windows Executable Files 33 X86 Disassembly/Linux 48 X86 Disassembly/Linux Executable Files 50 Code Patterns 51 X86 Disassembly/The Stack 51 X86 Disassembly/Functions and Stack Frames 53 X86 Disassembly/Functions and Stack Frame Examples 57 X86 Disassembly/Calling Conventions 58 X86 Disassembly/Calling Convention Examples 64 X86 Disassembly/Branches 74 X86 Disassembly/Branch Examples 83 X86 Disassembly/Loops 87 X86 Disassembly/Loop Examples 92 Data Patterns 95 X86 Disassembly/Variables 95 X86 Disassembly/Variable Examples 101 X86 Disassembly/Data Structures 103 X86 Disassembly/Objects and Classes 108 X86 Disassembly/Floating Point Numbers 112 X86 Disassembly/Floating Point Examples 119 Difficulties 121 X86 Disassembly/Code Optimization 121 X86 Disassembly/Optimization Examples 124 X86 Disassembly/Code Obfuscation 132 X86 Disassembly/Debugger Detectors 137 Resources and Licensing 139 X86 Disassembly/Resources 139 X86 Disassembly/Licensing 141 X86 Disassembly/Manual of Style 141 References Article Sources and Contributors 142 Image Sources, Licenses and Contributors 143 Article Licenses License 144 Wikibooks:Collections Preface 1 Wikibooks:Collections Preface This book was created by volunteers at Wikibooks (http:/ / en.
    [Show full text]
  • Different Emulators to Write 8086 Assembly Language Programs
    Different Emulators to write 8086 assembly language programs Subject: IWM Content • Emu8086 • TASM(Turbo Assembler) • MASM(Microsoft Macro Assembler) • NASM(Netwide Assembler) • FASM(Flat Assembler) Emu8086 • Emu8086 combines an advanced source editor, assembler, disassembler, software emulator with debugger, and step by step tutorials • It permit to assemble, emulate and debug 8086 programs. • This emulator was made for Windows, it works fine on GNU/Linux (with the help of Wine). • The source code is compiled by assembler and then executed on Emulator step-by-step, allowing to watch registers, flags and memory while program runs. how to run program on Emu8086 • Download Emu8086 through this link : https://download.cnet.com/Emu8086-Microprocessor- Emulator/3000-2069_4-10392690.html • Start Emu8086 by running Emu8086.exe • Select “Examples" from "File" menu. • Click “Emulate” button (or press F5). • Click “Single Step” button (or press F8) and watch how the code is being executed. Turbo Assembler(Tasm) • Turbo Assembler (TASM) is a computer assembler developed by Borland which runs on and produces code for 16- or 32-bit x86 DOS or Microsoft Windows. • The Turbo Assembler package is bundled with the Turbo Linker, and is interoperable with the Turbo Debugger. • Turbo Assembler (TASM) a small 16-bit computer program which enables us to write 16 bit i.e. x86 programming code on 32-bit machine. It can be used with any high level language compliers like GCC compiler set to build object files. So that programmers can use their daily routine machines to write 16-bit code and execute on x86 devices. how to run program using TASM • Download TASM through this link : https://techapple.net/2013/01/tasm-windows-7-windows-8-full- screen-64bit-version-single-installer/ • Start TASM by running tasm.exe • It will open DOSBOX.
    [Show full text]
  • Lab # 1 Introduction to Assembly Language
    Assembly Language LAB Islamic University – Gaza Engineering Faculty Department of Computer Engineering 2013 ECOM 2125: Assembly Language LAB Eng. Ahmed M. Ayash Lab # 1 Introduction to Assembly Language February 11, 2013 Objective: To be familiar with Assembly Language. 1. Introduction: Machine language (computer's native language) is a system of impartible instructions executed directly by a computer's central processing unit (CPU). Instructions consist of binary code: 1s and 0s Machine language can be made directly from java code using interpreter. The difference between compiling and interpreting is as follows. Compiling translates the high-level code into a target language code as a single unit. Interpreting translates the individual steps in a high-level program one at a time rather than the whole program as a single unit. Each step is executed immediately after it is translated. C, C++ code is executed faster than Java code, because they transferred to assembly language before machine language. 1 Using Visual Studio 2012 to convert C++ program to assembly language: - From File menu >> choose new >> then choose project. Or from the start page choose new project. - Then the new project window will appear, - choose visual C++ and win32 console application - The project name is welcome: This is a C++ Program that print "Welcome all to our assembly Lab 2013” 2 To run the project, do the following two steps in order: 1. From build menu choose build Welcome. 2. From debug menu choose start without debugging. The output is To convert C++ code to Assembly code we follow these steps: 1) 2) 3 3) We will find the Assembly code on the project folder we save in (Visual Studio 2012\Projects\Welcome\Welcome\Debug), named as Welcome.asm Part of the code: 2.
    [Show full text]
  • Assembly Language Step-By-Step: Programming with DOS and Linux
    Assembly Language Step-by-Step: Programming with DOS and Linux, Second Edition by Jeff Duntemann ISBN:0471375233 John Wiley & Sons © 2000 (613 pages) A “Lost World” journey into 16-bit assembler programming concepts and techniques. <?xml version="1.0" encoding="ISO-8859-1"?> Table of Contents Assembly Language Step-by-Step—Programming with DOS and Linux, Second Edition Foreword Introduction - "Why Would You Want to Do That?" Another Pleasant Valley Saturday Understanding What Computers Chapter 1 - Really Do Chapter 2 - Alien Bases Getting Your Arms around Binary and Hexadecimal Chapter 3 - Lifting the Hood Discovering What Computers Actually Are The Right to Assemble The Process of Making Assembly Language Chapter 4 - Programs NASM-IDE: A Place to Stand Give me a lever long enough, and a Chapter 5 - place to stand, and I will move the Earth. An Uneasy Alliance The x86 CPU and Its Segmented Memory Chapter 6 - System Following Your Instructions Meeting Machine Instructions up Close Chapter 7 - and Personal Chapter 8 - Our Object All Sublime Creating Programs that Work Dividing and Conquering Using Procedures and Macros to Battle Chapter 9 - Complexity Bits, Flags, Branches, and Tables Easing into Mainstream Chapter 10 - Assembly Programming Chapter 11 - Stringing Them Up Those Amazing String Instructions The Programmer's View of Linux Tools and Skills to Help You Write Chapter 12 - Assembly Code under a True 32-Bit OS Coding for Linux Applying What You've Learned to a True Chapter 13 - Protected Mode Operating System Conclusion - Not the End, But Only the Beginning Appendix A - Partial 8086/8088 Instruction Set Reference Appendix B - Segment Register Assumptions for Real Mode Segmented Model Appendix C - Web URLs for Assembly Programmers Appendix D - Segment Register Assumptions Appendix E - What's on the CD-ROM? Index List of Figures List of Tables Back Cover The bestselling guide to assembly language--now updated and expanded to include coverage of Linux.
    [Show full text]
  • Intel X86 Assembly Language & Microarchitecture
    Intel x86 Assembly Language & Microarchitecture #x86 Table of Contents About 1 Chapter 1: Getting started with Intel x86 Assembly Language & Microarchitecture 2 Remarks 2 Examples 2 x86 Assembly Language 2 x86 Linux Hello World Example 3 Chapter 2: Assemblers 6 Examples 6 Microsoft Assembler - MASM 6 Intel Assembler 6 AT&T assembler - as 7 Borland's Turbo Assembler - TASM 7 GNU assembler - gas 7 Netwide Assembler - NASM 8 Yet Another Assembler - YASM 9 Chapter 3: Calling Conventions 10 Remarks 10 Resources 10 Examples 10 32-bit cdecl 10 Parameters 10 Return Value 11 Saved and Clobbered Registers 11 64-bit System V 11 Parameters 11 Return Value 11 Saved and Clobbered Registers 11 32-bit stdcall 12 Parameters 12 Return Value 12 Saved and Clobbered Registers 12 32-bit, cdecl — Dealing with Integers 12 As parameters (8, 16, 32 bits) 12 As parameters (64 bits) 12 As return value 13 32-bit, cdecl — Dealing with Floating Point 14 As parameters (float, double) 14 As parameters (long double) 14 As return value 15 64-bit Windows 15 Parameters 15 Return Value 16 Saved and Clobbered Registers 16 Stack alignment 16 32-bit, cdecl — Dealing with Structs 16 Padding 16 As parameters (pass by reference) 17 As parameters (pass by value) 17 As return value 17 Chapter 4: Control Flow 19 Examples 19 Unconditional jumps 19 Relative near jumps 19 Absolute indirect near jumps 19 Absolute far jumps 19 Absolute indirect far jumps 20 Missing jumps 20 Testing conditions 20 Flags 21 Non-destructive tests 21 Signed and unsigned tests 22 Conditional jumps 22 Synonyms and terminology 22 Equality 22 Greater than 23 Less than 24 Specific flags 24 One more conditional jump (extra one) 25 Test arithmetic relations 25 Unsigned integers 25 Signed integers 26 a_label 26 Synonyms 27 Signed unsigned companion codes 27 Chapter 5: Converting decimal strings to integers 28 Remarks 28 Examples 28 IA-32 assembly, GAS, cdecl calling convention 28 MS-DOS, TASM/MASM function to read a 16-bit unsigned integer 29 Read a 16-bit unsigned integer from input.
    [Show full text]
  • Assembly Language Tutorial
    Assembly Language Tutorial ASSEMBLY LANGUAGE TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Assembly Programming Tutorial Assembly language is a low-level programming language for a computer, or other programmable device specific to a particular computer architecture in contrast to most high- level programming languages, which are generally portable across multiple systems. Assembly language is converted into executable machine code by a utility program referred to as an assembler like NASM, MASM etc. Audience This tutorial has been designed for software programmers with a need to understand the Assembly programming language starting from scratch. This tutorial will give you enough understanding on Assembly programming language from where you can take yourself at higher level of expertise. Prerequisites Before proceeding with this tutorial you should have a basic understanding of Computer Programming terminologies. A basic understanding of any of the programming languages will help you in understanding the Assembly programming concepts and move fast on the learning track. TUTORIALS POINT Simply Easy Learning Copyright & Disclaimer Notice All the content and graphics on this tutorial are the property of tutorialspoint.com. Any content from tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form without the written permission of tutorialspoint.com. Failure to do so is a violation of copyright laws. This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the accuracy of the site or its contents including this tutorial. If you discover that the tutorialspoint.com site or this tutorial content contains some errors, please contact us at [email protected] TUTORIALS POINT Simply Easy Learning Table of Content Assembly Programming Tutorial .............................................
    [Show full text]
  • Turboassembler 1.0 Di Sergio Polini
    PROVA Bor/and TurboAssembler 1.0 di Sergio Polini elluglio 1986 la Microsoft stabilì un 'impresa tutt'altro che banale, ma loro peso. Tutti sapevamo che la Bor- un nuovo standard. Acquistando con un simile strumento a disposizione i land non avrebbe dormito su instabili N la versione 4.0 del suo compila- tempi di sviluppo di un programma si allori; ci chiedevamo solo quando avreb- tore C si otteneva il CodeView, un de- sono abbreviati sensibilmente. be fatto la prossima mossa. Bene, ci bugger simbolico di ottimo livello, un Un po' alla volta tutti i compilatori siamo. /I Turbo C 2.0 e il Turbo Pascal decisivo passo in avanti rispetto al "vec- Microsoft, ed anche l'assembler, sono 5. O hanno ora un debugger simbolico chio)) SYMOEB ed anche rispetto ad stati confezionati con il CodeView. È integrato, più o meno analogo a quello altri prodotti analoghi già sul mercato. proprio questo il nuovo standard: nella del QuickC; è possibile però anche ac- Con il CodeView, programmi che dava- prova di un compilatore o di un assem- quistare le versioni "Professional)) dei no risultati pazzi, o programmi che in- bler non si può prescindere dalla com- due compilatori, che comprendono un chiodavano la macchina, cessavano di patibilità con il CodeView o dalla dispo- Turbo Oebugger separato e un Turbo essere un incubo. Non era più necessa- nibilità di un prodotto almeno equivalen- Assembler. Oppure si possono acqui- rio disseminare nei sorgenti decine di te, e ne ha fatto le spese, tra gli altri, stare le versioni "normali)), integrandole istruzioni write o printf, solo per tenere anche la Borland.
    [Show full text]
  • Quick Reference Borland® Turbo Assembler
    -- - Quick Reference Borland" Turbo Assembler" Quick Reference Borland® Turbo Assembler® Borland International, Inc., 100 Borland Way \ P.O. Box 660001, Scotts Valley, CA95067-000l Borland may have patents and/or pending patent applications covering subject matter in this document The furnishing of this document does not give you any license to these patents. Copyright © 1988, 1995 by Borland International. All rights reserved. All Borland products are trademarks or registered trademarks of Borland International, Inc. Other brand and product names are trademarks or registered trademarks of their respective holders. The material in Chapter 3 and Chapter 4 is reprinted with permission of Intel Corporation, copyright © Intel Corporation 1987, 1995. Printed in the U.S.A LSM1350WW2I772 5EOR1295 9596979899-9 8 7 6 5 4 HI Contents Chapter 1 DATAPTR............. 8 DUP ................ 8 Predefined symbols 1 DWORD .............. 8 $ .................. 1 DWORDPTR .......... 8 @32Bit ............... 1 EQ ................. 8 @code ............... 1 FAR ................ 8 @CodeSize . 1 FARPTR ............. 8 @CPU ............... 1 FWORD .............. 8 @curseg .............. 1 FWORDPTR ........... 8 @data ............... 1 GE ................. 9 @DataSize. 2 GT ........ '" ...... 9 ??date ............... 2 HIGH ............... 9 @fardata ............. 2 HIGH ............... 9 @fardata? ............. 2 LARGE .............. 9 @FileName . 2 LE ................. 9 ??filename ............. 2 LENGTH ............. 9 @Interface. 2 LOW ................ 9
    [Show full text]
  • Programmers' Guide
    Free Pascal Programmers’ manual Programmers’ manual for Free Pascal, version 0.99.10 1.5 February 1999 Micha¨elVan Canneyt Contents 1 Compiler directives 7 1.1 Local directives . 7 $A or $ALIGN: Align Data . 7 $ASMMODE : Assembler mode . 7 $B or $BOOLEVAL: Complete boolean evaluation . 8 $C or $ASSERTIONS : Assertion support . 8 $DEFINE : Define a symbol . 8 $ELSE : Switch conditional compilation . 8 $ENDIF : End conditional compilation . 8 $ERROR : Generate error message . 9 $F : Far or near functions . 9 $FATAL : Generate fatal error message . 10 $H or $LONGSTRINGS : Use AnsiStrings . 10 $HINT : Generate hint message . 10 $HINTS : Emit hints . 10 $IF : Start conditional compilation . 10 $IFDEF : Start conditional compilation . 11 $IFNDEF : Start conditional compilation . 11 $IFOPT : Start conditional compilation . 11 $INFO : Generate info message . 11 $I or $IOCHECK : Input/Output checking . 11 $I or $INCLUDE : Include file . 12 $I or $INCLUDE : Include compiler info . 12 $I386 XXX : Specify assembler format . 13 $L or $LINK : Link object file . 13 $LINKLIB : Link to a library . 13 $M or $TYPEINFO : Generate type info . 14 $MESSAGE : Generate info message . 14 $MMX : Intel MMX support . 14 $NOTE : Generate note message . 15 1 CONTENTS CONTENTS $NOTES : Emit notes . 15 $OUTPUT FORMAT : Specify the output format . 15 $P or $OPENSTRINGS : Use open strings . 16 $PACKENUM : Minimum enumeration type size . 16 $PACKRECORDS : Alignment of record elements . 16 $Q $OVERFLOWCHECKS: Overflow checking . 17 $R or $RANGECHECKS : Range checking . 17 $SATURATION : Saturation operations . 17 $STOP : Generate fatal error message . 17 $T or $TYPEDADDRESS : Typed address operator (@) . 18 $UNDEF : Undefine a symbol . 18 $V or $VARSTRINGCHECKS : Var-string checking . 18 $WAIT : Wait for enter key press .
    [Show full text]