Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and the Ugly)." (By Matt Welsh)


devel / comp.lang.c / [asm/c] emiting code for aa+=12.34

SubjectAuthor
* [asm/c] emiting code for aa+=12.34fir
+- Re: [asm/c] emiting code for aa+=12.34fir
`* Re: [asm/c] emiting code for aa+=12.34fir
 `* Re: [asm/c] emiting code for aa+=12.34Seamus Coleman
  +- Re: [asm/c] emiting code for aa+=12.34fir
  `* Re: [asm/c] emiting code for aa+=12.34Joe Pfeiffer
   `* Re: [asm/c] emiting code for aa+=12.34fir
    `- Re: [asm/c] emiting code for aa+=12.34fir

1
[asm/c] emiting code for aa+=12.34

<d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21437&group=comp.lang.c#21437

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:56:b0:2f1:fbea:c68d with SMTP id y22-20020a05622a005600b002f1fbeac68dmr9707454qtw.58.1650822266263;
Sun, 24 Apr 2022 10:44:26 -0700 (PDT)
X-Received: by 2002:a05:622a:6114:b0:2f0:ffc8:53f8 with SMTP id
hg20-20020a05622a611400b002f0ffc853f8mr9607097qtb.681.1650822266072; Sun, 24
Apr 2022 10:44:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 24 Apr 2022 10:44:25 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.146; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.146
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
Subject: [asm/c] emiting code for aa+=12.34
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 24 Apr 2022 17:44:26 +0000
Content-Type: text/plain; charset="UTF-8"
 by: fir - Sun, 24 Apr 2022 17:44 UTC

i need to emit asembly code for such thing as

aa+=12.34

where aa is float

it should be something like

movss xmm1, [aa]
addss xmm1, 12.34
movss [aa], xmm1

but i dont know "exactly" what

i also wrote a function to give me unsigned integer whis suposedly has
teh same binary form as float

unsigned FloatToUnsignedForm(float f)
{ union {
float f;
unsigned u;
} h;
h.f = f;
return h.u;
} hovever i dont checked yet if this work

i know i can check up in net for it but it may take some time
maybe someone here knows what i exactly should emit?

tnx

Re: [asm/c] emiting code for aa+=12.34

<9d9df555-ccbe-4fa3-b503-3d64ee1ca263n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21438&group=comp.lang.c#21438

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1182:b0:2f1:fefa:f1c4 with SMTP id m2-20020a05622a118200b002f1fefaf1c4mr9706776qtk.365.1650824290503;
Sun, 24 Apr 2022 11:18:10 -0700 (PDT)
X-Received: by 2002:a05:6214:2627:b0:446:6577:6ef8 with SMTP id
gv7-20020a056214262700b0044665776ef8mr10137835qvb.85.1650824290345; Sun, 24
Apr 2022 11:18:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 24 Apr 2022 11:18:10 -0700 (PDT)
In-Reply-To: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.146; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.146
References: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9d9df555-ccbe-4fa3-b503-3d64ee1ca263n@googlegroups.com>
Subject: Re: [asm/c] emiting code for aa+=12.34
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 24 Apr 2022 18:18:10 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sun, 24 Apr 2022 18:18 UTC

niedziela, 24 kwietnia 2022 o 19:44:32 UTC+2 fir napisał(a):
> i need to emit asembly code for such thing as
>
> aa+=12.34
>
> where aa is float
>
> it should be something like
>
> movss xmm1, [aa]
> addss xmm1, 12.34
> movss [aa], xmm1
>
> but i dont know "exactly" what
>
> i also wrote a function to give me unsigned integer whis suposedly has
> teh same binary form as float
>
> unsigned FloatToUnsignedForm(float f)
> {
> union {
> float f;
> unsigned u;
> } h;
> h.f = f;
> return h.u;
> }
> hovever i dont checked yet if this work
>
> i know i can check up in net for it but it may take some time
> maybe someone here knows what i exactly should emit?
>
> tnx
yet damn confusing thing is pasing floats to functions, i got some notes but im not 100%
at the moment (i mean when i tested it it worked but still im not sure )

?? txt: "assembled by fir %d ... %f ..." 0
?? floa: 123.456d

mov eax floa
mov ebx eax
add eax 4
push (eax)
push (ebx)

push (integer)
push txt
call (msvcrt.dll->printf)
pop eax
pop eax
pop eax
pop eax

Re: [asm/c] emiting code for aa+=12.34

<eb6ca94b-e25d-43f6-97e4-5e627839b9cfn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21439&group=comp.lang.c#21439

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:27e5:b0:44f:6273:c2f3 with SMTP id jt5-20020a05621427e500b0044f6273c2f3mr10560636qvb.127.1650829781601;
Sun, 24 Apr 2022 12:49:41 -0700 (PDT)
X-Received: by 2002:ae9:c30d:0:b0:69e:bd20:40cc with SMTP id
n13-20020ae9c30d000000b0069ebd2040ccmr8444355qkg.10.1650829781412; Sun, 24
Apr 2022 12:49:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 24 Apr 2022 12:49:41 -0700 (PDT)
In-Reply-To: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.158; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.158
References: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eb6ca94b-e25d-43f6-97e4-5e627839b9cfn@googlegroups.com>
Subject: Re: [asm/c] emiting code for aa+=12.34
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 24 Apr 2022 19:49:41 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 35
 by: fir - Sun, 24 Apr 2022 19:49 UTC

such crappy code seem to work but it was searched partially blindly (chaos mode)
those integer eax values was teken from this union , possibly i should save double to t10
stright
float code i dont know as it seem more complex

// compiling expression a+=0.1
mov sd x0 (a)
mov eax -1717986918
mov (t10) eax
mov eax 1069128089
mov (t11) eax
add sd x0 (t10)
mov sd (a) x0

mov ebx a
mov eax ebx
add eax 4
push (eax)
push (ebx)

push (c)
?? str_label_2: "zz %d zz %3.3f \x00"
push str_label_2
push 100
push 30
push 16777215
call ("green_fire.dll"->DrawSomeText2)
pop eax
pop eax
pop eax
pop eax
pop eax
pop eax
pop eax
ret

Re: [asm/c] emiting code for aa+=12.34

<t44atq$4m3$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21441&group=comp.lang.c#21441

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!nOqLI1EbCan+82M4Y2qJhQ.user.46.165.242.75.POSTED!not-for-mail
From: "Seamus....@gmail.com" (Seamus Coleman)
Newsgroups: comp.lang.c
Subject: Re: [asm/c] emiting code for aa+=12.34
Date: Sun, 24 Apr 2022 21:00:00 +0100
Organization: Aioe.org NNTP Server
Message-ID: <t44atq$4m3$1@gioia.aioe.org>
References: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
<eb6ca94b-e25d-43f6-97e4-5e627839b9cfn@googlegroups.com>
Reply-To: Seamus.Coleman@gmail.com
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="4803"; posting-host="nOqLI1EbCan+82M4Y2qJhQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Seamus Coleman - Sun, 24 Apr 2022 20:00 UTC

On 24/04/2022 20:49, fir wrote:
> such crappy code seem to work but it was searched partially blindly (chaos mode)
>
Are you aware that this is a "comp.lang.c" newsgroup while you are
posting a running commentary about your assembler code. People will
kill-file you if this continues.

Re: [asm/c] emiting code for aa+=12.34

<2caa41d4-d61c-4a2d-a855-ed33721825a4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21442&group=comp.lang.c#21442

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:2416:b0:69f:47fa:595e with SMTP id d22-20020a05620a241600b0069f47fa595emr2021221qkn.229.1650831860903;
Sun, 24 Apr 2022 13:24:20 -0700 (PDT)
X-Received: by 2002:a37:6552:0:b0:69c:910f:4f96 with SMTP id
z79-20020a376552000000b0069c910f4f96mr8498920qkb.371.1650831860701; Sun, 24
Apr 2022 13:24:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 24 Apr 2022 13:24:20 -0700 (PDT)
In-Reply-To: <t44atq$4m3$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.158; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.158
References: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
<eb6ca94b-e25d-43f6-97e4-5e627839b9cfn@googlegroups.com> <t44atq$4m3$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2caa41d4-d61c-4a2d-a855-ed33721825a4n@googlegroups.com>
Subject: Re: [asm/c] emiting code for aa+=12.34
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 24 Apr 2022 20:24:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sun, 24 Apr 2022 20:24 UTC

niedziela, 24 kwietnia 2022 o 22:11:51 UTC+2 undefined napisał(a):
> On 24/04/2022 20:49, fir wrote:
> > such crappy code seem to work but it was searched partially blindly (chaos mode)
> >
> Are you aware that this is a "comp.lang.c" newsgroup while you are
> posting a running commentary about your assembler code. People will
> kill-file you if this continues.

dont know, you may not realize that serious c programmers (at least in a bit older age like 2 decades ago) are programmers conscious of assembly and imo this 'edge' world between asm implementation and c belongs to c world.. nowadays im afraid the assembly goes more to distance but still i would expect c coders should know underlaying things (like calling conventions, how some things map to asm level etc)

besides even with off topics it was once discussed, some reasonable percentage of oftopics is rather good then neutal, this only the amount makes it bad .. i will probably not stay here to long, becouse if i get weary i will stop coding for another months probably

Re: [asm/c] emiting code for aa+=12.34

<1bh76i9l73.fsf@pfeifferfamily.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21444&group=comp.lang.c#21444

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: pfeif...@cs.nmsu.edu (Joe Pfeiffer)
Newsgroups: comp.lang.c
Subject: Re: [asm/c] emiting code for aa+=12.34
Date: Sun, 24 Apr 2022 16:21:36 -0600
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <1bh76i9l73.fsf@pfeifferfamily.net>
References: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
<eb6ca94b-e25d-43f6-97e4-5e627839b9cfn@googlegroups.com>
<t44atq$4m3$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="0dbe926f647b4d826932176a8ce38f78";
logging-data="19885"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Fg81kTw6M/sMw3cswe1I6zT6pn4NY3p4="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:vHPywEHDkJEQu6n7w59K36mEDr4=
sha1:vbkww0zZj4I2BsDvRiLgyHlpGF4=
 by: Joe Pfeiffer - Sun, 24 Apr 2022 22:21 UTC

Seamus Coleman <"Seamus.Coleman@gmail.com"> writes:

> On 24/04/2022 20:49, fir wrote:
>> such crappy code seem to work but it was searched partially blindly (chaos mode)
>>
> Are you aware that this is a "comp.lang.c" newsgroup while you are
> posting a running commentary about your assembler code. People will
> kill-file you if this continues.

For most of us that ship sailed long, long ago.

Re: [asm/c] emiting code for aa+=12.34

<3cb81c06-0d5e-41f0-841f-8576cd8a51d3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21445&group=comp.lang.c#21445

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:95:b0:2f1:fa51:be58 with SMTP id o21-20020a05622a009500b002f1fa51be58mr10112359qtw.564.1650840589732;
Sun, 24 Apr 2022 15:49:49 -0700 (PDT)
X-Received: by 2002:a05:6214:76d:b0:443:6801:6d0f with SMTP id
f13-20020a056214076d00b0044368016d0fmr10533793qvz.60.1650840589559; Sun, 24
Apr 2022 15:49:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 24 Apr 2022 15:49:49 -0700 (PDT)
In-Reply-To: <1bh76i9l73.fsf@pfeifferfamily.net>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.225; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.225
References: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
<eb6ca94b-e25d-43f6-97e4-5e627839b9cfn@googlegroups.com> <t44atq$4m3$1@gioia.aioe.org>
<1bh76i9l73.fsf@pfeifferfamily.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3cb81c06-0d5e-41f0-841f-8576cd8a51d3n@googlegroups.com>
Subject: Re: [asm/c] emiting code for aa+=12.34
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 24 Apr 2022 22:49:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 13
 by: fir - Sun, 24 Apr 2022 22:49 UTC

poniedziałek, 25 kwietnia 2022 o 00:21:49 UTC+2 Joe Pfeiffer napisał(a):
> Seamus Coleman <"Seamus....@gmail.com"> writes:
>
> > On 24/04/2022 20:49, fir wrote:
> >> such crappy code seem to work but it was searched partially blindly (chaos mode)
> >>
> > Are you aware that this is a "comp.lang.c" newsgroup while you are
> > posting a running commentary about your assembler code. People will
> > kill-file you if this continues.
> For most of us that ship sailed long, long ago.

same as your brain

Re: [asm/c] emiting code for aa+=12.34

<16a64e7d-0bb3-41fc-8b4b-fb2340f858d1n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21446&group=comp.lang.c#21446

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:5:b0:2f3:576a:6fcd with SMTP id x5-20020a05622a000500b002f3576a6fcdmr10394151qtw.669.1650840725278;
Sun, 24 Apr 2022 15:52:05 -0700 (PDT)
X-Received: by 2002:a37:b605:0:b0:69e:6d6f:aea7 with SMTP id
g5-20020a37b605000000b0069e6d6faea7mr8424828qkf.655.1650840725151; Sun, 24
Apr 2022 15:52:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 24 Apr 2022 15:52:04 -0700 (PDT)
In-Reply-To: <3cb81c06-0d5e-41f0-841f-8576cd8a51d3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.225; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.225
References: <d72f9e9a-ec4a-4ac8-8114-c691996123b2n@googlegroups.com>
<eb6ca94b-e25d-43f6-97e4-5e627839b9cfn@googlegroups.com> <t44atq$4m3$1@gioia.aioe.org>
<1bh76i9l73.fsf@pfeifferfamily.net> <3cb81c06-0d5e-41f0-841f-8576cd8a51d3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <16a64e7d-0bb3-41fc-8b4b-fb2340f858d1n@googlegroups.com>
Subject: Re: [asm/c] emiting code for aa+=12.34
From: profesor...@gmail.com (fir)
Injection-Date: Sun, 24 Apr 2022 22:52:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 19
 by: fir - Sun, 24 Apr 2022 22:52 UTC

poniedziałek, 25 kwietnia 2022 o 00:49:56 UTC+2 fir napisał(a):
> poniedziałek, 25 kwietnia 2022 o 00:21:49 UTC+2 Joe Pfeiffer napisał(a):
> > Seamus Coleman <"Seamus....@gmail.com"> writes:
> >
> > > On 24/04/2022 20:49, fir wrote:
> > >> such crappy code seem to work but it was searched partially blindly (chaos mode)
> > >>
> > > Are you aware that this is a "comp.lang.c" newsgroup while you are
> > > posting a running commentary about your assembler code. People will
> > > kill-file you if this continues.
> > For most of us that ship sailed long, long ago.

> same as your brain

or rather 'their'.. its a joke i dont care who reads what i post..its a free group

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor