summaryrefslogtreecommitdiff
path: root/test/exitrep.asm
blob: 755f05d53e066084ae60f463783c802b90dfd633 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
%macro testrep 0-1
  %assign i 1
  %rep %1 4
    mov eax,i
    %if i==3
      %exitrep
    %endif
    mov ebx,i
    %warning in %?%1 iteration i
    %if i >= 3
	%error iteration i should not be seen
    %endif
    %assign i i+1
  %endrep
  ret
%endmacro

%macro testrep_nl 0-1.nolist
  %assign i 1
  %rep %1 4
    mov eax,i
    %if i==3
      %exitrep
    %endif
    %warning in %?%1 iteration i
    mov ebx,i
    %if i >= 3
	%error iteration i should not be seen
    %endif
    %assign i i+1
  %endrep
  ret
%endmacro


	testrep
	testrep .nolist

	testrep_nl
	testrep_nl .nolist