From d112d522564b1a9281626ffb21817338dd49dad6 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 26 Jul 2015 14:02:18 +0100 Subject: [PATCH] 68hc11: outchar belongs in platform (some platforms might use another uart) --- Kernel/lowlevel-68hc11.s | 18 ++++----------- Kernel/platform-68hc11test/p68hc11.s | 34 +++++++++++++--------------- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/Kernel/lowlevel-68hc11.s b/Kernel/lowlevel-68hc11.s index 7c1d1daa..351a0e9e 100644 --- a/Kernel/lowlevel-68hc11.s +++ b/Kernel/lowlevel-68hc11.s @@ -13,7 +13,6 @@ .globl outnewline .globl outcharhex - .globl outchar .globl outstring .globl outx .globl outy @@ -41,9 +40,9 @@ irqrestore: ; D holds the return from di where A is the cc outnewline: ldab #0x0d - bsr outchar + bsr outchar_call ldab #0x0a - bra outchar + bra outchar_call outcharhex: @@ -65,20 +64,13 @@ outnibble: ble outh2 addb #0x07 outh2: addb #0x30 -outchar: - psha -outchar1: - ldaa scsr - anda #0x80 - beq outchar1 - stab scdr - pula - rts +outchar_call: + jmp outchar outstring: ldab ,x beq outsdone - bsr outchar + bsr outchar_call inx bra outstring diff --git a/Kernel/platform-68hc11test/p68hc11.s b/Kernel/platform-68hc11test/p68hc11.s index 20b52e02..fa81139e 100644 --- a/Kernel/platform-68hc11test/p68hc11.s +++ b/Kernel/platform-68hc11test/p68hc11.s @@ -15,29 +15,17 @@ .globl map_process_always .globl map_save .globl map_restore + .globl outchar ; exported debugging tools .globl trap_monitor .globl trap_reboot + include "cpu.def" + include "eeprom.def" include "kernel.def" include "../kernel-hc11.def" -; -; TODO: hardware registers -; - - .globl baud -.equ baud,0xf000 - .globl sccr1 -.equ sccr1,0xf000 - .globl sccr2 -.equ sccr2,0xf000 - .globl scdr -.equ scdr,0xf000 - .globl scsr -.equ scsr,0xf000 - .sect .data trapmsg: @@ -60,15 +48,25 @@ trap_monitor: trap_reboot: jmp reboot +outchar: + psha +outchar1: + ldaa scsr + anda #0x80 + beq outchar + stab scdr + pula init_early: rts init_hardware: ; set system RAM size - ldd #512 + ldd ram ; Size from firmware std ramsize - ldd #512-64 - std procmem + clc + sbcb #64 + sbca #0 + std procmem ; 64K is lost to kernel ; Our vectors are in high memory unlike Z80 but we still ; need vectors -- 2.34.1