;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file contains utf-8 non-ASCII characters, ;;; and so cannot be loaded into Emacs 22 or earlier. (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (string-lessp emacs-version "23") (error "`%s' was compiled for Emacs 23 or later" #$)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\302\303\304\305\306\307%\207" [require hexl custom-declare-group lmc nil "Customization group for the Little Man Computer simulator." :group languages] 6) #@26 Program counter for LMC. (defvar lmc--pc 0 (#$ . 589)) (make-variable-buffer-local 'lmc--pc) #@22 Accumulator for LMC. (defvar lmc-acc 0 (#$ . 688)) (make-variable-buffer-local 'lmc--acc) #@234 When non-nil, evaluate the code without extra delays. When nil, evaluation flashes the cursor at to help you see what's going on, which slows it down significantly. Also, when nil, evaluation is interrupted when the user hits a key. (defvar lmc-turbo nil (#$ . 785)) #@19 (fn &rest BODY) (defalias 'lmc--with-silent-modifications '(macro . #[128 "\300\301!\203\n\301B\207\302\303!\304\305B\306B\307\310B\311\312BBEE\207" [fboundp with-silent-modifications make-symbol "modified" let* ((buffer-modified-p)) ((buffer-undo-list t) (inhibit-read-only t) (inhibit-modification-hooks t) deactivate-mark buffer-file-name buffer-file-truename) unwind-protect progn unless ((restore-buffer-modified-p nil))] 9 (#$ . 1058)])) (byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put lmc--with-silent-modifications edebug-form-spec t function-put lisp-indent-function 0] 4) #@14 (fn N MAX) (defalias 'lmc--numberp #[514 "\247\205\300!\204\301\302\"\205W\206\301\303\"\207" [natnump error "%S is not a positive integer" "%S is too large"] 5 (#$ . 1670)]) #@23 (fn ARG LABELS MAX) (defalias 'lmc--resolve #[771 "\300\"\203 \207\236A\206\3019\203\302\202\303\"\207" [lmc--numberp error "Unknown label %S" "Arg %S is neither a label nor a number"] 6 (#$ . 1867)]) #@42 Mnemonic table for arity-1 instructions. (defconst lmc-mnemonic-1-table '((LDA . 5) (STO . 3) (STA . 3) (ADD . 1) (SUB . 2) (BR . 6) (BRA . 6) (BRZ . 7) (BRP . 8)) (#$ . 2090)) #@42 Mnemonic table for arity-0 instructions. (defconst lmc-mnemonic-0-table '((HLT . 0) (COB . 0) (IN . 901) (INP . 901) (OUT . 902)) (#$ . 2273)) #@13 (fn CMDS) (defalias 'lmc--assemble #[257 "\302\303\211\203\225\211@\211A\262\211:\204\211\236\203-@\304=\203&GS\202'\305\\\262\202\216\211\247\203p\306!\203>\211\307W\204F\310\311\"\210\202\216\211W\203T\310\312\"\210\202\216\313\"\203j\310\314\313\"@#\210\202\216\211\262\202\216\211\203\216\2119\203\216\211\236\203\207\310\315\"\210\202\216\211BB\262A\266\202\202\210\303C\303C\316\211\203q\211@\211A\262\242b\210\211\236\203\275\236A\317$\210\202j\211\243\204\327\211\242\236\203\327@\236A\317$\210\202j\211\242\304=\203\376\211A\211\203\372\211@\320\f\321##\210A\266\202\202\340\210\202j\211\242 \236\203@ \236A\307_\320A@ \307#\\\317$\210\202j\211\247\203E\211\242GZ\302\211W\203@\211\302#\266\211T\262\202)\266\202j\211\203e\2119\203e\211\236A\242G=\204^\322\323!\210\240\210\202j\310\324\"\210A\266\202\202\234\210\242\237\266\203\207" [lmc-mnemonic-0-table lmc-mnemonic-1-table 0 nil DAT 1 natnump 100 error "%S is not a valid address" "Address %S already used" rassq "Label %S needs to come after address %S" "Duplicate label %S" #[1027 "\242E\242B\240\210\300\240\207" [nil] 8 "\n\n(fn WORDS LL W &optional CODE)"] code lmc--resolve 1000 cl--assertion-failed (eq (cdr (assq cmd labels)) (length words)) "Invalid instruction %S"] 17 (#$ . 2422)]) #@18 (fn WORD ADDR) (defalias 'lmc--load-word #[514 "n\204\300\301!\210\302\303\304\"\305\306\307\306\310\306&c\210@A@\3118\203-9\203-\312!c\210\313c\210\303\314\"c\210\211\203>\315\202?\316c\207" [cl--assertion-failed (bolp) propertize format " %02d: " read-only t front-sticky rear-nonsticky 2 symbol-name #(" " 0 1 (rear-nonsticky t read-only t)) " %03d" #("\n" 0 1 (rear-nonsticky t read-only t lmc-code t)) #("\n" 0 1 (rear-nonsticky t read-only t))] 10 (#$ . 3809)]) #@13 (fn WORD) (defalias 'lmc-disassemble-word #[257 "\302\303\245\"@\211\203\211\304\303\"D\202!\302 \"\205!\302 \"@C\207" [lmc-mnemonic-1-table lmc-mnemonic-0-table rassq 100 mod] 6 (#$ . 4301)]) #@13 (fn ADDR) (defalias 'lmc-addr->point #[257 "eb\210\211y\207" [] 2 (#$ . 4511)]) (defalias 'lmc-point->addr #[0 "\300e`\"n\203\f\301\202 \302Z\207" [count-lines 0 1] 3]) #@27 (fn &optional ADDR FIX) (defalias 'lmc-get-word #[512 "\212\204 \300y\210\202\301!\210\302\303\304 \305#\203 \306\307\310!!\202T\302\311\304 \305#\203S\306\307\310!!\211\250\2048\312!\262\313\314\"\262\203M\315\316\317\"\305\211\320\310%\210\211\262\202T\300)\207" [0 lmc-addr->point re-search-forward " .* \\([0-9][0-9][0-9]\\)$" line-end-position t string-to-number match-string 1 " .* \\(.*\\)$" truncate mod 1000 replace-match format " %03d" nil] 9 (#$ . 4690)]) (defconst lmc-label-re "^\\([^ \n]*\\) \\(.*\\) *[0-9]") (defvar lmc-label-table nil) #@19 (fn ADDR LABEL) (defalias 'lmc-record-label #[514 "H\211\205 \211@\232?\205\"CI\210\211A\205\"\301\302\303\304pA%\207" [lmc-label-table run-with-timer 0 nil #[514 "rq\210\212\211\211\205'\211@\301T!\210o\204 \302\303`S`\304\305$\210)A\266\202\202\262*\207" [inhibit-read-only lmc-addr->point t put-text-property fontified nil] 9 "\n\n(fn BUF REFADDRS)"]] 9 (#$ . 5273)]) #@13 (fn ADDR) (defalias 'lmc-get-label #[257 "\212\301!\210\302\303\304#\205\305\225\305\224V\205\306\305!\307\"\210\211\262)\207" [lmc-label-re lmc-addr->point re-search-forward nil t 2 match-string lmc-record-label] 5 (#$ . 5671)]) (defalias 'lmc-font-lock-opcode #[0 "\301 \302\303\304\305\306!\307\"\310$\216\311\312 \313\"\205d\314 \315!\211A@\250\203P\211A@\316!\317 H\211A\320\"\203;\211\202>B\262\241\266\211\203NA\211\240\266\266\321\312 \312 T\322\323\324\206_\325\"$\266\326)\207" [lmc-label-table match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 get-text-property line-end-position lmc-code lmc-get-word lmc-disassemble-word lmc-get-label lmc-point->addr memql put-text-property display format #(" %s\n" 0 1 (cursor t) 1 3 (face font-lock-comment-face)) (Invalid opcode) nil] 12]) (defalias 'lmc-font-lock-label #[0 "\302\303 \304\225\304\224V\205\305\304!\"\210\212\306\304_S!\210\304\225`V\2035\307u\210\310\304\224\304\225\311\305\304!$\210\310`\304\225\312\313$\210) \207" [tab-width font-lock-constant-face lmc-record-label lmc-point->addr 2 match-string move-to-column -1 put-text-property help-echo display "…"] 6]) (defconst lmc-font-lock-keywords (byte-code "\301B\302B\207" [lmc-label-re ((1 'hexl-address-region) (2 (lmc-font-lock-label))) ((".$" (0 (lmc-font-lock-opcode))))] 2)) #@20 (fn BEG END LEN) (defalias 'lmc-after-change #[771 "?\205\212b\210\301w\210`W\205\302c\210\303\304!\210\202 )\207" [inhibit-read-only "^ \n" " " delete-char 1] 5 (#$ . 7064)]) #@22 LMC program counter. (defvar lmc-pc 0 (#$ . 7257)) (make-variable-buffer-local 'lmc-pc) #@18 LMC accumulator. (defvar lmc-acc nil (#$ . 7351)) (make-variable-buffer-local 'lmc-acc) #@18 Past LMC output. (defvar lmc-output nil (#$ . 7445)) (make-variable-buffer-local 'lmc-output) #@25 State where we stopped. (defvar lmc--stopped nil (#$ . 7545)) (make-variable-buffer-local 'lmc--stopped) (defalias 'lmc-update-pc #[0 "\303\304\"\305!\210 `\306\223\210\307\310\306\311#\210\312\313 \314\"?\205+\311\315\313 \313 Td^\314\311$)\207" [lmc-pc overlay-arrow-position inhibit-read-only mod 100 lmc-addr->point nil re-search-forward " .* *" t get-text-property line-end-position lmc-code put-text-property] 5]) (defalias 'lmc--state #[0 "\302  E\207" [lmc-acc lmc-pc buffer-chars-modified-tick] 3]) (defalias 'lmc-stopped-p #[0 "\301 \232\207" [lmc--stopped lmc--state] 2]) (defvar lmc-mode-map (byte-code "\300 \301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\311#\210\301\312\313#\210\211\207" [make-sparse-keymap define-key "" lmc-step "" lmc-run "\f" lmc-load-file "" lmc-set-acc "" lmc-set-pc] 5)) #@19 Menu for LMC-Sim. (defvar lmc-menu nil (#$ . 8396)) (easy-menu-do-define 'lmc-menu lmc-mode-map "Menu for LMC-Sim." '("LMC-Sim" ["Step" lmc-step (not (lmc-stopped-p))] ["Run" lmc-run (not (lmc-stopped-p))] ["Load file" lmc-load-file] "--" ["Set Program Counter" lmc-set-pc] ["Set Accumulator" lmc-set-acc])) (defvar lmc-tool-bar-map (byte-code "\300 \301\302\303\304\305\306\307\310&\210\301\311\312\313\305\314\307\315&\210\211\207" [make-sparse-keymap tool-bar-local-item "gud/next" lmc-step step :label "Step" :enable (not (lmc-stopped-p)) "gud/run" lmc-run run "Run" (not (lmc-stopped-p))] 10)) #@22 (fn &optional MAP) (defalias 'lmc-tool-bar-to-string #[256 "\301C\302\303\304\305\306\307!\310\"\311\312%\313 )\206\314\315!\"\210\211\242\207" [tool-bar-map "" map-keymap make-byte-code 514 "\211@\301=\205\214\211A@\3028\3038:\203\304\202\303\233\305\306\"\305\307\"\310\311\"\2031\305\311\"\2022\312\313!\314 \315\316 #\210\315\317 #\210\211\262\320\321\322\206R\n\323\324\325\326\n\205]\327\330\331\332@\333=\203y\204y\333\334\335ABBB\202{& \300\211\242\320\321\332\336\324\325%Q\240\266\211\207" vconcat vector [menu-item 2 3 4 plist-get :help :image plist-member :enable t eval make-sparse-keymap define-key [header-line mouse-1] [header-line mouse-2] propertize " " help-echo keymap face header-line mouse-face mode-line-highlight rear-nonsticky (display keymap help-echo) display image :conversion disabled (space :width 0.5)] 27 "\n\n(fn K V)" tool-bar-make-keymap key-binding [tool-bar]] 9 (#$ . 9005)]) (defvar lmc-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [lmc-mode-hook variable-documentation put "Hook run after entering LMC-Sim mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp lmc-mode-map definition-name lmc-mode] 4) (defvar lmc-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\317#\207" [lmc-mode-abbrev-table lmc-mode-map variable-documentation put purecopy "Keymap for `lmc-mode'." boundp lmc-mode-syntax-table definition-name lmc-mode (lambda (#1=#:def-tmp-var) (defvar lmc-mode-syntax-table #1#)) make-syntax-table "Syntax table for `lmc-mode'." (lambda (#1#) (defvar lmc-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `lmc-mode'." derived-mode-parent] 5) #@158 The simulator of the Little Man Computer. This mode runs the hook `lmc-mode-hook', as the final or penultimate step during initialization. \{lmc-mode-map} (defalias 'lmc-mode #[0 "\306\300!\210\307\310 \210\311\312\313 !\210\314\f!\210 =\306\315!\210\307 \306\316!\210\307\306\317!\210\320\306\321!\210\322\306\323!\210\324\325\326\327\330\307$\210\306\331!\210\332\333\330\"\306\334!\210\335 \336 \210\306\337!\210\340\341\342\343\312\344\345#\342\343\346\344\347#\350\351\343\352\353\354\355\356\357\307\360\361& \362BBD\342\343\363\344\347#\350\351\343\364\353\354\355\365\357\307\360\366& \367BBD\370\343\371\344\347#\372BBBBBBBBBBBB)\373\374!\207" [delay-mode-hooks major-mode mode-name lmc-mode-map lmc-mode-syntax-table lmc-mode-abbrev-table make-local-variable t kill-all-local-variables lmc-mode "LMC-Sim" use-local-map set-syntax-table truncate-lines truncate-partial-width-windows tab-width 10 font-lock-defaults (lmc-font-lock-keywords t) font-lock-extra-managed-props (display help-echo) add-hook after-change-functions lmc-after-change nil lmc-label-table make-vector 100 overlay-arrow-position point-min-marker lmc-update-pc header-line-format "" (:eval (lmc-tool-bar-to-string lmc-tool-bar-map)) " " propertize face (bold italic) "PC=" font-lock-function-name-face :eval format "%02d" mouse-face mode-line-highlight help-echo "mouse-2: set the Program Counter" follow-link keymap (keymap (header-line keymap (down-mouse-1 . ignore) (mouse-2 . lmc-set-pc) (mouse-1 . lmc-set-pc))) (lmc-pc) "ACC=" "%03d" "mouse-2: set the Accumulator" (keymap (header-line keymap (down-mouse-1 . ignore) (mouse-2 . lmc-set-acc) (mouse-1 . lmc-set-acc))) (lmc-acc) " " "Recent output=" ((:eval (if lmc-output (format "%s" lmc-output) "()"))) run-mode-hooks lmc-mode-hook local-abbrev-table] 21 (#$ . 11059) nil]) #@35 Set the Program Counter. (fn PC) (defalias 'lmc-set-pc #[257 "\211\301 \207" [lmc-pc lmc-update-pc] 2 (#$ . 12902) (byte-code "\301\302\"C\207" [lmc-pc read-number "New PC: "] 3)]) #@32 Set the Accumulator. (fn ACC) (defalias 'lmc-set-acc #[257 "\301\302\"\211\207" [lmc-acc mod 1000] 4 (#$ . 13092) (byte-code "\301\302\"C\207" [lmc-acc read-number "New Accumulator: "] 3)]) #@14 (fn WORDS) (defalias 'lmc-load #[257 "\304\305!\210\306 \210\307\310\310\211\311\312 \210\211\203+\211@\313\"\210T\262A\266\202\202\210\211\314W\203>\313\315\"\210\211T\262\202,)\266\316 \207" [inhibit-read-only lmc-pc lmc-acc lmc-output pop-to-buffer "*LMC-Sim*" lmc-mode t 0 nil erase-buffer lmc--load-word 100 (0) lmc-update-pc] 9 (#$ . 13292)]) (byte-code "\300\301\302\303\304DD\305\306\307%\207" [custom-declare-variable lmc-store-flash funcall function #[0 "\300\207" [t] 1] "If non-nil, memory words blink when modified." :type boolean] 6) #@13 (fn SECS) (defalias 'lmc--sit-for #[257 "?\205\301!\207" [lmc-turbo sit-for] 3 (#$ . 13867)]) #@18 (fn ADDR WORD) (defalias 'lmc-store-word #[514 "\212\304!\210\305\306\307 \310#\204\311\312\"\202\223\313\224\203<\314 \310\211\310\315\316\317\320\321!\322\"\323$\216\324`\325\326$\210,\210\327\330!\210`\331\332\"c\210|\266\205\221\327\333!\210\314 \310\211\310\315\316\317\320\321!\334\"\323$\216\324`\325\326$\210,\210\327\335!\210\314 \310\211\310\315\316\317\320\321!\336\"\323$\216\324`\325\337$\210,\210\327\340!\262)\207" [lmc-store-flash buffer-undo-list inhibit-read-only inhibit-modification-hooks lmc-addr->point re-search-forward " .* \\(.*\\)$" line-end-position t error "Missing memory cell %S" 1 buffer-modified-p make-byte-code 0 "\300?\205\301\302!\207" vconcat vector [restore-buffer-modified-p nil] 2 put-text-property face region lmc--sit-for 0.2 format " %03d" 0.1 [restore-buffer-modified-p nil] 0.1 [restore-buffer-modified-p nil] nil 0.1] 11 (#$ . 13973)]) #@30 Execute one LMC instruction. (defalias 'lmc-step #[0 "\304\305\"\306!\211@\211\307=\203(\310 \203\311\312!\210\202\364\313 \314 \210\315\316!\210\202\364\211\317=\203;\320\321\322!\323\"T\202\364\211\324=\203S\315\325\n\"\210\326\327\n\" BT\202\364\211\330=\203e\304A@!T\202\364\211\331=\203x\332A@\n\"\210T\202\364\211\333=\203\217\320\n\304A@!\\\323\"T\202\364\211\334=\203\246\320\n\304A@!Z\323\"T\202\364\211\335=\203\263A@\202\364\211\336=\203\313\n\337U\203\305A@\202\307T\202\364\211\340=\203\343\n\341W\203\335A@\202\337T\202\364\211\204\357\311\342\"\210\202\364\311\343\"\210\266\344 \207" [lmc-pc lmc--stopped lmc-acc lmc-output lmc-get-word fix lmc-disassemble-word HLT lmc-stopped-p error "Already halted" lmc--state force-mode-line-update message "Done." IN mod read-number "Enter a number: " 1000 OUT "Output: %03d" format "%03d" LDA STO lmc-store-word ADD SUB BR BRZ 0 BRP 500 "Invalid instruction %S" "%S not implemented" lmc-update-pc] 7 (#$ . 14895) nil]) #@89 Run the code until hitting a HLT. The machine will also stop if the user presses a key. (defalias 'lmc-run #[0 "\204 \301 \206 \302 ?\205\303 \210\304\305!\210\202\207" [lmc-turbo input-pending-p lmc-stopped-p lmc-step lmc--sit-for 0.05] 2 (#$ . 15940) nil]) (defvar lmc-asm-mode-map (byte-code "\300 \301\302\303#\210\301\304\305#\210\211\207" [make-sparse-keymap define-key "\f" lmc-asm-load "" lmc-asm-assemble] 5)) #@28 Menu for the LMC-Asm mode. (defvar lmc-asm-menu nil (#$ . 16377)) (easy-menu-do-define 'lmc-asm-menu lmc-asm-mode-map "Menu for the LMC-Asm mode." '("LMC-Asm" ["Assemble" lmc-asm-assemble] ["Load into Simulator" lmc-asm-load])) (defconst lmc-asm-mnemonic-names (byte-code "\302\303\304\302\305\"\302\305 \"\306#\"\207" [lmc-mnemonic-1-table lmc-mnemonic-0-table mapcar symbol-name append car (DAT)] 7)) (defconst lmc-asm-mnemonic-names-re (regexp-opt lmc-asm-mnemonic-names)) (defvar lmc-asm-font-lock-keywords (byte-code "\301\302\303Q\304BD\207" [lmc-asm-mnemonic-names-re ("^[ ]*\\(?:\\sw\\|\\s_\\)+" (0 (if (zerop (nth 0 (syntax-ppss))) font-lock-constant-face))) "(\\(" "\\_>\\)" ((1 font-lock-keyword-face))] 4)) (defvar lmc-asm-imenu-generic-expression '((nil "^\\(\\(?:\\sw\\|\\s_\\)+\\)" 1))) (defvar lmc-asm-outline-regexp "^\\(?:\\sw\\|\\s_\\)") (add-to-list 'auto-mode-alist '("\\.elmc\\'" . lmc-asm-mode)) (defvar lmc-asm-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [lmc-asm-mode-hook variable-documentation put "Hook run after entering LMC-Asm mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp lmc-asm-mode-map definition-name lmc-asm-mode] 4) (defvar lmc-asm-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\300!\204#\303\300\307\310#\210\311\312\300\313\"\210!\210\300\302N\2041\303\300\302\304\314!#\210\303\310\315\313#\207" [lmc-asm-mode-abbrev-table lmc-asm-mode-map variable-documentation put purecopy "Keymap for `lmc-asm-mode'." boundp definition-name lmc-asm-mode (lambda (#1=#:def-tmp-var) (defvar lmc-asm-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `lmc-asm-mode'." derived-mode-parent] 5) #@162 Major mode to edit LMC assembly code. This mode runs the hook `lmc-asm-mode-hook', as the final or penultimate step during initialization. \{lmc-asm-mode-map} (defalias 'lmc-asm-mode #[0 "\306\300!\210\307\310 \210\311\312\313 !\210\314\f!\210 \306\315!\210\316 \306\317!\210\320\306\321!\210\307\306\322!\210\306\323!\210 \324\325\326\327\307$\210\306\330!\210\331\306\332!\210\333)\334\335!\207" [delay-mode-hooks major-mode mode-name lmc-asm-mode-map emacs-lisp-mode-syntax-table lmc-asm-mode-abbrev-table make-local-variable t kill-all-local-variables lmc-asm-mode "LMC-Asm" use-local-map set-syntax-table font-lock-defaults (lmc-asm-font-lock-keywords) indent-line-function lmc-asm-indent-line indent-tabs-mode imenu-generic-expression outline-regexp add-hook completion-at-point-functions lmc-asm-completion nil comment-start ";" comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *" run-mode-hooks lmc-asm-mode-hook local-abbrev-table lmc-asm-imenu-generic-expression lmc-asm-outline-regexp] 5 (#$ . 18225) nil]) #@15 (fn STRING) (defalias 'lmc-asm-labels #[257 "\212`eb\210\301\302\303\304\305!\306G\307V\203\310\202\311\260\312\301\313#\203A\314\225W\2044\314\224V\203\315\314\225\307\225\"B\262\202\266\202\262)\207" [lmc-asm-mnemonic-names-re nil "\\(^\\|(" "[ ]+" "\\)" regexp-quote "\\(?:\\sw\\|\\s_\\)" 0 "*" "+" re-search-forward t 1 buffer-substring-no-properties] 11 (#$ . 19286)]) (defalias 'lmc-asm-completion #[0 "\212\301 \3028\203 \303\202T\211@\304U\2031\305\306!\210\212\307\303x\210n)\205T`\212\310\306!\210`)\311\312!E\202T\211@\313U\205T\305\306!\210`\212\310\306!\210`)`Sf\314=\203P\202S\311\312!E\262)\207" [lmc-asm-mnemonic-names syntax-ppss 8 nil 0 skip-syntax-backward "w_" " " skip-syntax-forward completion-table-dynamic lmc-asm-labels 1 40] 5]) (defalias 'lmc-asm-indentation #[0 "\212\302 \210\303 @\304V\203\305\202M\306\307!\203\202M\306 !\204.\306\310!\203*\202M\304\202M\306\311!\2048\305\202M\212\312`[!\210o)\203G\304\202M\312d!\210\313 )\207" [tab-width comment-start-skip back-to-indentation syntax-ppss 0 nil looking-at "(" "[ ]*$" "\\s<\\s<" forward-comment lmc-asm-indentation] 2]) #@22 (fn &optional ARG) (defalias 'lmc-asm-indent-line #[256 "\212\304 \210\305 @\306U\203A\307\310P!\203A\311c\210\312p! \236\203%\313c\210\202A\314 \3151;\312p!\210`X\2057\313c0\202?\210\202@\210\210)\316 \211\204N\317!\202\230\211\320 \210)\211\306U\205\230\212\321 \210\307\322!\205\227\323\224b\210i W\203\206\212\323\225b\210i U)?\205\227\323\224\323\225|\210 j\202\227\324\323!\325\232?\205\227\323\224\323\225|\210\325c)\207" [lmc-asm-mnemonic-names-re lmc-mnemonic-0-table left-margin tab-width back-to-indentation syntax-ppss 0 looking-at "\\_>" "(" read ")" line-end-position (error) lmc-asm-indentation lisp-indent-line indent-to-left-margin beginning-of-line "\\(?:\\sw\\|\\s_\\)+\\([ ]*\\)(" 1 match-string " "] 4 (#$ . 20451)]) (defalias 'lmc-asm-read #[0 "\300`eb\210\301d!\210m\204-`\3021 `\303p!BB\211\2620\202(\210\211b\210\304\305\300\"\266\202\211b\210\237\207" [nil forward-comment (end-of-file) read signal end-of-file] 6]) #@45 Load current buffer into the LMC simulator. (defalias 'lmc-asm-load #[0 "`p\300 =\205\n\301 r\302\303\304 !!\210)b\210\211\205&p\300!=\205&\305`\"\207" [window-buffer selected-window lmc-load lmc--assemble lmc-asm-read set-window-point] 5 (#$ . 21431) nil]) #@42 Assemble current buffer to check syntax. (defalias 'lmc-asm-assemble #[0 "`\300\301 !\210\211b\210\302\303!\207" [lmc--assemble lmc-asm-read message "No errors found"] 3 (#$ . 21701) nil]) #@46 Load FILE into the LMC simulator. (fn FILE) (defalias 'lmc-load-file #[257 "\300!\301!\302\303\304\305\306\"\307\"\310$\216r\211q\210\3111#\312 0\202-\313\314\315 \316!#\262*\207" [find-buffer-visiting find-file-noselect make-byte-code 0 "\300?\205\302\301!\207" vconcat vector [kill-buffer] 2 (error) lmc-asm-load error "Error at line %d: %s" line-number-at-pos error-message-string] 10 (#$ . 21896) (byte-code "\300\301\302\211\303\302\304&C\207" [read-file-name "Load LMC file: " nil t #[257 "\301!\206\302\303\304\305#)\266\203\207" [inhibit-changing-match-data file-directory-p "\\.elmc\\'" nil t string-match] 8 "\n\n(fn FILE)"]] 7)]) (provide 'lmc)