home *** CD-ROM | disk | FTP | other *** search
- PAGE ,132
- Title Yes/No Response Batch SubProcess
-
- Cseg Segment para public 'CODE'
- Assume Cs:Cseg,Ds:Cseg,Es:Cseg,Ss:Cseg
- org 100h
-
- MAIN proc near ; This is the main procedure
- Mov Ah,1 ; inputs char
- Int 21h ; Call DOS to do it
- Push Ax ; Save the hell
- Mov Ah,2 ; Carriage Return
- Mov Dl,0Dh ;
- Int 21h ;
- Mov Ah,2 ; Line Feed!
- Mov Dl,0Ah ;
- Int 21h ;
- Pop Ax ; Get back
- Cmp Al,'Y' ; Is it a CAP Y?
- Je IsYes ; Yes, so go there
- Cmp Al,'y' ; Is it a small y?
- Je IsYes ; Yes, so go there
- Cmp Al,'N' ; Is it a CAP N?
- Je IsNo ; Yes the response was such
- Cmp Al,'n' ; Is Small N?
- Jne Other ; No so get out of here
- IsNo: Mov Al,1 ; No response invokes 1 return code
- Jmp Short Final ; Goto final step
- IsYes: Mov Al,2 ; Yes resonse invokes 2 return code
- Jmp Short Final ; Goto Final Step
- Other: Mov Al,255 ; Other resoponse invokes NO (ff) ret code
- Final: Mov Ah,04Ch ; Terminate process subcode
- Int 21h ; And that be all!
- MAIN endp
-
- Cseg Ends
- End MAIN