Page 2 of 2
yeah
Posted: Mon Nov 24, 2008 1:09 pm
by Amenofhis
Shift the bit, left to right right to left but still i dont find anything, the thing is today but i have nothing ill ask for few more days but still i dont have anything that xplain or gave a example to do for the LSR ASL
I made this
Posted: Mon Nov 24, 2008 3:28 pm
by Amenofhis
I made this prog but still is not the same of what i want. this is a decrease thing. i got to work im taking example from this but still not getting it.
.ORG $0200
DELAY:
LDX #$64
STX $0005
Img DEC $0005
PHP
JSR Dito1
PLP
BNE Img
RTS
Dito1:
LDX #$01
log2: LDY #$01
log1: DEY
BNE log1
DEX
PHP
JSR log3
PLP
BNE log2
log3:
LDX #$FF
STX $0010
micro2 DEC $0010
PHP
JSR mic2
PLP
BNE micro2
RTS
mic2:
LDX #$FF
log4: LDY #$FF
log5: DEY
BNE log5
DEX
BNE log4
RTS
Re: yeah
Posted: Mon Nov 24, 2008 4:21 pm
by kc5tja
Shift the bit, left to right right to left but still i dont find anything, the thing is today but i have nothing ill ask for few more days but still i dont have anything that xplain or gave a example to do for the LSR ASL
A link to the W65C02 programmer's manual was provided in an earlier response which fully explains the operation of these instructions, with examples, and even pictures, provided. The manual assumes the reader has positively zero knowledge of assembly language programming at all, let alone of the 6502 in particular.
However, remember that
visualization of a program's output is hardware specific; so, to actually
display something, even once you figure out your solution, you'll want to refer to the programming documentation suitable for your environment. For example, writing to the display on a Commodore 64 is very different from an Atari 800, because the screens use different character sets and base addresses, and it's different still from Kowalski's 6502 simulator.
So, to repeat a question from before, it would be helpful to know which 6502 environment you are using.

