Skip to content

Commit

Permalink
need to start interacting with the heap
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-johnson-4 committed Jan 2, 2024
1 parent c56486d commit f47c719
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions stdlib/helpers.lm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@
\t mov $0, %r11 \n # $_.$4 = 0, .flags
);

::close-this := (
# move this S onto the heap
# %r12 becomes pointer to new location
# push 4
# call malloc
# add esp, 4
# ; now eax points to an allocated buffer of the requested size
);

::open-this := (
# move S from heap into this
# %r12 is pointer to current location
);

::program-header := (
.global _start \n
.text \n
Expand Down

0 comments on commit f47c719

Please sign in to comment.