mirror of
https://github.com/KarolS/millfork.git
synced 2024-09-06 17:54:26 +00:00
20 lines
361 B
Plaintext
20 lines
361 B
Plaintext
|
|
#if not(ARCH_6502)
|
|
#warn zp_reg module should be used only on 6502-compatible targets
|
|
#endif
|
|
|
|
inline asm byte __mul_u8u8u8() {
|
|
? LDA #0
|
|
? JMP __mul_u8u8u8_start
|
|
__mul_u8u8u8_add:
|
|
? CLC
|
|
? ADC __reg.lo
|
|
__mul_u8u8u8_loop:
|
|
? ASL __reg.lo
|
|
__mul_u8u8u8_start:
|
|
? LSR __reg.hi
|
|
? BCS __mul_u8u8u8_add
|
|
? BNE __mul_u8u8u8_loop
|
|
? RTS
|
|
}
|