Current location: Hot Scripts Forums » Programming Languages » Other Languages » [SOLVED] Assembly Language Program


[SOLVED] Assembly Language Program

Reply
  #1 (permalink)  
Old 10-03-08, 11:05 AM
hohpaul hohpaul is offline
New Member
 
Join Date: Oct 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Assembly Language Program

Hi,

I need advise on the below assembly language code. After compiling it, it returns with an undefined error on line 11, which is the PUSH DC part. I am not good in assembly language and would appreciate some help here. I am using the Z80 Macro Assembler program to compile the code.

Code:
	ORG	8000H
START:	LD	SP,8250H
	LD	HL,8110H
	LD	BC,8111H
	LD	A,(HL)
	CALL	BCDBIN
	LD	(BC),A
	HALT

BCDBIN:	PUSH	BC
	PUSH	DC
	LD	B,A
	AND	0FH
	LD	C,A
	LD	A,B
	AND	F0H
	SRL	A
	SRL	A
	SRL	A
	SRL	A
	LD	D,A
	XOR	A
	LD	E,0AH
SUM:	ADD	A,E
	DEC	D
        JP      NZ,SUM
	ADD	A,C
	POP	DE
	Pop	BC
	RET

Last edited by mab; 10-03-08 at 11:29 AM. Reason: Code tags.
Reply With Quote
  #2 (permalink)  
Old 10-03-08, 11:29 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
It should be -

Code:
PUSH DE
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #3 (permalink)  
Old 10-06-08, 10:44 AM
hohpaul hohpaul is offline
New Member
 
Join Date: Oct 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks. It worked fine after changing to PUSH DE. Appreciate your help.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
assembly language anupamsr Hot Scripts Forum Questions, Suggestions and Feedback 9 12-31-08 10:45 AM
Assembly - restarting a program ICE16 Other Languages 2 12-26-08 03:29 PM
[SOLVED] Assembly Language Loop Help J8II Other Languages 3 05-27-08 12:05 AM
Assembly Language question jessicayan Other Languages 1 02-13-07 03:07 PM
Assembly language help please psi3000 Other Languages 0 03-25-06 09:21 PM


All times are GMT -5. The time now is 03:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.