; twix command ; ; this command allows any logged user (as per RTDS specifications) ; to send a message to any other logged user. ; cr equ 0dh lf equ 0ah ; .z80 .request syslib extrn print,bbline ; begin: ld sp,stack ld hl,5dh ;point to arg ld a,(hl) cp ' ' ;if not blank... jp nz,nohlp ;...then no help call print cr,lf 'USAGE: ..}twix n (where "n" is the destination station letter' cr,lf ' A..P). You are then prompted for message' cr,lf,0 rst 0 ; nohlp: sub 40h ;make 0..16 cp 17 ;must be 0..16 jr c,stok call print cr,lf,7 'ERROR - can only send to station 0..16 (0=master)!',cr,lf,0 rst 0 ; stok: ld d,0 ;make sure d is 0 ld e,a ld (dest),de push de ld c,12 call 5 ;get station id ld a,e pop de cp e jr nz,notsm call print cr,lf,7 'ERROR - can''t send to yourself!',cr,lf,0 rst 0 ; notsm: add a,'@' ld (ls),a ;mark local station letter in msg ld bc,0fe29h ld h,91h call 50h ld a,(81h) cp 77h jr z,logged call print cr,lf,7 'ERROR - nobody is logged!',cr,lf,0 rst 0 ; logged: call print cr,lf 'Message (50 char max) :.......................' '...........................' rept 50 db 8 endm db 0 xor a call bbline or a jp z,0 ;quit if null line cp 51 jr c,lenok call print cr,lf,lf,7 'ERROR over 50 characters long!',cr,lf,0 rst 0 ; lenok: push af ld de,begin-65 ld a,0ffh ld (de),a inc de push hl ld hl,pre ld bc,11 ;preamble ldir pop hl ;get message pop af ld c,a ld b,0 ldir ld hl,endmsg ld bc,3 ldir ld bc,0fe29h ld de,(dest) ld h,90h ;set param call 50h rst 0 ; dest: dw 0 pre: db cr,lf,'FROM ' ls: db ' : ',7 endmsg: db cr,lf,'$' ds 80 stack equ $ end