Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display multi line msg inside a box?

Status
Not open for further replies.

kidrocks

Programmer
Feb 8, 2004
1
0
0
US
Ok I have constructed my box and positioned my cursor inside the box to display the msg, the first line displays correctly but when i use CRLF to display the second line, the msg starts at the begining of the screen. Tried using dup operator to indent it below the first but this erases
a line in my box. Any Suggestions?
 
kidrocks,

Firstly, Zeit is right. It is more helpful if you give code to work with, or at least the operating system you are using. (It would not be any help to you if I posted the answer in 8086 intel code when you have a UNIX box with a Sparc chip...)

However, I am going to make some assumtions: 1) you are running with intel code 2) you are running DOS (or DOS terminal in Windows - shouldn't matter for text display).

I have illustrated the use of mainly BIOS interrupts to achieve positioning of texts in the code below:
Code:
; Program illustrating 'textgoto(x,y)' interrupts.

assume cs:code
org 100h

code segment

program:
  jmp start
  ; data area here !
  string db 'Hello, World !',0

start:
  ; set up data
  mov ax,cs
  mov ds,ax
  mov es,ax

  ; clear screen
  mov ah,00h    ; function no.
  mov al,03h    ; video mode
  int 10h       ; BIOS int.

  ; write string at row 5, col 5 in red.
  mov ah,13h    ; function no.
  mov al,00h    ; write mode
  mov bh,00h    ; page no.
  mov bl,04h    ; attribute (color?)
  mov dh,05h    ; row
  mov dl,05h    ; col
  mov cx,0eh    ; size of string
  lea bp,string ; address of string
  int 10h       ; BIOS int.

  ; goto text location
  mov ah,02h    ; function no.
  mov bh,00h    ; current page no.
  mov dh,09h    ; row (from top)
  mov dl,09h    ; col (from left)
  int 10h       ; BIOS int.

  ; put char @ current text location
  mov ah,0eh    ; function no.
  mov al,01h    ; character
  mov bh,00h    ; page no.
  int 10h       ; BIOS int.
  
  ; wait for key press
  mov ax,00h    ; function no.
  int 16h       ; BIOS int.

  ; terminate
  mov ax,4c00h  ; function no.
  int 21h       ; DOS int.

code ends

end program
There are other ways of doing it, but I don't know what you have done in your code. That might have been useful.
:)

Don't hate the player - hate the game
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top