home *** CD-ROM | disk | FTP | other *** search
- ; pcbxlat.asm
- ;
- ; 5/5/88 by Ted
- ;
- ; Low Level RAM functions for OWL
- ;
- ; Copyright (c) 1988, 1989 Oakland Group Inc.
- ; ALL RIGHTS RESERVED
- ;
- ;------------------------REVISION HISTORY--------------------------------------;
- ;------------------------------------------------------------------------------;
- include PCDECL.MAC
-
- TAB SEGMENT WORD
- ASSUME SS:TAB
- esfoo label byte ; this fake label and segment are provided to trick
- TAB ENDS ; masm into assembling the xlat instruction correctly.
-
- PSEG
- ; ---------------------------------------------------------------------------- ;
- ; void bxlat (dest_addr, nbytes, swaptab)
- ; translate through swap table in nbytes bytes at dest_addr
-
- pubproc DIGPRIV bxlat <daddr, dptr, nbytes, swaptab, dptr>
- push bp
- mov bp, sp
- pushm <ds, es, si, di>
-
- lds si, [bp].daddr ; reg. ds = daddr seg
- mov di, si
- mov cx, [bp].nbytes ; reg. cx = nbytes
- les bx, [bp].swaptab ; reg. es:bx = table address
-
- cld
- ploop:
- lodsb
- ; the es segment override is poked in here
- xlat es:esfoo ; because the stupid assembler doesn't get it
- mov ds:[di], al
- inc di
- loop ploop
-
- popm <di, si, es, ds>
- pop bp
- ret
- endproc bxlat
- ; ---------------------------------------------------------------------------- ;
- ENDPS
- end
- ; ---------------------------------------------------------------------------- ;
-