home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 4 #4
/
Commodore_Disk_User_Vol.4_4_1991_-.d64
/
f-keys.list
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
3KB
|
103 lines
10 ;"@:f-keys.list"
20 *=$c000
30 lda $0314 ;have interrupts
40 cmp #$20 ;already been put in?
50 beq keyprog ;if so, goto keyprog
60 sei
70 lda #$20
80 sta $0314
90 lda #$c0
100 sta $0315
110 cli
120 rts
130 *=$c020
140 lda $c5 ;get keypress
150 cmp #$04 ;is it f1?
160 beq f1 ;goto f1
170 cmp #$05 ;is it f3?
180 beq f3 ;goto f3
190 cmp #$06 ;is it f5?
200 beq f5 ;goto f5
210 cmp #$03 ;is it f7?
220 beq f7 ;goto f7
230 jmp $ea31 ;housekeeping
240 f1 ;f1
250 lda #$00 ;set base to 00
260 jmp shift ;test shift
270 f3 ;f3
280 lda #$10 ;set base to 10
290 jmp shift ;test shift
300 f5 ;f5
310 lda #$20 ;set base to 20
320 jmp shift ;test shift
330 f7 ;f7
340 lda #$30 ;set base to 30
350 jmp shift ;test shift
360 shift ;test shift routine
370 ldx $028e ;get shift pattern
380 cpx #$00 ;no shift
390 beq output ;goto output
400 cpx #$01 ;shift key
410 bne commodore ;no, goto commodore
420 adc #$07 ;add 7 to base
430 jmp output ;goto output
440 commodore ;commodore test
450 cpx #$02 ;is it c=?
460 bne ctrl ;no, goto ctrl
470 adc #$3f ;add 3f to base
480 jmp output ;goto output
490 ctrl ;control test
500 cpx #$04 ;is it control
510 bne output ;goto output
520 adc #$47 ;add 47 to base
530 output ;output key rounine
540 sta temp+1 ;put address in lda
550 ldy #$00 ;set counter to 0
560 temp ;pointer
570 lda $c100,y ;get char
580 sta $0277,y ;and put in buffer
590 iny ;next char
600 cpy #$08 ;all 8 done?
610 bne temp ;no, goto temp
620 sty $c6 ;buffer full sign
630 ldy #$00 ;counter to 00
640 thingy ;weird named flag?!
650 jsr $eeb3 ;delay 1ms
660 dey ;do it 256 times
670 bne thingy ;go back to thingy
680 jmp $ea31 ;housekeeping
690 keyprog ;program f-key
700 jsr $aefd ;go past comma
710 jsr $b79e ;get number
720 cpx #$00 ;is it 0?
730 beq error ;error!
740 cpx #$11 ;more than 17?
750 bcc getkey ;no, okay
760 error ;error routine
770 ldx #$0e ;illegal quantity
780 jmp $a437 ;print errror
790 getkey dex ;take one away
800 stx $fd ;bung it in $fd
810 txa ;and in acc.
820 clc ;clear c flag
830 rol a ;mult 2 (2)
840 rol a ;mult 2 (4)
850 rol a ;mult 2 (8)
860 sta address+1 ;poke into lda
870 jsr $aefd ;go past comma
880 jsr $ad9e ;get string
890 sta $fe ;store length
900 jsr $b6a3 ;discard string
910 ldy #$00 ;counter to 00
920 getmore ;getmore
930 lda ($22),y ;get string
940 cpy $fe ;end of string?
950 bcc address ;no, goto adress
960 lda #$00 ;set char to 00
970 address ;pointer
980 sta $c100,y ;put in memory
990 iny ;add 1 to count
1000 cpy #$08 ;8 chars?
1010 bne getmore ;no, goto getmore
1020 rts ;return