TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: SYLVAIN LAUZON
from: DENIS BOYLES
date: 1997-04-08 11:52:00
subject: Indos.Asm

;[INDOS.ASM] - v1.00 Public Domain (pd) 1997 by Denis Boyles
;            ! Arrowsoft Assembler v1.00D (MASM v3.0)
;            ? Uses the EGA/VGA border to give a visual reference to the 
tate
;              of the INDOS flag. Border will turn black (0) if the flag is
;              clear and blue (1) if the flag is set. A "black" border means
;              it's safe to "interrupt" DOS. While a "blue" border means it
;              isn't safe, and one should wait until it is.
VIDEO       EQU 10h                    ;define VIDEO services interrupt
DOS         EQU 21h                    ;define DOS services interrupt
PRG SEGMENT
    ASSUME CS:PRG,DS:PRG
    ORG 0100h
;[START]-------------------------------------------------------------------
;   DOS Program Entry Point.
START:
    jmp     main                       ;jump over data to main code
;[DATA]--------------------------------------------------------------------
;   TSR Local variables are kept here.
InDOS       dd ?                       ;pointer address to INDOS flag
OldTck      dd ?                       ;pointer address to original tick INT
;[NEWTCK]------------------------------------------------------------------
;   Our new ticker interrupt handler (INT 1Ch).
NewTck PROC
    push    AX                         ;save ALL registers used within 
andler
    push    BX
    push    ES
    les     BX,CS:[InDOS]              ;load ES:BX with the INDOS pointer
    mov     AX,1001h                   ;VIDEO - Set Border Color
    mov     BH,ES:[BX]                 ;BH = color = INDOS flag
    int     VIDEO                      ;VIDEO - call interrupt to change 
lor
    pop     ES                         ;load ALL saved registers
    pop     BX
    pop     AX
    jmp     CS:[OldTck]                ;jump to original handler in IRQ chain
NewTck ENDP
;[SNIP]--------------------------------------------------------------------
;   ALL code and data upto this point is kept resident in memory.
SNIP:
;[MAIN]--------------------------------------------------------------------
;   Starting point of program after jump from initial entry above.
main PROC
    mov     AH,34h                     ;DOS - Get INDOS Address
    int     DOS                        ;DOS - call interrupt to get pointer
    mov     word ptr [InDOS][2],ES     ;save segment (ES) in memory
    mov     word ptr [InDOS][0],BX     ;save segment (BX) in memory
    inc     AH                         ;DOS - Get Interrupt Vector
    mov     AL,1Ch                     ;AL = interrupt vector to get
    int     DOS                        ;DOS - call interrupt to get vector
    mov     word ptr [OldTck][2],ES    ;save segment (ES) in memory
    mov     word ptr [OldTck][0],BX    ;save segment (BX) in memory
    sub     AH,10h                     ;DOS - Set Interrupt Vector
    mov     DX,offset NewTck           ;DS:DX -> new interrupt handler
    int     DOS                        ;DOS - call interrupt to set vector
    mov     DX,offset SNIP             ;ALL code/data upto SNIP is kept
    mov     CL,04h                     ;shift count of 4 to convert
    shr     DX,CL                      ;into paragraphs (DX/16)
    inc     DX                         ;plus one more to round up
    mov     AX,3100h                   ;DOS - TSR Program With Code (0)
    int     DOS                        ;DOS - call interrupt to leave 
esident
main ENDP
PRG ENDS
    END START
 * OLX 2.1 TD * Press "+" to see another tagline.
--- Maximus/2 3.01
---------------
* Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.