Coversion

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 19

Conversion is basically converting the formats of Data.

Ideally :
Binary Coded Decimals and Integers

32 bit Real numbers and 32 bit integers

BTI BCD to Integer


The BCD to Integer instruction converts a three place BCD number into 16 bit Integer. + 9 1 5

L MW10

0 0 0 0

1 0 0 1

0 0 0 1
BCD to Integer

0 1 0 1 + 915 BCD

BTI 0 0 0 0 0 0 1 1

T MW20

+ 915 Integer

BTD BCD to Double Integer


+ 0 1 5 7 8 2 1

L MD10

0000 0000 0001 0101

0111 1000 0010 0001

BCD to Integer BTD

T MD20

0000 0000 0000 0010

0110 1000 0111 1101


+ 157821 Integer

ITB Integer to BCD

L MD10

1111

1110

0110

0011 - 413 Integer

ITB

T MD20

1111

0100

0001

0011

DTB Double Integer to BCD


1111 1111 1111 1111 1111 1101 0100 0011 - 701 Integer Integer to BCD DTB

L MD10

T MD20

1111 0000 0000 0000

0000 0111 0000 0001

ITD Integer to Double Integer


1111 1111 1111 0110 L MW10

ITD

Integer to Double Integer

T MD20

1111 1111 1111 1111

1111 1111 1111 0110

DTR Double Integer to Real


The Double Integer to Real (DTR) converts a 32 bit integer in accumulator 1 to a 32 bit IEEE floating point (REAL) number. If necessary the instruction rounds the result. L MD10 DTR T MD20

Converting 32 Bit Floating Point number to 32 Bit Integers.

RND RND+

RNDTRUNC

RND Converts 32 Bit Real Number Into 32 Bit Integer and rounds it to nearest whole Number. Example: L MD10 RND T MD20 Integer +100 Integer -100 Real +100.5 Real 100.5

RND+
Converts 32 Bit Real Number Into 32 Bit Integer and rounds it to nearest smallest whole Number greater than or equals to Real Number under conversion. Example: L MD10 RND + T MD20 Integer +101 Integer -100 Real +100.5 Real 100.5

RNDConverts 32 Bit Real Number Into 32 Bit Integer and rounds it to nearest largest whole Number less than or equals to Real Number under conversion. Example: L MD10 RND T MD20 Integer +100 Integer -101 Real +100.5 Real 100.5

TRUNC
Converts 32 Bit Real Number Into 32 Bit Integer and truncates the decimal part of the Real Number under conversion. Example:

L MD10
TRUNC

Real +100.5

Real 100.5

T MD20

Integer +100

Integer -100

CAW - Reversing the Order of Bytes within Accumulator 1


L MW10 0101 1111 1010 0000 1111 1010 0101 0000

CAW

T MD20

0101 1111 1010 0000 0101 0000 1111 1010

CAD - Reversing the Order of Bytes within Accumulator 1


L MW10 0101 1111 1010 0000 1111 1010 0101 0000

CAD

T MD20

0101 0000 1111 1010 1010 0000 0101 1111

PUSH - moves the contents of accumulator 1 to accumulator 2


Accu 2
H G F E D

Accu 1
C B A

Accu 2

Accu 1

POP - moves the contents of accumulator 2 to accumulator 1


Accu 2
H G F E D

Accu 1
C B A

Accu 2

Accu 1

TAK - exchanges the contents of accumulator 1 and accumulator 2


Accu 2
H G F E D

Accu 1
C B A

Accu 2

Accu 1

ENT : Shifts the contents of acuumulator 2 and 3 to the next higher accumulator
ACCU 1 ACCU 2 ACCU 3 ACCU 4

The contents of accumulator 1 and 2 remains unchanged.

LEAVE : Shifts the contents of acuumulator 3 and 4 to the next lower accumulator
ACCU 1 ACCU 2 ACCU 3 ACCU 4

The contents of accumulator 1 and 4 remains unchanged.

Thank You !

You might also like