Efficient Assembly Language Programming

arithmetic and logic instructions arithmetic n.w
1 / 12
Embed
Share

Learn about arithmetic and logic instructions in assembly language, including multiplication, division, computing averages, and operating with arrays. Dive into practical examples and program snippets for better understanding.

  • Assembly Language
  • Arithmetic Instructions
  • Logic Instructions
  • Programming
  • Computer Science

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Arithmetic and logic Instructions Arithmetic and logic Instructions / 3 2024-2023 . . :

  2. Second Group Instructions MUL, DIV REG Memory DIV flags are undefined.

  3. DIV instruction when operand is a byte: AL = AX / operand AH = remainder. when operand is a word: AX = (DX AX) / operand DX = remainder.

  4. DIV instruction Q: Write a program in assembly language to compute Z=200 /4 MOV AX, 200 MOV BL, 4 DIV BL RET

  5. Q: Write a program in assembly language to compute C=(FD/9)*(FA-32) MOV AX,0FDH MOV Bl,09 DIV Bl MOV Bl,0FAH MOV Cl, 32H SUB Bl,Cl MUL Bl RET

  6. Q: Write a program in assembly language to Q: Write a program in assembly language to compute compute [2518]=(8+5)/(FA*32) [2518]=(8+5)/(FA*32)

  7. Q: Write a program in assembly language to compute the average of 5 degrees 80,88,90,80,88 ? ADD AX,80 ADD AX,88 ADD AX,90 ADD AX,80 ADD AX,88 MOV BX,05 DIV BX RET

  8. Q: Write a program in assembly language to compute the AV of array a1 elements? mov cx, 5 sum: add al,a1[si] inc si loop sum mov bl,5 div bl ret a1 db 1, 2, 3, 4, 5

  9. Third Group Instructions

  10. Third Group Instructions

  11. mov ax, 0FFFFH neg ax ret

  12. mov ax, 0FFFFH NOT ax ret

Related


More Related Content