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.
__________________
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???