home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,250 of 4,675   
   olcott to Robert   
   Re: Refuting the {Linz, Sipser and Kozen   
   22 Dec 20 16:19:10   
   
   XPost: comp.theory   
   From: NoOne@nospicedham.NoWhere.com   
      
   On 12/22/2020 11:40 AM, Robert wrote:   
   > In comp.lang.asm.x86 olcott  wrote in part:   
   >> On 12/22/2020 4:07 AM, Bernhard Schornak wrote:   
   >>> olcott wrote:   
   >>>   
   >>> _H_Hat:   
   >>> [000005e6](01)? 55????????????????? push ebp   
   >>> [000005e7](02)? 8bec??????????????? mov ebp,esp   
   >>> [000005e9](01)? 51????????????????? push ecx   
   >>> [000005ea](03)? 8b4508????????????? mov eax,[ebp+08]   
   >>> [000005ed](01)? 50????????????????? push eax   
   >>> [000005ee](03)? 8b4d08????????????? mov ecx,[ebp+08]   
   >>> [000005f1](01)? 51????????????????? push ecx   
   >>> [000005f2](05)? e8effdffff????????? call 000003e6   
   >>> [000005f7](03)? 83c408????????????? add esp,+08   
   >>> [000005fa](03)? 8945fc????????????? mov [ebp-04],eax   
   >>> [000005fd](04)? 837dfc00??????????? cmp dword [ebp-04],+00   
   >>> [00000601](02)? 7404??????????????? jz 00000607   
   >>> [00000603](02)? ebfe??????????????? jmp 00000603   
   >>> [00000605](02)? eb01??????????????? jmp 00000608   
   >>> [00000607](01)? f4????????????????? hlt   
   >>> [00000608](02)? 8be5??????????????? mov esp,ebp   
   >>> [0000060a](01)? 5d????????????????? pop ebp   
   >>> [0000060b](01)? c3????????????????? ret   
   >>>   
   >>>   
   >>> 0603 jumps to itself. Reduce to   
   >>>   
   >>> _H-Hat:movl? 0x0C(%esp), %eax   
   >>>   ?????? subl? $0x08,????? %esp   
   >>>   ?????? movl? %eax,?????? 0x00(%esp)   
   >>>   ?????? movl? %eax,?????? 0x04(%esp)   
   >>>   ?????? call? _WHATEVER_THAT_IS   
   >>>   ?????? testl %eax,?????? %eax   
   >>>   ?????? je??? 0f   
   >>>   ?? L00:jmp?? L00????????????????????? # loop forever   
   >>>   ???? 0:hlt??????????????????????????? # CLI/STI?   
   >>>   ?????? addl $0x08,?????? %esp   
   >>>   ?????? ret   
   >>>   
   >>>   
   >>>   
   >>> As long as the code at 0x03E6 is unknown, it is impossible to tell   
   >>> anything. _H_Hat itself does nothing ... except wasting clocks and   
   >>> electrical power when the returned value is not zero.   
   >>>   
   >>> The only thing I can see in your debug trace is that you would run   
   >>> out of stack,   
   >   
   > If it doesn't get caught in the infinite loop at 603, likely less   
   > than one million before you hit the stack guard page.   
   >   
      
   It is only this portion of the excution trace of H_Hat that I am   
   referring to. The second call 000003e6 from the same machine address   
   [000005f2] without any control flow instructions inbetween indicates   
   infinite recursion. Many of the comp.theory people could not understand   
   this.   
      
   ---[000005e6](01)  55                  push ebp   
   ---[000005e7](02)  8bec                mov ebp,esp   
   ---[000005e9](01)  51                  push ecx   
   ---[000005ea](03)  8b4508              mov eax,[ebp+08]   
   ---[000005ed](01)  50                  push eax   
   ---[000005ee](03)  8b4d08              mov ecx,[ebp+08]   
   ---[000005f1](01)  51                  push ecx   
   ---[000005f2](05)  e8effdffff          call 000003e6       --CALL [000003e6]   
   ---[000005e6](01)  55                  push ebp   
   ---[000005e7](02)  8bec                mov ebp,esp   
   ---[000005e9](01)  51                  push ecx   
   ---[000005ea](03)  8b4508              mov eax,[ebp+08]   
   ---[000005ed](01)  50                  push eax   
   ---[000005ee](03)  8b4d08              mov ecx,[ebp+08]   
   ---[000005f1](01)  51                  push ecx   
   ---[000005f2](05)  e8effdffff          call 000003e6       --CALL   
   [000003e6]   
      
   >> That is the answer that I expected and confirms that I am correct.   
   >>   
   >> I am using the x86 code that was translated from C as the   
   >> machine description language of a Universal Turing Machine   
   >> equivalent. I wrote a whole x86utm operating system for   
   >> this purpose. This means that the assumption is infinite   
   >> memory and thus infinite stack.   
   >   
   > ??? I don't think any general-use compiler will emit a HLT   
   > instruction.  No need, this is a priviliged ring0 instruction   
   > on modern x86 p-mode OSes.   
   >   
   > -- Robert   
   >   
      
   I use it in the x86 emulator to indicate the that system definitely   
   stopped executing at this point. Before I used this instruction the   
   emulator tended to try to execute garbage. When it popped the return   
   from main() it had no where to go.   
      
   --   
   Copyright 2020 Pete Olcott   
      
   "Great spirits have always encountered violent opposition from mediocre   
   minds." Einstein   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca