Scrolling display utility

Discuss software for the Micro-KIM and KIM-1

Scrolling display utility

Postby AartBik » Jul Sat 07, 2012 7:40 pm

I am working on some general utilities for the micro-KIM, and during the long weekend I had some spare time to finish a scrolling putchar utility that can output letters and digits to the 7-segment display in a scrolling fashion (some characters need more improvisation than others).

Brief video at
http://www.youtube.com/watch?v=GSfuRBtV ... ontext-gau
User avatar
AartBik
 
Posts: 24
Joined: Nov Thu 03, 2011 11:20 pm
Location: Mountain View, CA, USA

Re: Scrolling display utility

Postby chassum » Jul Sat 07, 2012 8:38 pm

Looks great! Where's the code ;)
User avatar
chassum
 
Posts: 23
Joined: Apr Mon 23, 2012 1:53 pm

Re: Scrolling display utility

Postby AartBik » Jul Sun 08, 2012 1:20 am

chassum wrote:Looks great! Where's the code ;)


I plan to release the utilities when it is a bit more flashed out, but the basic idea of displaying something on the 7-segment display can be understood by studying the SCAND and CONVD subroutines in 6530-002 ROM. For example, below you will find a very quick and dirty way of displaying AART on the display.

Code: Select all
;180200A27F8E4117A2088E4217A2778E4017203C02A20A8E4217A20843
;180218778E4017203C02A20C8E4217A2318E4017203C02A20E8E420717
;12023017A2788E4017203C024C0502A264CAD0FD600708
;0000030003
User avatar
AartBik
 
Posts: 24
Joined: Nov Thu 03, 2011 11:20 pm
Location: Mountain View, CA, USA

Re: Scrolling display utility

Postby chassum » Jan Thu 03, 2013 6:01 pm

Aart,
I _really_ like your assembler. Thanks for providing it. I was able to play with it a bit over the holidays and made a message scroller using Jim Butterfield's scan routine from Wumpus. Here's the source:
Code: Select all
; kim_msg.asm
; testing lin2c64 6510 assembler
; using J. Butterfield's scan display from Wumpus
; 01/03/2013 ces

; output from lin2c64 -P kim_msg.asm

;180180F7FCB9D8DEF9F1EFF6F4B09E0080BF86DBCFE6EDFD87FFEF13C0
;18019800F8F4B0ED80B0ED80F780F8F9EDF800F6F9B8B8BF80BEBE123E
;1301B0DCD086DE00808080FCEEF900808080808080000B37
;180200A001A9BC200003A001A980200003A001A98D200003A001A90774
;150218A8200003A001A980200003A001A9B52000034C00020557
;18030084DE85DDA90785DFA005A205B1DDC900D0016095E888CA100CA6
;180318F3D8189865DF85DC202803A4DC4C0A03A20A86DBA9528D070B13
;18033017203E032C071710F8C6DBD0EF60A97F8D4117A000A209B909E6
;0D0348E80084FC204E1FC8C00690F36006BE
;0000090009
;;;;;;;;;;;;;;;;;;;;;;;

; define some pseudo-alphabet characters
A_      .equ $f7
_b      .equ $fc
C_      .equ $b9
_c      .equ $d8
_d      .equ $de
E_      .equ $f9
F_      .equ $f1
G_      .equ $bd
_g      .equ $ef
H_      .equ $f6
_h      .equ $f4
I_      .equ $b0
J_      .equ $9e
K_      .equ $f0    ; non-standard
L_      .equ $b8
_l      .equ $86
_m      .equ $a3    ; non-standard
N_      .equ $b7
_n      .equ $b4
O_      .equ $bf
_o      .equ $dc
P_      .equ $f3
_q      .equ $e7
R_      .equ $31
_r      .equ $d0
S_      .equ $ed
_t      .equ $f8
U_      .equ $be
_u      .equ $9c
_v      .equ $c2    ; non-standard
_w      .equ $e2    ; non-standard
_x      .equ $e4    ; non-standard
Y_      .equ $ee
Z_      .equ $d8
Qmrk    .equ $d3
dsh     .equ $c0
spc     .equ $80
ch0     .equ $bf
ch1     .equ $86
ch2     .equ $dB
ch3     .equ $cf
ch4     .equ $e6
ch5     .equ $ed
ch6     .equ $fd
ch7     .equ $87
ch8     .equ $ff
ch9     .equ $ef

