INTRODUCTION TO MICROPROCESSOR Engr. Ammar Anwar Khan
TUTORIAL # 2 EE-353 Physical and Logical Addresses 2
MICROPROCESSOR
MEMORY 4
INSTRUCTION - MOV 5 MOV AX, BX Mneunomincs Move => MOV Addition => ADD Operands – Source, Destination AX, BX etc or may be zero operand (e.g., HLT=> halt)
SEGMENT REGISTERS 6
ADDRESSES addresses are specified as xxxx:yyyy where xxxx is value in segment register yyyy is offset Addresses are specified as relative to start of segment eg. Instruction Pointer relative to Code Segment
EXAMPLES 8 Logical Address CS:IP, DS:IP, ES:IP, SS:SP 3000:1500 Physical Address (20 bits) Shift Left CS, DS,ES or SS; Add the result to IP or SP =31500 is the Physical Address.
EXAMPLES 9 If CS=3000 and IP=1500 Offset =1500 Logical Address =3000:1500 Physical Address =31500 Lower range = =30000 Upper Range = FFFF=3FFFF
EXAMPLES 10 If SS=3500 and SP=FFEE Offset =FFFE Logical Address =3500:FFFE Physical Address =44FFE Lower range = =35000 Upper Range = FFFF=44FFF
STACK MEMORY 11 SS and SP Used to store value on the RUN PUSH => to store the value in the memory POP => Take out the value from the memory PUSH AX POP AX
STACK MEMORY 12
STACK MEMORY 13
LITTLE ENDIAN 14 Higher byte goes to Upper address Lower byte goes to Lower address MOV AX,6545 MOV [1500], AX [1500] = 45 [1501] = 65 Same for stack !!!!!
FLAG REGISTER 15
DEBUG- COMMAND PROMPT 16
DEBUG- COMMAND PROMPT 17
DEBUG- COMMAND PROMPT 18
DEBUG- COMMAND PROMPT 19
DEBUG- COMMAND PROMPT 20
End 21