Mercurial > emacs
annotate lisp/progmodes/mixal-mode.el @ 65695:e78a07e4c513
(compilation-error-properties): When getting the file from the
previous error message, correctly decode the new data format.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 26 Sep 2005 00:00:49 +0000 |
parents | 4dd2a1379398 |
children | 20752359c953 a3716f7538f2 |
rev | line source |
---|---|
51592 | 1 ;;; mixal-mode.el --- Major mode for the mix asm language. |
2 | |
64699
629afbe74e61
Update copyright for release of 22.1 for progmodes directory.
Nick Roberts <nickrob@snap.net.nz>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 2003, 2004, 2005 Free Software Foundation |
51592 | 4 |
5 ;; This program is free software; you can redistribute it and/or | |
6 ;; modify it under the terms of the GNU General Public License as | |
7 ;; published by the Free Software Foundation; either version 2 of | |
8 ;; the License, or (at your option) any later version. | |
9 | |
10 ;; This program is distributed in the hope that it will be | |
11 ;; useful, but WITHOUT ANY WARRANTY; without even the implied | |
12 ;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | |
13 ;; PURPOSE. See the GNU General Public License for more details. | |
14 | |
15 ;; You should have received a copy of the GNU General Public | |
16 ;; License along with this program; if not, write to the Free | |
64085 | 17 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 ;; MA 02110-1301 USA | |
51592 | 19 |
20 ;; Author: Pieter E.J. Pareit <pieter.pareit@skynet.be> | |
21 ;; Maintainer: Pieter E.J. Pareit <pieter.pareit@skynet.be> | |
22 ;; Created: 09 Nov 2002 | |
23 ;; Version: 0.1 | |
24 ;; Keywords: Knuth mix mixal asm mixvm "The Art Of Computer Programming" | |
25 | |
26 ;;; Commentary: | |
27 ;; Major mode for the mix asm language. | |
28 ;; The mix asm language is described in "The Art Of Computer Programming". | |
29 ;; | |
30 ;; For optimal use, also use GNU MDK. Compiling needs mixasm, running | |
31 ;; and debugging needs mixvm and mixvm.el from GNU MDK. You can get | |
32 ;; GNU MDK from `https://savannah.gnu.org/projects/mdk/' and | |
33 ;; `ftp://ftp.gnu.org/pub/gnu/mdk'. | |
34 ;; | |
35 ;; To use this mode, place the following in your .emacs file: | |
36 ;; `(load-file "/PATH-TO-FILE/mixal-mode.el")'. | |
37 ;; When you load a file with the extension .mixal the mode will be started | |
38 ;; automatic. If you want to start the mode manual, use `M-x mixal-mode'. | |
39 ;; Font locking will work, the behavior of tabs is the same as emacs | |
40 ;; default behavior. You can compile a source file with `C-c c' you can | |
41 ;; run a compiled file with `C-c r' or run it in debug mode with `C-c d'. | |
42 ;; You can get more information about a particular operation code by using | |
43 ;; mixal-describe-operation-code or `C-h o'. | |
44 ;; | |
45 ;; Have fun. | |
46 | |
47 ;;; History: | |
48 ;; Version 0.1: | |
49 ;; Version 0.1.1: | |
50 ;; 22/11/02: bugfix in fontlocking, needed to add a '-' to the regex. | |
51 ;; 19/11/02: completed implementing mixal-describe-operation-code. | |
52 ;; 13/11/02: implemented compile, mixal-run and mixal-debug. | |
53 ;; 10/11/02: implemented font-locking and syntax table. | |
54 ;; 09/11/02: started mixal-mode. | |
55 | |
56 ;;; Code: | |
57 | |
65236
4dd2a1379398
(compile-command): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64699
diff
changeset
|
58 (defvar compile-command) |
4dd2a1379398
(compile-command): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64699
diff
changeset
|
59 |
51592 | 60 ;;; Key map |
61 (defvar mixal-mode-map | |
62 (let ((map (make-sparse-keymap))) | |
63 (define-key map "\C-cc" 'compile) | |
64 (define-key map "\C-cr" 'mixal-run) | |
65 (define-key map "\C-cd" 'mixal-debug) | |
66 (define-key map "\C-ho" 'mixal-describe-operation-code) | |
67 map) | |
68 "Keymap for `mixal-mode'.") | |
69 ; (makunbound 'mixal-mode-map) | |
70 | |
71 ;;; Syntax table | |
72 (defvar mixal-mode-syntax-table | |
73 (let ((st (make-syntax-table))) | |
74 (modify-syntax-entry ?* "<" st) | |
75 (modify-syntax-entry ?\n ">" st) | |
76 st) | |
77 "Syntax table for `dot-mode'.") | |
78 | |
79 (defvar mixal-font-lock-label-face 'font-lock-variable-name-face | |
80 "Face name to use for label names. | |
81 Default value is that of `font-lock-variable-name-face', but you can modify | |
82 its value.") | |
83 | |
84 (defvar mixal-font-lock-operation-code-face 'font-lock-keyword-face | |
85 "Face name to use for operation code names. | |
86 Default value is that of `font-lock-keyword-face', but you can modify its | |
87 value.") | |
88 | |
89 (defvar mixal-font-lock-assembly-pseudoinstruction-face 'font-lock-builtin-face | |
90 "Face name to use for assembly pseudoinstruction names. | |
91 Default value is that of `font-lock-builtin-face', but you can modify its | |
92 value.") | |
93 | |
94 (defvar mixal-operation-codes | |
95 '("NOP" "ADD" "FADD" "SUB" "FSUB" "MUL" "FMUL" "DIV" "FDIV" "NUM" "CHAR" | |
96 "HLT" "SLA" "SRA" "SLAX" "SRAX" "SLC" "SRC" "MOVE" "LDA" "LD1" "LD2" "LD3" | |
97 "LD4" "LD5" "LD6" "LDX" "LDAN" "LD1N" "LD2N" "LD3N" "LD4N" "LD5N" "LD6N" | |
98 "LDXN" "STA" "ST1" "ST2" "ST3" "ST4" "ST5" "ST6" "STX" "STJ" "STZ" "JBUS" | |
99 "IOC" "IN" "OUT" "JRAD" "JMP" "JSJ" "JOV" "JNOV" | |
100 "JAN" "J1N" "J2N" "J3N" "J4N" "J5N" "J6N" "JXN" | |
101 "JAZ" "J1Z" "J2Z" "J3Z" "J4Z" "J5Z" "J6Z" "JXZ" | |
102 "JAP" "J1P" "J2P" "J3P" "J4P" "J5P" "J6P" "JXP" | |
103 "JANN" "J1NN" "J2NN" "J3NN" "J4NN" "J5NN" "J6NN" "JXNN" | |
104 "JANZ" "J1NZ" "J2NZ" "J3NZ" "J4NZ" "J5NZ" "J6NZ" "JXNZ" | |
105 "JANP" "J1NP" "J2NP" "J3NP" "J4NP" "J5NP" "J6NP" "JXNP" | |
106 "INCA" "DECA" "ENTA" "ENNA" "INC1" "DEC1" "ENT1" "ENN1" | |
107 "INC2" "DEC2" "ENT2" "ENN2" "INC3" "DEC3" "ENT3" "ENN3" "INC4" "DEC4" | |
108 "ENT4" "ENN4" "INC5" "DEC5" "ENT5" "ENN5" "INC6" "DEC6" "ENT6" "ENN6" | |
109 "INCX" "DECX" "ENTX" "ENNX" "CMPA" "FCMP" "CMP1" "CMP2" "CMP3" "CMP4" | |
110 "CMP5" "CMP6" "CMPX") | |
111 "List of possible operation codes as strings.") | |
112 ; (makunbound 'mixal-operation-codes) | |
113 | |
114 (defvar mixal-assembly-pseudoinstructions | |
115 '("ORIG" "EQU" "CON" "ALF" "END") | |
116 "List of possible assembly pseudoinstructions") | |
117 | |
118 ;;; Font-locking: | |
119 (defvar mixal-font-lock-keywords | |
120 `(("^\\([A-Z0-9a-z]+\\).*$" | |
121 (1 mixal-font-lock-label-face)) | |
122 (,(regexp-opt mixal-operation-codes 'words) | |
123 . mixal-font-lock-operation-code-face) | |
124 (,(regexp-opt | |
125 mixal-assembly-pseudoinstructions 'words) | |
126 . mixal-font-lock-assembly-pseudoinstruction-face) | |
127 ("^[A-Z0-9a-z]*[ \t]+[A-Z0-9a-z]+[ \t]+[\\-A-Z0-9a-z,():]*[\t]+\\(.*\\)$" | |
128 (1 font-lock-comment-face))) | |
129 "Keyword highlighting specification for `mixal-mode'.") | |
130 ; (makunbound 'mixal-font-lock-keywords) | |
131 | |
132 ;;;; Compilation | |
133 ;; Output from mixasm is compatible with default behavior of emacs, | |
134 ;; I just added a key (C-cc) and modified the make-command. | |
135 | |
136 ;;;; Indentation | |
137 ;; Tabs works well by default. | |
138 | |
139 ;;;; Describe | |
140 (defvar mixal-operation-codes-alist '() | |
141 "Alist that contains all the possible operation codes for mix. | |
142 Each elt has the form (OP-CODE GROUP FULL-NAME C-BYTE F-BYTE DESCRIPTION EXECUTION-TIME) | |
143 Where OP-CODE is the text of the opcode as an symbol, FULL-NAME is the human readable name | |
144 as a string, C-BYTE is the operation code telling what operation is to be performed, F-BYTE holds | |
145 an modification of the operation code which can be a symbol or a number, DESCRIPTION contains | |
146 an string with a description about the operation code and EXECUTION-TIME holds info | |
147 about the time it takes, number or string.") | |
148 ; (makunbound 'mixal-operation-codes-alist) | |
149 | |
150 (defun mixal-add-operation-code (op-code group full-name C-byte F-byte description execution-time) | |
151 "Add an operation code to the list that contains information about possible op code's." | |
152 (setq mixal-operation-codes-alist (cons (list op-code group full-name C-byte F-byte | |
153 description execution-time) | |
154 mixal-operation-codes-alist ))) | |
155 | |
156 ;; now add each operation code | |
157 | |
158 (mixal-add-operation-code | |
159 'LDA 'loading "load A" 8 'field | |
160 "Put in rA the contents of cell no. M. | |
161 Uses a + when there is no sign in subfield. Subfield is left padded with | |
162 zeros to make a word." | |
163 2) | |
164 | |
165 (mixal-add-operation-code | |
166 'LDX 'loading "load X" 15 'field | |
167 "Put in rX the contents of cell no. M. | |
168 Uses a + when there is no sign in subfield. Subfield is left padded with | |
169 zeros to make a word." | |
170 2) | |
171 | |
172 (mixal-add-operation-code | |
173 'LD1 'loading "load I1" (+ 8 1) 'field | |
174 "Put in rI1 the contents of cell no. M. | |
175 Uses a + when there is no sign in subfield. Subfield is left padded with | |
176 zeros to make a word. Index registers only have 2 bytes and a sign, Trying | |
177 to set anything more that that will result in undefined behavior." | |
178 2) | |
179 | |
180 (mixal-add-operation-code | |
181 'LD2 'loading "load I2" (+ 8 2) 'field | |
182 "Put in rI2 the contents of cell no. M. | |
183 Uses a + when there is no sign in subfield. Subfield is left padded with | |
184 zeros to make a word. Index registers only have 2 bytes and a sign, Trying | |
185 to set anything more that that will result in undefined behavior." | |
186 2) | |
187 | |
188 (mixal-add-operation-code | |
189 'LD3 'loading "load I3" (+ 8 3) 'field | |
190 "Put in rI3 the contents of cell no. M. | |
191 Uses a + when there is no sign in subfield. Subfield is left padded with | |
192 zeros to make a word. Index registers only have 2 bytes and a sign, Trying | |
193 to set anything more that that will result in undefined behavior." | |
194 2) | |
195 | |
196 (mixal-add-operation-code | |
197 'LD4 'loading "load I4" (+ 8 4) 'field | |
198 "Put in rI4 the contents of cell no. M. | |
199 Uses a + when there is no sign in subfield. Subfield is left padded with | |
200 zeros to make a word. Index registers only have 2 bytes and a sign, Trying | |
201 to set anything more that that will result in undefined behavior." | |
202 2) | |
203 | |
204 (mixal-add-operation-code | |
205 'LD5 'loading "load I5" (+ 8 5) 'field | |
206 "Put in rI5 the contents of cell no. M. | |
207 Uses a + when there is no sign in subfield. Subfield is left padded with | |
208 zeros to make a word. Index registers only have 2 bytes and a sign, Trying | |
209 to set anything more that that will result in undefined behavior." | |
210 2) | |
211 | |
212 (mixal-add-operation-code | |
213 'LD6 'loading "load I6" (+ 8 6) 'field | |
214 "Put in rI6 the contents of cell no. M. | |
215 Uses a + when there is no sign in subfield. Subfield is left padded with | |
216 zeros to make a word. Index registers only have 2 bytes and a sign, Trying | |
217 to set anything more that that will result in undefined behavior." | |
218 2) | |
219 | |
220 (mixal-add-operation-code | |
221 'LDAN 'loading "load A negative" 16 'field | |
222 "Put in rA the contents of cell no. M, with opposite sign. | |
223 Uses a + when there is no sign in subfield, otherwise use the opposite sign. | |
224 Subfield is left padded with zeros to make a word." | |
225 2) | |
226 | |
227 (mixal-add-operation-code | |
228 'LDXN 'loading "load X negative" 23 'field | |
229 "Put in rX the contents of cell no. M, with opposite sign. | |
230 Uses a + when there is no sign in subfield, otherwise use the opposite sign. | |
231 Subfield is left padded with zeros to make a word." | |
232 2) | |
233 | |
234 (mixal-add-operation-code | |
235 'LD1N 'loading "load I1 negative" (+ 16 1) 'field | |
236 "Put in rI1 the contents of cell no. M, with opposite sign. | |
237 Uses a + when there is no sign in subfield, otherwise use the opposite sign. | |
238 Subfield is left padded with zeros to make a word. Index registers only | |
239 have 2 bytes and a sign, Trying to set anything more that that will result | |
240 in undefined behavior." | |
241 2) | |
242 | |
243 (mixal-add-operation-code | |
244 'LD2N 'loading "load I2 negative" (+ 16 2) 'field | |
245 "Put in rI2 the contents of cell no. M, with opposite sign. | |
246 Uses a + when there is no sign in subfield, otherwise use the opposite sign. | |
247 Subfield is left padded with zeros to make a word. Index registers only | |
248 have 2 bytes and a sign, Trying to set anything more that that will result | |
249 in undefined behavior." | |
250 2) | |
251 | |
252 (mixal-add-operation-code | |
253 'LD3N 'loading "load I3 negative" (+ 16 3) 'field | |
254 "Put in rI3 the contents of cell no. M, with opposite sign. | |
255 Uses a + when there is no sign in subfield, otherwise use the opposite sign. | |
256 Subfield is left padded with zeros to make a word. Index registers only | |
257 have 2 bytes and a sign, Trying to set anything more that that will result | |
258 in undefined behavior." | |
259 2) | |
260 | |
261 (mixal-add-operation-code | |
262 'LD4N 'loading "load I4 negative" (+ 16 4) 'field | |
263 "Put in rI4 the contents of cell no. M, with opposite sign. | |
264 Uses a + when there is no sign in subfield, otherwise use the opposite sign. | |
265 Subfield is left padded with zeros to make a word. Index registers only | |
266 have 2 bytes and a sign, Trying to set anything more that that will result | |
267 in undefined behavior." | |
268 2) | |
269 | |
270 (mixal-add-operation-code | |
271 'LD5N 'loading "load I5 negative" (+ 16 5) 'field | |
272 "Put in rI5 the contents of cell no. M, with opposite sign. | |
273 Uses a + when there is no sign in subfield, otherwise use the opposite sign. | |
274 Subfield is left padded with zeros to make a word. Index registers only | |
275 have 2 bytes and a sign, Trying to set anything more that that will result | |
276 in undefined behavior." | |
277 2) | |
278 | |
279 (mixal-add-operation-code | |
280 'LD6N 'loading "load I6 negative" (+ 16 6) 'field | |
281 "Put in rI6 the contents of cell no. M, with opposite sign. | |
282 Uses a + when there is no sign in subfield, otherwise use the opposite sign. | |
283 Subfield is left padded with zeros to make a word. Index registers only | |
284 have 2 bytes and a sign, Trying to set anything more that that will result | |
285 in undefined behavior." | |
286 2) | |
287 | |
288 (mixal-add-operation-code | |
289 'STA 'storing "store A" 24 'field | |
290 "Store in cell Nr. M the contents of rA. | |
291 The modification of the operation code represents the subfield of the | |
292 memory cell that is to be overwritten with bytes from a register. These | |
293 bytes are taken beginning by the rightmost side of the register. The | |
294 sign of the memory cell is not changed, unless it is part of the subfield." | |
295 2) | |
296 | |
297 (mixal-add-operation-code | |
298 'STX 'storing "store X" 31 'field | |
299 "Store in cell Nr. M the contents of rX. | |
300 The modification of the operation code represents the subfield of the | |
301 memory cell that is to be overwritten with bytes from a register. These | |
302 bytes are taken beginning by the rightmost side of the register. The | |
303 sign of the memory cell is not changed, unless it is part of the subfield." | |
304 2) | |
305 | |
306 (mixal-add-operation-code | |
307 'ST1 'storing "store I1" (+ 24 1) 'field | |
308 "Store in cell Nr. M the contents of rI1. | |
309 The modification of the operation code represents the subfield of the | |
310 memory cell that is to be overwritten with bytes from a register. These | |
311 bytes are taken beginning by the rightmost side of the register. The | |
312 sign of the memory cell is not changed, unless it is part of the subfield. | |
313 Because index registers only have 2 bytes and a sign, the rest of the bytes | |
314 are assumed to be 0." | |
315 2) | |
316 | |
317 (mixal-add-operation-code | |
318 'ST2 'storing "store I2" (+ 24 2) 'field | |
319 "Store in cell Nr. M the contents of rI2. | |
320 The modification of the operation code represents the subfield of the | |
321 memory cell that is to be overwritten with bytes from a register. These | |
322 bytes are taken beginning by the rightmost side of the register. The | |
323 sign of the memory cell is not changed, unless it is part of the subfield. | |
324 Because index registers only have 2 bytes and a sign, the rest of the bytes | |
325 are assumed to be 0." | |
326 2) | |
327 | |
328 (mixal-add-operation-code | |
329 'ST3 'storing "store I3" (+ 24 3) 'field | |
330 "Store in cell Nr. M the contents of rI3. | |
331 The modification of the operation code represents the subfield of the | |
332 memory cell that is to be overwritten with bytes from a register. These | |
333 bytes are taken beginning by the rightmost side of the register. The | |
334 sign of the memory cell is not changed, unless it is part of the subfield. | |
335 Because index registers only have 2 bytes and a sign, the rest of the bytes | |
336 are assumed to be 0." | |
337 2) | |
338 | |
339 (mixal-add-operation-code | |
340 'ST4 'storing "store I4" (+ 24 4) 'field | |
341 "Store in cell Nr. M the contents of rI4. | |
342 The modification of the operation code represents the subfield of the | |
343 memory cell that is to be overwritten with bytes from a register. These | |
344 bytes are taken beginning by the rightmost side of the register. The | |
345 sign of the memory cell is not changed, unless it is part of the subfield. | |
346 Because index registers only have 2 bytes and a sign, the rest of the bytes | |
347 are assumed to be 0." | |
348 2) | |
349 | |
350 (mixal-add-operation-code | |
351 'ST5 'storing "store I5" (+ 24 5) 'field | |
352 "Store in cell Nr. M the contents of rI5. | |
353 The modification of the operation code represents the subfield of the | |
354 memory cell that is to be overwritten with bytes from a register. These | |
355 bytes are taken beginning by the rightmost side of the register. The | |
356 sign of the memory cell is not changed, unless it is part of the subfield. | |
357 Because index registers only have 2 bytes and a sign, the rest of the bytes | |
358 are assumed to be 0." | |
359 2) | |
360 | |
361 (mixal-add-operation-code | |
362 'ST6 'storing "store I6" (+ 24 6) 'field | |
363 "Store in cell Nr. M the contents of rI6. | |
364 The modification of the operation code represents the subfield of the | |
365 memory cell that is to be overwritten with bytes from a register. These | |
366 bytes are taken beginning by the rightmost side of the register. The | |
367 sign of the memory cell is not changed, unless it is part of the subfield. | |
368 Because index registers only have 2 bytes and a sign, the rest of the bytes | |
369 are assumed to be 0." | |
370 2) | |
371 | |
372 (mixal-add-operation-code | |
373 'STJ 'storing "store J" 32 'field | |
374 "Store in cell Nr. M the contents of rJ. | |
375 The modification of the operation code represents the subfield of the | |
376 memory cell that is to be overwritten with bytes from a register. These | |
377 bytes are taken beginning by the rightmost side of the register. The sign | |
378 of rJ is always +, sign of the memory cell is not changed, unless it is | |
379 part of the subfield. The default field for STJ is (0:2)." | |
380 2) | |
381 | |
382 (mixal-add-operation-code | |
383 'STZ 'storing "store zero" 33 'field | |
384 "Store in cell Nr. M '+ 0'. | |
385 The modification of the operation code represents the subfield of the | |
386 memory cell that is to be overwritten with zeros." | |
387 2) | |
388 | |
389 (mixal-add-operation-code | |
390 'ADD 'arithmetic "add" 1 'field | |
391 "Add to A the contents of cell Nr. M. | |
392 Subfield is padded with zero to make a word. | |
393 If the result is to large, the operation result modulo 1,073,741,823 (the | |
394 maximum value storable in a MIX word) is stored in `rA', and the overflow | |
395 toggle is set to TRUE." | |
396 2) | |
397 | |
398 (mixal-add-operation-code | |
399 'SUB 'arithmetic "subtract" 2 'field | |
400 "Subtract to A the contents of cell Nr. M. | |
401 Subfield is padded with zero to make a word. | |
402 If the result is to large, the operation result modulo 1,073,741,823 (the | |
403 maximum value storable in a MIX word) is stored in `rA', and the overflow | |
404 toggle is set to TRUE." | |
405 2) | |
406 | |
407 (mixal-add-operation-code | |
408 'MUL 'arithmetic "multiply" 3 'field | |
409 "Multiplies the contents of cell Nr. M with A, result is 10 bytes and stored in rA and rX. | |
410 The sign is + if the sign of rA and cell M where the same, otherwise, it is -" | |
411 10) | |
412 | |
413 (mixal-add-operation-code | |
414 'DIV 'arithmetic "divide" 4 'field | |
415 "Both rA and rX are taken together and divided by cell Nr. M, quotient is placed in rA, remainder in rX. | |
416 The sign is taken from rA, and after the divide the sign of rA is set to + when | |
417 both the sign of rA and M where the same. Divide by zero and overflow of rA result | |
418 in undefined behavior." | |
419 12) | |
420 | |
421 (mixal-add-operation-code | |
422 'ENTA 'address-transfer "enter A" 48 2 | |
423 "Literal value is stored in rA. | |
424 Indexed, stores value of index in rA." | |
425 1) | |
426 | |
427 (mixal-add-operation-code | |
428 'ENTX 'address-transfer "enter X" 55 2 | |
429 "Literal value is stored in rX. | |
430 Indexed, stores value of index in rX." | |
431 1) | |
432 | |
433 (mixal-add-operation-code | |
434 'ENT1 'address-transfer "Enter rI1" (+ 48 1) 2 | |
435 "Literal value is stored in rI1. | |
436 Indexed, stores value of index in rI1." | |
437 1) | |
438 | |
439 (mixal-add-operation-code | |
440 'ENT2 'address-transfer "Enter rI2" (+ 48 2) 2 | |
441 "Literal value is stored in rI2. | |
442 Indexed, stores value of index in rI2." | |
443 1) | |
444 | |
445 (mixal-add-operation-code | |
446 'ENT3 'address-transfer "Enter rI3" (+ 48 3) 2 | |
447 "Literal value is stored in rI3. | |
448 Indexed, stores value of index in rI3." | |
449 1) | |
450 | |
451 (mixal-add-operation-code | |
452 'ENT4 'address-transfer "Enter rI4" (+ 48 4) 2 | |
453 "Literal value is stored in rI4. | |
454 Indexed, stores value of index in rI4." | |
455 1) | |
456 | |
457 (mixal-add-operation-code | |
458 'ENT5 'address-transfer "Enter rI5" (+ 48 5) 2 | |
459 "Literal value is stored in rI5. | |
460 Indexed, stores value of index in rI5." | |
461 1) | |
462 | |
463 (mixal-add-operation-code | |
464 'ENT6 'address-transfer "Enter rI6" (+ 48 6) 2 | |
465 "Literal value is stored in rI6. | |
466 Indexed, stores value of index in rI6." | |
467 1) | |
468 | |
469 (mixal-add-operation-code | |
470 'ENNA 'address-transfer "enter negative A" 48 3 | |
471 "Literal value is stored in rA with opposite sign. | |
472 Indexed, stores value of index in rA with opposite sign." | |
473 1) | |
474 | |
475 (mixal-add-operation-code | |
476 'ENNX 'address-transfer "enter negative X" 55 3 | |
477 "Literal value is stored in rX with opposite sign. | |
478 Indexed, stores value of index in rX with opposite sign." | |
479 1) | |
480 | |
481 (mixal-add-operation-code | |
482 'ENN1 'address-transfer "Enter negative rI1" (+ 48 1) 3 | |
483 "Literal value is stored in rI1 with opposite sign. | |
484 Indexed, stores value of index in rI1 with opposite sign." | |
485 1) | |
486 | |
487 (mixal-add-operation-code | |
488 'ENN2 'address-transfer "Enter negative rI2" (+ 48 2) 3 | |
489 "Literal value is stored in rI2 with opposite sign. | |
490 Indexed, stores value of index in rI2 with opposite sign." | |
491 1) | |
492 | |
493 (mixal-add-operation-code | |
494 'ENN3 'address-transfer "Enter negative rI3" (+ 48 3) 3 | |
495 "Literal value is stored in rI3 with opposite sign. | |
496 Indexed, stores value of index in rI3 with opposite sign." | |
497 1) | |
498 | |
499 (mixal-add-operation-code | |
500 'ENN4 'address-transfer "Enter negative rI4" (+ 48 4) 3 | |
501 "Literal value is stored in rI4 with opposite sign. | |
502 Indexed, stores value of index in rI4 with opposite sign." | |
503 1) | |
504 | |
505 (mixal-add-operation-code | |
506 'ENN5 'address-transfer "Enter negative rI5" (+ 48 5) 3 | |
507 "Literal value is stored in rI5 with opposite sign. | |
508 Indexed, stores value of index in rI5 with opposite sign." | |
509 1) | |
510 | |
511 (mixal-add-operation-code | |
512 'ENN6 'address-transfer "Enter negative rI6" (+ 48 6) 3 | |
513 "Literal value is stored in rI6 with opposite sign. | |
514 Indexed, stores value of index in rI6 with opposite sign." | |
515 1) | |
516 | |
517 (mixal-add-operation-code | |
518 'INCA 'address-transfer "increase A" 48 0 | |
519 "Increase register A with the literal value of M. | |
520 On overflow the overflow toggle is set." | |
521 1) | |
522 | |
523 (mixal-add-operation-code | |
524 'INCX 'address-transfer "increase X" 55 0 | |
525 "Increase register X with the literal value of M. | |
526 On overflow the overflow toggle is set." | |
527 1) | |
528 | |
529 (mixal-add-operation-code | |
530 'INC1 'address-transfer "increase I1" (+ 48 1) 0 | |
531 "Increase register I1 with the literal value of M. | |
532 The result is undefined when the result does not fit in | |
533 2 bytes." | |
534 1) | |
535 | |
536 (mixal-add-operation-code | |
537 'INC2 'address-transfer "increase I2" (+ 48 2) 0 | |
538 "Increase register I2 with the literal value of M. | |
539 The result is undefined when the result does not fit in | |
540 2 bytes." | |
541 1) | |
542 | |
543 (mixal-add-operation-code | |
544 'INC3 'address-transfer "increase I3" (+ 48 3) 0 | |
545 "Increase register I3 with the literal value of M. | |
546 The result is undefined when the result does not fit in | |
547 2 bytes." | |
548 1) | |
549 | |
550 (mixal-add-operation-code | |
551 'INC4 'address-transfer "increase I4" (+ 48 4) 0 | |
552 "Increase register I4 with the literal value of M. | |
553 The result is undefined when the result does not fit in | |
554 2 bytes." | |
555 1) | |
556 | |
557 (mixal-add-operation-code | |
558 'INC5 'address-transfer "increase I5" (+ 48 5) 0 | |
559 "Increase register I5 with the literal value of M. | |
560 The result is undefined when the result does not fit in | |
561 2 bytes." | |
562 1) | |
563 | |
564 (mixal-add-operation-code | |
565 'INC6 'address-transfer "increase I6" (+ 48 6) 0 | |
566 "Increase register I6 with the literal value of M. | |
567 The result is undefined when the result does not fit in | |
568 2 bytes." | |
569 1) | |
570 | |
571 (mixal-add-operation-code | |
572 'DECA 'address-transfer "decrease A" 48 1 | |
573 "Decrease register A with the literal value of M. | |
574 On overflow the overflow toggle is set." | |
575 1) | |
576 | |
577 (mixal-add-operation-code | |
578 'DECX 'address-transfer "decrease X" 55 1 | |
579 "Decrease register X with the literal value of M. | |
580 On overflow the overflow toggle is set." | |
581 1) | |
582 | |
583 (mixal-add-operation-code | |
584 'DEC1 'address-transfer "decrease I1" (+ 48 1) 1 | |
585 "Decrease register I1 with the literal value of M. | |
586 The result is undefined when the result does not fit in | |
587 2 bytes." | |
588 1) | |
589 | |
590 (mixal-add-operation-code | |
591 'DEC2 'address-transfer "decrease I2" (+ 48 2) 1 | |
592 "Decrease register I2 with the literal value of M. | |
593 The result is undefined when the result does not fit in | |
594 2 bytes." | |
595 1) | |
596 | |
597 (mixal-add-operation-code | |
598 'DEC3 'address-transfer "decrease I3" (+ 48 3) 1 | |
599 "Decrease register I3 with the literal value of M. | |
600 The result is undefined when the result does not fit in | |
601 2 bytes." | |
602 1) | |
603 | |
604 (mixal-add-operation-code | |
605 'DEC4 'address-transfer "decrease I4" (+ 48 4) 1 | |
606 "Decrease register I4 with the literal value of M. | |
607 The result is undefined when the result does not fit in | |
608 2 bytes." | |
609 1) | |
610 | |
611 (mixal-add-operation-code | |
612 'DEC5 'address-transfer "decrease I5" (+ 48 5) 1 | |
613 "Decrease register I5 with the literal value of M. | |
614 The result is undefined when the result does not fit in | |
615 2 bytes." | |
616 1) | |
617 | |
618 (mixal-add-operation-code | |
619 'DEC6 'address-transfer "decrease I6" (+ 48 6) 1 | |
620 "Decrease register I6 with the literal value of M. | |
621 The result is undefined when the result does not fit in | |
622 2 bytes." | |
623 1) | |
624 | |
625 (mixal-add-operation-code | |
626 'CMPA 'comparison "compare A" 56 'field | |
627 "Compare contents of A with contents of M. | |
628 The field specifier works on both fields. The comparison indicator | |
629 is set to LESS, EQUAL or GREATER depending on the outcome." | |
630 2) | |
631 | |
632 | |
633 (mixal-add-operation-code | |
634 'CMPX 'comparison "compare X" 63 'field | |
635 "Compare contents of rX with contents of M. | |
636 The field specifier works on both fields. The comparison indicator | |
637 is set to LESS, EQUAL or GREATER depending on the outcome." | |
638 2) | |
639 | |
640 | |
641 (mixal-add-operation-code | |
642 'CMP1 'comparison "compare I1" (+ 56 1) 'field | |
643 "Compare contents of rI1 with contents of M. | |
644 The field specifier works on both fields. The comparison indicator | |
645 is set to LESS, EQUAL or GREATER depending on the outcome. Bit 1,2 and 3 | |
646 have a value of 0." | |
647 2) | |
648 | |
649 | |
650 (mixal-add-operation-code | |
651 'CMP2 'comparison "compare I2" (+ 56 2) 'field | |
652 "Compare contents of rI2 with contents of M. | |
653 The field specifier works on both fields. The comparison indicator | |
654 is set to LESS, EQUAL or GREATER depending on the outcome. Bit 1,2 and 3 | |
655 have a value of 0." | |
656 2) | |
657 | |
658 | |
659 (mixal-add-operation-code | |
660 'CMP3 'comparison "compare I3" (+ 56 3) 'field | |
661 "Compare contents of rI3 with contents of M. | |
662 The field specifier works on both fields. The comparison indicator | |
663 is set to LESS, EQUAL or GREATER depending on the outcome. Bit 1,2 and 3 | |
664 have a value of 0." | |
665 2) | |
666 | |
667 | |
668 (mixal-add-operation-code | |
669 'CMP4 'comparison "compare I4" (+ 56 4) 'field | |
670 "Compare contents of rI4 with contents of M. | |
671 The field specifier works on both fields. The comparison indicator | |
672 is set to LESS, EQUAL or GREATER depending on the outcome. Bit 1,2 and 3 | |
673 have a value of 0." | |
674 2) | |
675 | |
676 | |
677 (mixal-add-operation-code | |
678 'CMP5 'comparison "compare I5" (+ 56 5) 'field | |
679 "Compare contents of rI5 with contents of M. | |
680 The field specifier works on both fields. The comparison indicator | |
681 is set to LESS, EQUAL or GREATER depending on the outcome. Bit 1,2 and 3 | |
682 have a value of 0." | |
683 2) | |
684 | |
685 | |
686 (mixal-add-operation-code | |
687 'CMP6 'comparison "compare I6" (+ 56 6) 'field | |
688 "Compare contents of rI6 with contents of M. | |
689 The field specifier works on both fields. The comparison indicator | |
690 is set to LESS, EQUAL or GREATER depending on the outcome. Bit 1,2 and 3 | |
691 have a value of 0." | |
692 2) | |
693 | |
694 (mixal-add-operation-code | |
695 'JMP 'jump "jump" 39 0 | |
696 "Unconditional jump. | |
697 Register J is set to the value of the next instruction that would have | |
698 been executed when there was no jump." | |
699 1) | |
700 | |
701 (mixal-add-operation-code | |
702 'JSJ 'jump "jump, save J" 39 1 | |
703 "Unconditional jump, but rJ is not modified." | |
704 1) | |
705 | |
706 (mixal-add-operation-code | |
707 'JOV 'jump "jump on overflow" 39 2 | |
708 "Jump if OV is set (and turn it off). | |
709 Register J is set to the value of the next instruction that would have | |
710 been executed when there was no jump." | |
711 1) | |
712 | |
713 (mixal-add-operation-code | |
714 'JNOV 'jump "Jump on no overflow" 39 3 | |
715 "Jump if OV is not set (and turn it off). | |
716 Register J is set to the value of the next instruction that would have | |
717 been executed when there was no jump." | |
718 1) | |
719 | |
720 (mixal-add-operation-code | |
721 'JL 'jump "Jump on less" 39 4 | |
722 "Jump if '[CM] = L'. | |
723 Register J is set to the value of the next instruction that would have | |
724 been executed when there was no jump." | |
725 1) | |
726 | |
727 | |
728 (mixal-add-operation-code | |
729 'JE 'jump "Jump on equal" 39 5 | |
730 "Jump if '[CM] = E'. | |
731 Register J is set to the value of the next instruction that would have | |
732 been executed when there was no jump." | |
733 1) | |
734 | |
735 | |
736 (mixal-add-operation-code | |
737 'JG 'jump "Jump on greater" 39 6 | |
738 "Jump if '[CM] = G'. | |
739 Register J is set to the value of the next instruction that would have | |
740 been executed when there was no jump." | |
741 1) | |
742 | |
743 | |
744 (mixal-add-operation-code | |
745 'JGE 'jump "Jump on not less" 39 7 | |
746 "Jump if '[CM]' does not equal 'L'. | |
747 Register J is set to the value of the next instruction that would have | |
748 been executed when there was no jump." | |
749 1) | |
750 | |
751 | |
752 (mixal-add-operation-code | |
753 'JNE 'jump "Jump on not equal" 39 8 | |
754 "Jump if '[CM]' does not equal 'E'. | |
755 Register J is set to the value of the next instruction that would have | |
756 been executed when there was no jump." | |
757 1) | |
758 | |
759 | |
760 (mixal-add-operation-code | |
761 'JLE 'jump "Jump on not greater" 39 9 | |
762 "Jump if '[CM]' does not equal 'G'. | |
763 Register J is set to the value of the next instruction that would have | |
764 been executed when there was no jump." | |
765 1) | |
766 | |
767 (mixal-add-operation-code | |
768 'JAN 'jump "jump A negative" 40 0 | |
769 "Jump if the content of rA is negative. | |
770 Register J is set to the value of the next instruction that would have | |
771 been executed when there was no jump." | |
772 1) | |
773 | |
774 | |
775 (mixal-add-operation-code | |
776 'JAZ 'jump "jump A zero" 40 1 | |
777 "Jump if the content of rA is zero. | |
778 Register J is set to the value of the next instruction that would have | |
779 been executed when there was no jump." | |
780 1) | |
781 | |
782 | |
783 (mixal-add-operation-code | |
784 'JAP 'jump "jump A positive" 40 2 | |
785 "Jump if the content of rA is positive. | |
786 Register J is set to the value of the next instruction that would have | |
787 been executed when there was no jump." | |
788 1) | |
789 | |
790 | |
791 (mixal-add-operation-code | |
792 'JANN 'jump "jump A non-negative" 40 3 | |
793 "Jump if the content of rA is non-negative. | |
794 Register J is set to the value of the next instruction that would have | |
795 been executed when there was no jump." | |
796 1) | |
797 | |
798 | |
799 (mixal-add-operation-code | |
800 'JANZ 'jump "jump A non-zero" 40 4 | |
801 "Jump if the content of rA is non-zero. | |
802 Register J is set to the value of the next instruction that would have | |
803 been executed when there was no jump." | |
804 1) | |
805 | |
806 | |
807 (mixal-add-operation-code | |
808 'JANP 'jump "jump A non-positive" 40 5 | |
809 "Jump if the content of rA is non-positive. | |
810 Register J is set to the value of the next instruction that would have | |
811 been executed when there was no jump." | |
812 1) | |
813 | |
814 (mixal-add-operation-code | |
815 'JXN 'jump "jump X negative" 47 0 | |
816 "Jump if the content of rX is negative. | |
817 Register J is set to the value of the next instruction that would have | |
818 been executed when there was no jump." | |
819 1) | |
820 | |
821 | |
822 (mixal-add-operation-code | |
823 'JXZ 'jump "jump X zero" 47 1 | |
824 "Jump if the content of rX is zero. | |
825 Register J is set to the value of the next instruction that would have | |
826 been executed when there was no jump." | |
827 1) | |
828 | |
829 | |
830 (mixal-add-operation-code | |
831 'JXP 'jump "jump X positive" 47 2 | |
832 "Jump if the content of rX is positive. | |
833 Register J is set to the value of the next instruction that would have | |
834 been executed when there was no jump." | |
835 1) | |
836 | |
837 | |
838 (mixal-add-operation-code | |
839 'JXNN 'jump "jump X non-negative" 47 3 | |
840 "Jump if the content of rX is non-negative. | |
841 Register J is set to the value of the next instruction that would have | |
842 been executed when there was no jump." | |
843 1) | |
844 | |
845 | |
846 (mixal-add-operation-code | |
847 'JXNZ 'jump "jump X non-zero" 47 4 | |
848 "Jump if the content of rX is non-zero. | |
849 Register J is set to the value of the next instruction that would have | |
850 been executed when there was no jump." | |
851 1) | |
852 | |
853 | |
854 (mixal-add-operation-code | |
855 'JXNP 'jump "jump X non-positive" 47 5 | |
856 "Jump if the content of rX is non-positive. | |
857 Register J is set to the value of the next instruction that would have | |
858 been executed when there was no jump." | |
859 1) | |
860 | |
861 (mixal-add-operation-code | |
862 'J1N 'jump "jump I1 negative" (+ 40 1) 0 | |
863 "Jump if the content of rI1 is negative. | |
864 Register J is set to the value of the next instruction that would have | |
865 been executed when there was no jump." | |
866 1) | |
867 | |
868 | |
869 (mixal-add-operation-code | |
870 'J1Z 'jump "jump I1 zero" (+ 40 1) 1 | |
871 "Jump if the content of rI1 is zero. | |
872 Register J is set to the value of the next instruction that would have | |
873 been executed when there was no jump." | |
874 1) | |
875 | |
876 | |
877 (mixal-add-operation-code | |
878 'J1P 'jump "jump I1 positive" (+ 40 1) 2 | |
879 "Jump if the content of rI1 is positive. | |
880 Register J is set to the value of the next instruction that would have | |
881 been executed when there was no jump." | |
882 1) | |
883 | |
884 | |
885 (mixal-add-operation-code | |
886 'J1NN 'jump "jump I1 non-negative" (+ 40 1) 3 | |
887 "Jump if the content of rI1 is non-negative. | |
888 Register J is set to the value of the next instruction that would have | |
889 been executed when there was no jump." | |
890 1) | |
891 | |
892 | |
893 (mixal-add-operation-code | |
894 'J1NZ 'jump "jump I1 non-zero" (+ 40 1) 4 | |
895 "Jump if the content of rI1 is non-zero. | |
896 Register J is set to the value of the next instruction that would have | |
897 been executed when there was no jump." | |
898 1) | |
899 | |
900 | |
901 (mixal-add-operation-code | |
902 'J1NP 'jump "jump I1 non-positive" (+ 40 1) 5 | |
903 "Jump if the content of rI1 is non-positive. | |
904 Register J is set to the value of the next instruction that would have | |
905 been executed when there was no jump." | |
906 1) | |
907 | |
908 (mixal-add-operation-code | |
909 'J2N 'jump "jump I2 negative" (+ 40 1) 0 | |
910 "Jump if the content of rI2 is negative. | |
911 Register J is set to the value of the next instruction that would have | |
912 been executed when there was no jump." | |
913 1) | |
914 | |
915 | |
916 (mixal-add-operation-code | |
917 'J2Z 'jump "jump I2 zero" (+ 40 1) 1 | |
918 "Jump if the content of rI2 is zero. | |
919 Register J is set to the value of the next instruction that would have | |
920 been executed when there was no jump." | |
921 1) | |
922 | |
923 | |
924 (mixal-add-operation-code | |
925 'J2P 'jump "jump I2 positive" (+ 40 1) 2 | |
926 "Jump if the content of rI2 is positive. | |
927 Register J is set to the value of the next instruction that would have | |
928 been executed when there was no jump." | |
929 1) | |
930 | |
931 | |
932 (mixal-add-operation-code | |
933 'J2NN 'jump "jump I2 non-negative" (+ 40 1) 3 | |
934 "Jump if the content of rI2 is non-negative. | |
935 Register J is set to the value of the next instruction that would have | |
936 been executed when there was no jump." | |
937 1) | |
938 | |
939 | |
940 (mixal-add-operation-code | |
941 'J2NZ 'jump "jump I2 non-zero" (+ 40 1) 4 | |
942 "Jump if the content of rI2 is non-zero. | |
943 Register J is set to the value of the next instruction that would have | |
944 been executed when there was no jump." | |
945 1) | |
946 | |
947 | |
948 (mixal-add-operation-code | |
949 'J2NP 'jump "jump I2 non-positive" (+ 40 1) 5 | |
950 "Jump if the content of rI2 is non-positive. | |
951 Register J is set to the value of the next instruction that would have | |
952 been executed when there was no jump." | |
953 1) | |
954 | |
955 | |
956 (mixal-add-operation-code | |
957 'J3N 'jump "jump I3 negative" (+ 40 1) 0 | |
958 "Jump if the content of rI3 is negative. | |
959 Register J is set to the value of the next instruction that would have | |
960 been executed when there was no jump." | |
961 1) | |
962 | |
963 | |
964 (mixal-add-operation-code | |
965 'J3Z 'jump "jump I3 zero" (+ 40 1) 1 | |
966 "Jump if the content of rI3 is zero. | |
967 Register J is set to the value of the next instruction that would have | |
968 been executed when there was no jump." | |
969 1) | |
970 | |
971 | |
972 (mixal-add-operation-code | |
973 'J3P 'jump "jump I3 positive" (+ 40 1) 2 | |
974 "Jump if the content of rI3 is positive. | |
975 Register J is set to the value of the next instruction that would have | |
976 been executed when there was no jump." | |
977 1) | |
978 | |
979 | |
980 (mixal-add-operation-code | |
981 'J3NN 'jump "jump I3 non-negative" (+ 40 1) 3 | |
982 "Jump if the content of rI3 is non-negative. | |
983 Register J is set to the value of the next instruction that would have | |
984 been executed when there was no jump." | |
985 1) | |
986 | |
987 | |
988 (mixal-add-operation-code | |
989 'J3NZ 'jump "jump I3 non-zero" (+ 40 1) 4 | |
990 "Jump if the content of rI3 is non-zero. | |
991 Register J is set to the value of the next instruction that would have | |
992 been executed when there was no jump." | |
993 1) | |
994 | |
995 | |
996 (mixal-add-operation-code | |
997 'J3NP 'jump "jump I3 non-positive" (+ 40 1) 5 | |
998 "Jump if the content of rI3 is non-positive. | |
999 Register J is set to the value of the next instruction that would have | |
1000 been executed when there was no jump." | |
1001 1) | |
1002 | |
1003 | |
1004 (mixal-add-operation-code | |
1005 'J4N 'jump "jump I4 negative" (+ 40 1) 0 | |
1006 "Jump if the content of rI4 is negative. | |
1007 Register J is set to the value of the next instruction that would have | |
1008 been executed when there was no jump." | |
1009 1) | |
1010 | |
1011 | |
1012 (mixal-add-operation-code | |
1013 'J4Z 'jump "jump I4 zero" (+ 40 1) 1 | |
1014 "Jump if the content of rI4 is zero. | |
1015 Register J is set to the value of the next instruction that would have | |
1016 been executed when there was no jump." | |
1017 1) | |
1018 | |
1019 | |
1020 (mixal-add-operation-code | |
1021 'J4P 'jump "jump I4 positive" (+ 40 1) 2 | |
1022 "Jump if the content of rI4 is positive. | |
1023 Register J is set to the value of the next instruction that would have | |
1024 been executed when there was no jump." | |
1025 1) | |
1026 | |
1027 | |
1028 (mixal-add-operation-code | |
1029 'J4NN 'jump "jump I4 non-negative" (+ 40 1) 3 | |
1030 "Jump if the content of rI4 is non-negative. | |
1031 Register J is set to the value of the next instruction that would have | |
1032 been executed when there was no jump." | |
1033 1) | |
1034 | |
1035 | |
1036 (mixal-add-operation-code | |
1037 'J4NZ 'jump "jump I4 non-zero" (+ 40 1) 4 | |
1038 "Jump if the content of rI4 is non-zero. | |
1039 Register J is set to the value of the next instruction that would have | |
1040 been executed when there was no jump." | |
1041 1) | |
1042 | |
1043 | |
1044 (mixal-add-operation-code | |
1045 'J4NP 'jump "jump I4 non-positive" (+ 40 1) 5 | |
1046 "Jump if the content of rI4 is non-positive. | |
1047 Register J is set to the value of the next instruction that would have | |
1048 been executed when there was no jump." | |
1049 1) | |
1050 | |
1051 | |
1052 (mixal-add-operation-code | |
1053 'J5N 'jump "jump I5 negative" (+ 40 1) 0 | |
1054 "Jump if the content of rI5 is negative. | |
1055 Register J is set to the value of the next instruction that would have | |
1056 been executed when there was no jump." | |
1057 1) | |
1058 | |
1059 | |
1060 (mixal-add-operation-code | |
1061 'J5Z 'jump "jump I5 zero" (+ 40 1) 1 | |
1062 "Jump if the content of rI5 is zero. | |
1063 Register J is set to the value of the next instruction that would have | |
1064 been executed when there was no jump." | |
1065 1) | |
1066 | |
1067 | |
1068 (mixal-add-operation-code | |
1069 'J5P 'jump "jump I5 positive" (+ 40 1) 2 | |
1070 "Jump if the content of rI5 is positive. | |
1071 Register J is set to the value of the next instruction that would have | |
1072 been executed when there was no jump." | |
1073 1) | |
1074 | |
1075 | |
1076 (mixal-add-operation-code | |
1077 'J5NN 'jump "jump I5 non-negative" (+ 40 1) 3 | |
1078 "Jump if the content of rI5 is non-negative. | |
1079 Register J is set to the value of the next instruction that would have | |
1080 been executed when there was no jump." | |
1081 1) | |
1082 | |
1083 | |
1084 (mixal-add-operation-code | |
1085 'J5NZ 'jump "jump I5 non-zero" (+ 40 1) 4 | |
1086 "Jump if the content of rI5 is non-zero. | |
1087 Register J is set to the value of the next instruction that would have | |
1088 been executed when there was no jump." | |
1089 1) | |
1090 | |
1091 | |
1092 (mixal-add-operation-code | |
1093 'J5NP 'jump "jump I5 non-positive" (+ 40 1) 5 | |
1094 "Jump if the content of rI5 is non-positive. | |
1095 Register J is set to the value of the next instruction that would have | |
1096 been executed when there was no jump." | |
1097 1) | |
1098 | |
1099 | |
1100 (mixal-add-operation-code | |
1101 'J6N 'jump "jump I6 negative" (+ 40 1) 0 | |
1102 "Jump if the content of rI6 is negative. | |
1103 Register J is set to the value of the next instruction that would have | |
1104 been executed when there was no jump." | |
1105 1) | |
1106 | |
1107 | |
1108 (mixal-add-operation-code | |
1109 'J6Z 'jump "jump I6 zero" (+ 40 1) 1 | |
1110 "Jump if the content of rI6 is zero. | |
1111 Register J is set to the value of the next instruction that would have | |
1112 been executed when there was no jump." | |
1113 1) | |
1114 | |
1115 | |
1116 (mixal-add-operation-code | |
1117 'J6P 'jump "jump I6 positive" (+ 40 1) 2 | |
1118 "Jump if the content of rI6 is positive. | |
1119 Register J is set to the value of the next instruction that would have | |
1120 been executed when there was no jump." | |
1121 1) | |
1122 | |
1123 | |
1124 (mixal-add-operation-code | |
1125 'J6NN 'jump "jump I6 non-negative" (+ 40 1) 3 | |
1126 "Jump if the content of rI6 is non-negative. | |
1127 Register J is set to the value of the next instruction that would have | |
1128 been executed when there was no jump." | |
1129 1) | |
1130 | |
1131 | |
1132 (mixal-add-operation-code | |
1133 'J6NZ 'jump "jump I6 non-zero" (+ 40 1) 4 | |
1134 "Jump if the content of rI6 is non-zero. | |
1135 Register J is set to the value of the next instruction that would have | |
1136 been executed when there was no jump." | |
1137 1) | |
1138 | |
1139 | |
1140 (mixal-add-operation-code | |
1141 'J6NP 'jump "jump I6 non-positive" (+ 40 1) 5 | |
1142 "Jump if the content of rI6 is non-positive. | |
1143 Register J is set to the value of the next instruction that would have | |
1144 been executed when there was no jump." | |
1145 1) | |
1146 | |
1147 (mixal-add-operation-code | |
1148 'SLA 'miscellaneous "shift left A" 6 0 | |
1149 "Shift to A, M bytes left. | |
1150 Hero's will be added to the right." | |
1151 2) | |
1152 | |
1153 | |
1154 (mixal-add-operation-code | |
1155 'SRA 'miscellaneous "shift right A" 6 1 | |
1156 "Shift to A, M bytes right. | |
1157 Zeros will be added to the left." | |
1158 2) | |
1159 | |
1160 | |
1161 (mixal-add-operation-code | |
1162 'SLAX 'miscellaneous "shift left AX" 6 2 | |
1163 "Shift AX, M bytes left. | |
1164 Zeros will be added to the right." | |
1165 2) | |
1166 | |
1167 | |
1168 | |
1169 (mixal-add-operation-code | |
1170 'SRAX 'miscellaneous "shift right AX" 6 3 | |
1171 "Shift AX, M bytes right. | |
1172 Zeros will be added to the left." | |
1173 2) | |
1174 | |
1175 | |
1176 (mixal-add-operation-code | |
1177 'SLC 'miscellaneous "shift left AX circularly" 6 4 | |
1178 "Shift AX, M bytes left circularly. | |
1179 The bytes that fall off to the left will be added to the right." | |
1180 2) | |
1181 | |
1182 | |
1183 (mixal-add-operation-code | |
1184 'SRC 'miscellaneous "shift right AX circularly" 6 4 | |
1185 "Shift AX, M bytes right circularly. | |
1186 The bytes that fall off to the right will be added to the left." | |
1187 2) | |
1188 | |
1189 (mixal-add-operation-code | |
1190 'MOVE 'miscellaneous "move" 7 'number | |
1191 "Move MOD words from M to the location stored in rI1." | |
1192 '(+ 1 (* 2 number))) | |
1193 | |
1194 (mixal-add-operation-code | |
1195 'NOP 'miscellaneous "no operation" 0 'ignored | |
1196 "No operation, M and F are not used by the machine." | |
1197 1) | |
1198 | |
1199 (mixal-add-operation-code | |
1200 'HLT 'miscellaneous "halt" 5 2 | |
1201 "Halt. | |
1202 Stop instruction fetching." | |
1203 1) | |
1204 | |
1205 (mixal-add-operation-code | |
1206 'IN 'input-output "input" 36 'unit | |
1207 "Transfer a block of words from the specified unit to memory. | |
1208 The transfer starts at address M." | |
1209 1) | |
1210 | |
1211 (mixal-add-operation-code | |
1212 'OUT 'input-output "output" 37 'unit | |
1213 "Transfer a block of words from memory. | |
1214 The transfer starts at address M to the specified unit." | |
1215 1) | |
1216 | |
1217 (mixal-add-operation-code | |
1218 'IOC 'input-output "input-output control" 35 'unit | |
1219 "Perform a control operation. | |
1220 The control operation is given by M on the specified unit." | |
1221 1) | |
1222 | |
1223 (mixal-add-operation-code | |
1224 'JRED 'input-output "jump ready" 38 'unit | |
1225 "Jump to M if the specified unit is ready." | |
1226 1) | |
1227 | |
1228 | |
1229 (mixal-add-operation-code | |
1230 'JBUS 'input-output "jump busy" 34 'unit | |
1231 "Jump to M if the specified unit is busy." | |
1232 1) | |
1233 | |
1234 (mixal-add-operation-code | |
1235 'NUM 'conversion "convert to numeric" 5 0 | |
1236 "Convert rAX to its numerical value and store it in rA. | |
1237 the register rAX is assumed to contain a character representation of | |
1238 a number." | |
1239 10) | |
1240 | |
1241 (mixal-add-operation-code | |
1242 'CHAR 'conversion "convert to characters" 5 1 | |
1243 "Convert the number stored in rA to a character representation. | |
1244 The converted character representation is stored in rAX." | |
1245 10) | |
1246 | |
1247 (defvar mixal-describe-operation-code-history nil | |
1248 "History list for describe operation code.") | |
1249 | |
1250 (defun mixal-describe-operation-code (&optional op-code) | |
1251 "Display the full documentation of OP-CODE." | |
1252 (interactive) | |
1253 ;; we like to provide completition and history, so do it ourself (interactive "?bla")? | |
1254 (unless op-code | |
1255 (let* ((completion-ignore-case t) | |
1256 ;; we already have a list, but it is not in the right format | |
1257 ;; transform it to a valid table so completition can use it | |
1258 (table (mapcar '(lambda (elm) | |
1259 (cons (symbol-name (car elm)) nil)) | |
1260 mixal-operation-codes-alist)) | |
1261 ;; prompt is different depending on we are close to a valid op-code | |
1262 (have-default (member (current-word) mixal-operation-codes)) | |
1263 (prompt (concat "Describe operation code " | |
1264 (if have-default | |
1265 (concat "(default " (current-word) "): ") | |
1266 ": ")))) | |
1267 ;; as the operation code to the user | |
1268 (setq op-code (completing-read prompt table nil t nil | |
1269 'mixal-describe-operation-code-history | |
1270 (current-word))))) | |
1271 ;; get the info on the op-code and output it to the help buffer | |
1272 (let ((op-code-help (assq (intern-soft op-code) mixal-operation-codes-alist))) | |
1273 (when op-code-help | |
1274 (with-output-to-temp-buffer (buffer-name (get-buffer-create "*Help*")) | |
1275 (princ op-code) (princ " is an mix operation code\n\n") | |
1276 (princ (nth 5 op-code-help)) (terpri) (terpri) | |
1277 (princ " group: ") (princ (nth 1 op-code-help)) (terpri) | |
1278 (princ " nice name: ") (princ (nth 2 op-code-help)) (terpri) | |
1279 (princ " OPCODE / C: ") (princ (nth 3 op-code-help)) (terpri) | |
1280 (princ " MOD / F: ") (princ (nth 4 op-code-help)) (terpri) | |
1281 (princ " time: ") (princ (nth 6 op-code-help)) (terpri))))) | |
1282 | |
1283 ;;;; Running | |
1284 (defun mixal-run () | |
1285 "Run's mixal file in current buffer, assumes that file has been compiled" | |
1286 (interactive) | |
1287 (mixvm (concat "mixvm -r -t -d " | |
1288 (file-name-sans-extension (buffer-file-name))))) | |
1289 | |
1290 (defun mixal-debug () | |
1291 "Starts mixvm for debugging, assumes that file has been compiled with debugging support" | |
1292 (interactive) | |
1293 (mixvm (concat "mixvm " | |
1294 (file-name-sans-extension (buffer-file-name))))) | |
1295 | |
1296 ;;;###autoload | |
1297 (define-derived-mode mixal-mode fundamental-mode "mixal" | |
1298 "Major mode for the mixal asm language. | |
1299 \\{mixal-mode-map}" | |
1300 (set (make-local-variable 'comment-start) "*") | |
1301 (set (make-local-variable 'comment-start-skip) "*") | |
1302 (set (make-local-variable 'font-lock-defaults) '(mixal-font-lock-keywords)) | |
1303 ; might add an indent function in the future | |
1304 ; (set (make-local-variable 'indent-line-function) 'mixal-indent-line) | |
1305 (set (make-local-variable 'compile-command) (concat "mixasm -g " | |
1306 buffer-file-name)) | |
1307 ;; mixasm will do strange when there is no final newline, | |
59247
d162faeebae4
(mixal-mode): Use mode-require-final-newline.
Richard M. Stallman <rms@gnu.org>
parents:
52401
diff
changeset
|
1308 ;; so let Emacs ensure that it is always there |
d162faeebae4
(mixal-mode): Use mode-require-final-newline.
Richard M. Stallman <rms@gnu.org>
parents:
52401
diff
changeset
|
1309 (set (make-local-variable 'require-final-newline) |
d162faeebae4
(mixal-mode): Use mode-require-final-newline.
Richard M. Stallman <rms@gnu.org>
parents:
52401
diff
changeset
|
1310 mode-require-final-newline)) |
51592 | 1311 |
1312 ;;;###autoload | |
1313 (add-to-list 'auto-mode-alist '("\\.mixal\\'" . mixal-mode)) | |
1314 | |
1315 (provide 'mixal-mode) | |
52401 | 1316 |
1317 ;;; arch-tag: be7c128a-bf61-4951-a90e-9398267ce3f3 | |
51592 | 1318 ;;; mixal-mode.el ends here |