Valeriano Jo Ren 2M

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

Jo Ren B.

Valeriano BSIT- Irreg

Assembly Language
An assembly language is a low-level programming language for a computer, or other programmable device, in which there is a very strong (generally one-to-one) correspondence between the language and the architecture's machine code instructions.

Assembly language is converted into executable machine code by a utility program referred to as an assembler; the conversion process is referred to as assembly, or assembling the code.
http://en.wikipedia.org/wiki/Assemb ly_language#Current_usage

Key concepts
Assembler - An assembler creates object code by translating assembly instruction mnemonics into opcodes, and by resolving symbolic names for memory locations and other entities. The use of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most assemblers also include macro facilities for performing textual substitution
http://en.wikipedia.org/wiki/Assemb ly_language#Current_usage

Mnemonic
A mnemonic or mnemonic device, is any learning technique that aids information retention. Mnemonics aim to translate information into a form that the human brain can retain better than its original form.

http://en.wikipedia.org/wiki/Mnemo nic

Opcode
An opcode (operation code) is the portion of a machine language instruction that specifies the operation to be performed.

http://en.wikipedia.org/wiki/Opcode

Two Types Of Assembler


One-pass assemblers go through the source code once. Any symbol used before it is defined will require "errata" at the end of the object code (or, at least, no earlier than the point where the symbol is defined) telling the linker or the loader to "go back" and overwrite a placeholder which had been left where the as yet undefined symbol was used. Multi-pass assemblers create a table with all symbols and their values in the first passes, then use the table in later passes to generate code.
http://en.wikipedia.org/wiki/Assemb ly_language#Current_usage

Application of Assembly Language


Assembly Language is used when speed and reliability are the overriding factor like small footprint real-time operating systems. By using assembly language, programmers can maximize on speed to a level. It is easy to write than machine code programs. It allows the programmer access to registers or instructions that are not usually provided by a High-level language. The main Application of Assembly Language is for direct hardware manipulation i.e. device drivers. Assembly language also directly correlates which machine instructions; the only way to get closer to the machine is to write in binary or hex code.
http://www.studymode.com/essays/Applicati on-Of-Assembly-Language-1685433.html

Data Execution Prevention


Data Execution Prevention (DEP) is a security feature included in modern operating systems: it is preventing the content of a region of memory identified as containing data other than executable instructions to be executed as instructions by a program, service, device driver, etc. DEP runs in two modes: hardware-enforced DEP for CPUs that can mark memory pages as nonexecutable, and software-enforced DEP with limited protection for CPUs that do not have hardware support.
http://en.wikipedia.org/wiki/Data_Ex ecution_Prevention

MASM32

MASM32 is the Microsoft Macro Assembler. It is an assembler. It takes your code pre-processes it and converts it to binary. The links it to runnable executable or an OBJect file. Processors 32bit and em64t processors (80386 and up) support the 8086 compatibility mode called "real mode". Which means that all PCs to this day are backward compatible with say MS-DOS and all the games that used to run on IBM XT.
http://stackoverflow.com/questions/4733059/what-is-masmwhich-we-generally-use-it-for-learning-assembly-language-code

Programming using MASM32

Resuming with the Point no. 5 of previous post Beginning With MASM After typing a simple program for addition the screen will look like:

http://imabhishekgarg.wordpress.com /category/assembly-language-masmprogramming/

Programming using MASM32

Now Let us Save the file (File-> Save ) and exit (File>Exit or Alt+F+x) well get back to the cmd screen :

http://imabhishekgarg.wordpress.com /category/assembly-language-masmprogramming/

Programming using MASM32


Now well follow the final 3 instructions given in step no. 8 in previous post to compile and run the program (circled by green color). Keep pressing enter when program asks for object file name or run file name during compilation and linking.

http://imabhishekgarg.wordpress.com /category/assembly-language-masmprogramming/

Programming using MASM32

After entering Debug addition.exe the cursor starts blinking in front of a hyphen . Now well see the step by step result by pressing t and enter alternatively.

http://imabhishekgarg.wordpress.com /category/assembly-language-masmprogramming/

You might also like