Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unresolved Operand(s)

Status
Not open for further replies.

lemon101

Programmer
Mar 12, 2006
2
GB
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?
 
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.
 
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)
 
And these line numbers correspond to the code you originally posted?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top