SAD     .equ $1740      ; data port for pins 1-4
SADD    .equ $1741
SBD     .equ $1742      ; data port for pins 5-6
SBDD    .equ $1743
TIMER2  .equ $1707      ; optional 2nd 6532 timer
led1    .equ $08        ; LED selectors (left to right)
led2    .equ $0a
led3    .equ $0c
led4    .equ $0e
led5    .equ $10
led6    .equ $12
lout    .equ $7f        ; set pins as output to left 4 LEDs
rout    .equ $1e        ; set pins as output to right 2 LEDs
tmr     .equ $00db
ptr     .equ $00dc
xfrhi   .equ $00dd
xfrlo   .equ $00de
tmp1    .equ $00df
cbuff   .equ $00e8

        .org $0180      ; start of data
msg0    .byte A_ _b C_ _c _d E_ F_ _g H_ _h I_ J_ $00
msg1    .byte spc ch0 ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch8 ch9 $00
msg2    .byte _t _h I_ S_ spc I_ S_ spc A_ spc _t E_ S_ _t $00
msg3    .byte H_ E_ L_ L_ O_ spc U_ U_ _o _r _l _d $00
msg4    .byte spc spc spc _b Y_ E_ $00
MSG5    .BYTE spc spc spc spc spc spc $00

lo0     .equ <msg0
hi0     .equ >msg0
lo1     .equ <msg1
hi1     .equ >msg1
lo2     .equ <msg2
hi2     .equ >msg2
lo3     .equ <msg3
hi3     .equ >msg3
lo4     .equ <msg4
hi4     .equ >msg4
lo5     .equ <msg5
hi5     .equ >msg5

        .org $0200      ; start of code       
main    ldy #hi5
        lda #lo5
        jsr scan
        ldy #hi0
        lda #lo0
        jsr scan
        ldy #hi1
        lda #lo1
        jsr scan
        ldy #hi3
        lda #lo3
        jsr scan
        ldy #hi0
        lda #lo0
        jsr scan
        ldy #hi4
        lda #lo4
        jsr scan
        jmp main
       
        .org $0300
scan    sty xfrlo       ; y and a get loaded before jsr to scan
        sta xfrhi
        lda #$07        ; init scan forward
        sta tmp1
        ldy #$05        ; init y
cont    ldx #$05        ; init x
char    lda (xfrhi),y   ; get character
        cmp #$00        ; last character?
        bne more        ; if not, continue
        rts
more    sta cbuff,x     ; store char
        dey             ; set up next char
        dex             ; set up next store loc
        bpl char        ; loop if not 6th char
        cld             ; binary mode
        clc             ; prepare to add (clear carry flag)
        tya             ; get char pointer
        adc tmp1        ; update for 6 new characters
        sta ptr         ; save new pointer
        jsr dspdly      ; delay display
        ldy ptr         ; restore pointer
        jmp cont        ; continue with rest of message
dspdly  ldx #$0a        ; set the delay rate here
        stx tmr         ; put in decr. location
time    lda #$52        ; load timer
        sta TIMER2      ; start timer
lite    jsr disp        ; gosub display rtn
        bit TIMER2      ; timer done?
        bpl lite        ; if not, loop
        dec tmr         ; decrement timer counter
        bne time        ; not finished
        rts             ; now get 6 new characters
disp    lda #lout       ; change left led segments
        sta SADD        ; to outputs
        ldy #$00        ; init recall index
        ldx #$09        ; init digit number
six     lda cbuff,y     ; get character
        sty $00fc       ; save y for monitor disp routine
        jsr $1f4e       ; monitor routine - disp char, delay 500 cycles
        iny             ; set up for next char
        cpy #$06        ; 6 char displayed?
        bcc six         ; no
;        JSR $1f3d       ; check keypress if you want to
        rts

       
User avatar
chassum
 
Posts: 23
Joined: Apr Mon 23, 2012 1:53 pm

Re: Scrolling display utility

Postby vbriel » Jan Fri 04, 2013 9:24 pm

Ah I gotta give this a try. Time to break out my Micro-KIM for some play.
User avatar
vbriel
Site Admin
 
Posts: 1184
Joined: Jul Tue 19, 2005 12:10 pm
Location: Ohio

Re: Scrolling display utility

Postby AartBik » Jan Mon 07, 2013 1:46 pm

chassum wrote:Aart,
I _really_ like your assembler. Thanks for providing it.


Thanks for your very kind words. One is glad to be of service!
User avatar
AartBik
 
Posts: 24
Joined: Nov Thu 03, 2011 11:20 pm
Location: Mountain View, CA, USA

Re: Scrolling display utility

