| |
Sasq
Registered: Apr 2004 Posts: 155 |
Badass - New 6502 Assembler
The last couple of months I've created a new 6502 Assembler called bass (or Badass).
The basic idea is for it to be as advanced as Kickassembler, but with a less complex, more unified syntax.
And it also has unit tests in an internal emulator.
You can find it at https://github.com/sasq64/bass
I've started a tutorial here: http://apone.org/bass/part1.html
Here is an example C64 source http://apone.org/bass/example.asm.html |
|
... 106 posts hidden. Click here to view all posts.... |
| |
JackAsser
Registered: Jun 2002 Posts: 1989 |
Quote: Well NoStore should be implied in any non-leaf section now.
It means it will not be any data in the section.
Yup, I guessed as much. You really need output directives to root sections also, i.e. to what file they should be emitted. |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
Sure, that already works. Although I need to allow file ouput section to overlap I guess. |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
Here is the new Section documentation (and other meta commands):
https://github.com/sasq64/bass/blob/new-sections/docs/META.md |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
Beta4 update. Changes include:
* Indexed labels, for accessing labels inside macros and rept statements
* New section system, child sections etc
* Unicode strings
* !check for runtime asserts in 6502 code
* Better error reporting
https://github.com/sasq64/bass/releases |
| |
Frantic
Registered: Mar 2003 Posts: 1627 |
Good work there, sir! I didn't manage to build bass on my MacOS 10.13 system though, due to various errors when compiling. Too bad. |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
Yes Apples clang still lacks many C++17 features. I'll see what I can do... |
| |
Boogaloo
Registered: Aug 2019 Posts: 21 |
I'm following this with great interest. I'll try it out soonish. Great work so far!
(And I agree with JackAsser about the clean C++ code.) |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
OK, removed shared_ptr<T[]> which is not supported by OSX yet it seems, should build now. |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
@Boogaloo Thanks! |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
Here is an example of indexed labels and unit testing, based
on a snippet from Trash that wanted this feature;
; constant D011VALUE == value in d011
D011VALUE = 0
!macro DrawRasterColors(row) {
!if (row & 7) == (D011VALUE & 7) {
; 23 cycle macro
col[row]:
lda #0 ; 2
sta $d020 ; 6
sta $d021 ; 10
!rept 5 { nop }
bit $ea ; 23
} else {
;63 cycle macro
col[row]:
lda #0 ; 2
sta $d020 ; 6
sta $d021 ; 10
!rept 25 { nop }
bit $ea ; 63
}
}
!section "main", $c000
!rept 6*8 {
DrawRasterColors(i + $40)
}
!test "bad" {
DrawRasterColors(0)
}
!assert tests.bad.cycles == 23
!test "good" {
DrawRasterColors(1)
}
!assert tests.good.cycles == 63
!test "modify" {
lda #9
sta col[$40]+1
lda #8
sta col[$41]+1
}
!assert tests.modify.ram[$c001] == 9
!assert tests.modify.ram[$c010] == 8
|
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 - Next |