User Tools

Site Tools


vbasic

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
vbasic [2020/09/04 03:17] – [VEND] silverdrvbasic [2022/11/24 09:40] (current) – [DLOFF] silverdr
Line 11: Line 11:
 Summing up - you will appreciate VBASIC for: Summing up - you will appreciate VBASIC for:
  
 +  * all the additions aimed at helping in low-level programming
 +  * fast-turnaround, zero boilerplate verification of VIC programming ideas
   * immediate full access to VASYL's power from within BASIC programs   * immediate full access to VASYL's power from within BASIC programs
   * lowest barriers to entry into VASYL programming and programming techniques development   * lowest barriers to entry into VASYL programming and programming techniques development
-  * fast-turnaround, zero boilerplate verification of VIC programming ideas 
   * verifying/debugging of VASYL code and display lists   * verifying/debugging of VASYL code and display lists
  
Line 24: Line 25:
 ====== Initialisation ====== ====== Initialisation ======
  
-As part of initialisation process VBASIC installs itself in the RAM area, address of which is normally occupied by BASIC ROM code, and adds additional routines at the very top of memory available for BASIC programs. It also verifies the presence of an installed BeamRacer card and activates it if found. Thanks to that your programs do not need to perform any additional steps to check and activate BeamRacer. Last but not least it adds helper routines and modifies several system variables and vectors in order to provide correct information about available memory and enable seamless experience with all the standard behaviour for STOP, STOP/RESTORE etc. working as usual, while actively maintaining both the VBASIC extension and BeamRacer active.+As part of initialisation process VBASIC installs itself in the RAM area, address of which is normally occupied by BASIC ROM code, and adds additional routines at the very top of memory available for BASIC programs. It also verifies the presence of an installed BeamRacer card and activates it if found. Thanks to that your programs do not need to perform any additional steps to check and activate BeamRacer. Last but not least it adds helper routines and modifies several system variables and vectors. This allows to provide correct information about available memory and enables seamless BASIC programming experience. As a result all the standard behaviour for STOP, STOP/RESTORE etc. remains unchanged, while actively maintaining both the VBASIC extension and BeamRacer active at the same time.
  
 ====== Features ====== ====== Features ======
Line 95: Line 96:
 PRINT 256& PRINT 256&
 PRINT 53248& PRINT 53248&
 +PRINT 16777215&
 </code> </code>
  
-the most appropriate one will be chosen automatically+the most appropriate one will be chosen automatically. Values up to 32-bit long are supported.
  
 ===== 16-bit PEEKs and POKEs ===== ===== 16-bit PEEKs and POKEs =====
Line 173: Line 175:
 which configures which configures
  
-  * PORT #0+  * Conveyor #0 (connected to VASYL PORT #0)
   * to point to VASYL memory address 0 ($0000)   * to point to VASYL memory address 0 ($0000)
   * with the default step of 1   * with the default step of 1
Line 237: Line 239:
   PRINT BL&W : REM PRINT IT AS 16-BIT HEXADECIMAL NUMBER   PRINT BL&W : REM PRINT IT AS 16-BIT HEXADECIMAL NUMBER
  
-==== VPEEK ==== +==== HI ==== 
-FUNCTION: Returns 8-bit value from <ADDRESSin currently selected bank of VASYL memory+FUNCTION: Returns "HI" byte (eight most significant bits) of <VALUEinterpreted as 16-bit unsigned integer
  
-__Synopsis__: ''VPEEK(<ADDRESS>)''+__Synopsis__: ''LO(<VALUE>)''
  
-__Examples__: +Where <VALUEis a number in the 16-bit unsigned int range0..65535
-  PRINT VPEEK($100) +
- +
-==== VDPEEK ==== +
-FUNCTION: Returns "double peek" value from <ADDRESS> in currently selected bank of VASYL memory +
- +
-__Synopsis__''VDPEEK(<ADDRESS>)''+
  
 __Examples__: __Examples__:
-  PRINT VDPEEK($100)&W+  PRINT HI(53281)&B
  
 ==== LO ==== ==== LO ====
Line 263: Line 259:
   PRINT LO(53280)&B   PRINT LO(53280)&B
  
-==== HI ==== +==== VDPEEK ==== 
-FUNCTION: Returns "HIbyte (eight most significant bits) of <VALUEinterpreted as 16-bit unsigned integer+FUNCTION: Returns "double peekvalue from <ADDRESSin currently selected bank of VASYL memory
  
-__Synopsis__: ''LO(<VALUE>)''+__Synopsis__: ''VDPEEK(<ADDRESS>)''
  
-Where <VALUEis a number in the 16-bit unsigned int range0..65535+__Examples__: 
 +  PRINT VDPEEK($100)&
 + 
 +==== VPEEK ==== 
 +FUNCTION: Returns 8-bit value from <ADDRESS> in currently selected bank of VASYL memory 
 + 
 +__Synopsis__''VPEEK(<ADDRESS>)''
  
 __Examples__: __Examples__:
