|
Last change
on this file was 18, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
3.1 KB
|
| Line | |
|---|
| 1 | ;
|
|---|
| 2 | ; RPRINT.ASM -- Text output via DOS (real mode)
|
|---|
| 3 | ;
|
|---|
| 4 | ; Copyright (c) 1991-1995 by Eberhard Mattes
|
|---|
| 5 | ;
|
|---|
| 6 | ; This file is part of emx.
|
|---|
| 7 | ;
|
|---|
| 8 | ; emx is free software; you can redistribute it and/or modify it
|
|---|
| 9 | ; under the terms of the GNU General Public License as published by
|
|---|
| 10 | ; the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 11 | ; any later version.
|
|---|
| 12 | ;
|
|---|
| 13 | ; emx is distributed in the hope that it will be useful,
|
|---|
| 14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 16 | ; GNU General Public License for more details.
|
|---|
| 17 | ;
|
|---|
| 18 | ; You should have received a copy of the GNU General Public License
|
|---|
| 19 | ; along with emx; see the file COPYING. If not, write to
|
|---|
| 20 | ; the Free Software Foundation, 59 Temple Place - Suite 330,
|
|---|
| 21 | ; Boston, MA 02111-1307, USA.
|
|---|
| 22 | ;
|
|---|
| 23 | ; See emx.asm for a special exception.
|
|---|
| 24 | ;
|
|---|
| 25 |
|
|---|
| 26 | ;
|
|---|
| 27 | ; Note: This module must not use 386 instructions
|
|---|
| 28 | ;
|
|---|
| 29 |
|
|---|
| 30 | INCLUDE EMX.INC
|
|---|
| 31 |
|
|---|
| 32 | PUBLIC RWORD, RBYTE, RNIBBLE
|
|---|
| 33 | PUBLIC RCHAR, RTEXT, RCRLF
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 | INIT_CODE SEGMENT
|
|---|
| 37 |
|
|---|
| 38 | ASSUME CS:INIT_CODE, DS:NOTHING
|
|---|
| 39 |
|
|---|
| 40 | .8086 ; !!!
|
|---|
| 41 |
|
|---|
| 42 | RWORD PROC NEAR
|
|---|
| 43 | XCHG AL, AH
|
|---|
| 44 | CALL RBYTE
|
|---|
| 45 | XCHG AL, AH
|
|---|
| 46 | CALL RBYTE
|
|---|
| 47 | RET
|
|---|
| 48 | RWORD ENDP
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 | RBYTE PROC NEAR
|
|---|
| 52 | PUSH AX
|
|---|
| 53 | REPT 4
|
|---|
| 54 | SHR AL, 1
|
|---|
| 55 | ENDM
|
|---|
| 56 | CALL RNIBBLE
|
|---|
| 57 | POP AX
|
|---|
| 58 | PUSH AX
|
|---|
| 59 | CALL RNIBBLE
|
|---|
| 60 | POP AX
|
|---|
| 61 | RET
|
|---|
| 62 | RBYTE ENDP
|
|---|
| 63 |
|
|---|
| 64 | RNIBBLE PROC NEAR
|
|---|
| 65 | AND AL, 0FH
|
|---|
| 66 | ADD AL, 30H
|
|---|
| 67 | CMP AL, 3AH
|
|---|
| 68 | JB RNIB1
|
|---|
| 69 | ADD AL, 7
|
|---|
| 70 | RNIB1: CALL RCHAR
|
|---|
| 71 | RET
|
|---|
| 72 | RNIBBLE ENDP
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 | ;
|
|---|
| 76 | ; In: DS:DX Text (0 terminated)
|
|---|
| 77 | ;
|
|---|
| 78 | RTEXT PROC NEAR
|
|---|
| 79 | PUSH AX
|
|---|
| 80 | PUSH BX
|
|---|
| 81 | PUSH CX
|
|---|
| 82 | XCHG BX, DX
|
|---|
| 83 | MOV CX, BX
|
|---|
| 84 | XOR AL, AL
|
|---|
| 85 | RTEXT1: CMP AL, DS:[BX]
|
|---|
| 86 | JE RTEXT2
|
|---|
| 87 | INC BX
|
|---|
| 88 | JMP RTEXT1
|
|---|
| 89 | RTEXT2: XCHG BX, CX
|
|---|
| 90 | SUB CX, BX
|
|---|
| 91 | XCHG BX, DX
|
|---|
| 92 | MOV BX, 1 ; stdout
|
|---|
| 93 | MOV AH, 40H
|
|---|
| 94 | INT 21H
|
|---|
| 95 | POP CX
|
|---|
| 96 | POP BX
|
|---|
| 97 | POP AX
|
|---|
| 98 | RET
|
|---|
| 99 | RTEXT ENDP
|
|---|
| 100 |
|
|---|
| 101 | RCHAR PROC NEAR
|
|---|
| 102 | PUSH AX
|
|---|
| 103 | PUSH DX
|
|---|
| 104 | MOV DL, AL
|
|---|
| 105 | MOV AH, 02H
|
|---|
| 106 | INT 21H
|
|---|
| 107 | POP DX
|
|---|
| 108 | POP AX
|
|---|
| 109 | RET
|
|---|
| 110 | RCHAR ENDP
|
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 | RCRLF PROC NEAR
|
|---|
| 114 | PUSH AX
|
|---|
| 115 | MOV AL, CR
|
|---|
| 116 | CALL RCHAR
|
|---|
| 117 | MOV AL, LF
|
|---|
| 118 | CALL RCHAR
|
|---|
| 119 | POP AX
|
|---|
| 120 | RET
|
|---|
| 121 | RCRLF ENDP
|
|---|
| 122 |
|
|---|
| 123 | INIT_CODE ENDS
|
|---|
| 124 |
|
|---|
| 125 | END
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.