From 609b6741e8dd1080953a816c196ef0da26d6be51 Mon Sep 17 00:00:00 2001 From: Koichi Nakamura Date: Tue, 29 Dec 2020 17:33:30 +0900 Subject: [PATCH] Add "e" --- README.md | 1 + planck.xxd | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6981c59..4f827d8 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,4 @@ $ cat helloworld.fs | ./plank | { | 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 | diff --git a/planck.xxd b/planck.xxd index 283a18a..dedc1f8 100644 --- a/planck.xxd +++ b/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, PT_LOAD 00000038: 0000 0000 0080 0408 p_offset,p_vaddr=0x08048000 -00000040: 0000 0000 a802 0000 p_paddr,p_filesz +00000040: 0000 0000 c802 0000 p_paddr,p_filesz 00000048: 0000 0008 0700 0000 p_memsz(128MB),PF_X|PF_W|PF_R 00000050: 0010 0000 0200 0000 p_align, -00000058: 8082 0408 e880 0408 , (5c: key) +00000058: b082 0408 e880 0408 , (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) @@ -104,3 +104,7 @@ 00000290: 08ad ff20 0000 0000 next; 00000298: 8d6d fc89 7500 83c0 rpush %esi; addl $4,%eax 000002a0: 0489 c6ad ff20 0000 movl %eax,%esi; next; + +000002b0: 8082 0408 0165 0000 e: exit +000002b8: bc82 0408 8b75 008d rpop %esi +000002c0: 6d04 adff 2000 0000 next