Open your eyes to assembly
This is the initial page for Abre los Ojos al Ensamblador (ie Open your Eyes to Assembly, in English). Some years ago I started my assembly learning way, practically from level zero. I kept on taking notes and, after a time I asked myself if it would not be interesting to anybody. That was the AOE start and rise.
Along the book you will be able to find comments and important remarks on my own experiences in the assembly programming, as well as debugging examples that I did, well to understand how the program works or to debug it. In such a way that I believe that they can be wealthy enough also for you. All the study subjects in the book are seasoned with abundant examples, what I have made use of to learning.
Important:
|
There're now several chapters translated from Spanish to English, they are marked with "[Translation already available]".
- Forum. I have made it on my own using Notepad++ and ConTEXT. Here you can find the AOE libraries in its homonymous section. You are invited to participate in it, but AOE has no support and surely I will not answer questions. I hope that you like it.
- 29th of January 2012. I have corrected some things in chapter 01.
- April 2, 2011. I have added direct access link to 7zipped downloable book.
Although my native language is Spanish, I will try my best translating AOE.
|
Let's see from now on a brief description of every chapter:
- Chapter 01 [Translation already available]. Generic information is dumped here, no specific of assembly language. One talks about numeric systems, such as decimal, binary, octal and hexadecimal, conversion among each to others, its representation and mathematical operations. Data types: byte, word, dword, qword, real, etc. Registers. Memory organization. Segmentation. COM and EXE programs and its differences. Differences between NASM, FASM and MASM.
- Chapter 02 [Translation already available]. Hello World. An introduction to our first asm program in COM and EXE mode. We discuss also about the program flow to achieve a better understanding of assembly programming using the Microsoft debugger DEBUG, hence maybe you can find here a help to your debugging techniques.
- Chapter 03 [Translation already available]. Data. We see the different assembly data type and how they are defined: string of characters, constants, characters, bytes, word, double word, qword, real and its representation on the screen. And we begin to see complex data type: array of structures, pointers, pointers to pointers, pointers to structures, pointers to arrays, arrays of pointers, structures of pointers, nested structures, unions, fields of bits, etc.
- Chapter 04 [Translation already available]. Jumps. We study here the program flow. We talk about short, near and far directions. Labels, what are they and how can we define them. Jumps types depending on their length. Flags. Taking decisions. Loops.
- Chapter 05 [Not translated yet]. Procedures. We study here MASM PROC directive utilities, saving registers into a procedure as a security method. Parameters and differents ways to pass them to the routine. How to define local variables using the stack. Local labels. Far calls. The macros paragraph is not ready yet, it is in the list of tasks.
- Chapter 06 [Not translated yet]. Arithmetic. Here we review the mathematical operations such as addition, subtraction, multiplication, division, INC, DEC, rotations and displacements, sign extents. See also packed and unpacked BCD and ASCII numbers. Mathematical operations with large numbers. The coprocessor, its usage, and examples
- Chapter 07 [Translation already available]. This chapter is dedicated to data processing. You can find here single, double and circular queues and stacks, as well as trees, but also example of its usage. You can find here, also, sort and search methods: bubble and quick sort method, by one and multile keys, also indexing methods. Lineal and binary search methods, also indexed; also numeric data searching (keep in mind that float point has not always exact representation. Searching similar phonemes. You can find some lists and tree examples like breaking down a number in prime factors, find the y-values for a polinomial from x-values, etc.
- Chapter 08 [Translation already available]. The screen. We will give a brief review of basic concepts such as the video card components, the graphics and color palette, horizontal and vertical retrace, modes and video pages, and the BIOS and DOS interrupts and prepared to work with the graphics card. We will look at the direct video memory writing method , increasing speed, but fairly standard. Finally we will see some graphic examples in text mode: copper bar, focus, kaleidoscope, tetris and an debugging example.
- Chapter 09 [Not translated yet]. The keyboard. What is the keyboard layout and data area. Keyboard buffer scan codes and examples. MS-DOS 21h interruption and 16h-BIOS examples. Multitap keyboard representation on screen example.
- Chapter 10 [Not translated yet]. Files. We will give a brief review of files basic definitions and their physical structure and DOS and BIOS old files operations. MS-DOS file handle, DTA structure. File search capabilities and advanced features for MS-DOS files. The file buffers. Different file access methods: sequential method, random and binary. Creating, opening, writing, reading and closing a file. Overturn the file contents to the screen.
- Chapter 11 [Not translated yet]. Interruptions. Polling versus interrupt. Internal interrupts, hardware and software. Location of interruptions. Interruption process. System interrupts table. ISRs. Managing interrupts. Interruptions to handling interruptions. Methods for managing interruptions. Examples: real-time clock, showing live keyboard, time and date, our own ISR, interrupt search. Multiplex interrupt.
- Chapter 12 [Not translated yet]. The memory. Memory management. MS-DOS memory map. Memory types: conventional, upper memory area, ROM and RAM, expanded memory, upper memory blocks, ROM shadowing, high memory area, extended memory, cache memory, CMOS RAM. Memory blocks and their types. Free space environment on resident programs. Resize a memory block. Allocate memory space. Call to threads and overlays. Loading and running applets. Loading and running overlays. TSRs. Involved interruptions, TSRs classification, problems: Neither the BIOS nor DOS are reentrant, time-critical actions, size and speed, relocation and removal, delayed activation, preserving the context. TSRs examples: clock, screen saver. Define a stack on the resident chunk, changing active PSP, changing DTA. Reentry problems with MS-DOS. InDOS and ErrorMode indicators. Critical errors management. CMOS. Extended memory and higher. DMA.
- Chapter 13 [Translation already available]. Recursive definitions examples: Natural numbers. Data and algorithm recursion. Queue and internal recursion with and without parameters. Recursion on data. When to use and when not to use recursion. Reverse tracking algorithms: the Eight Queens problem.
- Chapter 14 [Not translated yet]. The printer. Basic interrupt operations. Common characters. Examples.
- Chapter 15 [Not translated yet]. The mouse. Basic definitions of the mouse. Common operations. Control methods. Other cool features.
- Chapter 16 [Not translated yet]. The joystick. Brief history. The joystick structure. Connector. BIOS functions. Game port direct reading. This chapter needed to be developed, it only has the basic definitions. Although it's in the task list, it is not probably that I do it.
- Chapter 17 [Translation already available]. The time. Methods for time controlling: using interrupts, accessing BIOS information, intercepting 1Ch/08h interruption, using the screen refresh. Multi delay. PIT programming. How to set channel 0 to a different frequency. Another way to use the PIT.
- Chapter 18 [Not translated yet]. The sound. Problems with sound. Performance PC Speaker: direct control by the timer. Musical notes, melodies in the background. Digital music over the loudspeaker. Digital sound files. Trackers. The Sound Blaster is on the to-do list.
- Chapter 19 [Translation already available]. High Level Langages (HLL) interfaces with assembly. Assembly interfaces with high-level languages (HLL) b>. We will see assembly interfaces with pascal, c and basic. We will use compiler turbo pascal, turbo c, basic quick and Virtual Pascal, Free Pascal, Pelles C, Tiny C, Rapid QBasic, Visual Basic. We will do many examples to test the assembler embedded in each of the compilers and access to external assembly routines from the high-level language. We will also test the high-level language internal routines use into the assembler code and parameter passing between different compilers routines asm/hll. Hangman example in each compiler. Quick Libraries creation in Quick Basic. Dividing a project into modules in assembly, library compilation in assembly and usage.
- Chapter 20 [Translation already available]. Windows programming. In this chapter we can find how install FASM, NASM and MASM32 needed packages. And beging learning win32 asm programming from basic level, increasing it, covering some Windows programming basic aspects with examples, like Windows console program, Messagebox, basic window with and without resource (external/internal) files, writing text on windows, hyperlink, painting on the window, using a timer, using bitmaps, using buffers, creating objects on a window: group, buttons, checkboxes, radiobuttons, etc. How to include information in the resource file. Customize the cursor over a button. Double image buttons. Creating menus. Creating toolboxes. Opening and closing files. Making dlls. Example of debugging in Windows. Etc.
- Chapter 21 [Not translated yet]. Linux programming. It is in my list of tasks.
- Chapter 22 [Not translated yet]. Graphic programming. Some definitions: pixel, color depth, video buffer, color palette, memory organization in 13h graphic mode, aspect ratio.
- Chapter 23 [Not translated yet]. Graphic lines. Slope equation, Bresenham algorithm, cropping, Sutherland-Cohen algorithm. Samples and debugging.
- Chapter 24 [Not translated yet]. Rectangles. Rectangles and aspect ratio.
- Chapter 25 [Not translated yet]. Ellipses. Ellipses, midpoint algorithm, circles and aspect ratio, incremental algorithm. Algorithm for drawing circles and ellipses. Examples.
- Chapter 26 [Translation already available]. Filling regions. Region definition. Interior pixels and edge. Connectivity. Region-filling algorithm.
- Chapter 27 [Translation already available]. The graphical palette. What is the palette, reading and modifying the palette. Avoiding interference. Examples: standard palette colors, RGB color mixing, fade in/out, palette rotation.
- Chapter 28 [Not translated yet]. Some graphic formats. RAW, PCX, BMP. Full size and less than 320x200 loading examples.
- Chapter 29 [Translation already available]. Virtual screens. Definitions. 13h virtual screens. Examples.
- Chapter 30 [Translation already available]. Text in graphic mode. Fonts. BIOS support. Characters in the default VGA. Character generator software. Pixels manipulation. Crop. Examples: 8x8 and 8x16 and user fonts.
- Chapter 31 [Translation already available]. Sine and cosine functions. Trigonometric ratios. Methodology. Slide rule. Example: spiral.
- Chapter 32 [Not translated yet]. Fractals. Definition of fractal. Hausdorff-Besicovitch dimension. Linear Fractals: Cantor Dust, Sierpinkski triangle, Koch curve, Hilbert curves. Nonlinear and complex fractals: Julia sets and Mandelbrot. Chaos: bifurcation diagram, Lorentz attractor. L-Systems. Examples: Plasma fractal flame, fractal terrain generator, clouds.
- Chapter 33 [Translation already available]. Animation. Pixel operations bit by bit: xor, not, and, or. The keyboard. Double, triple and n-buffering. Bit block tiling. Animation. Restoring the background.
- Chapter 34 [Translation already available]. Graphic effects examples. Overturn the screen to BMP. Rebound. Bump mapping. Ceva curve. FeedBack. Magnifying glass. Snow: Christmas trees, Snowfall demo. Plasma dynamic. Rain. Shade bob. Sprite. Grounds.
- Chapter 35 [Translation already available]. Space invaders. Different methods used in the Space Invaders example: getting BIOS-ticks, intercepting Int 1Ch, using PIT-COUNTER 0, reading the PIT counter channel 0. With background music.
- Chapter 36 [Not translated yet]. 3D introduction. I am doing it now.
- Chapter 37 [Not translated yet]. 3D examples. It is in my list of tasks.
- Appendix A "[Translation already available]". ASCII characters. ASCII characters table and program that show them.
- Appendix B "[Translation already available]". Conditional jumps. Jumps Mnemonics.
- Appendix C "[Translation already available]". DEBUG. Little DEBUG tutorial with examples.
- Appendix D [Not translated yet]. BIOS data area. Small sample of BIOS data area.
- Appendix E "[Translation already available]". Input/Output Ports. Small list of ports In/Out.
- Appendix F "[Translation already available]". Keyboard scan codes.
- Appendix G "[Translation already available]". Optimizations. Some tips to optimize our programs.
- Appendix H "[Translation already available]". MS-DOS. Small MS-DOS/Windows command windows tutorial. Batch script files tutorial. Examples.
- Appendix I "[Translation already available]". 8087 instructions in alphabetical order.
- Appendix J "[Translation already available]". Big projects in assembly.
- Appendix K "[Translation already available]". Good practices decalogue. Some tips to make life easier when programming.
Last modified: 2010-11-21