diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-09-15 22:21:15 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-09-15 22:52:41 -0700 |
commit | ae470b42f102d5da4f7d4255a47e3cf582079f33 (patch) | |
tree | aa251ea7734370b9c152a5cf08a7b97c9c1de0c1 /apps/mu.subx | |
parent | 8815cf7d57e738731dfc43680b4eccbaef9d822c (diff) | |
download | mu-ae470b42f102d5da4f7d4255a47e3cf582079f33.tar.gz |
6781 - new app: RPN (postfix) calculator
This was surprisingly hard; bugs discovered all over the place.
Diffstat (limited to 'apps/mu.subx')
-rw-r--r-- | apps/mu.subx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/mu.subx b/apps/mu.subx index 1b68350f..b3cb99de 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -14518,6 +14518,13 @@ size-of-type-id: # t: type-id -> result/eax: int b8/copy-to-eax 8/imm32 eb/jump $size-of-type-id:end/disp8 # eax changes type from type-id to int } + # if t is a slice, return 8 + 3d/compare-eax-and 0xc/imm32/slice + { + 75/jump-if-!= break/disp8 + b8/copy-to-eax 8/imm32 + eb/jump $size-of-type-id:end/disp8 # eax changes type from type-id to int + } # if t is a user-defined type, return its size # TODO: support non-atom type (find-typeinfo %eax %ecx) |