Search code examples
assembly8085

How to Store value in Stack Pointer Register to Memory (8085)?


say I have a 16-bit address 1964h in SP register, how to copy this address to a consecutive 8-bit memory in 8085 ?

PS: I'm using SP for general purpose operations (eg. to store operands).


Solution

  • Did it this way :

        lxi h,0h        ; initialize hl to zero
        dad sp          ; add sp to hl
        shld [dest]     ; store to memory