lazyboy-0.2.1.1: An EDSL for programming the Game Boy.

Copyright(c) Rose 2019
LicenseBSD3
Maintainerrose@lain.org.uk
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Lazyboy.Control

Description

This module defines methods of controlling the flow of execution for Lazyboy.

Synopsis

Documentation

getLabel :: Lazyboy Integer Source #

Get a label, and in the process increment the counter used to track labels. this provides a safe interface to label retrieval and utilization.

getLocalLabel :: Lazyboy Label Source #

Get a local label. The name is guaranteed to be unique.

getGlobalLabel :: Lazyboy Label Source #

Get a global label. The name is guaranteed to be unique.

withLabel :: (Label -> Lazyboy ()) -> Lazyboy () Source #

Execute an action within a global label and pass the action the label.

withLocalLabel :: (Label -> Lazyboy ()) -> Lazyboy () Source #

Execute an action within a local label and pass the action the label.

embedFile :: FilePath -> Lazyboy Label Source #

Embed a file and return a global label for it. A jump over the block of data is added to prevent the image data being executed.

embedImage :: FilePath -> Lazyboy Label Source #

Embed an image and return a (global) label for it. A jump over the block of data is added to prevent the image data being executed.

embedBytes :: [Word8] -> Lazyboy Label Source #

Embed a sequence of bytes into the file and return a (global) label for it. A jump over the block of data is added to prevent the image data being executed.

freeze :: Lazyboy () Source #

Suspend execution indefinitely by disabling interrupts and halting.

cond :: Condition -> Lazyboy a -> Lazyboy a Source #

Executes the given action provided condition flag is set.

class Comparable a b where Source #

A typeclass for comparisons between registers and values.

Methods

equalTo Source #

Arguments

:: a 
-> b 
-> Lazyboy Condition

Check the equality of two items.

notEqualTo Source #

Arguments

:: a 
-> b 
-> Lazyboy Condition

Check the inequality of two items.

greaterThan Source #

Arguments

:: a 
-> b 
-> Lazyboy Condition

Check whether a is greater than b.

lessThan Source #

Arguments

:: a 
-> b 
-> Lazyboy Condition

Check whether a is less than b.

Instances
Comparable Word8 Register8 Source #

An instance for comparing a Word8 and an 8-bit register (this is an alias).

Instance details

Defined in Lazyboy.Control

Comparable Register8 Word8 Source #

An instance for comparing an 8-bit register and a Word8.

Instance details

Defined in Lazyboy.Control

Comparable Register8 Register8 Source #

An instance for comparing two 8-bit registers.

Instance details

Defined in Lazyboy.Control

if' :: Lazyboy Condition -> Lazyboy a -> Lazyboy a Source #

Executes an action which returns a condition flag, then conditionally executes another action baed on the state of that condition flag.

not :: Lazyboy Condition -> Lazyboy Condition Source #

Boolean NOT operation for inverting Condition flags.

and :: Lazyboy Condition -> Lazyboy Condition -> Lazyboy Condition Source #

Assign boolean values to two registers based on the result flags of some conditions and then AND them and return the result.

or :: Lazyboy Condition -> Lazyboy Condition -> Lazyboy Condition Source #

Assign boolean values to two registers based on the result flags of some conditions and then OR them and return the result.