65Org16 Assembler (16-bit bytes, 32-bit address space)

Programming the 6502 microprocessor and its relatives in assembly and other languages.
teamtempest
Posts: 443
Joined: 08 Nov 2009
Location: Minnesota
Contact:

Post by teamtempest »

Quote:
(I can't say how pleased I was to discover that on linux I did
Code:
./HXA_TW.EXE pi.asm

and by happening to have WINE installed it "just worked" - your assembler is cross-platform after all.)
It's always nice to have one's favorite programming environment available, isn't it? That's probably why I'm still fooling around with Thompson AWK in the first place!
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Post by ElEctric_EyE »

I have noticed when using Bitwise's assembler, the org. starts at $FFFFF000 but the .bin file is 8K long meaning the org. is really $FFFFE000. When I try to change the .org to $FFFFE000 there are all zero's. Can someone confirm this?
Not really a huge deal at this point as I can change the reset vector in my hex editor, but something is skewed...
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Post by ElEctric_EyE »

ElEctric_EyE wrote:
I have noticed when using Bitwise's assembler, the org. starts at $FFFFF000 but the .bin file is 8K long meaning the org. is really $FFFFE000. When I try to change the .org to $FFFFE000 there are all zero's. Can someone confirm this?
Not really a huge deal at this point as I can change the reset vector in my hex editor, but something is skewed...
My mistake, I forgot. It's 4Kx16. Not 8Kx8. My hex editor confuses me, even though I have it set up to display 16-bit data, it still thinks in terms of 8-bits, so the offsets are wrong. I guess I have no need for the hex editor now...
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Post by BitWise »

ElEctric_EyE wrote:
I have noticed when using Bitwise's assembler, the org. starts at $FFFFF000 but the .bin file is 8K long meaning the org. is really $FFFFE000. When I try to change the .org to $FFFFE000 there are all zero's. Can someone confirm this?
Not really a huge deal at this point as I can change the reset vector in my hex editor, but something is skewed...
4K of 16 bit bytes = 8K of 8 bit bytes

Edit: Ah I see you got there. Thats the problem with leaving IE open and going off to meetings
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Post by ElEctric_EyE »

Bitwise, how do we define Labels in your assembler?
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Post by BitWise »

ElEctric_EyE wrote:
Bitwise, how do we define Labels in your assembler?

Code: Select all

SomeLabel
Or

Code: Select all

SomeLabel:
You can also have local labels (which can be reused elsewhere) provided they follow a global label

Code: Select all

GlobalLabel:
  LDX #10
.Loop DEX
  BNE .Loop
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Post by ElEctric_EyE »

I've used local labels. I was able to see how you used them in your example boot program. They work as long as they're longer then 1 letter...

But I am trying to do something like:

Code: Select all

   .CODE
	.ORG	$FFFFF000
	
	dcom = $FFFF0010
	ddat = $FFFF0011

CLRSCR:	PHA
		TXA
		PHA
		TYA
		PHA
		LDA #$2a	;set x address
		STA dcom
		LDA #$00	;start
		STA ddat 
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Post by BitWise »

Looks like you are trying to define some 'equates'. So either

Code: Select all

dcom = $FFFF0010 
ddat = $FFFF0011 
or

Code: Select all

dcom .EQU $FFFF0010 
ddat .EQU $FFFF0011 
No spaces before the symbol name.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Post by ElEctric_EyE »

No spaces. That worked...

Your program automatically converts a 6502 program to 65Org16? It sure seems like it does after copying and pasting a short 6502 routine I wrote using MK's assembler.
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Post by BitWise »

ElEctric_EyE wrote:
No spaces. That worked...

Your program automatically converts a 6502 program to 65Org16? It sure seems like it does after copying and pasting a short 6502 routine I wrote using MK's assembler.
I built the 65Org16 assembler from the same Java source as my 6502 family assembler. Its uses the same parser but I stripped out support for device switching (.6502, .65C02, .65816) and extended byte to be 16-bits through out.

So if you feed it vanilla 6502 source it will come out as 16-bit code.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Post by ElEctric_EyE »

Excellent!

Would it be too much trouble to increase the size of the boot.asm file to 8Kx16? The reason I ask is because I have 3 assemblers/disassemblers I'm looking at, and 2 of the 3 top out at 4Kx8. I'm looking to convert Micromon-64, Supermon-64, and/or Hashmon for my project.
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Post by BitWise »

ElEctric_EyE wrote:
Excellent!

Would it be too much trouble to increase the size of the boot.asm file to 8Kx16? The reason I ask is because I have 3 assemblers/disassemblers I'm looking at, and 2 of the 3 top out at 4Kx8. I'm looking to convert Micromon-64, Supermon-64, and/or Hashmon for my project.
Just change the start address for your code in the source file (e.g. .ORG $FFFFE000) and the linker options to reflect the new code area

Code: Select all

LK65_FLAGS = \
	-bss $$00010000-$$EFFFFFFF -code $$FFFFE000-$$FFFFFFFF
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Post by ElEctric_EyE »

Thanks for the quick reply.
How does one go about changing the linker file/options?
I tried pasting that code in the assembly and it's giving some exceptions.
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Post by BitWise »

ElEctric_EyE wrote:
Thanks for the quick reply.
How does one go about changing the linker file/options?
I tried pasting that code in the assembly and it's giving some exceptions.
The linker options are in the makefile
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
ElEctric_EyE
Posts: 3260
Joined: 02 Mar 2009
Location: OH, USA

Post by ElEctric_EyE »

I see it. Thank You. :D
Post Reply