That looks to me as if it would work pretty well. Have you given it a try yet? Tthanks for the interjections, Lionel. Smile
ACagliano are you gonna make your tutorial on this? I think I read something on the IRC, is it true? I'm looking forward to it.
ScoutDavid wrote:
ACagliano are you gonna make your tutorial on this? I think I read something on the IRC, is it true? I'm looking forward to it.
Oooh, I hope he will! If he does, everyone wins, I think.
I am starting a tutorial on game design using Axe, yes. It will delve into everything my TI-Basic version did, and then will address using CalcNET as a linking protocol.

@Kerm: Only one calculator, and no unit-to-units cables.
That sounds very cool! btw, it's called CALCnet, not CalcNET.
ACagliano wrote:
I am starting a tutorial on game design using Axe, yes. It will delve into everything my TI-Basic version did, and then will address using CalcNET as a linking protocol.

@Kerm: Only one calculator, and no unit-to-units cables.


Oh that's great Smile
KermMartian wrote:
Does it store simultaneously? If there are even a few cycles between the high byte and the low byte, bad things can happen.


Not read on z80 architecture, but I'm pretty sure there are no "free" cycles during the duration of any one instruction...unless you start talking about pipelining or hyperthreading... o.o

Were you worried the buffer might be read between storing the high and low bytes?
Progbeard wrote:
KermMartian wrote:
Does it store simultaneously? If there are even a few cycles between the high byte and the low byte, bad things can happen.


Not read on z80 architecture, but I'm pretty sure there are no "free" cycles during the duration of any one instruction...unless you start talking about pipelining or hyperthreading... o.o

Were you worried the buffer might be read between storing the high and low bytes?
Progbeard, in z80 asm, ld (imm_addr),hl operates in one instruction, so an interrupt cannot trigger in the middle of the two-byte load. However, this is Axe, a compiled language, and I am not sure how it renders a two-byte load in the high-level language into ASM. I considered it entirely possible that it might break it up into two separate one-byte load instructions.
Perhaps you could poke Quigibo on that. That is a very worthy question.
KermMartian wrote:
Progbeard wrote:
KermMartian wrote:
Does it store simultaneously? If there are even a few cycles between the high byte and the low byte, bad things can happen.


Not read on z80 architecture, but I'm pretty sure there are no "free" cycles during the duration of any one instruction...unless you start talking about pipelining or hyperthreading... o.o

Were you worried the buffer might be read between storing the high and low bytes?
Progbeard, in z80 asm, ld (imm_addr),hl operates in one instruction, so an interrupt cannot trigger in the middle of the two-byte load. However, this is Axe, a compiled language, and I am not sure how it renders a two-byte load in the high-level language into ASM. I considered it entirely possible that it might break it up into two separate one-byte load instructions.


Axe usually uses


Code:
push HL
; get pointer into HL here
pop DE
ld (HL),E
inc HL
ld (HL),D


except when it's a constant location; in that case it uses


Code:
ld (ADDRESS),HL
Oh, I see. I'm also not too familiar with Axe. If Axe has a word load instruction, I can't imagine it would compile into two two-byte loads. But if Axe has only byte load instructions, you might be right, and that wouldn't be very desirable.

Are there any good Axe tutorials on the web aside from just the Axe documentation?
Progbeard wrote:
Are there any good Axe tutorials on the web aside from just the Axe documentation?


kindermoumoute's writing a very complete tutorial on the Site du Zéro (it's in French).

I'm working on an "Ultimate Guide to Axe Parser" on my own site, as well as a few specific tutorials on arrays and making a SHMUP in Axe.
Progbeard, so Deep Thought did indeed confirm my concern. Smile Personally, I'd stick with ASM if you feel proficient enough in it, but I'm slightly biased. ACagliano, what were you saying earlier on SAX about having to move around memory?
Hey, everybody! I have an *UNTESTED* CALCnet axiom for you guys! It's only the source, as I can't compile right now. Here it is:

Code:

.org $0000
.dw $C0DE

;Start Cn2.2
.dw $0003
.db %00010000
.db $63,$3C   ;"CoordOn"
.db %00000000   ;replacement
.db 0
call 04206h

;Stop Cn2.2
.dw $0003
.db %00010000
.db $63,$3D   ;"CoordOff"
.db %00000000   ;replacement
.db 0
call 04212h

