Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jedeoric committed Feb 10, 2024
1 parent 12212e7 commit 817b8ab
Show file tree
Hide file tree
Showing 40 changed files with 161 additions and 12 deletions.
1 change: 1 addition & 0 deletions docs/ADIODB_VECTOR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ADIODB_VECTOR
2 changes: 2 additions & 0 deletions docs/RES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
* kernel_create_process
* kernel_kill_process
* kernel_kill_process via XFREE_ROUTINE
* XDIVIS
* XREADBYTES_ROUTINE
* XPUTCWD_ROUTINE
* XWRITEBYTES_ROUTINE
* XFSEEK_ROUTINE
* XMKDIR_ROUTINE
* XRM_ROUTINE
* XOPENDIR
* XFILLM
* _XEXEC
* _XFORK
* _XFORK via kernel_create_process
Expand Down
5 changes: 4 additions & 1 deletion docs/RESB.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# RESB
* checking_fp_exists
* kernel_create_process
* ZADCHA
* XDIVIS
* XCLOSE_ROUTINE
* XGETCWD_ROUTINE
* XPUTCWD_ROUTINE
* XWRITEBYTES_ROUTINE
* XFSEEK_ROUTINE
* XOPENDIR
* compute_path_relative
* XFILLM
* _XEXEC
* _XFORK via kernel_create_process
* _XEXEC
* XGETARGV_ROUTINE
* getFileLength
* kernel_try_to_find_command_in_bin_path
* XOPEN_ROUTINE
2 changes: 2 additions & 0 deletions docs/TR0.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# TR0
* XBINDX
* XDIVIS
* XREADBYTES_ROUTINE
* XFSEEK_ROUTINE
* XOPENDIR
Expand Down
2 changes: 2 additions & 0 deletions docs/TR1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# TR1
* XBINDX
* XDIVIS
|MODIFY:KERNEL_XOPEN_PTR1:XFSEEK_ROUTINE
* _XEXEC
* _XFORK
Expand Down
1 change: 1 addition & 0 deletions docs/TR2.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# TR2
* XBINDX
* XMAINARGS_ROUTINE
1 change: 1 addition & 0 deletions docs/TR3.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# TR3
* XBINDX
* XMAINARGS_ROUTINE
2 changes: 2 additions & 0 deletions docs/TR4.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# TR4
* kernel_create_process
* XBINDX
* XDECIM
* XFSEEK_ROUTINE
* _XFORK via kernel_create_process
* XMAINARGS_ROUTINE
2 changes: 2 additions & 0 deletions docs/TR5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
* checking_fp_exists
* kernel_create_process
* kernel_kill_process via XFREE_ROUTINE
* XBINDX
* XDECIM
* _XFORK via kernel_create_process
* XOPEN_ROUTINE
1 change: 1 addition & 0 deletions docs/TR6.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# TR6
* XDECIM
* XFSEEK_ROUTINE
3 changes: 3 additions & 0 deletions docs/i_o_counter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# i_o_counter
* XWR0
* XRD0
3 changes: 3 additions & 0 deletions docs/i_o_save.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# i_o_save
* XWR0
* XWSTR0
6 changes: 3 additions & 3 deletions docs/memmap_ram.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@
## Kernel bank 7
| Type | Name | Range | Size |
| :-------- |:---------------------------- |:------- |:-----|
|ROM|<span style="color:green">FREE</span> |$fef4-$fff0| 252 |
|ROM|<span style="color:green">FREE</span> |$fef5-$fff0| 251 |
##Bank 0
| Type | Name | Range | Size |
| -------- | ---------------------------- | ------- |-----|
|BANK0|BUFBUF | $c080-$c0b6 | 54 |
|BANK0|BUFROU | $c500-$c54e | |
|BANK0|TELEMON_KEYBOARD_BUFFER_BEGIN | $c5c4-$c680 | |
|BANK0|XMALLOC (copy from kernel) | $fba6-$fc52 | |
|BANK0|X<span style="color:green">FREE</span> (copy from kernel) | $fc52-$fed7 | |
|BANK0|XMALLOC (copy from kernel) | $fba7-$fc53 | |
|BANK0|X<span style="color:green">FREE</span> (copy from kernel) | $fc53-$fed8 | |
4 changes: 4 additions & 0 deletions docs/work_channel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# work_channel
* XWR0
* XWSTR0
* XRD0
2 changes: 1 addition & 1 deletion generate_memmap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sed -i 's/FREE/<span style="color:green">FREE<\/span>/g' docs/memmap_ram.md
sed -i 's/|#/#/g' docs/memmap_ram.md
sed -i 's/MEMMAP://g' docs/memmap_ram.md

LIST="RESB RES RESC RESD RESE RESF RESG RESH TR0 TR1 TR2 TR3 TR4 TR5 TR6 TR7"
LIST="RESB RES RESC RESD RESE RESF RESG RESH TR0 TR1 TR2 TR3 TR4 TR5 TR6 TR7 work_channel i_o_save i_o_counter ADIODB_VECTOR"

for I in $LIST; do

