1

I propose two headers for PedroM, one for GAS, the other for A68k :
pedrom::stdin		equ	pedrom@0000
pedrom::stdout		equ	pedrom@0000+4
pedrom::stderr		equ	pedrom@0000+8

pedrom::printf		equ	pedrom@0004
pedrom::vcbprintf	equ	pedrom@0005
pedrom::clrscr		equ	pedrom@0006
pedrom::fclose		equ	pedrom@0007
pedrom::freopen		equ	pedrom@0008
pedrom::fopen		equ	pedrom@0009
pedrom::fseek		equ	pedrom@000a
pedrom::ftell		equ	pedrom@000b
pedrom::feof		equ	pedrom@000c
pedrom::fputc		equ	pedrom@000d
pedrom::fputs		equ	pedrom@000e
pedrom::fwrite		equ	pedrom@000f
pedrom::fgetc		equ	pedrom@0010
pedrom::fread		equ	pedrom@0011
pedrom::fgets		equ	pedrom@0012
pedrom::ungetc		equ	pedrom@0013
pedrom::fflush		equ	pedrom@0014
pedrom::clearerr	equ	pedrom@0015
pedrom::ferror		equ	pedrom@0016
pedrom::rewind		equ	pedrom@0017
pedrom::fprintf		equ	pedrom@0018
pedrom::tmpnam		equ	pedrom@0019

pedrom::qsort		equ	pedrom@001b

pedrom::bsearch		equ	pedrom@001e
pedrom::remove		equ	pedrom@001f
pedrom::unlink		equ	pedrom@001f
pedrom::rename		equ	pedrom@0020
pedrom::atoi		equ	pedrom@0021
pedrom::atol		equ	pedrom@0021

pedrom::rand		equ	pedrom@0023
pedrom::srand		equ	pedrom@0024
pedrom::calloc		equ	pedrom@0025
pedrom::realloc		equ	pedrom@0026
pedrom::atof		equ	pedrom@0027
pedrom::sttputchar	equ	pedrom@0028	; ???
pedrom::perror		equ	pedrom@0029
pedrom::getenv		equ	pedrom@002a
pedrom::system		equ	pedrom@002b
pedrom::setvbuf		equ	pedrom@002c
pedrom::exit		equ	pedrom@002d
pedrom::atexit		equ	pedrom@002e

.set	pedrom__stdin,		pedrom__0000
.set	pedrom__stdout,		pedrom__0000+4
.set	pedrom__stderr,		pedrom__0000+8

.set	pedrom__printf,		pedrom__0004
.set	pedrom__vcbprintf,	pedrom__0005
.set	pedrom__clrscr,		pedrom__0006
.set	pedrom__fclose,		pedrom__0007
.set	pedrom__freopen,	pedrom__0008
.set	pedrom__fopen,		pedrom__0009
.set	pedrom__fseek,		pedrom__000a
.set	pedrom__ftell,		pedrom__000b
.set	pedrom__feof,		pedrom__000c
.set	pedrom__fputc,		pedrom__000d
.set	pedrom__fputs,		pedrom__000e
.set	pedrom__fwrite,		pedrom__000f
.set	pedrom__fgetc,		pedrom__0010
.set	pedrom__fread,		pedrom__0011
.set	pedrom__fgets,		pedrom__0012
.set	pedrom__ungetc,		pedrom__0013
.set	pedrom__fflush,		pedrom__0014
.set	pedrom__clearerr,	pedrom__0015
.set	pedrom__ferror,		pedrom__0016
.set	pedrom__rewind,		pedrom__0017
.set	pedrom__fprintf,	pedrom__0018
.set	pedrom__tmpnam,		pedrom__0019

.set	pedrom__qsort,		pedrom__001b

.set	pedrom__bsearch,	pedrom__001e
.set	pedrom__remove,		pedrom__001f
.set	pedrom__unlink,		pedrom__001f
.set	pedrom__rename,		pedrom__0020
.set	pedrom__atoi,		pedrom__0021
.set	pedrom__atol,		pedrom__0021

