X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=main.asm;h=54b2a5dfd8c21cf4e7de8ef30c7470ab5c3ecac0;hb=4a9ccd4fd3b9b19c696a2f37e0b46eecc1fdd671;hp=d1ff2b3192e7b59a6a677841f0886a31e9d9f3f3;hpb=5224cfbc1856cd2f4c786f73223b1182acbc96cc;p=rrq%2Fjonasforth.git diff --git a/main.asm b/main.asm index d1ff2b3..54b2a5d 100644 --- a/main.asm +++ b/main.asm @@ -84,11 +84,11 @@ macro forth_asm label, name, immediate { .start: } -os_code_section - include "impl.asm" ; Misc. subroutines include "bootstrap.asm" ; Forth words encoded in Assembly +os_code_section + main: cld ; Clear direction flag so LODSQ does the right thing. mov rbp, return_stack_top ; Initialize return stack @@ -588,6 +588,27 @@ forth MAIN, 'MAIN' dq BRANCH, -8 * 2 dq TERMINATE +;; EFI: + +forth EFI_SYSTEM_TABLE_CONSTANT, 'SystemTable' + dq LIT, system_table, GET + dq EXIT + +forth_asm EFICALL2, 'EFICALL2' + pop rax ; function pointer + pop rdx ; 2nd argument + pop rcx ; 1st argument + + push rsi + + sub rsp, 32 + call rax + add rsp, 32 + + pop rsi + + next + ;; Built-in variables: forth STATE, 'STATE' @@ -665,6 +686,6 @@ return_stack_top: ;; include the file directly in the binary, and then interpret it at startup. sysf: file 'sys.f' -file 'example.f' +file 'uefi.f' sysf.len = $ - sysf