Well, it depends on what you're trying to do.
If Mario is hitting the block from below and then receiving 100 coins, you'll only be able to play the sound effect once with what SMW gives you. The reason is because blocks only run their code while Mario or sprites are touching them, so you wouldn't be able to play the coin sound during frames when they aren't. The only way to circumvent that is to add code elsewhere to do so (often,
UberASM is used to do so; you could just check
$13CC and, if it's non-zero, play the sound).
However, that presents another possible issue with what you're trying to do. If you do that (or if your block works by having Mario just stand on top of the block the whole time), most likely you'll still just have the sound effect play once. This is because sound effects will only play when the sound number actually changes between two frames; so if you do this over the course of 4 frames:
CodeWait -> Play -> Play -> Play
You'll only hear the sound effect when the "Wait" switches to "Play". So instead, you should alternate them like this:
CodeWait -> Play -> Wait -> Play
To do so in ASM, people typically use the frame counter $14:
Code LDA $13CC
BEQ .ret
LDA $14
AND #$01 ; how often to play; this is every other frame. #$03 (every 4th frame) and #$07 (every 8th) are also common
BNE .ret
LDA #$01
STA $1DFC
.ret
RTL
Professional frame-by-frame time wizard.
YouTube -
Twitter -
SMW Glitch List -
SMW Randomizer