Skip to content

Commit 77650d2

Browse files
committed
Use color for assembly syntax in the cross-compiler manual.
1 parent 82fe65d commit 77650d2

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

compiler/USAGE.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ From the FastBasic source, you can reference any symbol via `@name`, for example
229229

230230
The ASM file must export the `ADD_10` (always uppercase) symbol, for example:
231231

232+
```Assembler
232233
; Assembly module
233234
.export ADD_10
234235
@@ -244,6 +245,7 @@ The ASM file must export the `ADD_10` (always uppercase) symbol, for example:
244245
; Return value in A/X registers
245246
rts
246247
.endproc
248+
```
247249

248250
You can also export ZP symbols, to import them use `@@name`.
249251

@@ -401,6 +403,7 @@ the screen.
401403

402404
The simple assembly version of this statement would be:
403405

406+
```Assembler
404407
.export DO_WAIT
405408
.include "atari.inc"
406409
@@ -410,6 +413,7 @@ The simple assembly version of this statement would be:
410413
cmp VCOUNT
411414
bcc loop
412415
rts
416+
```
413417

414418
Save this file as `wait.asm`.
415419

@@ -458,7 +462,7 @@ There some parts of the syntax file that needs explanation:
458462
symbol value, this means the value will be filled by the linker.
459463

460464
- Then, we are expecting an `EXPR`. This syntax specifies an integer
461-
expression, the parser will parse any expresion that gives am integer number
465+
expression, the parser will parse any expression that gives am integer number
462466
here, and the result will be placed in the `A` and `X` registers.
463467

464468

@@ -477,8 +481,8 @@ of commands is the following:
477481
file name given does not have an extension, `.tgt` is added.
478482

479483
- `library`: Gives the name of the library to link with a compiled FastBasic
480-
program for this target. Only one library file is alowed, the last
481-
one read takes precendence.
484+
program for this target. Only one library file is allowed, the last
485+
one read takes precedence.
482486

483487
- `config`: Gives the name of the linker configuration file used for this
484488
target.

template.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,19 @@
571571
%
572572

573573
$if(listings)$
574+
\lstdefinelanguage{Assembler}{%
575+
morekeywords={%
576+
ADC,AND,ASL,BCC,BCS,BEQ,BIT,BMI,BNE,BPL,BRA,BRK,BVC,BVS,CLC,CLD,%
577+
CLI,CLV,CMP,CPX,CPY,DEA,DEC,DEX,DEY,EOR,INA,INC,INX,INY,JMP,JSR,%
578+
LDA,LDX,LDY,LSR,NOP,ORA,PHA,PHP,PHX,PHY,PLA,PLP,PLX,PLY,ROL,ROR,%
579+
RTI,RTS,SBC,SEC,SED,SEI,STA,STP,STX,STY,STZ,TAX,TAY,TRB,TSB,TSX,%
580+
TXA,TXS,TYA},%
581+
sensitive=false,%
582+
morecomment=[l]*,%
583+
morecomment=[l];%
584+
}[keywords,comments,strings]
585+
586+
574587
\lstdefinestyle{eisvogel_listing_style}{
575588
language = [Visual]Basic,
576589
numbers = left,

0 commit comments

Comments
 (0)