diff options
author | root <root@ka-ata-killa.ourano.james.local> | 2021-02-24 23:45:58 +0000 |
---|---|---|
committer | root <root@ka-ata-killa.ourano.james.local> | 2021-02-24 23:45:58 +0000 |
commit | 1575d4f53805f177474b5bb96daebede9b2dfb73 (patch) | |
tree | 91f6819f7280088bb9344fae7dbef8c43a0a04c0 /docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/E435 | |
download | base-master.tar.gz base-master.tar.bz2 base-master.zip |
Diffstat (limited to 'docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/E435')
-rw-r--r-- | docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/E435 | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/E435 b/docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/E435 new file mode 100644 index 0000000..636b244 --- /dev/null +++ b/docs/os12/mdfs.net/Docs/Comp/BBC/OS1-20/E435 @@ -0,0 +1 @@ +**************** BUFFER ADDRESS HI LOOK UP TABLE ************************
E435 DB &03 ;keyboard
E436 DB &0A ;rs423 input
E437 DB &08 ;rs423 output
E438 DB &07 ;printer
E439 DB &07 ;sound 0
E43A DB &07 ;sound 1
E43B DB &07 ;sound 2
E43C DB &07 ;sound 3
E43D DB &09 ;speech
**************** BUFFER ADDRESS LO LOOK UP TABLE ************************
E43E DB &00
E43F DB &00
E440 DB &C0
E441 DB &C0
E442 DB &50
E443 DB &60
E444 DB &70
E445 DB &80
E446 DB &00
**************** BUFFER START ADDRESS OFFSET ****************************
E447 DB &E0
E448 DB &00
E449 DB &40
E44A DB &C0
E44B DB &F0
E44C DB &F0
E44D DB &F0
E44E DB &F0
E44F DB &C0
*******: get nominal buffer addresses in &FA/B **************************
; ON ENTRY X=buffer number
;Buffer number Address Flag Out pointer In pointer
;0=Keyboard 3E0-3FF 2CF 2D8 2E1
;1=RS423 Input A00-AFF 2D0 2D9 2E2
;2=RS423 output 900-9BF 2D1 2DA 2E3
;3=printer 880-8BF 2D2 2DB 2E4
;4=sound0 840-84F 2D3 2DC 2E5
;5=sound1 850-85F 2D4 2DD 2E6
;6=sound2 860-86F 2D5 2DE 2E7
;7=sound3 870-87F 2D6 2DF 2E8
;8=speech 8C0-8FF 2D7 2E0 2E9
E450 LDA &E43E,X ;get buffer base address lo
E453 STA &FA ;store it
E455 LDA &E435,X ;get buffer base address hi
E458 STA &FB ;store it
E45A RTS ;exit
*************************************************************************
* *
* OSBYTE 152 Examine Buffer status *
* *
*************************************************************************
;on entry X = buffer number
;on exit FA/B points to buffer start Y is offset to next character
;if buffer is empty C=1, Y is preserved else C=0
E45B BIT &D9B7 ;set V and
E45E BVS &E461 ;jump to E461
*************************************************************************
* *
* OSBYTE 145 Get byte from Buffer *
* *
*************************************************************************
;on entry X = buffer number
; ON EXIT Y is character extracted
;if buffer is empty C=1, else C=0
E460 CLV ;clear V
E461 JMP (&022C) ;Jump via REMV
*************************************************************************
* *
* REMV buffer remove vector default entry point *
* *
*************************************************************************
;on entry X = buffer number
;on exit if buffer is empty C=1, Y is preserved else C=0
E464 PHP ;push flags
E465 SEI ;bar interrupts
E466 LDA &02D8,X ;get output pointer for buffer X
E469 CMP &02E1,X ;compare to input pointer
E46C BEQ &E4E0 ;if equal buffer is empty so E4E0 to exit
E46E TAY ;else A=Y
E46F JSR &E450 ;and get buffer pointer into FA/B
E472 LDA (&FA),Y ;read byte from buffer
E474 BVS &E491 ;if V is set (on input) exit with CARRY clear
;Osbyte 152 has been done
E476 PHA ;else must be osbyte 145 so save byte
E477 INY ;increment Y
E478 TYA ;A=Y
E479 BNE &E47E ;if end of buffer not reached <>0 E47E
E47B LDA &E447,X ;get pointer start from offset table
E47E STA &02D8,X ;set buffer output pointer
E481 CPX #&02 ;if buffer is input (0 or 1)
E483 BCC &E48F ;then E48F
E485 CMP &02E1,X ;else for output buffers compare with buffer start
E488 BNE &E48F ;if not the same buffer is not empty so E48F
E48A LDY #&00 ;buffer is empty so Y=0
E48C JSR &E494 ;and enter EVENT routine to signal EVENT 0 buffer
;becoming empty
E48F PLA ;get back byte from buffer
E490 TAY ;put it in Y
E491 PLP ;get back flags
E492 CLC ;clear carry to indicate success
E493 RTS ;and exit
**************************************************************************
**************************************************************************
** **
** CAUSE AN EVENT **
** **
**************************************************************************
**************************************************************************
;on entry Y=event number
;A and X may be significant Y=A, A=event no. when event generated @E4A1
;on exit carry clear indicates action has been taken else carry set
E494 PHP ;push flags
E495 SEI ;bar interrupts
E496 PHA ;push A
E497 STA &FA ;&FA=A
E499 LDA &02BF,Y ;get enable event flag
E49C BEQ &E4DF ;if 0 event is not enabled so exit
E49E TYA ;else A=Y
E49F LDY &FA ;Y=A
E4A1 JSR &F0A5 ;vector through &220
E4A4 PLA ;get back A
E4A5 PLP ;get back flags
E4A6 CLC ;clear carry for success
E4A7 RTS ;and exit
********* check event 2 character entering buffer ***********************
E4A8 TYA ;A=Y
E4A9 LDY #&02 ;Y=2
E4AB JSR &E494 ;check event
E4AE TAY ;Y=A
*************************************************************************
* *
* OSBYTE 138 Put byte into Buffer *
* *
*************************************************************************
;on entry X is buffer number, Y is character to be written
E4AF TYA ;A=Y
E4B0 JMP (&022A) ;jump to INSBV
*************************************************************************
* *
* INSBV insert character in buffer vector default entry point *
* *
*************************************************************************
;on entry X is buffer number, A is character to be written
E4B3 PHP ;save flags
E4B4 SEI ;bar interrupts
E4B5 PHA ;save A
E4B6 LDY &02E1,X ;get buffer input pointer
E4B9 INY ;increment Y
E4BA BNE &E4BF ;if Y=0 then buffer is full else E4BF
E4BC LDY &E447,X ;get default buffer start
E4BF TYA ;put it in A
E4C0 CMP &02D8,X ;compare it with input pointer
E4C3 BEQ &E4D4 ;if equal buffer is full so E4D4
E4C5 LDY &02E1,X ;else get buffer end in Y
E4C8 STA &02E1,X ;and set it from A
E4CB JSR &E450 ;and point &FA/B at it
E4CE PLA ;get back byte
E4CF STA (&FA),Y ;store it in buffer
E4D1 PLP ;pull flags
E4D2 CLC ;clear carry for success
E4D3 RTS ;and exit
E4D4 PLA ;get back byte
E4D5 CPX #&02 ;if we are working on input buffer
E4D7 BCS &E4E0 ;then E4E0
E4D9 LDY #&01 ;else Y=1
E4DB JSR &E494 ;to service input buffer full event
E4DE PHA ;push A
***** return with carry set *********************************************
E4DF PLA ;restore A
E4E0 PLP ;restore flags
E4E1 SEC ;set carry
E4E2 RTS ;and exit
***************** CODE MODIFIER ROUTINE *********************************
* CHECK FOR ALPHA CHARACTER *
*************************************************************************
;ENTRY character in A
;exit with carry set if non-Alpha character
E4E3 PHA ;Save A
E4E4 AND #&DF ;convert lower to upper case
E4E6 CMP #&41 ;is it 'A' or greater ??
E4E8 BCC &E4EE ;if not exit routine with carry set
E4EA CMP #&5B ;is it less than 'Z'
E4EC BCC &E4EF ;if so exit with carry clear
E4EE SEC ;else clear carry
E4EF PLA ;get back original value of A
E4F0 RTS ;and Return
;
;
*******: INSERT byte in Keyboard buffer *********************************
E4F1 LDX #&00 ;X=0 to indicate keyboard buffer
*************************************************************************
* *
* OSBYTE 153 Put byte in input Buffer checking for ESCAPE *
* *
*************************************************************************
;on entry X = buffer number (either 0 or 1)
;X=1 is RS423 input
;X=0 is Keyboard
;Y is character to be written
E4F3 TXA ;A=buffer number
E4F4 AND &0245 ;and with RS423 mode (0 treat as keyboard
;1 ignore Escapes no events no soft keys)
E4F7 BNE &E4AF ;so if RS423 buffer AND RS423 in normal mode (1) E4AF
E4F9 TYA ;else Y=A character to write
E4FA EOR &026C ;compare with current escape ASCII code (0=match)
E4FD ORA &0275 ;or with current ESCAPE status (0=ESC, 1=ASCII)
E500 BNE &E4A8 ;if ASCII or no match E4A8 to enter byte in buffer
E502 LDA &0258 ;else get ESCAPE/BREAK action byte
E505 ROR ;Rotate to get ESCAPE bit into carry
E506 TYA ;get character back in A
E507 BCS &E513 ;and if escape disabled exit with carry clear
E509 LDY #&06 ;else signal EVENT 6 Escape pressed
E50B JSR &E494 ;
E50E BCC &E513 ;if event handles ESCAPE then exit with carry clear
E510 JSR &E674 ;else set ESCAPE flag
E513 CLC ;clear carry
E514 RTS ;and exit
******** get a byte from keyboard buffer and interpret as necessary *****
;on entry A=cursor editing status 1=return &87-&8B,
;2= use cursor keys as soft keys 11-15
;this area not reached if cursor editing is normal
E515 ROR ;get bit 1 into carry
E516 PLA ;get back A
E517 BCS &E592 ;if carry is set return
;else cursor keys are 'soft'
E519 TYA ;A=Y get back original key code (&80-&FF)
E51A PHA ;PUSH A
E51B LSR ;get high nybble into lo
E51C LSR ;
E51D LSR ;
E51E LSR ;A=8-&F
E51F EOR #&04 ;and invert bit 2
;&8 becomes &C
;&9 becomes &D
;&A becomes &E
;&B becomes &F
;&C becomes &8
;&D becomes &9
;&E becomes &A
;&F becomes &B
E521 TAY ;Y=A = 8-F
E522 LDA &0265,Y ;read 026D to 0274 code interpretation status
;0=ignore key, 1=expand as 'soft' key
;2-&FF add this to base for ASCII code
;note that provision is made for keypad operation
;as codes &C0-&FF cannot be generated from keyboard
;but are recognised by OS
;
E525 CMP #&01 ;is it 01
E527 BEQ &E594 ;if so expand as 'soft' key via E594
E529 PLA ;else get back original byte
E52A BCC &E539 ;if above CMP generated Carry then code 0 must have
;been returned so E539 to ignore
E52C AND #&0F ;else add ASCII to BASE key number so clear hi nybble
E52E CLC ;clear carry
E52F ADC &0265,Y ;add ASCII base
E532 CLC ;clear carry
E533 RTS ;and exit
;
*********** ERROR MADE IN USING EDIT FACILITY ***************************
E534 JSR &E86F ;produce bell
E537 PLA ;get back A, buffer number
E538 TAX ;X=buffer number
********get byte from buffer ********************************************
E539 JSR &E460 ;get byte from buffer X
E53C BCS &E593 ;if buffer empty E593 to exit
E53E PHA ;else Push byte
E53F CPX #&01 ;and if RS423 input buffer is not the one
E541 BNE &E549 ;then E549
E543 JSR &E173 ;else oswrch
E546 LDX #&01 ;X=1 (RS423 input buffer)
E548 SEC ;set carry
E549 PLA ;get back original byte
E54A BCC &E551 ;if carry clear (I.E not RS423 input) E551
E54C LDY &0245 ;else Y=RS423 mode (0 treat as keyboard )
E54F BNE &E592 ;if not 0 ignore escapes etc. goto E592
E551 TAY ;Y=A
E552 BPL &E592 ;if code is less that &80 its simple so E592
E554 AND #&0F ;else clear high nybble
E556 CMP #&0B ;if less than 11 then treat as special code
E558 BCC &E519 ;or function key and goto E519
E55A ADC #&7B ;else add &7C (&7B +C) to convert codes B-F to 7-B
E55C PHA ;Push A
E55D LDA &027D ;get cursor editing status
E560 BNE &E515 ;if not 0 (normal) E515
E562 LDA &027C ;else get character destination status
;Bit 0 enables RS423 driver
;BIT 1 disables VDU driver
;Bit 2 disables printer driver
;BIT 3 enables printer independent of CTRL B or CTRL C
;Bit 4 disables spooled output
;BIT 5 not used
;Bit 6 disables printer driver unless VDU 1 precedes character
;BIT 7 not used
E565 ROR ;get bit 1 into carry
E566 ROR ;
E567 PLA ;
E568 BCS &E539 ;if carry is set E539 screen disabled
E56A CMP #&87 ;else is it COPY key
E56C BEQ &E5A6 ;if so E5A6
E56E TAY ;else Y=A
E56F TXA ;A=X
E570 PHA ;Push X
E571 TYA ;get back Y
E572 JSR &D8CE ;execute edit action
E575 PLA ;restore X
E576 TAX ;
E577 BIT &025F ;check econet RDCH flag
E57A BPL &E581 ;if not set goto E581
E57C LDA #&06 ;else Econet function 6
E57E JMP (&0224) ;to the Econet vector
********* get byte from key string **************************************
;on entry 0268 contains key length
;and 02C9 key string pointer to next byte
E581 LDA &0268 ;get length of keystring
E584 BEQ &E539 ;if 0 E539 get a character from the buffer
E586 LDY &02C9 ;get soft key expansion pointer
E589 LDA &0B01,Y ;get character from string
E58C INC &02C9 ;increment pointer
E58F DEC &0268 ;decrement length
************** exit with carry clear ************************************
E592 CLC ;
E593 RTS ;exit
;
*** expand soft key strings *********************************************
Y=pointer to sring number
E594 PLA ;restore original code
E595 AND #&0F ;blank hi nybble to get key string number
E597 TAY ;Y=A
E598 JSR &E3A8 ;get string length in A
E59B STA &0268 ;and store it
E59E LDA &0B00,Y ;get start point
E5A1 STA &02C9 ;and store it
E5A4 BNE &E577 ;if not 0 then get byte via E577 and exit
*********** deal with COPY key ******************************************
E5A6 TXA ;A=X
E5A7 PHA ;Push A
E5A8 JSR &D905 ;read a character from the screen
E5AB TAY ;Y=A
E5AC BEQ &E534 ;if not valid A=0 so BEEP
E5AE PLA ;else restore X
E5AF TAX ;
E5B0 TYA ;and Y
E5B1 CLC ;clear carry
E5B2 RTS ;and exit
\ No newline at end of file |