Skip to content

Commit

Permalink
Adjust crt0 for the C tools and FDISK for SDCC 4.2
Browse files Browse the repository at this point in the history
(pass arguments in registers)

Also add a missing "include" statement.
  • Loading branch information
Konamiman committed Mar 29, 2023
1 parent 55205c8 commit 3137b26
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
1 change: 1 addition & 0 deletions source/kernel/bank0/init.mac
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
;
INCLUDE ../condasm.inc
INCLUDE ../const.inc
INCLUDE ../macros.inc
;
;===== end add DOS2.50
;
Expand Down
8 changes: 0 additions & 8 deletions source/kernel/bank4/partit.mac
Original file line number Diff line number Diff line change
Expand Up @@ -5855,14 +5855,6 @@ GET_DVB_NEXT:
scf
ret

GET_DISKID_HL:
ld hl,DISKID
ld a,(hl)
inc a
ret nz
ld hl,PROCNM+8
ret

;-----------------------------------------------------------------------------
;
PROC DRVS2
Expand Down
7 changes: 3 additions & 4 deletions source/kernel/bank5/fdisk_crt0.s
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ init: ;call gsinit

;--- Prepare parameters for main

push hl
push bc
ex de,hl
push bc
pop hl

;--- Step 3: Call the "main" function

Expand All @@ -28,8 +29,6 @@ init: ;call gsinit

;--- Terminate program

pop af
pop af
ret

;--- Program code and data (global vars) start here
Expand Down
5 changes: 2 additions & 3 deletions source/tools/C/crt0_msxdos_advanced.s
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,8 @@ parloopend:
;* Command line processing done. Here, C=number of parameters.

cont: ld hl,#0x100
ld b,#0
push bc ;Pass info as parameters to "main"
push hl
ld d,#0
ld e,c ;Pass info as parameters to "main"

;--- Step 3: Call the "main" function
push de
Expand Down

0 comments on commit 3137b26

Please sign in to comment.