Guest User

Untitled

a guest
Aug 30th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 !cpu 65EL02
  2.                 !to "disk_62dff8faf7932713.img",plain       ;type the name of your output img file here
  3.                 *=0x500                                     ;set offset to 0x500
  4.  
  5.                 CLC                                         ;clear carry flag
  6.                 XCE                                         ;set emulation flag
  7.                 REP #$30                                    ;set to 16bit mode
  8.                 !al                                         ;need this to make accumulator 16bit
  9.  
  10.                 LDA #$1                                     ;map device 1 (monitor) to redbus window
  11.                 MMU #$0
  12.                 LDA #$300                                   ;set redbus window offset to 0x300
  13.                 MMU #1
  14.                 MMU #2                                      ;enable redbus
  15.  
  16.                 LDA #$400                                   ;set external memory mapped window to 0x400
  17.                 MMU #$3
  18.                 MMU #$4                                     ;enable external memory mapped window
  19.  
  20.                 LDA #$500                                   ;Set POR to 0x500
  21.                 MMU #$6
  22.  
  23. .display                                                    ;setup display registers
  24.                 LDA #$0
  25.                 STA $308                                    ;set blit x start to 0
  26.                 STA $309                                    ;set blit y start to 0
  27.                 STA $30A                                    ;set blit x offset to 0
  28.                 STA $30B                                    ;set blit y offset to 0
  29.  
  30.                 LDA #$50                                    ;set blit width to 50
  31.                 STA $30C
  32.                 LDA #$32                                    ;set blit height to 32
  33.                 STA $30D
  34.  
  35.                 LDA #$3                                     ;set blit mode to shift
  36.                 STA $307
  37.                
  38.                 LDA #$00                                     ;set memory access row to 1
  39.                 STA $300
  40.  
  41.                 SEP #$30                                    ;switch to 8bit mode
  42.                 !as                                         ;need this to switch back accumulator to 8bit mode
  43.  
  44. .main                                                       ;start of program
  45.                 CLC
  46.                 LDA #$20                                    ;store ASCII Space in varible
  47.                 STA $01
  48.                 LDA #$01                                    ;store current memory access to varible
  49.                 STA $05
  50.                 LDX #$00                                    ;reset X to 0
  51. .clear                                                      ;clear the screen
  52. .loop           LDA $01                                     ;load string character + x to accumulator
  53.  
  54.                 CPX #$60                                    ;check if string has reached the end
  55.                 BEQ .row_end                                ;if string reached the end branch to next + sign
  56.  
  57.                 STA $310, X                                 ;print character into display memory + X
  58.                 INX                                         ;increment X to move one character forward
  59.  
  60.                 JMP .loop                                   ;print next character
  61.                
  62. .row_end        LDX #$00                                    ;reset X to 0
  63.                
  64.                 LDA $05
  65.                 CMP #$32
  66.                 BEQ .clear_end
  67.                
  68.                 INC $05
  69.                 LDA $05
  70.                 STA $300
  71.                 JMP .loop
  72.                
  73. .clear_end      LDA #$00
  74.                 STA $03
  75.                 STA $300
  76.              
  77. .writer                                                     ;start writer program
  78.                 LDX #$00                                    ;reset X
  79.  
  80. .buffer         LDY $305                                    ;checks if buffer is empty
  81.                 CPY
  82.                 BEQ .buffer
  83.                
  84.                
  85. .end            STP                                         ;crash and burn
  86.                 !fi 128, $00                                ;fill disk with 0's to make the disk at least 128bytes
Add Comment
Please, Sign In to add comment