Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

How to store value 5000 for creating 5000xDelay1ms (5s)? (Assembly)

Status
Not open for further replies.

smiles

Advanced Member level 4
Joined
Jul 27, 2007
Messages
110
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,096
I am writing Assembly code (Pic16F877) for a small project.
For example, you enter '1' then '2' then '3' and '4' keys and you get a number 1234 in a word variable named Delay (10101111100010). I get it by the way 1x10+2=12, then 12x10+3=123, then 123x10+4=1234.
Do multiplying with 10 by rotate left (delete carry flag) three times then plus itself two times
Now my problem is don't find out the way to contain 1234.
I used
Delay res 2 (... and seem that what I think is word then is only two separate bytes and the rotate left isn't effective)
Caused that I want to use 1234 like 1234xDelay1ms and the word contain 1234 just only need to decrease by 1 rapidly then we have 1234ms delay (time for lamp light up, for i.e)
...
in brief, how can I store value 5000 for creating 5000xDelay1ms (5s) ? :|
Could you give me some ways to solve this, thanks !!!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top