Skip to content

Commit a392bb9

Browse files
v1.0.1-fix-pack
1 parent 8e500ef commit a392bb9

File tree

144 files changed

+41893
-16143
lines changed

Some content is hidden

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

144 files changed

+41893
-16143
lines changed

Analise.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public static TipoVariavel ProcessaTipo(string tipo)
3535
switch(tipo)
3636
{
3737
case "int8":
38-
return TipoVariavel.Int16;
38+
return TipoVariavel.Int8;
3939
case "uint8":
40-
return TipoVariavel.UInt16;
40+
return TipoVariavel.UInt8;
4141
case "int16":
4242
return TipoVariavel.Int16;
4343
case "uint16":

Distro/Atual/hcbasic.dll

512 Bytes
Binary file not shown.

Distro/Atual/hcbasic.pdb

40 Bytes
Binary file not shown.

Distro/Exemplos/README.MD

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Distribuição do HCBasic
2+
3+
Todas as distribuições vem com alguns exemplos e arquivos que auxiliam na compilação.
4+
5+
Para testar execute na sua plataforma:
6+
7+
Linux/macOS:
8+
9+
```sh
10+
chmod +x compilar.sh
11+
./compilar.sh
12+
```
13+
14+
Windows:
15+
16+
```sh
17+
compilar.bat
18+
```

Distro/Exemplos/compilar.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
hcbasic helloworld.hcb helloworld.com Plataformas\8086-DOS\ Plataformas\8086\
1+
hcbasic helloworld.hcb helloworld.asm Plataformas\8086-DOS\ Plataformas\8086\
2+
nasm -f bin -o helloworld.com helloworld.asm
3+
4+
hcbasic gui.hcb gui.asm Plataformas\8086-DOS\ Plataformas\8086\
5+
nasm -f bin -o gui.com gui.asm

Distro/Exemplos/compilar.sh

100644100755
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
#!/bin/sh
22

3-
./hcbasic helloworld.hcb helloworld.com Plataformas/8086-DOS Plataformas/8086/
3+
chmod +x hcbasic
4+
5+
./hcbasic helloworld.hcb helloworld.asm Plataformas/8086-DOS Plataformas/8086/
6+
nasm -f bin -o helloworld.com helloworld.asm
7+
8+
./hcbasic gui.hcb gui.asm Plataformas/8086-DOS Plataformas/8086/
9+
nasm -f bin -o gui.com gui.asm

Distro/Exemplos/gui.hcb

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
' Este é um protótipo
2+
Imports System
3+
Imports System.Drawing
4+
Imports System.Forms
5+
Imports VGA
6+
7+
Module Program
8+
9+
' Os controles devem ser declarados no modulo
10+
Dim MainForm as Control
11+
Dim HelloWorldLabel as Control
12+
Dim OkButton as Control
13+
Dim HelloWorldText as String
14+
15+
Public Sub Main(args as String)
16+
' O Driver de Video deve ser iniciado
17+
VGA.Mode640x480x2
18+
' O Motor de Aplicação deve ser iniciado
19+
Application.Initialize
20+
21+
' Os controles devem ser criados e inicializados
22+
Form.Initialize MainForm
23+
MainForm.Top = 30
24+
MainForm.Left = 10
25+
MainForm.Width = 200
26+
MainForm.Height = 100
27+
MainForm.Text = "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"
28+
29+
Label.Initialize HelloWorldLabel
30+
String.Copy HelloWorldText, "HELLO WORLD"
31+
HelloWorldLabel.Text = HelloWorldText
32+
HelloWorldLabel.Top = 8
33+
HelloWorldLabel.Left = 4
34+
HelloWorldLabel.Width = 170
35+
HelloWorldLabel.Height = 10
36+
HelloWorldLabel.Visible = 1
37+
Control.Add MainForm, HelloWorldLabel
38+
39+
Button.Initialize OkButton
40+
OkButton.Text = "Enter para SAIR"
41+
OkButton.Top = 21
42+
OkButton.Left = 4
43+
OkButton.Width = 150
44+
OkButton.Height = 20
45+
OkButton.Visible = 1
46+
OkButton.OnKeyPress = AddressOf(OkButton_OnKeyPress)
47+
OkButton.OnClick = AddressOf(OkButton_OnClick)
48+
Control.Add MainForm, OkButton
49+
50+
' Deve ser iniciado o gerenciador de aplicação que tomará conta dos eventos
51+
Application.Run MainForm
52+
53+
Graphics.Mode80x25x16
54+
End
55+
56+
57+
Sub OkButton_OnKeyPress(ctrl as Control, e as KeyboardEventArgs)
58+
String.Copy HelloWorldText, "PRESSIONADO "
59+
Dim ptr as PtrByteArray
60+
ptr = HelloWorldText
61+
@ptr = @ptr + 14
62+
ptr = e.AsciiChar
63+
Control.Redraw HelloWorldLabel
64+
End
65+
66+
Sub OkButton_OnClick(ctrl as Control, e as MouseEventArgs)
67+
Application.Exit 0
68+
End
69+
70+
End

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module OS
1616
asm "cmp sp, END"
1717
asm "ja .end"
1818
Throw StackOverflowError
19-
asm ".end"
19+
asm ".end:"
2020
End
2121

2222
sub Start2
@@ -140,9 +140,18 @@ module OS
140140
asm "mov ax, REALOC_TABLE"
141141
end
142142

143-
public function ConsoleReadChar() as uint8
143+
public function ConsoleAvail() as uint8
144144
asm "mov ah, 1"
145-
asm "int 0x21"
145+
asm "int 0x16"
146+
asm "jnz .sim"
147+
Return 0
148+
asm ".sim:"
149+
Return 1
150+
end
151+
152+
public function ConsoleReadChar() as uint8
153+
asm "mov ah, 0"
154+
asm "int 0x16"
146155
asm "xor ah, ah"
147156
end
148157

0 commit comments

Comments
 (0)