This commit is contained in:
Kartik Agaram 2020-07-09 07:57:03 -07:00
parent 88aeadf3c6
commit a3bfbb99f8
2 changed files with 11 additions and 12 deletions

View File

@ -119,6 +119,7 @@ $move-cursor-on-screen:end:
5d/pop-to-ebp
c3/return
# just because Mu has no support for global variables yet
print-string-to-screen: # s: (addr array byte)
# . prologue
55/push-ebp

View File

@ -10596,7 +10596,7 @@ check-mu-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-fi
89/<- %ebp 4/r32/esp
# . save registers
50/push-eax
# if stmt's operation matches a primitive, check against it
# - if stmt's operation matches a primitive, check against it
(has-primitive-name? *(ebp+8)) # => eax
3d/compare-eax-and 0/imm32/false
{
@ -10604,19 +10604,17 @@ check-mu-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buffered-fi
(check-mu-primitive *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14))
eb/jump $check-mu-stmt:end/disp8
}
# otherwise find a function to check against
# - otherwise find a function to check against
# var f/edi: (addr function) = lookup(*Program->functions)
(lookup *_Program-functions *_Program-functions->payload) # => eax
(find-matching-function %eax *(ebp+8)) # => eax
3d/compare-eax-and 0/imm32
{
# var f/edi: (addr function) = lookup(*Program->functions)
(lookup *_Program-functions *_Program-functions->payload) # => eax
(find-matching-function %eax *(ebp+8)) # => eax
3d/compare-eax-and 0/imm32
{
74/jump-if-= break/disp8
(check-mu-call *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14))
eb/jump $check-mu-stmt:end/disp8
}
# TODO: error on unknown function. We need to first type-check calls to SubX functions.
74/jump-if-= break/disp8
(check-mu-call *(ebp+8) %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14))
eb/jump $check-mu-stmt:end/disp8
}
# TODO: error on unknown function. We need to first type-check calls to SubX functions.
$check-mu-stmt:end:
# . restore registers
58/pop-to-eax