________._______________ ________ .------------------.
/ _____/| ____/\ _ \ \_____ \ |.----------------.|
/ __ \ |____ \ / /_\ \ / ____/ || >*bbs beebs.ddn||
\ |__\ \/ \\ \_/ \/ \ || s.net:6502 -t ||
\_____ /______ / \_____ /\_______ \ || BBC -b 19200 ||
\/ \/ \/ \/ || ||
6502 Assembly Projext #1 || ||
A simple BBS dialer for your BBC Micro ||________________||
|-[CUB]---------[]-|
'------------------'
____ ____ ____ ____ ____
||I |||n |||t |||r |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|
A few weeks ago I started creating some pretty small but useful
(to me) tools, to make comms on the BBC Micro easier. It all
started with the menuing system I had created for my Beeb. I
wanted to be able to load a telnet/dial up connection by issuing
the host I wanted as a parameter. Unfortunately to my knowledge
there is no such comms package available for the BBC Micro.
____ ____ ____ ____ ____ ____ ____ ____
||S |||o |||l |||u |||t |||i |||o |||n ||
||__|||__|||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|
I created a small program in 6502 assembly which I compiled with
the wonderful BeebASM (https://github.com/stardot/beebasm/) to
take the parameters entered after the loader and append this to
ATDT, sending down the serial port to my TcpSer modem running at
the other end.
I.e.:
*bbs beebs.ddns.net:6502 ----> ATDT beebs.ddns.net:80
From here the program loads up the BBC Micro's (well Master 128's)
built in OS Terminal rom and you carry on from there. The built in
terminal it quite expansive (although little is documented about
its various options). This has allowed me to add additional
parameters for example:
*bbs beebs.ddns.net:6502 -t BBC
Loads up terminal in Mode 7 (teletext graphics mode for BBS
that support Teletext Mode 7 control codes.
*bbs beebs.ddns.net:6502 -t VT100
Loads up terminal in 80 column VT100 mode
*bbs beebs.ddns.net:6502 -t 40
Loads up terminal in 40 column ASCII mode
The -b (baud rate) parameter has also been added.
Needless to say coupled with my menuing system I can now select
the Comms menu, then choose the BBS I'd like to dial into without
needing to load up Commstar, setup the baud and parity, and then
type ATDT blah.blah.blah
.------------------. \ .------------------.
|.----------------.| \ |.----------------.|
|| ----[COMMS]----|| \ || WELCOME TO ||
|| 1. BeeBS || \ || BeeBS ||
|| 2. NightOwl || \ || ||
|| 3. Level29 || / || ........ ||
|| 4. SDF.org || / || ....... ||
||________________|| / ||________________||
|-[CUB]---------[]-| / |-[CUB]---------[]-|
'------------------' / '------------------'
____ ____ ____ ____ ____
||N |||o |||t |||e |||s ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|
Cannot get this program to work with Econet file system, I assume
something to do with the OSARGS call, but haven't spent much time
trying to solve the problem.
This version does access the serial port via &FE09 directly, no
checking to see if it is clear, however I've not encountered any
issues with this, it may be worth replacing this with the correct
OS call to write to the serial port. OSByte 138, X set as 2
Serial out, and the character to send in Y. To send 'A' for
example:
LDA #138
LDX #2
LDY #65
JSR osbyte
____ ____ ____ ____ ____ ____ ____
||L |||i |||s |||t |||i |||n |||g ||
||__|||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/__\|/__\|
Currently MIA, I have the compiled version, but not the source, on
my to-do list to find.
-EDIT- Found a version in a backup...might work?!
osasci = &ffe3
addr = &70
cmdline = &5000
osargs = &ffda
osword = &fff1
ORG &2000
.start ;get any arguments that follow *mcterm
lda #1
ldy #0
ldx #addr
jsr osargs
.rdcmdlp
tya
pha
LDX #addr
LDY #0
LDA #5
JSR osword ;read byte from i/o memory
PLA
TAY
LDA addr+4
STA cmdline,Y
INY ;copy byte of commandline to buffer
INC addr
BNE rdcmdnxt
INC addr+1 ;increment command line address
.rdcmdnxt
CMP #13
BNE rdcmdlp ;Loop until cr
.init
ldx #2 ;set serial port to listening
lda #&02
jsr &fff4
LDY #0
.parameters
LDA cmdline, Y
CMP #45 ;check for -
BNE main_loop
INY
LDA cmdline, Y
CMP #68 ;check for d
BEQ dial
JSR main_loop
.dial
lda #65
sta &fe09
lda #84
sta &fe09
lda #13
sta &fe09
lda #65
sta &fe09
lda #84
sta &fe09
lda #68
sta &fe09
lda #84
sta &fe09
INY
LDA cmdline, Y
CMP #32
BNE dial_address
INY
.dial_address
LDA cmdline, Y
sta &fe09
INY
cmp #32
BEQ parameters
CMP #13
BNE dial_address
JSR main_loop
.main_loop
jsr check_serial
.main_loop_key
jsr check_key
jmp main_loop
.check_serial
ldx #1
lda #145
jsr &fff4
bcs main_loop_key ;if nothing on buffer check keyboard
tya
jsr get_char ;otherwise get character from serial
rts
.check_key
ldx #0 ;check keyboard input buffer
lda #145
jsr &fff4
tya
bcs main_loop ;If nothing in buffer return to main loop
cmp #136
beq cur_left
cmp #137
beq cur_right
cmp #138
beq cur_down
cmp #139
beq cur_up
jsr get_char
.print_serial
sta &fe09
jmp main_loop
.cur_left
lda #29
sta &fe09
jsr display_char
jmp main_loop
.cur_right
lda #6
sta &fe09
jsr display_char
jmp main_loop
.cur_up
lda #30
sta &fe09
jsr display_char
jmp main_loop
.cur_down
lda #10
sta &fe09
jsr display_char
jmp main_loop
.get_char
.crlf
cmp #10 ;check for ASCII 10
bne skip_change
lda #0 ;Skip ASCII 10
.skip_change
cpx #0
beq print_serial
jsr display_char
rts
.get_ansi ;get data from serial
ldx #1
lda #145
jsr &fff4
rts
.display_char:
jsr osasci ;put the character on the screen
rts
.end