Initial revision
This commit is contained in:
parent
c5508c7c0b
commit
a5f4b01d82
5 changed files with 137 additions and 0 deletions
2
mach/i80/libmon/LIST
Normal file
2
mach/i80/libmon/LIST
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
mon.s
|
||||||
|
char.her.s
|
5
mach/i80/libmon/README
Normal file
5
mach/i80/libmon/README
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
This directory contains the files char.her.s, that has routines
|
||||||
|
getchar and putchar for the MC-CPM, and char.nas.s, that
|
||||||
|
has the same routines for the Nascom.
|
||||||
|
The library "tail" should contain one of these two files.
|
||||||
|
The default is char.her.s.
|
31
mach/i80/libmon/char.her.s
Normal file
31
mach/i80/libmon/char.her.s
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
.define getchar, putchar
|
||||||
|
|
||||||
|
! These getchar and putchar routines can be used for HERMAC computer
|
||||||
|
|
||||||
|
! Read a character from HERMAC-monitor
|
||||||
|
! Character is returned in a-reg
|
||||||
|
|
||||||
|
getchar:
|
||||||
|
in 0xF1
|
||||||
|
ani 1
|
||||||
|
jz getchar
|
||||||
|
in 0xF0
|
||||||
|
cpi 0x0D
|
||||||
|
jnz 1f
|
||||||
|
mvi a,0x0A
|
||||||
|
1: ret
|
||||||
|
|
||||||
|
! Write character on HERMAC monitor
|
||||||
|
! Assumes character in a-reg
|
||||||
|
|
||||||
|
putchar:
|
||||||
|
cpi 0x0A
|
||||||
|
jnz 1f
|
||||||
|
mvi a,0x1F
|
||||||
|
1: push psw
|
||||||
|
2: in 0xF1
|
||||||
|
ani 4
|
||||||
|
jz 2b
|
||||||
|
pop psw
|
||||||
|
out 0xF0
|
||||||
|
ret
|
50
mach/i80/libmon/char.nas.s
Normal file
50
mach/i80/libmon/char.nas.s
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
.define getchar, putchar
|
||||||
|
|
||||||
|
! These getchar and putchar routines can be used for NASCOM computer.
|
||||||
|
|
||||||
|
! Read character from NASCOM-monitor
|
||||||
|
! Character is returned in a-reg
|
||||||
|
|
||||||
|
getchar:
|
||||||
|
call 0x69
|
||||||
|
jnc getchar
|
||||||
|
cpi 0x1F
|
||||||
|
jz CR
|
||||||
|
cpi 0x1D
|
||||||
|
jz BS
|
||||||
|
ret
|
||||||
|
|
||||||
|
CR: mvi a,0x0A
|
||||||
|
ret
|
||||||
|
|
||||||
|
BS: mvi a,0x08
|
||||||
|
ret
|
||||||
|
|
||||||
|
! Write charcacter on NASCOM-monitor
|
||||||
|
! Assumes character in a-reg
|
||||||
|
|
||||||
|
putchar:
|
||||||
|
push h
|
||||||
|
push b
|
||||||
|
lxi h,tab
|
||||||
|
mvi b,5
|
||||||
|
1: cmp m
|
||||||
|
jz fetch
|
||||||
|
inx h
|
||||||
|
inx h
|
||||||
|
dcr b
|
||||||
|
jnz 1b
|
||||||
|
2: call 0x013B
|
||||||
|
pop b
|
||||||
|
pop h
|
||||||
|
ret
|
||||||
|
fetch: inx h
|
||||||
|
mov a,m
|
||||||
|
jmp 2b
|
||||||
|
! conversion table for NASCOM characters
|
||||||
|
tab: .byte 0x0D,0x00
|
||||||
|
.byte 0x1B,0x1E
|
||||||
|
.byte 0x08,0x1D
|
||||||
|
.byte 0x0A,0x1F
|
||||||
|
.byte 0x7F,0x00
|
||||||
|
|
49
mach/i80/libmon/head.s
Normal file
49
mach/i80/libmon/head.s
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
.define hol0, argv, envp, begbss
|
||||||
|
.define .ignmask,.reghp,.trapproc,.fra
|
||||||
|
.define .retadr,.retadr1,.areg,.bcreg,.tmp1
|
||||||
|
.define block1, block2, block3
|
||||||
|
.define .stop
|
||||||
|
|
||||||
|
.base 0x1000
|
||||||
|
.text
|
||||||
|
lxi h,0x1000 ! stack will grow from 0x1000 downwards
|
||||||
|
sphl
|
||||||
|
lxi h,begbss ! clear bss
|
||||||
|
lxi d,endbss-begbss
|
||||||
|
mvi c,0
|
||||||
|
|
||||||
|
2: mov m,c
|
||||||
|
inx h
|
||||||
|
dcx d
|
||||||
|
mov a,e
|
||||||
|
ora d
|
||||||
|
jnz 2b
|
||||||
|
|
||||||
|
lxi h,envp ! call main
|
||||||
|
push h
|
||||||
|
lxi h,argv
|
||||||
|
push h
|
||||||
|
lxi h,0
|
||||||
|
push h
|
||||||
|
call _m_a_i_n
|
||||||
|
.stop: jmp 0xfb52
|
||||||
|
|
||||||
|
.bss
|
||||||
|
begbss:
|
||||||
|
.trapproc: .space 2
|
||||||
|
.ignmask: .space 2
|
||||||
|
.data
|
||||||
|
hol0: .space 8
|
||||||
|
.reghp: .word endbss
|
||||||
|
argv: .word 0
|
||||||
|
envp: .word 0
|
||||||
|
.retadr: .space 2 ! used to save return address
|
||||||
|
.retadr1: .space 2 ! reserve
|
||||||
|
.bcreg: .space 2 ! used to save localbase
|
||||||
|
.areg: .space 1
|
||||||
|
.tmp1: .space 2
|
||||||
|
.fra: .space 8 ! 8 bytes function return area
|
||||||
|
block1: .space 4 ! used by 32 bits divide and
|
||||||
|
block2: .space 4 ! multiply routines
|
||||||
|
block3: .space 4
|
||||||
|
|
Loading…
Reference in a new issue