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
fd5dc45ff3
commit
58ca78f1f1
@ -9,21 +9,20 @@ main:
|
|||||||
|
|
||||||
mov ax0, .msg
|
mov ax0, .msg
|
||||||
call print
|
call print
|
||||||
break
|
|
||||||
|
|
||||||
mov ax0, .buf
|
mov ax0, .buf
|
||||||
mov ax1, .msg
|
mov ax1, .msg
|
||||||
call strrev
|
call strrev
|
||||||
break
|
|
||||||
|
|
||||||
|
prn 10
|
||||||
mov ax0, .buf
|
mov ax0, .buf
|
||||||
call print
|
call print
|
||||||
|
|
||||||
leave
|
leave
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.msg = "Hello World :)\n"
|
.msg = "Hello World :)"
|
||||||
.buf = " "
|
.buf = "!!!!!!!!!!!!!!!!"
|
||||||
|
|
||||||
;
|
;
|
||||||
; Exit function
|
; Exit function
|
||||||
|
@ -10,8 +10,11 @@ strrev:
|
|||||||
jz .4
|
jz .4
|
||||||
|
|
||||||
; save str's location
|
; save str's location
|
||||||
mov rdx, ax1
|
; xxx why is dec'ing needed?
|
||||||
|
lea rdx, b[ax1 + -1]
|
||||||
|
|
||||||
|
; go to str's end, just before
|
||||||
|
; the null terminator
|
||||||
.1:
|
.1:
|
||||||
test b[ax1+1], b[ax1+1]
|
test b[ax1+1], b[ax1+1]
|
||||||
jz .2
|
jz .2
|
||||||
@ -19,6 +22,8 @@ strrev:
|
|||||||
inc ax1
|
inc ax1
|
||||||
jmp .1
|
jmp .1
|
||||||
|
|
||||||
|
; copy, going backward though str
|
||||||
|
; and forward through buf
|
||||||
.2:
|
.2:
|
||||||
mov b[ax0], b[ax1]
|
mov b[ax0], b[ax1]
|
||||||
|
|
||||||
|
10
pc/mem.c
10
pc/mem.c
@ -94,6 +94,15 @@ void writemem8(ctx_t *ctx, ulong val, ulong addr)
|
|||||||
|
|
||||||
ushort v = ctx->mp[real];
|
ushort v = ctx->mp[real];
|
||||||
|
|
||||||
|
if (!(addr % 2)) {
|
||||||
|
ctx->mp[real] = ((v & 0xFF00) << 8) | (val & 0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
ctx->mp[real] = (v & 0xFF) | (((val & 0xFF) << 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if (addr % 2) {
|
if (addr % 2) {
|
||||||
ctx->mp[real] = (v & 0xFF00) | (val & 0xFF);
|
ctx->mp[real] = (v & 0xFF00) | (val & 0xFF);
|
||||||
}
|
}
|
||||||
@ -101,6 +110,7 @@ void writemem8(ctx_t *ctx, ulong val, ulong addr)
|
|||||||
else {
|
else {
|
||||||
ctx->mp[real] = (v & 0xFF) | (((val & 0xFF) << 8));
|
ctx->mp[real] = (v & 0xFF) | (((val & 0xFF) << 8));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void writemem16(ctx_t *ctx, ulong val, ulong addr)
|
void writemem16(ctx_t *ctx, ulong val, ulong addr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user