;*********************************************************************** ; Filename: MEMREG.SS ; ; This sample SCRIPT shows the Memory to Memory Move and ; Register Read/Write capabilities of the 53C710/720. ;*********************************************************************** ; Memory to Memory Move instructions can be done to/from the 53C720's ; internal registers if the address given decodes to the memory mapped ; address of the 53C720. Below is the address for the SCRATCH register ; in little endian mode when the base address of the card is D800. ; Converting D800:6034 to an absolute address gives DE034 ABSOLUTE Scratch_Zero_Addr = 0x0DE034 ABSOLUTE Scratch_One_Addr = 0x0DE035 ABSOLUTE Scratch_Two_Addr = 0x0DE036 ABSOLUTE Scratch_Three_Addr = 0x0DE037 ; Relative buffers in memory ; Allignment buffer is added so that these buffers will be alligned at a ; long word boundry in memory. This was added so that memory-to-memory move ; instructions to/from the chips registers will not give illegal instruction ; interrupts when using the current revision of the debugger. RELATIVE Alignment_Buff = 0 RELATIVE Temp_Buff1 = Alignment_Buff + 2 RELATIVE Temp_Buff2 = Temp_Buff1 + 4 RELATIVE Byte_0 = Temp_Buff2 + 4 RELATIVE Byte_1 = Byte_0+1 RELATIVE Byte_2 = Byte_1+1 RELATIVE Byte_3 = Byte_2+1 ENTRY start start: ; Use Register Write to put 0xFF's in SCRATCH register move 0xFF to SCRATCH0 move 0xFF to SCRATCH1 move 0xFF to SCRATCH2 move 0xFF to SCRATCH3 ; Use Memory-to-Memory Move instruction to move 1 byte into the SCRATCH ; register from memory. move memory 1, Temp_Buff1, Scratch_Zero_Addr ; Now move that byte back out of the SCRATCH register move memory 1, Scratch_Zero_Addr, Temp_Buff2 ; Now use 2 Register Read/Write instructions to put 0xFF back in SCRATCH0. move 0xFF to SFBR move SFBR to SCRATCH0 ; Move 4 bytes from memory to the SCRATCH register using 4 separate ; byte wide moves to show different allignments move memory 1, Byte_0, Scratch_Zero_Addr move memory 1, Byte_1, Scratch_One_Addr move memory 1, Byte_2, Scratch_Two_Addr move memory 1, Byte_3, Scratch_Three_Addr ; Move 4 bytes out of the SCRATCH register and put them in memory move memory 1, Scratch_Zero_Addr, Byte_0 move memory 1, Scratch_One_Addr, Byte_1 move memory 1, Scratch_Two_Addr, Byte_2 move memory 1, Scratch_Three_Addr, Byte_3 ; Re-initialize the SCRATCH register to all 0xFF's. move 0xFF to SCRATCH0 move 0xFF to SCRATCH1 move 0xFF to SCRATCH2 move 0xFF to SCRATCH3 ; Now move 4 bytes at a time from memory into the SCRATCH register ; to show 32 bit accesses. Note that the address's of Temp_Buff1 and ; Scratch_Zero_Addr must have the same long word allignment (A0-A1 ; must be the same) move memory 4, Temp_Buff1, Scratch_Zero_Addr ; Now move the data back out of the SCRATCH register using a long ; word access move memory 4, Scratch_Zero_Addr, Temp_Buff2 ; Move 1 byte from memory to memory move memory 1, Temp_Buff1, Temp_Buff2 ; Move 2 bytes from memory to memory move memory 2, Temp_Buff1, Temp_Buff2 ; Move 3 bytes from memory to memory move memory 3, Temp_Buff1, Temp_Buff2 ; Move 4 bytes from memory to memory move memory 4, Temp_Buff1, Temp_Buff2 ; Put this in so the compiler recognizes Alignment_Buff move memory 1, Temp_Buff2 + 2, Alignment_Buff ; Interrupt saying we are all done int 0x0A