Skip to content
Bob Burns edited this page Dec 23, 2017 · 16 revisions

Welcome to the mikode wiki!

Abbreviations

SREG Status Register

PC Program Counter

Rd Destination Register

Rr Source Register

K constant Value

k constant address

b bit

s bit in status register

Assembler Directives and Special Instructions

.org - set address

.def - define register

.equ - equate variable to value

.db - data byte.

Memory

Stack

0xf000 - 0xffff

Screen Rom

0xc000 - 0xd400 Set to 128 (0x80) by 40 (0x28)

Key in

0xe000 Load from this address to get key input

GPIO

Requires root. Works with the Raspberry Pi A+,B+,2B,3B

Register bits correspond to gpio 6, 13, 19, 26, 12, 16, 20, 21

0xe100 - output

0xe101 - set direction

0xe102 - input

See examples/blink.asm

Random

0xe004 - 0xe007 Random int value every cycle

Registers

r0 - r15

X = r13:r12

Y = r15:r14

Flags - Sreg

7 6 5 4 3 2 1 0
- T - S V N Z C

[T] Transfer flag

[S] Sign flag

[V] Overflow flag

[N] Negative flag

[Z] Zero flag

[C] Carry flag


Special Keys during execution

F1 - toggle display registers

F2 - clear display registers

F3 - break (quit)

F4 - stop/start execution


Mikode Instruction Set

Based on Atmel AVR

AddWithC

Add

AddImmWord

And

AndImm

ArithShiftRt

BitClear

BitLoad

BranchBitClr

BranchBitSet

BranchCarryClr

BranchCarrySet

Break

BranchEqu

BranchGrEqu

BranchLower

BranchLessThan

BranchMinus

BranchNotEqu

BranchPlus

BranchSameHigh

BranchTClr

BranchTSet

BranchOverClr

BranchOverSet

BranchPlus

BranchSameHigh

BranchTClr

BranchTSet

Call

ClearBitsReg

ClearCarryF

ClearNegF

ClearReg

ClearSignF

ClearTranF

ClearOverflowF

ClearZeroF

Compliment

CompareCarry

CompareImm

CompareSkipEqu

Decrement

ExclusiveOr

IndCall

IndJump

Increment

Jump

LoadIndX

LoadIndY

LoadIndImm

LoadDirect

LogicalShiftRt

LogicalShiftLt

Move

MoveWord

Multiply

MultiplyS

Negate

NOP

Or

OrImm

Pop

Push

Return

RotateLeft

RotateRight

SubtractWithC

SubtractImmC

SubtractImmWord

SetBitsReg

SkipBitRegClr

SkipBitRegSet

SetCarryF

SetNegF

SetAllReg

SetSignF

SetTranF

SetOverflowF

SetZeroF

StoreIndX

StoreIndY

StoreDirect

Subtract

SubtractImm

Swap

TestZero

Clone this wiki locally