32-Bit Instruction Set

IFS

Conditionally Execute Next Instruction

Operation:

Assembler Syntax:

Example:

if (condition IMM4 is false) then begin

if (Mem16[PC + 2] is PFX) then PC PC + 6

else PC PC + 4

end

IFS cc_IMM4

IFS cc_ne

BSR SendIt ; only call if Z flag set

NOP ; (delay slot) executed in either case

2

32-Bit Set

Description:

Condition Codes:

1These condition codes have different numeric values for IFS and SKPS instructions.

Instruction Format:

Instruction Fields:

Execute next instruction if specified condition is true, skip if condition is false. If the next instruction is PFX, then both PFX and the instruction following PFX are skipped together.

Settings:

cc_nc

0x0

(not C)

 

 

 

cc_c

0x1

(C)

 

 

 

cc_nz

0x2

(not Z)

 

 

 

cc_z

0x3

(Z)

 

 

 

cc_pl

0x4

(not N)

 

 

 

cc_mi

0x5

(N)

 

 

 

cc_lt

0x6

(N xor V)

 

 

 

cc_ge

0x7

(not (N xor V))

 

 

 

cc_gt

0x8

(Not (Z or (N xor V)))

 

 

 

cc_le

0x9

(Z or (N xorV))

 

 

 

cc_nv

0xa

(not V)

 

 

 

cc_v

0xb

(V)

 

 

 

cc_hi

0xc

(not (C or Z))

 

 

 

cc_la

0xd

(C or Z)

 

 

 

Additional alias flags allowed:

 

 

cc_cs = cc_c

cc_n = cc_mi

cc_cc = cc_nc

cc_vc = cc_nv

cc_eq = cc_z

cc_vs = cc_v

cc_ne = cc_nz

cc_p = cc_pl

Codes mean execute if, e.g., ifs cc_eq means execute if equal i4w

IMM4 = 4-bit immediate value

Instruction

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

0

1

1

1

1

1

1

0

1

1

1

0

 

 

IMM4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Altera Corporation

57

Page 69
Image 69
Excalibur electronic A-MNL-NIOSPROG-01.1 manual Ifs, Conditionally Execute Next Instruction