Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Loops-While/6502-Assembly/loops-while.6502
Normal file
17
Task/Loops-While/6502-Assembly/loops-while.6502
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
LoopsWhile: PHA ;push accumulator onto stack
|
||||
|
||||
LDA #$00 ;the 6502 is an 8-bit processor
|
||||
STA Ilow ;and so 1024 ($0400) must be stored in two memory locations
|
||||
LDA #$04
|
||||
STA Ihigh
|
||||
WhileLoop: LDA Ilow
|
||||
BNE NotZero
|
||||
LDA Ihigh
|
||||
BEQ EndLoop
|
||||
NotZero: JSR PrintI ;routine not implemented
|
||||
LSR Ihigh ;shift right
|
||||
ROR Ilow ;rotate right
|
||||
JMP WhileLoop
|
||||
|
||||
EndLoop: PLA ;restore accumulator from stack
|
||||
RTS ;return from subroutine
|
||||
Loading…
Add table
Add a link
Reference in a new issue