Upload
ermercado78
View
217
Download
0
Embed Size (px)
Citation preview
8/12/2019 Valeriano Jo Ren 2M
1/13
8/12/2019 Valeriano Jo Ren 2M
2/13
An assembly language is a low-level programming
language for a computer, or other programmable
device, in which there is a very strong (generallyone-to-one) correspondence between the languageand the architecture's machine code instructions.
Assembly language is converted into executablemachine code by a utility program referred to as anassembler; the conversion process is referred to asassembly, or assembling the code.
Assembly Language
http://en.wikipedia.org/wiki/Assemb
ly_language#Current_usage
http://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_language8/12/2019 Valeriano Jo Ren 2M
3/13
Assembler- An assembler creates object code bytranslating assembly instruction mnemonics into
opcodes, and by resolving symbolic names formemory locations and other entities. The use ofsymbolic references is a key feature of assemblers,saving tedious calculations and manual address
updates after program modifications. Mostassemblers also include macro facilities forperforming textual substitution
Key concepts
http://en.wikipedia.org/wiki/Assemb
ly_language#Current_usage
http://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_language8/12/2019 Valeriano Jo Ren 2M
4/13
A mnemonic or mnemonic device, is any learningtechnique that aids information retention.
Mnemonics aim to translate information into a formthat the human brain can retain better than itsoriginal form.
Mnemonic
http://en.wikipedia.org/wiki/Mnemo
nic
http://en.wikipedia.org/wiki/Mnemonichttp://en.wikipedia.org/wiki/Mnemonichttp://en.wikipedia.org/wiki/Mnemonichttp://en.wikipedia.org/wiki/Mnemonic8/12/2019 Valeriano Jo Ren 2M
5/13
An opcode (operation code) is the portion of amachine language instruction that specifies the
operation to be performed.
Opcode
http://en.wikipedia.org/wiki/Opcode
http://en.wikipedia.org/wiki/Opcodehttp://en.wikipedia.org/wiki/Opcode8/12/2019 Valeriano Jo Ren 2M
6/13
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, atleast, no earlier than the point where the symbol isdefined) telling the linker or the loader to "go back"and overwrite a placeholder which had been leftwhere the as yet undefined symbol was used.
Multi-pass assemblers create a table with allsymbols and their values in the first passes, then usethe table in later passes to generate code.
Two Types Of
Assembler
http://en.wikipedia.org/wiki/Assemb
ly_language#Current_usage
http://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_language8/12/2019 Valeriano Jo Ren 2M
7/13
Assembly Language is used when speed and reliability are the
overriding factor like small footprint real-time operatingsystems.
By using assembly language, programmers can maximize onspeed to a level. It is easy to write than machine code programs.
It allows the programmer access to registers or instructions thatare 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 towrite in binary or hex code.
Application of Assembly
Language
http://www.studymode.com/essays/Applicati
on-Of-Assembly-Language-1685433.html
http://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.htmlhttp://www.studymode.com/essays/Application-Of-Assembly-Language-1685433.html8/12/2019 Valeriano Jo Ren 2M
8/13
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 containingdata other than executable instructions to be executed asinstructions by a program, service, device driver, etc.
DEP runs in two modes: hardware-enforced DEP forCPUs that can mark memory pages as nonexecutable, andsoftware-enforced DEP with limited protection for CPUsthat do not have hardware support.
Data Execution
Prevention
http://en.wikipedia.org/wiki/Data_Ex
ecution_Prevention
http://en.wikipedia.org/wiki/Data_Execution_Preventionhttp://en.wikipedia.org/wiki/Data_Execution_Preventionhttp://en.wikipedia.org/wiki/Data_Execution_Preventionhttp://en.wikipedia.org/wiki/Data_Execution_Prevention8/12/2019 Valeriano Jo Ren 2M
9/13
MASM32 is the Microsoft Macro Assembler. It is anassembler. It takes your code pre-processes it and
converts it to binary. The links it to runnableexecutable or an OBJect file.
Processors 32bit and em64t processors (80386 andup) support the 8086 compatibility mode called "real
mode". Which means that all PCs to this day arebackward compatible with say MS-DOS and all thegames that used to run on IBM XT.
MASM32
http://stackoverflow.com/questions/4733059/what-is-masm-
which-we-generally-use-it-for-learning-assembly-language-code
http://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-codehttp://stackoverflow.com/questions/4733059/what-is-masm-which-we-generally-use-it-for-learning-assembly-language-code8/12/2019 Valeriano Jo Ren 2M
10/13
Resuming with the Point no. 5 of previous postBeginning With MASM After typing a simple
program for addition the screen will look like:
Programming usingMASM32
http://imabhishekgarg.wordpress.com/category/assembly-language-masm-
programming/
http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/8/12/2019 Valeriano Jo Ren 2M
11/13
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-masm-
programming/
Programming usingMASM32
http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/8/12/2019 Valeriano Jo Ren 2M
12/13
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 enterwhen program asks for object file name or run file name during compilationand linking.
http://imabhishekgarg.wordpress.com/category/assembly-language-masm-
programming/
Programming usingMASM32
http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/8/12/2019 Valeriano Jo Ren 2M
13/13
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 enteralternatively.
http://imabhishekgarg.wordpress.com
/category/assembly-language-masm-programming/
Programming usingMASM32
http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/http://imabhishekgarg.wordpress.com/category/assembly-language-masm-programming/