| |
| /pliant/language/data/new.pli |
| |
| 1 |
# Copyright Hubert Tonneau hubert.tonneau@pliant.cx | |
| 2 |
# | |
| 3 |
# This program is free software; you can redistribute it and/or | |
| 4 |
# modify it under the terms of the GNU General Public License version 2 | |
| 5 |
# as published by the Free Software Foundation. | |
| 6 |
# | |
| 7 |
# This program is distributed in the hope that it will be useful, | |
| 8 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 9 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 10 |
# GNU General Public License for more details. | |
| 11 |
# | |
| 12 |
# You should have received a copy of the GNU General Public License | |
| 13 |
# version 2 along with this program; if not, write to the Free Software | |
| 14 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
| 15 |
| |
| 16 |
scope "/pliant/language/" "/pliant/install/" | |
| 17 |
module "/pliant/install/ring2.pli" | |
| 18 |
| |
| 19 |
| |
| 20 |
meta new e | |
| 21 |
if e:size=2 and { var Pointer:Type t :> (e:0 constant Type) map Type ; addressof:t<>null } and (e:1 cast t) | |
| 22 |
var Link:Argument adr :> argument local Address | |
| 23 |
var Link:Argument object :> argument indirect t adr 0 | |
| 24 |
e suckup e:0 ; e suckup e:1 | |
| 25 |
e add (instruction (the_function entry_new Type -> Address) e:0:result adr) | |
| 26 |
e add (instruction (the_function 'copy Universal' Universal Universal Type) e:1:result object e:0:result) | |
| 27 |
e set_result object access_read+access_write+access_object | |
| 28 |
| |
| 29 |
export new | |
| |