ok,thanks alot...for this program.is keep telling me that there is an error in line 38 and 40,but i cant identify what type of error. can you guide me to find the error?...thanks.
Code:
*-----------------------------------------------------------
* Program :PROG5.X68
* Written by :salim abdullah al-farsi
* Date :05.04.2011
* Description:Displaying the results in binary numbers
*-----------------------------------------------------------
ORG $1000
START MOVE.B #0,$E00010
JSR Delay
LEA List,A0 ;A0 is set to point at the lisrt
MOVE.B #5,D0 ;Use D0 as loop counter and set it to 5
CLR.B D1 ;Clear the total in D1 before we start
Loop ADD.B (A0),D1 ;Add the number pointed at by A0 to D1
ADD.L #1,A0 ;Point to the next number in the list
SUB.B #1,D0 ;Decrement the counter
BNE Loop ;If we haven't reached zero go round again
MOVE.B D1,$E00010
JSR WORD2DEC
MOVE.B #9,D0
TRAP #15 ;Halt Simulator
List DC.B 1,4,3,6,7 ;here's the data to add.
Delay Move.L #$1FFFFF,d7
Delay1 SUBI.L #1,D7
BNE Delay1
RTS
SS8 EQU $E00000
WORD2DEC
MOVE.B #10,D3
MOVEA.L #SS8+2*0,A2
JSR Segment7
blank
MOVEA.L #SS8+2*1,A2
JSR Segment7
blank
MOVEA.L #SS8+2*2,A2
JSR Segment7
blank
DIVU #10000,D1
MOVE.B D1,D3
MOVEA.L #SS8+2*3,A2
JSR Segment7
LSR.L #8,D1
LSR.L #8,D1
DIVU #1000,D1
MOVE.B D1,D3
MOVEA.L #SS8+2*4,A2
JSR Segment7
LSR.L #8,D1
LSR.L #8,D1
DIVU #100,D1
MOVE.B D1,D3
MOVEA.L #SS8+2*5,A2
JSR Segment7
LSR.L #8,D1
LSR.L #8,D1
DIVU #10,D1
MOVE.B D1,D3
MOVEA.L #SS8+2*6,A2
JSR Segment7
LSR.L #8,D1
LSR.L #8,D1
MOVE.B D1,D3
MOVEA.L #SS8+2*7,A2
JSR Segment7
RTS
*Seven Segment digital display conversion table
*-----------------------------------------------------------
* A
* -----
* F| |B
* | G |
* -----
* E| |C
* | D |
* ----- .H
*
* Bit Number 7 6 5 4 3 2 1 0
* Segment H G F E D C B A
* bit patterns to form the respective digis character for LEDs wired as common cathode.
digits: ;look-up table
dc.b $3F digit 0
dc.b $06 digit 1
dc.b $5B digit 2
dc.b $4F digit 3
dc.b $66 digit 4
dc.b $6D digit 5
dc.b $7D digit 6
dc.b $07 digit 7
dc.b $7F digit 8
dc.b $6F digit 9
dc.b $00 digit off
dc.b $40 dash
ds.w 0 force word boundary
*----------------------------------------------------------
* Display a digit on the 7-segment display
* Pre: D3.B contains 1 digit to display
* A2 points to 7-segment LED to use
* Post: A2 points to next 7-segment LED
segment7:
movem.l d3/a0,-(a7) save registers
lea digits,a0 bit pattern table
and.l #$00ff,d3
move.b (a0,d3),(a2) display digit
adda.l #2,a2
movem.l (a7)+,d3/a0 restore registers
rts
END START
[Admin: Added code format]