mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
vm
This commit is contained in:
parent
c8d899db9e
commit
227150be08
@ -11,21 +11,25 @@
|
|||||||
blte zero, eax, .do_exec
|
blte zero, eax, .do_exec
|
||||||
|
|
||||||
; nope, append ".com" and try again
|
; nope, append ".com" and try again
|
||||||
|
mov esi, argv0
|
||||||
sub ecx, argbuf.size, 5
|
sub ecx, argbuf.size, 5
|
||||||
scasb ax0, zero ; find null-term
|
scasb esi, zero ; find null-term
|
||||||
mov b[ax0+0], '.' ; ".com"
|
mov b[esi], '.' ; ".com"
|
||||||
mov b[ax0+1], 'c'
|
mov b[esi+1], 'c'
|
||||||
mov b[ax0+2], 'o'
|
mov b[esi+2], 'o'
|
||||||
mov b[ax0+3], 'm'
|
mov b[esi+3], 'm'
|
||||||
nul b[ax0+4]
|
nul b[esi+4]
|
||||||
|
|
||||||
; try again
|
; try again
|
||||||
mov eax, Sys.OpenFile
|
mov eax, Sys.OpenFile
|
||||||
mov ax0, argv0
|
mov ax0, argv0
|
||||||
trap 0
|
trap 0
|
||||||
|
|
||||||
; still no good?
|
; we good?
|
||||||
bltz eax, .exec_not_found
|
blte 0, eax, .do_exec
|
||||||
|
|
||||||
|
nul b[esi] ; erase ".com"
|
||||||
|
jmp .exec_not_found
|
||||||
|
|
||||||
.do_exec:
|
.do_exec:
|
||||||
; load file into memory
|
; load file into memory
|
||||||
|
@ -1380,21 +1380,25 @@ main:
|
|||||||
blte zero, eax, .do_exec
|
blte zero, eax, .do_exec
|
||||||
|
|
||||||
; nope, append ".com" and try again
|
; nope, append ".com" and try again
|
||||||
|
mov esi, argv0
|
||||||
sub ecx, argbuf.size, 5
|
sub ecx, argbuf.size, 5
|
||||||
scasb ax0, zero ; find null-term
|
scasb esi, zero ; find null-term
|
||||||
mov b[ax0+0], '.' ; ".com"
|
mov b[esi], '.' ; ".com"
|
||||||
mov b[ax0+1], 'c'
|
mov b[esi+1], 'c'
|
||||||
mov b[ax0+2], 'o'
|
mov b[esi+2], 'o'
|
||||||
mov b[ax0+3], 'm'
|
mov b[esi+3], 'm'
|
||||||
nul b[ax0+4]
|
nul b[esi+4]
|
||||||
|
|
||||||
; try again
|
; try again
|
||||||
mov eax, Sys.OpenFile
|
mov eax, Sys.OpenFile
|
||||||
mov ax0, argv0
|
mov ax0, argv0
|
||||||
trap 0
|
trap 0
|
||||||
|
|
||||||
; still no good?
|
; we good?
|
||||||
bltz eax, .exec_not_found
|
blte 0, eax, .do_exec
|
||||||
|
|
||||||
|
nul b[esi] ; erase ".com"
|
||||||
|
jmp .exec_not_found
|
||||||
|
|
||||||
.do_exec:
|
.do_exec:
|
||||||
; load file into memory
|
; load file into memory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user