;random walk www.6502asm.com
U:lda $1
and #7
tay
lda G,y
sta $4
ldy $1
lda B,y
sta $5
ldy $0
lda $2
sta ($4),y
lda $fe
and #3
beq R
cmp #1
beq L
cmp #2
beq up
jmp N
R:inc $0
jmp D
L:dec $0
jmp D
up:dec $1
jmp D
N:inc $1
jmp D
D:lda $0
and #31
sta $0
lda $1
and #31
sta $1
dec $3
bne U
lda $fe
sta $2
jmp U
B:dcb 2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5
G:dcb 0,32,64,96,$80,$a0,$c0,$e0
Inspired by the classic one liner:
10 PRINT CHR$(205.5+RND(1));: GOTO 10
for the #Commodore #C64
* = $c000
lda #$00
sta $d020
sta $d021
lda #$01
sta $0286
lda #147
jsr $ffd2
clc
lda $d012
and #$01
adc #$cd
jsr $ffd2
bne $c012
Execute with SYS 49152
#6502Assembly
I wonder if you can make something useful in assembly in the limits of one Mastodon post - or 500 characters? Either as Assembly source, or as just hex bytes, which is about 160 hex bytes including spaces and a start address.
#AskingForAFriend
#6502Assembly
#MachineCode
#Z80
#askingforafriend #6502assembly #machinecode #z80
Here is the fixed code:
C000: A2 0A LDX #$0A
C002: BD 0C C0 LDA $C00C,X
C005: 20 D2 FF JSR $FFD2
C008: CA DEX
C009: 10 F7 BPL $C002
C00B: 60 RTS
C00C: 44 4C 52 4F 57 20 4F 4C
C014: 4C 45 48
This fixed version checks if X is now positive (reading it as a signed Integer from -127 to +128 I think). Zero is of course a positive number. The previous version worked by luck, as C64 emulators tend to initialise RAM to zero, which might not be reliable on real hardware.
@cyberspice So JSR OSWRCH is equivalent to the Commodore Kernal CHROUT ($ffd2)
Good work.
#6502Assembly
After some thinking, this is the shortest way to make a Hello World in #6502Assembly on the #Commodore #C64 (portable to other C= machines)
Source:
* = $c000
ldx #$0a
lda $c00c,x
dex
jsr $ffd2
bne $c002
rts
!byte $44, $4c, $52, $4f, $57, $20, $4f, $4c, $4c ,$45, $48
Screen shot from BASIC also attached.
One mistake I used to make in 6502 was this:
lda #$00
ldx #$00
ldy #$00
I now realise this will save me two whole bytes:
lda #$00
tax
tay
I've spent this last week sick at home with #COVID. During that time I downloaded #RetroArch and have been playing a few #NES games. Now I have this crazy itch to make my own home brew NES game.
I've been watching YouTube videos on how to program #6502assembly since yesterday and it seems pretty cool. What am I getting my self into?
If anyone is curious, #NESHacker is a great channel putting out content on programming NES games and the 6502 processor.
#COVID #retroarch #nes #6502assembly #neshacker
fighting the urge to make a recursive factorial representation in #6502assembly, send help pls
Can you understand 6502 assembly? Even if you don't, you might find this thoroughly commented and very readable disassembly of Super Mario Bros. on the NES enlighting:
🍄 https://gist.github.com/1wErt3r/4048722
#programming #6502assembly #gamedev #retro
In realtà sto studiando l'Assembly del 6502 perché voglio costruire Bender
#retrocomputing #6502CPU #6502assembly
So I've been working on a basic sound driver for the #SID since 3 days, and I've managed to get it to play a chord! Groundbreaking stuff, I know. /j
The hardest part (yet) was figuring out how to create a note table and even be able to use it. I tried to make use of that .byte thingy, but to no avail. I did manage to do it at like 3am tho.
#sid #c64 #6502asm #6502assembly
@hackaday This is really cool. I have a #Z80 chip that I hope to some day turn into something like this.
Meanwhile I'm still learning lots from my Smartykit Apple I clone. That thing is a lot more fun to poke around with than it has any right to be! #6502assembly
Ich mache es jetzt mal öffentlich: Mein #GuterVorsatz für 2023 ist es 6502 Assembler zu lernen. #6502Assembly
Ich habe da noch eine alte, offene Rechnung ...
RT @YangKui7@twitter.com
Super Mario runs well, and the simulator has improved.#Java #javafx #nesdev #6502assembly
#java #javafx #nesdev #6502assembly
@DeveloperMemes
Well, actually I never programmed in #assembly even if I learned #6502assembly