Assembly module

I am learning assembly language.

Is there a module in the assembly? I know that I can find the remainder using the formula Number = Divident * Divisor + Remainder.

I heard when we use the DIV syntax, is the remainder stored in one of the registers?

Edit 1: I am using Intel x86 architecture and developing it on Ubuntu.

+3
source share
2 answers

The DIV instruction returns the factor in AX and the remainder in DX in the x86 architecture.

+5
source

al <-Ax source div

ah <-Ax mod source

if the source size was a byte. ahcontains the remainder.

AX <- DX: DivX AX Source

DX <-DX: AX modem source

. DX .

+1

Source: https://habr.com/ru/post/1760268/


All Articles