Let's start coding

Require Toolchain

XA65 is used for Orix.

#include "../../oric-common/include/asm/telemon.h"
 
.text
#ifdef TARGET_ORIX
*=$1000-20
; include header
	.byt $01,$00		; non-C64 marker
	.byt "o", "r", "i"      ; "ori" MAGIC number :$6f, $36, $35
	.byt 1			; version
	.byt $00, $00	        ; 6502 mode
	.byt $00, $00		// Extends
	.byt $00, $00	        ;operating system id  : telemon 3.0
	.byt $00                ; reserved
	.byt %01001001          ; Auto, direct, data
	.byt <start_adress,>start_adress ; loading adress
	.byt <EndOfMemory,>EndOfMemory   ; end of loading adress
	.byt <start_adress,>start_adress ; starting adress
 
start_adress
#endif
	*=$1000
	lda #$41
	sta $bb80
	rts
EndOfMemory
  • in this folder (projects), create a folder “hello_telemon”
  • in this folder (hello_telemon), create a folder “include”
  • in hello_telemon folder, create a file “hello.asm” and open it in an editor. Copy and paste this :
#include "../../oric-common/include/asm/telemon.h"
.text
#ifdef TARGET_ORIX
*=$1000-20
; include header
	.byt $01,$00		; non-C64 marker
        .byt "o", "r", "i"      ; "o65" MAGIC number :$6f, $36, $35
	.byt 1			; version
	.byt $00, $00	        ; mode word mode0, mode1
	.byt $00, $00		;
	.byt $00, $00		; operating system id
	.byt $00 ; reserved
	.byt %01001001                   ; Auto, direct, data
	.byt <start_adress,>start_adress ; loading adress
	.byt <EndOfMemory,>EndOfMemory   ; end of loading adress
	.byt <start_adress,>start_adress ; starting adress
 
start_adress
#endif
 
   *=$1000
   lda #<str_hello_world
   ldy #>str_hello_world
   BRK_TELEMON(XWSTR0) 
   rts
   str_hello_world
   .asc "Hello world !",0
  • at this step, you have to build with assembler : open a command line window (cmd.exe)
  • go to your project directory (oric/projects/hello_world) and execute xa :
 ..\..\osdk\bin\xa.exe hello_world.asm
  • at this step, you have a new file : a.o65
  • insert stratsed telestrat start Oricutron
  • insert your new disk genetated in oricutron, runs your code.

This sample displays a picture in hires mode.

#include "../../oric-common/include/asm/telemon.h"
.text
#ifdef TARGET_ORIX
*=$1000-20
; include header
	.byt $01,$00		; non-C64 marker
        .byt "o", "r", "i"      ; "o65" MAGIC number :$6f, $36, $35
	.byt 1			; version
	.byt $00, $00	; mode word mode0, mode1
	.byt $00, $00		; CPU type
	.byt $00, $00		; operating system id
	.byt $00 ; reserved
	.byt %01001001 ; Auto, direct, data
	.byt <start_adress,>start_adress ; loading adress
	.byt <EndOfMemory,>EndOfMemory ; end of loading adress
	.byt <start_adress,>start_adress ; starting adress
 
start_adress
#endif
 
   *=$1000
   BRK_TELEMON(XHIRES)      ; switch to hires
 
   lda #<str_enter_and_read ; load ptr of the string (path)
   ldx #>str_enter_and_read  
   BRK_TELEMON(XOPEN)       ; open
 
   ; have a look to https://github.com/jedeoric/telemon/blob/master/src/functions/xread.asm    
   lda #$00                 ; set PTR_READ_DEST to $a000
   ldy #$a0 
   sta PTR_READ_DEST        ; From (telemon vars)
   sty PTR_READ_DEST+1
   lda #<8000               ;  
   ldy #>8000               ; read 8000 bytes
   BRK_TELEMON(XFREAD)      ; launch the read, XFREAD will insert data in PTR_READ_DEST
 
   ; at this step, the picture is displayed
   rts
str_enter_and_read
   .asc "/usr/share/viewhrs/e/exocet.hir",0