| |
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.... |
| |
Oswald
Registered: Apr 2002 Posts: 5007 |
indexed labels is nice, lot of guys need that when creating selfmodded speedcode with macros :) |
| |
Raistlin
Registered: Mar 2007 Posts: 548 |
I was interested in trying out this assembler .. but .. trying to compile the source, I'm getting some problems..
On Windows, CMake is refusing to generate the compile_commands.json file ....
Anyone know what might be needed to get this compiling on Windows? |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
`compile_commands.json` are not needed for building, only for Intellisense features in editors such as Visual Studio Code. |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
The `dev` branch is where it's happening BTW.
The following is an example on how you can let the assembler "pre-render" sid register data for faster playback (like the Dane part in Edge of Disgrace):
!script "../lua/sid.lua"
data = load("../data/test.sid")
sid = sid_parse(data)
!section "music", sid.load
music:
!fill sid.data
%{
sid_data = nil
function generate_data()
map_bank_write(0xd4, 1, function(adr, val)
if sid_data then
table.insert(sid_data, adr - 0xd400)
table.insert(sid_data, val)
end
end)
start_run()
init = sym("sid.init")
play = sym("sid.play")
set_a(0)
call(init)
sid_data[#sid_data - 1] = sid_data[#sid_data - 1] | 0x80
for i=1,15*50 do
l = #sid_data
call(play)
if l ~= #sid_data then
sid_data[#sid_data - 1] = sid_data[#sid_data - 1] | 0x80
else
print("Silent frame")
end
end
end
function get_sid_data()
sid_data = {}
generate_data()
result = sid_data
sid_data = nil
return result
end
}%
!text "SID"
sid_data:
!fill get_sid_data()
|
| |
JackAsser
Registered: Jun 2002 Posts: 1987 |
Quote: The `dev` branch is where it's happening BTW.
The following is an example on how you can let the assembler "pre-render" sid register data for faster playback (like the Dane part in Edge of Disgrace):
!script "../lua/sid.lua"
data = load("../data/test.sid")
sid = sid_parse(data)
!section "music", sid.load
music:
!fill sid.data
%{
sid_data = nil
function generate_data()
map_bank_write(0xd4, 1, function(adr, val)
if sid_data then
table.insert(sid_data, adr - 0xd400)
table.insert(sid_data, val)
end
end)
start_run()
init = sym("sid.init")
play = sym("sid.play")
set_a(0)
call(init)
sid_data[#sid_data - 1] = sid_data[#sid_data - 1] | 0x80
for i=1,15*50 do
l = #sid_data
call(play)
if l ~= #sid_data then
sid_data[#sid_data - 1] = sid_data[#sid_data - 1] | 0x80
else
print("Silent frame")
end
end
end
function get_sid_data()
sid_data = {}
generate_data()
result = sid_data
sid_data = nil
return result
end
}%
!text "SID"
sid_data:
!fill get_sid_data()
Hehe, awesome! |
| |
Mr. SID
Registered: Jan 2003 Posts: 419 |
Yeah, you can do stuff like that with k2asm and Python too. Some of it is useful and other things are masturbatory coding... :) |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
Does k2asm also contain an emulator?
Otherwise I can't see how it can do this. |
| |
Mr. SID
Registered: Jan 2003 Posts: 419 |
No, but you can do pretty much anything in Python these days: https://github.com/docmarionum1/py65emu |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
Hot damn, there's PLA in play*. An actual mnemonic in a shitload of 'code'. |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
I have done several improvements now, including a built in "fantasy" text mode 6502 system.
This allows you to prototype program to run directly in the terminal.
Made a short & ugly screencast about it:
https://youtu.be/g1uuhz7Qupw
Manual is also coming along, and the "hardware" of the text mode system is documented at the end:
http://apone.org/bass/ |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 - Next |