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!

Text output

Status
Not open for further replies.

SmileeTiger

Programmer
Mar 13, 2000
200
0
0
US
Hi I am trying to output some text to the screen using the following routine.. any idea why it won't work?

Is there a better way to do this?
.data
text db "lalala",0
.code
main proc
;This section sets up es to point to the .data section and ds to point to the display
mov ax, @data
mov es,ax ; Moves the ax val to the extra segment
mov ax, 0B800h ; Location for the display
mov ds,ax ; Moves the ax val to the data segment
;end setting up the segments
mov di, offset text
mov bx,30h
mov cx,5h
mov al,0eh
DrawText:
mov ah,es:[di]
mov [bx],ax
add di,1
loop DrawText
 
*chuckles*
It won't work because I was silly and forgot to increase bx :p

working code:
text db "lalala",0

.code




main proc



;This section sets up es to point to the .data section and ds to point to the display
mov ax, @data
mov es,ax ; Moves the ax val to the extra segment
mov ax, 0B800h ; Location for the display
mov ds,ax ; Moves the ax val to the data segment
;end setting up the segments
;call ClearScreen;Clears the screen
;call Outline
mov di, offset text
mov bx,30h
mov cx,5h
mov ah,0eh
DrawText:
mov al,es:[di]
mov [bx],ax
add bx,2
add di,1
loop DrawText
 
* Chuckling chuckling kling ling ing *
Cooool Tiger.
I think Tiger can think twice before posting
questions :)

Do not rejoice that ur code works.
it might be a special case of an error :-(
 
Heh I tend to look at problems differently after I post them for some reason. I wish we had a cancel post option :p.

SmileeTiger
 
Hoi Tiger,
was just kidding..I like ur enthusiasm.
Do not rejoice that ur code works.
it might be a special case of an error :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top