Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thanks for a great forum. My problem was answered just by scrolling through previously solved problems. Great service!!..."

Geography

Where in the world do Tek-Tips members come from?
lemon101 (Programmer)
12 Mar 06 18:39
Hello guys, I'm new to this forum, however its seems pretty cool. I am having a little trouble with some code I pulled straight from Mazidi's book on the 8051 microcontroller:

ORG
MOV A,#38H ; init. LCD 2 lines, 5x7 matrix
ACALL COMNWRT ; call command subroutine
ACALL DELAY ; give LCD some time
MOV A,#0EH ; display on, cursor on
ACALL COMNWRT ; call command subroutine
ACALL DELAY ; give LCD some time
MOV A,#01 ; clear LCD
ACALL COMNWRT ; call command subroutine
ACALL DELAY ; give LCD some time
MOV A,#06H ; shift cursor right
ACALL COMNWRT ; call command subroutine
ACALL DELAY ; give LCD some time
MOV A,#84H ; cursor at line 1, pos. 4
ACALL COMNWRT ; call command subroutine
ACALL DELAY ; give LCD some time
MOV A,#'N' ; display letter N
ACALL DATAWRT ; call display subroutine
ACALL DELAY ; give LCD some time
MOV A,#'O' ; display letter O
ACALL DATAWRT ; call display subroutine
AGAIN: SJMP AGAIN ; stay here
COMNWRT: ; send command to LCD
MOV P1,A ; copy reg A to port 1
CLR P2.0 ; RS = 0 for command
CLR P2.1 ; R/W = 0 for write
SETB P2.2 ; E = 1 for high pulse
CLR P2.2 ; E = 0 FOR H-to-L pulse
RET
DATAWRT: ; write data to LCD
MOV P1,A ; copy reg A to port 1
SETB P2.0 ; RS = 1 for data
CLR P2.1 ; R/W = 0 for write
SETB P2.2 ; E = 1 for high pulse
CLR P2.2 ; E = 0 FOR H-to-L pulse
RET
DELAY: MOV R3,#50 ; 50 or higher for fast CPUs
HERE2: MOV R4,#255 ; R4 = 255
HERE: DJNZ R4,HERE ; stay until R4 becomes 0
DJNZ R3,HERE2
RET
END

I put this code into Rigel's Reads51 IDE. When I try to compile/build it using the Reads51 v4 Toolchain I get errors wherever I put anything to do with PORTS (P1, P2.0, etc). These errors are listed as "Unresolved Operand(s)".

However when I try to compile/build the code with the Reads51 v3 Toolchain, the IDE gives no errors.

This is really weird and I'm pretty puzzled by this. Can anyone shed some light on this?
zeitghost (Programmer)
13 Mar 06 4:14
To state the obvious, sounds like you have something undefined in the Reads51 toolchain.

You might try posting the actual error messages.

Please used the

CODE

tags when posting code.
lemon101 (Programmer)
13 Mar 06 6:09
Sorry about not using the tag there, didn't realise it was available. I get the following errors in Reads51 under the v4 Toolchain:

CODE

"C:\LCD-Commands and data with time delay.asm"        8    Undecodable line, Syntax error
"C:\LCD-Commands and data with time delay.asm"       30    Unresolved operand(s)
"C:\LCD-Commands and data with time delay.asm"       31    Unresolved operand(s)
"C:\LCD-Commands and data with time delay.asm"       32    Unresolved operand(s)
"C:\LCD-Commands and data with time delay.asm"       33    Unresolved operand(s)
"C:\LCD-Commands and data with time delay.asm"       34    Unresolved operand(s)
"C:\LCD-Commands and data with time delay.asm"       37    Unresolved operand(s)
"C:\LCD-Commands and data with time delay.asm"       38    Unresolved operand(s)
"C:\LCD-Commands and data with time delay.asm"       39    Unresolved operand(s)
"C:\LCD-Commands and data with time delay.asm"       40    Unresolved operand(s)
"C:\LCD-Commands and data with time delay.asm"       41    Unresolved operand(s)
zeitghost (Programmer)
13 Mar 06 10:59
And these line numbers correspond to the code you originally posted?

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close