Conditional Processing Flashcards
AND operation betweent he pair of the matching bits in the two operands:
AND destination, source
NOTE: 1-T and 0-F
OR operation between the pair of matching bits in two operands:
OR destination, source
NOTE: 1-T and 0-F
XOR operation between the pair of matching bits in two operands:
XOR destination, source
NOTE: 0 & 0 = 0; 1 & 1 = 0
NOT operation on a single destination operand:
NOT destination
Bit- Mapped Sets
Binary bits indicate set membership; Efficient use of storage; Also known as bit vectors. It is like creating a bijection from the indices to the elements, where there is no necessity to convert to/from bit representation of the set from the universal set.
Is the bit mapped set in the assembly language use the bitwise operations to manipulate the individual bits within a binary word or a memory location?
Yes, it is true. This help sus in the storage management as in computer graphics, where each bits corresponds to each pixel, the bit is used to store the state of the pixel rather than byte. There are fast operations such as AND, OR and other which are used to cmbine the images if needed.
Bit vecotr here generally refers to the use of the fixed size array of bits to represent a collection of elements.
ASCII character ‘a’
97
ASCII character ‘A’
65
Which bit is cleared out to convert the lowercase a into uppercase A, in the AL register:
bit 5
0-9 (ASCII):
48-57
How can you turn the caps lock on using the operation OR?
Set the bit 6;
mov ax, 40h; loads the segment address of the the BIOS data area into ax
mov ds, ax; Set the ds to BDA segment
mov bx, 17h; Load the offset of the keyboard flag into the bx
or BYTE PTR [bx], 01000000; Turn on the caps lock key
Jump to a label if the integer is even?
mov ax, wordVal
add ax, 1
jz EvenVals
If the Zero flag is set, jump to the label.
LSB
the right most bit
not set LSB == zero flag set => jump to the even value, and vice-versa
If the integer is negative
cmp ax, 0
jl Negative Val
Jump to a label if the value in AL is not zero:
or al, al
jnz IsNotZero
Does Oring a number with itself chnages its value?
No
Test Instruction perform a bitwise AND operation between two operands (hence, non destructive), but____________
it does not stores the result. It just update the flag register based on the result.
NOTE: test al, 00000001b
jnz ValueNotFound
CMP instruction:
comapres the destination operand to the source operand. Non destructive subtraction of the spurce from the destination. It does not chnage th evalue in the destination.
Is the sign flag equal to the overflow flag in the given instructions below?
mov al, -1
cmp al, 5
No
Jcond Instruction:
A Jcond branches to a label when the specific flag or registers conditions are met.