.. stubs/retroreplay/target/rrdump.s

File last touched at: 22.09.2003

 

         *=$0801-2
         .word $0801

        .word nextline          ; link to next basic line
        .word 2001              ; line-nr
        .byte $9e               ; token for sys
        .byte "2061"
        .byte $00               ; end of basic-line
nextline:
        .byte $00,$00           ; end of basic-program


         .include "../../generic/target/ports/silversurfer.inc"

         .include "rr.inc"

CHROUT=$ffd2
CHRIN =$ffe4

;---------------------------------------
; serial line input dumper
; (mostly useful for testing :=])
; 20020905: gpz fixed a lame bug ;)
;---------------------------------------

ss_dump:
         .proc

         lda #$00
         sta count+1

         cli

         lda #
$04       ; baudrate ($04=115k)
         jsr ss_init
mlp:

         jsr ss_getchr
         pha

count:   lda #$00
         jsr printhex

         lda #
$20
         jsr CHROUT

         pla
         jsr printhex

         lda #
$0d
         jsr CHROUT

         inc count
+1

@ll:
         jsr CHRIN
         cmp #
$03      ; runstop aborts
         beq @sk
         cmp #
$20      ; space stops
         beq @ll

         jmp mlp
@sk:
         rts

         .endproc

hextab:         .byte $30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$41,$42,$43,$44,$45,$46

printhex:
         tax
         lsr a
         lsr a
         lsr a
         lsr a
         tay
         lda hextab
,y
         jsr CHROUT
         txa
         and #
$0f
         tay
         lda hextab
,y
         jmp CHROUT

         .include "../../generic/target/ports/silversurfer_polling.s"

 

generated by txt2htm v0.1a (w)2001 Groepaz/Hitmen