; Alternate version of Regist.asm     (RegistAlt.asm)

; Shows code generated by MASM, using .IF/.ELSE/.ENDIF
; directives as comments. The automatically generated
; label names are different from page 221, but the
; logic is the same.

INCLUDE Irvine32.inc

.data
TRUE = 1
FALSE = 0
gradeAverage  WORD 275	; test value
credits       WORD 12	; test value
OkToRegister  BYTE ?

.code
main PROC
	mov OkToRegister,FALSE

;.IF gradeAverage > 350
 	cmp  gradeAverage,350
 	jbe  @C0001
 	mov  OkToRegister,TRUE
	jmp  @C0008

;.ELSEIF (gradeAverage > 250) && (credits <= 16)
@C0001:
	cmp  gradeAverage,250
	jbe  @C0004
	cmp  credits,16
	ja   @C0004
	mov  OkToRegister,TRUE
	jmp  @C0008

;.ELSEIF (credits <= 12)
@C0004:
	cmp  credits,12
	ja   @C0008
	mov  OkToRegister,TRUE

;.ENDIF
@C0008:

main ENDP
end main