-  PRINT HI(53281)&B+  PRINT VPEEK($100)
  
 ===== Statements only ===== ===== Statements only =====
Line 318: Line 320:
  
 __Examples__: __Examples__:
-  100 DLOFF : REM TURN DISPLAULIST EXECUTION OFF+  100 DLOFF : REM TURN DISPLAYLIST EXECUTION OFF
  
 ==== DLON ==== ==== DLON ====
Line 552: Line 554:
 __Synopsis__: ''RACER <NUM>'' __Synopsis__: ''RACER <NUM>''
  
-Where <NUM> can be 0, 1, 2 meaning+Where <NUM> can be 0, 1, 2, 3 meaning
   * 0 - BeamRacer inactive   * 0 - BeamRacer inactive
   * 1 - BeamRacer active but RUN/STOP-RESTORE combination deactivates it   * 1 - BeamRacer active but RUN/STOP-RESTORE combination deactivates it
   * 2 - BeamRacer active and automatically reactivated after every RUN/STOP-RESTORE (default)   * 2 - BeamRacer active and automatically reactivated after every RUN/STOP-RESTORE (default)
 +  * 3 - Disable VBASIC without changing BeamRacer status (VBASIC V1.2 and higher)
  
 __Examples__: __Examples__:
Line 588: Line 591:
 STATEMENT: Assembles [[:isa#badline|BADLINE <RASTERLINES>]] and stores the result in memory STATEMENT: Assembles [[:isa#badline|BADLINE <RASTERLINES>]] and stores the result in memory
  
-__Synopsis__: ''VBADLINE <RASTERLINES>''+__Synopsis__: ''VBADLINE [<RASTERLINES>''
   * RASTERLINES is a 3-bit integer number in the range 0..7   * RASTERLINES is a 3-bit integer number in the range 0..7
  
Line 602: Line 605:
   A = VBADLINE(3) : REM ASSEMBLE AND ASSIGN THE RESULT TO A VARIABLE   A = VBADLINE(3) : REM ASSEMBLE AND ASSIGN THE RESULT TO A VARIABLE
  
 +__Discussion__: The command sets the vertical scroll bits in VIC-II ''SCROLY'' register to a calculated value that will trigger badline on requested positive, vertical offset from the current rasterline. It does NOT delay displaylist execution
 ==== VBRA ==== ==== VBRA ====
 ---- ----
-DISPLAYLIST: Continue Display List execution at offset <OFFSET>+DISPLAYLIST: Continue Display List execution at address <address>
  
-STATEMENT: Assembles [[:isa#bra|BRA <OFFSET>]] and stores the result in memory+STATEMENT: Assembles [[:isa#bra|BRA <ADDRESS>]] and stores the result in memory
  
-__Synopsis__: ''VBRA <OFFSET>''+__Synopsis__: ''VBRA <ADDRESS>|*<OFFSET>'' 
 +  * ADDRESS is a memory address within the -128..127 range from the current one
   * OFFSET is an 8-bit signed number from range -128..127   * OFFSET is an 8-bit signed number from range -128..127
  
Line 621: Line 626:
 999 VEND 999 VEND
 </code> </code>
-FUNCTION: TBD 
  
 +<code basic [highlight_lines_extra="2"]>
 +[...]
 +200 VBRA 100 : REM CONTINUE AT ADDRESS $64
 +999 VEND
 +</code>
  
 +<code basic [highlight_lines_extra="2"]>
 +[...]
 +200 VBRA *-2 : REM INFINITE LOOP
 +999 VEND
 +</code>
 +FUNCTION: Returns assembled [[:isa#bra|BRA <OFFSET>]]
 +
 +__Synopsis__: ''VBRA(*<OFFSET>)''
 +
 +__Examples__:
 +  A = VBRA(*+10): REM ASSEMBLE AND ASSIGN THE RESULT TO A VARIABLE
 +  
 +__Discussion__: While it is technically possible to use VBRA(<ADDRESS>) notation also in function mode, it is not very useful.
 ==== VDECA ==== ==== VDECA ====
 ---- ----
Line 637: Line 659:
 110 VWAIT $33,0  : REM WAIT FOR FIRST PAPER LINE 110 VWAIT $33,0  : REM WAIT FOR FIRST PAPER LINE
 120 VSETA 12     : REM TWELVE TIMES 120 VSETA 12     : REM TWELVE TIMES
-130 VLABEL A%    : REM LOOP CODE BEGINS HERE+130 LABEL A%     : REM LOOP CODE BEGINS HERE
 140 VMOV $21, 14 : REM LIGHT BLUE 140 VMOV $21, 14 : REM LIGHT BLUE
 150 VDELAYV 8    : REM DELAY EIGHT RASTERLINES 150 VDELAYV 8    : REM DELAY EIGHT RASTERLINES
vbasic.1599214664.txt.gz · Last modified: 2020/09/04 03:17 by silverdr