| ??? 07/18/01 20:59 Read: times |
#13315 - RE: ORG |
Your assembler maintains a pointer to know where the generated code should go. This pointer reflects the program counter (in short PC) of your microcontroller in real life.
e.g. if your assembler generates a 2 byte instruction, then the PC is incremented twice to point at the location where the following instruction should be placed. ORG will pre-set the PC to a predefined address. The first byte the assembler generates after that ORG will be put at that address. The second byte at the next address, etc. What address to choose depends on your hardware. If you're programming a real stand allone controller like a native 8052, you should begin your program with ORG 0000h, which is pretty much the default value for most assemblers anyway. But if you use some kind of prefab board with a monitor program in it, you might have to use ORG 8000h, or whatever the starting address of your XRAM / Program RAM area is. You may also use the ORG directive to skip some memory, like unused interrupt vector space. I hope this explanation helps a little. Happy programming. |
| Topic | Author | Date |
| ORG | 01/01/70 00:00 | |
| RE: ORG | 01/01/70 00:00 | |
| RE: ORG | 01/01/70 00:00 | |
| RE: ORG | 01/01/70 00:00 | |
RE: ORG | 01/01/70 00:00 |



