mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-24 08:54:17 +00:00
Upload
Digital Research
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
*
|
||||
* read one char from console
|
||||
*
|
||||
CRTS=$3ff01
|
||||
CRTD=$3ff03
|
||||
.globl _getchar
|
||||
.globl _putchar
|
||||
_getchar:
|
||||
move.b CRTS,R0
|
||||
and #1,R0 //receive register full
|
||||
beq _getchar //not yet
|
||||
move.b CRTD,R0 //read the char
|
||||
and.l #$7f,R0 //leave only 7 bits
|
||||
cmp.b #$0d,R0 //carriage return?
|
||||
bne l0
|
||||
move.b #$0a,R0 //turn into line feed
|
||||
l0:
|
||||
move R0,-(sp)
|
||||
jsr _putchar //echo it
|
||||
move (sp)+,R0 //pop arg
|
||||
rts
|
||||
Reference in New Issue
Block a user