Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

SIC-1 Solutions

Forum for posting SIC-1 solutions · By jaredkrinke

Division

A topic by jaredkrinke created Feb 04, 2023 Views: 414
Viewing posts 1 to 1
Developer
@start:
subleq @tmp, @IN
subleq @remainder, @tmp
subleq @tmp, @tmp
subleq @tmp, @IN
subleq @divisor, @tmp
@loop:
subleq @n_quotient, @one
subleq @remainder, @divisor, @leq
subleq @tmp, @tmp, @loop
@leq:
subleq @tmp, @tmp
subleq @tmp, @remainder, @eq
subleq @n_quotient, @n_one
subleq @tmp, @tmp
subleq @tmp, @divisor
subleq @remainder, @tmp
subleq @divisor, @divisor, @done
@eq:
subleq @remainder, @remainder, @done
@done:
subleq @OUT, @n_quotient
subleq @tmp, @tmp
subleq @tmp, @remainder
subleq @OUT, @tmp
subleq @remainder, @remainder
subleq @divisor, @divisor
subleq @n_quotient, @n_quotient
subleq @tmp, @tmp, @start
; Variables
@tmp: .data 0
@remainder: .data 0
@divisor: .data 0
@n_quotient: .data 0
; Constants
@one: .data 1
@n_one: .data -1