Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.
- Posts: 6
- Joined: Tue Jan 06, 2015 7:56 pm
- Location: Orleans | France
I'm quickly testing C programming in OSDK 1.11
and want to use the scanf()
Has anyone tried it before ?
I'm testing the following :
Code: Select all
// Using the Scanf() ANSI-C function
printf("What is your name ?\n");
printf("Hello %s!\n", my_str);
However, at the moment I get the following answer from the linker :
Building the program HWSIMPLE at adress $800
- convert C to assembly code
- cleanup output
D:\apps\dev\osdk\sample\c\scanf\MAIN.s(3): 08bd:Overflow error
scanbuf reserve 256
D:\apps\dev\osdk\sample\c\scanf\scanf.s(8): 090d:Syntax error
fieldcount db 0
D:\apps\dev\osdk\sample\c\scanf\sscanf.s(53): 0973:Syntax error
numberscan dw 0
D:\apps\dev\osdk\sample\c\scanf\sscanf.s(166): 0a42:Syntax error
signscan db 0
D:\apps\dev\osdk\sample\c\scanf\sscanf.s(167): 0a42:Label defined error
Break after 5 errors
ERROR : Build failed.
Press any key to continue . . .
Dear Oric fellows, any idea of what I'm doing wrong? (attached is my C tiny program)
- (3.07 KiB) Downloaded 49 times
- Site Admin
- Posts: 2894
- Joined: Fri Jan 06, 2006 10:00 pm
- Location: Oslo, Norway
As it happens, you are probably the first person having tried to use scanf in the OSDK since we switched to XA instead of FRAsm.
Basically we forgot to convert the syntax for the scanf.s and sscanf.s files in the lib folder.
I just fixed that, but until I release a new version of the OSDK you need to use a temporary fix:
- reserve -> .dsb
- db -> .byt
- dw -> .word
I attached the working files in the zip file.
Also, your overflow error is not something that can be fixed, you have added a 256 bytes local variable in your main, that's not going to work very well.
If you move the "char my_str;" out of main() that should work just fine.
- (1.37 KiB) Downloaded 47 times