We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33d5402 commit 5422f06Copy full SHA for 5422f06
1 file changed
src/interp/mul.asm
@@ -33,29 +33,31 @@
33
.segment "RUNTIME"
34
35
.proc EXE_MUL ; AX = (SP+) * AX
36
- sta tmp1
37
- stx tmp1+1
38
- lda stack_l, y
+ ; Store A
39
sta tmp3
40
- ldx stack_h, y
41
- stx tmp3+1
42
43
- ; Multiply "tmp1 * tmp3"
+ ; Get first bit into carry
+ lda stack_h, y
+ lsr
+ sta tmp1+1
+ lda stack_l, y
44
+ ror
45
+ sta tmp1
46
+
47
lda #0
48
sta tmp2+1
49
ldy #16 ; Number of bits
50
- lsr tmp1+1
- ror tmp1 ; Get first bit into carry
51
@L0: bcc @L1
52
53
clc
54
adc tmp3
- tax
55
- lda tmp3+1
+ sta tmp2
56
57
+ txa
58
adc tmp2+1
59
- txa
60
+ lda tmp2
61
62
@L1: ror tmp2+1
63
ror
0 commit comments