hohpaul
10-03-08, 12:05 PM
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.
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
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.
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