| ??? 04/06/02 14:46 Read: times |
#21487 - RE: quick question on ASM variables |
Remember in other words that a variable is the contents of a RAM memory location. The 8052 has two internal spaces DATA memory, and Indirect memory.
In a modern relocatable assembler, memory locations are allocated into memory Segments. The exact wording will depend on your assembler. However, here is an example for illustration. Mydata SEGEMENT DATA ;declare a space called ; MYDATA in internal data memory My_idata SEGMENT Idata ;Declare a space in Idata too. RSEG Mydata ;change into that defined space to declare allocations. Myfirstvariable: DS 1 MySecondVaiable: DS 1 RSEG My_idata An_indirect_variable:DS 1 CSEG ; Change to the code memory space ORG 0000 JMP 30H ;Now start coding MOV myfirstvariable,#22 MOV Mysecondvariable,#44 MOV @an_indirect_variable,#2 ;etc etc In other words, unless you are accessing XDATA mapped peripherals or something like that, you don't need to know WHERE the variables are, just as you never know in a HLL. Steve |
| Topic | Author | Date |
| quick question on ASM variables | 01/01/70 00:00 | |
| RE: quick question on ASM variables | 01/01/70 00:00 | |
| RE: quick question on ASM variables | 01/01/70 00:00 | |
| RE: quick question on ASM variables | 01/01/70 00:00 | |
| RE: quick question on ASM variables | 01/01/70 00:00 | |
| RE: ASM variables, moving thru it | 01/01/70 00:00 | |
| RE: ASM variables, moving thru it | 01/01/70 00:00 | |
| RE: quick question on ASM variables | 01/01/70 00:00 | |
| RE: quick question on ASM variables, Rob | 01/01/70 00:00 | |
| RE: quick question on ASM variables, Rob | 01/01/70 00:00 | |
| RE: quick question on ASM variables | 01/01/70 00:00 | |
| RE: data segment variables wont work? | 01/01/70 00:00 | |
| RE: quick question on ASM variables | 01/01/70 00:00 | |
| RE: data segment variables wont work? | 01/01/70 00:00 | |
| RE: Thanks!! | 01/01/70 00:00 | |
RE: Thanks!! | 01/01/70 00:00 |



