help to make this code work

Reply

Join Date: Jul 2009
Posts: 13
Reputation: paulnewman has a little shameless behaviour in the past 
Solved Threads: 0
paulnewman paulnewman is offline Offline
Newbie Poster

help to make this code work

 
0
  #1
Jul 6th, 2009
;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 CSispsg, DSatasg
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: help to make this code work

 
0
  #2
Jul 6th, 2009
Isn't DOS printing suppose to have a '$' terminator?
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: help to make this code work

 
0
  #3
Jul 6th, 2009
Oh yes.
message DB 'ASSEMBLY LANGUAGE PROGRAMMING$'


  1. DS:DX ; is string pointer.
String must end with '$'
Last edited by wildgoose; Jul 6th, 2009 at 9:48 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 13
Reputation: paulnewman has a little shameless behaviour in the past 
Solved Threads: 0
paulnewman paulnewman is offline Offline
Newbie Poster

Re: help to make this code work

 
-1
  #4
Jul 7th, 2009
i TRIED IT AND IT DOESNT DIPLAY THE MESSAGE
IS THERE ANY ERROR ON THE CODE.

CAN SOMEBODY HELP ME DEBUG IT.

THANKS
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 13
Reputation: paulnewman has a little shameless behaviour in the past 
Solved Threads: 0
paulnewman paulnewman is offline Offline
Newbie Poster

Re: help to make this code work

 
0
  #5
Jul 7th, 2009
Is the ;model medium and ;stack supposed to be commented out.
pls can any one help me re-write that script to display
"assembly language program" on the screen.

regards
paul
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: help to make this code work

 
0
  #6
Jul 7th, 2009
Are you using
  1. DS:DX
you were using BX which is wrong.

Post your current code again!
Last edited by wildgoose; Jul 7th, 2009 at 8:24 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 13
Reputation: paulnewman has a little shameless behaviour in the past 
Solved Threads: 0
paulnewman paulnewman is offline Offline
Newbie Poster

Re: help to make this code work

 
0
  #7
Jul 9th, 2009
;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 CSispsg, DSatasg
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 13
Reputation: paulnewman has a little shameless behaviour in the past 
Solved Threads: 0
paulnewman paulnewman is offline Offline
Newbie Poster

Re: help to make this code work

 
0
  #8
Jul 9th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark

Re: help to make this code work

 
0
  #9
Jul 9th, 2009
DX DX DX DX DX !!!!!
  1. Message is DS:DX
  2. NOT BX!!!!
Last edited by wildgoose; Jul 9th, 2009 at 1:55 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 13
Reputation: paulnewman has a little shameless behaviour in the past 
Solved Threads: 0
paulnewman paulnewman is offline Offline
Newbie Poster

Re: help to make this code work

 
0
  #10
Jul 9th, 2009
You mean the following lines:

MOV DS,BX
LEA DX,message;
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC