Lecture (05) x86 programming 4
|
|
- Jeremy Jennings
- 5 years ago
- Views:
Transcription
1 Lecture (05) x86 programming 4 By: Dr. Ahmed ElShafee ١ TOC IA32 cont,.. Segmentation Assembler Directives Format of console programs Practical deliverable 01 ٢
2 Simple Memory Addressing Modes Normal (R) Mem[Reg[R]] Register R specifies memory address mov eax, [ecx] Displacement D(R) Mem[Reg[R]+D] Register R specifies start of memory region Constant displacement D specifies offset mov edx, 8[ebp] ٣ int _tmain(int argc, _TCHAR* argv[]) { unsigned int src_arr[4]={12,34,56,78}; unsigned int x1,x2,x3,x4; unsigned int des_arr[4]; _asm { lea ebx,src_arr mov edx,[ebx] mov x1,edx mov edx,4[ebx] mov x2,edx mov edx,8[ebx] mov x3,edx mov edx,12[ebx] mov x4,edx lea ebx,des_arr mov edx,x4 mov [ebx],edx mov edx,x3 mov 4[ebx],edx mov edx,x2 mov 8[ebx],edx ٤ mov edx,x1 mov 12[ebx],edx } printf("x1=%d\n",x1); printf("x2=%d\n",x2); printf("x3=%d\n",x3); printf("x4=%d\n",x4); printf("des_arr[0]=%d\n",des_arr[0]); printf("des_arr[1]=%d\n",des_arr[1]); printf("des_arr[2]=%d\n",des_arr[2]); printf("des_arr[3]=%d\n",des_arr[3]); printf("press any key to continue,..."); char ch = getch(); return 0; } Example 06
3 int _tmain(int argc, _TCHAR* argv[]) { unsigned int x,y,z; printf("enter X="); scanf("%d",&x); printf("enter y="); scanf("%d",&y); _asm { push x push y pop eax pop edx add eax,edx push eax pop z } printf("z=%d\n",z); printf("press any key to continue,..."); getch(); return 0; } ٥ Example 07 Segmentation Segmentation is used to allow relocation of programs, i.e. programs can be loaded on different memory areas and still run correctly. Segmentation is used in the 8088/8086 microprocessors to allow the generation of 20 bit addresses using 16 bit registers. ٦
4 In the Real Mode Operation a 20 bit address (effective address) is obtained by shifting the segment address 4 bits to the left (X10H) and then adding the offset address The offset address is specified in the program. The segment address is specified by the operating system whenever the program is loaded. The code segment holds the machine codes of the program. The Instruction Pointer specifies the ٧ offset address in the code segment. The data segment holds the data used by the program. Most data references are specified in the data segment. The stack segment holds the stack of the program. The offset address in the stack segment is specified with the registers SP and BP. The extra segment is used as a data segment by some data movement instructions. ٨
5 Example 01 If DS =1600H find the maximum area occupied by the data segment. Find also the effective address, if the offset address is 1F00H. ٩ Solution 01 Starting address = DS X 10H = 1600H X 10H = 16000H Ending address = Starting address + FFFF = 16000H + FFFFH = 25FFFH Effective address = Segment:Offset = 1600:1F00 = Segment address X 10H + Offset = 1600H X 10H + 1F00H = 16000H + 1F00H = 17F00H ١٠
6 Assembler Directives Directives are instructions given by the programmer to the assembler on how to assemble the program. Directives are not part of the instruction set of the microprocessor. The use of directives might vary from assembler to assembler. Some of the MASM 32 assembler directives are: ORG (Origin): Tells the assembler where to store the machine code of the next instruction. EQU (Equate): Tells the assembler to assign a value to an identifier. SEGMENT: Tells the assembler to begin a new segment. ASSUME: Tell the assembler to associate a segment with a segment register. PROC (Procedure): Tells the assembler to begin a new procedure. MACRO: Assigns the sequence of instructions to an identifier. ١١ END: Ends a program, segment (ENDS), a procedure (ENDP), or a Ḍr. Ahmed ElShafee, ACU : Fall 2018, Microprocessors 1 macro (ENDM) > Data Definition Directives Data Definition directives tell the assembler to store the specified data in the next memory locations. Data that occupies more than one location is stored with the LSByte in the lower address. (DB) Define Byte (1 byte or 8 bits Same as BYTE) (DW) Define Word (2 bytes or 16 bits Same as WORD) (DD) Define Double Word (4 bytes or 32 bits Same as DWORD) (DQ) Define Quad Word (8 bytes or 64 bits Same as QWORD) (DT) Define Ten Bytes (10 bytes or 80 bits Same as TBYTE) ١٢
7 Code 01 Examples: ABC DB 26H ;ABC=26H XYZ DB 35H,87H,0A4H ;XYZ= {35H,87H,A4H} YOU DB ahmd ;YOU = ahmd VAL DW 1254H ;VAL = 1254H X1 DB? ;X1 = UNSPECIFIED X4 DB 3 DUP(20H) ;X4 = {20H,20H,20H} N1 DB 123H ;INVALID ١٣ Code 02 Show the content of the memory based on the following data definitions: ORG 100H VAL1 EQU 21H AB10 DB 37 NEW DB 23H,56H, $ LOT DW 1245H XY11 DB NEXT A123 DD 123H B561 DB 4 DUP(40H) VAL2 DB VAL1 ١٤
8 solution Show the content of the memory based on the following data definitions: ORG 100H VAL1 EQU 21H AB10 DB 37 NEW DB 23H,56H, $ LOT DW 1245H XY11 DB NEXT A123 DD 123H B561 DB 4 DUP(40H) VAL2 DB VAL1 ١٥ Label Address AB10 DS:0100 NEW+0 DS:0101 NEW+1 DS:0102 NEW+2 DS:0103 LOT DS:0104 DS:0105 XY11+0 DS:0106 XY11+1 DS:0107 XY11+2 DS:0108 XY11+3 DS:0109 A123 DS:010A DS:010B DS:010C DS:010D B561+0 DS:010E B561+1 DS:010F B561+2 DS:0110 B561+3 DS:0111 VAL2 DS:0112 Content Code 03; data definition; emu86 ORG 100H JMP START VAL1 EQU 21H AB10 DB 37 NEW DB 23H,56H, $ LOT DW 1245H XY11 DB NEXT A123 DD 123H B561 DB 4 DUP(40H) VAL2 DB VAL1 START: nop END ١٦
9 ١٧ Format of DOS programs All programs must have a code and a stack. Code is the part of the program that contains the instructions of the program. Stack is an area in the RAM used by the system to store return addresses, and by the programmer to store temporarily data. It is a Last In First Out (LIFO) buffer. Programs can also have a data area, where all data (variables) is stored. There are two basic types of programs: Commands (.COM). The data and the stack of the program are part of the Code segment. The stack is always located at the end of the segment. The first 256 bytes of the segment are reserved. ١٨ Executable (.EXE). The code and stack and data of the program are located in different segments.
10 Format of the.com programs.model SMALL CSEG SEGMENT PARA 'CODE ;Start a Code segment ASSUME CS:CSEG, DS:CSEG, SS:CSEG ORG 100H ;Reserve first 256 locations START: JMP MAIN ;Skip data area {Place the data of the program here} MAIN PROC NEAR ;Beginning of main procedure {Place the code of the program here} RET ;Get return DOS address MAIN ENDP ;End of main procedure CSEG ENDS ;End of the segment END START ;End of the program ١٩ Format of the.com programs.model SMALL.CODE ORG 100H ;Reserve first 256 locations START: JMP MAIN ;Skip data area {Place the data of the program here} MAIN PROC NEAR ;Beginning of main procedure {Place the code of the program here} RET ;Get return DOS address MAIN ENDP ;End of main procedure END START ;End of the program ٢٠
11 Example 01.01; hello world; masm CSEG SEGMENT PARA CODE ;Start a Code segment ASSUME CS:CSEG, DS:CSEG, SS:CSEG ORG 100H ;Reserve first 256 locations START: JMP MAIN ;Skip data area MSG DB "Hello World 01",'$ MAIN PROC NEAR ;Beginning of main procedure LEA DX,MSG MOV AH,9 INT 21H INT 20H RET MAIN ENDP ;End of main procedure CSEG ENDS ;End of the segment END START ;End of the program ٢١ Example 01; hello world; masm.model SMALL.CODE ORG 100H ;Reserve first 256 locations START: JMP MAIN ;Skip data area MSG DB "Hello World 01",'$ MAIN PROC NEAR ;Beginning of main procedure LEA DX,MSG MOV AH,9 INT 21H INT 20H RET MAIN ENDP ;End of main procedure END START ;End of the program ٢٢
12 ٢٣ Compiling and linking Masm 01.asm ML AT 01.obj 01.com ٢٤
13 ٢٥ Thanks,.. ٢٦
Lecture (06) x86 programming 5
Lecture (06) x86 programming 5 By: Dr. Ahmed ElShafee 1 TOC Format of DOS programs Format of the.com programs Addressing Modes 1> Immediate Addressing Mode 2> Register Addressing Mode 3> Direct Addressing
More informationLecture (03) x86 programming 2
Lecture (03) x86 programming 2 By: Dr. Ahmed ElShafee ١ TOC The 80x86 Registers The Flag Register 80x86 Modes of operation ٢ Types of instruction set Complex instruction set computer (CISC): Large instruction
More informationORG ; TWO. Assembly Language Programming
Dec 2 Hex 2 Bin 00000010 ORG ; TWO Assembly Language Programming OBJECTIVES this chapter enables the student to: Explain the difference between Assembly language instructions and pseudo-instructions. Identify
More informationChapter 3: Addressing Modes
Chapter 3: Addressing Modes Chapter 3 Addressing Modes Note: Adapted from (Author Slides) Instructor: Prof. Dr. Khalid A. Darabkh 2 Introduction Efficient software development for the microprocessor requires
More informationAssembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler:
Assembling, Linking and Executing 1) Assembling: - Assembling converts source program into object program if syntactically correct and generates an intermediate.obj file or module. - It calculates the
More informationComputer Systems Lecture 9
Computer Systems Lecture 9 CPU Registers in x86 CPU status flags EFLAG: The Flag register holds the CPU status flags The status flags are separate bits in EFLAG where information on important conditions
More informationELEG3924 Microprocessor
Department of Electrical Engineering University of Arkansas ELEG3924 Microprocessor Ch.2 Assembly Language Programming Dr. Jing Yang jingyang@uark.edu 1 OUTLINE Inside 8051 Introduction to assembly programming
More informationSPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY
BACKGROUND Segment The "SEGMENT" and "ENDS" directives indicate to the assembler the beginning and ending of a segment and have the following format label SEGMENT [options] ;place the statements belonging
More informationConstants and Expressions. Lecture 7: Assembly Language Programs. Constants and Expressions (cont.) Statements. Names. Assembly Directives
Lecture 7: Assembly Language Programs Basic elements of assembly language Assembler directives Data allocation directives Data movement instructions Assembling, linking, and debugging Using TASM Constants
More informationEC 333 Microprocessor and Interfacing Techniques (3+1)
EC 333 Microprocessor and Interfacing Techniques (3+1) Lecture 6 8086/88 Microprocessor Programming (Arithmetic Instructions) Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC
More informationQ. State and Explain steps involved in program development. [w-08, w-10, s-12, w-11]
Q. State and Explain steps involved in program development. [w-08, w-10, s-12, w-11] Answer: 1. Defining Problem 2. Algorithm 3. Flowchart 4. Initialization of checklist 5. Choosing instructions 6. Converting
More information8086 ALP TOOLS (CH 2) CHAPTER 2
1 CHAPTER 2 In this chapter, we shall discuss the Assembly Language Program development tools, PC memory structure and Assembler directives. Books to be Referred: 1. Microprocessors and Interfacing 2nd
More informationLecture 16: Passing Parameters on the Stack. Push Examples. Pop Examples. CALL and RET
Lecture 1: Passing Parameters on the Stack Push Examples Quick Stack Review Passing Parameters on the Stack Binary/ASCII conversion ;assume SP = 0202 mov ax, 124h push ax push 0af8h push 0eeeh EE 0E F8
More informationEEM336 Microprocessors I. Data Movement Instructions
EEM336 Microprocessors I Data Movement Instructions Introduction This chapter concentrates on common data movement instructions. 2 Chapter Objectives Upon completion of this chapter, you will be able to:
More informationFaculty of Engineering Computer Engineering Department Islamic University of Gaza Assembly Language Lab # 2 Assembly Language Fundamentals
Faculty of Engineering Computer Engineering Department Islamic University of Gaza 2011 Assembly Language Lab # 2 Assembly Language Fundamentals Assembly Language Lab # 2 Assembly Language Fundamentals
More informationCS241 Computer Organization Spring 2015 IA
CS241 Computer Organization Spring 2015 IA-32 2-10 2015 Outline! Review HW#3 and Quiz#1! More on Assembly (IA32) move instruction (mov) memory address computation arithmetic & logic instructions (add,
More informationMacros in Pentium. Assembly Language. October 25
Macros in Pentium Assembly Language October 25 CSC201 Section 002 Fall, 2000 Equates PI equ 3.1415926 MAXRECS equ 200 RECSIZE equ 5 move equ mov la equ lea float1 dd PI recarray db MAXRECS*RECSIZE dup
More informationTurning C into Object Code Code in files p1.c p2.c Compile with command: gcc -O p1.c p2.c -o p Use optimizations (-O) Put resulting binary in file p
Turning C into Object Code Code in files p1.c p2.c Compile with command: gcc -O p1.c p2.c -o p Use optimizations (-O) Put resulting binary in file p text C program (p1.c p2.c) Compiler (gcc -S) text Asm
More informationEC-333 Microprocessor and Interfacing Techniques
EC-333 Microprocessor and Interfacing Techniques Lecture 4 Addressing Modes Dr Hashim Ali Spring - 2018 Department of Computer Science and Engineering HITEC University Taxila Slides taken from Computer
More informationELEG3923 Microprocessor Ch.2 Assembly Language Programming
Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.2 Assembly Language Programming Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Inside 8051 Introduction to assembly programming
More informationX86 Addressing Modes Chapter 3" Review: Instructions to Recognize"
X86 Addressing Modes Chapter 3" Review: Instructions to Recognize" 1 Arithmetic Instructions (1)! Two Operand Instructions" ADD Dest, Src Dest = Dest + Src SUB Dest, Src Dest = Dest - Src MUL Dest, Src
More informationAssembler Programming. Lecture 10
Assembler Programming Lecture 10 Lecture 10 Mixed language programming. C and Basic to MASM Interface. Mixed language programming Combine Basic, C, Pascal with assembler. Call MASM routines from HLL program.
More informationEEM336 Microprocessors I. Addressing Modes
EEM336 Microprocessors I Addressing Modes Introduction Efficient software development for the microprocessor requires a complete familiarity with the addressing modes employed by each instruction. This
More informationAssembly Language Fundamentals. Chapter 3
Assembly Language Fundamentals Chapter 3 1 Numeric Constants 2 Numeric constants are made of numerical digits with, possibly, a sign and a suffix. Ex: -23 (a negative integer, base 10 is default) 1011b
More information6/20/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:
Introduction Efficient software development for the microprocessor requires a complete familiarity with the addressing modes employed by each instruction. This chapter explains the operation of the stack
More informationEECE.3170: Microprocessor Systems Design I Summer 2017
EECE.3170: Microprocessor Systems Design I Summer 2017 Lecture 8: Key Questions June 5, 2017 1. (Review) Describe the structure of a typical x86 stack frame. EECE.3170: Microprocessor Systems Design I
More informationADDRESSING MODES. Operands specify the data to be used by an instruction
ADDRESSING MODES Operands specify the data to be used by an instruction An addressing mode refers to the way in which the data is specified by an operand 1. An operand is said to be direct when it specifies
More informationIslamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 2125: Assembly Language LAB. Lab # 10. Advanced Procedures
Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 2125: Assembly Language LAB Lab # 10 Advanced Procedures May, 2014 1 Assembly Language LAB Stack Parameters There are
More informationMachine and Assembly Language Principles
Machine and Assembly Language Principles Assembly language instruction is synonymous with a machine instruction. Therefore, need to understand machine instructions and on what they operate - the architecture.
More informationProcedure-Calling Conventions October 30
Procedure-Calling Conventions October 30 CSC201 Section 002 Fall, 2000 Saving registers Registers are inevitably used by subroutines; changes their! Registers have global scope; calling procedures also
More informationEECE.3170: Microprocessor Systems Design I Summer 2017 Homework 4 Solution
1. (40 points) Write the following subroutine in x86 assembly: Recall that: int f(int v1, int v2, int v3) { int x = v1 + v2; urn (x + v3) * (x v3); Subroutine arguments are passed on the stack, and can
More informationMicroprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017)
Microprocessor and Assembly Language Week-5 System Programming, BCS 6th, IBMS (2017) High Speed Memory Registers CPU store data temporarily in these location CPU process, store and transfer data from one
More informationConstants and. Lecture 7: Assembly Language Programs. Expressions (cont.) Constants and. Statements. Expressions
Lecture 7: Assembly Language Programs Basic elements of assembly language Assembler directives Data allocation directives Data movement instructions Assembling, linking, and debugging Using TASM Constants
More informationAssembly Language Each statement in an assembly language program consists of four parts or fields.
Chapter 3: Addressing Modes Assembly Language Each statement in an assembly language program consists of four parts or fields. The leftmost field is called the label. - used to identify the name of a memory
More informationMarking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)
Philadelphia University Faculty of Engineering Marking Scheme Examination Paper Department of CE Module: Microprocessors (630313) Final Exam Second Semester Date: 02/06/2018 Section 1 Weighting 40% of
More informationWe will first study the basic instructions for doing multiplications and divisions
MULTIPLICATION, DIVISION AND NUMERICAL CONVERSIONS We will first study the basic instructions for doing multiplications and divisions We then use these instructions to 1. Convert a string of ASCII digits
More informationMicroprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil
Microprocessor By Mrs. R.P.Chaudhari Mrs.P.S.Patil Chapter 1 Basics of Microprocessor CO-Draw Architecture Of 8085 Salient Features of 8085 It is a 8 bit microprocessor. It is manufactured with N-MOS technology.
More informationStack -- Memory which holds register contents. Will keep the EIP of the next address after the call
Call without Parameter Value Transfer What are involved? ESP Stack Pointer Register Grows by 4 for EIP (return address) storage Stack -- Memory which holds register contents Will keep the EIP of the next
More information16.317: Microprocessor Systems Design I Fall 2013
16.317: Microprocessor Systems Design I Fall 2013 Exam 2 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling
More informationCS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 4: 80X86 INSTRUCTION SET QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS
CS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 4: 80X86 INSTRUCTION SET QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS Q1. IWrite an ALP that will examine a set of 20 memory
More informationProposed Common Configuration Method
Proposed Common Configuration Method July 9, 1991 The Common Configuration Method (CCM) simplifies configuration of disks and other storage devices. This definition includes a Standard AT Compatible Register
More informationExperiment 8 8 Subroutine Handling Instructions and Macros
Introduction Experiment 8 8 Subroutine Handling Instructions and Macros In this experiment you will be introduced to subroutines and how to call them. You will verify the exchange of data between a main
More informationPractical Malware Analysis
Practical Malware Analysis Ch 4: A Crash Course in x86 Disassembly Revised 1-16-7 Basic Techniques Basic static analysis Looks at malware from the outside Basic dynamic analysis Only shows you how the
More informationDr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD /12/2014 Slide 1
Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD 21252 rkarne@towson.edu 11/12/2014 Slide 1 Intel x86 Aseembly Language Assembly Language Assembly Language
More informationLecture (09) x86 programming 8
Lecture (09) x86 programming 8 By: Dr. Ahmed ElShafee 1 Basic Input Output System BIOS BIOS refers to a set of procedures or functions that enable the programmer have access to the hardware of the computer.
More informationCSE 505 Lecture 8: Introduction to Assembly Language
Page1 Advantages of Assembly Language Low-level access to the computer Higher speed Total control over CPU (Must know what you are doing in order to make these advantages work) Disadvantages of assembly
More informationBAHAR DÖNEMİ MİKROİŞLEMCİLER LAB3 FÖYÜ
INTRODUCTION OF SEGMENT A typical program on 8086 consists of at least three segments Code segment: Contains instructions that accomplish certain tasks Data segment: Stores information to be processed
More informationComputer Architecture and System Software Lecture 06: Assembly Language Programming
Computer Architecture and System Software Lecture 06: Assembly Language Programming Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Assignment 3 due thursday Midterm
More informationLecture (08) x86 programming 7
Lecture (08) x86 programming 7 By: Dr. Ahmed ElShafee 1 Conditional jump: Conditional jumps are executed only if the specified conditions are true. Usually the condition specified by a conditional jump
More informationAssembly I: Basic Operations. Computer Systems Laboratory Sungkyunkwan University
Assembly I: Basic Operations Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Moving Data (1) Moving data: movl source, dest Move 4-byte ( long )
More informationVideo processing The INT instruction enables program to interrupt its own processing. Use INT instruction to handle inputs and outputs
Video processing The INT instruction enables program to interrupt its own processing. Use INT instruction to handle inputs and outputs INT 10H: screen handling INT 21H: for displaying screen output and
More informationExperiment 3. TITLE Optional: Write here the Title of your program.model SMALL This directive defines the memory model used in the program.
Experiment 3 Introduction: In this experiment the students are exposed to the structure of an assembly language program and the definition of data variables and constants. Objectives: Assembly language
More informationA4 Sample Solution Ch3
A4 Sample Solution Ch3 2. AL, AH, BL, BH,CL,CH,DLl, DH 3. AX, BX, CX, DX, SP, BP, SI, DI, CS, DS, ES, SS, FS, GS 4. EAX, EBX, ECX, EDX, ESP, EBP, EDI, ESI 5. RAX, RBX, RCX, RDX, RSP, RBP, RSI, RDI and
More informationASSEMBLY I: BASIC OPERATIONS. Jo, Heeseung
ASSEMBLY I: BASIC OPERATIONS Jo, Heeseung MOVING DATA (1) Moving data: movl source, dest Move 4-byte ("long") word Lots of these in typical code Operand types Immediate: constant integer data - Like C
More informationUNIVERSITY OF CALIFORNIA, RIVERSIDE
Final Page 1 of 7 UNIVERSITY OF CALIFORNIA, RIVERSIDE Computer Science Department CS61 Machine Organization & Assembly Language Final September 1, 2000 53 Name: Solution Key Student ID#: Please print legibly
More informationCS-202 Microprocessor and Assembly Language
CS-202 Microprocessor and Assembly Language Lecture 2 Introduction to 8086 Assembly Language Dr Hashim Ali Spring - 2019 Department of Computer Science and Engineering HITEC University Taxila!1 Lecture
More informationAssembly Language. Lecture 3 Assembly Fundamentals
Assembly Language Lecture 3 Assembly Fundamentals Ahmed Sallam Slides based on original lecture slides by Dr. Mahmoud Elgayyar General Concepts CPU Design, Instruction execution cycle IA-32 Processor Architecture
More informationModule 3 Instruction Set Architecture (ISA)
Module 3 Instruction Set Architecture (ISA) I S A L E V E L E L E M E N T S O F I N S T R U C T I O N S I N S T R U C T I O N S T Y P E S N U M B E R O F A D D R E S S E S R E G I S T E R S T Y P E S O
More informationCVE EXPLOIT USING 108 BYTES AND DOWNLOADING A FILE WITH YOUR UNLIMITED CODE BY VALTHEK
CVE-2017-11882 EXPLOIT USING 108 BYTES AND DOWNLOADING A FILE WITH YOUR UNLIMITED CODE BY VALTHEK First words of thank to Embedy Company to discover the initial exploit and POC of 44 bytes máximum, Ridter
More informationEthical Hacking. Assembly Language Tutorial
Ethical Hacking Assembly Language Tutorial Number Systems Memory in a computer consists of numbers Computer memory does not store these numbers in decimal (base 10) Because it greatly simplifies the hardware,
More informationAssembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language
4345 Assembly Language Assembly Language Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology Assembly Language 3-1 Overview of Assembly Language Advantages: Faster as compared
More informationMarking Scheme. Examination Paper. Module: Microprocessors (630313)
Philadelphia University Faculty of Engineering Marking Scheme Examination Paper Department of CE Module: Microprocessors (630313) Final Exam Second Semester Date: 12/06/2017 Section 1 Weighting 40% of
More informationCNIT 127: Exploit Development. Ch 1: Before you begin. Updated
CNIT 127: Exploit Development Ch 1: Before you begin Updated 1-14-16 Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend, such as Denial
More informationCPS104 Recitation: Assembly Programming
CPS104 Recitation: Assembly Programming Alexandru Duțu 1 Facts OS kernel and embedded software engineers use assembly for some parts of their code some OSes had their entire GUIs written in assembly in
More information8051 Microcontrollers
8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 8, 2016 Controller vs Processor Controller vs Processor Introduction to 8051 Micro-controller In 1981,Intel corporation
More informationreply db y prompt db Enter your favourite colour:, 0 colour db 80 dup(?) i db 20 k db? num dw 4000 large dd 50000
Declaring Variables in Assembly Language As in Java, variables must be declared before they can be used Unlike Java, we do not specify a variable type in the declaration in assembly language Instead we
More informationdb "Please enter up to 256 characters (press Enter Key to finish): ",0dh,0ah,'$'
PA4 Sample Solution.model large.stack 100h.data msg1 db "This programs scans a string of up to 256 bytes and counts the repetitions of the number 4206 and sums them.",0dh,0ah,'$' msg2 db "Please enter
More informationIA-32 Architecture. CS 4440/7440 Malware Analysis and Defense
IA-32 Architecture CS 4440/7440 Malware Analysis and Defense Intel x86 Architecture } Security professionals constantly analyze assembly language code } Many exploits are written in assembly } Source code
More informationCS165 Computer Security. Understanding low-level program execution Oct 1 st, 2015
CS165 Computer Security Understanding low-level program execution Oct 1 st, 2015 A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns
More informationAssembly I: Basic Operations. Jo, Heeseung
Assembly I: Basic Operations Jo, Heeseung Moving Data (1) Moving data: movl source, dest Move 4-byte ("long") word Lots of these in typical code Operand types Immediate: constant integer data - Like C
More informationProgram Exploitation Intro
Program Exploitation Intro x86 Assembly 04//2018 Security 1 Univeristà Ca Foscari, Venezia What is Program Exploitation "Making a program do something unexpected and not planned" The right bugs can be
More informationProcess Layout and Function Calls
Process Layout and Function Calls CS 6 Spring 07 / 8 Process Layout in Memory Stack grows towards decreasing addresses. is initialized at run-time. Heap grow towards increasing addresses. is initialized
More informationIntel 8086: Instruction Set
IUST-EE (Chapter 6) Intel 8086: Instruction Set 1 Outline Instruction Set Data Transfer Instructions Arithmetic Instructions Bit Manipulation Instructions String Instructions Unconditional Transfer Instruction
More informationCOMPUTER ENGINEERING DEPARTMENT
Page 1 of 14 COMPUTER ENGINEERING DEPARTMENT Jan. 7, 2010 COE 205 COMPUTER ORGANIZATION & ASSEMBLY PROGRAMMING Major Exam II First Semester (091) Time: 3:30 PM-6:00 PM Student Name : KEY Student ID. :
More informationLab 2: Introduction to Assembly Language Programming
COE 205 Lab Manual Lab 2: Introduction to Assembly Language Programming - page 16 Lab 2: Introduction to Assembly Language Programming Contents 2.1. Intel IA-32 Processor Architecture 2.2. Basic Program
More informationLecture 6. Assembler Directives
Lecture 6 Assembler Directives Assembler Directives Code generation flow Assembler directives Introduction Segment control Generic segment (SEGMENT, RSEG) Absolute segment (CSEG, DSEG and XSEG) Address
More informationELEC VIDEO BIOS ROUTINES
It is less confusing to the user if we remove unnecessary messages from the display before giving information or instructions. At the command prompt, we do this with the DOS command CLS. However, this
More informationINT 21H and INT 10H Programming and Macros
Dec Hex Bin 4 4 00000100 ORG ; FOUR INT 21H and INT 10H Programming and Macros OBJECTIVES this chapter enables the student to: Use INT 10H function calls to: Clear the screen. Set the cursor position.
More informationAssembly Language Programming
Assembly Language Programming Integer Constants Optional leading + or sign Binary, decimal, hexadecimal, or octal digits Common radix characters: h hexadecimal d decimal b binary r encoded real q/o - octal
More informationAssembly Language for Intel-Based Computers, 4 th Edition. Lecture 25: Interface With High-Level Language
Assembly Language for Intel-Based Computers, 4 th Edition Kip R. Irvine Lecture 25: Interface With High-Level Language Slide show prepared by Kip R. Irvine, Revision date: 07/07/2002 Modified on April
More informationAssignment 3. Problem Definition:
Att (2) Perm(5) Oral(3) Total(10) Sign with Date Assignment 3 Problem Definition: Write x86 ALP to convert 4-digit Hex number into its equivalent BCD number and 4-digit BCD number into its equivalent HEX
More informationmith College Computer Science CSC231 - Assembly Week #4 Dominique Thiébaut
mith College Computer Science CSC231 - Assembly Week #4 Dominique Thiébaut dthiebaut@smith.edu Homework Solutions Outline Review Hexdump Pentium Data Registers 32-bit, 16-bit and 8-bit quantities (registers
More informationLesson 4. Stack, Procedures and Macros
Lesson 4. Stack, Procedures and Macros Computer Structure and Organization Graduated in Computer Sciences / Graduated in Computer Engineering Graduated in Computer Sciences / Graduated in Computer Engineering
More informationUNIT 4. Modular Programming
1 UNIT 4. Modular Programming Program is composed from several smaller modules. Modules could be developed by separate teams concurrently. The modules are only assembled producing.obj modules (Object modules).
More information16.317: Microprocessor Systems Design I Fall 2014
16.317: Microprocessor Systems Design I Fall 2014 Exam 2 Solution 1. (16 points, 4 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling
More informationLab 3. The Art of Assembly Language (II)
Lab. The Art of Assembly Language (II) Dan Bruce, David Clark and Héctor D. Menéndez Department of Computer Science University College London October 2, 2017 License Creative Commons Share Alike Modified
More informationCSCI 334: Principles of Programming Languages. Computer Architecture (a really really fast introduction) Lecture 11: Control Structures II
1 byte{ 1 byte{ CSCI 334: Principles of Programming Languages Lecture 11: Control Structures II Computer Architecture (a really really fast introduction) Instructor: Dan Barowy Memory Instructions main
More informationThe Stack. Lecture 15: The Stack. The Stack. Adding Elements. What is it? What is it used for?
Lecture 15: The Stack The Stack What is it? What is it used for? A special memory buffer (outside the CPU) used as a temporary holding area for addresses and data The stack is in the stack segment. The
More information.code. lea dx,msg2. Page 1/8. Problem 1: Programming in Assembly [25 Points]
Problem : Programming in Assembly [ Points] The following assembly program is supposed to: receive three integer numbers from the console, call a function, name sort, function sort arranges the three input
More informationCS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 21: Generating Pentium Code 10 March 08
CS412/CS413 Introduction to Compilers Tim Teitelbaum Lecture 21: Generating Pentium Code 10 March 08 CS 412/413 Spring 2008 Introduction to Compilers 1 Simple Code Generation Three-address code makes it
More informationLab 3: Defining Data and Symbolic Constants
COE 205 Lab Manual Lab 3: Defining Data and Symbolic Constants - page 25 Lab 3: Defining Data and Symbolic Constants Contents 3.1. MASM Data Types 3.2. Defining Integer Data 3.3. Watching Variables using
More informationAddressing Modes on the x86
Addressing Modes on the x86 register addressing mode mov ax, ax, mov ax, bx mov ax, cx mov ax, dx constant addressing mode mov ax, 25 mov bx, 195 mov cx, 2056 mov dx, 1000 accessing data in memory There
More informationx86 assembly CS449 Spring 2016
x86 assembly CS449 Spring 2016 CISC vs. RISC CISC [Complex instruction set Computing] - larger, more feature-rich instruction set (more operations, addressing modes, etc.). slower clock speeds. fewer general
More informationCS499. Intel Architecture
CS499 Intel Architecture Intel Architecture References IA-32 Intel Architecture Software Developer s Manual, Volume 1: Basic Architecture Volume 2: Instruction Set Reference www.intel.com/design/pentiumii/manuals/
More informationCS 31: Intro to Systems ISAs and Assembly. Martin Gagné Swarthmore College February 7, 2017
CS 31: Intro to Systems ISAs and Assembly Martin Gagné Swarthmore College February 7, 2017 ANNOUNCEMENT All labs will meet in SCI 252 (the robot lab) tomorrow. Overview How to directly interact with hardware
More informationIntroduction to 8086 Assembly
Introduction to 8086 Assembly Lecture 6 Working with memory Why using memory? Registers are limited in number and size Program data Program code etc. The data segment dd 1234 dw 13 db -123 The data segment
More informationReverse Engineering Low Level Software. CS5375 Software Reverse Engineering Dr. Jaime C. Acosta
1 Reverse Engineering Low Level Software CS5375 Software Reverse Engineering Dr. Jaime C. Acosta Machine code 2 3 Machine code Assembly compile Machine Code disassemble 4 Machine code Assembly compile
More informationW4118: PC Hardware and x86. Junfeng Yang
W4118: PC Hardware and x86 Junfeng Yang A PC How to make it do something useful? 2 Outline PC organization x86 instruction set gcc calling conventions PC emulation 3 PC board 4 PC organization One or more
More informationLanguage of x86 processor family
Assembler lecture 2 S.Šimoňák, DCI FEEI TU of Košice Language of x86 processor family Assembler commands: instructions (processor, instructions of machine language) directives (compiler translation control,
More informationadministrivia today start assembly probably won t finish all these slides Assignment 4 due tomorrow any questions?
administrivia today start assembly probably won t finish all these slides Assignment 4 due tomorrow any questions? exam on Wednesday today s material not on the exam 1 Assembly Assembly is programming
More information