flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
dosmancer 03 Jun 2025, 18:57
There isn't anything like this yet, or is there?
I thought it'd be a cool idea. Made an experiment. I made a quick test site that works but I won't share that since security was not a priority. I added fasmg but a lot of features don't work since I have only done the minimum requirements. I am not sure how much time I'm going to spend on improving it, probably not much at least not now, so many "side quests" in life already. I'd prefer to not host this myself or maybe I can I'm not sure. I'm open for collab, MRs and such. Maybe we could get this, or a more polished version of it, into the main compiler-explorer repo and godbolt.org site for example. To make it really good one could add syntax highlighting, keywords et cetera. https://github.com/fredrik-hjarner/compiler-explorer-fasmg
|
||||||||||
![]() |
|
dosmancer 08 Jun 2025, 00:11
I put up a proof-of-concept site https://fasmg-experiment.ddns.net/
no bells n whistles but pretty nice to use on cellphone for short one-off experiments when a real computer is unavailable. |
|||
![]() |
|
bitRAKE 08 Jun 2025, 07:48
Very nice work. Those long bus/train rides have an added dimension.
|
|||
![]() |
|
bitRAKE 08 Jun 2025, 16:38
Namespaces can use numerical identifiers.
We can create a similar effect as "#pragma once". Browser caching also works, afaict. Happy to test any functionality. - labels change color if additional line content - tabs are four spaces |
|||
![]() |
|
dosmancer 08 Jun 2025, 17:54
bitRAKE wrote: Namespaces can use numerical identifiers. Testing is very helpful. and requesting features but the implementation speed with be ultra slow. Nice to see that snippets work. Regarding syntax highlighting I had hoped that it used the same as vscode (since both Compiler Explorer and vscode use monaco editor) but they dont (vscode uses TextMate grammar and Monaco itself uses something called Monarch) so I will not improve the syntax highlighting sadly (unless I notice TextMate grammars can be easily transformed into Monarch grammar). Also dont "rely" too much on this as I have not made any automated backups (in case of important snippets of code one does not want to lose) |
|||
![]() |
|
bitRAKE 08 Jun 2025, 19:42
I'm not familiar with Monaco/Monarch but I want this as a more viable option and am willing to spend some time on it. A complete solution is impossible* as the highlighter is stateless, but some lesser featureful option should be possible.
* Dynamic directives (removecomments/retaincomments, combinelines/isolatelines, etc) and the fundamental nature of fasmg can break a stateless highlighter. |
|||
![]() |
|
dosmancer 08 Jun 2025, 21:36
woa. I realized there's even a noscript version available out of the box: https://fasmg-experiment.ddns.net/noscript/z/4zsner
Quote: I'm not familiar with Monaco/Monarch but I want this as a more viable option and am willing to spend some time on it. That makes me happy. Pleas do if you want. Yes I'd be great if this could be polished a bit more. Seems documentation is around here: https://github.com/compiler-explorer/compiler-explorer/blob/main/docs/AddingALanguage.md https://microsoft.github.io/monaco-editor/monarch.html I think this is the syntax highlighter that is in use currently: https://github.com/compiler-explorer/compiler-explorer/blob/main/static/modes/asm-mode.ts I can take a look at the server/host-side and try to figure out how to backup and such as that's also important. |
|||
![]() |
|
dosmancer 09 Jun 2025, 19:53
Ok, now daily backups are made and they can also be restored. Restarting the host/server computer seems to work well too, everything starts as it should after reboots.
Only thing remaining host-side, at least that I can think of now, is experimenting with rebuilding compiler-explorer when the repo has been updated. Rebuidling is currently exteremly slow since the host machine only has 1GB RAM (and building requires a bit more than 3GB so is uses 2GB swap). |
|||
![]() |
|
bitRAKE 10 Jun 2025, 00:01
bitRAKE wrote: A complete solution is impossible static/modes/fasmg-min-mode.ts Code: import * as monaco from 'monaco-editor'; monaco.languages.register({ id: 'fasmg' }); const language: monaco.languages.IMonarchLanguage = { syntactical: /[\!\#\&\(\)\*\+\,\-\.\/\:\;\<\=\>\?\[\\\]\`\{\|\}\~]/, tokenizer: { root: [ [/\s+/, 'white'], [/;.*$/, 'comment'], [/('|")(?:(?!\1).|\1\1)*\1/, 'string'], [/@syntactical/, 'invalid'], // Float / scientific formats [/\d(?:[\d_'])*(?:(?:(?:\.[\d_']*\d)?[Ee][+-]?[\d_']*\d)|(?:(?:\.[\d_']*\d)?[Ff])|(?:\.[\d_']*\d))/, 'number.float'], // Hex formats [/\$[0-9A-Fa-f][0-9A-Fa-f_']*/, 'number.hex'], [/0x[0-9A-Fa-f][0-9A-Fa-f_']*/, 'number.hex'], [/[0-9][0-9A-Fa-f_']*[Hh]/, 'number.hex'], // Binary, octal, decimal [/[01][01_']*[Bb]/, 'number.binary'], [/[0-7][0-7_']*[OoQq]/, 'number.octal'], [/\d[\d_']*[Dd]?/, 'number'], ], }, }; monaco.languages.setLanguageConfiguration('fasmg', { comments: { lineComment: ';', }, brackets: [ ['{', '}'], ['[', ']'], ['(', ')'], ['<', '>'], ], autoClosingPairs: [ { open: '{', close: '}' }, { open: '[', close: ']' }, { open: '(', close: ')' }, { open: "'", close: "'", notIn: ['string', 'comment'] }, { open: '"', close: '"', notIn: ['string', 'comment'] }, ], surroundingPairs: [ { open: '{', close: '}' }, { open: '[', close: ']' }, { open: '(', close: ')' }, { open: '<', close: '>' }, { open: '"', close: '"' }, { open: "'", close: "'" }, ] }); monaco.languages.setMonarchTokensProvider('fasmg', language); export default language; I'm continuing to work on the full-featured version. A timely relevant blog post, How Compiler Explorer Works in 2025. Last edited by bitRAKE on 10 Jun 2025, 06:39; edited 1 time in total |
|||
![]() |
|
dosmancer 10 Jun 2025, 06:39
Awesome. Tried it a bit and seems good. I was surprised that these two were actually valid:
Code: x = $01_ repeat 1, i:x display `i, 13, 10 end repeat x = 0x01_ repeat 1, i:x display `i, 13, 10 end repeat I "think" the regexes could be shortened a bit if ignoreCase is used. Case never matters for the builtin stuff, right? |
|||
![]() |
|
bitRAKE 10 Jun 2025, 06:41
I had a similar thought, but ignoreCase doesn't appear to work in character classes.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.