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).
I once had to write this for a boot prom (boot monitor) for a HD-mikko - a variant of Mikromikko 1.
; !----------------------------------------------------
; ! sptohl 0090
; !
; ! moves sp to hl (the value of sp before the call)
; !
; ! on return :
; ! hl = sp
; ! other registers are saved
; !
sptohl :
push psw
lxi h,00000h
ana a
dad sp
inx h
inx h
inx h
inx h
pop psw
ret
Did it this way :