Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inventory Report speed 51/393 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 78 additions & 42 deletions 32-Inventory-Report.speed.asm
Original file line number Diff line number Diff line change
@@ -1,55 +1,91 @@
-- HUMAN RESOURCE MACHINE PROGRAM --
-- Inventory report fast solution: 51/393
-- Using precalculated values.

JUMP b
a:
COPYFROM 15
OUTBOX
b:
BUMPUP 14
BUMPUP 14
COPYTO 16 -- Const 2 (C)
BUMPUP 14
COPYTO 17 -- Const 3 (X)
BUMPUP 14
COPYTO 18 -- Const 4 (A)
BUMPUP 14 -- Const 5 (B)
loop:
INBOX
COPYTO 16
COPYTO 19

-- Compare with "B"
SUB 0
JUMPZ outb

COPYFROM 19
-- Compare with "A"
SUB 1
JUMPZ outa

COPYFROM 19
-- Compare with "X"
SUB 2
JUMPZ outx

-- Else branch: "C"

outc:
COPYFROM 16
OUTBOX
JUMP loop
outx:
COPYFROM 17
OUTBOX
JUMP loop
outa:
COPYFROM 18
OUTBOX
JUMP loop
outb:
COPYFROM 14
COPYTO 15
COPYTO 17
JUMP e
c:
BUMPUP 15
d:
BUMPUP 17
e:
COPYFROM [17]
JUMPZ a
SUB 16
JUMPZ c
JUMP d
OUTBOX
JUMP loop


DEFINE LABEL 0
eJwzYmBgmG8Q6sZuEBbZrceU9lvrUpW41rEWBpC4c6jxfGdP23wnBgdt++1OILFuPRXT84bn9D47VGoo
O23TV3Y6bGHvyOCQbMvjudnoQsh7i7DIbCvv5Gwrvvx2yynF1SbqjZuNvjdF6/I3gfTru7eHv4trDwex
nT1rSmaVpJSC2Flt5/QgdKWGXFuo8apG3piw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