Commodore 64 Assembler for Windows!

W64Asm Help

Version 1.0 Beta

8-5-06
----------------------------------------------------------------------------------------------
File.

New Source.				Creates a new source for editing.
Load Source.				Loads a source for editing,.txt or .asm
Merge Source Into File.			Merge a source file in to editor at current postion.
Merge Prg Into Source.			Merge a Prg file into editor as data statments
Merge Binary Into Source.			Merge a binary file into editor as data statments
Save Source.				Save the current source file,.txt or .asm
Save Selected Text.			Save the selected text as a source file,.txt or .asm
Quit.					Leave the assembler.
----------------------------------------------------------------------------------------------
Edit.

Undo.					Undo last action.
Redo.					Redo last action.	
Cut.					Cut the selected text to system clipboard.
Copy.					Copy the selected text to system clipboard.
Paste.					Paste the current contents of clipboard to editor.
Select All.					Selects all the text in editor.
Select Text Colour.				Select a new text colour.	
Select Background Colour.			Select a new background colour.
Select Font				Select a new font for use in editor.

----------------------------------------------------------------------------------------------
Assemble.

Assemble Into Prg				Assemble current source into a prg file.
Assemble Into P00				Assemble current source into a p00 file.
----------------------------------------------------------------------------------------------
Help.

Help.					This.
C64 Memory Map.				Display a c64 Memory Map.
----------------------------------------------------------------------------------------------


Using the assembler.

The start address should be set as follows.

*=$0800 or *=2048
----------------------------------------------------------------------------------------------

Comments.

All text found to the right of a semi colon ; will be ignored.

	lda #$ff	;load 255 into a



----------------------------------------------------------------------------------------------

Labels Should have either a space or tab after them,and not be a op name(LDA Ect).
Labels should be placed against either an instruction or a byte/word/text/dword data type.

start	lda #0
Label	rts


*=$0800		;set start at $0800



ipcvalue	byte $ff	;set a label against a byte/data value

	clc		;code start
	lda ipcvalue	;load value that label is marked against,in this case $ff,255


	ldx 0		;copy values
loop	lda table,x
	sta $c000,x
	inx
	cmp 0
	bne loop
	rts
;
table	byte 1,2,3,0

PLEASE NOTE

Do not use TEXT,WORD,DBYTE,BYTE as lables such as


	ldx #$00
back	lda text,x
	sta $c000,x
	inx
	bne back
	rts
;
	text "abc"
;

Much better

	ldx #$00
back	lda tdat,x
	sta $c000,x
	inx
	bne back
	rts
;
tdat	text "abc"
;
----------------------------------------------------------------------------------------------

Variables should be defined such as.

val=1		Decimal
val=$1		hex
val=%00000001	binary
val="a"		ascii
val=`a`		screen code,this only works for a-z and a few others

Or you can do somting like

value=$d015

lda 0
sta value

will be 

lda 0
sta $d015


Or 

Base=49152

	lda 0
	tax
loop	sta base,x
	inx
	bne loop
	rts

Should be

	lda 0
	tax
loop	sta $c000
	inx
	bne loop
	rts

If you want to access a zero page location just do

val=1

lda val
ora 1
sta val

will be

lda $01
ora #$01
sta $01

if you define variables 

a=1
Or
a=$1
Or
a=%00000001

and then you do

lda a
sta a

it will be the same as

lda $01
sta $01

if you wish your variables to have the same effect as an immidiate load (LDA #$ff)
when you define the variable simple preceed with a hash,such as

a=#$ff
Or
a=#255
Or
a=#%11111111

lda a		
will be

lda #$ff	(immidiate)




----------------------------------------------------------------------------------------------
Data values.

Byte,word supported

8 bit data can be entered as follows.

byte 0,1,2,3,4,5		decimal
byte $ff,$ff		hex
byte %00001111,%00001111	binary

You can mix such as

byte "a",123,$ff,`d`,%00001111

Or
text "a","b"		ascii character
text `a`,`b`		screen display code


But if using a string of chars,please only use 1 string per line(To be fixed)
text "abcdef"		string of ascii--only use 1 string per line
text `abcdef` 		string of screen codes--only use 1 string per line




Also highbyte/lowbyte finding.

byte >4096 =16		highbyte 	
byte <$ff0a=10		lowbyte
byte >4096 =16



Also supports 16 bit word values

word %1111111100000001
word 53280
word $c000

Or if you enter 

word $ff

This will be placed in memeory as $ffff

Also supports dbyte values

dbyte $ff01

will be stored in reverse order as

$01,$ff



----------------------------------------------------------------------------------------------
Including other files.


include "file.txt"

This will include another source file at assemlbe time,must be in same dir/folder as W64asm

include ""

This will include another source file at assemlbe time,but will open a requester
allowing you to chose which file to include.

includebinary "file.bin" will include a binary file,that must be in same dir/folder.

includebinary "" opens a requester for binary file include.

includeprg "file.prg" will include a PRG file,that must be in same dir/folder.
(Please not the first to bytes that hold the file`s start address will not be included).

includeprg ""

This will open a requester allowing you to choose a PRG file to include.
(Please not the first to bytes that hold the file`s start address will not be included).




----------------------------------------------------------------------------------------------

finding highbyte/lowbyte

a=$09ff

lda >a
ldx start
	ldx