Skip to content

Commit 3d49773

Browse files
v1.0
1 parent 9783b8f commit 3d49773

File tree

47 files changed

+3079
-1838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3079
-1838
lines changed

Distro/Atual/hcbasic.dll

0 Bytes
Binary file not shown.

Distro/Atual/hcbasic.pdb

8 Bytes
Binary file not shown.

Distro/Linux64/Plataformas/8086-DOS/System.OS.hcb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ module OS
6161
end
6262
end
6363
' Define ponteiro
64-
asm "mov ax, cs"
65-
asm "mov [bp-2], ax"
66-
asm "mov word [bp-4], 0x80"
64+
@args = 0x80
65+
#args = CodeSegment()
6766
' Adiciona um zero ao final da variavel para ser ASCIZ
6867
asm "mov al, [0x80]"
6968
asm "xor ah, ah"
@@ -155,6 +154,7 @@ end
155154
module File
156155
public function Open(stream as Stream, filename as ptrbytearray) as uint16
157156
dim id as uint16
157+
id = 0
158158
asm "mov ax, 0x3d02"
159159
asm "push ds"
160160
asm "push word [bp+12]"
@@ -183,6 +183,7 @@ module File
183183

184184
public function Create(stream as Stream, filename as ptrbytearray) as uint16
185185
dim id as uint16
186+
id = 0
186187
asm "mov ax, 0x3c00"
187188
asm "push ds"
188189
asm "push word [bp+12]"

Distro/Linux64/Plataformas/8086/System.hcb

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ error NoAnswerError = 10
1414
error TimeoutError = 11
1515
error InvalidValueError = 12
1616
error AccessDeniedError = 13
17+
error InvalidFormatError = 14
1718

1819
Structure ColorPalette
1920
Dim Black as UInt16
@@ -172,7 +173,29 @@ module String
172173
return i
173174
end
174175

176+
public sub Substring(dest as PtrByteArray, orig as PtrByteArray, pos as uint16, size as uint16)
177+
dim dest_len as UInt16
178+
dim orig_len as UInt16
179+
dim i as uint16
180+
dim value as uint8
181+
dest_len = dest
182+
orig_len = String.Length(orig)
183+
if pos > orig_len then throw OutOfBoundsError
184+
if (size + 1) > dest_len then throw CapacityOverflowError
185+
@dest++
186+
@orig = @orig + 1 + pos
187+
for i = 1 to size
188+
value = orig
189+
dest = value
190+
@dest++
191+
@orig++
192+
end
193+
dest = 0
194+
end
195+
175196
public function Equals(txt1 as ptrbytearray, txt2 as ptrbytearray) as uint16
197+
@txt1++
198+
@txt2++
176199
while txt1 == txt2
177200
if txt1 == 0 then return 1
178201
@txt1++
@@ -232,11 +255,53 @@ structure Stream
232255
Dim WriteRaw as func(of stream, ptrbytearray, uint16, uint16)
233256
Dim Write as func(of stream, ptrbytearray, uint16)
234257
Dim Close as func(of stream, uint16)
235-
Dim SeekCurrent as func(of stream, uint16) as uint16
236-
Dim SeekStart as func(of stream, uint16) as uint16
237-
Dim SeekEnd as func(of stream, uint16) as uint16
258+
Dim SeekCurrent as func(of stream, uint16, uint16)
259+
Dim SeekStart as func(of stream, uint16, uint16)
260+
Dim SeekEnd as func(of stream, uint16, uint16)
238261
end
239262

263+
module Stream
264+
' Return size
265+
Public Function ReadRaw(s as Stream, data as PtrByteArray, len as UInt16) as UInt16
266+
If #s.ReadRaw == 0 Then Throw NotImplementedError
267+
Return s.ReadRaw.Invoke(data, len)
268+
End
269+
' Return size
270+
Public Function Read(s as Stream, data as PtrByteArray) as UInt16
271+
If #s.Read == 0 Then Throw NotImplementedError
272+
Return s.Read.Invoke(data)
273+
End
274+
' Return size
275+
Public Function WriteRaw(s as Stream, data as PtrByteArray, len as UInt16) as UInt16
276+
If #s.WriteRaw == 0 Then Throw NotImplementedError
277+
Return s.WriteRaw.Invoke(data, len)
278+
End
279+
' Return size
280+
Public Function Write(s as Stream, data as PtrByteArray) as UInt16
281+
If #s.Write == 0 Then Throw NotImplementedError
282+
Return s.Write.Invoke(data)
283+
End
284+
285+
Public Function Close(s as Stream) as UInt16
286+
If #s.Close == 0 Then Throw NotImplementedError
287+
Return s.Close.Invoke()
288+
End
289+
290+
Public Function SeekCurrent(s as Stream, position as UInt16) as UInt16
291+
If #s.SeekCurrent == 0 Then Throw NotImplementedError
292+
Return s.SeekCurrent.Invoke(position)
293+
End
294+
295+
Public Function SeekEnd(s as Stream, pos as UInt16) as UInt16
296+
If #s.SeekEnd == 0 Then Throw NotImplementedError
297+
Return s.SeekEnd.Invoke(pos)
298+
End
299+
300+
Public Function SeekStart(s as Stream, pos as UInt16) as UInt16
301+
If #s.SeekStart == 0 Then Throw NotImplementedError
302+
Return s.SeekStart.Invoke(pos)
303+
End
304+
end
240305

241306
structure String
242307
Dim Capacity as UInt8

