()
| 108 | } |
| 109 | |
| 110 | func 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 | |
| 143 | func routine_loadFontDescriptions(label string) []asm.Instruction { |
| 144 | instructions := asm.Instructions{} |
no test coverage detected