| |
Sasq
Registered: Apr 2004 Posts: 155 |
Wanted: Source codes (for badass)
In order to improve my assembler it would be great to try it on existing projects.
So if you have sources for demos/intros/games that you don't mind sharing it would be kind if you could send them my way, and I'll try to get them working in bass.
They need to be buildable the normal way (Kickass, Acme or whatever) so I can compare the output binaries...
(this also means that if your type of demos requires special tools there is a greater chance I will include such functionality in bass).
-- sasq64@gmail.com |
|
... 65 posts hidden. Click here to view all posts.... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11136 |
Quote:How do we know what the code actually means ?
you write it, explicitly :) |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
This would mean that
table:
!fill 256
end:
size = table-end
sta data & (size-1)
sta data & $ff
would generate different opcodes, because size is not 8-bit
All this would require a complicated type and promotion system, and you could only get it to do _almost_ what you want.
I think
sta ; addressing mode depends on operand
sta.b ; zp
sta.w ; 16-bit
is probably the simplest/best way to do it. |
| |
Raistlin
Registered: Mar 2007 Posts: 572 |
Or just use sta.zp and sta.abs in the same way as KickAss? |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
Sure, what you call the suffix is no too important :)
Probably .8 .b .zp .z should all be synonyms
And .w .16 .abs |
| |
chatGPZ
Registered: Dec 2001 Posts: 11136 |
.whatimean |
| |
JackAsser
Registered: Jun 2002 Posts: 1990 |
Quote: Sure, what you call the suffix is no too important :)
Probably .8 .b .zp .z should all be synonyms
And .w .16 .abs
Hear hear |
| |
Peiselulli
Registered: Oct 2006 Posts: 81 |
ACME :
You can force ACME to use a specific addressing mode by adding "+1",
"+2" or "+3" to the assembler mnemonic. Each one of these postfixes
sets the relevant "Force Bit" in ACME's result. If Force Bit 3 is set,
ACME will use 24-bit addressing. Force Bit 2 means 16-bit addressing
and Force Bit 1 means 8-bit addressing. Higher Force Bits have higher
priorities.
Here's an (overly complicated) example:
symbol1 = $fb
symbol2 = $fd
symbol3+3 = $ff ; set Force Bit 3 and store in symbol's flags
ldx $fa
ldy+2 $fc ; set Force Bit 2 (16-bit addressing)
lda+3 $fe ; set Force Bit 3 (24-bit addressing)
stx symbol1
sty+2 symbol2 ; set Force Bit 2 (16-bit addressing)
sta symbol3 ; no need to set Force Bit 3 as it is
; already set in "symbol3".
will be assembled to
a6 fa ; ldx $fa
ac fc 00 ; ldy $00fc
af fe 00 00 ; lda $0000fe
86 fb ; stx $fb
8c fd 00 ; sty $00fd
8f ff 00 00 ; sta $0000ff
from:
https://github.com/meonwax/acme/blob/master/docs/AddrModes.txt |
| |
Krill
Registered: Apr 2002 Posts: 2852 |
ACME never ceases to amaze me over and over again with its creative syntax. =) |
| |
tlr
Registered: Sep 2003 Posts: 1723 |
I'm pondering a bit about syntax for referencing symbols in different scopes... towards inner scopes I guess 'outer.inner.symbol'... is a reasonable syntax, but what about the parent scope, or an absolute reference, i.e from the global scope?
Python3 uses .global and .nonlocal key words to specify the bindings of variables in the current scope, but I'd personally prefer something directly in the symbol reference.
Parent scope could be @p.symbol and global @g.symbol perhaps? Not entierly happy with that though.
Any personal favorites here?
(Maybe this should be in a new thread as it's a generic assembly syntax question, but it's useful for the discussion here as well.) |
| |
Krill
Registered: Apr 2002 Posts: 2852 |
Quoting tlrwhat about the parent scope, or an absolute reference, i.e from the global scope? Just a quick shot without thinking much about it, but what about a ".." prefix to go up/out one scope, similar to traversing folder structures? Would be something like "..outer.inner" to reach a same-level scope's inner symbol. Could be enhanced for "..." to go up two scopes, etc.
A fully qualified path starting from the global scope could be prefixed with ":", e.g., ":scope.child.grandchild".
@p.* and @g.* sure are not pretty. :) |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - Next |