REM - REM Author: Brian Tiffin REM Dedicated to the public domain REM REM Date started: January 2017 REM Modified: 2017-01-12/22:36-0500 REM REM Tectonics: REM bacon -f mixedbacon.bac REM + REM mixedbacon.bac, uniffi call to BaCon BASIC FUNCTION embed(int operand1,int operand2) TYPE int USEC #define ASM asm( #define GAS ); int sum, accumulator; ASM "movl %1, %0\n\t" "addl %2, %0" : "=r" (sum) /* output operands */ : "r" (operand1), "r" (operand2) /* input operands */ : "0" /* clobbered operands */ GAS accumulator = sum; ASM "addl %1, %0\n\t" "addl %2, %0" : "=r" (accumulator) : "0" (accumulator), "g" (operand1), "r" (operand2) : "0" GAS END USEC RETURN accumulator END FUNCTION REM REM asmmix, to be called from Unicon uniffi REM FUNCTION asmmix(int one, int two) PRINT "BaCon received: ", one, ", ", two my_accumulator=embed(one, two) RETURN my_accumulator END FUNCTION