.set	pedrom__rand,		pedrom__0023
.set	pedrom__srand,		pedrom__0024
.set	pedrom__calloc,		pedrom__0025
.set	pedrom__realloc,	pedrom__0026
.set	pedrom__atof,		pedrom__0027
.set	pedrom__sttputchar,	pedrom__0028	| ???
.set	pedrom__perror,		pedrom__0029
.set	pedrom__getenv,		pedrom__002a
.set	pedrom__system,		pedrom__002b
.set	pedrom__setvbuf,	pedrom__002c
.set	pedrom__exit,		pedrom__002d
.set	pedrom__atexit,		pedrom__002e

I'm working to retrieve the informations which will allow to write the C header (mainly arguments needed, and where PedroM will search for them) to allow someone to write the C header (i won't be able to write it by myself).[nosmile]

2

[nosmile]Something like that would be good ?
pedrom::stdin		equ	pedrom@0000
pedrom::stdout		equ	pedrom@0000+4
pedrom::stderr		equ	pedrom@0000+8

variables

pedrom::printf equ pedrom@0004
args are on the stack : format, args, ...
pedrom::vcbprintf equ pedrom@0005
vcbprintf (short (*callback)(short,FILE *), FILE *p, const char *fmt, va_list args)
(from printf.c, line 225)
pedrom::clrscr equ pedrom@0006
no args
pedrom::fclose equ pedrom@0007
__ATTR_REG__ short fclose(FILE *f)
(from files.c, line 56)
pedrom::freopen equ pedrom@0008
__ATTR_REG__ FILE *freopen(const char *name, const char *mode, FILE *f)
(from files.c, line 75)
pedrom::fopen equ pedrom@0009
__ATTR_REG__ FILE *fopen(const char *name, const char *mode)
(from files.c, line 178)
pedrom::fseek equ pedrom@000a
__ATTR_REG__ short fseek(FILE *f, long offset, short wh)
(from files.c, line 187)
pedrom::ftell equ pedrom@000b
__ATTR_REG__ long ftell(FILE *f)
(from files.c, line 219)
pedrom::feof equ pedrom@000c
__ATTR_REG__ short feof(const FILE *f)
(from files.c, line 228)
pedrom::fputc equ pedrom@000d
__ATTR_STK__ short fputc(short c, FILE *f)
(from files.c, line 237)

3

Thanks wink
This is related to ticket #5 "Clearer AMS / TIGCCLIB / PedroM separation". I think we should tackle #9 "Upgrade kernel support" first.

What about pedrom@0001, pedrom@0002 and pedrom@0003 ? Don't these exist ?
I can see a typo: "fprtinf" wink
avatar
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Co-admin de TI-Planet.

4

Lionel Debroux (./3) :
This is related to ticket #5 "Clearer AMS / TIGCCLIB / PedroM separation".

Oops, so this is not the right section... You move it ?
Lionel Debroux (./3) :
What about pedrom@0001, pedrom@0002 and pedrom@0003 ? Don't these exist ?

Just variables which really exist. I don't know how to write that in C to tell the program that they are not functions, but adresses. (lea.l pedrom__stdout,%a0)
Lionel Debroux (./3) :
I can see a typo: "fprtinf" wink.gif

No, pedrom__fprintf is pedrom__0018, != pedrom__printf

5

It's OK in this section, I think.
I can see a typo: "fprtinf" wink
No, pedrom__fprintf is pedrom__0018, != pedrom__printf

Indeed, but I was referring to the 't' being two characters too early. That should read "fprintf" instead of "fprtinf".
avatar
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Co-admin de TI-Planet.

6

Fixed. Well done hehe

