mirror of
https://github.com/nineties/planckforth
synced 2024-12-26 21:58:42 +01:00
Remove "{" and "}" from primitive
This commit is contained in:
parent
72927a9b5a
commit
0c1462c59c
2 changed files with 49 additions and 59 deletions
|
@ -31,8 +31,6 @@ $ cat helloworld.fs | ./plank
|
|||
| D | dstore | ( addr -- ) | Set data stack pointer |
|
||||
| r | rfetch | ( -- addr ) | Get return stack pointer |
|
||||
| R | rstore | ( addr -- ) | Set return stack pointer |
|
||||
| { | dtor | ( a -- R:a ) | Push value to return stack |
|
||||
| } | rtod | ( R: -- a ) | Pop value from return stack |
|
||||
| i | docol | ( -- addr ) | Get the interpreter function |
|
||||
| e | exit | ( -- ) | Exit current function |
|
||||
| L | lit | ( -- a ) | Load immediate |
|
||||
|
|
106
planck.xxd
106
planck.xxd
|
@ -6,10 +6,10 @@
|
|||
00000028: 3400 2000 0100 0000 e_ehsize,e_phentsize,e_phnum,e_shentsize
|
||||
00000030: 0000 0000 0100 0000 e_shnum,e_shstrndx,<phdr> PT_LOAD
|
||||
00000038: 0000 0000 0080 0408 p_offset,p_vaddr=0x08048000
|
||||
00000040: 0000 0000 0004 0000 p_paddr,p_filesz
|
||||
00000040: 0000 0000 c803 0000 p_paddr,p_filesz
|
||||
00000048: 0000 0008 0700 0000 p_memsz(128MB),PF_X|PF_W|PF_R
|
||||
00000050: 0010 0000 0084 0408 p_align, <here>
|
||||
00000058: e083 0408 e880 0408 <latest:init="=">, <interpreter>(5c: key)
|
||||
00000058: a883 0408 e880 0408 <latest:init="=">, <interpreter>(5c: key)
|
||||
00000060: 6881 0408 9881 0408 (60: find) (64: execute)
|
||||
00000068: 3881 0408 f0ff ffff (68: jump) (6c: -16)
|
||||
00000070: be5c 8004 08bd 0080 (70: movl $interpreter,%esi) (75: movl $0x10048000,%ebp)
|
||||
|
@ -91,71 +91,63 @@
|
|||
00000240: 3082 0408 0152 0000 R: rstore
|
||||
00000248: 4c82 0408 5dad ff20 popl %ebp; next;
|
||||
|
||||
00000250: 4082 0408 017b 0000 {: dtor
|
||||
00000258: 5c82 0408 588d 6dfc popl %eax;rpush %eax;
|
||||
00000260: 8945 00ad ff20 0000 next;
|
||||
00000250: 4082 0408 0169 0000 i: docol
|
||||
00000258: 5c82 0408 6868 8204 pushl $docol;
|
||||
00000260: 08ad ff20 0000 0000 next;
|
||||
00000268: 8d6d fc89 7500 83c0 <docol>rpush %esi; addl $4,%eax
|
||||
00000270: 0489 c6ad ff20 0000 movl %eax,%esi; next;
|
||||
|
||||
00000268: 5082 0408 017d 0000 }: rtod
|
||||
00000270: 7482 0408 8b45 008d rpop %eax;
|
||||
00000278: 6d04 50ad ff20 0000 pushl %eax; next;
|
||||
00000278: 5082 0408 0165 0000 e: exit
|
||||
00000280: 8482 0408 8b75 008d rpop %esi
|
||||
00000288: 6d04 adff 2000 0000 next
|
||||
|
||||
00000280: 6882 0408 0169 0000 i: docol
|
||||
00000288: 8c82 0408 6898 8204 pushl $docol;
|
||||
00000290: 08ad ff20 0000 0000 next;
|
||||
00000298: 8d6d fc89 7500 83c0 <docol>rpush %esi; addl $4,%eax
|
||||
000002a0: 0489 c6ad ff20 0000 movl %eax,%esi; next;
|
||||
00000290: 7882 0408 014c 0000 L: lit
|
||||
00000298: 9c82 0408 ad50 adff lodsl; pushl %eax; next;
|
||||
000002a0: 2000 0000 0000 0000
|
||||
|
||||
000002b0: 8082 0408 0165 0000 e: exit
|
||||
000002b8: bc82 0408 8b75 008d rpop %esi
|
||||
000002c0: 6d04 adff 2000 0000 next
|
||||
000002a8: 9082 0408 0153 0000 S: string
|
||||
000002b0: b482 0408 ad56 5001 lodsl; pushl %esi; pushl %eax
|
||||
000002b8: c683 c603 83e6 fcad addl %eax,%esi; addl $3,%esi; andl $~3,%esi;next;
|
||||
000002c0: ff20 0000 0000 0000
|
||||
|
||||
000002c8: b082 0408 014c 0000 L: lit
|
||||
000002d0: d482 0408 ad50 adff lodsl; pushl %eax; next;
|
||||
000002d8: 2000 0000 0000 0000
|
||||
000002c8: a882 0408 012b 0000 +: add
|
||||
000002d0: d482 0408 5801 0424 popl %eax; addl %eax,(%esp)
|
||||
000002d8: adff 2000 0000 0000 next;
|
||||
|
||||
000002e0: c882 0408 0153 0000 S: string
|
||||
000002e8: ec82 0408 ad56 5001 lodsl; pushl %esi; pushl %eax
|
||||
000002f0: c683 c603 83e6 fcad addl %eax,%esi; addl $3,%esi; andl $~3,%esi;next;
|
||||
000002f8: ff20 0000 0000 0000
|
||||
000002e0: c882 0408 012d 0000 -: sub
|
||||
000002e8: ec82 0408 5829 0424 popl %eax; subl %eax,(%esp)
|
||||
000002f0: adff 2000 0000 0000 next;
|
||||
|
||||
00000300: e082 0408 012b 0000 +: add
|
||||
00000308: 0c83 0408 5801 0424 popl %eax; addl %eax,(%esp)
|
||||
00000310: adff 2000 0000 0000 next;
|
||||
000002f8: e082 0408 012a 0000 *: mul
|
||||
00000300: 0483 0408 585b 0faf popl %eax; popl %ebx; imul %ebx,%eax
|
||||
00000308: c350 adff 2000 0000 pushl %eax; next;
|
||||
|
||||
00000318: 0083 0408 012d 0000 -: sub
|
||||
00000320: 2483 0408 5829 0424 popl %eax; subl %eax,(%esp)
|
||||
00000328: adff 2000 0000 0000 next;
|
||||
00000310: f882 0408 012f 0000 /: div
|
||||
00000318: 1c83 0408 31d2 5b58 xorl %edx,%edx; popl %ebx; popl %eax
|
||||
00000320: f7fb 50ad ff20 0000 idiv %ebx; pushl %eax
|
||||
|
||||
00000330: 1883 0408 012a 0000 *: mul
|
||||
00000338: 3c83 0408 585b 0faf popl %eax; popl %ebx; imul %ebx,%eax
|
||||
00000340: c350 adff 2000 0000 pushl %eax; next;
|
||||
00000328: 1083 0408 0125 0000 %: mod
|
||||
00000330: 3483 0408 31d2 5b58 xorl %edx,%edx; popl %ebx; popl %eax
|
||||
00000338: f7fb 52ad ff20 0000 idiv %ebx; pushl %edx
|
||||
|
||||
00000348: 3083 0408 012f 0000 /: div
|
||||
00000350: 5483 0408 31d2 5b58 xorl %edx,%edx; popl %ebx; popl %eax
|
||||
00000358: f7fb 50ad ff20 0000 idiv %ebx; pushl %eax
|
||||
00000340: 2883 0408 0126 0000 &: and
|
||||
00000348: 4c83 0408 5821 0424 popl %eax; andl %eax,(%esp)
|
||||
00000350: adff 2000 0000 0000 next;
|
||||
|
||||
00000360: 4883 0408 0125 0000 %: mod
|
||||
00000368: 6c83 0408 31d2 5b58 xorl %edx,%edx; popl %ebx; popl %eax
|
||||
00000370: f7fb 52ad ff20 0000 idiv %ebx; pushl %edx
|
||||
00000358: 4083 0408 017c 0000 |: or
|
||||
00000360: 6483 0408 5809 0424 popl %eax; orl %eax,(%esp)
|
||||
00000368: adff 2000 0000 0000 next;
|
||||
|
||||
00000378: 6083 0408 0126 0000 &: and
|
||||
00000380: 8483 0408 5821 0424 popl %eax; andl %eax,(%esp)
|
||||
00000388: adff 2000 0000 0000 next;
|
||||
00000370: 5883 0408 015e 0000 ^: xor
|
||||
00000378: 7c83 0408 5831 0424 popl %eax; andl %eax,(%esp)
|
||||
00000380: adff 2000 0000 0000 next;
|
||||
|
||||
00000390: 7883 0408 017c 0000 |: or
|
||||
00000398: 9c83 0408 5809 0424 popl %eax; orl %eax,(%esp)
|
||||
000003a0: adff 2000 0000 0000 next;
|
||||
00000388: 7083 0408 013c 0000 <: less
|
||||
00000390: 9483 0408 585b 39c3 popl %eax; popl %ebx; cmpl %eax,%ebx
|
||||
00000398: 0f9c c00f b6c0 50ad setl %al; movzbl %al, %eax; pushl %eax; next;
|
||||
000003a0: ff20 0000 0000 0000
|
||||
|
||||
000003a8: 9083 0408 015e 0000 ^: xor
|
||||
000003b0: b483 0408 5831 0424 popl %eax; andl %eax,(%esp)
|
||||
000003b8: adff 2000 0000 0000 next;
|
||||
|
||||
000003c0: a883 0408 013c 0000 <: less
|
||||
000003c8: cc83 0408 585b 39c3 popl %eax; popl %ebx; cmpl %eax,%ebx
|
||||
000003d0: 0f9c c00f b6c0 50ad setl %al; movzbl %al, %eax; pushl %eax; next;
|
||||
000003d8: ff20 0000 0000 0000
|
||||
|
||||
000003e0: c083 0408 013d 0000 =: equal
|
||||
000003e8: ec83 0408 585b 39c3 popl %eax; popl %ebx; cmpl %eax,%ebx
|
||||
000003f0: 0f94 c00f b6c0 50ad setl %al; movzbl %al, %eax; pushl %eax; next;
|
||||
000003f8: ff20 0000 0000 0000
|
||||
000003a8: 8883 0408 013d 0000 =: equal
|
||||
000003b0: b483 0408 585b 39c3 popl %eax; popl %ebx; cmpl %eax,%ebx
|
||||
000003b8: 0f94 c00f b6c0 50ad setl %al; movzbl %al, %eax; pushl %eax; next;
|
||||
000003c0: ff20 0000 0000 0000
|
||||
|
|
Loading…
Reference in a new issue