From a5f4b01d8273fb95c9e30e6753a031568f56c643 Mon Sep 17 00:00:00 2001 From: em Date: Mon, 18 Mar 1985 13:15:00 +0000 Subject: [PATCH] Initial revision --- mach/i80/libmon/LIST | 2 ++ mach/i80/libmon/README | 5 ++++ mach/i80/libmon/char.her.s | 31 +++++++++++++++++++++++ mach/i80/libmon/char.nas.s | 50 ++++++++++++++++++++++++++++++++++++++ mach/i80/libmon/head.s | 49 +++++++++++++++++++++++++++++++++++++ 5 files changed, 137 insertions(+) create mode 100644 mach/i80/libmon/LIST create mode 100644 mach/i80/libmon/README create mode 100644 mach/i80/libmon/char.her.s create mode 100644 mach/i80/libmon/char.nas.s create mode 100644 mach/i80/libmon/head.s diff --git a/mach/i80/libmon/LIST b/mach/i80/libmon/LIST new file mode 100644 index 000000000..7a444069b --- /dev/null +++ b/mach/i80/libmon/LIST @@ -0,0 +1,2 @@ +mon.s +char.her.s diff --git a/mach/i80/libmon/README b/mach/i80/libmon/README new file mode 100644 index 000000000..20fb6f214 --- /dev/null +++ b/mach/i80/libmon/README @@ -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. diff --git a/mach/i80/libmon/char.her.s b/mach/i80/libmon/char.her.s new file mode 100644 index 000000000..c78044b0e --- /dev/null +++ b/mach/i80/libmon/char.her.s @@ -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 diff --git a/mach/i80/libmon/char.nas.s b/mach/i80/libmon/char.nas.s new file mode 100644 index 000000000..7ac61c23c --- /dev/null +++ b/mach/i80/libmon/char.nas.s @@ -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 + diff --git a/mach/i80/libmon/head.s b/mach/i80/libmon/head.s new file mode 100644 index 000000000..f5bd23517 --- /dev/null +++ b/mach/i80/libmon/head.s @@ -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 + -- 2.34.1