;---====================== Start Software License ======================--- ;--== ==-- ;--== This license governs the use of this software, and your use of ==-- ;--== this software constitutes acceptance of this license. Agreement ==-- ;--== with all points is required to use this software. ==-- ;--== ==-- ;--== 1. You may use this software freely for personal use. ==-- ;--== ==-- ;--== 2. You may use this software freely to determine feasibility for ==-- ;--== commercial use. ==-- ;--== ==-- ;--== 3. You may use this software for commercial use if the author ==-- ;--== has given you written consent. ==-- ;--== ==-- ;--== 4. You may modify this software provided you do not remove the ==-- ;--== license and copyright notice. ==-- ;--== ==-- ;--== 5. You may distribute this software and derivative works to ==-- ;--== personal friends and work colleagues only. ==-- ;--== ==-- ;--== 6. You agree that this software comes “as-is” and with no ==-- ;--== warranty whatsoever, either expressed or implied, including, ==-- ;--== but not limited to, warranties of merchantability or fitness ==-- ;--== for a particular purpose. ==-- ;--== ==-- ;--== 7. You agree that the author will not be liable for any damages ==-- ;--== relating from the use of this software, including direct, ==-- ;--== indirect, consequential or incidental. This software is used ==-- ;--== entirely at your own risk and should it prove defective, you ==-- ;--== will assume full responsibility for all costs associated with ==-- ;--== servicing, repair or correction. ==-- ;--== ==-- ;--== Your rights under this license are terminated immediately if you ==-- ;--== breach it in any way. ==-- ;--== ==-- ;---======================= End Software License =======================--- ;---====================== Start Copyright Notice ======================--- ;--== ==-- ;--== Filename ..... asm_bra_tests.txt ==-- ;--== Download ..... http://www.spacewire.co.uk ==-- ;--== Author ....... Steve Haywood (steve.haywood@ukonline.co.uk) ==-- ;--== Copyright .... Copyright (c) 2004 Steve Haywood ==-- ;--== Project ...... Raptor-16 ==-- ;--== Version ...... 1.00 ==-- ;--== Conception ... 20 August 2004 ==-- ;--== Modified ..... N/A ==-- ;--== ==-- ;---======================= End Copyright Notice =======================--- ;---========================= Start Description ========================--- ;--== ==-- ;--== This set of instructions check every single branch addressing ==-- ;--== mode of the Raptor-16 microprocessor and fully covers both the ==-- ;--== branch taken and branch not taken cases. ==-- ;--== ==-- ;--== If all the branches work then the D0 register will be loaded ==-- ;--== with the following sequence of words:- ==-- ;--== ==-- ;--== 0, 1, 2, ..., 23, 24, 25. ==-- ;--== ==-- ;--== Any missed words from the sequence or any -1's loaded into D0 ==-- ;--== indicate that an addressing mode has failed. ==-- ;--== ==-- ;--== Source assembles into 98 words and needs to be run for 8us. ==-- ;--== ==-- ;--== The full set of tests cover all possibilities has shown below:- ==-- ;--== ==-- ;--== Bra alw,Dn Bra alw,(An)+ Bra alw,#Label ==-- ;--== Bra nev,Dn Bra nev,(An)+ Bra nev,#Label ==-- ;--== Bra alw,An Bra alw,d(An) Bra alw,Label ==-- ;--== Bra nev,An Bra nev,d(An) Bra nev,Label ==-- ;--== Bra alw,(An) BraQ alw,#Label ==-- ;--== Bra nev,(An) BraQ nev,#Label ==-- ;--== Bra alw,-(An) Bra alw,Pn ==-- ;--== Bra nev,-(An) Bra nev,Pn ==-- ;--== ==-- ;--== Tests also check that the -(An) and (An)+ modes only apply ==-- ;--== pre-dec and post-inc register changes if a branch is taken. ==-- ;--== ==-- ;---========================== End Description =========================--- Skip BraQ Start ; Skip Test Data LocG LoadQ #15,D0 ; BraQ LocH ; LocI BraQ BadBoy ; Start LoadQ #0,D0 ; LoadQ #LocA,D1 ; Bra alw,D1 ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocA LoadQ #1,D0 ; LoadQ #BadBoy,D3 ; Bra nev,D3 ; Branch should not be taken LoadQ #2,D0 ; LoadQ #LocB,A3 ; Bra alw,A3 ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocB LoadQ #3,D0 ; LoadQ #BadBoy,A2 ; Bra nev,A2 ; Branch should not be taken LoadQ #4,D0 ; LoadQ #PtrLocC,A0 ; Bra alw,(A0) ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocC LoadQ #5,D0 ; LoadQ #BadPtr,A3 ; Bra nev,(A3) ; Branch should not be taken LoadQ #6,D0 ; LoadQ #DatA,A1 ; Bra alw,-(A1) ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocD LoadQ #7,D0 ; LoadQ #DatB,A5 ; Bra nev,-(A5) ; Branch should not be taken Move (A5),D0 ; Check No Pre-Dec LoadQ #9,D0 ; LoadQ #DatC,A5 ; Bra alw,(A5)+ ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocE Move (A5),D0 ; Check Post-Inc LoadQ #11,D0 ; LoadQ #DatD,A4 ; Bra nev,(A4)+ ; Branch should not be taken AddQ #1,A4 ; Move (A4),D0 ; LoadQ #12,D0 ; Bra alw,DatE(PC) ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocF LoadQ #13,D0 ; Bra nev,BadPtr(PC) ; Branch should not be taken LoadQ #14,D0 ; BraQ alw,#LocG ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocH LoadQ #16,D0 ; BraQ nev,#LocI ; Branch should not be taken LoadQ #17,D0 ; Move #LocJ,P3 ; Bra alw,P3 ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocJ LoadQ #18,D0 ; Move #BadBoy,P2 ; Bra nev,P2 ; Branch should not be taken LoadQ #19,D0 ; Bra alw,#LocK ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocK LoadQ #20,D0 ; Bra nev,#BadBoy ; Branch should not be taken LoadQ #21,D0 ; BraQ alw,LocL ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocL LoadQ #22,D0 ; BraQ nev,BadBoy ; Branch should not be taken LoadQ #23,D0 ; Bra alw,LocM ; Branch should be taken MoveQ #-1,D0 ; Should not be executed LocM LoadQ #24,D0 ; Bra nev,BadBoy ; Branch should not be taken LoadQ #25,D0 ; End BraQ Infinate ; BadBoy MoveQ #-1,D0 ; Infinate BraQ Infinate ; BadPtr Words BadBoy ; PtrLocC Words LocC ; Words LocD ; DatA Words 0 ; Words BadBoy ; DatB Words 8 ; DatC Words LocE ; Words 10 ; DatD Words BadBoy ; Words 12 ; DatE Words LocF ;