ASM within a FlexBASIC routine
After three hours of headbanging, I'm ready to swallow my pride and ask the experts. 
I'm trying to dip my toe into putting assembly code inside of a FlexBASIC function. Here is what I'm trying to do (as an example).
I'm trying to dip my toe into putting assembly code inside of a FlexBASIC function. Here is what I'm trying to do (as an example).
dim myVar, shifts as uLong
myVar = 1024
shifts = 8
print BitShiftRight(myVar, shifts)
FUNCTION BitShiftRight(x as ulong, y as ulong) as ulong
'shifts X to right Y places
dim theAnswer as ulong
ASM
(dark magic happens here to get stuff into, and out of the assembly block after shifting X to the right Y places)
END ASM
return theAnswer
END FUNCTION
I feel like a total noob here. The shifts I have no problem with. I can write this in standalone assembly. But I have utterly no idea how to "hook-up" the assembly stuff to the input params, and then "get the answer" out of the assembly block and into the BASIC RETURN value. Can anyone enlighten me how this works? 
Comments
FUNCTION BitShiftRight(x as ulong, y as ulong) as ulong 'shifts X to right Y places ASM SHR x, y END ASM return x END FUNCTIONThat's it. No fancy pointers. No address-of. No mucking about with fancy passing methods.Now if someone could please hand me the dunce hat, I'll go work on some plumbing or something...
LOL, you are not alone when when it comes to missing the simple and obvious when immersed in something that is usually more complex. Done the forehead smack many times after spending time on what turns out to be very simple.
I’m really trying to figure a way to blame @ersmith for this. But it just isnt working... like... at all.
In retrospect, I have to admit that FlexBASIC really is da bomb. It even makes *me* look good when I’m being obtuse. Lol!
FWIW, I am really enjoying the Flex suite. You’ve done some amazing work here.