Hi All
Had another read of Hippys excillent work on explainig #macros and there use.
Noticed using multiple lables in the macro but could not fathom out how to send serrxd info
in the simulator so I had a think and came up with the following using 2 difrent lables 2 difrent variable and the first bits of the respective
variables
it just desplays the even values of the variables if the first bit is 0
regards
john
Had another read of Hippys excillent work on explainig #macros and there use.
Noticed using multiple lables in the macro but could not fathom out how to send serrxd info
in the simulator so I had a think and came up with the following using 2 difrent lables 2 difrent variable and the first bits of the respective
variables
Code:
#macro bit_supply(var,var1,lable)'var is bit0 of b0 or bit8 of b1 var1 is b0 or b1
if var=0 then:sertxd(" EVENS "):gosub declare:sertxd(#var1,lf,cr):endif
if var=1 then:pause 15:sertxd(" ODDS "):gosub decbit:sertxd(#var,lf):goto lable:endif
#endm
do
do while b0<10
sup:
b0=b0+1
bit_supply(bit0,b0,sup)
loop
b0=0
do while b1<10
pus:
b1=b1+1
bit_supply(bit8,b1,pus)
loop
b1=0
loop
declare:
if b0>0 and b0<11 then
sertxd("b0 ")
elseif b1>0 and b1<11 then
sertxd("b1 ")
endif
return
decbit:
if bit0=1 then
sertxd("bit0 ")
elseif bit8=1 then
sertxd("bit8 ")
endif
return
regards
john