Code! ..of what?

by MSX Resource Center on 18-10-2009, 21:10
Обсуждение: Bussum 2007

Не хватает фотографий? Пришлите ваши собственные!Добавить фото

Комментарии (8)

By mth

Champion (503)

Аватар пользователя mth

09-10-2007, 01:39

I was told it's a comparison of the idle loop used by msd (top) and Prodatron (bottom).

By ro

Scribe (4530)

Аватар пользователя ro

17-10-2007, 08:57

here's an optimalisation of the lower loop:

loop: LD HL,CNT
INC (HL)
JR LOOP

Smile

By ro

Scribe (4530)

Аватар пользователя ro

17-10-2007, 17:18

eh, stupid. THIS will realy speed your program up Wink
(before anybody wanna correct me, I'll do it meself)

LD HL,CNT
LOOP: INC(HL)
JR LOOP

whateffah!

By Edwin

Paragon (1182)

Аватар пользователя Edwin

17-10-2007, 22:45

/me notes in the important to remember list: don't take code advice from ro

By Prodatron

Paragon (1800)

Аватар пользователя Prodatron

18-10-2007, 00:26

Hey, for the full pleasure a 16bit counter is needed, an 8bit one wouldn't be enough Tongue Inside the idle task the CPU usage doesn't matter at all, it's only important, that the task manager can show the correct load.

By Prodatron

Paragon (1800)

Аватар пользователя Prodatron

18-10-2007, 00:34

Btw, if a "HALT" would switch the Z80 into energy saving mode, MSDs methode saves a lot of electricity, and we can switch off even more nuclear power plants. But as my methode measures the CPU usage more detailed, who cares Tongue Face

By ro

Scribe (4530)

Аватар пользователя ro

18-10-2007, 16:37

..if only we were talking Unix here Tongue

HALT.....bzzzz, system is halted.

bravo! there's some REAL iddletime for ya!

Running Naked in a Field of Flowers

By mth

Champion (503)

Аватар пользователя mth

20-10-2007, 02:13

openMSX goes to sleep on HALTs, so if you run it on a laptop or a modern desktop PC, an idle loop with HALT would indeed save some energy Smile