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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying a String

Status
Not open for further replies.

NyCzMaGiX

Programmer
Nov 30, 2001
2
US
Hi all,
I want to display my string at a certain position on the screen. But with my coding, it displays weird ASCII characters at position 0,0 instead of "Please Enter Input...etc." onto the screen. Please help.

.data
MESSAGE1 DB "Please Enter Input Filename: ", 0

.code
org 100h


MOV AX, 0B800h
MOV ES, AX
MOV AH, 07h
MOV DI, 0
MOV BX, 0
MOV CX, 29

DISPLAY:
MOV AL, MESSAGE1[BX]
MOV ES:[DI], AX
JZ THEEND
INC BX
ADD DI, 2
LOOP DISPLAY

THEEND:
INT 20h
 
Hello,

you are writing a DOS .COM file but those only consist of one segment. Move the data in the data segment below the last code, and remove the .data, and everything works fine.

Wouter Dijkslag

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top