懇請大大教8051資料移動

1.Move data from on-chip SRAM 36H- 73H to external data RAM

20F9H to 2136H.

2.Move data from external data RAM 1200H -1250H to external data RAM 2200H-2250H

3.Move data from external data RAM 1234H-1285H to on-chip SRAM 22H -73H.

4.Move data from external code RAM 1200H -1250H to external data RAM 2200H-2250H. You may use hints in 4. to initialize code memory

老師出了這三個回家練習..

有大大能幫我解答嗎>"<

老師上課有錄影 可是影片看不懂

我真的有認真去聽..

Update:

1.Move data from on-chip SRAM 20H-40H to 5AH-7AH in REVERSE order.

That is, (20H) move to (7AH), (21H) move to (79H),…., (3FH) move to (5BH),

(40H) move to (5AH).

2.

Update 2:

2.Move data from external code RAM 1234H-1285H to on-chip SRAM 22H -73H.

You can use following instructions to initialize code memory :

ORG 1234H

TABLE: DB 03, 56H, 01H,……

Update 3:

上面2題是老師出的加分題

有大大能幫我解答嗎>"<

拜託拜託

2 Answers

Rating
  • 1 decade ago
    Favorite Answer

    A1:

    MOV R0,#36H

    MOV DPTR,#20F9H

    MOV R1,#3DH

    AGAIN:

    MOV A,@R0

    MOVX @DPTR,A

    INC R0

    INC DPTR

    DJNZ R1,AGAIN

    A2

    MOV DPTR,#1250H

    MOV R1,#50H

    AGAIN:

    MOVX A,@DPTR

    MOV DPH,#22H

    MOVX @DPTR,A

    MOV DPH,#12H

    INC DPTR

    DJNZ R1,AGAIN

    A3:

    MOV DPTR,#1234H

    MOV R0,#36H

    MOV R1,#51H

    AGAIN:

    MOVXA,@DPTR

    MOV @R0,A

    INC DPTR

    INC R0

    DJNZ R1,AGAIN

    A4:

    MOV DPTR,#1250H

    MOV R1,#50H

    AGAIN:

    CLR A

    MOVC A,@A DPTR

    MOV DPH,#22H

    MOVX @DPTR,A

    MOV DPH,#12H

    INC DPTR

    DJNZ R1,AGAIN

    2008-11-22 23:12:51 補充:

    請參考:

    http://tw.knowledge.yahoo.com/question/question?qi...

    2008-11-22 23:23:11 補充:

    1. On-chip SRAM ==> MOV

    2. External Data RAM ==> MOVX

    3. External Code RAM ==> MOVC

    另外, 第三點取決於硬體的設計, 其實也可能用 MOVX 來搬移

  • John
    Lv 6
    1 decade ago

    首先整理四個問題, 可看到RAM有幾個類型.

    1. On-chip SRAM

    2. External Data RAM

    3. External Code RAM

    請先查這三種類型的記憶體,

    其架構如何, 該如何存取.

    接著再來研究如何搬移.

Still have questions? Get your answers by asking now.