Trying to set up a stack.

This commit is contained in:
CrazyEttin 2021-06-02 18:13:12 +03:00
parent d0a5441a62
commit 6e5019dcb7
3 changed files with 13 additions and 9 deletions

View File

@ -37,7 +37,7 @@ mov cl, 0x2
;Set the destination ;Set the destination
mov ax, 0x1000 mov ax, 0x1000
mov es, ax mov es, ax
mov bx, 0 mov bx, 0x200
;Set the size ;Set the size
mov al, 0x20 mov al, 0x20
;Load ;Load
@ -45,7 +45,7 @@ mov ah, 0x2
int 0x13 int 0x13
;Boot the system ;Boot the system
jmp 0x1000:0 jmp 0x1000:0x200
;Padding ;Padding
times 0x1fe-($-$$) db 0 times 0x1fe-($-$$) db 0

View File

@ -25,10 +25,6 @@ mov byte [.lastln], dh
mov ah, 0x0 mov ah, 0x0
int 0x16 int 0x16
;Check for null
cmp al, 0x0
je .loop
;Check for return ;Check for return
cmp al, 0xd cmp al, 0xd
je .return je .return
@ -84,7 +80,7 @@ jmp .char
;Get the cursor position ;Get the cursor position
mov ah, 0x3 mov ah, 0x3
int 0x10 int 0x10
;More from the end of a line to the beginning of the next one ;Move from the end of a line to the beginning of the next one
cmp dl, [cpl] cmp dl, [cpl]
je .nextln je .nextln
;Move forward within a line ;Move forward within a line
@ -107,12 +103,12 @@ jmp .checkln
.backspace: .backspace:
;Check for the input beginning ;Check for the input beginning
cmp bl, 0x0 cmp bl, 0x1
je .loop je .loop
;Get the cursor position ;Get the cursor position
mov ah, 0x3 mov ah, 0x3
int 0x10 int 0x10
;More from the beginning of a line to the end of the previous one ;Move from the beginning of a line to the end of the previous one
cmp dl, 0x1 cmp dl, 0x1
je .prevln je .prevln
;Move backward within a line ;Move backward within a line

View File

@ -1,3 +1,4 @@
[ORG 0x200]
jmp start jmp start
;Calls ;Calls
@ -20,6 +21,13 @@ start:
mov ax, 0x1000 mov ax, 0x1000
mov ds, ax mov ds, ax
;Set up the stack
cli
mov ax, 0x1000
mov ss, ax
mov sp, 0x200
sti
;Get the terminal width ;Get the terminal width
mov ah, 0xf mov ah, 0xf
int 0x10 int 0x10