Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !cpu 65EL02
- !to "disk_62dff8faf7932713.img",plain ;type the name of your output img file here
- *=0x500 ;set offset to 0x500
- CLC ;clear carry flag
- XCE ;set emulation flag
- REP #$30 ;set to 16bit mode
- !al ;need this to make accumulator 16bit
- LDA #$1 ;map device 1 (monitor) to redbus window
- MMU #$0
- LDA #$300 ;set redbus window offset to 0x300
- MMU #1
- MMU #2 ;enable redbus
- LDA #$400 ;set external memory mapped window to 0x400
- MMU #$3
- MMU #$4 ;enable external memory mapped window
- LDA #$500 ;Set POR to 0x500
- MMU #$6
- .display ;setup display registers
- LDA #$0
- STA $308 ;set blit x start to 0
- STA $309 ;set blit y start to 0
- STA $30A ;set blit x offset to 0
- STA $30B ;set blit y offset to 0
- LDA #$50 ;set blit width to 50
- STA $30C
- LDA #$32 ;set blit height to 32
- STA $30D
- LDA #$3 ;set blit mode to shift
- STA $307
- LDA #$00 ;set memory access row to 1
- STA $300
- SEP #$30 ;switch to 8bit mode
- !as ;need this to switch back accumulator to 8bit mode
- .main ;start of program
- CLC
- LDA #$20 ;store ASCII Space in varible
- STA $01
- LDA #$01 ;store current memory access to varible
- STA $05
- LDX #$00 ;reset X to 0
- .clear ;clear the screen
- .loop LDA $01 ;load string character + x to accumulator
- CPX #$60 ;check if string has reached the end
- BEQ .row_end ;if string reached the end branch to next + sign
- STA $310, X ;print character into display memory + X
- INX ;increment X to move one character forward
- JMP .loop ;print next character
- .row_end LDX #$00 ;reset X to 0
- LDA $05
- CMP #$32
- BEQ .clear_end
- INC $05
- LDA $05
- STA $300
- JMP .loop
- .clear_end LDA #$00
- STA $03
- STA $300
- .writer ;start writer program
- LDX #$00 ;reset X
- .buffer LDY $305 ;checks if buffer is empty
- CPY
- BEQ .buffer
- .end STP ;crash and burn
- !fi 128, $00 ;fill disk with 0's to make the disk at least 128bytes
Add Comment
Please, Sign In to add comment