Instructions for Arithmetic and Logic Operations in Assembly Language

lab lab 4 4 and logic instructions second group n.w
1 / 6
Embed
Share

Explore the second group of instructions in assembly language, including MUL and DIV operations affecting specific flags, as well as examples of MUL and DIV instructions with different operand sizes. Learn how to write an assembly program to compute a formula using these instructions.

  • Assembly Language
  • Arithmetic Operations
  • Logic Instructions
  • Programming

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. Lab Lab 4 4 and Logic Instructions Second Group Second Group Arithmetic Arithmetic and Logic Instructions . . :

  2. Second Group Instructions MUL, DIV REG Memory MUL instructions affect these flags only: CF, OF When result is over operand size these flags are set to 1, when result fits in operand size these flags are set to 0. For DIV flags are undefined.

  3. MUL instruction when operand is a byte: AX = AL * operand. when operand is a word: (DX AX) = AX * operand.

  4. Second Group Instructions DIV Source This instruction is used to divide an word by a byte or to divide an double word (32 bits) by a word. AX= AX/ Byte DXAX= DX AX / Word

  5. DIV instruction DIV - divide: when operand is a byte: AL = AX / operand AH = remainder (modulus). . when operand is a word: AX = (DX AX) / operand DX = remainder (modulus). .

  6. Second Group Instructions Q: Write an assembly language program to compute C=(5/9)*(F-32) MOV AX,05 MOV BX,09 DIV BX MOV BX,0FH MOV CX, 32H SUB BX,CX MUL BX RET

Related


More Related Content