Das erzählt mir was von
Code: Alles auswählen
../_DEVELOPMENT/l/sccz80/9-common/f48/fa.asm:12: error: undefined symbol: init_floatpack
^---- init_floatpack
Code: Alles auswählen
../_DEVELOPMENT/l/sccz80/9-common/f48/fa.asm:12: error: undefined symbol: init_floatpack
^---- init_floatpack
Code: Alles auswählen
#include <stdio.h>
#include <string.h>
/* Formats a float by cutting off the zeroes at the end.
If there are only zeroes after the decimal point, then
the decimal point is cut off, too.
Parameters: f the float value to format
formatted a character buffer to hold the float as string
*/
void formatNumber(float f, char *formatted) {
char *s;
sprintf(formatted, "%f", f);
s = formatted + strlen(formatted);
--s;
while (s != formatted) {
if (*s != '0') {
if (*s != '.') {
++s;
}
*s = '\0';
break;
}
--s;
}
}
/* Main.
Returns an error code (== 0: ok, != 0: error).
*/
int main(void)
{
float fInput, fAkku;
char op, currentOp;
char continueLoop;
char formatted[20];
printf("Mini-Taschenrechner\n\n");
op = '\0';
fAkku = 0;
continueLoop = 1;
do {
printf("Zahl : ");
scanf("%f", &fInput);
printf("Operation: ");
currentOp = getchar();
currentOp = getchar();
switch (op) {
case '\0':
fAkku = fInput;
break;
case '+':
fAkku = fAkku + fInput;
break;
case '-':
fAkku = fAkku - fInput;
break;
case '*':
fAkku = fAkku * fInput;
break;
case '/':
fAkku = fAkku / fInput;
break;
default:
continueLoop = 0;
}
formatNumber(fAkku, formatted);
printf(" %s\n", formatted);
op = currentOp;
} while (currentOp != '=' && continueLoop);
return 0;
}
Code: Alles auswählen
zcc +cpm -subtype=pcw80 -create-app calc.c -o calc.com
calc.c::main::0::5:36: error: undefined symbol: dadd
^---- dadd
calc.c::main::0::5:36: error: undefined symbol: dsub
^---- dsub
calc.c::main::0::5:36: error: undefined symbol: dmul
^---- dmul
calc.c::main::0::5:36: error: undefined symbol: ddiv
^---- ddiv
CP/M Box Version 1.9.2 benutze ich. Und normalerweise die Enter Taste am Ziffernblock.bbock hat geschrieben: ↑26.02.2023, 17:14 Also, das mit der zu schnellen Tastenwiederholung kenne ich nur, wenn ich den "Fast Mode" einschalte (mit F11 oder mit der "Vorwärtsspulen"-Schaltfläche). Das betrifft dann alle Tasten. Die Return-Taste macht bei mir gar keine Tastenwiederholung, die Enter-Taste vom Ziffernblock schon.
Welche CP/M Box Version verwendest du denn?
Ganz ganz herzlichen Dank Bernd!!!bbock hat geschrieben: ↑25.02.2023, 14:09
Das würde man in C ähnlich wie in TurboPascal mit gotoxy(10, 14); machen - normalerweise...Code: Alles auswählen
#include <stdio.h> void gotoXY(unsigned int x, unsigned int y) { putchar(27); // ESC putchar('Y'); // cursor to position putchar(y + 32); // row + 32 putchar(x + 32); // column + 32 } int main(void) { gotoXY(10, 14); putchar('O'); // oder printf("%s", "O"); }