Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
  You are not logged in - nap
Pas6502   [2018]

Released by :
Syntax Error Software

Release Date :
20 December 2018

Type :
Other Platform C64 Tool

Website :
https://bitbucket.org/paul_nicholls/pas6502/src/master/

User rating:awaiting 8 votes (8 left)

Credits :
Code .... Syntax Error Software

Download :

Look for downloads on external sites:
 Pokefinder.org


Summary
Submitted by bugjam on 15 November 2019
From Bitbucket:

Welcome to Pas6502 (designed and written by Paul Nicholls (twitter.com/syntaxerrorsoft), a compiler that takes code using a dialect of Object Pascal and outputs a 6502 program by utilising the Kick Assembler cross-assembler program.

Pas 6502 setup:
To use Pas6502, you need to:

1) Download Kick Assembler from here and extract to a folder on your hard drive. http://theweb.dk/KickAssembler/Main.html

2) Download the WinVICE Commodore emulator from here and extract to a folder on your hard drive. http://vice-emu.sourceforge.net/

3) Download the Exomizer packing program from here and extract to a folder on your hard drive https://bitbucket.org/magli143/exomizer/wiki/Home

4) Run Pas6502 and configure it to point to the files it asks for.

Look in the Pas6502\projects folder for some quick and rough example projects (not much at the moment...).

The Pas6502\imports folder contains the required .asm files for the compiler and the first bare-bones c64.pas file..

TODO:
allow de-referencing PByte/PInteger variables in the right-hand side of expressions...currently only on left-hand side.
Pas6502 types:
8-bit integers (byte)
16-bit signed integers (integer).
boolean values.
pByte - pointer to a byte value; only can be used to assign to at this point, not read from.
pInteger - pointer to an integer value; only can be used to assign to at this point, not read from.
arrays (lower bound must start with 0)
type definitions - can use simple record types like so (no arrays as record parameters).
Type TMyType = record a : Byte; b : Integer; end;

Binary data:
You can import binary data as inizialized constants like so:

const sprites : LoadBinary('miniMIKE_sprites.bin',<address>);

<address> is optional. If not included, then the data will appear at that spot in the program. Otherwise, the binary data will be loaded at the included address.

The binary inizialized constant includes .size and .address parameters for reading data from it.

// copy sprite data i := 0; while i < sprites.size do begin Poke(SpriteDataAddress + i,Peek(sprites.address + i)); Inc(i); end;

Procedures:
Procedures are supported, but recursive routines won't work and you can't have parameters yet.

Built-in routines:
Poke(address,value) - write 8-bit value to memory location (truncates to 8-bit)
Poke16(address,value) - write 16-bit value to memory location (lsb, msb)
Inc(value,increment) - increment a variable [increment is parsed, but ignored right now].
Dec(value,increment) - decrement a variable [increment is parsed, but ignored right now].
SetupInterrupt(procedure name) - set the standard irq vectors to point to that procedure (must have Interrupt declaration at the end of the definition).
SetupRasterInterrupt(procedure name,raster line) - set the standard irq vectors to point to that procedure and setup raster interrupts to trigger on raster line (must have RasterIRQ declaration at the end of the definition).
IrqEnd(procedure name,raster line) - required at the end of a Raster IRQ routine if you want it to re-trigger on a raster line (or even go to a different routine entirely).
Expression syntax and internals:
Internally, booleans are (False = 0, True = -1), but basically anything <> 0 will equate to True as well (similar to C/C++) which could come in handy sometimes.

For normal Pascal syntax useage, this is not needing to be known.

You can stick with Pascal syntax for expressions like so:

b := (a <> True);

if (not b or not a) and (x < y) and () then ...

It is also entirely possible to mix types (integer/boolean) in equations. This can come in handy for extra tricky code like:

The Delta Dirac function: -(x=0)
The absolute value function: x(1+2(x<0))
Search CSDb
Advanced
Navigate
Prev - Random - Next
Detailed Info
· Summaries (1)
· User Comments
· Production Notes
Fun Stuff
· Goofs
· Hidden Parts
· Trivia
Forum
· Discuss this release
Support CSDb
Help keep CSDb running:



Funding status:




About this site:
CSDb (Commodore 64 Scene Database) is a website which goal is to gather as much information and material about the scene around the commodore 64 computer - the worlds most popular home computer throughout time. Here you can find almost anything which was ever made for the commodore 64, and more is being added every day. As this website is scene related, you can mostly find demos, music and graphics made by the people who made the scene (the sceners), but you can also find a lot of the old classic games here. Try out the search box in the top right corner, or check out the CSDb main page for the latest additions.
Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.293 sec.