ASSEMBLER M. Antczak, S. Wąsik. Debug session: starting of the example.exe program debugging process debug example.exe checking the value that is stored.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

ax2 + bx + c 2x2 + 11x + 5 ac 2(5) = b =11 ( ) 2x2 + 10x + 1x
Jump Condition.
Slide 1 Insert your own content. Slide 2 Insert your own content.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
ADDING INTEGERS 1. POS. + POS. = POS. 2. NEG. + NEG. = NEG. 3. POS. + NEG. OR NEG. + POS. SUBTRACT TAKE SIGN OF BIGGER ABSOLUTE VALUE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Factoring Trinomials When a=1 ALWAYS check for GCF first! Factor trinomials in the standard form ax²+ bx + c Solve equations in the standard form ax²+
Progam.-(6)* Write a program to Display series of Leaner, Even and odd using by LOOP command and Direct Offset address. Design by : sir Masood.
Addition 1’s to 20.
Test B, 100 Subtraction Facts
Week 1.
Flow of Control Instruction/Control structure Looping structure Looping structure Branching structure Branching structure For assembly language program.
X-box Factoring. X- Box 3-9 Product Sum Factor the x-box way Example: Factor 3x 2 -13x (3)(-10)= x 2x 3x 2 x-5 3x +2.
Registers of the 8086/ /2002 JNM.
Tutorial 2 IDE for ARM 7 board (2). Outline Introduce the Debug mode of uVision4 2.
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
Flow Control Instructions
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Lecture 3 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
ICS312 Set 9 Logic & Shift Instructions. Logic & Shift Instructions Logic and Shift Instructions can be used to change the bit values in an operand. The.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#5) By Dr. Syed Noman.
Dr. José M. Reyes Álamo 1.  Review: ◦ of Comparisons ◦ of Set on Condition  Statement Labels  Unconditional Jumps  Conditional Jumps.
5. Assembly Language. Basics of AL Program data Pseudo-ops Array Program structures Data, stack, code segments.
Arithmetic Flags and Instructions
Executing and Linking an assembly program. Lesson plan Review Program logic and control Practice exercise Assembling, Linking and Executing Programs Practice.
1 ICS 51 Introductory Computer Organization Fall 2009.
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 5 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
Review of Assembly language. Recalling main concepts.
2/20/2016CAP 2211 Flow Control Instructions. 2/20/2016CAP 2212 Transfer of Control Flow control instructions are used to control the flow of a program.
Comparison Instructions Test instruction –Performs an implied AND operation between each of the bits in 2 operands. Neither operand is modified. (Flags.
Jumps, Loops and Branching. Unconditional Jumps Transfer the control flow of the program to a specified instruction, other than the next instruction in.
Assembly Language Wei Gao. Assembler language Instructions.
K.K. Leung Fall 2008Introductory Pentium Programming1 Pentium Architecture: Introductory Programming Kin K. Leung
Computer Architecture CST 250
Introduction to assembly programmıng language
Data Transfers, Addressing, and Arithmetic
EE3541 Introduction to Microprocessors
Computer Architecture
Assembly IA-32.
Assembly Language Programming Part 2
Microprocessor and Assembly Language
(The Stack and Procedures)
CS-401 Assembly Language Programming
Arithmetic Instructions
X86’s instruction sets.
فصل پنجم انشعاب و حلقه.
LING 408/508: Programming for Linguists
Fundamentals of Computer Organisation & Architecture
תכנות בסיסי בשפת סף פרק 5 מצגת 3.
(The Stack and Procedures)
Microprocessor Lab CSL1543 0:0:2
Flow Control Instructions
University of Gujrat Department of Computer Science
Microprocessor and Assembly Language
X86 Assembly Review.
EECE.3170 Microprocessor Systems Design I
High-level language structures
UNIT-II Assembly Language Programs Involving Logical
(The Stack and Procedures)
Jump & Loop instructions
Carnegie Mellon Ithaca College
Chapter 8: Instruction Set 8086 CPU Architecture
Computer Architecture and Assembly Language
Presentation transcript:

ASSEMBLER M. Antczak, S. Wąsik

Debug session: starting of the example.exe program debugging process debug example.exe checking the value that is stored in the AX register -rax AX 0000 : setting the value that will be stored in the AX register -rax AX 0000 : 1 program execution (go) -g debug session termination (quit) -q

Hexadecimal arithmetic: DecDig Base=10 HexDig A 10 B 11 C 12 D 13 E 14 F 15 Base=16 Addition 2A8 + 34C 8 C – 16 = A – F F4 5F4 Subtraction F 2 F B 3 BF 3BF HexDig Negation 0 F 1 E 2 D 3 C 4 B 5 A A 5 B 4 C 3 D 2 E 1 F 0 Negation (U2) FFD3 negation Negation (U2) FFD3 002C Negation (U2) FFD3 002C Negation (U2) FFD3 002C D

Basic assembler instructions set: ADD AX, BX AX = AX + BX SUB AX, BX AX = AX - BX NEG AX AX = (-1)*AX INC AX AX = AX + 1 DEC AX AX = AX – 1 MOV AX, BX AX = BX IMUL BX AX = AX * BX IDIV BX AX = AX / BX and DX = AX % BX while(a==b) { instrs } Jump instructions – used to jump to the memory place identified by particular address (e.g. code block label) : direct jump (without condition) JMP loop conditional jumps (when the condition is fulfilled) CMP AX, BX ; flags setting JNE finish Different possibilities: JNE != ; JE == ; JG > ; JL = ; Assume: a AX; b BX loop: instrs finish: int 3 Assume: a AX; b BX loop: CMP AX, BX instrs finish: int 3 Assume: a AX; b BX loop: CMP AX, BX instrs JMP loop finish: int 3 Assume: a AX; b BX loop: CMP AX, BX JNE finish instrs JMP loop finish: int 3 if(a>=b) instr1 else instr2 Assume: a AX; b BX ifCond: instr1 elseCond: instr2 finish: int 3 Assume: a AX; b BX ifCond: CMP AX, BX instr1 elseCond: instr2 finish: int 3 Assume: a AX; b BX ifCond: CMP AX, BX JL elseCond instr1 elseCond: instr2 finish: int 3 Assume: a AX; b BX ifCond: CMP AX, BX JL elseCond instr1 JMP finish elseCond: instr2 finish: int 3