Hum
Posted: Mon Nov 24, 2008 5:59 pm
by Amenofhis
Hum thanks but i download the document u gave me has 469 pages but i didnt find what i want a example like i got here because the program i use to emulate is call macroassambler & Emulartor from Michal Kalwaski
from this webpage
http://home.pacbell.net/michal_k/
im looking for a example same as i post before to start with.
Posted: Tue Nov 25, 2008 6:48 pm
by Nightmaretony
shit the bit across multiple screen locations in a smooth scroll.
I'm sure you mean SHIFT the bit
Phill.
thanks, no brain that morning...
lda #"N"
sta $0200
lda #"O"
sta $0201
lda #"B"
sta $0202
lda #"R"
sta $0203
lda #"A"
sta $0204
lda #"I"
sta $0205
lda #"N"
sta $0206
lda #"F"
sta $0207
lda #"O"
sta $0208
lda #"R"
sta $0209
lda #"T"
sta $020A
lda #"O"
sta $020B
lda #"N"
sta $020C
lda #"Y"
sta $020D
Re: I made this
Posted: Tue Nov 25, 2008 7:02 pm
by Nightmaretony
I made this prog but still is not the same of what i want. this is a decrease thing. i got to work im taking example from this but still not getting it.
.ORG $0200
DELAY:
LDX #$64
STX $0005
Img DEC $0005
PHP
JSR Dito1
PLP
BNE Img
RTS
Dito1:
LDX #$01
log2: LDY #$01
log1: DEY
BNE log1
DEX
PHP
JSR log3
PLP
BNE log2
log3:
LDX #$FF
STX $0010
micro2 DEC $0010
PHP
JSR mic2
PLP
BNE micro2
RTS
mic2:
LDX #$FF
log4: LDY #$FF
log5: DEY
BNE log5
DEX
BNE log4
RTS
ok, so what is the reasoning for using mic and log and micro for your routine labels?
Another Example
Posted: Sat Nov 29, 2008 8:09 am
by bgaarsoe
It may already be too late for you, but here is another short example with comments (Too bad about the formatting. Everything gets squished.

):
.ORG $200
XDELAY .EQU 155 ;THESE DETERMINE DELAY DURATION
YDELAY .EQU 155 ;FIDDLE WITH THESE TO GET THE RIGHT DELAY
ADELAY .EQU 5
SCREENMEM .EQU $7000 ;YOUR SCREEN MEM LOCATION
MAIN LDA #%10000000 ;STARTING BIT IMAGE
SHIFTRIGHT LDX #7 ;SHIFT COUNTER
SHIFTRIGHTLP STA SCREENMEM ;DISPLAY THE BIT PATTERN
JSR DELAY ;CALL DELAY ROUTINE
DEX
BEQ SHIFTLEFT
LSR A ;SHIFT THE BIT RIGHT
JMP SHIFTRIGHTLP
SHIFTLEFT LDX #7 ;SHIFT COUNTER
SHIFTLEFTLP STA SCREENMEM ;DISPLAY BIT PATTERN
JSR DELAY ;CALL DELAY ROUTINE
DEX
BEQ SHIFTRIGHT
ASL A ;SHIFT THE BIT LEFT
JMP SHIFTLEFTLP
DELAY PHA ;SAVE CURRENT REGISTER VALUES
TAY
PHA
TXA
PHA
LDA #ADELAY
YRESET LDY #YDELAY
XRESET LDX #XDELAY
XLOOP DEX
BNE XLOOP
DEY
BNE XRESET
SEC ;DECREMENT THE A REGISTER
SBC #1 ;NOTE: 65C02 HAS A "DEC A" COMMAND FOR THIS
BNE YRESET
PLA ;RESTORE ORIGINAL REGISTER VALUES
TXA
PLA
TYA
PLA
RTS
Posted: Sat Nov 29, 2008 8:18 am
by GARTHWILSON
(Too bad about the formatting. Everything gets squished.
Put [co de] and [/co de] around the section, removing the space I put in the middle to keep them from doing their thing. To make sure you got your spacing and vertical alignment the way you intended before posting, click "Preview".
Posted: Sat Nov 29, 2008 6:25 pm
by bgaarsoe
Thanks, Garth. It was too late to edit it, so here it is again:
Code: Select all
.ORG $8000
XDELAY .EQU 155 ;CONSTANTS: USED IN THE DELAY LOOP TO DETERMINE DELAY DURATION
YDELAY .EQU 155 ;FIDDLE WITH THESE TO GET THE RIGHT DELAY.
ADELAY .EQU 5
SCREENMEM .EQU $7000 ;THIS NEEDS TO BE YOUR SCREEN MEM LOCATION.
MAIN LDA #%10000000 ;STARTING BIT IMAGE
SHIFTRIGHT LDX #7 ;SHIFT COUNTER
SHIFTRIGHTLP STA SCREENMEM
JSR DELAY ;CALL DELAY ROUTINE
DEX
BEQ SHIFTLEFT
LSR A ;SHIFT THE BIT RIGHT
JMP SHIFTRIGHTLP
SHIFTLEFT LDX #7 ;SHIFT COUNTER
SHIFTLEFTLP STA SCREENMEM
JSR DELAY ;CALL DELAY ROUTINE
DEX
BEQ SHIFTRIGHT
ASL A ;SHIFT THE BIT LEFT
JMP SHIFTLEFTLP
;***** THREE-LEVEL DELAY LOOP--A=OUTER LOOP COUNTER, Y=MIDDLE LOOP COUNTER, X=INNER LOOP COUNTER ******
DELAY PHA ;SAVE THE CURRENT REGISTER VALUES ON THE STACK
TAY
PHA
TXA
PHA
LDA #ADELAY
YRESET LDY #YDELAY
XRESET LDX #XDELAY
XLOOP DEX
BNE XLOOP
DEY
BNE XRESET
SEC
SBC #1 ;NOTE: 65C02 HAS A "DEC A" COMMAND FOR THIS.
BNE YRESET
PLA ;RESTORE REGISTER VALUES FROM THE STACK
TXA
PLA
TYA
PLA
RTS
Posted: Sat Nov 29, 2008 6:50 pm
by GARTHWILSON
It was too late to edit it, so here it is again:
You should always be able to go back and edit your own posts, but you'll have to be logged in or the "Edit" button won't show.
Posted: Sun Nov 30, 2008 12:45 am
by bgaarsoe
It was too late to edit it, so here it is again:
You should always be able to go back and edit your own posts, but you'll have to be logged in or the "Edit" button won't show.
Thanks again, Garth.