0 Members and 2 Guests are viewing this topic.
I'm currently porting a big project from BASIC to Axe, and I needed to store flags (for account managing). That's when I realized that Axe lacks bit support ({A}e0 works fine, but there's nothing like 1->{A}e0 to set / reset flags)
QuoteI'm currently porting a big project from BASIC to Axe, and I needed to store flags (for account managing). That's when I realized that Axe lacks bit support ({A}e0 works fine, but there's nothing like 1->{A}e0 to set / reset flags)Or you can do {A} or value -> {A} and {A} xor value -> {A} to set/reset a bit (with value from [1-2-4...-128] As for token hook doesn't working, quickly looking at the source didn't give me apparent errors, but since you use a lot of SMC, it is kinda hard to see Maybe a more experimented axiom coders could tell, or me taking more time to look/test, but time is precious for me these days
The token hook works for me:
As for functions behaving incorrectly, I see two issues in a first look:The code you use to signal that the next address should be replaced actually signals not to replace the next address. The correct signal is $7F. I'd also advise using the REP_NEXT macro provided by Axe.inc instead of producing the signals manually, although some tweaking may need to be done for it to work properly in some assemblers.All arguments are passed as 16-bit values, but you pop some off the stack into af. This puts the low byte (the one you want) into f, not a. You should pop these arguments into a 16-bit register pair and then move them into a.
; The following prefixes will change the replacement policy:;; $7F Next instruction is a relative address.; $40,$Offs Next instruction is a relative address with an unsigned byte offset.; $49 Next instruction is an absolute address.
-> Info : I'm using Axe 1.2.2a. Which one do you use Runer ?
I use ld s on absolute addresses, not relative ones... Did I misunderstand ?
Quote from: ISSOtm on May 10, 2015, 03:25:00 pmI use ld s on absolute addresses, not relative ones... Did I misunderstand ?Notice each command's code starts with .org 0. This means that all the labels in your code are offsets relative to the start of the code, and the REP_NEXT macro signals that the next 16-bit immediate value is such a relative value to which the actual base address of the code should be added when compiled.The ABS_NEXT macro signals that the next 16-bit immediate value is an absolute (fixed) value that is not relative to anything and should not be offset.
Quote from: ISSOtm on May 10, 2015, 03:25:00 pm-> Info : I'm using Axe 1.2.2a. Which one do you use Runer ?Same.
Still, the token hook doesn't work on my setups (both real and emulated). Could you transfer me your compiled program file to see if the problem comes from my calc or the compilator ? Thanks.
Your file worked for me. It looks like the problem came from the assembler I was, using (ClrHome's online assembler)