Distro/Linux64/hcbasic.dll

1.5 KB
Binary file not shown.

Distro/Linux64/hcbasic.pdb

340 Bytes
Binary file not shown.

Distro/LinuxARM32/Plataformas/8086-DOS/System.OS.hcb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ module OS
6161
end
6262
end
6363
' Define ponteiro
64-
asm "mov ax, cs"
65-
asm "mov [bp-2], ax"
66-
asm "mov word [bp-4], 0x80"
64+
@args = 0x80
65+
#args = CodeSegment()
6766
' Adiciona um zero ao final da variavel para ser ASCIZ
6867
asm "mov al, [0x80]"
6968
asm "xor ah, ah"
@@ -155,6 +154,7 @@ end
155154
module File
156155
public function Open(stream as Stream, filename as ptrbytearray) as uint16
157156
dim id as uint16
157+
id = 0
158158
asm "mov ax, 0x3d02"
159159
asm "push ds"
160160
asm "push word [bp+12]"
@@ -183,6 +183,7 @@ module File
183183

184184
public function Create(stream as Stream, filename as ptrbytearray) as uint16
185185
dim id as uint16
186+
id = 0
186187
asm "mov ax, 0x3c00"
187188
asm "push ds"
188189
asm "push word [bp+12]"

Distro/LinuxARM32/Plataformas/8086/System.hcb

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ error NoAnswerError = 10
1414
error TimeoutError = 11
1515
error InvalidValueError = 12
1616
error AccessDeniedError = 13
17+
error InvalidFormatError = 14
1718

1819
Structure ColorPalette
1920
Dim Black as UInt16
@@ -172,7 +173,29 @@ module String
172173
return i
173174
end
174175

176+
public sub Substring(dest as PtrByteArray, orig as PtrByteArray, pos as uint16, size as uint16)
177+
dim dest_len as UInt16
178+
dim orig_len as UInt16
179+
dim i as uint16
180+
dim value as uint8
181+
dest_len = dest
182+
orig_len = String.Length(orig)
183+
if pos > orig_len then throw OutOfBoundsError
184+
if (size + 1) > dest_len then throw CapacityOverflowError
185+
@dest++
186+
@orig = @orig + 1 + pos
187+
for i = 1 to size
188+
value = orig
189+
dest = value
190+
@dest++
191+
@orig++
192+
end
193+
dest = 0
194+
end
195+
175196
public function Equals(txt1 as ptrbytearray, txt2 as ptrbytearray) as uint16
197+
@txt1++
198+
@txt2++
176199
while txt1 == txt2
177200
if txt1 == 0 then return 1
178201
@txt1++
@@ -232,11 +255,53 @@ structure Stream
232255
Dim WriteRaw as func(of stream, ptrbytearray, uint16, uint16)
233256
Dim Write as func(of stream, ptrbytearray, uint16)
234257
Dim Close as func(of stream, uint16)
235-
Dim SeekCurrent as func(of stream, uint16) as uint16
236-
Dim SeekStart as func(of stream, uint16) as uint16
237-
Dim SeekEnd as func(of stream, uint16) as uint16
258+
Dim SeekCurrent as func(of stream, uint16, uint16)
259+
Dim SeekStart as func(of stream, uint16, uint16)
260+
Dim SeekEnd as func(of stream, uint16, uint16)
238261
end
239262

263+
module Stream
264+
' Return size
265+
Public Function ReadRaw(s as Stream, data as PtrByteArray, len as UInt16) as UInt16
266+
If #s.ReadRaw == 0 Then Throw NotImplementedError
267+
Return s.ReadRaw.Invoke(data, len)
268+
End
269+
' Return size
270+
Public Function Read(s as Stream, data as PtrByteArray) as UInt16
271+
If #s.Read == 0 Then Throw NotImplementedError
272+
Return s.Read.Invoke(data)
273+
End
274+
' Return size
275+
Public Function WriteRaw(s as Stream, data as PtrByteArray, len as UInt16) as UInt16
276+
If #s.WriteRaw == 0 Then Throw NotImplementedError
277+
Return s.WriteRaw.Invoke(data, len)
278+
End
279+
' Return size
280+
Public Function Write(s as Stream, data as PtrByteArray) as UInt16
281+
If #s.Write == 0 Then Throw NotImplementedError
282+
Return s.Write.Invoke(data)
283+
End
284+
285+
Public Function Close(s as Stream) as UInt16
286+
If #s.Close == 0 Then Throw NotImplementedError
287+
Return s.Close.Invoke()
288+
End
289+
290+
Public Function SeekCurrent(s as Stream, position as UInt16) as UInt16
291+
If #s.SeekCurrent == 0 Then Throw NotImplementedError
292+
Return s.SeekCurrent.Invoke(position)
293+
End
294+
295+
Public Function SeekEnd(s as Stream, pos as UInt16) as UInt16
296+
If #s.SeekEnd == 0 Then Throw NotImplementedError
297+
Return s.SeekEnd.Invoke(pos)
298+
End
299+
300+
Public Function SeekStart(s as Stream, pos as UInt16) as UInt16
301+
If #s.SeekStart == 0 Then Throw NotImplementedError
302+
Return s.SeekStart.Invoke(pos)
303+
End
304+
end
240305

241306
structure String
242307
Dim Capacity as UInt8

Distro/LinuxARM32/hcbasic.dll

1.5 KB
Binary file not shown.

Distro/LinuxARM32/hcbasic.pdb

340 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)