I'm building an audio driver in ASM6, and I'm up to where I build a table of sound effect addresses and lengths. But when I try to express lookup tables using macros, I get "Incomplete expression" errors.
When I assemble this source file and provide -L to expand macros in the listing file:
This listing is produced:
What is causing these errors, and what should I understand in order to figure out how to fix them?
When I assemble this source file and provide -L to expand macros in the listing file:
Code:
macro sfxdef name, baseaddr, length, period, channel
name = <((* - sfx_table) / 4)
dw baseaddr
db (channel<<2)|((period - 1)<<4)
db length
endm
base $C000
sfx_table:
sfxdef SFX_foo, foo_data, 1, 1, 0
sfxdef SFX_bar, bar_data, 1, 1, 0
foo_data: db $89,$10
bar_data: db $84,$20
name = <((* - sfx_table) / 4)
dw baseaddr
db (channel<<2)|((period - 1)<<4)
db length
endm
base $C000
sfx_table:
sfxdef SFX_foo, foo_data, 1, 1, 0
sfxdef SFX_bar, bar_data, 1, 1, 0
foo_data: db $89,$10
bar_data: db $84,$20
This listing is produced:
Code:
macro sfxdef name, baseaddr, length, period, channel
name = <((* - sfx_table) / 4)
dw baseaddr
db (channel<<2)|((period - 1)<<4)
db length
endm
base $C000
0C000 sfx_table:
0C000 sfxdef SFX_foo, foo_data, 1, 1, 0
0C000 SFX_foo = <((* - sfx_table) / 4)
*** Incomplete expression.
0C000 08 C0 dw foo_data
0C002 00 db (0<<2)|((1 - 1)<<4)
0C003 01 db 1
0C004 sfxdef SFX_bar, bar_data, 1, 1, 0
0C004 SFX_bar = <((* - sfx_table) / 4)
*** Incomplete expression.
0C004 0A C0 dw bar_data
0C006 00 db (0<<2)|((1 - 1)<<4)
0C007 01 db 1
0C008
0C008 89 10 foo_data: db $89,$10
0C00A 84 20 bar_data: db $84,$20
name = <((* - sfx_table) / 4)
dw baseaddr
db (channel<<2)|((period - 1)<<4)
db length
endm
base $C000
0C000 sfx_table:
0C000 sfxdef SFX_foo, foo_data, 1, 1, 0
0C000 SFX_foo = <((* - sfx_table) / 4)
*** Incomplete expression.
0C000 08 C0 dw foo_data
0C002 00 db (0<<2)|((1 - 1)<<4)
0C003 01 db 1
0C004 sfxdef SFX_bar, bar_data, 1, 1, 0
0C004 SFX_bar = <((* - sfx_table) / 4)
*** Incomplete expression.
0C004 0A C0 dw bar_data
0C006 00 db (0<<2)|((1 - 1)<<4)
0C007 01 db 1
0C008
0C008 89 10 foo_data: db $89,$10
0C00A 84 20 bar_data: db $84,$20
What is causing these errors, and what should I understand in order to figure out how to fix them?