Author Topic: Count to 10,000 in ASM  (Read 10315 times)

0 Members and 1 Guest are viewing this topic.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Count to 10,000 in ASM
« Reply #30 on: February 19, 2012, 07:36:58 pm »
It depends what your goals are, but the fastest way to count from 0 to 60,000 (definition: 1 register holds every single value from 0 to 60,000) would look like this:

Code: [Select]
ld hl, 0
ld de, 0
ld bc, 60000
ldir

This code would take .076 seconds to run at your standard 16.5 Mhz. HL and DE would both count to 60,000 and BC would count from 60,000 to 0. Going to 10,000 would take .013.


Edit:
  Technically there is a faster way, but it requires 120,000 bytes of instructions.
« Last Edit: February 19, 2012, 07:38:24 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Count to 10,000 in ASM
« Reply #31 on: February 20, 2012, 01:51:14 am »
I made a program for it on my NXT in assembly that counts and displays the number.(It displays the number in the same place the whole time.) It counts to 10,000 in about 4 seconds.
there's no way that you are getting 2,500 frames per second. i'm guessing that whatever method your using isn't "turning off the OS overhead" like qwerty said, and that it manages screen updates itself with interrupts, and that all you're doing is writing the character data to a RAM buffer somewhere.
the processor in the NXT brick runs at 48 MHz (or so the internet tells me), and the z80 in the 83+ and 84+ run at 6 MHz and 15 MHz respectively, so it will, indeed, count faster. like qwerty said, that's not the best way to determine "how fast it will run," but when the differences are that obvious, it's not a question.

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: Count to 10,000 in ASM
« Reply #32 on: February 20, 2012, 01:56:26 am »
(off-topic: everytime someone posts in this topic, due to the topic title in OmnomIRC I always think somebody revived this thread but outside the spam sub-forum X.x)
« Last Edit: February 20, 2012, 01:56:42 am by DJ_O »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Count to 10,000 in ASM
« Reply #33 on: February 20, 2012, 02:39:40 am »
Also, the NXT has an ARM7 processor, correct? The architecture itself is faster than the z80 too (stuff takes less clock cycles, there are more registers, 32-bit instead of 8-bit, etc)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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: Count to 10,000 in ASM
« Reply #34 on: February 20, 2012, 03:06:54 am »
Maybe the screen/LCD driver of the NXT is just considerably slower than the already slow 83+/84+ one, or worse, the Prizm one?
« Last Edit: February 20, 2012, 03:07:08 am by DJ_O »

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Count to 10,000 in ASM
« Reply #35 on: February 20, 2012, 09:26:22 am »
Yes, it has a 32-bit ARM7 Microprocessor running at 48 Mhz.
DJ_O-
Well actually, even if I make the program not display anything, it is faster than the TI 84 not displaying anything. And I actually think the NXT's display driver is faster than the Ti-84's. I can tell you the refresh rate. It refreshes every 17 milliseconds.