MCPcopy Index your code
hub / github.com/djhworld/simple-computer / initialiseCommonCode

Function initialiseCommonCode

cmd/generator/common.go:110–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108}
109
110func initialiseCommonCode() []asm.Instruction {
111 instructions := asm.Instructions{}
112
113 instructions.Add(
114 asm.DEFSYMBOL{"LINE-WIDTH", 0x001E},
115 asm.DEFSYMBOL{"CALL-RETURN-ADDRESS", 0xFF33},
116 asm.DEFSYMBOL{"ONE", 0x0001},
117 asm.DEFSYMBOL{"LINEX", 0xFF01},
118 asm.DEFSYMBOL{"PEN-POSITION-ADDR", 0x0400},
119 asm.DEFSYMBOL{"KEYCODE-REGISTER", 0x0401},
120
121 asm.DEFSYMBOL{"DISPLAY-ADAPTER-ADDR", 0x0007},
122 asm.DEFSYMBOL{"KEY-ADAPTER-ADDR", 0x000F},
123 )
124
125 instructions.Add(
126 asm.DATA{asm.REG0, asm.SYMBOL{"LINEX"}},
127 asm.DATA{asm.REG1, asm.NUMBER{0x0000}},
128 asm.STORE{asm.REG0, asm.REG1},
129 )
130
131 // jump to main
132 instructions.Add(asm.DEFLABEL{"start"})
133 instructions.AddBlocks(callRoutine("ROUTINE-init-fontDescriptions"))
134 instructions.Add(asm.JMP{asm.LABEL{"main"}})
135
136 instructions.Add(asm.DEFLABEL{"ROUTINES"})
137 instructions.AddBlocks(routine_loadFontDescriptions("ROUTINE-init-fontDescriptions"))
138 instructions.AddBlocks(routine_drawFontCharacter("ROUTINE-io-drawFontCharacter"))
139 instructions.AddBlocks(routine_pollKeyboard("ROUTINE-io-pollKeyboard"))
140 return instructions.Get()
141}
142
143func routine_loadFontDescriptions(label string) []asm.Instruction {
144 instructions := asm.Instructions{}

Callers 1

mainFunction · 0.85

Calls 7

AddMethod · 0.95
AddBlocksMethod · 0.95
GetMethod · 0.95
callRoutineFunction · 0.85
routine_pollKeyboardFunction · 0.85

Tested by

no test coverage detected