September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -0,0 +1,22 @@
; https://skilldrick.github.io/easy6502/
; Multiplies A by X
define memory 1040
JMP MAIN
MULTIPLY: STA memory ; memory = A
BEQ MUL_END ; A = 0
TXA ; A = X
BEQ MUL_END ; X = 0 -> A = 0
LDA memory
CLC
MUL_LOOP: DEX ; X -= 1
BEQ MUL_END ; X = 0 -> A = A * X
ADC memory ; A += memory
JMP MUL_LOOP
MUL_END: RTS
MAIN: LDA #50
LDX #5
JSR MULTIPLY

View file

@ -0,0 +1 @@
100 DEF MULTIPLY(A,B)=A*B

View file

@ -1,2 +1,2 @@
real multiply(RealNumber a, RealNumber b)
= a * b.
real multiply(real a, real b)
= a * b;

View file

@ -1 +1 @@
symbol f := (:x:y)(x * y).
symbol f := (x,y => x * y);

View file

@ -0,0 +1 @@
f(x,y){ ^ x * y }

View file

@ -0,0 +1 @@
2[*]

View file

@ -0,0 +1,2 @@
(lambda (x y)
(* x y))

View file

@ -0,0 +1,3 @@
(define multiply (lambda (x y) (* x y)))
(define (multiply x y) (* x y))

View file

@ -0,0 +1,12 @@
(let multiply ((x n) (y m))
(* x y))
; example of naive multiplication function implementation using local recursion:
(define (multiply x y)
(let loop ((y y) (n 0))
(if (= y 0)
n
(loop (- y 1) (+ n x)))))
(print (multiply 7 8))
; ==> 56

View file

@ -1,2 +1 @@
(define (mutiply a b)
(* a b))
(define (multiply a b) (* a b))

View file

@ -0,0 +1 @@
(define multiply (λ (a b) (* a b)))

View file

@ -0,0 +1 @@
(define multiply *)

View file

@ -0,0 +1 @@
Multiply(6, 111)

View file

@ -0,0 +1,3 @@
Function Multiply(ByVal a As Integer, ByVal b As Integer) As Integer
Return a * b
End Function

View file

@ -0,0 +1 @@
Dim I As Integer = Multiply(7, 6)