7

	dc.w	DIALOG.Do_redirect-PedroMLibKernel		; 1A
	dc.w	qsort_redirect-PedroMLibKernel			; 1B
	dc.w	PID_Switch_redirect-PedroMLibKernel		; 1C
	dc.w	_tt_Decompress_redirect-PedroMLibKernel		; 1D
	dc.w	bsearch_redirect-PedroMLibKernel			; 1E

I had missing elements in my header, and I found them looking at Library.asm. I don't know why. PpHd, I should add all that ? Was it you that gave me this header ? I don't remember...

8

Most of that stuff has OS-independent implementations in TIGCCLIB though.
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

9

PpHd, could you check that please ? I didn't found the description of all ramcalls, and I have added exports for the pedrom lib. You are ok to export them ?
;=======================================================
;	PedroM exports
;=======================================================
pedrom::stdin		equ	pedrom@0000
pedrom::stdout		equ	pedrom@0000+4
pedrom::stderr		equ	pedrom@0000+8
pedrom::RunMainFunction	equ	pedrom@0001	; Added
pedrom::HeapRealloc	equ	pedrom@0002	; Added
pedrom::HeapMax		equ	pedrom@0003	; Added
pedrom::printf		equ	pedrom@0004
pedrom::vcbprintf	equ	pedrom@0005
pedrom::clrscr		equ	pedrom@0006
pedrom::fclose		equ	pedrom@0007
pedrom::freopen		equ	pedrom@0008
pedrom::fopen		equ	pedrom@0009
pedrom::fseek		equ	pedrom@000a
pedrom::ftell		equ	pedrom@000b
pedrom::feof		equ	pedrom@000c
pedrom::fputc		equ	pedrom@000d
pedrom::fputs		equ	pedrom@000e
pedrom::fwrite		equ	pedrom@000f
pedrom::fgetc		equ	pedrom@0010
pedrom::fread		equ	pedrom@0011
pedrom::fgets		equ	pedrom@0012
pedrom::ungetc		equ	pedrom@0013
pedrom::fflush		equ	pedrom@0014
pedrom::clearerr	equ	pedrom@0015
pedrom::ferror		equ	pedrom@0016
pedrom::rewind		equ	pedrom@0017
pedrom::fprintf		equ	pedrom@0018
pedrom::tmpnam		equ	pedrom@0019
pedrom::DialogDo	equ	pedrom@001a	; Added
pedrom::qsort		equ	pedrom@001b
pedrom::PID_Switch	equ	pedrom@001c	; Added
pedtom::_tt_Decompress	equ	pedrom@001d	; Added
pedrom::bsearch		equ	pedrom@001e
pedrom::remove		equ	pedrom@001f
pedrom::unlink		equ	pedrom@001f
pedrom::rename		equ	pedrom@0020
pedrom::atoi		equ	pedrom@0021	; atoi, not atol ?!?
pedrom::kbd_queue	equ	pedrom@0022	; Added
pedrom::rand		equ	pedrom@0023
pedrom::srand		equ	pedrom@0024
pedrom::calloc		equ	pedrom@0025
pedrom::realloc		equ	pedrom@0026
pedrom::atof		equ	pedrom@0027
pedrom::_sputc		equ	pedrom@0028	; Modified
pedrom::perror		equ	pedrom@0029
pedrom::getenv		equ	pedrom@002a
pedrom::system		equ	pedrom@002b
pedrom::setvbuf		equ	pedrom@002c
pedrom::exit		equ	pedrom@002d
pedrom::atexit		equ	pedrom@002e


;=======================================================
;	RAM_THROW extension
;=======================================================

RAM_THROW	macro
	dc.w	$F000+\0
endm

RAMC	macro			; I prefer this one because it does 
	dc.w	$F000+\0	; not break my indentation :p
endm

