diff --git a/Makefile b/Makefile
index afec2b7e..74ab4305 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
SRCDIR_COMMON = c64/aliases
SRCDIR_BASIC_COMMON = $(SRCDIR_COMMON) c64/basic
-SRCDIR_KERNAL_COMMON = $(SRCDIR_COMMON) c64/kernal c64/kernal/assets c64/kernal/jumptable c64/kernal/iec c64/kernal/interrupts
+SRCDIR_KERNAL_COMMON = $(SRCDIR_COMMON) c64/kernal c64/kernal/assets c64/kernal/jumptable c64/kernal/iec c64/kernal/interrupts c64/kernal/print
SRCDIR_BASIC_generic = $(SRCDIR_BASIC_COMMON) c64/basic/,target_generic
SRCDIR_BASIC_mega65 = $(SRCDIR_BASIC_COMMON) c64/basic/,target_mega65
diff --git a/STATUS.md b/STATUS.md
index 9c26e41b..2b7915dc 100644
--- a/STATUS.md
+++ b/STATUS.md
@@ -65,7 +65,6 @@ Note: vectors at `$0300` are not supported yet - for now only the locations belo
| `($A000)` | | cold start | PARTIAL | |
| `($A002)` | | warm start | PARTIAL | |
-
### Unofficial BASIC routines/locations
@@ -82,7 +81,7 @@ Not all of them - only these we want to have implemented.
| `$AB1E` | STROUT | DONE | |
| `$BDCD` | LINPRT | NOT DONE | |
| `$E3BF` | INIT | NOT DONE | |
-| `$E422` | INITMSG | NOT DONE | |
+| `$E422` | INITMSG | PARTIAL | banner printed outside |
| `$E453` | RVECT | NOT DONE | |
diff --git a/c64/basic/,imports.s b/c64/basic/,imports.s
index 0c14f4b0..b195dcac 100644
--- a/c64/basic/,imports.s
+++ b/c64/basic/,imports.s
@@ -9,3 +9,5 @@
#endif
.label print_hex_byte = KERNAL.print_hex_byte
+.label print_return = KERNAL.print_return
+.label print_space = KERNAL.print_space
diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s
index c77ad42a..9863ea5b 100644
--- a/c64/basic/basic_cold_start.s
+++ b/c64/basic/basic_cold_start.s
@@ -49,10 +49,8 @@ basic_cold_start:
sbc TXTTAB+1
jsr print_integer
+ jsr print_space
- lda #$20
- jsr JCHROUT
-
// Print the rest of the start up message
ldx #34
jsr print_packed_message
diff --git a/c64/basic/basic_do_error.s b/c64/basic/basic_do_error.s
index ba31a966..6266b0ef 100644
--- a/c64/basic/basic_do_error.s
+++ b/c64/basic/basic_do_error.s
@@ -6,8 +6,7 @@ basic_do_error:
pha
// Print ? at start
- lda #$0D
- jsr JCHROUT
+ jsr print_return
lda #$3F
jsr JCHROUT
@@ -17,8 +16,7 @@ basic_do_error:
jsr print_packed_message
// Print ERROR at end
- lda #$20
- jsr JCHROUT
+ jsr print_space
ldx #33
jsr print_packed_message
@@ -26,10 +24,8 @@ basic_do_error:
// XXX print line number if not in direct mode
- lda #$0D
- jsr JCHROUT
- lda #$0D // XXX do we need this?
- jsr JCHROUT
+ jsr print_return
+ jsr print_return
// Reset stack, and go back to main loop
ldx #$FE
diff --git a/c64/basic/basic_main_loop.s b/c64/basic/basic_main_loop.s
index f29d5d37..4318aa78 100644
--- a/c64/basic/basic_main_loop.s
+++ b/c64/basic/basic_main_loop.s
@@ -34,7 +34,7 @@ got_line_of_input:
stx __tokenise_work1
// Strip leading spaces from the line
-remove_leading_spaces:
+remove_leading_spaces:
lda $0200
cmp #$20
bne !+
@@ -51,15 +51,14 @@ rsl_l1: lda $0200,x
bne remove_leading_spaces
!:
// Do printing of the new line
- lda #$0d
- jsr JCHROUT
+ jsr print_return
// Ignore empty lines
lda __tokenise_work1
beq basic_read_next_line
// Else, tokenise the line
- jsr tokenise_line
+ jsr tokenise_line
// Has the user entered a line of BASIC beginning with a number?
lda $0200
diff --git a/c64/basic/basic_warm_start.s b/c64/basic/basic_warm_start.s
index eeabd60a..1416ec4e 100644
--- a/c64/basic/basic_warm_start.s
+++ b/c64/basic/basic_warm_start.s
@@ -19,8 +19,7 @@ basic_warm_start:
jsr print_hex_byte
lda CMP0+0
jsr print_hex_byte
- lda #$0D
- jsr JCHROUT
+ jsr print_return
!:
jmp basic_main_loop
diff --git a/c64/basic/cmd_break.s b/c64/basic/cmd_break.s
index ffcab37f..d3aa3cd3 100644
--- a/c64/basic/cmd_break.s
+++ b/c64/basic/cmd_break.s
@@ -16,7 +16,7 @@ cmd_stop:
jsr print_integer
!:
- lda #$0D
- jsr JCHROUT
+ jsr print_return
+
cmd_end:
jmp basic_main_loop
diff --git a/c64/basic/cmd_list.s b/c64/basic/cmd_list.s
index 91078fc8..2aef7ccb 100644
--- a/c64/basic/cmd_list.s
+++ b/c64/basic/cmd_list.s
@@ -60,8 +60,7 @@ list_single_line: // entry point needed by DOS wedge
tax
pla
jsr print_integer
- lda #$20
- jsr JCHROUT
+ jsr print_space
// Iterate through printing out the line
// contents
@@ -69,7 +68,7 @@ list_single_line: // entry point needed by DOS wedge
sta QTSW
ldy #4
-list_print_loop:
+list_print_loop:
#if CONFIG_MEMORY_MODEL_60K
ldx #