mirror of
https://github.com/KarolS/millfork.git
synced 2024-11-01 05:05:32 +00:00
0ca1be0c00
– changed `inline` to `macro` – added support for parameters for macros written in Millfork – added `inline`, `noinline`, `register` hints – added <<<< operator – pointer dereference expressions are now supported more widely – C64 library fixes – added `-O1` command line option as an alias for `-O`
47 lines
663 B
Plaintext
47 lines
663 B
Plaintext
// target-independent things
|
|
|
|
word nmi_routine_addr @$FFFA
|
|
word reset_routine_addr @$FFFC
|
|
word irq_routine_addr @$FFFE
|
|
|
|
macro asm void poke(word const addr, byte a) {
|
|
STA addr
|
|
}
|
|
|
|
macro asm byte peek(word const addr) {
|
|
?LDA addr
|
|
}
|
|
|
|
macro asm void disable_irq() {
|
|
SEI
|
|
}
|
|
|
|
macro asm void enable_irq() {
|
|
CLI
|
|
}
|
|
|
|
asm byte hi_nibble_to_hex(byte a) {
|
|
LSR
|
|
LSR
|
|
LSR
|
|
LSR
|
|
JMP lo_nibble_to_hex
|
|
}
|
|
|
|
asm byte lo_nibble_to_hex(byte a) {
|
|
AND #$F
|
|
CLC
|
|
ADC #$30
|
|
CMP #$3A
|
|
BCC _lo_nibble_to_hex_lbl
|
|
ADC #$6 // carry is set
|
|
_lo_nibble_to_hex_lbl:
|
|
RTS
|
|
}
|
|
|
|
macro asm void panic() {
|
|
JSR _panic
|
|
}
|
|
|
|
array __constant8 = [8]
|