English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I’m programming the ATMEL 89C52 using its assembly language and I have a problem making part of a program... I want to compare two values stored in two different registers, say R0 and R1 and I want to make a program that would do the function of:

CJNE R0,R1,HERE

I tried putting one of the two values in the accumulator A but it didn't work as I’m still getting "unknown instruction" error each time I run the assembler

please help

2006-08-04 10:48:12 · 3 answers · asked by MiG 2 in Computers & Internet Programming & Design

CJNE A,R0,HERE didn't work either

2006-08-05 04:00:38 · update #1

3 answers

first move data in acc to B reg' and then use command "CJNE A,DIRECT,HERE " instead of "CJNE R0,R1,HERE".

already you know that DIRECT is direct address of SFR reg'.

here direct address of R0 (bank0) is 00h

so,you can program as

CJNE A,00h,HERE

byeeeeeeeeeeeee.........

2006-08-05 02:11:44 · answer #1 · answered by vazk 2 · 0 0

i imagine it truly is what you're after: public classification Homework3143 { public static void substantial(String[] args) { int sum=0; int count number=0; double accepted=0.0; int i=a million; even as (ianswer #2 · answered by chipman 4 · 0 0

did you put A in the right place in the instruction? A should be first.

MOV A,R0

CJNE A,R1,HERE
instead of
CJNE R1,A,HERE

2006-08-05 03:03:59 · answer #3 · answered by justme 7 · 0 0

fedest.com, questions and answers