汇编:CBM prg Studio。
大家好,圣诞快乐,节日快乐 :) 我的中断中的文本输出是怎么回事?我必须在这里遗漏一些明显的东西,但请看一下附图......
它应该说:
“进入第一个候选人的范围……”
*位图显示
“开始我的 Y/N?”
看看所附的图像,自己看看。
下面是代码。感谢您抽出时间来看看,这让我困惑了一整晚!
:) 詹姆斯点击这里查看图片
; 10 SYS (2064)
*=$0801
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32, $30, $36, $34, $29, $00, $00, $00
;Sexy Subroutines...
CHROUT = $FFD2 ; Output a character to the screen
SCNKEY = $FF9F ; Place ASCII character into keyboard queue
GETIN = $FFE4 ; Places the ASCII value into the Accumulator
PLOT = $FFF0 ; PLOTs the cursor to the next line down, X = the row number
; Y = the colum. Always Clear the Carry (CLC) vital for
; plotting!
DECDIS = $BDCD
;The stack location for temporary strings...
tempst1 = $0020
tempst2 = $0021
;Screen details...
Screen = $0400
Border = $D020
Background = $D021
; I/O Stuff.........
LSTX = $00c5 ; Current key pressed.
; 01=ENTER. 3C=SPACE. 1=38. 2=3b. 3=08. 4=0b. 5=10. 6=13. 7=18. 8=1b. 9=20
; Y=19. N=27. S=0d. P=29.
*=$0810
lda #147 ; This is a BASIC routine that presses the keyboard
jsr CHROUT ; button that clears the screen.
lda #00
sta Border
sta Background
jsr Init ; Split the screen!
ldx #$00
lda #$0e
jsr CHROUT
ldx #20
ldy #00
clc
jsr PLOT
lda #>Siliconi
sta tempst2
lda #<Siliconi
sta tempst1
jsr print
ldx #01
ldy #00
clc
jsr PLOT
lda #>message
sta tempst2
lda #<message
sta tempst1
jsr print
loaddccimage
;lda $3f40,x
;sta $0400,x
lda $4040,x
sta $0500,x
lda $4140,x
sta $0600,x
;lda $4240,x
;sta $0700,x
;lda $4328,x
;sta $d800,x
lda $4428,x
sta $d900,x
lda $4528,x
sta $da00,x
;lda $4628,x
;sta $db00,x
inx
bne loaddccimage
lda #$3b
sta $d011
lda #$18
sta $d016
jump jmp *
;===================
Init SEI ; set interrupt bit, make the CPU ignore interrupt requests
LDA #%01111111 ; switch off interrupt signals from CIA-1
STA $DC0D
AND $D011 ; clear most significant bit of VIC's raster register
STA $D011
LDA $DC0D ; acknowledge pending interrupts from CIA-1
LDA $DD0D ; acknowledge pending interrupts from CIA-2
LDA #0 ; set rasterline where interrupt shall occur
STA $D012
LDA #<Irq ; set interrupt vectors, pointing to interrupt service routine below
STA $0314
LDA #>Irq
STA $0315
LDA #%00000001 ; enable raster interrupt signals from VIC
STA $D01A
CLI ; clear interrupt flag, allowing the CPU to respond to interrupt requests
RTS ; ?? Leave here ??
Irq LDA $D011 ; select text screen mode
AND #%11011111
STA $D011
lda #$14
sta $d018
LDA #%00000000
sta $d016
LDA #<Irq2 ; set interrupt vectors to the second interrupt service routine at Irq2
STA $0314
LDA #>Irq2
STA $0315
LDA #100
STA $D012 ; next interrupt will occur at line no. 0
ASL $D019 ; acknowledge the interrupt by clearing the VIC's interrupt flag
JMP $EA31 ; jump into KERNAL's standard interrupt service routine to handle keyboard scan, cursor display etc.
Irq2 LDA $D011 ; select bitmap screen mode
ORA #%00100000
STA $D011
lda #$18
sta $d018
LDA #%00010000
sta $d016
LDA #<Irq ; set interrupt vectors back to the first interrupt service routine at Irq
STA $0314
LDA #>Irq
STA $0315
LDA #200
STA $D012 ; next interrupt will occur at line no. 210
ASL $D019 ; acknowledge the interrupt by clearing the VIC's interrupt flag
JMP $EA81 ; jump into shorter ROM routine to only restore registers from the stack etc
Print
ldy #0 ;Clear the Y register
Print1
lda (tempst1),y
cmp #255
beq PrintDone
jsr PrintChar
iny
jmp Print1
PrintDone
RTS
PrintChar
cmp #48
bcc PrintChar1
PrintChar1
jsr CHROUT
rts
Siliconi
Text "COMMENCE MINE Y/N?"
byte 255
message
Text "Moving into range of the first candidate..."
byte 255
*=$1FFE
incbin "ASTRO1.prg"