Re: wide screen text mode?



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

.



Relevant Pages

  • Re: HOWTO Implement LoadLibrary, GetProcAdress, and FreeLibrary.
    ... public static string Invoke(IntPtr IntPtr_Function, string csParam1, ... AssemblyName AssemblyName_This = new AssemblyName; ... // We must now push each paramter onto the stack. ... // We must now push the function pointer onto the stack. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Stack
    ... character pointer once i exit the push function. ... So in case of *Strings* i cannot display the popped string or the ... members of the stack at any given time. ... struct stackelement item; ...
    (comp.lang.c)
  • Re: Getting a stack trace
    ... If all you want to know is the function call sequence (not the whole stack ... number or a string and then pop it off. ... function you push that function's ID to the stack, ... At error you just dump the contents of the stack to ...
    (comp.unix.programmer)
  • Re: Getting a stack trace
    ... If all you want to know is the function call sequence (not the whole stack ... number or a string and then pop it off. ... function you push that function's ID to the stack, ... At error you just dump the contents of the stack to ...
    (alt.os.linux)
  • KeyEvent consume() not working on JTextField, what am I done wrong?
    ... the characters while moving the cursor. ... 2007/100 13:12:34 is the time string. ... public static final int YEAR_1 = 0; ... public void nextPosition(int intKeyCode, int intCharPos) { ...
    (comp.lang.java.programmer)