SPO600 Lab2 - 6502 조립언어 실습실
소스 코드
LDA #$00 ; set a pointer at $40 to point to $0200
STA $40
LDA #$02
STA $41
LDA #$05 ; colour number: green
LDY #$00 ; set index to 0
; draw green line at the top of the bitmap screen
top:
STA ($40),y ; set pixel at the address (pointer)+Y
INY ; increment index
CPY #$20 ;
BNE top ; continue until done the page
LDA #$05 ; set page to 5
STA $41 ;
LDA #$06 ; colour number: blue
LDY #$E0 ; set index to starting index of last line in pg.5
; draw blue line at the bottom of the bitmap screen
bottom:
STA ($40),y ; set pixel at the address (pointer)+Y
INY ; increment index
CPY #$00 ;
BNE bottom ; continue until done the page
LDA #$02 ; set page to 2
STA $41 ;
LDY #$00 ; set index to starting index of pg.2
; draw yellow line to the left and
; purple line to the right of the bitmap screen
sides:
CLC ; clear carry to prevent accumulating of a value
LDA #$07 ; colour number: yellow
STA ($40),y ; set pixel at the address (pointer)+Y
TYA ; transfer y to a
ADC #$1F ; increment memory (a) by 1f (32 in hex = 1 line)
TAY ; transfer a to y
LDA #$04 ; colour number: purple
STA ($40),y ; set pixel at the address (pointer)+Y
INY ; increment y (to first index of next line)
CPY #$00 ;
BNE sides ; continue until done the page
INC $41 ; increment 1 page
LDX $41 ; get current page number
CPX #$06 ; compare with 6
BNE sides ; continue until done the page
테두리를 그리는 과정을 세 부분으로 나누었습니다.
Reference
이 문제에 관하여(SPO600 Lab2 - 6502 조립언어 실습실), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/joycew414/spo600-lab2-6502-assembly-language-lab-384텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)