Expand Down
43 changes: 42 additions & 1 deletion memmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ int MALLOC_FREE_BEGIN_LOW=0x525;
int MALLOC_FREE_END_HIGH=0x534;
int MALLOC_FREE_END_LOW=0x52f;
int KERNEL_MALLOC_FREE_CHUNK_MAX=0x5;
|CALL:XCRLF:XWR0
|MODIFY:work_channel:XWR0
|MODIFY:i_o_save:XWR0
|MODIFY:i_o_counter:XWR0
|MODIFY:i_o_save:XWSTR0
|MODIFY:work_channel:XWSTR0
|MODIFY:ADDRESS_READ_BETWEEN_BANK:XWSTR0
|MODIFY:work_channel:XRD0
|MODIFY:i_o_counter:XRD0
|MODIFY:$1B:XRDW0
|MODIFY:RES:_create_file_pointer
|MODIFY:KERNEL_ERRNO:_create_file_pointer
|CALL:XMALLOC:_create_file_pointer
Expand All @@ -54,6 +64,22 @@ int KERNEL_MALLOC_FREE_CHUNK_MAX=0x5;
|MODIFY:RES:kernel_kill_process
|MODIFY:TR5:kernel_kill_process via XFREE_ROUTINE
|MODIFY:RES:kernel_kill_process via XFREE_ROUTINE
|MODIFY:RESB:ZADCHA
|MODIFY:TR0:XBINDX
|MODIFY:TR1:XBINDX
|MODIFY:TR2:XBINDX
|MODIFY:TR3:XBINDX
|MODIFY:TR4:XBINDX
|MODIFY:TR5:XBINDX
|CALL:XDECIM:XBINDX
|CALL:XDECIM:XWR0
|MODIFY:TR4:XDECIM
|MODIFY:TR5:XDECIM
|MODIFY:TR6:XDECIM
|MODIFY:TR0:XDIVIS
|MODIFY:TR1:XDIVIS
|MODIFY:RES:XDIVIS
|MODIFY:RESB:XDIVIS
|MODIFY:RESB:XCLOSE_ROUTINE
|MODIFY:TR7:XCLOSE_ROUTINE
|MODIFY:PTR_READ_DEST:XREADBYTES_ROUTINE
Expand Down Expand Up @@ -89,6 +115,15 @@ CALL:XOPEN:XRM_ROUTINE
|MODIFY:RESD:compute_path_relative
|MODIFY:RESE:compute_path_relative
|MODIFY:RESF:compute_path_relative
|MODIFY:DECTRV:XDECAL
|MODIFY:DECCIB:XDECAL
|MODIFY:DECFIN:XDECAL
|MODIFY:DECDEB:XDECAL
|MODIFY:RES:XFILLM
|MODIFY:RESB:XFILLM
|MODIFY:HRSPAT:XHIRES
|CALL:XTEXT:XCSSCR
|MODIFY:FLGTEL:XTEXT
|MODIFY:RES:_XEXEC
|MODIFY:TR0:_XEXEC
|MODIFY:TR1:_XEXEC
Expand Down Expand Up @@ -117,8 +152,14 @@ CALL:XOPEN:XRM_ROUTINE
|MODIFY:REB:XMAINARGS_ROUTINE
|MODIFY:KERNEL_ERRNO:XMAINARGS_ROUTINE
|MODIFY:RES:XGETARGV_ROUTINE
|MODIFY:RESB:_XEXEC
|MODIFY:RESB:XGETARGV_ROUTINE
|MODIFY:RESB:getFileLength
|MODIFY:ADHRS:XHRSCB
|MODIFY:ADHRS:XHRSCH
|MODIFY:HRSX40:XHRSCD
|MODIFY:HRSX6:XHRSCD
|MODIFY:HRSX40:XHRSCG
|MODIFY:HRSX6:XHRSCG
|MODIFY:RES:kernel_try_to_find_command_in_bin_path
|MODIFY:RESB:kernel_try_to_find_command_in_bin_path
|MODIFY:RESC:kernel_try_to_find_command_in_bin_path
Expand Down
2 changes: 1 addition & 1 deletion src/build.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.define __DATE__ "2023-06-20 02:17"
.define __DATE__ "2023-11-23 20:52"
3 changes: 2 additions & 1 deletion src/functions/XOP.asm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ XOP0_ROUTINE:
skip129:

ldy #(KERNEL_SIZE_IOTAB-1)
@loop:

@loop:
cmp IOTAB,y
beq @skip2
dey
Expand Down
5 changes: 5 additions & 0 deletions src/functions/XRDW.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
XRD0_ROUTINE:
lda #$00
.out .sprintf("|MODIFY:work_channel:XRD0")
.out .sprintf("|MODIFY:i_o_counter:XRD0")

Lc7da:
sta work_channel ; Save the channel
lda #$04
Expand All @@ -8,6 +11,7 @@ Lc7da:
pha
tya
pha

@loop:
ldx work_channel
lda IOTAB,x
Expand All @@ -25,6 +29,7 @@ Lc7da:
inc work_channel
dec i_o_counter
bne @loop

