home *** CD-ROM | disk | FTP | other *** search
- Page 55,80
- Title Sample program for Soft-ICE tutorial
-
- DATA Segment Public 'Data'
- pad db 12H dup(0)
- char db 0
- answer db 0
- space_msg db 'The Character is a SPACE',0DH,0AH,'$'
- no_space_msg db 'The Character is NOT a'
- db 'SPACE',0DH,0AH,'$'
- DATA Ends
-
- STACK Segment Stack 'Stack'
- dw 128 Dup(?)
- STACK Ends
-
- CODE Segment Public 'Code'
- Assume CS:CODE, DS:DATA, ES:Nothing, SS:STACK
- start:
-
- ; Set up segments
- mov ax, DATA
- mov es,ax
- mov ds,ax
-
- ; Main Program Loop
-
- main_loop:
- call get_key
- call is_space?
- cmp answer, 0
- je no_space
-
- ; It's a space, so display the space message
- mov ah,9
- mov dx, offset space_msg
- int 21H
- jmp main_loop
-
- ; It's NOT a space, so display the no space message
- no_space: mov ah,9
- mov dx, offset no_space_msg
- int 21H
- jmp main_loop
-
- ;--------------------------------------------------------------;
- ; JAKE'S ROUTINES
- ;--------------------------------------------------------------;
- ; Get Key Routine (one of Jake's routines)
-
- get_key proc
- mov ah,8
- int 21H
- mov char,al
- ret
- get_key endp
-
- ; Check if character is a space (one of Jake's routines)
-
- is_space? proc
- cmp char,20H
- jne not_space
- mov answer,1
- ret
- not_space:
- mov cs:answer,0
- ret
- is_space? endp
-
- CODE Ends
- End start
-
-
-
-