문제

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).

도움이 되었습니까?

해결책

Did it this way :

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

다른 팁

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top