;Send address pointer
.dw $0003
.db %00010000
.db $63,$0A   ;"Xmin"
.db %00000000   ;replacement
.db 0
ld hl, 087FAh

;Send data pointer
.dw $0003
.db %00010000
.db $63,$0B   ;"Xmax"
.db %00000000   ;replacement
.db 0
ld hl, 08801h

;Send size pointer
.dw $0003
.db %00010000
.db $63,$02   ;"Xscl"
.db %00000000   ;replacement
.db 0
ld hl, 087FFh

;Store Send Go
.dw $0003
.db %00010000
.db $63,$27   ;"Delta X"
.db %00010000   ;store command
.db 0
ld (08800h), hl

;Retreive Send Go
.dw $0003
.db %00010000
.db $63,$27   ;"Delta X"
.db %00000000   ;replacement
.db 0
ld hl, (08800h)

;Recieve address pointer
.dw $0003
.db %00010000
.db $63,$0C   ;"Ymin"
.db %00000000   ;replacement
.db 0
ld hl, 086F3h

;Recieve data pointer
.dw $0003
.db %00010000
.db $63,$0D   ;"Ymax"
.db %00000000   ;replacement
.db 0
ld hl, 086FAh

;Recieve size pointer
.dw $0003
.db %00010000
.db $63,$03   ;"Yscl"
.db %00000000   ;replacement
.db 0
ld hl, 086F8h

;Store Recieve Go
.dw $0003
.db %00010000
.db $63,$28   ;"Delta Y"
.db %00010000   ;store command
.db 0
ld (086F9h), hl

;Retreive Recieve Go
.dw $0003
.db %00010000
.db $63,$28   ;"Delta Y"
.db %00000000   ;replacement
.db 0
ld hl, (086F9h)

;End Axiom
.dw $0000
.end

Would someone please compile this for me? Thank you.[/code]
Nifty! Once compiled, how would one go about using this?
I'll definitely test this out! Why do all of your memory addresses have a 0 in front of them?
Here's how an Axiom works:

1. In Axe, place an #Axiom() token (where AsmComp should be in the Catalog) and put the compiled Axiom name in the argument.
2. Use these tokens in the program:
- CoordOn starts CALCnet, CoordOff stops CALCnet.
- Xmin, Xmax, and Xscl are pointers for the send buffer's target, data, and size, respectively.
- Ymin, Ymax, and Yscl are the same for the recieve buffer.
- Delta X and Delta Y are the second bytes of the size words. You can read them and write to them as you would in ASM (set and clear the high bit).

EDIT:
souvik1997 wrote:
I'll definitely test this out! Why do all of your memory addresses have a 0 in front of them?

I'm not really an ASM programmer. I thought that all the addresses needed a 0 in front of them.
Only the ones that start with a letter. Smile There are two accepted formats: $F02C/$89E2, or 0F02Ch/89E2h.
ACagliano wrote:
I get what you are saying Kerm, so we are clear on that.

I'm just confused. I don't believe Axe uses little endian, so in Axe, it may be 0x80[size]. Maybe you can tell me Kerm,

if I had to flip the memory high and low bytes of the Cn2 calls and the memory areas from the standard z80 conventions in order to use them in Axe, I should have to flip this as well, correct.


If you are using z80 hexcodes, you are using little endian. However, in Axe, the pointers are 2 byte values, so you don't have to worry about it - it manages it for you. The only note I need to make about this Axiom is that you must store or read 128 to the Delta ("Frame Ready") values.
Compynerd, here's your program compiled as hex, in case it helps you at all:


Code:
DE C0 03 00 10 63 3C 00 00 CD 06 42 03 00 10 63 3D 00 00 CD 12 42 03 00 10 63 0A 00 00 21 FA 87 03 00 10 63 0B 00 00 21 01 88 03 00 10 63 02 00 00 21 FF 87 03 00 10 63 27 10 00 22 00 88 03 00 10 63 27 00 00 2A 00 88 03 00 10 63 0C 00 00 21 F3 86 03 00 10 63 0D 00 00 21 FA 86 03 00 10 63 03 00 00 21 F8 86 03 00 10 63 28 10 00 22 F9 86 03 00 10 63 28 00 00 2A F9 86 00 00
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 4
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement