1 / 8

Assembly Programming

Assembly Programming. Notes for Practical 4. Basic Arithmetic. Addition Add destination, source Subtraction Sub destination, source Multiplication Division. Addition. 10 + 6 = 16 mov ax, 10 add ax, 6 Java: ax = 10; ax = ax + 6;. Subtraction. 10 – 6 = 4 mov ax, 10 sub ax, 6

rod
Download Presentation

Assembly Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Assembly Programming Notes for Practical 4 http://www.osdata.com/topic/language/asm/intarith.htm#integerarithmetic

  2. Basic Arithmetic • Addition • Add destination, source • Subtraction • Sub destination, source • Multiplication • Division http://www.osdata.com/topic/language/asm/intarith.htm#integerarithmetic

  3. Addition • 10 + 6 = 16 • mov ax, 10 • add ax, 6 • Java: ax = 10; ax = ax + 6; http://www.osdata.com/topic/language/asm/intarith.htm#integerarithmetic

  4. Subtraction • 10 – 6 = 4 • mov ax, 10 • sub ax, 6 • Java: ax = 10; ax = ax - 6; http://www.osdata.com/topic/language/asm/intarith.htm#integerarithmetic

  5. Multiplication • 4 * 5 (= 20) • mov ax, 4 • imul 5 • Java: ax = 4; ax = ax * 5; http://www.osdata.com/topic/language/asm/intarith.htm#integerarithmetic

  6. Division • 13 ÷ 5 ( = 2 remainder 3) • mov ax, 13 • idiv 5 • ax would have the quotient value • dx has the remainder value http://www.osdata.com/topic/language/asm/intarith.htm#integerarithmetic

  7. Prac 4 • 1. Fibonacci Series • Back-generate the series to 1. Ni = Ni-2 - Ni+1 ; N1 = 1 N2 = 1; for i>0 • 2. Long division • x divided by y, where x < y. • Use integer division to calculate decimals • 123 ÷ 100 = 1.23 http://www.osdata.com/topic/language/asm/intarith.htm#integerarithmetic

  8. For more learning!!! • http://www.osdata.com/topic/language/asm/intarith.htm#integerarithmetic http://www.osdata.com/topic/language/asm/intarith.htm#integerarithmetic

More Related