; page 60,132 ; title SWAPLPTS - Swap LPT1 and LPT2 ; ; S W A P L P T S . A 8 6 ; ; Copyright (C) 1991 John W Grothman. All rights reserved. ; Released to the public domain. ; ; purpose: ; Swaps LPT1 and LPT2. ; ; 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/91 John W Grothman (CompuServe: 73740,1540) ; Original version in proprietary assembly language. ; ; 1.1 8/14/94 Kirk Lawrence ; Added screen message, so user can tell that something has actually happened. ; Translated the source code from proprietary to generic assembly language, ; so that it will compile under shareware-type compilers. ; ; 11-11-98 ; Ported to CP/M-86 by Kirk Lawrence. ; cseg ;start of code segment org 100h ;leave room for base page jmp start ; msg db 10,13,' SWAPLPTS Version 1.1 - Printer Port Swapper' db 10,13,' Copyright 1991 by John W Grothman. All rights ' db 'reserved.' db 10,13,' Released to the public domain.',10,13 db 10,13,' => LPT1 and LPT2 have been swapped.',10,13,07,'$' ; start: mov cl, 9 ;function 9 - print string mov dx, offset msg ;point DX to screen message int 224 ;call BDOS xor ax, ax ;zero out register AX mov ds, ax ;set DS to 0 (low memory (data) area) mov bx, 0408h ;low memory offset of LPT1 base I/O address mov ax, [bx] ;get it and mov dx, ax ; ...save in DX mov bx, 040Ah ;low 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 xor cx,cx ;function 0 - reset system int 224 ;call BDOS end