Postby MOS6502 » Aug Sat 17, 2013 10:20 am

chassum wrote: I was able to play with it a bit over the holidays and made a message scroller using Jim Butterfield's scan routine from Wumpus. Here's the source:


Hi. This looks like fun. Could you give some instructions on how to use this? I transfered the KIM-code bit into my Micro-KIM and I get a blank screen.
Motorola 6800, Intel 8080, Fairchild F8, Rockwell PPS8... MOS 6502 Microprocessor beats 'em all!
User avatar
MOS6502
 
Posts: 8
Joined: May Mon 28, 2012 12:26 pm
Location: Helsinki - Finland

Re: Scrolling display utility

Postby chassum » Aug Mon 19, 2013 5:02 pm

MOS6502 wrote:
chassum wrote: I was able to play with it a bit over the holidays and made a message scroller using Jim Butterfield's scan routine from Wumpus. Here's the source:


Hi. This looks like fun. Could you give some instructions on how to use this? I transfered the KIM-code bit into my Micro-KIM and I get a blank screen.


This program uses the timer on the (optional) second 6532, so I'm guessing that you don't have that installed. Let me know if it's actually some other problem.
cheerts,
-chassum
User avatar
chassum
 
Posts: 23
Joined: Apr Mon 23, 2012 1:53 pm

Re: Scrolling display utility

Postby MOS6502 » Aug Wed 21, 2013 12:48 pm

Thanks, the problem indeed was the missing second 6532. I uploaded the code into my KIM-1 and it works. I just spent some two hours trying different scrolling texts 8)

I am not sure if you had coded the demo on purpose to show the messages in a bit weird order (msg5, msg0, msg1, msg3, msg0, msg4 - ie. not showing msg2 at all and showing msg0 twice!), I changed the order in my test code to 1-5. Couple of times I did get random characters after the last message. The random characters kept scrolling for one or two "whole screens" and then the program continued normally. I am not yet sure what caused it but it might have something to do with the message length (I added some spaces and/or modified the message length a little and the problem disappeared).

Anyway, thanks, nice little utility. I am using this as a little demo to show my KIM-1 at the Finnish Amiga users club meeting in couple of weeks.
Motorola 6800, Intel 8080, Fairchild F8, Rockwell PPS8... MOS 6502 Microprocessor beats 'em all!
User avatar
MOS6502
 
Posts: 8
Joined: May Mon 28, 2012 12:26 pm
Location: Helsinki - Finland

Re: Scrolling display utility

Postby chassum » Aug Wed 21, 2013 1:35 pm

Glad that you've got it going! And yes, I did display the messages out of order on purpose. I'm a software QA guy and that kind of thing is part of my nature ;)
Feel free to re-define any of the 'non-standard' characters (some of them are rather clumsy).
And I'd love to see a video of your demo.
User avatar
chassum
 
Posts: 23
Joined: Apr Mon 23, 2012 1:53 pm

Re: Scrolling display utility

Postby MOS6502 » Sep Wed 25, 2013 12:40 pm

We had the Finnish Amiga Users group meeting last saturday and here are photos and videos of the event:
http://saku.bbs.fi/yhdistys/tapahtumat/ ... index.html

My KIM-1 (and PET-2001) can be seen on pages 14-15 on the photo report (here: http://saku.bbs.fi/yhdistys/tapahtumat/ ... ex_14.html). (No, I am not the guy on the photo on page 14. I am on the bottom-left photo on page 7, the guy in the blue Amiga- shirt).

The KIM-1 was using the scrolling display utility by chassum 8) It had some short and simple texts like SAKU 2013, Heureka 21-9-2013 (name and place of the event) and "Commodore KIM-1" and of course, "Hello world". Nothing fancy but it was much nicer to have the machine doing something.

Both the KIM and PET received a lot of interest by the visitors and they were the oldest machines on the show. Probably the most photographed ones, too.

Thanks for the code, chassum!
Motorola 6800, Intel 8080, Fairchild F8, Rockwell PPS8... MOS 6502 Microprocessor beats 'em all!
User avatar
MOS6502
 
Posts: 8
Joined: May Mon 28, 2012 12:26 pm
Location: Helsinki - Finland

Re: Scrolling display utility

Postby chassum » Sep Wed 25, 2013 4:13 pm

Looks like it was a great event. Very nice shots of some wonderful machines. So glad I could help in my small way.
thanks!
User avatar
chassum
 
Posts: 23
Joined: Apr Mon 23, 2012 1:53 pm


Return to Software

Who is online

Users browsing this forum: No registered users and 0 guests