EDASS-128-RASTER-BARS-MANDATORY-LIKE-Hello-World! -------------------------------------------------------------------------------------------------- TOOL: EDASS-128 {Commodore C128 EDITOR & ASSEMBLER} Language: Assembler Extra: - Author: Misel Zivanovic Note: (C) 8th FEB 2026 - www.lived.ch, mzretro.ch --------------------------------------------------------------------------------------------------- Raster bars is something everyone wanted to do as a kid, no doubt. On the internet you can find tons of different approaches and here is my way to do it. Main goal was to achieve stability without involving everything possible! I think it's a well done job! I used jsr $ffd2 KERNAL routine to show text, but positioning isn't so the strength of it... Could be that there is another, better, more byte-efficient way? STA to be better choice in such cases where you need to position more than one line of text on the screen. Whatever, it's doing its job for now. Won't bother any longer for now with this. rasterbars.asm -a:0010-a: -e: ;-------------------------------------- *= $1300 .obj m .bank 15 ;-------------------------------------- ; ; lda #147 ;clear screen jsr $ffd2 ; ; lda #22 ;lowercase map ; sta $a2c ; jsr gotext ; start jsr $ffe4 cmp #$0d ;hold enter >quit beq basic ldx #$00 ldy #48 ;start position cycle lda color,x go cpy $d012 bne go sta $d020 sta $d021 inx iny iny iny iny iny iny iny iny iny iny iny iny iny iny cpx #16 bne cycle jmp start ;and repeat ; basic lda #$0c ;exit settings sta $d020 lda #$0b sta $d021 lda #$0f sta $f1 ; lda #$14 ;uppercase map ; sta $a2c rts ; ;-------------------------------------- ; show text ;-------------------------------------- gotext lda #$00 sta $f1 ; text color clc ldx #12 ldy #10 jsr $c018 ldx #$00 line1 lda text1,x ;text line 1 jsr $ffd2 inx cpx #16 bne line1 clc ldx #20 ldy #10 jsr $c018 ldx #$00 line2 lda text2,x ;text line 2 jsr $ffd2 inx cpx #16 bne line2 rts ;-------------------------------------- color .byte $01,$02,$03,$04,$05,$06 .byte $07,$08,$09,$0a,$0b,$0c .byte $0e,$0d,$0f,$00 text1 .text "C128 Color Bars!" text2 .text "Press ENTER=QUIT"