Deutsch   English   Français   Italiano  
<v755fr$15jl6$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mikko <mikko.levanto@iki.fi>
Newsgroups: comp.theory
Subject: Re: Sequence of sequence, selection and iteration matters -- Professor Hehner
Date: Tue, 16 Jul 2024 09:54:51 +0300
Organization: -
Lines: 58
Message-ID: <v755fr$15jl6$1@dont-email.me>
References: <v6e7va$c4sv$1@dont-email.me> <v6g444$pdc2$1@dont-email.me> <v6go4d$sg7f$1@dont-email.me> <v6ikv5$19h6q$1@dont-email.me> <v6jguf$1ctoi$5@dont-email.me> <v6ji1d$1dpoc$1@dont-email.me> <v6jig0$1ctoi$11@dont-email.me> <v6jkib$1e3jq$1@dont-email.me> <v6jpe5$1eul0$1@dont-email.me> <v6jpqo$1e3jq$2@dont-email.me> <v6jqfg$1eul0$2@dont-email.me> <v6k6md$1h3a7$1@dont-email.me> <v6k9ef$1hicb$1@dont-email.me> <v6lc9v$1q8jn$1@dont-email.me> <v6lva1$1tj30$1@dont-email.me> <v6m4nk$1uean$1@dont-email.me> <v6m53s$1ugv5$1@dont-email.me> <v6m6i9$1uean$3@dont-email.me> <v6m78d$1uq86$1@dont-email.me> <v6o17i$2bu9u$1@dont-email.me> <v6ordc$2fuva$9@dont-email.me> <v6qrq1$2v5cr$1@dont-email.me> <v6rbf7$30qtt$10@dont-email.me> <v6tcth$3gm3g$1@dont-email.me> <v6tss2$3imib$10@dont-email.me> <v702nt$2kut$1@dont-email.me> <v70pa9$61d8$11@dont-email.me> <v72isq$jqao$1@dont-email.me> <v736v3$mjis$10@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 16 Jul 2024 08:54:51 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3dd6edd43e45e7f4d1f3b2fdd0259233";
	logging-data="1232550"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18yZoIuDXTDf07utM9vhlRj"
User-Agent: Unison/2.2
Cancel-Lock: sha1:bbD7oaJy+kHtAluGtrbN1/958IM=
Bytes: 3693

On 2024-07-15 13:07:47 +0000, olcott said:

> On 7/15/2024 2:25 AM, Mikko wrote:
>> On 2024-07-14 15:02:33 +0000, olcott said:
>> 
>>> Going to the assembly language level provides a directed
>>> graph of control flow.
>> 
>> So does the C level.
>> 
> 
> A directed graph only uses jmps from one specific
> machine address to another. This a node and a path
> to another node. The C level has no jmps and no
> machine addresses.

At C level there are jumps, at least the return at the end. In case of
DDD shown below, there is also a jump to HHH and the return from it.
Although neither C nor machine code tells whether HHH returns they both
specify where it should return if it does.

As the meaning of the program does not depend on its location in the menory
the machine addresses are not relevant.

>>> It also shows the final state that
>>> is not shown at the C level.
>> 
>> How is that different from the final state that is shown at the C level?
> 
> void DDD()
> {
>    HHH(DDD);
> }
> 
> The C level conflates all of these instructions together
> as if there was only one instruction. There is no final
> state at C level.

Of course there is a final state at the C level. The execution is in the
final state when the program returns, which by C rules happen when the
program executes a return instruction or at the end of the program.

> _DDD()
> [00002163] 55         push ebp      ; housekeeping
> [00002164] 8bec       mov ebp,esp   ; housekeeping
> [00002166] 6863210000 push 00002163 ; push DDD
> [0000216b] e853f4ffff call 000015c3 ; call HHH(DDD)
> [00002170] 83c404     add esp,+04
> [00002173] 5d         pop ebp
> [00002174] c3         ret
> Size in bytes:(0018) [00002174]

Note the ret instruction at 2174: it is there because the C code specifies
that the program returns if the end of the program is executed.

-- 
Mikko