Help me out please 1. Explain how storage space allocated for initialized data b
ID: 3598759 • Letter: H
Question
Help me out please
1. Explain how storage space allocated for initialized data by the following instructions
TSU_ENGINEERING DB ‘Y’
NUMBER DW 45066
NEG_NUMBER DW -45066
2. Explain the action of the Assembly language instructions below: MOV DX, 0302H OUT DX, AL IN AX, DX
3. If CS=24F6H and IP=634AH, show (a) the logical address, and (b) the offset address. Calculate (c) the physical address, (d) the lower range, and (e) the upper range of the code segment.
4. Consider the instructions below. What will happen in (i) and (ii)? (i) ADD AX, [4000] (ii) ADD AX, 4000H
Explanation / Answer
1.
DB - Define Byte. Allocate 1 bytes i.e. 8 bits
DW - Define Word. Generally allocate 2 bytes on a typical x86 32-bit system
And the allocation is done as following
Each byte of character is stored as its ASCII value in hexadecimal.
Each decimal value is automatically converted to its 16-bit binary equivalent and stored as a hexadecimal number.
Processor uses the little-endian byte ordering.
Negative numbers are converted to its 2's complement representation.
Short and long floating-point numbers are represented using 32 or 64 bits, respectively.
Now the example -
TSU_ENGINEERING DB ‘Y’ // The above point one say each value is stored as ASCII, ASCII of y = 79H so just the byte 79H is stored in TSU_ENGINEERING.So this instruction Declare a byte, referred to as location TSU_ENGINEERING, containing the value 79H.
NUMBER DW 45066 // 45066 D = B00A h (as from above point 2 each decimal value is stored in a hexadecimal number). It allocate 2 bytes of memory for the word location NUMBER containing B00Ah.
NEG_NUMBER DW -45066 // As per above 4 point Negative numbers are stored in its 2's complement representation. It allocate 2 bytes of memory for the word location NEG_NUMBER containing 4FF6h.
2.
MOV DX, 0302H // move value 0302H into the DX data register.
OUT DX, AL // the value of DX is put on the output register AL for outputing the value to the port.(in short output data is put on AL from DX)
IN AX, DX // the value of In register AX is put into DX data register. (in short input data is put on DX from AX)
4.
i) ADD AX, [4000] // add the value stored in memory location 4000h to AX.
(ii) ADD AX, 4000H // add the value 4000h to AX.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.