Adsense

write code to transfer block of data from 1FFFF104 to 1FFFF164 and blocksize is stores on 1FFFF100.

;please note here that data transfer done in word only

;first word transfer done between the addresses from 1FFFF1(04 - 05 - 06 - 07) to 1FFFF1(64 - 65 - 66 - 67)

;second word transfer done between the addresses from 1FFFF1(08 - 09 - 0A - 0B) to 1FFFF1(68 - 69 - 6A - 6B)

; and so on

; size of block will be available at location 1FFFF100

;Solution:

 TTL transfer
        AREA Myprog, CODE, READONLY
ENTRY
        EXPORT main
main
            LDR R7,=0x1FFFF100      ;first location initialize to the R7
            LDR R6,=0x1FFFF160    ;second location initialize to R6
            LDR R1,[R7,#0x00]        ;data number need to multiply of 4 as PC+4
            LSLS R1,R1,#0x02        
        ;multiply by 4 if words, 2 if half words and instruction not require in bytes are transferring
            LDR R3,=0x04    ; necessary to shift because PC+4   
Labl1    LDR R2,[R7,R3]    ;first word transfer to R2
            STR R2,[R6,R3]    ;first word store from R2
            ADDS R3,R3,#0x04    ;shift due to word transfer
            SUBS R1,R1,#0x04    ;
            BHI Labl1
done
            SWI &11
            END

Result:

Red colors: data fetch from memory

Green colors: data stored to the memory

No comments:

Post a Comment

Write a ARM cortex M0+ assembly language code based on arithmatc and logical instructions.

 Problem 1: Implement following code conversions to convert binary no 0x89ABCDEF(32-bits) into a) BCD (64-bits)   b) Gray (32-bits) Problem...