flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
tthsqe 06 Jan 2015, 04:14
tile asks its all
|
|||
![]() |
|
revolution 06 Jan 2015, 04:15
HLT
|
|||
![]() |
|
revolution 06 Jan 2015, 10:52
neville wrote: This of course is not quite the same thing as, for example, the System Idle process in a multi-tasking OS. In a simple case this could be a tight loop of I/O polling instructions. ![]() |
|||
![]() |
|
JohnFound 06 Jan 2015, 11:09
Every normal OS system idle process must end with HLT, lowering the CPU load this way.
|
|||
![]() |
|
shutdownall 06 Jan 2015, 16:53
I don't know any system which is really idle even if it seems to be idle.
![]() There is so much to do in a PC for example, USB requires action, system has to react at key presses, there are many background service tasks, you have to be present on LAN and WLAN actions. So when is a system really idle ? I would say when it is powered off. ![]() And the big question is - why should a system be idle at all ? To save power - okay this is done for microcontrollers or mobiles but the electronic is running anyway - so the devices in a system are powered and the only thing is to put a microprocessor maybe in a power reduced mode (make it slower) but not really idle or even entering a HALT command. And the processor even takes energy when it is in HALT state. ![]() |
|||
![]() |
|
JohnFound 06 Jan 2015, 18:10
shutdownall, at first for the modern processors working allways on 100% is really hard task. Most of them will overheat. The power consumed is more by times, not by percents.
Anyway, your mistake is in the time scale. 1..2ms is very small time for a human, but almost an eternity for the CPU. Let see some simple example. If the timer makes the interrupts on 10ms and the CPU is 5% loaded, it actually executes some code for 0.5ms and stays in HALT for 9.5ms waiting for an interrupt. |
|||
![]() |
|
neville 07 Jan 2015, 09:24
I just thought that tthsqe's original question implied he was thinking of on-going instruction executions, whereas the HLT instruction, as suggested by revolution, isn't quite like that.
Of course, the cpu will rarely if ever stay in the HALT state for more than a millisecond after executing a HLT, but since a ms is a long time to the cpu its heat dissipation can be significantly lowered. In the HALT state the CPU is at least still internally polling it's interrupt lines fed from the external PICs (or maybe that's all implemented as a dedicated hardware function), but I'm not sure if that's what tthsqe had in mind when referring to the cpu being "idle"? What I was getting at is that we could all write a keyboard polling loop which would occupy the CPU 100% while it waits for us to press a key. We could call this a software "idle" loop (yes, very inefficient!), and maybe this is what tthsqe was getting at? Or maybe the question was always meant to be a bit vague ![]() Code: WAIT4KEY: IN AL,64H AND AL,1 JZ WAIT4KEY GOTKEY: IN AL,60H ;get scancode... ... ;process scancode or using real mode BIOS: Code: WAIT4KEY: MOV AH,1 INT 16H JZ WAIT4KEY GOTKEY: CMP AH,... ;process scancode... _________________ FAMOS - the first memory operating system |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.