-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpico200.s
114 lines (105 loc) · 1.55 KB
/
pico200.s
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
; PICO200 - THE ~200 BYTE PROGRAMMING LANGUAGE
; WRITTEN BY VARDAN PETROSYAN JANUARY 2025
ORG 7C00H
MOV AH, 2
MOV AL, 1
MOV CH, 0
MOV CL, 2
MOV DH, 0
MOV DL, 80H
MOV BX, 1000H
INT 13H
MOV SI, 1000H
JMP LOOP
LOOP:
MOV AL, [SI]
TEST AL, AL
JZ END
INC SI
CMP AL, 'I'
JE INSTI
CMP AL, 'D'
JE INSTD
CMP AL, 'L'
JE INSTL
CMP AL, 'J'
JE INSTJ
CMP AL, 'Z'
JE INSTZ
CMP AL, 'E'
JE INSTE
CMP AL, 'K'
JE END
CMP AL, 'P'
JE INSTP
CONTINUE:
JMP LOOP
INSTI:
MOVZX DI, BYTE [SI]
SUB DI, 32
ADD DI, REGS
INC SI
INC BYTE [DI]
JMP CONTINUE
INSTD:
MOVZX DI, BYTE [SI]
SUB DI, 32
ADD DI, REGS
INC SI
DEC BYTE [DI]
JMP CONTINUE
INSTP:
MOVZX DI, BYTE [SI]
SUB DI, 32
ADD DI, REGS
INC SI
MOV AL, [DI]
MOV AH, 0EH
INT 10H
JMP CONTINUE
INSTL:
MOVZX DI, BYTE [SI]
SUB DI, 32
ADD DI, REGS
INC SI
ADD [DI], SI
JMP CONTINUE
INSTJ:
MOVZX DI, BYTE [SI]
SUB DI, 32
ADD DI, REGS
INC SI
MOV SI, [DI]
JMP CONTINUE
INSTZ:
MOVZX DI, BYTE [SI]
SUB DI, 32
ADD DI, REGS
MOV DI, [DI]
INC SI
TEST DI, DI
JNZ .NO
MOVZX BP, BYTE [SI]
INC SI
SUB BP, 32
ADD BP, REGS
MOV SI, [BP]
JMP CONTINUE
.NO:
INC SI
JMP CONTINUE
INSTE:
MOVZX DI, BYTE [SI]
SUB DI, 32
ADD DI, REGS
MOV DI, [DI]
INC SI
TEST DI, DI
JNZ .NO
JMP END
.NO:
JMP CONTINUE
END: JMP $
REGS: TIMES 32 DB 0
TIMES 510-($-$$) DB 0
DB 0X55, 0XAA