RAM_CALCULATOR			equ	0
RAM_LCD_WIDTH			equ	1
RAM_LCD_HEIGHT			equ 	2
RAM_ROM_BASE			equ	3
RAM_LC_LINE_BYTES		equ	4
RAM_KEY_LEFT			equ	5
RAM_KEY_RIGHT			equ	6
RAM_KEY_UP			equ	7
RAM_KEY_DOWN			equ	8
;RAM_				equ	9	; 342 on 92, 345 on 89 (KEY_UPRIGHT or KEY_DOWNLEFT)
;RAM_				equ	10	; 345 on 92, 342 on 89
;RAM_				equ	11	; $2000 on both models
RAM_LCD_SIZE			equ	12
;RAM_				equ	13	; $4000 on both models
RAM_font_medium			equ	14
RAM_ReturnValue			equ	15
;RAM_				equ	16	; TEST_PRESSED_FLAG-$1c ?
RAM_Heap			equ	17
RAM_FolderListHandle		equ	18
RAM_MainHandle			equ	19	; FoldeListHandle + 1 ?
;RAM_				equ	20	; $0130 on both models ? kb_globals ?
RAM_kernel::idle		equ	21
RAM_kernel::exec		equ	22
RAM_kernel::Ptr2Hd		equ	23
RAM_kernel::Hd2Sym		equ	24
RAM_kernel::LibsBegin		equ	25
RAM_kernel::LibsEnd		equ	26
RAM_kernel::LibsCall		equ	27
RAM_kernel::LibsPtr		equ	28
RAM_kernel::LibsExec		equ	29
RAM_kernel::HdKeep		equ	30
RAM_kernel::ExtractFromPack	equ	31
RAM_kernel::ExtractFile		equ	32
RAM_LCD_MEM 			equ	33
RAM_font_small			equ	34
RAM_font_large			equ	35
RAM_SYM_ENTRY.name		equ	36
RAM_SYM_ENTRY.compat		equ	37
RAM_SYM_ENTRY.flags		equ	38
RAM_SYM_ENTRY.hVal		equ	39
RAM_SYM_ENTRY.sizeof		equ	40
RAM_kernel::ExtractFileFromPack	equ	41
RAM_kernel::exit		equ	42
RAM_kernel::atexit		equ	43
RAM_kernel::RegisterVector	equ	44
RAM_GHOST_SPACE			equ	45
RAM_KERNEL_SPACE		equ	46
RAM_kernel::SystemDir		equ	47

; I haven't found :
; HW_EVRSION, HW_REVISION_VERSION, EMULATOR, ROM_VERSION, KEY_DIAMOND,
; KEY_SHIFT, kb_globals, 
[nosmile]

pedrom::sidefont is pedrom::0000+28 ?

