home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / TASMSWAN.ZIP / BOUND286.ASM < prev    next >
Assembly Source File  |  1989-07-17  |  971b  |  68 lines

  1. %TITLE  "Bound test ---80286/386 ONLY !!!!"
  2.  
  3.     P286N
  4.     IDEAL
  5.     DOSSEG
  6.     MODEL    small
  7.     STACK    256
  8.  
  9.     DATASEG
  10.  
  11. exitCode    db    0
  12. errorMsg    db    '*** ERROR:  array index OUT of bounds', 0
  13. normalMsg    db    'Program ending with no errors', 0
  14. lowRange    dw    100
  15. highRange    dw    199
  16. oldSeg        dw    ?
  17. oldOfs        dw    ?
  18.  
  19.     CODESEG
  20.  
  21. ;------------from STRIO.obj
  22.     EXTRN    StrWrite:proc, NewLine:proc
  23.  
  24. Start:
  25.     mov    ax,@data
  26.     mov    ds,ax
  27.     mov    es,ax
  28.     push    es
  29.     mov    ax,03505h
  30.     int    21h
  31.     mov    [oldSeg],es
  32.     mov    [oldOfs],bx
  33.     pop    es
  34.     push    ds
  35.     mov    ax,02505h
  36.     mov    dx, offset Int5ISR
  37.     push    cs
  38.     pop    ds
  39.     int    21h
  40.     pop    ds
  41.     mov    bx,2
  42.     bound    bx,[lowRange]
  43.     mov    di, offset normalMsg
  44.     call    StrWrite
  45.     call    NewLine
  46. Exit:
  47.     push    ds
  48.     mov    ax,02505h
  49.     mov    dx,[oldOfs]
  50.     mov    ds,[oldSeg]
  51.     int    21h
  52.     pop    ds
  53.     mov    ah,04Ch
  54.     mov    al,[exitCode]
  55.     int    21h
  56.  
  57. PROC    Int5ISR
  58.     mov    ax,@data
  59.     mov    ds,ax
  60.     mov    es,ax
  61.     mov    di, offset errorMsg
  62.     call    StrWrite
  63.     call    NewLine
  64.     jmp    Exit
  65. ENDP    Int5ISR
  66.  
  67.     END    Start
  68.