Hi
The problem is that I want to write a program using processor 8051 (which is my first one ) but it doesnt work the point is to store #68h in the adress 40h and to increase to 89h with a loop . I dont want the solution since I already have it . Just asking what did I do wrong . Maybe I will post also the solution if you dont understand the point of my program :
SOLUTION:
MY PROGRAM
The problem is that I want to write a program using processor 8051 (which is my first one ) but it doesnt work the point is to store #68h in the adress 40h and to increase to 89h with a loop . I dont want the solution since I already have it . Just asking what did I do wrong . Maybe I will post also the solution if you dont understand the point of my program :
SOLUTION:
Code:
MOV A, #68H ;A=68H
MOV R0, #40H ; R0 is a pointer starting from 40H
MOV R2, #73 ; 89H-40H=49H = 73 decimal (loop iterations)
Again:
MOV @R0, A ; loop
INC R0
DJNZ R2, Again
Code:
cseg at 0
jmp 100
cseg at 100
mov a,#40h
mov r0,73
what:
mov @a,#68h
inc a
djnz r0, what
main:
sjmp main
end
Last edited by a moderator: