-
Notifications
You must be signed in to change notification settings - Fork 0
/
exe.mya16
87 lines (73 loc) · 1.73 KB
/
exe.mya16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "rpn2"
cmd_fibbo_exe:
call PUSHSTATE
xor bx, bx
mov cx, 1
mov bp, 0
cmd_fibbo_exe_start:
mov ax, bx
call PRINT_AX
mov ah, endl
int 1
add bx, cx
mov dx, cx
mov cx, bx
mov bx, dx
cmp rm, bp
je cmd_fibbo_exe_start
call POPSTATE
ret
#string cmd_shutdown_msg "Shutting down"
cmd_shutdown_exe:
mov adr, cmd_shutdown_msg
call WRITE
mov ah, '.'
mov bx, 10 ; cycles to sleep
call SLEEP
int 1
call SLEEP
int 1
call SLEEP
int 1
call SLEEP
; clear screen
mov ah, 12
int 1
; shut down
mov ah, 0
int 0xffff
ret
cmd_motd_exe:
mov adr, os_bootmsg
call WRITE
ret
#string cmd_help_head "List of commands:\n"
#string cmd_help_hyphen " - "
cmd_help_exe:
call PUSHSTATE
mov adr, cmd_help_head ; vypiseme cmd_help_head
call WRITE
mov adr, os_cmdlist ; nacteme zacatek seznamu do adr
mov bp, os_cmdlistend ; konec seznamu do adr
mov ah, endl ; konec radku do ah
cmd_help_loop:
iadd adr, 2 ; ve stringu preskocime jmp command
call WRITE ; vypiseme command
push adr ; push aktualni adresy
mov adr, cmd_help_hyphen ; vypsani pomlcky
call WRITE
pop adr ; pop aktualni adresy
iadd adr, 3 ; ve stringu preskocime jmp command - v tomto pripade 3 slova
call WRITE ; vypiseme popis commandu
int 1 ; zalomeni radku - v ah je porad endl
iadd adr, 1 ; skok na zacatek jmp
cmp adr, bp ; zjistime jestli nejsme na konci seznamu
jl cmd_help_loop ; pokud ne, opakujeme
call POPSTATE
ret
cmd_clrscrn_exe:
call PUSHSTATE
mov ah, 12
int 1
call POPSTATE
ret