mirror of
https://github.com/KarolS/millfork.git
synced 2024-08-16 20:28:54 +00:00
45 lines
667 B
Plaintext
45 lines
667 B
Plaintext
// target-independent things
|
|
|
|
word nmi_routine_addr @$FFFA
|
|
word reset_routine_addr @$FFFC
|
|
word irq_routine_addr @$FFFE
|
|
|
|
inline asm void poke(word const addr, byte const value) {
|
|
?LDA #value
|
|
STA addr
|
|
}
|
|
|
|
inline asm byte peek(word const addr) {
|
|
LDA addr
|
|
}
|
|
|
|
inline asm void disable_irq() {
|
|
SEI
|
|
}
|
|
|
|
inline 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
|
|
}
|
|
|
|
inline asm void panic() {
|
|
JSR _panic
|
|
} |