OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [software/] [boot_tb/] [DisplayChar.asm] - Diff between revs 5 and 12

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 5 Rev 12
Line 21... Line 21...
;
;
; ============================================================================
; ============================================================================
;
;
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; Display a character on the screen device
; Display a character on the screen device
; Expects the processor to be in 16 bit mode with 16 bit acc and 16 bit indexes
 
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
;
;
public DisplayChar:
public VBDisplayChar:
;               push    c1
                addui   r31,r31,#-40
;               push    pregs
                sws             c1,zs:[r31]
;               push    r2
                sws             pregs,zs:8[r31]
;               push    r3
                sw              r2,zs:16[r31]
;               push    r4
                sw              r3,zs:24[r31]
                addui   r27,r27,#-40
                sw              r4,zs:32[r31]
                sws             c1,[r27]
 
                sws             pregs,8[r27]
 
                sw              r2,16[r27]
 
                sw              r3,24[r27]
 
                sw              r4,32[r27]
 
                ldi             r2,#8
                ldi             r2,#8
                sc              r2,$FFDC0600
                sc              r2,$FFDC0600
                zxb             r1,r1
                zxb             r1,r1
                lb              r2,EscState
                lb              r2,EscState
                tst             p0,r2
                tst             p0,r2
Line 65... Line 59...
                cmpi    p0,r1,#ESC
                cmpi    p0,r1,#ESC
p0.ne   br              _0003
p0.ne   br              _0003
                ldi             r1,#1
                ldi             r1,#1
                sb              r1,EscState
                sb              r1,EscState
exitDC:
exitDC:
;               pop             r4
                lws             c1,zs:[r31]
;               pop             r3
                lws             pregs,zs:8[r31]
;               pop             r2
                lw              r2,zs:16[r31]
;               pop             pregs
                lw              r3,zs:24[r31]
;               pop             c1
                lw              r4,zs:32[r31]
                lws             c1,[r27]
                addui   r31,r31,#40
                lws             pregs,8[r27]
 
                lw              r2,16[r27]
 
                lw              r3,24[r27]
 
                lw              r4,32[r27]
 
                addui   r27,r27,#40
 
                rts
                rts
_0003:
_0003:
                bsr             AsciiToScreen
                ldi             r4,#10
 
                sc              r4,$FFDC0600
 
                bsr             VBAsciiToScreen
                lhu             r2,NormAttr
                lhu             r2,NormAttr
 
                andi    r2,r2,#-1024
                or              r1,r1,r2
                or              r1,r1,r2
                lcu             r3,VideoPos
                lcu             r3,VideoPos
                lhu             r2,Vidptr
                lhu             r2,Vidptr
                ldi             r4,#9
 
                sc              r4,$FFDC0600
 
                sh              r1,hs:[r2+r3*4]
                sh              r1,hs:[r2+r3*4]
                lcu             r1,CursorX
                lcu             r1,CursorX
                addui   r1,r1,#1
                addui   r1,r1,#1
                lcu             r2,Textcols
                lcu             r2,Textcols
                cmp             p0,r1,r2
                cmp             p0,r1,r2
Line 123... Line 113...
                sc              r1,CursorY
                sc              r1,CursorY
                bsr             SyncVideoPos
                bsr             SyncVideoPos
                br              exitDC
                br              exitDC
 
 
processEsc:
processEsc:
 
                ldi             r4,#22
 
                sc              r4,$FFDC0600
                lb              r2,EscState
                lb              r2,EscState
                cmpi    p0,r2,#-1
                cmpi    p0,r2,#-1
p0.ne   br              .0006
p0.ne   br              .0006
                cmpi    p0,r1,#'T'      ; clear to EOL
                cmpi    p0,r1,#'T'      ; clear to EOL
p0.ne   br              .0003
p0.ne   br              .0003
Line 217... Line 209...
                ldi             r1,#%001001001_011011011_00_00000000
                ldi             r1,#%001001001_011011011_00_00000000
                sh              r1,NormAttr
                sh              r1,NormAttr
                br              exitDC
                br              exitDC
 
 
doBackSpace:
doBackSpace:
 
                ldi             r4,#23
 
                sc              r4,$FFDC0600
                lc              r2,CursorX
                lc              r2,CursorX
                tst             p0,r2
                tst             p0,r2
p0.eq   br              exitDC          ; Can't backspace anymore
p0.eq   br              exitDC          ; Can't backspace anymore
                lcu             r3,VideoPos
                lcu             r3,VideoPos
.0002:
.0002:

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.