Posted By
George on 2011-09-11 16:36:03
| Re: Draw a single pixel in assembler
Hi gerliczer, Yes, it helped. thank you very much. I think this init will be standard for my examples..
Another question: This is the Code from Csabo which draws the one pixel ; draw a pixel at 160, 100 (center) LDX #160 LDY #100 JSR drawpixel
; ################################################# drawpixel TXA AND #$07 STA tempx+1 ; TXA AND #$F8 STA ptr LDA #$00 STA ptr+1 ; TYA AND #$07 STA tempy+1 ; TYA ; y=y/8 AND #$F8 LSR a LSR a LSR a ASL a ; y=y*2 TAY LDA ptr CLC ADC mul320,y STA ptr LDA ptr+1 ADC mul320+1,y CLC ADC #$20 STA ptr+1
after that i try to make a loop for a line from x=1 to 200, which does not work. What i am doing wrong? Can i compare X or Y register direct with a value? LDX #1 LDY #100 loop01 ; loop JSR drawpixel INX TXA AND #200 BNE loop01
|