Open a file (relative or not)

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
; set the header
  ldy #O_RDONLY ; Open in readonly
  lda #<filename
  ldx #>filename
  BRK_TELEMON(XOPEN)
  ; A register contains FP id
  rts
filename
  .asc "/opt/toto.txt"
 

Read X bytes

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
; set the header
; [IN] AY contains the length to read
; [IN] PTR_READ_DEST must be set because it's the ptr_dest
; [IN] TR0 contains the fd id 
 
; Send the fp pointer
  lda #$01 ; 1 is the fd id of the file opened
  sta TR0
; define target address
  lda #<$a000
  sta PTR_READ_DEST
  lda #>$a000
  sta PTR_READ_DEST+1
; We read 8000 bytes
  lda #<8000
  ldy #>8000
; reads byte 
  BRK_TELEMON(XFREAD)
  nop
  nop
  nop
  nop
  nop
  BRK_TELEMON(XCLOSE)  
 

WRITE X bytes

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
; set the header
#define PTR_READ_DEST $2c
#define TR0           $0c
 
  ldy     #O_WRONLY
  lda     #<_filename_open
  ldx     #>_filename_open
  BRK_TELEMON(XOPEN)
 
fileopened  
  sta     saveFP
 
  lda     #<_edition_buffer
  sta     PTR_READ_DEST
 
  lda     #>_edition_buffer
  sta     PTR_READ_DEST+1
 
  lda     saveFP
  sta     TR0
 
  lda     _length_of_file
  ldy     _length_of_file+1
 
  BRK_TELEMON(XFWRITE)
  nop
  nop
  nop
  nop
  nop
  BRK_TELEMON(XCLOSE)
  rts
saveFP  
.byt 0  
_filename_open
.asc "/mytext.txt",0  
_length_of_file
 .byt 12,0 ; 12 bytes
_edition_buffer
 .asc "123456789012"

Close a file

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
; set the header
  lda #$01 ; fd id
  BRK_TELEMON(XCLOSE)
  rts

Create a folder

#include "../orix/src/include/telemon.h"
#include "../orix/src/include/macro.h"
 
  lda   #<file1
  ldy   #>file1
  BRK_TELEMON(XMKDIR)
  rts
file1
    .asc "/jede/toulou/pouet",0