Machine Learning
Machine Learning
Little Endian: The least significant byte (LSB) is stored first (at the lowest
memory address). For example, if we have the hex value 1234, it would
be stored in memory as 34 12.
Big Endian: The most significant byte (MSB) is stored first. The hex value
1234 would be stored in memory as 12 34.
1. 1234 → Stored as 34 12
2. ABFC → Stored as FC AB
3. B100 → Stored as 00 B1
4. B800 → Stored as 00 B8
Examples:
2
MOV CX, 6 ; Set loop counter to 6
MOV AX, 0 ; Initialize AX (accumulator) to 0
ADD_LOOP:
ADD AX, 6 ; Add 6 to AX
LOOP ADD_LOOP ; Decrease CX by 1 and repeat if CX != 0
Here’s how you can swap the contents using mathematical operations:
3
Q No 6: Assembly Program to Find the Maximum Element in an Array of
Ten Numbers
MOV SI, OFFSET ARRAY ; Point SI to the start of the array
MOV CX, 10 ; Set counter to 10 (number of elements)
MOV AX, [SI] ; Assume the first element is the max
FIND_MAX:
ADD SI, 2 ; Move to the next element
CMP AX, [SI] ; Compare AX with the current element
JG NEXT_ELEMENT ; If AX > [SI], go to next element
MOV AX, [SI] ; Otherwise, set AX to the current element
NEXT_ELEMENT:
LOOP FIND_MAX ; Decrease CX by 1 and repeat if CX != 0
; AX now holds the maximum value
If you need further explanations or modifications for any part, let me
know!