JWoodrell 285 Posted August 30, 2012 Share Posted August 30, 2012 hey guys, I realize this is probably a silly question. but how do I create a "variable" when working only in assembly. If I were in "C" i just define one, but in tutorials for assembly are written like you already know how to. I am pretty sure it has to do with the ".data" my program compiles fine, but when it tries to load it to the MSP430 to test run it, it kicks back the error "MSP430: Trouble Writing Memory Block at 0x0 on Page 0 of Length 0x2: Could not perform access, BSL memory segments are protected." Also the Compiler has a warning "#10247-D creating output section ".data" without a SECTIONS" I thought .data was a standard section that was defined by default, why would I need to make a custom linker config to use a standard section. and why is it trying to load the data section into protected memory, doesn't it move around memory blocks where it needs to? or am I just confusing things too much? the code I added to test thiswas just .data P1SyncChk .word 0x00 which is (from what I can tell) from the example on page 25 of SLAU131b the assembly language manual for MSP430... I is confused Quote Link to post Share on other sites
Rickta59 589 Posted August 30, 2012 Share Posted August 30, 2012 One of the best ways to figure out how to do something in ASM is to write it in C and then have the compiler output the asm it creates. Quote Link to post Share on other sites
oPossum 1,083 Posted August 30, 2012 Share Posted August 30, 2012 Use .bss to declare non-constant data .bss foo, 2 ; Integer named foo Use .byte, .word and .long to declare constant data in the code segment JWoodrell 1 Quote Link to post Share on other sites
JWoodrell 285 Posted August 30, 2012 Author Share Posted August 30, 2012 thank you that was driving me nuts Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.