Help i need to create a program and i dont know how
I made this
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
.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
Amenofhis wrote:
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
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
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.
from this webpage http://home.pacbell.net/michal_k/
im looking for a example same as i post before to start with.
-
Nightmaretony
- In Memoriam
- Posts: 618
- Joined: 27 Jun 2003
- Location: Meadowbrook
- Contact:
phillhs wrote:
Nightmaretony wrote:
shit the bit across multiple screen locations in a smooth scroll.
Phill.
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
"My biggest dream in life? Building black plywood Habitrails"
-
Nightmaretony
- In Memoriam
- Posts: 618
- Joined: 27 Jun 2003
- Location: Meadowbrook
- Contact:
Re: I made this
Amenofhis wrote:
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
.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?
"My biggest dream in life? Building black plywood Habitrails"
Another Example
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
.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
Last edited by bgaarsoe on Fri Dec 19, 2008 5:58 am, edited 1 time in total.
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
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
Last edited by bgaarsoe on Fri Dec 19, 2008 6:01 am, edited 4 times in total.
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact: