3

What does the ".bss" command do in MSP430 assembly code? For example what does ".bss beep_cnt,2" do with the variable beep_cnt2?

.bss    beep_cnt,2              ; beeper flag
.bss    delay_cnt,2             ; delay flag
user1779429
  • 65
  • 1
  • 2
  • 3

1 Answers1

6

The term BSS is universal in assembly and C programming, across operating system no less. Core concept stuff, originally an acronym for "Block Started by Symbol" with a tongue-in-cheek version of Better Save Space. Goes back to the mid 1950s, started by an IBM 704 assembler and adopted into Fortran and flung from there. The wikipedia article has the history. Not otherwise mentioning the effort to get rid of globals over the past 20 years.

So it is reserving two bytes in the data segment that's zero-initialized at startup.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536