From fa5c3569289209ba0d4c49da3545022201f722aa Mon Sep 17 00:00:00 2001 From: superturbocat2001 Date: Thu, 12 Nov 2020 00:57:05 +0000 Subject: [PATCH] - Renamed golang example file. - Added DrawBar function git-svn-id: svn://kolibrios.org@8178 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/golang/Makefile | 2 +- .../develop/golang/{main.go => example.go} | 2 + programs/develop/golang/int40.s | 86 ------------------- 3 files changed, 3 insertions(+), 87 deletions(-) rename programs/develop/golang/{main.go => example.go} (95%) delete mode 100755 programs/develop/golang/int40.s diff --git a/programs/develop/golang/Makefile b/programs/develop/golang/Makefile index 5f23f51c7e..48e171956f 100644 --- a/programs/develop/golang/Makefile +++ b/programs/develop/golang/Makefile @@ -1,4 +1,4 @@ -PROGRAM=main +PROGRAM=example SOURCES=syscalls.o colors.go.o colors.gox os.go.o os.gox $(PROGRAM).go.o LIBOBJ=os.go.o syscalls.o colors.go.o GOFLAGS= -nostdlib -nostdinc -fno-stack-protector -fno-split-stack -static -m32 -g -I. diff --git a/programs/develop/golang/main.go b/programs/develop/golang/example.go similarity index 95% rename from programs/develop/golang/main.go rename to programs/develop/golang/example.go index bcf7f01442..d640e582b7 100644 --- a/programs/develop/golang/main.go +++ b/programs/develop/golang/example.go @@ -1,4 +1,5 @@ package kernel + import "os" import "colors" @@ -21,6 +22,7 @@ func RedrawAll(bar_pos int){ os.CreateButton(300, 128, 80, 30, Btn2, colors.Blue); os.WriteText(32,128, 0x11000000 | colors.White,btn_txt1, 10) os.WriteText(320,128, 0x11000000 | colors.White,btn_txt2, 10) + os.DrawBar(uint32(bar_pos), 90, 100, 30, colors.Red); } func Load() { diff --git a/programs/develop/golang/int40.s b/programs/develop/golang/int40.s deleted file mode 100755 index 37fd4ed779..0000000000 --- a/programs/develop/golang/int40.s +++ /dev/null @@ -1,86 +0,0 @@ - -SECTION .text - -[GLOBAL __start] -extern go.kernel.Load - -global go.os.Sleep -global go.os.Event -global go.os.Button -global go.os.Exit -global go.os.Redraw -global go.os.Window - -__start: - call go.kernel.Load - ret - -go.os.Sleep: - push ebp - mov ebp,esp - mov eax, 5 - mov ebx, [ebp+8] - int 0x40 - mov esp,ebp - pop ebp - ret - - -go.os.Event: - push ebp - mov ebp,esp - mov eax, 10 - int 0x40 - mov esp,ebp - pop ebp - ret - -go.os.Button: - push ebp - mov ebp,esp - mov eax, 17 - int 0x40 - mov esp,ebp - pop ebp - ret - -go.os.Exit: - push ebp - mov ebp,esp - mov eax, -1 - int 0x40 - mov esp,ebp - pop ebp - ret - - -go.os.Redraw: - push ebp - mov ebp,esp - mov eax, 12 - mov ebx, [ebp+8] - int 0x40 - mov esp,ebp - pop ebp - ret - -go.os.Window: - push ebp - mov ebp,esp - mov ebx, [ebp+8] - shl ebx, 16 - or ebx, [ebp+16] - mov ecx, [ebp+12] - shl ecx, 16 - or ecx, [ebp+20] - mov edx, 0x14 - shl edx, 24 - or edx, 0xFFFFFF - mov esi, 0x808899ff - mov edi, [ebp+24] - xor eax, eax - int 0x40 - mov esp,ebp - pop ebp - ret -