PDA

View Full Version : WORD vs BYTE variable lengths



bartman
- 28th November 2005, 21:16
From what I discovered for answers in my sound thread I've run into this and am curious about it.

When using this bit of code from MisterE:

@PlayTone
@ BSF _Piezo
PauseUs AVar
@ BCF _Piezo
PauseUs AVar
@ DECFSZ _Cycles,1
@ Goto PlayTone
.
.
.

I found that if Avar and Cycles are set to Word length variable as opposed to Byte length variables the sound is not as "sharp". You can actually make out the spaces during the pulse when using the word length variable.

So, I assume from this that it takes more time for the processor to deal with a word variable instead of a byte size variable? Am I correct here or would something else be coming into play here?

Further to that. I like this method of doing sound over the actual sound command, now that I have a better grasp of how it works, but if the word and byte variables do make differences in timing then it there anyway around that instead of having one subroutine to handle sounds that need a larger variable over the byte size variable?

Thanks.

Bart