Is it possible to use the switch macro like in C++ to execute the same code for multiple cases?
Like in c++ if I wanted to do the same code for case 3,4, and 5 I could do
Case 0:
// some code
break;
case 2:
// some code
;break
case 3:
case 4:
case 5:
// some code
Greg Falen's macros can do that, but using what I think is a Pascal syntax instead of the C syntax:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
.data
.code
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
start:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
mov ebx, 0
.WHILE ebx < 8
print ustr$(ebx),13,10
switch ebx
case 0
print "case 0",13,10
case 1..2,5,7
print "case 1..2,5,7",13,10
case 3
print "case 3",13,10
default
print "default",13,10
endsw
inc ebx
.ENDW
inkey "Press any key to exit..."
exit
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start
0
case 0
1
case 1..2,5,7
2
case 1..2,5,7
3
case 3
4
default
5
case 1..2,5,7
6
default
7
case 1..2,5,7