Quote Originally Posted by Darrel Taylor View Post
For more versatility, you might consider this ...

The EXT (external) modifier.

Typcasting Variables inside of Arrays
http://www.picbasic.co.uk/forum/show...php?t=3891#TYP
Darrel, EXT can't be that versatile. I'm using the EXT modifier, its your code example I'm using.

Serout2 TX_USB, 84,[" DSvolts is ",bin DSvolts.highbyte,bin DSvolts.lowbyte,13,10]
this won't compile. Should it? Or could I have a Bank problem?


Code:
    DSbuffer  VAR BYTE[9] BANK0
ASM          ;Typcasting Variables inside of Arrays
DSstat    = _DSbuffer      ; byte
DStemp    = _DSbuffer + 1  ; word
DSvolts   = _DSbuffer + 3  ; word
DScurrent = _DSbuffer + 5  ; word
DSthres   = _DSbuffer + 7  ; byte
DScrc     = _DSbuffer + 8  ; byte
ENDASM
    DSstat      VAR  BYTE  EXT ; Status/Configuration
    DStemp      VAR  WORD  EXT ; Temperature
    DSvolts     VAR  WORD  EXT ; Voltage
    DScurrent   VAR  WORD  EXT ; Current
    DSthres     VAR  BYTE  EXT ; Threshold
    DScrc       VAR  BYTE  EXT ; CRC