home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
hamradio
/
morsetxt.lbr
/
MRS-LB10.AZM
/
MRS-LB10.ASM
Wrap
Assembly Source File
|
1987-10-31
|
9KB
|
266 lines
.he MRS-LB10.* --CHR$(13)24AUG85 -#-
;MORSETXT system-specific overlay for the Ampro Little Board, and
; master model for other overlays, with hardware notes.
;
; AMPRO USERS NOTE:
; The release version of MORSETXT.* v1.0 was written on and
; for an Ampro Little Board. If that's what you have, just build
; the noisemaker, plug it and go. Read on, but be dragging out
; your soldering iron, not MLOAD.
;
;Required hardware extension:
;This program keys the HSO (or equivalent) pin on the DB25
; connector of your computer's serial-B (modem) port.
;
;To use it as a Morse code learning aid, you'll need to connect
; an audio noise-maker (something you can stand to listen to
; for long periods of time) to that pin.
;
;The cheapest method of doing this requires the following
; parts:
;
;1. DB25P connector. Radio Shack # 276-1547 or equivalent
;
;2. Piezo oscillator. RS # 273-060 is a little raucous, but good
; for short periods. A 2 kilohertz tone would be ideal for
; this; some Mallory Sonalerts may oscillate there. Get one
; that outputs a continuous (NOT pulsing) tone.
;
;3. Silicon diode. 1N914 (pkg. RS 276-1620, 276-1122) is okay
; electrically, but somewhat fragile. 1N4001 (RS 276-1101)
; rectifier is a lot sturdier. If you use a signal diode,
; consider mounting the whole circuit either on perfboard or
; inside a DB25 hood.
;
;4. Optional 10k-plus pot, volume control. RS 271-1711 or equiv.
;
;(I have no special love for Radio Shack, but they do have the
; advantage of being virtually everywhere, hence the use of
; their catalog numbers.)
;
; Schematic:
;
; DB25 pin diode... the UNBANDED end of the diode
; connects to the DB25 pin. The BANDED end
; |\ | goes to the oscillator.
; [7]--------| >|-----------------------+
; GND |/ | | "plus" lead...
; | red wire.
; +--------+---------+
; | PIEZO OSCILLATOR |
; +--------+---------+
; 10k - 50k pot | "minus" lead...
; | black wire.
; [5]----/\/\/\/------+-----------------+
; HSO 1 ^2 3 |
; | |
; +---------+
; (optional volume control)
;
;The above pinout is valid according to the Ampro manual. The
; circuit actually is powered when the HSO line is turned OFF.
; It's done this way because the boot routines on disk, when
; loaded, initialize the serial-B port with HSO turned on. The
; machine-specific routine (and this design) are both adapted
; to this.
;This means that the oscillator will be on when you first power
; up, and every time you reset. That's one way to find out
; that it's plugged in (experience)...
;
;The diode is needed because the HSO line, when on, swings above
; ground. The oscillator must be protected from that.
;The optional pot probably won't silence the oscillator, but it
; will quiet it substantially. In factory environments, my
; experience suggests leaving it out.
;
;This circuit is unique in that the piezo oscillator can make
; (more than) enough noise, powered only by the HSO output.
; Any other circuit will probably require a small power-
; supply or a battery, and extra control circuitry.
;
; --Carroll R. Bryan III WB1HKU/6
;
;
;Assemble with ASM. Any major improvements or new overlays should
; be uploaded to Ampro1 @ (408)258-8128, unless somone else would
; rather hub this.
;
LF equ 10
CR equ 13
FX equ 0FFh
;
CLOCK equ 40 ;CPU clockspeed in hundreds of kilohertz
;
;
PORTAS equ 84h ;console status and control port
CINMSK equ 1 ;character-is-input mask
CINMCH equ 1 ;character-is-input match
PORTBS equ 8Ch ;port B status and control port
;
;
;Title block. It's sent to screen by ILPRT, so keep it
; the same size. Use the bottom open line for your own
; overlay credit. If need be, move the text up a line
; to bring that top open line down.
;ILPRT returns when it finds a null. The 1Ah which
; follows that is an EOF character (a meaningless ldax d
; instruction as far as the CPU is concerned), so that
; a console command of TYPE MORSETXT.COM will bring up
; only the title block (and whatever 'call ILPRT'
; happens to mean as ASCII).
;
org 103h
;
db CR,LF,9,'***----MORSETXT.COM v1.0-----***'
db CR,LF,9,'* *'
db CR,LF,9,'* International Morse Code *'
db CR,LF,9,'* transmitter for text files *'
db CR,LF,9,'* Ampro Little Board version *'
db CR,LF,9,'* via Port B''s HSO line *'
db CR,LF,9,'* *'
db CR,LF,9,'***-- --CHR$(13)23AUG85------***'
db CR,LF,LF,0,1Ah
;
;
org 235h
;
DELCON: db 0,0 ;32-bit value stored in byte-serial
db 4,0A6h ;form. Delay constant for 0.1 wpm
;when running a Z80 at 0.1 MHz. This
;value is adjusted for declared
;clockrate in the first routine
;called. DITCNT will be calculated
;immediately afterwards.
;
;
DITCNT: ds 2 ;the key delay variable.
;
DAHCNT: ds 2 ;no longer directly used by program.
;(It cut down on the range too much.)
;If you're retweaking after an over-
;haul, though, you'll want to see
;what various values of delay and
;DELCNT do to it and DITCNT. That's
;why I left it in the COMfile.
;
CLKBYT: db CLOCK ;clock frequency in 100 KHz increments
;
;WSPACE, XTNFLG and PRETTY are copied into WSPBYT, XTNBYT and PRYBYT
; just before every filename line's arguments are brought down and
; plugged in. However you set them will be the default condition. If
; the just-loaded command line has switch-commands in it, they will
; toggle running conditions away from your default.
;The advantage is in rearranging the sending commands in wildcard
; expansions, where no command switches are possible.
;
;
WSPACE: db 0 ;if non-zero, space out the characters.
XTNFLG: db 0 ;if non-zero, only ARRL characters.
PRETTY: db 0 ;if zero,an excess period becomes <bt>,
;only one space in a row is sent.
;
KEY: jmp KEYR
UNKEY: jmp UNKEYR ;Hooks for the three hardware-dependent
CONSEN: jmp CSEN ;routines, allowing for overlays.
SEIKON: ds 3 ;jmp CONSAY...and one for calling out again.
;
;@ 024Dh:
;
;These are the hardware-specific sending routines.
;As written, KEYSTB works with the Ampro's DART. The callers,
; KEY and UNKEY, differ in that KEY calls with A=0FFh, while
; UNKEY calls with A=0. The Ampro initialization routines set
; the HSO line on serial-B, so this routine-set resets that
; line in order to key the oscillator.
;Don't trash anything but A, and be as quick as you can. The
; massive delays in KEY and UNKEY will mask a lot of fixed
; delay, but you want to be able to really hear an honest
; 45 wpm, don't you?
;
;If you have to rewrite KEY and UNKEY, pay attention to
; the CPU's T-states. Those delays were tweaked to yield
; true clear-text codespeed with the extrapolated constant
; in DELCON.
;DELCON should be left at its present value if possible.
; Too big, and slow-speed delay increments get defaulted
; to FFFF. Too small, and the upper speed increments get
; grossly off.
;
KEYR: mvi a,FX ;delay-count is in hl
call KEYSTB
KELP: nop! nop! nop! nop! nop ;If you mess with these
nop! nop! nop! nop! nop ;delays, you'll have to
nop! nop! nop! nop! nop ;retune the master delay
nop! nop! nop! nop! nop ;count. Try to put it in
nop! nop! nop! nop! nop ;the same general range.
nop! nop ;Otherwise, you'll run
mov a,a ;out of arithmetic range
dcx h ;one way or the other.
mov a,l
ora h
jnz KELP
ret
;
UNKEYR: xra a ;ditto
call KEYSTB
UKELP: nop! nop! nop! nop! nop
nop! nop! nop! nop! nop
nop! nop! nop! nop! nop
nop! nop! nop! nop! nop
nop! nop! nop! nop! nop
nop! nop
mov a,a
dcx h
mov a,l
ora h
jnz UKELP
ret
;
;Hopefully, this is the only routine in the code-timing
; nest that you'll have to tweak.
;
;
KEYSTB: cma ;Reverse the sense to deal with preset.
;Now it's 00 to sound the note, 0FFh to
;silence it.
push psw ;Hide it.
mvi a,5 ;Vector the DART to register 5...
out PORTBS ;where we find the RTS assertion bit.
pop psw ;Now we're ready to put together a
;control word.
push b ;Copy bc out before we clobber it...
mvi b,68h ;Default condition in the register,
;which we must preserve...
;(8-bit transmission, transmit enabled)
;
ani 2 ;Expose just the bit we want to change.
add b ;Slam 'em together, and shove the pair
out PORTBS ;out the airlock.
pop b ;Get back whatever's in b
ret ;and go home.
;
;This is the direct port status call. It is called by
; ILMORS and GOCHAR on their way back from sending a
; character. If CON: has a freshly typed character,
; go play with it. Otherwise, as you were.
;
CSEN: in PORTAS ;console port
ani CINMSK
cpi CINMCH ;Here's where we break off if
cz SEIKON ;CON: is sending.
ret
;
;@ 02B7h as written:
;
;I trust this is enough room for whatever you have to do.
;
org 400h
;
;
end
;
eof MRS-LB10.ASM/Ampro[stuff.933]--CHR$(13)30JUN85