LOL, not to mention my computer can easily run over 2 billion opcodes per second, over two processing cores.
Not to mention I'm now legally obligated to represent x86 assembly:
So, this counts to a billion.
To save time, it only prints every 100,000th number, but if you really want the full billion, change the 100,000 to 1.
It will take your computer a few days to count, since _printf is really slow. The program is instantaneous if the printing is taken out entirely.
;///////////////////////////////////////////////////////////
extern _printf
extern _system
segment .data
szCount db 'n = %d',10,0
szIdiot db 'mthtchr05 is a fucking IDIOT!!',10,0
szPause db 'PAUSE', 0
segment .code
global _main
_main:
enter 4,0
mov dword [ebp-4], 0
countLoop:
mov EAX,0
innerLoop:
inc dword [ebp-4]
inc EAX
cmp EAX,100000
jl innerLoop
push dword [ebp-4]
push szCount
call _printf ;Print the number
add esp, 8
cmp dword [ebp-4], 1000000000 ;Check if we're at a billion yet.
jl countLoop
push szIdiot
call _printf ;When the program is done, it bashes
add esp, 4 ;whoever said it couldn't count to a billion
push szPause
call _system
add esp, 4
leave
ret
;///////////////////////////////////////////////////////////