Specifications

4-32 Programmer’s Guide Sega
Psy-Q Development System
CASE and ENDCASE
Description The CASE directive is used to select code in a multiple-choice situation. The CASE
argument defines the expression to be evaluated; if the argument(s) after the equals
sign are true, the code that follows is assembled. The equals-question mark case is
selected if no previous case is true.
Syntax CASE expression
=expression[,expression]
=?
ENDCASE
See Also IF conditionals
Remarks In the absence of a equals-question mark (=?) case, if the existing cases are
unsuccessful, the case-defined code is not assembled.
Examples The following is an alternative for the example listed under the IF directive - see
chapter 5.
Target equ Sega-MD
...
case Target
=Sega-MD
sec_dir equ 2
=Sega-CD
sec_dir equ 1
=? dc.b "New Version",0
sec_dir equ 3
endcase