??? 05/09/04 14:45 Read: times |
#70066 - Some questions about the code Responding to: ???'s previous message |
Thanks to all for helping specially Prahlad J. Purohit.
few questions please: 1) what does PASS 1 and pass 2 means as mentioned by Prahlad J. Purohit? ******************************************** Iam trying to understand the multi-tasking example for Eight LEDS and EIGHT Push Buttons as mentioned on this website and need some help in understanding this; http://www.8052.com/users/mkaras/State_Machine.A51 I have just understand only this that the programmer is taking one by one switch out of the Eight switches and considering the different states of each switch individually for 1.25msec, am I rite? 1) Does BSEG in the following code means that a segment is started in the bitwise accessiable area and DBIT 1 means that it is initized from the ist bit, so it takes start from 00 bit and goes to 123 decimal number bit (7f), am I rite? BSEG AT 00 Tick: DBIT 1 ; 1 = 1.25 msec tick has come 2) Next does the above means that when ever 1.25msec timer intrepput comes a bit is set in that bitwise area or what this statement shows? 3) DSEG in the following means that the programmer is using the general purpose ram which is of 80bytes but what does HIGH:LOW means in the following code line, does its just showing that these bytes are used for input of HIGH and LOW signal from the switches; ;internal data area variables. DSEG AT 30H ; word locations are HIGH:LOW 4) Now after the above following lines come in the code, does it mean that 30H location byte is for the current switch which the program is considering, for one switch 8 bits, why's that? SwitchNo: DS 1 ; current switch number to process (0->7) 5) Next in code it means from 31H to 38H location bytes are reserved for the current state of each switch, again 8 bits are used for keeping the state of eahc switch why? SwitchStates: DS 1 ; current state of Switch 0 DS 1 ; current state of Switch 1 DS 1 ; current state of Switch 2 DS 1 ; current state of Switch 3 DS 1 ; current state of Switch 4 DS 1 ; current state of Switch 5 DS 1 ; current state of Switch 6 DS 1 ; current state of Switch 7 6) Then for switch counter 2 bytes are used so these will start after the bytes for current state of switch bytes are finished and for each switch 16bits are used i think these because 5 seconds counter is needed separately for each switch iam i rite? SwitchCounters: DS 2 ; counter for Switch 0 DS 2 ; counter for Switch 1 DS 2 ; counter for Switch 2 DS 2 ; counter for Switch 3 DS 2 ; counter for Switch 4 DS 2 ; counter for Switch 5 DS 2 ; counter for Switch 6 DS 2 ; counter for Switch 7 7)Then why 20 bytes are reserved for STACK why not more how this is calculated that the STACK should have 20 bytes or less and what does the RAM_END label means here? STACK: DS 20 ; reserve 20 bytes of space RAM_END: DS 1 ; end of allocated RAM marker 8)Now as per the tutorial here and your information does CSEG segment means the code memory where the user code is and it is of 64K? I hope its not too many questions, i think i should move to the next thread, i hope there is no limit of writing in reply to any post. |
Topic | Author | Date |
what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding![]() | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
Some questions about the code | 01/01/70 00:00 | |
RE: Some questions about the code | 01/01/70 00:00 | |
Some questions about the code | 01/01/70 00:00 | |
Some more questions about the Main Loop | 01/01/70 00:00 |