Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

URGENT HELP NEEDED: please check my source code (assembly)

Status
Not open for further replies.

-joe-

Newbie level 3
Joined
Aug 30, 2005
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,353
PLease help me with my source code...
there are several errors...
i am doing a 8x8 LED dot matrix display using ATMEL 89c51 chip and in assembly language





;----------------------------------------------------------------------------
; I/O ADDRESS
;----------------------------------------------------------------------------
NextButton EQU P1.0 ; PORT 1.0
BackButton EQU P1.1 ; port 1.1
AutoButton EQU P1.2 ; PORT 1.2

;----------------------------------------------------------------------------
; VARIABLE ADDRESS
;----------------------------------------------------------------------------

NUMBER EQU 625

ORG 0000H


MAIN: MOV R1, #01H
MOV R2, #0
MOV R3, #0
MOV DPTR, #TABLE

Button_Loop: MOV A, P1
JNB ACC.0, NextButton
JNB ACC.1, BackButton
JNB ACC.2, AutoButton
JB AutoBut, AutoButton
MOV B, #10h
DJNZ B, $
SJMP Button_Loop


NextButton: CLR AutoBut MOV A, ROW
INC A
LJMP Button_Loop


BackButton: CLR AutoBut
MOV A, ROW
DEC A
LJMP Button_Loop

AutoButton: SETB AutoBut
MOV A, ROW
SJMP Button_Loop



ROW: MOV A, R3
MOVC A, @A+DPTR
MOV R2, A
MOV P0, R2
MOV P2, R1
ACALL DELAY
MOV A, R1
RL A
MOV R1, A
INC R3
CJNE R1, #01H, ROW
MOV R3, #0
SJMP ROW


TOGGLE: MOV R2, #20
CPL P1.2 DJNZ R2, Toggle


DELAY: MOV TMOD, #01H
MOV TH0, #HIGH(-100000) MOV TL0, #LOW(-100000)
SETB TR0
JNB TF0, $
CLR TF0
RET



TABLE: DB 0F1H, 0EEH, 0E6H, 0EAH, 0ECH, 0EEH, 0F1H, 0FFH ;0
DB 0E0H,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DDH, 0EBH, 0EBH, 0DDH, 0DDH, 0FFH, 0FFH ;x
DB 0FBH, 0F9H, 0EEH, 0FAH, 0F8H, 0EEH, 0EEH, 0FFH ;y DB 0E0H, 0F3H, 0F9H, 0FCH, 0E0H, 0FFH, 0FFH, 0FFH ;z DB 0C3H, 0BDH, 066H, 05AH, 07EH, 05AH, 0BDH, 0C3H
DB 03CH, 042H, 099H, 0A5H, 081H, 0A5H, 042H, 03CH
DB 0C3H, 0BDH, 05AH, 066H, 07EH, 05AH, 0BDH, 0C3H
DB 0FFH, 0F7H, 073H, 0B1H, 080H, 0B1H, 073H, 0F7H
DB 000H, 018H, 03CH, 07EH, 0FFH, 0FFH, 0E7H, 042H

END
 

waja28

Newbie level 2
Joined
Oct 8, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
i want to know, have u finish ur program..
i would like doing this project, could u send the right codes
 

welove8051

Full Member level 6
Joined
Jul 16, 2009
Messages
357
Helped
51
Reputation
102
Reaction score
41
Trophy points
1,308
Location
india
Activity points
3,277
hey joe there are lot of logical errors in ur code. explain ur concept briefly.
 

incomplete_jerin

Advanced Member level 2
Joined
Jun 4, 2010
Messages
551
Helped
97
Reputation
208
Reaction score
93
Trophy points
1,308
Location
INDIA
Activity points
3,912
Could you post the errors which you faced while compiling the code?
Regards,
Jerin.
 

waja28

Newbie level 2
Joined
Oct 8, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
I give u error dan assembly code. Plzz help to correct the error
 

Attachments

  • L10008.TXT
    1.8 KB · Views: 13
  • ERROR.doc
    111 KB · Views: 13
  • assignment_178[1].pdf
    175.9 KB · Views: 16

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top