2017-05-31 18:52:48 +00:00
|
|
|
/* -*-comment-start: "//";comment-end:""-*-
|
|
|
|
* Mes --- Maxwell Equations of Software
|
|
|
|
* Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
|
|
|
|
*
|
|
|
|
* This file is part of Mes.
|
|
|
|
*
|
|
|
|
* Mes is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
* your option) any later version.
|
|
|
|
*
|
|
|
|
* Mes is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2017-07-09 07:24:07 +00:00
|
|
|
int test ();
|
2017-05-31 18:52:48 +00:00
|
|
|
|
|
|
|
int
|
2017-07-09 07:24:07 +00:00
|
|
|
main ()
|
2017-05-31 18:52:48 +00:00
|
|
|
{
|
2017-07-09 07:24:07 +00:00
|
|
|
int r = test ();
|
|
|
|
#if __MESC__
|
|
|
|
asm ("mov____%eax,%ebx");
|
|
|
|
asm ("mov____$i32,%eax SYS_exit");
|
|
|
|
asm ("int____$0x80");
|
2017-11-16 21:11:07 +00:00
|
|
|
#elif __GNUC__
|
2017-07-09 07:24:07 +00:00
|
|
|
asm ("mov %0,%%ebx"
|
|
|
|
: // no outputs
|
|
|
|
: "" (r));
|
|
|
|
asm ("mov $1,%eax");
|
|
|
|
asm ("int $0x80");
|
2017-11-16 21:11:07 +00:00
|
|
|
#elif __TINYC__
|
|
|
|
asm ("mov %0,%%ebx"
|
|
|
|
: // no outputs
|
|
|
|
: "Ir" (r));
|
|
|
|
asm ("mov $1,%eax");
|
2017-12-04 21:58:10 +00:00
|
|
|
asm ("int $128");
|
2017-11-16 21:11:07 +00:00
|
|
|
#endif // __GNUC__
|
2017-05-31 18:52:48 +00:00
|
|
|
}
|