home *** CD-ROM | disk | FTP | other *** search
- %TITLE "Bound test ---80286/386 ONLY !!!!"
-
- P286N
- IDEAL
- DOSSEG
- MODEL small
- STACK 256
-
- DATASEG
-
- exitCode db 0
- errorMsg db '*** ERROR: array index OUT of bounds', 0
- normalMsg db 'Program ending with no errors', 0
- lowRange dw 100
- highRange dw 199
- oldSeg dw ?
- oldOfs dw ?
-
- CODESEG
-
- ;------------from STRIO.obj
- EXTRN StrWrite:proc, NewLine:proc
-
- Start:
- mov ax,@data
- mov ds,ax
- mov es,ax
- push es
- mov ax,03505h
- int 21h
- mov [oldSeg],es
- mov [oldOfs],bx
- pop es
- push ds
- mov ax,02505h
- mov dx, offset Int5ISR
- push cs
- pop ds
- int 21h
- pop ds
- mov bx,2
- bound bx,[lowRange]
- mov di, offset normalMsg
- call StrWrite
- call NewLine
- Exit:
- push ds
- mov ax,02505h
- mov dx,[oldOfs]
- mov ds,[oldSeg]
- int 21h
- pop ds
- mov ah,04Ch
- mov al,[exitCode]
- int 21h
-
- PROC Int5ISR
- mov ax,@data
- mov ds,ax
- mov es,ax
- mov di, offset errorMsg
- call StrWrite
- call NewLine
- jmp Exit
- ENDP Int5ISR
-
- END Start