            .386p
_CODE       segment use16
            assume cs:_CODE, ds:_DATA, ss:_STACK
_CODE       ends
_DATA       segment use16

_ADAM       DB   2 DUP(?)
_EVA        DB   1 DUP(?)
_CAESAR     DB   200 DUP(?)
_DAVID      DB   10 DUP(?)

            PUBLIC _ADAM,_EVA,_CAESAR,_DAVID,
_DATA	    ends

_CODE       segment use16
            assume  cs:_CODE,ds:_DATA,ss:_STACK

_TEST      PROC NEAR
            LEA  SI,_CAESAR
            ADD  SI,Word Ptr [_ADAM]
            ADD  SI,Word Ptr [_ADAM]
            MOV  AX,Word Ptr [SI]
            MOV  Word Ptr [_ADAM],AX
            LEA  SI,_CAESAR
            ADD  SI,Word Ptr [_ADAM]
            ADD  SI,Word Ptr [_ADAM]
            MOV  AX,Word Ptr [SI]
            MOV  Word Ptr [_ADAM],AX
            MOV  AX,Word Ptr [_ADAM]
            CMP  AX,-20
            SETE AL
            CMP  AL,1
            JNE  _1
            MOV  AX,3
            IMUL Word Ptr [_ADAM]
            LEA  SI,_CAESAR
            ADD  SI,AX
            ADD  SI,AX
            MOV  AX,Word Ptr [SI]
            CMP  AX,17
            SETG AL
            MOV  Byte Ptr [_EVA],AL
            JMP  _2
_1:
_4:
            LEA  SI,_DAVID
            ADD  SI,5
            MOV  AL,Byte Ptr [SI]
            CMP  AL,1
            JNE  _3
            LEA  SI,_CAESAR
            ADD  SI,3
            ADD  SI,3
            MOV  AX,Word Ptr [_ADAM]
            CWD
            IDIV Word Ptr [SI]
            MOV  BX,5
            SUB  BX,AX
            MOV  AX,Word Ptr [_ADAM]
            IMUL BX
            MOV  Word Ptr [_ADAM],AX
            JMP  _4
_3:
_2:
            LEA  SI,_DAVID
            ADD  SI,8
            MOV  AX,Word Ptr [_ADAM]
            CMP  AX,1000
            SETL AL
            MOV  BL,Byte Ptr [_EVA]
            OR   BL,AL
            MOV  Byte Ptr [SI],BL
            RET
_TEST       ENDP
start:
            MOV  AX, SEG _DATA
            MOV  DS,AX
            CALL _TEST
            MOV  AX,4C00h
            INT  21h
_CODE       ends
_STACK      segment para stack
            db 800 dup (?)
_STACK      ends
     	      end   start
