.bss .word 1 thumb 1114 assembler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

.bss .word 1 thumb 1114 assembler

288 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cwpjr on Sun Jan 27 18:50:16 MST 2013
in a *.s module I declare an uninitialized variable:
.bss
// .align 2 or 4 or commented out no matter
ABASE: .word 1
NBASE:          .word    1
XBASE: .word 1

I then load the address to a register:

    LDR   r0, =NBASE

I get a address like 0x1000003E

such that my initialization code for the NBASE variable HardFaults.

EX:
STR r1, [r0]

.word help says the 1 argument I give is an expression, with no examples there, so where can I find what I'm missing?
0 Kudos
Reply
1 Reply

277 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cwpjr on Mon Jan 28 17:44:58 MST 2013
In .bss .word and .byte arguments are meaningless except to enforce standard allocation of a word or a byte...
LBL: .byte 64 is a byte
LB2: .byte 1 is a byte
LB3: .byte may be a byte but the label after it will point to the same byte.
LB4: same as LB3:

.space 64 actually uses it's argument and allocated 64 bytes

I had avoided it because a second fill arg implied usage in .data, not .bss
0 Kudos
Reply