Here's what worked for me:
#1: I just reference the function name without "()" and without "&" (as done for modern C). For example, this (nonsense) code produced the correct ASM:
extern int func1();
foo() {
int *f;
f = func1;
*f = 0xedb0;
}
#2: I'm not seeing any issue - the ASM file contains the same
labels as in the #asm section of the C source ("ISR000", etc). One
thing about most C compilers of that era (and even modern ones) is
that "C" variables, etc, will be prefixed with a special character
internally ("_" if it's valid) which means that any inline
assembly language must manually prefix references to C variables,
etc. If you have a C variable "foo" you must refer to it as "_foo"
from inline assembly code (or whatever the special character is
for your assembler config).
Maybe we're not talking about the same "C80"? I'm using "The Software Toolworks C/80" on CP/M.
--
You received this message because you are subscribed to the Google Groups "SEBHC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sebhc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sebhc/9bcf6f43-320c-46bd-a8d9-d8373917f76en%40googlegroups.com.
I misspoke about C/80 prefixing variables. C/80 does not prefix
global variable names with anything.
Perhaps you are talking about how C/80 treats local variables vs. global variables? Only global variables are assigned "meaningful" labels, basically the name used in the program source code. Local variables are always rendered/renamed into temporary labels. You can really only reliably access global variables from ASM code. Although, there was a trick we used to pass a single local variable into ASM code: if you have a seemingly useless statement "var;" immediately before your "#asm" you can assume the HL will contain the value of "var". It's a bit of a kludge, but can be used.
To view this discussion on the web visit https://groups.google.com/d/msgid/sebhc/b2942666-1c0d-0094-9cb7-cca654a31331%40gmail.com.
Sounds like you’ve gotten an answer joe. But FYI I’ll remind you all of cdecl which is a very useful resource
so “declare x as pointer to function returning int” results in:
int (*x)()
you can then pass x, store in an array, or otherwise use it like any other variable.
also of course if you’re working with C/80 I highly recommend keeping a copy of Kernighan & Ritchie (“K&R” – the original 1978 one, not the later ANSI one) by your desk. Pointers to functions are discussed in 5.12, see especially the sort() routine on p. 116…
Joe: did you get the answer on how to connect your ISR globals to your C program? I can help with that if you still need it…
--
You received this message because you are subscribed to a topic in the Google Groups "SEBHC" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sebhc/6X3LGHpFlq8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sebhc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sebhc/0b6901d8cf4e%244c9e2160%24e5da6420%24%40gmail.com.