@skip2:
pla
tay
Expand Down
5 changes: 4 additions & 1 deletion src/functions/XWRD.asm
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
XRDW0_ROUTINE:
lda #$00
.out .sprintf("|MODIFY:$1B:XRDW0")

lda #$00
sta $1B

@loop:
lda $1B
jsr Lc7da
bcs @loop

ROUTINE_I_O_NOTHING:
sec
rts
6 changes: 6 additions & 0 deletions src/functions/XWRx.asm
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
XWR0_ROUTINE:
.out .sprintf("|MODIFY:work_channel:XWR0")
.out .sprintf("|MODIFY:i_o_save:XWR0")
.out .sprintf("|MODIFY:i_o_counter:XWR0")
.out .sprintf("|MODIFY:ADIODB_VECTOR:XWR0")

pha ; Push byte to write
lda #$00
sta work_channel
pla ; Get byte to write

XWSTR0_re_enter_from_XDECAL:
sta i_o_save ; save the byte to write in I_O_save
lda #$04
Expand Down
8 changes: 7 additions & 1 deletion src/functions/XWSTRx.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
; i_o_save
; ADDRESS_READ_BETWEEN_BANK

XWSTR0_ROUTINE:
.proc XWSTR0_ROUTINE
.out .sprintf("|MODIFY:i_o_save:XWSTR0")
.out .sprintf("|MODIFY:work_channel:XWSTR0")
.out .sprintf("|MODIFY:ADDRESS_READ_BETWEEN_BANK:XWSTR0")

ldx #$00
stx i_o_save+1
sta ADDRESS_READ_BETWEEN_BANK
sty ADDRESS_READ_BETWEEN_BANK+1

@loop:
lda i_o_save+1
sta work_channel
Expand All @@ -20,3 +25,4 @@ XWSTR0_ROUTINE:
bne @loop
inc ADDRESS_READ_BETWEEN_BANK+1
bne @loop
.endproc
2 changes: 1 addition & 1 deletion src/functions/getargv.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
; X Contain the id of the argument

.out .sprintf("|MODIFY:RES:XGETARGV_ROUTINE")
.out .sprintf("|MODIFY:RESB:_XEXEC")
.out .sprintf("|MODIFY:RESB:XGETARGV_ROUTINE")

.proc XGETARGV_ROUTINE

Expand Down
9 changes: 9 additions & 0 deletions src/functions/xbindx.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
; AY contains the number
; X ...
.out .sprintf("|MODIFY:TR0:XBINDX")
.out .sprintf("|MODIFY:TR1:XBINDX")
.out .sprintf("|MODIFY:TR2:XBINDX")
.out .sprintf("|MODIFY:TR3:XBINDX")
.out .sprintf("|MODIFY:TR4:XBINDX")
.out .sprintf("|MODIFY:TR5:XBINDX")

sta TR1
sty TR2

Expand Down Expand Up @@ -29,6 +36,7 @@
beq @L2
sta TR3
bne @L3+1

@L2:
ldy TR3
bne @L3+1
Expand All @@ -42,6 +50,7 @@
bpl @L5
lda TR1
ora #$30

@L1:
ldy TR4

Expand Down
1 change: 1 addition & 0 deletions src/functions/xcrlf.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.out .sprintf("|CALL:XCRLF:XWR0")
.proc XCRLF_ROUTINE
; Attention, parfois, il y a des tests bne/beq dans le shell (voir commande cat) pour faire des branchements et eviter le jmp.
; modifier en consequence cette routine
Expand Down
5 changes: 5 additions & 0 deletions src/functions/xdecal.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
; DOC_MEMORY_WRITE_1=DECTRV

; This routine could be replace with a simple routine in 65C816 mode

.out .sprintf("|MODIFY:DECTRV:XDECAL")
.out .sprintf("|MODIFY:DECCIB:XDECAL")
.out .sprintf("|MODIFY:DECFIN:XDECAL")
.out .sprintf("|MODIFY:DECDEB:XDECAL")
pha
txa
pha
Expand Down
5 changes: 5 additions & 0 deletions src/functions/xdecim.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.proc XDECIM_ROUTINE
.out .sprintf("|CALL:XDECIM:XBINDX")
.out .sprintf("|CALL:XDECIM:XWR0")
.out .sprintf("|MODIFY:TR4:XDECIM")
.out .sprintf("|MODIFY:TR5:XDECIM")
.out .sprintf("|MODIFY:TR6:XDECIM")
pha
lda #$00 ; 65c02
sta TR5
Expand Down
6 changes: 6 additions & 0 deletions src/functions/xdivis.asm
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
.out .sprintf("|MODIFY:TR0:XDIVIS")
.out .sprintf("|MODIFY:TR1:XDIVIS")
.out .sprintf("|MODIFY:RES:XDIVIS")
.out .sprintf("|MODIFY:RESB:XDIVIS")
sta TR0
sty TR1
ldx #$00
stx RESB
stx RESB+1
ldx #$10

@loop:
asl RES
rol RES+1
Expand All @@ -20,6 +25,7 @@
sty RESB
sta RESB+1
inc RES

@skip:
dex
bne @loop
Expand Down
Loading

0 comments on commit 817b8ab

Please sign in to comment.