mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
dos
This commit is contained in:
parent
439aa159ea
commit
18747ae31a
@ -22,7 +22,7 @@ main:
|
||||
ret
|
||||
|
||||
.msg = "Hello World :)"
|
||||
.buf = "!!!!!!!!!!!!!!!!"
|
||||
.buf = "!!!!!!!!!!!!!!!!!!!!!"
|
||||
|
||||
;
|
||||
; Exit function
|
||||
|
21
dos/str/strcpy.k
Normal file
21
dos/str/strcpy.k
Normal file
@ -0,0 +1,21 @@
|
||||
; The OS/K Team licenses this file to you under the MIT license.
|
||||
; See the LICENSE file in the project root for more information.
|
||||
|
||||
;
|
||||
; void strcpy(char *, const char *)
|
||||
;
|
||||
strcpy:
|
||||
ret
|
||||
|
||||
;
|
||||
; void strncpy(char *, const char *, int)
|
||||
;
|
||||
strncpy:
|
||||
ret
|
||||
|
||||
;
|
||||
; void strnzcpy(char *, const char *, int)
|
||||
;
|
||||
strnzcpy:
|
||||
ret
|
||||
|
@ -3,4 +3,5 @@
|
||||
|
||||
include "str/strlen.k"
|
||||
include "str/strrev.k"
|
||||
include "str/strcpy.k"
|
||||
|
||||
|
@ -10,8 +10,7 @@ strrev:
|
||||
jz .4
|
||||
|
||||
; save str's location
|
||||
; xxx why is dec'ing needed?
|
||||
lea rdx, b[ax1 + -1]
|
||||
mov rdx, ax1
|
||||
|
||||
; go to str's end, just before
|
||||
; the null terminator
|
||||
|
@ -31,7 +31,7 @@ void i_##name(ctx_t *ctx, acc_t *p1, acc_t *p2) \
|
||||
assert(p1->type == A_REG || p1->mem); \
|
||||
if (p1->mem) { \
|
||||
ulong addr = p1->type == A_REG ? ctx->r[p1->val].val : p1->val; \
|
||||
writemem(ctx, v1, addr, p1->mlen); \
|
||||
writemem(ctx, v1, addr + p1->off, p1->mlen); \
|
||||
} \
|
||||
else ctx->r[p1->val].val = v1; \
|
||||
} \
|
||||
|
Loading…
x
Reference in New Issue
Block a user