Jump to content

newb in need

- - - - -

  • Please log in to reply
9 replies to this topic

#1
mcor89

mcor89

    Newbie

  • Members
  • Pip
  • 5 posts
sorry im pretty new to tasm and i have to create a program that displays some lines, ive completed most of my program but still need help on this one line: $AAAAAAAAAAA$$$AAAAAAAAAA$
im having trouble displaying the $ key, any help is appreciated

#2
mebob

mebob

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
What exactly is it doing wrong?
Latinamne loqueris?

#3
mcor89

mcor89

    Newbie

  • Members
  • Pip
  • 5 posts
I have to make a program that displays:
$AAAAAAAAAAAAAAAAAAAAAAA$$$AAAAAAAAAAAAAAAAAAAAAAAA$
Name: John Doe
Street address 1234 something st
city/state/zip brooklyn, NY 10023
telephone #: 1-234-567-8900
$AAAAAAAAAAAAAAAAAAAAAAA$$$AAAAAAAAAAAAAAAAAAAAAAAA$

it also displays two spaces after everyline
this is what i have:
TITLE CS14 PGM4:DISPLAY NAME
.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB '$AAAAAAAAAAAAAAAAAAAAAAA$$$AAAAAAAAAAAAAAAAAAAAAAAAAAAA$', 13, 10, 10, 10, '$'
MSG2 DB 'NAME: blach blah', 13, 10, 10, 10, '$'
MSG3 DB 'STREET ADDRESS: something st.', 13, 10, 10, 10, '$'
MSG4 DB 'CITY/STATE/ZIP: BROOKLYN, NY 10000', 13, 10, 10, 10,'$'
MSG5 DB 'TELEPHONE #: 1-234-567-8900', 13, 10, 10, 10, '$'

.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
LEA DX, MSG1
MOV AH, 9
INT 21H
LEA DX, MSG2
MOV AH, 9
INT 21H
LEA DX, MSG3
MOV AH, 9
INT 21H
LEA DX, MSG4
MOV AH, 9
INT 21H
LEA DX, MSG5
MOV AH, 9
INT 21H
LEA DX, MSG1
MOV AH, 9
INT 21H
MOV AX, 4C00H
INT 21H
MAIN ENDP
END MAIN
the $ cancel out the whole sentance and makes it so that it doesnt display, how would i go around fixing this

#4
mebob

mebob

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
Leave it to DOS to make everything difficult. Is INT 10 available? If so, use Int 10/AH=13h, it should work.
Latinamne loqueris?

#5
mcor89

mcor89

    Newbie

  • Members
  • Pip
  • 5 posts
didnt work =\

#6
mebob

mebob

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
Can I see your code using INT 10?
Latinamne loqueris?

#7
mcor89

mcor89

    Newbie

  • Members
  • Pip
  • 5 posts
TITLE CS14 PGM4:DISPLAY NAME
.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB '$AAAAAAAAAAAAAAAAAAAAAAA$$$AAAAAAAAAAAAAAAAAAAAAAAAAAAA$', 13, 10, 10, 10, '$'
MSG2 DB 'NAME: blah', 13, 10, 10, 10, '$'
MSG3 DB 'STREET ADDRESS: something st.', 13, 10, 10, 10, '$'
MSG4 DB 'CITY/STATE/ZIP: BROOKLYN, NY 00000', 13, 10, 10, 10,'$'
MSG5 DB 'TELEPHONE #: 1-234-567-8900', 13, 10, 10, 10, '$'

.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
LEA DX, MSG1
MOV AH, 13h
INT 10
LEA DX, MSG2
MOV AH, 9
INT 21H
LEA DX, MSG3
MOV AH, 9
INT 21H
LEA DX, MSG4
MOV AH, 9
INT 21H
LEA DX, MSG5
MOV AH, 9
INT 21H
LEA DX, MSG1
MOV AH, 9
INT 21H
MOV AX, 4C00H
INT 21H
MAIN ENDP
END MAIN

#8
mebob

mebob

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
INT 10 doesn't work the same as INT 21. This should work:

mov ah,0x13

mov al,1

mov bh,0

mov bl,0x07

mov cx,SIZE_OF_STRING

mov dh,0

mov dl,0

mov ax,@DATA

mov es,ax

push bp

mov bp,MSG1

int 0x10

pop bp

DH and DL store the row and column respectively of where to print the string.
Here is the usage of it: Int 10/AH=13h
Latinamne loqueris?

#9
mcor89

mcor89

    Newbie

  • Members
  • Pip
  • 5 posts
it says operand types do not match on the mov bp, MSG1
I think I'm just goign to hand my code in to my teacher and hope she doesn't take many point off, thanks for taking the time to help a stranger in need =]

#10
mebob

mebob

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
Well, this way would be harder, but you could make your own function that prints characters out one at a time, then you wouldn't have to worry about the '$' characters.
Latinamne loqueris?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users