Skip to content

Commit

Permalink
Renamed a few badass -> bass
Browse files Browse the repository at this point in the history
Fixed Makefile
  • Loading branch information
Jonas Minnberg committed Jun 6, 2020
1 parent 6f44443 commit b114875
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build/
*.def
.vscode/
cmake-*/
compile_commands.json
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10)
project(badass VERSION 0.5)
project(bass VERSION 0.5)

set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -33,8 +33,8 @@ target_compile_options(badlib PRIVATE ${WARN})
target_include_directories(badlib PRIVATE external/peglib PUBLIC src)
target_link_libraries(badlib PRIVATE lua sol2::sol2 lodepng fmt coreutils ${THREAD_LIB})

add_executable(badass main.cpp)
target_link_libraries(badass PRIVATE coreutils badlib CLI11::CLI11)
add_executable(bass main.cpp)
target_link_libraries(bass PRIVATE coreutils badlib CLI11::CLI11)

add_executable(tester testmain.cpp asmtest.cpp symtest.cpp)
target_link_libraries(tester PRIVATE coreutils fmt badlib)
Expand Down
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@

all :
make -C build -j
all : debug

build/cmake_install.cmake :
rm -rf builds/debug
cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=ReleaseDebug

compile_commands.json : build/compile_commands.json
rm -f compile_commands.json
ln -s builds/debug/compile_commands.json .

debug : build/cmake_install.cmake compile_commands.json
cmake --build build -- -j8

test : all
build/tester

main.prg : asm/test.asm build/badass
build/badass -i asm/test.asm

run: main.prg
../x16-emulator/build/x16-emu -rom rom.bin -prg result.prg -run
32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## 6502 Assembler
## The Bass 6502 Assembler

* ACME like syntax
* Aims to be on par with Kickassembler in automation/scriptability,
Expand All @@ -11,7 +11,7 @@ See [INTRO.md](INTRO.md) for a tutorial / introduction.

### Invoking

`badass -i <source> -Dname=val ...`
`bass -i <source> -Dname=val ...`

### Example

Expand All @@ -32,13 +32,13 @@ start:
; Clear 1K
ldx #0
- !rept 4 { sta $1000+i*256,x }
$ !rept 4 { sta $1000+i*256,x }
dex
bne -
SetVRAM(0x1234)
ldx #end - text
- lda start,x
$ lda start,x
sta $1000,x
dex
bne -
Expand All @@ -59,29 +59,13 @@ A label starting with a dot ('.') is a _local_ label and treated
as _lastLabel.label_, where _lastLabel_ is the closest previous
_non local_ label.

A label can be also called '+' or '-'
A label can be also called '$'.

Referencing '+' will mean the closest _following_ '+' label.
Referencing '-' will mean the closest _previous_ '-' label.
Referencing '+' will mean the closest _following_ '$' label.
Referencing '-' will mean the closest _previous_ '$' label.

Repeated '-' or '+' signs means to skip further.

### Memory Layout

It is assumed that the normal use case is that you want to
produce a single "product" from a main source, that will include other
sources. There is no linking step since it is not very useful today.

The default mode then is to start with a _Target_ which defines the
available memory, assemble all source code into sections, where each
section can recide in a different part of the targets memory, and
finally write the entire image as a file.

Other common use cases is that some sections are written as separate
files, for manual loading by the main (startable) image.

This is compilcated a bit by the various funky layouts of different
targets, such as cartridge images.

### Unit Tests

Expand Down Expand Up @@ -109,6 +93,8 @@ The assembled changes are then rolled back.
!test <name> { <statements> }
!assert <expression> [, <message> ]
...
```

### Basic Operation in Detail
Expand Down

0 comments on commit b114875

Please sign in to comment.