1 2.EXTERN MY_LABEL2; 3.section .text; 4 5// 6//2 Program Flow Control 7// 8 9 10//JUMP ( Preg ) ; /* indirect to an absolute (not PC-relative)address (a) */ 11//Preg: P5-0, SP, FP 12 13JUMP (P0); 14JUMP (P1); 15JUMP (P2); 16JUMP (P3); 17JUMP (P4); 18JUMP (P5); 19JUMP (SP); 20JUMP (FP); 21 22//JUMP ( PC + Preg ) ; /* PC-relative, indexed (a) */ 23JUMP (PC+P0); 24JUMP (PC+P1); 25JUMP (PC+P2); 26JUMP (PC+P3); 27JUMP (PC+P4); 28JUMP (PC+P5); 29JUMP (PC+SP); 30JUMP (PC+FP); 31 32 33//JUMP pcrelm2 ; /* PC-relative, immediate (a) or (b) */ 34 35JUMP 0X0; 36JUMP 1234; 37JUMP -1234; 38JUMP 2; 39JUMP -2; 40 41MY_LABEL1: 42//JUMP.S pcrel13m2 ; /* PC-relative, immediate, short (a) */ 43JUMP.S 0X0; 44JUMP.S 1234; 45JUMP.S -1234; 46JUMP.S 2; 47JUMP.S -2; 48 49//JUMP.L pcrel25m2 ; /* PC-relative, immediate, long (b) */ 50JUMP.L 0XFF800000; 51JUMP.L 0X007FFFFE; 52JUMP.L 0X0; 53JUMP.L 1234; 54JUMP.L -1234; 55JUMP.L 2; 56JUMP.L -2; 57 58//JUMP user_label ; /* user-defined absolute address label, */ 59JUMP MY_LABEL1; 60JUMP MY_LABEL2; 61 62JUMP MY_LABEL1-2; 63JUMP MY_LABEL2-2; 64 65//IF CC JUMP pcrel11m2 ; /* branch if CC=1, branch predicted as not taken (a) */ 66IF CC JUMP 0xFFFFFE08; 67IF CC JUMP 0x0B4; 68IF CC JUMP 0; 69 70//IF CC JUMP pcrel11m2 (bp) ; /* branch if CC=1, branch predicted as taken (a) */ 71IF CC JUMP 0xFFFFFE08(bp); 72IF CC JUMP 0x0B4(bp); 73 74//IF !CC JUMP pcrel11m2 ; /* branch if CC=0, branch predicted as not taken (a) */ 75IF !CC JUMP 0xFFFFFF22; 76IF !CC JUMP 0X120; 77 78//IF !CC JUMP pcrel11m2 (bp) ; /* branch if CC=0, branch predicted as taken (a) */ 79IF !CC JUMP 0xFFFFFF22(bp); 80IF !CC JUMP 0X120(bp); 81 82//IF CC JUMP user_label ; /* user-defined absolute address label, resolved by the assembler/linker to the appropriate PC-relative instruction (a) */ 83IF CC JUMP MY_LABEL1; 84IF CC JUMP MY_LABEL2; 85 86//IF CC JUMP user_label (bp) ; /* user-defined absolute address label, resolved by the assembler/linker to the appropriate PC-relative instruction (a) */ 87IF CC JUMP MY_LABEL1(bp); 88IF CC JUMP MY_LABEL2(bp); 89 90//IF !CC JUMP user_label ; /* user-defined absolute address label, resolved by the assembler/linker to the appropriate PC-relative instruction (a) */ 91IF !CC JUMP MY_LABEL1; 92IF !CC JUMP MY_LABEL2; 93 94//IF !CC JUMP user_label (bp) ; /* user-defined absolute address label, resolved by the assembler/linker to the appropriate PC-relative instruction (a) */ 95IF !CC JUMP MY_LABEL1(bp); 96IF !CC JUMP MY_LABEL2(bp); 97 98//CALL ( Preg ) ; /* indirect to an absolute (not PC-relative) address (a) */ 99CALL(P0); 100CALL(P1); 101CALL(P2); 102CALL(P3); 103CALL(P4); 104CALL(P5); 105 106 107//CALL ( PC + Preg ) ; /* PC-relative, indexed (a) */ 108CALL(PC+P0); 109CALL(PC+P1); 110CALL(PC+P2); 111CALL(PC+P3); 112CALL(PC+P4); 113CALL(PC+P5); 114 115//CALL pcrel25m2 ; /* PC-relative, immediate (b) */ 116CALL 0x123456 ; 117CALL -1234; 118 119//CALL user_label ; /* user-defined absolute address label,resolved by the assembler/linker to the appropriate PC-relative instruction (a) or (b) */ 120CALL MY_LABEL1; 121CALL MY_LABEL2; 122 123RTS ; // Return from Subroutine (a) 124RTI ; // Return from Interrupt (a) 125RTX ; // Return from Exception (a) 126RTN ; // Return from NMI (a) 127RTE ; // Return from Emulation (a) 128 129lsetup ( 4, 4 ) lc0 ; 130 131lsetup ( beg_poll_bit, end_poll_bit ) lc0 ; 132NOP;NOP; 133beg_poll_bit: R0=1(Z); 134end_poll_bit: R1=2(Z); 135 136lsetup ( 4, 6 ) lc1 ; 137 138lsetup ( FIR_filter, bottom_of_FIR_filter ) lc1 ; 139NOP; 140FIR_filter: R0=1(Z); 141bottom_of_FIR_filter: R1=2(Z); 142 143lsetup ( 4, 8 ) lc0 = p1 ; 144 145lsetup ( 4, 8 ) lc0 = p1>>1 ; 146 147loop DoItSome LC0 ; /* define loop DoItSome with Loop Counter 0 */ 148loop_begin DoItSome ; /* place before the first instruction in the loop */ 149R0=1; 150R1=2; 151loop_end DoItSome ; /* place after the last instruction in the loop */ 152 153loop DoItSomeMore LC1 ; /* define loop MyLoop with Loop Counter 1*/ 154 155 156