a certain point in a program may be needed later in the program. This data is stored in the stack and retrieved when needed. Because the number of general purpose registers (GPRs) in a microprocessor is limited–hence not all the temporary data can be stored in them and this is where the stack plays its part. What are the software instructions related to operations? Ans. The following are stack related software instructions: LXI SP, address PUSH rp, POP rp PUSH PSW, POP PSW XTHL, SPHL CALL RET – DAD SP Mark Questions Write an assembly language program to add two 16-bit numbers. ALGORITHM: Initialize memory pointer to data location. Get the first number from memory and store in Register pair. Get the second number in memory and add it to the Register pair. Store the sum & carry in separate memory locations. PROGRAM: ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT 8000 LHLD 8050H Load the augend in DE pair through HL pair. 8001 8002 8003 XCHG 8004 LHLD 8052H Load the addend in HL pair. 8005 8006
a certain point in a program may be needed later in the program. This data is stored in the stack and retrieved when needed. Because the number of general purpose registers (GPRs) in a microprocessor is limited–hence not all the temporary data can be stored in them and this is where the stack plays its part. What are the software instructions related to operations? Ans. The following are stack related software instructions: LXI SP, address PUSH rp, POP rp PUSH PSW, POP PSW XTHL, SPHL CALL – RET DAD SP Mark Questions Write an assembly language program to add two 16-bit numbers. ALGORITHM: Initialize memory pointer to data location. Get the first number from memory and store in Register pair. Get the second number in memory and add it to the Register pair. Store the sum & carry in separate memory locations. PROGRAM: ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT 8000 LHLD 8050H Load the augend in DE pair through HL pair. 8001 8002 8003 XCHG 8004 LHLD 8052H Load the addend in HL pair. 8005 8006
microprocessors-and-applications-model-questions-answers.docx