Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
lord loh. said:Has anyone tried recurssive subroutines?
Is it possible with 18F452 assembly?
lord loh. said:So apart from the default stack to store the PC+1, I shall have to write a routine or a macro to implement a software stack...
No...It was just a wild idea I got. I was trying to learn 18F452 and had lot of trouble understanding the banks.
The trouble now is that I am unable to figure out how memory is allocated if the size of the variables exceed a bank... Will I have to do a banksel before every register file operation? This shall add a lot of words to my code. And can variables cross over banks?
:boooh: too much trouble.
lord loh. said:I shall quit the project after a month but the organization shall continue with their work.
Please look into the Datasheet, Especially the Access Bank. Shortly, it takes all SFRs and 128 GPRs and put's them into separate address space, so that no Bank switching is necessary (if 128 GPRs is enaugh).lord loh. said:So apart from the default stack to store the PC+1, I shall have to write a routine or a macro to implement a software stack...
No...It was just a wild idea I got. I was trying to learn 18F452 and had lot of trouble understanding the banks.
The trouble now is that I am unable to figure out how memory is allocated if the size of the variables exceed a bank... Will I have to do a banksel before every register file operation? This shall add a lot of words to my code. And can variables cross over banks?
:boooh: too much trouble.
lord loh. said:Yes... I have been thinking and simulating all day...
I am thinking of an extreme case... Where 128 registers are not enough... My PIC is supposed to send packets over an RF link... And a packet means a lot of data with CRC and overheads etc.
What I found was that the linker build fails if a variable or a part of it declared in one udata section overflows from the bank it is currently being defined in into another bank...It is not allowed....
So one has to manage variables in such a way by starting the udata at the begining of the bank so that maximum size of variables can be declared. If I start at FE, I can have only teo bytes.... One at FE and the other at FF. Should I try to define a 3rd byte, there is a build fail.