| | |
help to make this code work
![]() |
•
•
Join Date: Jul 2009
Posts: 13
Reputation:
Solved Threads: 0
;A program to display the message, "ASSEMBLY LANGUAGE PROGRAM" on the screen.
;MODEL MEDIUM
;STACK
Datasg SEGMENT; Beginning of data segment
message DB "ASSEMBLY LANGUAGE PROGRAMMING"
Datasg ENDs; End of data segment
Dispsg SEGMENT; Beginning of code segment
ASSUME CS
ispsg, DS
atasg
ORG 100h
john: MOV AH,09h; 9 is function value to display string
MOV BX,Datasg; Initialise the start segment
MOV DS, BX
LEA BX,message; Load effective address in BX register
INT 21h
MOV AH,4ch
Dispsg ENDs
END start
Please can somebody help me correct this code because am a newbie, the code is not displaying what it suppose to display.
Regards
Paul
;MODEL MEDIUM
;STACK
Datasg SEGMENT; Beginning of data segment
message DB "ASSEMBLY LANGUAGE PROGRAMMING"
Datasg ENDs; End of data segment
Dispsg SEGMENT; Beginning of code segment
ASSUME CS
ispsg, DS
atasgORG 100h
john: MOV AH,09h; 9 is function value to display string
MOV BX,Datasg; Initialise the start segment
MOV DS, BX
LEA BX,message; Load effective address in BX register
INT 21h
MOV AH,4ch
Dispsg ENDs
END start
Please can somebody help me correct this code because am a newbie, the code is not displaying what it suppose to display.
Regards
Paul
Oh yes.
message DB 'ASSEMBLY LANGUAGE PROGRAMMING$'
String must end with '$'
message DB 'ASSEMBLY LANGUAGE PROGRAMMING$'
Assembly Syntax (Toggle Plain Text)
DS:DX ; is string pointer.
Last edited by wildgoose; Jul 6th, 2009 at 9:48 pm.
Are you using
you were using BX which is wrong.
Post your current code again!
Assembly Syntax (Toggle Plain Text)
DS:DX
Post your current code again!
Last edited by wildgoose; Jul 7th, 2009 at 8:24 pm.
•
•
Join Date: Jul 2009
Posts: 13
Reputation:
Solved Threads: 0
;A program to display the message, "ASSEMBLY LANGUAGE PROGRAM" on the screen.
MODEL MEDIUM
STACK 21H
Datasg SEGMENT; Beginning of data segment
message DB 'ASSEMBLY LANGUAGE PROGRAMMING
'
Datasg ENDs; End of data segment
Dispsg SEGMENT; Beginning of code segment
ASSUME CS
ispsg, DS
atasg
ORG 100h
john: MOV AH,09h; 9 is function value to display string
MOV BX,Datasg; Initialise the start segment
MOV DS,DX
LEA BX,message; Load effective address in BX register
INT 21h
MOV AH,4ch
Dispsg ENDs
END start
MODEL MEDIUM
STACK 21H
Datasg SEGMENT; Beginning of data segment
message DB 'ASSEMBLY LANGUAGE PROGRAMMING
'Datasg ENDs; End of data segment
Dispsg SEGMENT; Beginning of code segment
ASSUME CS
ispsg, DS
atasgORG 100h
john: MOV AH,09h; 9 is function value to display string
MOV BX,Datasg; Initialise the start segment
MOV DS,DX
LEA BX,message; Load effective address in BX register
INT 21h
MOV AH,4ch
Dispsg ENDs
END start
•
•
Join Date: Jul 2009
Posts: 13
Reputation:
Solved Threads: 0
Hi Wildgoose,
Thank you so much for all your support, I am a new in assembly language and am very eager to know it because it is one of my major in my course.
But, this assignment is very crucial to me because it carries 30 mark, and I have to submit it tomorrow. Please if you can help me make it work , I will appreciate so much.
One thing again, am using an IDE software called emu8086. when I ran it, it doesnt display output automatically, i have to click on screen button, but then is oesnt show anything. just blank black screen.
Am suspecting this area of code segment as where the problem lies:
1. MODEM MEDIUM
2. STACK
3. ASSUME CS: Dispsg, DS: Datasg
4. MOV DS, BX
5.LEA DS, message
Actually, the second question of this assignment requests that after the first one works, that I should rewrite the program using a function value of INT 21h.
please am very grateful so far for urgent attention you gave for this my codes to make sure it works.
Thanks so much as I wait for your reply.
Paulnewman
Thank you so much for all your support, I am a new in assembly language and am very eager to know it because it is one of my major in my course.
But, this assignment is very crucial to me because it carries 30 mark, and I have to submit it tomorrow. Please if you can help me make it work , I will appreciate so much.
One thing again, am using an IDE software called emu8086. when I ran it, it doesnt display output automatically, i have to click on screen button, but then is oesnt show anything. just blank black screen.
Am suspecting this area of code segment as where the problem lies:
1. MODEM MEDIUM
2. STACK
3. ASSUME CS: Dispsg, DS: Datasg
4. MOV DS, BX
5.LEA DS, message
Actually, the second question of this assignment requests that after the first one works, that I should rewrite the program using a function value of INT 21h.
please am very grateful so far for urgent attention you gave for this my codes to make sure it works.
Thanks so much as I wait for your reply.
Paulnewman
DX DX DX DX DX !!!!!
Assembly Syntax (Toggle Plain Text)
Message is DS:DX NOT BX!!!!
Last edited by wildgoose; Jul 9th, 2009 at 1:55 am.
![]() |
Similar Threads
- Why doesn't this code work? (C#)
- Make program work on other PCs (VB.NET)
- How do i make my program work for 5 times and then Expire (VB.NET)
- Get Wan IP Code doesn't work HELP (VB.NET)
- need help to make this program work (C++)
- how to make clrscr() work (C++)
- How do I work around this? - virtual templates (C++)
- Null Pointer? will this code work (C)
- Please help me make this script work in Netscape (JavaScript / DHTML / AJAX)
Other Threads in the Assembly Forum
- Previous Thread: Memory Location
- Next Thread: Function return values
| Thread Tools | Search this Thread |





