Skip to content

Commit

Permalink
fix: #81 Added APPLCODE which follows CODE segment
Browse files Browse the repository at this point in the history
Added code segment `APPLCODE` following code segment `CODE` and modified
`mk/build.mk` to force user application code to be placed in the
`APPLCODE` segment by default. This will place the libmsx library and
standard C library code in the CODE segment and the user application
code in the APPLCODE segment. So as long as the total size of the
library code used by the application is approximately 16 KiB or less, it
will work as expected.
  • Loading branch information
mori0091 committed Sep 7, 2024
1 parent 62e4827 commit bcb6f70
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions crt0/crt0_mod_rom_header/app_megarom_header.s
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
;; ---- ordering segments for linker
.area _HOME
.area _CODE
.area _APPLCODE
.area _INITIALIZER
.area _GSINIT
.area _GSFINAL
Expand Down
1 change: 1 addition & 0 deletions crt0/crt0_mod_rom_header/app_rom_header.s
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
;; ---- ordering segments for linker
.area _HOME
.area _CODE
.area _APPLCODE
.area _INITIALIZER
.area _GSINIT
.area _GSFINAL
Expand Down
1 change: 1 addition & 0 deletions mk/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ PAD2POW2 = ${LIBMSX_HOME}/bin/pad2pow2.sh
CFLAGS ?=
CFLAGS += -mz80 -MMD
CFLAGS += -I ${LIBMSX_HOME}/include
CFLAGS += --codeseg APPLCODE

LIBMSX = ${LIBMSX_HOME}/lib/libmsx.lib

Expand Down

0 comments on commit bcb6f70

Please sign in to comment.