User Tools

Site Tools


introduction_to_programming_the_beamracer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
introduction_to_programming_the_beamracer [2020/09/05 00:04] laubzegaintroduction_to_programming_the_beamracer [2020/10/08 14:45] – [Local Memory] laubzega
Line 67: Line 67:
  LDA #$20  LDA #$20
  STA VREG_ADR0H  STA VREG_ADR0H
- LDA #$01 ; advance LRAM pointer by one on every transfer+ LDA #$01 ; advance LRAM pointer by one after every transfer
  STA VREG_STEP0  STA VREG_STEP0
  LDX #0  LDX #0
Line 144: Line 144:
  
 <code vasyl> <code vasyl>
-dlist: 
     WAIT  48,13     WAIT  48,13
     MOV $20, 1     MOV $20, 1
Line 151: Line 150:
     MOV $20, 0     MOV $20, 0
     END         ; this is a handy alias for instruction "WAIT 511,63"     END         ; this is a handy alias for instruction "WAIT 511,63"
-dlend: 
 </code> </code>
  
Line 163: Line 161:
  
 <code vasyl> <code vasyl>
-dlist: 
     WAIT  48, 0     WAIT  48, 0
     MOV $20,15     MOV $20,15
Line 171: Line 168:
     MOV $20,15     MOV $20,15
     END     END
-dlend: 
 </code> </code>
  
Line 178: Line 174:
  
 <code vasyl> <code vasyl>
-dlist: 
     WAIT    48, 0 ; starting line     WAIT    48, 0 ; starting line
     MOV    $20,15     MOV    $20,15
Line 186: Line 181:
     MOV    $20,15     MOV    $20,15
     END     END
-dlend: 
 </code> </code>
  
Line 212: Line 206:
  
 <code vasyl> <code vasyl>
-dlist: 
     WAIT    48, 0 ; starting line     WAIT    48, 0 ; starting line
 loop:     loop:    
Line 225: Line 218:
     BRA    loop         ; loop endlessly     BRA    loop         ; loop endlessly
     END                 ; never reached     END                 ; never reached
-dlend: 
 </code> </code>
  
Line 249: Line 241:
 To make a counter run, we now need to use instruction "[[isa#DECA|DECA]]" for counter A, or "[[isa#DECB|DECB]]" for counter B. What it does is a bit more complicated - first, it checks if the value held by respective counter is equal to "0", and if it is, it skips the next two bytes of the display list (which usually is how much space the next instruction occupies). If the value in the counter is anything else than zero, the instruction decrements it by one, and then continues normally. \\ This is best illustrated building on the previous example, with newly added lines highlighted. To make a counter run, we now need to use instruction "[[isa#DECA|DECA]]" for counter A, or "[[isa#DECB|DECB]]" for counter B. What it does is a bit more complicated - first, it checks if the value held by respective counter is equal to "0", and if it is, it skips the next two bytes of the display list (which usually is how much space the next instruction occupies). If the value in the counter is anything else than zero, the instruction decrements it by one, and then continues normally. \\ This is best illustrated building on the previous example, with newly added lines highlighted.
  
-<code vasyl [highlight_lines_extra="3,13"]> +<code vasyl [highlight_lines_extra="2,12"]>
-dlist:+
     WAIT    48, 0 ; starting line     WAIT    48, 0 ; starting line
     SETA              ; load 3 to counter 0     SETA              ; load 3 to counter 0
Line 265: Line 256:
     BRA    loop         ; will be skipped when counter 0 reaches 0     BRA    loop         ; will be skipped when counter 0 reaches 0
     END     END
-dlend: 
 </code> </code>
  
introduction_to_programming_the_beamracer.txt · Last modified: 2021/09/10 01:49 by silverdr