; ; group w, test 1 ; ; sram addressing m4_include(..\tmacros.h) INIT_TEST(u,0x04) ; declare symbols here SYM(next0) SYM(next1) SYM(next2) SYM(next3) SUBTEST(1) ; set up stack ld.16 a,0x7000 copy sp,a ; set things up call setup_page_table ; store 0x4321 to location 0x5000 ld.16 a,0x4321 ld.16 b,0x5000 st.16 0(b),a ; Test data ref - should be 0x4321 ld.16 b,0x5000 ld.16 a,0(b) cmpb.eq.16 a,0x4321,next2 br fail next2: ; remap data page 11 to sram page 11 ld.16 a,0xe00a ld.16 b,0x5000 wdpte a,(b) ; turn paging on call paging_on ; Use test location 0x5000, stuff 0x1234 in data ld.16 b,0x5000 ld.16 a,0x1234 st.16 0(b),a ; Test data ref - should be 0x1234 ld.16 a,0(b) cmpb.eq.16 a,0x1234,next0 br fail next0: ; Now, restore page 11 to device memory ld.16 a,0xc00a ld.16 b,0x5000 wdpte a,(b) ; Test data ref - should be 0x4321 ld.16 b,0x5000 ld.16 a,0(b) cmpb.eq.16 a,0x4321,next1 br fail next1: ; Just be redundant, turn off paging and we should get the same thing call paging_off ld.16 b,0x5000 ld.16 a,0(b) cmpb.eq.16 a,0x4321,next3 br fail next3: ; Clean up call paging_off call setup_page_table ; Finally, when done branch to pass END_TEST