flat assembler
Message board for the users of flat assembler.
Index
> Non-x86 architectures > how to realize CPU adresses words not bytes |
Author |
|
bitRAKE 02 Jun 2022, 09:20
I'm still thinking about the overall problem, but #2 can be realized in fasmg with the namespace separation mechanism. Here is another example, and this one.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
02 Jun 2022, 09:20 |
|
bitRAKE 02 Jun 2022, 09:31
Maybe preventing any odd byte output is another solution? In fasmg there are a limited number of data directives at the bottom of the hierarchy - they could be overloaded with a calminstruction which limits output. Similar to how relocations are accumulated and alignments are verified.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
02 Jun 2022, 09:31 |
|
Tomasz Grysztar 02 Jun 2022, 10:22
The AVR.INC in the classic examples for fasmg does this by overriding label definition with "(label) ?" macro definition:
Code: calminstruction (label) ? definition& local command match : command?, definition jno other match :: command?, definition jyes other arrange definition, =LABEL label =AT =$ =shr 1 assemble definition assemble command exit other: arrange definition, label definition assemble definition end calminstruction The AVR.INC also defines PC symbol to be equal to ($ shr 1), to be used in expressions where you need current address. In another of my early examples, one for DCPU-16 I override the $ symbol itself: Code: ; The following statement defines case-sensitive "$", while the internal "$" ; is case-insensitive (like all built-in symbols). Because such name has only ; one case, this definition effectively replaces the internal symbol unless ; the "$?" construction is used to directly access the case-insensitive one. $ equ ($? shr 1) |
|||
02 Jun 2022, 10:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.