(chsui paschez moi, et yaguère d'outils pour bosser sur ce qui sert de PC à mes beaux-parents triso)

10

!call PpHd
--- Call : PpHd appelé(e) sur ce topic ...
?

11

Folco (./9) :
pedrom::RunMainFunction equ pedrom@0001 ; Added


Useless. Should be removed. Kept only for compatibility with PedroM 0.80.
Folco (./9) :
pedrom::HeapRealloc equ pedrom@0002 ; Added pedrom::HeapMax equ pedrom@0003 ; Added

Same functions as for AMS, except they don't limit the maximum allocatable to 65520: you can get what you want.
Folco (./9) :
pedrom::exit equ pedrom@002d pedrom::atexit equ pedrom@002e

It is the exact same functions as the kernel ones. Use RAMCALL_exit/atexit instead.
Folco (./9) :
pedrom::atoi equ pedrom@0021 ; atoi, not atol ?!?

Starting PedroM 0.82, atoi and atol are the same functions.
Folco (./9) :
pedrom::stdin equ pedrom@0000 pedrom::stdout equ pedrom@0000+4 pedrom::stderr equ pedrom@0000+8


Missing:
pedrom::argc equ pedrom@0000+12
pedrom::argc equ pedrom@0000+16
pedrom::errno equ pedrom@0000+20
pedrom::side_font equ pedrom@0000+24
Folco (./9) :
; I haven't found : ; HW_EVRSION, HW_REVISION_VERSION, EMULATOR, ROM_VERSION, KEY_DIAMOND, ; KEY_SHIFT, kb_globals,


Try again tongue

12

Is it right now ?
;=======================================================
;	PedroM exports
;=======================================================
pedrom::stdin		equ	pedrom@0000
pedrom::stdout		equ	pedrom@0000+4
pedrom::stderr		equ	pedrom@0000+8
pedrom::argc		equ	pedrom@0000+12
pedrom::argv		equ	pedrom@0000+16
pedrom::errno		equ	pedrom@0000+20
pedrom::side_font	equ	pedrom@0000+24

;pedrom@0001					DEPRECATED, don't use it

pedrom::HeapRealloc	equ	pedrom@0002	; Allow to alloc more than 65520 bytes
pedrom::HeapMax		equ	pedrom@0003	; Idem, able to return a value > 65520
pedrom::printf		equ	pedrom@0004
pedrom::vcbprintf	equ	pedrom@0005
pedrom::clrscr		equ	pedrom@0006
pedrom::fclose		equ	pedrom@0007
pedrom::freopen		equ	pedrom@0008
pedrom::fopen		equ	pedrom@0009
pedrom::fseek		equ	pedrom@000a
pedrom::ftell		equ	pedrom@000b
pedrom::feof		equ	pedrom@000c
pedrom::fputc		equ	pedrom@000d
pedrom::fputs		equ	pedrom@000e
pedrom::fwrite		equ	pedrom@000f
pedrom::fgetc		equ	pedrom@0010
pedrom::fread		equ	pedrom@0011
pedrom::fgets		equ	pedrom@0012
pedrom::ungetc		equ	pedrom@0013
pedrom::fflush		equ	pedrom@0014
pedrom::clearerr	equ	pedrom@0015
pedrom::ferror		equ	pedrom@0016
pedrom::rewind		equ	pedrom@0017
pedrom::fprintf		equ	pedrom@0018
pedrom::tmpnam		equ	pedrom@0019
pedrom::DialogDo	equ	pedrom@001a
pedrom::qsort		equ	pedrom@001b
pedrom::PID_Switch	equ	pedrom@001c
pedtom::_tt_Decompress	equ	pedrom@001d
pedrom::bsearch		equ	pedrom@001e
pedrom::remove		equ	pedrom@001f
pedrom::unlink		equ	pedrom@001f
pedrom::rename		equ	pedrom@0020
pedrom::atoi		equ	pedrom@0021	; Starting PedroM 0.82, atoi and atol are the same functions.
pedrom::kbd_queue	equ	pedrom@0022
pedrom::rand		equ	pedrom@0023
pedrom::srand		equ	pedrom@0024
pedrom::calloc		equ	pedrom@0025
pedrom::realloc		equ	pedrom@0026
pedrom::atof		equ	pedrom@0027
pedrom::_sputc		equ	pedrom@0028
pedrom::perror		equ	pedrom@0029
pedrom::getenv		equ	pedrom@002a
pedrom::system		equ	pedrom@002b
pedrom::setvbuf		equ	pedrom@002c
;pedrom::exit		equ	pedrom@002d	; Like functions of the kernel,
;pedrom::atexit		equ	pedrom@002e	; use kernel::exit/kernel::atexit instead


;=======================================================
;	Can be used to call PedroM system calls trough kernel::LibsExec
;=======================================================
PEDROM_stdin		equ	$0
PEDROM_HeapRealloc	equ	$2	; Allow to alloc more tat 65520 bytes
PEDROM_HeapMax		equ	$3	; Idem, able to return a value > 65520
PEDROM_printf		equ	$4
PEDROM_vcbprintf	equ	$5
PEDROM_clrscr		equ	$6
PEDROM_fclose		equ	$7
PEDROM_freopen		equ	$8
PEDROM_fopen		equ	$9
PEDROM_fseek		equ	$a
PEDROM_ftell		equ	$b
PEDROM_feof		equ	$c
PEDROM_fputc		equ	$d
PEDROM_fputs		equ	$e
PEDROM_fwrite		equ	$f
PEDROM_fgetc		equ	$10
PEDROM_fread		equ	$11
PEDROM_fgets		equ	$12
PEDROM_ungetc		equ	$13
PEDROM_fflush		equ	$14
PEDROM_clearerr		equ	15
PEDROM_ferror		equ	$16
PEDROM_rewind		equ	$17
PEDROM_fprintf		equ	$18
PEDROM_tmpnam		equ	$19
PEDROM_DialogDo		equ	$1a
PEDROM_qsort		equ	$1b
PEDROM_PID_Switch	equ	$1c
PEDROM__tt_Decompress	equ	$1d
PEDROM_bsearch		equ	$1e
PEDROM_remove		equ	$1f
PEDROM_unlink		equ	$1f
PEDROM_rename		equ	$20
PEDROM_atoi		equ	$21	; Starting PedroM 0.82, atoi and atol are the same functions.
PEDROM_kbd_queue	equ	$22
PEDROM_rand		equ	$23
PEDROM_srand		equ	$24
PEDROM_calloc		equ	$25
PEDROM_realloc		equ	$26
PEDROM_atof		equ	$27
PEDROM__sputc		equ	$28
PEDROM_perror		equ	$29
PEDROM_getenv		equ	$2a
PEDROM_system		equ	$2b
PEDROM_setvbuf		equ	$2c


;=======================================================
;	RAM_THROW extension
;=======================================================

RAM_THROW	macro
	dc.w	$F000+\0
endm

RAMC	macro			; I prefer this one because it does 
	dc.w	$F000+\0	; not break my indentation :p
endm

RAM_CALCULATOR			equ	$0
RAM_LCD_WIDTH			equ	$1
RAM_LCD_HEIGHT			equ	$2
RAM_tios::ROM_base		equ	$3
RAM_LCD_LINE_BYTES		equ	$4
RAM_KEY_LEFT			equ	$5
RAM_KEY_RIGHT			equ	$6
RAM_KEY_UP			equ	$7
RAM_KEY_DOWN			equ	$8
RAM_KEY_UPRIGHT			equ	$9
RAM_KEY_DOWNLEFT		equ	$A
RAM_KEY_DIAMOND			equ	$B
RAM_LCD_SIZE			equ	$C
RAM_KEY_SHIFT			equ	$D
RAM_tios::font_medium		equ	$E
RAM_ReturnValue			equ	$F
RAM_tios::kb_globals		equ	$10
RAM_tios::Heap			equ	$11
RAM_tios::FolderListHandle	equ	$12
RAM_tios::MainHandle		equ	$13
RAM_ROM_VERSION			equ	$14
RAM_kernel::Idle		equ	$15
RAM_kernel::Exec		equ	$16
RAM_kernel::Ptr2Hd		equ	$17
RAM_kernel::Hd2Sym		equ	$18
RAM_kernel::LibsBegin		equ	$19
RAM_kernel::LibsEnd		equ	$1A
RAM_kernel::LibsCall		equ	$1B
RAM_kernel::LibsPtr		equ	$1C
RAM_kernel::LibsExec		equ	$1D
RAM_kernel::HdKeep		equ	$1E
RAM_kernel::ExtractFromPack	equ	$1F
RAM_kernel::ExtractFile		equ	$20
RAM_LCD_MEM 			equ 	$21
RAM_tios::font_small		equ	$22
RAM_tios::font_large		equ	$23
RAM_tios::SYM_ENTRY.name	equ	$24
RAM_tios::SYM_ENTRY.compat	equ	$25
RAM_tios::SYM_ENTRY.flags	equ	$26
RAM_tios::SYM_ENTRY.hVal	equ	$27
RAM_tios::SYM_ENTRY.sizeof	equ	$28
RAM_kernel::ExtractFileFromPack	equ	$29
RAM_kernel::exit		equ	$2A
RAM_kernel::atexit		equ	$2B
RAM_kernel::RegisterVector	equ	$2C
RAM_GHOST_SPACE			equ	$2D
RAM_KERNEL_SPACE		equ	$2E
RAM_kernel::SystemDir		equ	$2F

[nosmile]

13

Thanks smile
avatar
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Co-admin de TI-Planet.

14

BTW, there are some typos in the header I posted. I will send you the fixed version. The GAS version is done and already tested.

15

pedrom::stdout          equ     pedrom@0000+4
pedrom::stderr          equ     pedrom@0000+8
pedrom::argc            equ     pedrom@0000+12
pedrom::argv            equ     pedrom@0000+16
pedrom::errno           equ     pedrom@0000+20
pedrom::side_font       equ     pedrom@0000+24

Is that a future-proof ABI? Doesn't this hardcode the layout of your variables in RAM?
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

16

Kevin Kofler (./15) :
Is that a future-proof ABI? Doesn't this hardcode the layout of your variables in RAM?


They are only pointers to theses variables.

17

For someone who want to write the C header :
pedrom::stdin		equ	pedrom@0000
pedrom::stdout		equ	pedrom@0000+4
pedrom::stderr		equ	pedrom@0000+8

variables

pedrom::printf equ pedrom@0004
args are on the stack : format, args, ...
pedrom::vcbprintf equ pedrom@0005
vcbprintf (short (*callback)(short,FILE *), FILE *p, const char *fmt, va_list args)
(printf.c, line 225)
pedrom::clrscr equ pedrom@0006
no args
pedrom::fclose equ pedrom@0007
__ATTR_REG__ short fclose(FILE *f)
(files.c, line 56)
[nosmile]
pedrom::freopen equ pedrom@0008
__ATTR_REG__ FILE *freopen(const char *name, const char *mode, FILE *f)
(files.c, line 75)
pedrom::fopen equ pedrom@0009
__ATTR_REG__ FILE *fopen(const char *name, const char *mode)
(files.c, line 178)
pedrom::fseek equ pedrom@000a
__ATTR_REG__ short fseek(FILE *f, long offset, short wh)
(files.c, line 187)
pedrom::ftell equ pedrom@000b
__ATTR_REG__ long ftell(FILE *f)
(files.c, line 219)
pedrom::feof		equ	pedrom@000c[pre]
__ATTR_REG__ short feof(const FILE *f)
(files.c, line 228)
[pre]pedrom::fputc		equ	pedrom@000d

__ATTR_STK__ short fputc(short c, FILE *f)
(files.c, line 237)
pedrom::fputs equ pedrom@000e
__ATTR_REG__ short fputs(const char *s, FILE *f)
(files.c, line 284)
pedrom::fwrite equ pedrom@000f
__ATTR_REG__ unsigned short fwrite(const char *ptr, unsigned short size, unsigned short n, FILE *f)
(files.c, line 290)
pedrom::fgetc equ pedrom@0010
__ATTR_STK__ short fgetc(FILE *f)
(files.c, line 307)
pedrom::fread equ pedrom@0011
__ATTR_REG__ unsigned short fread(unsigned char *ptr, unsigned short size, unsigned short n, FILE *f)
(files.c, line 338)
pedrom::fgets equ pedrom@0012
__ATTR_REG__ char *fgets(char *s, short n, FILE *fp)
(file.c, line 357)
pedrom::ungetc equ pedrom@0013
__ATTR_REG__ short ungetc(short c, FILE *f)
(files.c, line 383)
pedrom::fflush equ pedrom@0014
__ATTR_REG__ short fflush(FILE *f)
(files.c, line 395)
pedrom::clearerr equ pedrom@0015
__ATTR_REG__ void clearerr(FILE *f)
(files.c, line 405)
pedrom::ferror equ pedrom@0016
__ATTR_REG__ short ferror (const FILE *f)
(files.c, line 411)
pedrom::rewind equ pedrom@0017
__ATTR_REG__ void rewind (FILE *f)
(files.c, line 417
pedrom::fprintf equ pedrom@0018
short fprintf(FILE *f, const char *fmt, ...)
(files.c, line 424)
pedrom::tmpnam equ pedrom@0019
char *tmpnam(char *s asm("a0"))
(files.c, line 434)
pedrom::qsort equ pedrom@001b
void qsort (void *list asm("a0"), short num_items asm("d0"), short size asm("d1"), compare_t cmp_func asm("a1"))
(qsort.c, line 28)
pedrom::bsearch equ pedrom@001e
void *bsearch(const void *key asm("a0"), const void *bptr asm("a1"), short n asm("d0"), short w asm("d1"), compare_t cmp_func asm("a2"))
(qsort.c, line 285)
pedrom::remove		equ	pedrom@001f
pedrom::unlink		equ	pedrom@001f

short unlink(const char *fname asm("a0"))
(files.c, line 443)
pedrom::rename equ pedrom@0020
short rename(const char *old asm("a0"), const char *new asm("a1"))
(files.c, line 449)
pedrom::atoi		equ	pedrom@0021
pedrom::atof		equ	pedrom@0021

In: a0 -> string(NULL)
Out:; d0.l = Number (atol)
d0.w = Number (atoi)
(Misc.asm, line 535)
pedrom::kbd_queue equ pedrom@0022
void *kbd_queue (void)
(Misc2.asm, line 226)
pedrom::rand equ pedrom@0023
int rand (rand)
(Misc2.asm, line 385)
pedrom::srand equ pedrom@0024
void srand (unsigned long seed asm ("d0"))
(Misc2.asm, line 404)
pedrom::calloc equ pedrom@0025
void *calloc (unsigned short NoOfItems asm("d0"), unsigned short SizeOfItems asm("d1"));
(Misc2.asm, line 409)
pedrom::realloc equ pedrom@0026
void *realloc (void *Ptr asm("a0"), unsigned long NewSize asm("d1"));
(Misc2.asm, line 423)
pedrom::atof equ pedrom@0027
float atof (const char *s asm("a2"));
(Misc2.asm, line 447)
pedrom::_sputc equ pedrom@0028
short _sputc(short ch, FILE *fp)
(printf.c, line 478)
pedrom::perror equ pedrom@0029
void perror(const char *str asm("a2"))
(Misc2.asm, line 487)
pedrom::getenv equ pedrom@002a
const char *getenv(const char *name asm("a2"));
(Misc.asm, line 481)
pedrom::system equ pedrom@002b
int system(const char *command asm("a0"))
(System.asm, line 709)
pedrom::setvbuf equ pedrom@002c
int setvbuf(FILE *stream, char *buf, int mode , size_t size);
(Misc2.asm, line 319)

18

Someone would want to write this header ? #itm#

19

Can't for now, sorry.
avatar
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Co-admin de TI-Planet.

20

Don't worry grin

21

IMHO it's really PedroM's job to ship such a header.

The problem is that several of the symbol names conflict with the ones from TIGCCLIB's own stdio.h, stdlib.h etc. implementations (which is pretty much unavoidable as they're defined by ISO C). The FILE structures are also not compatible with each other (or are they?).
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

22

I need stdout, stderr, printf and fprintf.

I would want to know if PpHd would accept these prototypes :
FILE* stdout;
FILE* stderr;
void printf(const char* format, ...);
short fprintf(FILE* stream, const char* format, ...);

How could I define FILE ?

23

I don't understand. PedroM already ship its own header file for the C language. FILE, stdout, stderr, printf and fprintf are defined inside.

24

LOL !

So ./17 was useless ? grin

Thanx anyway, I hadn't see these headers. Good job ! o/