Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

8051程式設計

設計一程式,將RAM之30H~3FH記憶體的內容清除為0,同時將40H

~4FH記憶體的內容設定為F0,F1,F2,...及FFH.

1 Answer

Rating
  • 1 decade ago
    Favorite Answer

    INIT_SYSTEM :

    MOV R0,#30H

    MOV A,#0

    MOV COUNT,A

    CLEAR_DATA :

    MOV A,#00H

    MOV @R0,A

    INC R0

    MOV A,COUNT

    INC A

    MOV COUNT,A

    CJNE A,#17,CLEAR_DATA

    MOV A,#0

    MOV COUNT,A

    MOV A,#F0H

    MOV DATA,A

    MOV R0,#40H

    INSERT_DATA :

    MOV A,COUNT

    ANL A,DATA

    MOV @R0,A

    INC R0

    MOV A,COUNT

    INC A

    MOV COUNT,A

    CJNE A,#17,INSERT_DATA

    RET

    Source(s): 寫久了就會
Still have questions? Get your answers by asking now.