page 60,132 title SWAPLPTS - Swap LPT1 and LPT2 ; ; S W A P L P T S . A S M ; ; Copyright(C) 1991 John W Grothman. All rights reserved. ; ; Released to the public domain. ; ; purpose: ; Swap LPT1 and LPT2. ; ; to do: ; ; technical notes: ; This is a SIMPLE thing to do. Just swap the base I/O addresses ; in low DOS memory that DOS uses to map the LPT port hardware. ; ; modification log: ; 1.0 4/12/90 John W Grothman (CompuServe 73740,1540) cseg segment para public 'code' assume cs:cseg, ds:cseg, es:cseg, ss:cseg org 100h begin proc near xor ax, ax mov ds, ax ; set DS to 0 (DOS low memory (data) area) mov bx, 0408h ; low DOS memory offset of LPT1 base I/O address mov ax, [bx] ; get it and mov dx, ax ; save in DX mov bx, 040ah ; low DOS memory offset of LPT2 base I/O address mov ax, [bx] ; get it and mov cx, ax ; save in CX mov ax, dx ; get back LPT1 mov [bx], ax ; and put it in LPT2 mov bx, 0408h ; address of LPT1 base I/O address mov ax, cx ; get back LPT2 mov [bx], ax ; and put it in LPT1 mov ax, 4c00h ; terminate with ERRORLEVEL = 0 int 21h ret begin endp cseg ends end begin