diff --git a/README.md b/README.md index ee8cbfd..0b4da5c 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,22 @@ We specified some source files (which will get compiled automatically) and some Furthermore, we can disable subroutines by replacing the first opcode with a RTS (`instant_rts`). This is necessary in some cases because Champ does not emulate hardware and thus can not load data from disk, for example. +### Defining watches + +You can watch registers or variables at certain program counter addresses by inserting a _champ directive_ in a comment after the respective code line in your assembler source code. All champ directives start with an _at sign_ (@). Here's an example: + +``` +LDA #2 ; load 2 into accumulator +ASL ; multiply by two +STA SOMEWHERE ; store result @Au +``` + +With the `@Au` directive, we tell champ to monitor the A register and interpret it as an unsigned 8 bit integer (likewise, `@As` would treat the value as a signed 8 bit integer). + +By default, all champ values get recorded before the operation has been executed. To get the value after the operation, you can write: `@Au(post)`. + +### Running the profiler + To start champ, type: ``` diff --git a/doc/screenshot.png b/doc/screenshot.png index 7c4fe1d..36a5c0f 100644 Binary files a/doc/screenshot.png and b/doc/screenshot.png differ diff --git a/plot3d.yaml b/plot3d.yaml index ddb69f4..dbf56a7 100644 --- a/plot3d.yaml +++ b/plot3d.yaml @@ -1,5 +1,5 @@ load: - 0x6000: plot3d/plot3d242c.s + 0x6000: plot3d/plot3d242.s 0x1200: plot3d/multtab.s 0x8400: plot3d/ldrwtab.s 0x8900: plot3d/SINETABLE