Play a note!

Made something in Assembly? Show it off, and tell us how it works...
Absolute beginners welcome... we want to see what you've done!
Forum rules
There is a special rule on this forum...
This forum is intended to offer equal amounts encouragement and constructive feedback...
Therefore, if you say 2 negative things about someones work, you must think of 2 or more equally positive things...

Eg: "Great first effort, the idea is absolutely fascinating... However I noticed a few bugs, and maybe the graphics could be improved..."

If you can't think of anything good to say, then don't say anything!

If we don't encourage newbie programmers they won't have the confidence and motivation to stick at it and become great programmers! *speaking from experience*
Post Reply
Posts: 3
Joined: Tue Sep 01, 2020 2:06 pm

Play a note!

Post by Sect0r » Sat Sep 05, 2020 5:00 am

i made a program (with the help of a friend) that plays a note!
i spent 6 hours trying to figure out why it wasn't playing, just to find out that it was reading from zero page values and not an immediate value (Which i didn't know existed and or how they are used)
and eventually running into a brk opt code and restart it self.

Anyway, aside from that
here it is!

Code: Select all

; 10 SYS (49152)


        BYTE    $0E, $08, $0A, $00, $9E, $20, $28,  $34, $39, $31, $35, $32, $29, $00, $00, $00


defm lsa
        lda #$/1
        sta $/2

;           Val MemAddress
        lsa 44, D400    ;frequency voice1 low byte
        lsa 1D, D401    ;frequency voice1 high byte
        lsa 0F, D418    ;volume

        lsa 11, D405    ;attack
        lsa F0, D406    ;sustain

        ;play note
        lsa 11, D404    ;control register

        jmp HALT

User avatar
Posts: 430
Joined: Mon Apr 22, 2019 3:19 am

Re: Play a note!

Post by akuyou » Thu Sep 10, 2020 3:20 am

Great work! you've made progress pretty quick... it took me quite a while to get any sound out of the C64 too - it takes time to get started on these things!

that LSA macro is a good idea! I'm sure it'll save a lot of time.
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

Posts: 3
Joined: Tue Sep 01, 2020 2:06 pm

Re: Play a note!

Post by Sect0r » Thu Sep 10, 2020 1:06 pm

I use a lot of macros!
I think they're neat, and make my code a bit cleaner

Post Reply

Return to “Show and Tell”