Author Topic: Several questions  (Read 13468 times)

0 Members and 2 Guests are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Several questions
« Reply #15 on: October 04, 2010, 05:51:19 pm »
  Also, a goto is more efficient to exit a loop than to set a variable to a number above the maximum because it will save time in the code and its 3 bytes less.

How is it more efficient? I though jp commands (assuming that's what goto uses) took quite awhile to jump.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Several questions
« Reply #16 on: October 04, 2010, 05:52:56 pm »
We have to remember that ASM Gotos are not like TI-BASIC Gotos, though. In TI-BASIC, they are inneficient in most cases (and even cause leaks), but it doesn't mean it will be the same in Axe/ASM.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Several questions
« Reply #17 on: October 04, 2010, 06:02:49 pm »
ASM is a totally different animal from BASIC. But the ASM jump commands I'm familiar with, JL and JP both take fairly long times to jump as far as I'm aware. I'm not sure if Axe uses those commands for GOTO though.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Several questions
« Reply #18 on: October 04, 2010, 06:05:18 pm »
Ah, I didn't know that. Maybe it is not as slow as you think? Sadly I am not experienced with z80 so I wouldn't be able to confirm. You could always run some Axe tests, though, to see.
« Last Edit: October 04, 2010, 06:05:28 pm by DJ Omnimaga »

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Several questions
« Reply #19 on: October 04, 2010, 06:17:22 pm »
ASM is a totally different animal from BASIC. But the ASM jump commands I'm familiar with, JL and JP both take fairly long times to jump as far as I'm aware. I'm not sure if Axe uses those commands for GOTO though.

JR and JP take 12 clock cycles at most. That's 2 microseconds (2*10-6 seconds) at 6MHz, so I would hardly call that a "fairly long time." :P
« Last Edit: October 04, 2010, 06:19:34 pm by Runer112 »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Several questions
« Reply #20 on: October 04, 2010, 06:19:04 pm »
Only 12 clock cycles? Ignore everything I said before then. I obviously need to look at that part in ASM in 28 days again.

EDIT: For the names as well :P
« Last Edit: October 04, 2010, 06:20:22 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Several questions
« Reply #21 on: October 04, 2010, 06:21:45 pm »
Only 12 clock cycles? Ignore everything I said before then. I obviously need to look at that part in ASM in 28 days again.

EDIT: For the names as well :P

You might have been thinking of ASM's implementation of the BASIC Goto statement. In pure ASM, all Z80 instructions should take about sixteen cycles or less.




Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Several questions
« Reply #22 on: October 04, 2010, 06:53:36 pm »
Only 12 clock cycles? Ignore everything I said before then. I obviously need to look at that part in ASM in 28 days again.

EDIT: For the names as well :P
You might have been thinking of ASM's implementation of the BASIC Goto statement. In pure ASM, all Z80 instructions should take about sixteen cycles or less.
*23 cycles or less. :)
« Last Edit: October 04, 2010, 06:53:49 pm by ztrumpet »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Several questions
« Reply #23 on: October 04, 2010, 08:35:11 pm »
I think the BASIC goto can take over 9000 cycles in some cases (like when the lbl is at the very bottom of a 18 KB program)
« Last Edit: October 04, 2010, 08:35:33 pm by DJ Omnimaga »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Several questions
« Reply #24 on: October 04, 2010, 08:40:35 pm »
*23 cycles or less. :)

Instructions like CPDR can be a bit misleading though ;)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Several questions
« Reply #25 on: October 04, 2010, 10:13:05 pm »
WHat makes them misleading? Can they take random amounts of clock cycles?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Several questions
« Reply #26 on: October 04, 2010, 10:27:04 pm »
Well what they do is a little complicated, but basically they keep repeating themselves over and over again until a certain condition is met, so they take different amount of clock cycles depending on the situation.  But * technically* its not 1 instruction, but its a whole bunch of instructions being done over and over so thats where it can get misleading :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Several questions
« Reply #27 on: October 04, 2010, 11:08:28 pm »
Ah right, makes sense :)

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Several questions
« Reply #28 on: October 05, 2010, 07:52:48 am »
To be technical, they're called "block instructions," and are LDIR, LDDR, CPIR, CPDR, INIR, INDR, OTIR, OTDR, and maybe some other ones I don't remember.
The number of times they execute is based on the contents of BC (a 16-bit register), though some (notably CPIR and CPDR) are also affected by the contents of RAM (they essentially work as one-byte finds.)
[/rant]
;D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Several questions
« Reply #29 on: October 05, 2010, 06:30:23 pm »
What does that extra R stand for, anyway?