0% found this document useful (0 votes)
16 views23 pages

8255 Interfacong

The document provides a detailed explanation of binary arithmetic operations, including 1's and 2's complements, and assembly language instructions for division and rotation. It also covers memory addressing techniques and the use of registers in assembly programming. Various examples illustrate the conversion of decimal numbers to binary and the execution of arithmetic operations using assembly language commands.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views23 pages

8255 Interfacong

The document provides a detailed explanation of binary arithmetic operations, including 1's and 2's complements, and assembly language instructions for division and rotation. It also covers memory addressing techniques and the use of registers in assembly programming. Various examples illustrate the conversion of decimal numbers to binary and the execution of arithmetic operations using assembly language commands.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 23

-09/02

09 = 00001001
-09/02
09 = 00001001
1’s complement of 09 = 11110110
2’s complement of 09 = 11110111 = F7
MOV AL, F7H
MOV BL,02
IDIV BL
-0009/02
09 = 00001001
1’s complement of 09 = 11110110
2’s complement of 09 = 11110111 = F7
MOV AL, F7H
MOV BL,02 CBW COPIES THE SIGN BIT OF A BYTE
IN AL TO ALL THE BITS IN AH
IDIV BL (AX/BL)
Hence
MOV AL,F7
CBW (AH = FF, AL=F7)
MOV BL,02
IDIV BL
-1234/0002
1234 = 0001001000110100
1’s complement of 1234 = 1110110111001011
2’s complement of 1234 = 1110110111001100 =
EDCC
MOV AX, EDCC
MOV BX,0002
IDIV BX
-1234/0002
1234 = 0001001000110100
1’s complement of 1234 = 1110110111001011
2’s complement of 1234 = 1110110111001100 = EDCC
MOV AX, EDCC
MOV BX,0002 CWD COPIES THE SIGN BIT OF A WORD
IDIV BX (DXAX/BX) IN AX TO ALL THE BITS IN DX
HENCE
MOV AX,EDCC
CWD (DX = FFFF, AX=EDCC)
MOV BX,0002
IDIV BX (DXAX/BX)
ROR – ROTATE RIGHT (LSB INTO CARRY AND MSB AND OTHER
BITS SHIFT TO RIGHT)
ROL- ROTATE LEFT (MSB INTO CARRY AND LSB AND OTHER BITS
SHIFT TO LEFT)
RCR - ROTATE RIGHT THRU CARRY (LSB INTO CARRY AND CARRY
INTO MSB AND OTHER BITS SHIFT TO RIGHT)
RCL - ROTATE LEFT THRU CARRY (MSB INTO CARRY AND CARRY
INTO LSB AND OTHER BITS SHIFT TO LEFT)
FORMAT FOR EXAMPLE:
RCR BX,01
RCR BX,CL (If shifting is to be done more than once, count has to
be stored in CL)
RCR BYTEPTR[BX],01
RCR WORDPTR[BX],01
MOV CL, 03
MOV AX,007F
MOV BX,0505
ROL AX,CL
AND AH, BH
OR BL,AL
MOV CL, 03 CL = 03
MOV AX,007F AX=007F
MOV BX,0505 BX = 0505
ROL AX,CL AX = 03F8
AND AH, BH AX=01F8
OR BL,AL BX=05FD
Initializing pointers
MOV BX,1000
MEMWDS(this is a label and it can be anyword)
is assumed to point at the word beginning at
location 1000h in the data segment
MOV BX, MEMWDS
BL <= [1000]
BH <=[1001]
LEA BX, MEMWDS
BX<= 1000
MNEMONIC SEGMENT FOR SYMBOLIC REPRESENTATION
MEMORY ACCESS

LEA BX, MEMWDS DATA BX <= 1000


(flags unaffected)

LDS BX,DWORDPTR[SI] DATA BL<=[SI], BH<=[SI+1]


DS<=[SI+3,SI+2]
(flags unaffected)

LES BX,DWORDPTR[SI] DATA BL<=[SI], BH<=[SI+1]


ES<=[SI+3,SI+2]
(flags unaffected)
LEA SI, MEMWDS
LDS BX, DWORDPTR[SI]
MOV AL, [BX]
MEMORY LOCATION CONTENTS
1003 E0
1002 00
1001 80
1000(LABELLED AS MEMWDS) 10

BX = 8010
DS = E000
AL = [E8010]

You might also like