|
-
April 14th, 2009, 05:03 PM
#1
how to print a string with frame
i need to write a prog in assembly language that prints a frame around a string after inputing it with the keyboard.
example
input string:hello
*********
*hello *
*********
the lenght of the frame increases with the lenght of the string. i wrote this but i cannot output the string with the frame
TEXTOUT MACRO TEXT
MOV AH, 09
LEA DX, TEXT
INT 21H
ENDM
TEXTIN MACRO BUF
MOV AH, 0AH
LEA DX, BUF
INT 21H
ENDM
StackS SEGMENT PARA STACK 'STACK'
DW 32 DUP(?)
StackS ENDS
MAX_TEXT EQU 10
DATA SEGMENT PARA PUBLIC 'DATA'
MESS1 DB 0AH,0DH,"input string: $"
BUF1 DB MAX_TEXT
QNT1 DB 0
TEXT1 DB MAX_TEXT DUP(?)
DATA ENDS
CODE SEGMENT PARA PUBLIC 'CODE'
ASSUME CS:CODE, DS ATA, SS:StackS
start:MOV AX, DATA
MOV DS, AX
MOV ES, AX
TEXTOUT MESS1
TEXTIN BUF1
MOV AH,1
INT 21H
XOR CH, CH
MOV CL, QNT1
LEA DI, TEXT1
XOR BX,BX
mov dl,al
mov ah, 2
int 21h
MOV AH, 4CH
code ends
end start
pls i need help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|