Question regarding PASM
Hi all!
I splitted a PASM function into two parts:
Now if I want to call the whole function I'm using
but how do I call the sub function only?
I tried the following code but it does not work:
I splitted a PASM function into two parts:
wINDIRECT
'Populate reg and data before calling this routine.
'and reg, _wordmask 'Ensure only a word will be copied over
mov t2, reg
and t2, _lowerbyte
shl t2, shift1
andn outa, A0mask
or outa, A1mask 'Set address to $02 (LSBs of address Register)
or outa, RDmask 'Set RDpin high
andn outa, WRmask 'and WRpin low to perform a write operation
and outa, invDATAmask 'Clear all data lines
or outa, t2 'set the data pins to the given value
andn outa, CSmask 'Begin the data transmission
nop
or outa, CSmask 'End the data transmission (first half of the address)
mov t2, reg
and t2, _upperbyte
shl t2, shift2
or outa, A0mask
andn outa, A1mask 'Set address to $01 (MSBs of address Register)
'andn outa, CSmask 'Start the data transmission (second half of the address)
and outa, invDATAmask 'Clear all data lines
or outa, t2 'set the data pins to the given value
andn outa, CSmask 'Begin the data transmission
nop
or outa, CSmask 'End the data transmission (first half of the address)
:dataonly and data, #$FF 'Ensure only a byte will be copied over
mov t2, data
shl t2, shift1
or outa, A0mask
or outa, A1mask 'Set address to $03 (data Register)
'andn outa, CSmask 'Start the data transmission (payload data)
and outa, invDATAmask 'Clear all data lines
or outa, t2 'set the data pins to the given value
andn outa, CSmask 'Begin the data transmission
nop
or outa, CSmask 'End the data transmission (first half of the address)
wINDIRECT_ret ret 'Return to the calling loop
Now if I want to call the whole function I'm using
call #wINDIRECT
but how do I call the sub function only?
I tried the following code but it does not work:
call #wINDIRECT:dataonly

Comments
wINDIRECT '... stuff dataonly '... other stuff dataonly_ret wINDIRECT_ret retThis way, you can call either wINDIRECT or dataonly
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com
My products: Morpheus / Mem+ / PropCade / FlexMem / VMCOG / Propteus / Proteus / SerPlug
and 6.250MHz Crystals to run Propellers at 100MHz & 5.0" OEM TFT VGA LCD modules
Las - Large model assembler Largos - upcoming nano operating system