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
9 replies to this topic
#1
Posted 15 December 2010 - 12:03 PM
|
|
|
#2
Posted 15 December 2010 - 12:47 PM
#3
Posted 15 December 2010 - 12:54 PM
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
$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
Posted 15 December 2010 - 01:17 PM
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
Posted 15 December 2010 - 01:32 PM
didnt work =\
#6
Posted 15 December 2010 - 03:10 PM
#7
Posted 15 December 2010 - 09:30 PM
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
.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
Posted 16 December 2010 - 06:12 AM
INT 10 doesn't work the same as INT 21. This should work:
Here is the usage of it: Int 10/AH=13h
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 bpDH 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
Posted 16 December 2010 - 07:24 AM
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 =]
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
Posted 16 December 2010 - 09:33 AM
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


Sign In
Create Account

Back to top









