Re: wide screen text mode?
- From: Terence <tbwright@xxxxxxxxx>
- Date: Sat, 11 Aug 2007 16:07:55 -0700
On Aug 12, 3:03 am, Udo Kuhnt <048321887-0...@xxxxxxxxxxx> wrote:
I also do not understand what you mean by "TUI calls".
Can you provide a code sample that does this?
Here is the source for calling the ouput of a string to the current
screen buffer.
The setting of the screen i/o parameters then take over and display
the screen or part of it .
The call from FOrtran would be
call outs(codeword,colourword,lengthword,stringaddress)
For ASM work you just push the 4-byte addresses of the same parameters
on the stack and perform a far call to the routine. Stack is cleaned
up automatically.
name OUTS
public OUTS
souts segment
;MODE: compatible with older version
; advance cursor to end+1/not advance 0001/0000
; string/repeat 0002/0000
; use yx/use current cursor 0004/0000
; update yx with cursor address/not 0008/0000
; use colour/leave existing 0900/0A00
assume CS:souts
OUTS proc far ;CALL OUTS(MODE,PG-ATTR,YX,L,STRING);
PUSH BP ;save BP
MOV BP,SP ;access to stack
PUSH BP ;save because will use BP as well
; get actual cursor position (and shape)
MOV AH,03h
XOR BX,BX
INT 10h ;DH=ROW, DL=COL, CX=SHAPE
;
LES BX,dword ptr [bp+22]
MOV AX,ES:[BX] ;AX=MODE
;
TEST AL,04H ;use yx as address?
JNZ O1 ;if use current
LES BX,dword ptr [bp+14] ;get YX address=(256*row)+col
MOV DX,ES:[BX] ;DX=YX to use
O1: LES BX,dword ptr [bp+10]
MOV CX,ES:[BX] ;CX=COUNT
LES BX,dword ptr [bp+18]
MOV BX,ES:[BX] ;BX=PAGE in BH, ATTR in AL
LES BP,dword ptr [bp+06] ;BP=ADDR STR (lose stack pointer)
;
PUSH DX ;SAVE YX/cursor. stack dx
PUSH AX ;SAVE MODE . stack dx-ax
TEST AL,02H ;00/01 CHAR OR 02/03 STRING?
JNZ O4 ;if string
; repeated character
O2: MOV AH,02H ;
INT 10H ;set cursor to [DX]
INC DX ;bump cursor
CMP DL,80
JNZ O3
ADD DX,176
O3: POP AX ;to get 09 or 0A operation
PUSH AX ;stack dx-ax
MOV AL,ES:[BP] ;character to repeat
; no bump BP since same character!
PUSH CX
MOV CX,1 ;one by one
INT 10H ;OUT [AL]
POP CX
LOOP O2
JMP O6
; string
O4: MOV AH,02H ;string form
INT 10H ;set cursor to [DX]
INC DX ;bump cursor
CMP DL,80
JNZ O5
ADD DX,176
O5: POP AX ;to get 09 or 0a operation
PUSH AX ;still stack dx-ax
MOV AL,ES:[BP]
INC BP
PUSH CX ;current length left. stack dx-ax-cx
MOV CX,1 ;one by one
INT 10H ;OUT [AL]
POP CX ;real length counter. stack dx-ax
LOOP O4 ;decrement length left
; DX has actual cursor, CX is zero
O6: POP AX ;mode
POP CX ;original [DX] yx or cursor, DX has actual
;
PUSH AX
TEST AL,01H ;advance cursor?
JNZ O7 ;if yes
MOV DX,CX ;use old yx/cursor
O7: MOV AH,02H
INT 10H ;set cursor to chosen DX
POP AX
POP BP ;SAVED SP
;
TEST AL,08H ;update yx?
JZ O8 ;if no
LES BX,dword ptr [bp+14]
MOV ES:[BX],DX ;store new YX
O8: MOV SP,BP
POP BP ;SAVED BP
RET 20
OUTS endp
souts ends
END
.
- References:
- wide screen text mode?
- From: Day Brown
- Re: wide screen text mode?
- From: Jim Leonard
- Re: wide screen text mode?
- From: Day Brown
- Re: wide screen text mode?
- From: Udo Kuhnt
- Re: wide screen text mode?
- From: Day Brown
- Re: wide screen text mode?
- From: Jim Leonard
- Re: wide screen text mode?
- From: Terence
- Re: wide screen text mode?
- From: Udo Kuhnt
- wide screen text mode?
- Prev by Date: Re: wide screen text mode?
- Next by Date: Re: wide screen text mode?
- Previous by thread: Re: wide screen text mode?
- Next by thread: Re: wide screen text mode?
- Index(es):
Relevant Pages
|