Compare commits
10 Commits
1565fb3720
...
webview-ne
Author | SHA1 | Date | |
---|---|---|---|
c1aac375e2 | |||
8d235ce49b | |||
e423bfb2d1 | |||
1483ec8462 | |||
e8121c66f8 | |||
6aff7b8c02 | |||
e0d724286f | |||
03dcc2051f | |||
03111f5e99 | |||
4cc716458a |
@@ -69,6 +69,7 @@ img_files = {
|
||||
{"SETTINGS/SYSTEM.INI", "common/settings/system.ini"},
|
||||
{"SETTINGS/TASKBAR.INI", "common/settings/taskbar.ini"},
|
||||
{"SETTINGS/SYSTEM.ENV", "common/settings/system.env"},
|
||||
{"SETTINGS/USBDRV.DAT",VAR_DRVS .. "/usb/usbother/usbdrv.dat"},
|
||||
}
|
||||
|
||||
-- For russian build, add russian-only files.
|
||||
@@ -567,6 +568,7 @@ tup.append_table(img_files, {
|
||||
{"DRIVERS/OHCI.SYS", VAR_DRVS .. "/usb/ohci.sys"},
|
||||
{"DRIVERS/EHCI.SYS", VAR_DRVS .. "/usb/ehci.sys"},
|
||||
{"DRIVERS/USBHID.SYS", VAR_DRVS .. "/usb/usbhid/usbhid.sys"},
|
||||
{"DRIVERS/USBOTHER.SYS",VAR_DRVS .. "/usb/usbother/usbother.sys"},
|
||||
{"DRIVERS/USBSTOR.SYS", VAR_DRVS .. "/usb/usbstor.sys"},
|
||||
{"DRIVERS/RDC.SYS", VAR_DRVS .. "/video/rdc.sys"},
|
||||
{"DRIVERS/COMMOUSE.SYS", VAR_DRVS .. "/mouse/commouse.sys"},
|
||||
|
4
drivers/usb/usbother/Tupfile.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
ROOT = "../../.."
|
||||
tup.rule("usbother.asm", "fasm %f %o " .. tup.getconfig("PESTRIP_CMD") .. tup.getconfig("KPACK_CMD"), "%B.sys")
|
||||
tup.rule("usbdrv.asm", "fasm %f %o ", "%B.dat")
|
214
drivers/usb/usbother/usbdrv.asm
Normal file
@@ -0,0 +1,214 @@
|
||||
;*****************************************************************************;
|
||||
; Copyright (C) 2025, Mikhail Frolov aka Doczom . All rights reserved. ;
|
||||
; Distributed under terms of the 3-Clause BSD License. ;
|
||||
;*****************************************************************************;
|
||||
; File of usb drivers
|
||||
; base = 0
|
||||
; offset | Size | Name | Description
|
||||
;=======================|=======|===============|=============================
|
||||
; base + 0 | 4 | ID_drv_table | offset to dev_ven drv array
|
||||
; base + 4 | 4 | Class_table | offset to class drv array
|
||||
;
|
||||
; n = 0 .. count driver with ID table
|
||||
; nt = count driver with ID table
|
||||
; ID_drv_table + 0*(n-1)| 4 | ID_TABLE | offset from base to table VID:PID
|
||||
; ID_drv_table + 4*(n-1)| 4 | DRV_NAME | offset from base to name of driver
|
||||
; ID_drv_table + 8*nt | 8 | __ZERO | terminaror of list
|
||||
|
||||
; k = 0 .. count driver on class code
|
||||
; kt = count driver on class code
|
||||
; Class_table + 0*(k-1) | 1 | LENGTH_CLASS | length of class code 1..3
|
||||
; Class_table + 1*(k-1) | 1 | USB_CLASS | main usb class code (M)
|
||||
; Class_table + 2*(k-1) | 1 | USB_SUBCLASS | USB subclass code or zero(V)
|
||||
; Class_table + 2*(k-1) | 1 | USB_PROTOCOL | USB protocol code or zero(V)
|
||||
; Class_table + 4*(k-1) | 4 | DRV_NAME | offset from base to name of driver
|
||||
; Class_table + 8*kt | 8 | __ZERO | terminaror of list
|
||||
|
||||
; i = 0 .. count VID:PID
|
||||
; it = count VID:PID
|
||||
; ID_TABLE + 0*(i-1) | 2 | VID | Vendor id
|
||||
; ID_TABLE + 2*(i-1) | 2 | PID | Product id
|
||||
; ID_TABLE + 4*it | 4 | __ZERO | terminaror of list
|
||||
|
||||
|
||||
macro INIT_USBDRV_FILE {
|
||||
local ..id_list, ..class_list
|
||||
|
||||
format binary as 'dat'
|
||||
use32
|
||||
org 0
|
||||
dd ..id_list
|
||||
dd ..class_list
|
||||
|
||||
|
||||
macro ID_DRV_TABLE \{
|
||||
dd 0, 0
|
||||
\}
|
||||
|
||||
macro CLASS_TABLE \{
|
||||
dd 0, 0
|
||||
\}
|
||||
macro ID_TABLE \{
|
||||
\}
|
||||
macro DRV_NAME_LIST \{
|
||||
\}
|
||||
postpone \{
|
||||
..id_list: ID_DRV_TABLE
|
||||
..class_list: CLASS_TABLE
|
||||
ID_TABLE
|
||||
DRV_NAME_LIST
|
||||
\}
|
||||
}
|
||||
|
||||
macro ADD_CLASS drv_name, class, subclass, protocol {
|
||||
|
||||
local ..length, ..class_code, ..drv_name
|
||||
|
||||
..length = 3
|
||||
|
||||
match =X, class \{
|
||||
err 'Class is mandatory argument'
|
||||
\}
|
||||
match =X, protocol \{
|
||||
..length = 2
|
||||
\}
|
||||
match =X, subclass \{
|
||||
..length = 1
|
||||
\}
|
||||
|
||||
..class_code = ..length or (class shl 8)
|
||||
|
||||
if ..length = 3
|
||||
..class_code = ..class_code or (protocol shl 24)
|
||||
end if
|
||||
if ..length = 2
|
||||
..class_code = ..class_code or (subclass shl 16)
|
||||
end if
|
||||
|
||||
|
||||
; add in list
|
||||
|
||||
macro DRV_NAME_LIST \{
|
||||
..drv_name: db drv_name, 0
|
||||
DRV_NAME_LIST
|
||||
\}
|
||||
|
||||
macro CLASS_TABLE \{
|
||||
dd ..class_code, ..drv_name
|
||||
CLASS_TABLE
|
||||
\}
|
||||
}
|
||||
|
||||
macro ADD_ID drv_name, [device_id] {
|
||||
common
|
||||
local ..drv_name, ..id_table
|
||||
|
||||
macro ID_TABLE \{
|
||||
ID_TABLE
|
||||
..id_table:
|
||||
\}
|
||||
|
||||
reverse
|
||||
local vid_pid
|
||||
match VID:PID, device_id \{
|
||||
vid_pid = (PID shl 16) + VID
|
||||
\}
|
||||
|
||||
|
||||
macro ID_TABLE \{
|
||||
ID_TABLE
|
||||
dd vid_pid
|
||||
\}
|
||||
|
||||
common
|
||||
macro ID_TABLE \{
|
||||
ID_TABLE
|
||||
dd 0
|
||||
\}
|
||||
macro DRV_NAME_LIST \{
|
||||
..drv_name: db drv_name, 0
|
||||
DRV_NAME_LIST
|
||||
\}
|
||||
macro ID_DRV_TABLE \{
|
||||
dd ..id_table, ..drv_name
|
||||
ID_DRV_TABLE
|
||||
\}
|
||||
}
|
||||
|
||||
; ADD ID driver Linux
|
||||
macro ADD_IDL drv_name, [vendor_id, device_id] {
|
||||
common
|
||||
local ..drv_name, ..id_table
|
||||
|
||||
macro ID_TABLE \{
|
||||
ID_TABLE
|
||||
..id_table:
|
||||
\}
|
||||
|
||||
reverse
|
||||
local vid_pid
|
||||
vid_pid = (device_id shl 16) + vendor_id
|
||||
|
||||
macro ID_TABLE \{
|
||||
ID_TABLE
|
||||
dd vid_pid
|
||||
\}
|
||||
|
||||
common
|
||||
macro ID_TABLE \{
|
||||
ID_TABLE
|
||||
dd 0
|
||||
\}
|
||||
macro DRV_NAME_LIST \{
|
||||
..drv_name: db drv_name, 0
|
||||
DRV_NAME_LIST
|
||||
\}
|
||||
macro ID_DRV_TABLE \{
|
||||
dd ..id_table, ..drv_name
|
||||
ID_DRV_TABLE
|
||||
\}
|
||||
}
|
||||
|
||||
|
||||
INIT_USBDRV_FILE
|
||||
|
||||
;ADD_CLASS 'usbcdc-ctrl' , 0x02, X , X
|
||||
;ADD_CLASS 'usbimage' , 0x06, 1 , 1
|
||||
;ADD_CLASS 'usbcdc-data' , 0x0A, X , X
|
||||
;ADD_CLASS 'ccid' , 0x0B, X , X
|
||||
;ADD_CLASS 'uvd' , 0x0E, X , X
|
||||
;ADD_CLASS 'uvd_2' , 0x0E, 0x02, X
|
||||
;ADD_CLASS 'usb_bluetooth' , 0xE0, 0x01, X
|
||||
;ADD_CLASS 'usb_wifi' , 0xE0, 0x02, X
|
||||
|
||||
|
||||
|
||||
ADD_ID 'usbftdi',\
|
||||
0x0403:0 ; Any FTDI device
|
||||
|
||||
;https://github.com/avrdudes/avrdude/blob/main/src/usbdevs.h#L51
|
||||
;ADD_ID 'usbasp',\
|
||||
; 0x16c0:0x05dc,\ ; VOTI Obdev's free shared PID
|
||||
; 0x03e8:0xc7b4,\ ; ATMEL (unofficial) USBasp
|
||||
; 0x16c0:0x092f ; VOTI NIBObee PID
|
||||
|
||||
;https://github.com/WCHSoftGroup/ch341par_linux/blob/main/driver/ch34x_pis.c
|
||||
;ADD_IDL 'ch341par',\
|
||||
; 0x1a86, 0x5512,\ ; ch341a default
|
||||
; 0x1a86, 0x55db,\ ; CH347T Mode1 SPI+IIC+UART
|
||||
; 0x1a86, 0x55dd,\ ; CH347T Mode3 JTAG+UART
|
||||
; 0x1a86, 0x55de,\ ; CH347F
|
||||
; 0x1a86, 0x55e7 ; CH339W
|
||||
|
||||
;https://github.com/openbsd/src/blob/master/sys/dev/usb/uchcom.c
|
||||
;https://github.com/WCHSoftGroup/ch341ser_linux/blob/main/driver/ch341.c
|
||||
;ADD_IDL 'ch341ser',\
|
||||
; 0x1a86, 0x7523,\ ; ch340 chip
|
||||
; 0x1a86, 0x7522,\ ; ch340k chip
|
||||
; 0x1a86, 0x5523,\ ; ch341 chip
|
||||
; 0x1a86, 0xe523,\ ; ch330 chip
|
||||
; 0x4348, 0x5523 ; ch340 custom chip
|
||||
|
||||
|
||||
|
||||
|
523
drivers/usb/usbother/usbother.asm
Normal file
@@ -0,0 +1,523 @@
|
||||
;*****************************************************************************;
|
||||
; Copyright (C) 2025, Mikhail Frolov aka Doczom . All rights reserved. ;
|
||||
; Distributed under terms of the 3-Clause BSD License. ;
|
||||
; ;
|
||||
; usbother is a driver for loading USB drivers of a certain class and vendor. ;
|
||||
; ;
|
||||
; Version 0.1.1, 24 May 2025 ;
|
||||
; ;
|
||||
;*****************************************************************************;
|
||||
format PE native 0.05
|
||||
entry START
|
||||
; const
|
||||
|
||||
DRV_VERSION = 0x0101 ; 0.1.1
|
||||
|
||||
|
||||
; struct
|
||||
include '../../struct.inc'
|
||||
|
||||
; USB device descriptor
|
||||
struct DEVICE_DESCR
|
||||
bLength db ?
|
||||
bDescriptorType db ?
|
||||
bcdUSB dw ?
|
||||
bDeviceClass db ?
|
||||
bDeviceSubClass db ?
|
||||
bDeviceProtocol db ?
|
||||
bMaxPacketSize0 db ?
|
||||
idVendor dw ?
|
||||
idProduct dw ?
|
||||
bcdDevice dw ?
|
||||
iManufacturer db ?
|
||||
iProduct db ?
|
||||
iSerialNumber db ?
|
||||
bNumConfigurations db ?
|
||||
ends
|
||||
|
||||
struct INTERFACE_DESCR
|
||||
bLength db ?
|
||||
bDescriptorType db ?
|
||||
bInterfaceNumber db ?
|
||||
bAlternateSetting db ?
|
||||
bNumEndpoints db ?
|
||||
bInterfaceClass db ?
|
||||
bInterfaceSubClass db ?
|
||||
bInterfaceProtocol db ?
|
||||
iInterface db ?
|
||||
ends
|
||||
|
||||
|
||||
struct SRV
|
||||
srv_name rb 16 ;ASCIIZ string
|
||||
magic dd ? ;+0x10 ;'SRV '
|
||||
size dd ? ;+0x14 ;size of structure SRV
|
||||
fd dd ? ;+0x18 ;next SRV descriptor
|
||||
bk dd ? ;+0x1C ;prev SRV descriptor
|
||||
base dd ? ;+0x20 ;service base address
|
||||
entry dd ? ;+0x24 ;service START function
|
||||
srv_proc dd ? ;+0x28 ;user mode service handler
|
||||
srv_proc_ex dd ? ;+0x2C ;kernel mode service handler
|
||||
ends
|
||||
|
||||
struct USBSRV
|
||||
srv SRV
|
||||
usb_func dd ?
|
||||
ends
|
||||
|
||||
struct USBFUNC
|
||||
strucsize dd ?
|
||||
add_device dd ?
|
||||
device_disconnect dd ?
|
||||
ends
|
||||
|
||||
USBDRV_TYPE_NOLOCK = 0 ; usb device not controlled (native driver
|
||||
; not found and IOCTL not opened device)
|
||||
USBDRV_TYPE_NATIVE = 1 ; native PE kernel driver for usb
|
||||
USBDRV_TYPE_IOCTL = 2 ; usb device is controlled by IOCTL service
|
||||
; (driver or userspace process/threads)
|
||||
USBDRV_IOCTL_BLOCKED = 4 ; blocked IOCTL interface, device disconnected
|
||||
|
||||
|
||||
|
||||
struct DRV_CONTEXT
|
||||
next dd ?
|
||||
prev dd ?
|
||||
drv_hand dd ?
|
||||
drv_pdata dd ?
|
||||
flags dd ?
|
||||
|
||||
config_descr dd ?
|
||||
interface_descr dd ?
|
||||
ep rd 64 ; 32 IN + 32 OUT endpoints' pipes
|
||||
ends
|
||||
DRV_CONTEXT.ep0 fix (DRV_CONTEXT.ep + 0)
|
||||
|
||||
|
||||
section '.flat' code readable writable executable
|
||||
|
||||
include '../../proc32.inc'
|
||||
include '../../peimport.inc'
|
||||
include '../../macros.inc'
|
||||
|
||||
|
||||
proc START c, state:dword, cmdline:dword
|
||||
|
||||
cmp [state], DRV_ENTRY
|
||||
jne .end
|
||||
; init
|
||||
|
||||
mov ecx, drv_list_lock
|
||||
invoke MutexInit
|
||||
|
||||
mov ecx, interface_list_lock
|
||||
invoke MutexInit
|
||||
|
||||
; load drv_list
|
||||
stdcall load_drv_list, default_list
|
||||
test eax, eax
|
||||
jnz .end
|
||||
|
||||
; reg driver
|
||||
invoke RegUSBDriver, drv_name, service_proc, usb_functions
|
||||
ret
|
||||
.end:
|
||||
xor eax, eax
|
||||
ret
|
||||
endp
|
||||
|
||||
proc load_drv_list stdcall, .path:dword
|
||||
|
||||
push ebx
|
||||
mov ecx, drv_list_lock
|
||||
invoke MutexLock
|
||||
; load file
|
||||
invoke LoadFile, [.path]
|
||||
test eax, eax
|
||||
push eax
|
||||
jnz @f
|
||||
mov dword[esp], -1
|
||||
jmp .exit
|
||||
@@:
|
||||
cmp [drv_list], 0
|
||||
jz @f
|
||||
|
||||
invoke KernelFree, [drv_list]
|
||||
@@:
|
||||
mov eax,[esp]
|
||||
mov [drv_list], eax
|
||||
mov dword[esp], 0
|
||||
.exit:
|
||||
mov ecx, drv_list_lock
|
||||
invoke MutexUnlock
|
||||
pop eax
|
||||
pop ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc service_proc stdcall, .ioctl:dword
|
||||
|
||||
push esi
|
||||
or eax, -1
|
||||
mov esi, [.ioctl]
|
||||
|
||||
mov ecx, [esi + IOCTL.io_code]
|
||||
cmp ecx, .count_ioctl_codes
|
||||
jae .fail
|
||||
|
||||
jmp dword[.table_subfunction + ecx*4]
|
||||
|
||||
.table_subfunction:
|
||||
dd .get_version
|
||||
dd .update_list
|
||||
dd .get_array_dev
|
||||
dd .get_full_dev_data
|
||||
dd .open_dev
|
||||
dd .close_dev
|
||||
dd .control_transfer
|
||||
dd .bulk_transfer
|
||||
dd .interrupt_transfer
|
||||
;dd .control_transfer_async
|
||||
;dd .bulk_transfer_async
|
||||
;dd .interrupt_transfer_async
|
||||
.count_ioctl_codes = ($ - .table_subfunction)/4
|
||||
|
||||
.get_version:
|
||||
mov eax, [esi + IOCTL.output]
|
||||
cmp [esi + IOCTL.out_size], 4
|
||||
jne .fail
|
||||
|
||||
mov dword[eax], DRV_VERSION
|
||||
xor eax, eax
|
||||
jmp .exit
|
||||
|
||||
.update_list:
|
||||
; update list
|
||||
mov ecx, [esi + IOCTL.input]
|
||||
cmp [esi + IOCTL.inp_size], 0
|
||||
jnz @f
|
||||
|
||||
mov ecx, default_list
|
||||
@@:
|
||||
stdcall load_drv_list, ecx
|
||||
|
||||
.exit:
|
||||
pop esi
|
||||
ret
|
||||
|
||||
.get_array_dev:
|
||||
.get_full_dev_data:
|
||||
.open_dev:
|
||||
.close_dev:
|
||||
;
|
||||
.control_transfer:
|
||||
.bulk_transfer:
|
||||
.interrupt_transfer:
|
||||
|
||||
.fail:
|
||||
or eax, -1
|
||||
jmp .exit
|
||||
endp
|
||||
|
||||
|
||||
proc AddDevice stdcall, .config_pipe:dword, \
|
||||
.config_descr:dword,\
|
||||
.interface:dword
|
||||
|
||||
push esi edi
|
||||
mov eax, sizeof.DRV_CONTEXT
|
||||
invoke Kmalloc
|
||||
test eax, eax
|
||||
jz .err_init
|
||||
|
||||
mov esi, eax
|
||||
|
||||
mov ecx, interface_list_lock
|
||||
invoke MutexLock
|
||||
|
||||
mov edx, [usb_interface_list] ; next
|
||||
mov [esi + DRV_CONTEXT.next], edx
|
||||
mov [esi + DRV_CONTEXT.prev], usb_interface_list
|
||||
mov [usb_interface_list], esi
|
||||
mov [edx + DRV_CONTEXT.prev], esi
|
||||
|
||||
mov ecx, interface_list_lock
|
||||
invoke MutexUnlock
|
||||
|
||||
and [esi + DRV_CONTEXT.drv_hand], 0
|
||||
mov [esi + DRV_CONTEXT.flags], USBDRV_TYPE_NOLOCK
|
||||
|
||||
; lock mutex
|
||||
mov ecx, drv_list_lock
|
||||
invoke MutexLock
|
||||
|
||||
; save device context data
|
||||
mov eax, [.config_pipe]
|
||||
mov [esi + DRV_CONTEXT.ep0], eax
|
||||
mov eax, [.config_descr]
|
||||
mov [esi + DRV_CONTEXT.config_descr], eax
|
||||
mov eax, [.interface]
|
||||
mov [esi + DRV_CONTEXT.interface_descr], eax
|
||||
|
||||
; get pointer to list
|
||||
mov edx, [drv_list]
|
||||
test edx, edx
|
||||
jz .err_exit
|
||||
|
||||
mov edi, edx
|
||||
add edi, [edx]
|
||||
|
||||
; get in ecx VID:PID code
|
||||
invoke USBGetParam, [.config_pipe], 0
|
||||
mov ecx, dword[eax + DEVICE_DESCR.idVendor]
|
||||
|
||||
.loop_id_drv:
|
||||
cmp dword[edi], 0
|
||||
jz .end_loop_id_drv
|
||||
|
||||
mov edx, [drv_list]
|
||||
add edx, [edi] ; ID_TABLE
|
||||
.loop_id:
|
||||
cmp dword[edx], 0
|
||||
jz .end_loop_id
|
||||
|
||||
; check id
|
||||
mov eax, ecx
|
||||
test word[edx + 2], 0xffff
|
||||
jne @f
|
||||
; driver for all devices of VID
|
||||
and eax, 0xffff
|
||||
@@:
|
||||
cmp [edx], eax ; check VID:PID
|
||||
je @f
|
||||
|
||||
add edx, 4
|
||||
jmp .loop_id
|
||||
@@: ; found
|
||||
call .load_drv
|
||||
jnz .exit
|
||||
|
||||
add edx, 4
|
||||
jmp .loop_id
|
||||
.end_loop_id:
|
||||
add edi, 8
|
||||
jmp .loop_id_drv
|
||||
|
||||
.end_loop_id_drv:
|
||||
|
||||
|
||||
push esi
|
||||
mov esi, str_1
|
||||
invoke SysMsgBoardStr
|
||||
pop esi
|
||||
|
||||
|
||||
; get in ecx class code
|
||||
mov eax, [.interface]
|
||||
mov ecx, dword[eax + INTERFACE_DESCR.bInterfaceClass] ; 24-31 bits
|
||||
|
||||
mov edi, [drv_list]
|
||||
add edi, [edi + 4]
|
||||
.loop_class:
|
||||
cmp dword[edi], 0
|
||||
jz .end_loop_class
|
||||
|
||||
; check class
|
||||
movzx eax, byte[edi] ; length
|
||||
and eax, 11b ; protect - max length = 3
|
||||
lea eax, [eax*8] ; 1 = 8; 2 = 16; 3 = 24
|
||||
xor edx, edx
|
||||
bts edx, eax
|
||||
dec edx ; bitmask
|
||||
|
||||
mov eax, [edi]
|
||||
shr eax, 8
|
||||
and eax, edx ; good class in list
|
||||
|
||||
and edx, ecx ; good class of device
|
||||
|
||||
cmp eax, edx
|
||||
je @f
|
||||
|
||||
add edi, 8
|
||||
jmp .loop_class
|
||||
@@: ; found
|
||||
call .load_drv
|
||||
jnz .exit
|
||||
|
||||
add edi, 8
|
||||
jmp .loop_class
|
||||
|
||||
; IN: edi - item list of driver
|
||||
; esi - DRV_CONTEXT
|
||||
; OUT: ZF - not found zF - found
|
||||
; function save drv handl in DRV_CONTEXT.drv_hand
|
||||
; and pdata in DRV_CONTEXT.drv_pdata
|
||||
.load_drv:
|
||||
push ecx edx
|
||||
; load driver
|
||||
push esi
|
||||
mov esi, str_2
|
||||
invoke SysMsgBoardStr
|
||||
pop esi
|
||||
|
||||
mov ecx, [drv_list]
|
||||
add ecx, [edi + 4]
|
||||
|
||||
pusha
|
||||
mov esi, ecx
|
||||
invoke SysMsgBoardStr
|
||||
mov esi, str_newline
|
||||
invoke SysMsgBoardStr
|
||||
popa
|
||||
|
||||
invoke GetService, ecx
|
||||
test eax, eax
|
||||
jz @f
|
||||
|
||||
mov [esi + DRV_CONTEXT.drv_hand], eax
|
||||
; get function list
|
||||
mov ecx, [eax + USBSRV.usb_func]
|
||||
|
||||
; call AddDevice of driver
|
||||
stdcall [ecx + USBFUNC.add_device], [.config_pipe], \
|
||||
[.config_descr],\
|
||||
[.interface]
|
||||
mov [esi + DRV_CONTEXT.drv_pdata], eax
|
||||
test eax, eax
|
||||
jnz .load_drv.good
|
||||
|
||||
push esi
|
||||
mov esi, str_4
|
||||
invoke SysMsgBoardStr
|
||||
pop esi
|
||||
|
||||
and [esi + DRV_CONTEXT.drv_hand], 0
|
||||
@@:
|
||||
pushf
|
||||
push esi
|
||||
mov esi, str_5
|
||||
invoke SysMsgBoardStr
|
||||
pop esi
|
||||
popf
|
||||
|
||||
pop edx ecx
|
||||
retn
|
||||
.load_drv.good:
|
||||
pushf
|
||||
push esi
|
||||
mov esi, str_3
|
||||
invoke SysMsgBoardStr
|
||||
pop esi
|
||||
popf
|
||||
|
||||
mov [esi + DRV_CONTEXT.flags], USBDRV_TYPE_NATIVE
|
||||
pop edx ecx
|
||||
retn
|
||||
|
||||
|
||||
.err_exit:
|
||||
mov eax, esi
|
||||
invoke Kfree
|
||||
xor esi, esi
|
||||
.end_loop_class:
|
||||
.exit:
|
||||
; driver not found - Added libusb driver
|
||||
|
||||
; unlock mutex
|
||||
mov ecx, drv_list_lock
|
||||
invoke MutexUnlock
|
||||
|
||||
mov eax, esi
|
||||
pop edi esi
|
||||
ret
|
||||
.err_init:
|
||||
xor eax, eax
|
||||
pop edi esi
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc DeviceDisconnected stdcall, .pdata:dword
|
||||
|
||||
mov eax, [.pdata]
|
||||
|
||||
test [eax + DRV_CONTEXT.flags], USBDRV_TYPE_NATIVE
|
||||
jz .no_native
|
||||
|
||||
cmp [eax + DRV_CONTEXT.drv_hand], 0
|
||||
jz .free
|
||||
|
||||
; call device disconnected
|
||||
mov ecx, [eax + DRV_CONTEXT.drv_hand]
|
||||
|
||||
mov edx, [ecx + USBSRV.usb_func]
|
||||
cmp dword[edx], USBFUNC.device_disconnect
|
||||
jbe .free ; TODO: check
|
||||
|
||||
stdcall [edx + USBFUNC.device_disconnect], [eax + DRV_CONTEXT.drv_pdata]
|
||||
.free:
|
||||
; clear list of DRV_CONTENT
|
||||
mov ecx, interface_list_lock
|
||||
invoke MutexLock
|
||||
|
||||
mov eax, [.pdata]
|
||||
mov edx, [eax + DRV_CONTEXT.prev]
|
||||
mov ecx, [eax + DRV_CONTEXT.next]
|
||||
mov [edx + DRV_CONTEXT.next], ecx
|
||||
mov [ecx + DRV_CONTEXT.prev], edx
|
||||
|
||||
mov ecx, interface_list_lock
|
||||
invoke MutexUnlock
|
||||
|
||||
; free context
|
||||
mov eax, [.pdata]
|
||||
invoke Kfree
|
||||
ret
|
||||
.no_native:
|
||||
test [eax + DRV_CONTEXT.flags], USBDRV_TYPE_IOCTL
|
||||
jz .free
|
||||
|
||||
; set state for block user api and clear struct
|
||||
or [eax + DRV_CONTEXT.flags], USBDRV_IOCTL_BLOCKED
|
||||
xor ecx, ecx
|
||||
;mov [eax + DRV_CONTEXT.drv_hand], ecx
|
||||
;mov [eax + DRV_CONTEXT.drv_pdata], ecx
|
||||
mov [eax + DRV_CONTEXT.config_descr], ecx
|
||||
mov [eax + DRV_CONTEXT.interface_descr], ecx
|
||||
mov [eax + DRV_CONTEXT.ep0], ecx
|
||||
; TODO
|
||||
jmp .free
|
||||
endp
|
||||
|
||||
; data
|
||||
drv_list_lock MUTEX
|
||||
|
||||
drv_list dd ?
|
||||
|
||||
interface_list_lock MUTEX
|
||||
usb_interface_list:
|
||||
dd usb_interface_list
|
||||
dd usb_interface_list
|
||||
|
||||
|
||||
usb_functions:
|
||||
dd .end - usb_functions
|
||||
dd AddDevice
|
||||
dd DeviceDisconnected
|
||||
.end:
|
||||
|
||||
drv_name db 'usbother', 0
|
||||
|
||||
default_list: db '/sys/settings/usbdrv.dat', 0
|
||||
|
||||
str_1: db 'USBOTHER: Driver for this ID not found', 13, 10, 0
|
||||
str_2: db 'USBOTHER: Check found driver: ', 0, 13, 10, 0
|
||||
str_3: db 'USBOTHER: Device driver is good', 13, 10, 0
|
||||
str_4: db 'USBOTHER: Device driver fail prob', 13, 10, 0
|
||||
str_5: db 'USBOTHER: Device driver load error', 13, 10, 0
|
||||
str_newline: db 13,10,0
|
||||
|
||||
data fixups
|
||||
end data
|
@@ -809,7 +809,8 @@ iglobal
|
||||
align 4
|
||||
iso9660_user_functions:
|
||||
dd iso9660_free
|
||||
dd (.end - $ - 4) / 4
|
||||
dd (.end - .first) / 4
|
||||
.first:
|
||||
dd iso9660_Read
|
||||
dd iso9660_ReadFolder
|
||||
dd 0
|
||||
@@ -828,7 +829,7 @@ iso9660_create_partition:
|
||||
; esi -> DISK structure
|
||||
; out:
|
||||
; eax -> iso9660 partition structure, 0 = not iso9660
|
||||
cmp dword [esi + DISK.MediaInfo.SectorSize], 2048 ; cd disks
|
||||
cmp dword [esi + DISK.MediaInfo.SectorSize], CDBlockSize
|
||||
jnz .fail_disk_sector
|
||||
|
||||
push ebx
|
||||
@@ -838,7 +839,7 @@ iso9660_create_partition:
|
||||
add [esp], eax
|
||||
mov dword[esp + 4], 0 ; base encoding - ascii
|
||||
|
||||
add ebx, 2048
|
||||
add ebx, CDBlockSize
|
||||
.new_descr:
|
||||
inc dword[esp]
|
||||
; read 16 sector, check header of descriptor
|
||||
@@ -899,7 +900,7 @@ iso9660_create_partition:
|
||||
; copy data on struct
|
||||
add esp, 4
|
||||
pop dword[eax + ISO9660.type_encoding]
|
||||
mov dword[eax + ISO9660.lba_size], 2048 ;TODO
|
||||
mov dword[eax + ISO9660.lba_size], CDBlockSize
|
||||
pop dword[eax + ISO9660.primary_descr]
|
||||
|
||||
mov ecx, dword[ebx + ISO9660_PRIMARY_DESCRIPTOR.root_dir_record + ISO9660_DIRECTORY_RECORD.lba]
|
||||
@@ -928,12 +929,10 @@ iso9660_create_partition:
|
||||
; IN: eax - ptr PARTITION
|
||||
; OUT: -
|
||||
; SAVE: esi, edi
|
||||
; Function free PARTITION struct and all object this structure
|
||||
; The function frees the PARTITION structure and all its elements from memory
|
||||
iso9660_free:
|
||||
jmp free
|
||||
|
||||
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
; ISO9660 external functions
|
||||
; in:
|
||||
@@ -946,14 +945,14 @@ iso9660_Read:
|
||||
sub esp, 4 ; for ptr on memory page
|
||||
call iso9660_find_file
|
||||
mov esi, eax
|
||||
mov edi, [ebx + 16] ; ptr to programm buffer
|
||||
mov edi, [ebx + f70s0arg.buf] ; ptr to programm buffer
|
||||
|
||||
test byte[esi + ISO9660_DIRECTORY_RECORD.flags], 10b ; check dir
|
||||
jnz iso9660_find_file.not_found
|
||||
|
||||
; check offset (offset <= size)
|
||||
mov edx, [ebx + 4] ; low offset
|
||||
cmp dword[ebx + 8], 0 ; high offset
|
||||
mov edx, [ebx + f70s0arg.offset.lo] ; low offset
|
||||
cmp dword[ebx + f70s0arg.offset.hi], 0 ; high offset
|
||||
jnz iso9660_find_file.bad_offset ; error offset > max size
|
||||
|
||||
cmp edx, [esi + ISO9660_DIRECTORY_RECORD.data_length]
|
||||
@@ -961,39 +960,48 @@ iso9660_Read:
|
||||
|
||||
; good file - copy file data
|
||||
sub esp, 4*4
|
||||
mov dword[esp + 3*4], 0
|
||||
mov [esp + 1*4], edx ; offset to start copy
|
||||
mov dword[esp], 0 ; count copping byte
|
||||
|
||||
virtual at esp
|
||||
.var_count_copied_data dd ?
|
||||
.var_offset_copy dd ?
|
||||
.var_size_copy_data dd ?
|
||||
.var_fs_err dd ?
|
||||
.var_buffer dd ?
|
||||
end virtual
|
||||
|
||||
mov dword[.var_fs_err], 0 ; ENOERR
|
||||
mov [.var_offset_copy], edx ; offset to start copy
|
||||
mov dword[.var_count_copied_data], 0 ; count copping byte
|
||||
|
||||
; check end offset (offset+size_buff <= size)
|
||||
mov ecx, [esi + ISO9660_DIRECTORY_RECORD.data_length]
|
||||
mov eax, [ebx + 12] ;size copy data - buffer size
|
||||
mov eax, [ebx + f70s0arg.count] ;size copy data - buffer size
|
||||
sub ecx, edx
|
||||
mov [esp + 2*4], eax ; set count copy = buffer size
|
||||
mov [.var_size_copy_data], eax ; set count copy = buffer size
|
||||
cmp ecx, eax ; max copy size > buffer size
|
||||
jae @f
|
||||
|
||||
mov [esp + 2*4], ecx
|
||||
mov dword[esp + 3*4], ERROR_END_OF_FILE
|
||||
mov [.var_size_copy_data], ecx
|
||||
mov dword[.var_fs_err], ERROR_END_OF_FILE
|
||||
|
||||
@@:
|
||||
mov esi, [esi + ISO9660_DIRECTORY_RECORD.lba]
|
||||
; [esp + 4*4] = ptr temp buffer
|
||||
; [esp+3*4] = fs err code [esp+2*4] = size copy data
|
||||
; [esp+1*4] = offset copy [esp] = count copying data
|
||||
; [esp+1*4] = offset copy [esp] = count copied data
|
||||
|
||||
.full_size:
|
||||
; check offset mod sector_size = 0
|
||||
test edx, not -2048
|
||||
jz .first_align ; no creat buffer for first align
|
||||
test edx, not -CDBlockSize
|
||||
jz .first_align
|
||||
|
||||
mov ebx, [esp + 4*4]
|
||||
mov ebx, [.var_buffer]
|
||||
|
||||
; read sector
|
||||
push edx
|
||||
|
||||
and edx, -2048
|
||||
shr edx, BSF 2048
|
||||
and edx, -CDBlockSize
|
||||
shr edx, BSF CDBlockSize
|
||||
mov eax, esi ; ISO9660_DIRECTORY_RECORD.lba
|
||||
add eax, edx
|
||||
mov ecx, 1
|
||||
@@ -1010,18 +1018,18 @@ iso9660_Read:
|
||||
|
||||
mov ecx, edx
|
||||
neg edx
|
||||
and edx, not -2048
|
||||
and ecx, not -2048
|
||||
and edx, not -CDBlockSize
|
||||
and ecx, not -CDBlockSize
|
||||
; create new offset
|
||||
add dword[esp + 1*4], not -2048
|
||||
and dword[esp + 1*4], -2048
|
||||
add dword[.var_offset_copy], not -CDBlockSize
|
||||
and dword[.var_offset_copy], -CDBlockSize
|
||||
|
||||
cmp dword[esp + 2*4], edx ; copy data > read in this sector
|
||||
cmp dword[.var_size_copy_data], edx ;copy data > read in this sector
|
||||
jae @f
|
||||
mov edx, [esp + 2*4]
|
||||
mov edx, [.var_size_copy_data]
|
||||
@@:
|
||||
sub dword[esp + 2*4], edx
|
||||
add dword[esp], edx
|
||||
sub dword[.var_size_copy_data], edx
|
||||
add dword[.var_count_copied_data], edx
|
||||
|
||||
;DEBUGF 1, "K : iso c=%x d=%x Hz\n", ecx, edx
|
||||
push esi
|
||||
@@ -1035,22 +1043,22 @@ iso9660_Read:
|
||||
;stdcall kernel_free, ebx
|
||||
.first_align:
|
||||
|
||||
mov ecx, [esp + 2*4]
|
||||
and ecx, -2048
|
||||
mov ecx, [.var_size_copy_data]
|
||||
and ecx, -CDBlockSize
|
||||
|
||||
cmp ecx, 2048
|
||||
cmp ecx, CDBlockSize
|
||||
jb .copy_finish_block
|
||||
|
||||
mov eax, [esp + 1*4]
|
||||
shr eax, BSF 2048
|
||||
mov eax, [.var_offset_copy]
|
||||
shr eax, BSF CDBlockSize
|
||||
; copy main block
|
||||
mov ebx, edi
|
||||
add edi, ecx
|
||||
sub dword[esp + 2*4], ecx
|
||||
add dword[esp + 1*4], ecx
|
||||
add dword[esp], ecx
|
||||
sub dword[.var_size_copy_data], ecx
|
||||
add dword[.var_offset_copy], ecx
|
||||
add dword[.var_count_copied_data], ecx
|
||||
|
||||
shr ecx, BSF 2048
|
||||
shr ecx, BSF CDBlockSize
|
||||
xor edx, edx
|
||||
add eax, esi ; ISO9660_DIRECTORY_RECORD.lba
|
||||
; ebx - buffer
|
||||
@@ -1063,14 +1071,14 @@ iso9660_Read:
|
||||
|
||||
.copy_finish_block:
|
||||
|
||||
cmp dword[esp + 2*4], 0
|
||||
jz .end_align ; creat buffer for end read sector
|
||||
cmp dword[.var_size_copy_data], 0
|
||||
jz .end_align
|
||||
|
||||
mov ebx, [esp + 4*4]
|
||||
mov ebx, [.var_buffer]
|
||||
|
||||
;copy finish block
|
||||
mov eax, [esp + 1*4]
|
||||
shr eax, BSF 2048
|
||||
mov eax, [.var_offset_copy]
|
||||
shr eax, BSF CDBlockSize
|
||||
xor edx, edx
|
||||
|
||||
mov ecx, 1
|
||||
@@ -1084,16 +1092,16 @@ iso9660_Read:
|
||||
jnz .err_disk_1
|
||||
|
||||
mov esi, ebx
|
||||
mov ecx, [esp + 2*4]
|
||||
add dword[esp], ecx
|
||||
mov ecx, [.var_size_copy_data]
|
||||
add dword[.var_count_copied_data], ecx
|
||||
rep movsb
|
||||
|
||||
;stdcall kernel_free, ebx
|
||||
|
||||
.end_align:
|
||||
; set ebx size copy data
|
||||
mov ebx, [esp]
|
||||
mov esi, [esp + 3*4]
|
||||
mov ebx, [.var_count_copied_data]
|
||||
mov esi, [.var_fs_err]
|
||||
add esp, 4*4
|
||||
call kernel_free
|
||||
|
||||
@@ -1124,13 +1132,13 @@ iso9660_ReadFolder:
|
||||
test byte[eax + ISO9660_DIRECTORY_RECORD.flags], 10b ; check dir
|
||||
jz iso9660_find_file.not_found
|
||||
|
||||
mov edi, [ebx + 16] ; buffer
|
||||
push dword[ebx + 16]
|
||||
push dword[ebx + 4] ; first file
|
||||
push dword[ebx + 8] ; encoding
|
||||
mov edi, [ebx + f70s1arg.buf] ; buffer
|
||||
push dword[ebx + f70s1arg.buf]
|
||||
push dword[ebx + f70s1arg.start_idx] ; first file
|
||||
push dword[ebx + f70s1arg.encoding] ; encoding
|
||||
push dword 0
|
||||
push dword 0
|
||||
push dword[ebx + 12] ; count file
|
||||
push dword[ebx + f70s1arg.count] ; count files
|
||||
push dword[eax + ISO9660_DIRECTORY_RECORD.data_length]
|
||||
push dword[eax + ISO9660_DIRECTORY_RECORD.lba]
|
||||
|
||||
@@ -1142,17 +1150,28 @@ iso9660_ReadFolder:
|
||||
; [esp + 24] - first item 0..(2^32 -1)
|
||||
; [esp + 28] - user buffer
|
||||
; edi - user buffer
|
||||
virtual at esp
|
||||
.var_lba dd ?
|
||||
.var_size dd ?
|
||||
.var_max_count dd ?
|
||||
.var_counter dd ?
|
||||
.var_all_count_files dd ?
|
||||
.var_encoding dd ?
|
||||
.var_first_item dd ?
|
||||
.var_user_buffer dd ?
|
||||
.var_buffer dd ?
|
||||
end virtual
|
||||
|
||||
; set header(32 byte) in buffer
|
||||
mov dword[edi], 1
|
||||
add edi, 32 ;set on first item
|
||||
add edi, sizeof.bdfe_hdr ;set on first item
|
||||
|
||||
; loop copy file info and name
|
||||
.read_sector:
|
||||
mov ebx, [esp + 32]
|
||||
mov ebx, [.var_buffer]
|
||||
mov ecx, 1
|
||||
xor edx, edx
|
||||
mov eax, [esp]
|
||||
mov eax, [.var_lba]
|
||||
; ebx - buffer
|
||||
; edx:eax - num sector
|
||||
; ebp - PARTITION
|
||||
@@ -1165,27 +1184,27 @@ iso9660_ReadFolder:
|
||||
jz .next_sector
|
||||
|
||||
; inc counter all files
|
||||
inc dword[esp + 16]
|
||||
inc dword[.var_all_count_files]
|
||||
; check copy
|
||||
mov eax, [esp + 24]
|
||||
cmp [esp + 16], eax
|
||||
mov eax, [.var_first_item]
|
||||
cmp [.var_all_count_files], eax
|
||||
jbe .skip
|
||||
|
||||
mov eax, [esp + 12]
|
||||
cmp [esp + 8], eax
|
||||
mov eax, [.var_counter]
|
||||
cmp [.var_max_count], eax
|
||||
je .skip
|
||||
|
||||
inc dword[esp + 12]
|
||||
inc dword[.var_counter]
|
||||
|
||||
mov eax, ebx
|
||||
mov ecx, edi
|
||||
call iso9660_GetFileInfo.copy_file_info
|
||||
|
||||
; copy encoding
|
||||
movzx eax, byte[esp + 20]
|
||||
movzx eax, byte[.var_encoding]
|
||||
mov [edi + 4], eax
|
||||
|
||||
add edi, 40
|
||||
add edi, bdfe.name
|
||||
;-----------------------------------------------------------------------------
|
||||
; copy name
|
||||
push ebx
|
||||
@@ -1219,9 +1238,9 @@ iso9660_ReadFolder:
|
||||
cmp eax, 2
|
||||
je .ascii2utf16
|
||||
@@:
|
||||
sub ecx, 1 ; CF + ZF
|
||||
jbe @f
|
||||
movsd
|
||||
sub ecx, 1 ; CF
|
||||
jb @f
|
||||
movsb
|
||||
cmp byte[esi], ';'
|
||||
jne @b
|
||||
@@:
|
||||
@@ -1298,31 +1317,31 @@ iso9660_ReadFolder:
|
||||
movzx ecx, byte[ebx]
|
||||
add ebx, ecx
|
||||
|
||||
test ebx, 2048
|
||||
test ebx, CDBlockSize
|
||||
jnz .next_sector
|
||||
|
||||
mov eax, ebx
|
||||
and eax, not -2048
|
||||
cmp eax, [esp + 4]
|
||||
and eax, not -CDBlockSize
|
||||
cmp eax, [.var_size]
|
||||
jb .new_file
|
||||
|
||||
mov eax, [esp + 12]
|
||||
cmp eax, [esp + 8]
|
||||
mov eax, [.var_counter]
|
||||
cmp eax, [.var_max_count]
|
||||
jb .new_file
|
||||
|
||||
jmp .end_loop
|
||||
|
||||
.next_sector:
|
||||
inc dword[esp]
|
||||
sub dword[esp + 4], 2048
|
||||
inc dword[.var_lba]
|
||||
sub dword[.var_size], CDBlockSize
|
||||
ja .read_sector
|
||||
.end_loop:
|
||||
mov ecx, [esp + 28]
|
||||
mov ebx, [esp + 12]
|
||||
mov [ecx + 4], ebx
|
||||
mov esi, [esp + 16]
|
||||
mov [ecx + 8], esi
|
||||
mov esi, [esp + 8] ; max count
|
||||
mov ecx, [.var_user_buffer]
|
||||
mov ebx, [.var_counter]
|
||||
mov [ecx + bdfe_hdr.read_cnt], ebx
|
||||
mov esi, [.var_all_count_files]
|
||||
mov [ecx + bdfe_hdr.total_cnt], esi
|
||||
mov esi, [.var_max_count] ; max count
|
||||
; free buffer
|
||||
add esp, 8*4
|
||||
call kernel_free
|
||||
@@ -1334,11 +1353,11 @@ iso9660_ReadFolder:
|
||||
@@:
|
||||
ret
|
||||
.err_disk:
|
||||
mov ecx, [esp + 28]
|
||||
mov ebx, [esp + 12]
|
||||
mov [ecx + 4], ebx
|
||||
mov esi, [esp + 16]
|
||||
mov [ecx + 8], esi
|
||||
mov ecx, [.var_user_buffer]
|
||||
mov ebx, [.var_counter]
|
||||
mov [ecx + bdfe_hdr.read_cnt], ebx
|
||||
mov esi, [.var_all_count_files]
|
||||
mov [ecx + bdfe_hdr.total_cnt], esi
|
||||
; free buffer
|
||||
add esp, 8*4
|
||||
call kernel_free
|
||||
@@ -1361,13 +1380,13 @@ iso9660_GetFileInfo:
|
||||
sub esp, 4 ; for ptr on memory page
|
||||
call iso9660_find_file
|
||||
|
||||
mov ecx, [ebx + 16] ; buffer
|
||||
mov ecx, [ebx + f70s5arg.buf] ; buffer
|
||||
|
||||
call .copy_file_info
|
||||
|
||||
call kernel_free
|
||||
xor eax, eax
|
||||
mov ebx, 40
|
||||
mov ebx, bdfe.name
|
||||
ret
|
||||
|
||||
; IN: eax -> ISO966_DIRECTORY_RECORD
|
||||
@@ -1375,11 +1394,11 @@ iso9660_GetFileInfo:
|
||||
; destruct: edx
|
||||
.copy_file_info:
|
||||
; copy size
|
||||
mov [ecx + 36], dword 0
|
||||
mov [ecx + bdfe.size.hi], dword 0
|
||||
mov edx, [eax + ISO9660_DIRECTORY_RECORD.data_length]
|
||||
mov [ecx + 32], edx
|
||||
mov [ecx + bdfe.size.lo], edx
|
||||
|
||||
; copy flags(dir of file)
|
||||
; copy flags(dir or file)
|
||||
xor edx, edx
|
||||
or dl, 000001b
|
||||
test byte[eax + ISO9660_DIRECTORY_RECORD.flags], 1b ; check hidden flag
|
||||
@@ -1389,11 +1408,11 @@ iso9660_GetFileInfo:
|
||||
test byte[eax + ISO9660_DIRECTORY_RECORD.flags], 10b ; check dir
|
||||
jz @f
|
||||
or dl, 10000b ; dir flag
|
||||
mov dword[ecx + 32], 0 ; size = zero
|
||||
mov dword[ecx + bdfe.size.lo], 0 ; size = zero
|
||||
@@:
|
||||
mov [ecx], edx
|
||||
mov [ecx], edx ; set bdfe.attr
|
||||
|
||||
; copy date creat file
|
||||
; copying the file creation date
|
||||
movzx edx, byte[eax + ISO9660_DIRECTORY_RECORD.date_time]
|
||||
add edx, 1900 ; year
|
||||
shl edx, 8
|
||||
@@ -1402,26 +1421,26 @@ iso9660_GetFileInfo:
|
||||
shl edx, 8
|
||||
mov dl, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 2] ;day
|
||||
|
||||
mov [ecx + 12], edx
|
||||
mov [ecx + 20], edx
|
||||
mov [ecx + 28], edx
|
||||
mov [ecx + bdfe.cdate], edx
|
||||
mov [ecx + bdfe.adate], edx
|
||||
mov [ecx + bdfe.mdate], edx
|
||||
|
||||
; copy time creat file
|
||||
; copying the file creation time
|
||||
movzx edx, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 3] ;hour
|
||||
shl edx, 8
|
||||
mov dl, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 4] ;minute
|
||||
shl edx, 8
|
||||
mov dl, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 5] ;second
|
||||
|
||||
mov [ecx + 8], edx
|
||||
mov [ecx + 16], edx
|
||||
mov [ecx + 24], edx
|
||||
mov [ecx + bdfe.ctime], edx
|
||||
mov [ecx + bdfe.atime], edx
|
||||
mov [ecx + bdfe.mtime], edx
|
||||
|
||||
ret
|
||||
|
||||
.rootdir:
|
||||
mov edi, [ebx + 16] ; edi = buffer
|
||||
; copy flags (dir)
|
||||
mov edi, [ebx + f70s5arg.buf] ; edi = buffer
|
||||
; copy flags (partition dir)
|
||||
mov byte [edi], 8
|
||||
; copy size drive
|
||||
mov eax, dword[ebp + PARTITION.Length+DQ.lo]
|
||||
@@ -1431,12 +1450,12 @@ iso9660_GetFileInfo:
|
||||
bsf ecx, ecx
|
||||
shld edx, eax, cl
|
||||
shl eax, cl
|
||||
mov [edi + 32], eax ; bdfe.size.lo
|
||||
mov [edi + 36], edx ; bdfe.size.hi
|
||||
mov [edi + bdfe.size.lo], eax
|
||||
mov [edi + bdfe.size.hi], edx
|
||||
|
||||
mov eax, [ebx + 8]
|
||||
mov eax, [ebx + f70s5arg.xflags]
|
||||
; copy encoding
|
||||
mov [edi + 4], eax
|
||||
mov [edi + bdfe.nameenc], eax
|
||||
; check encoding on fs struct
|
||||
test eax, eax ; check f70s5arg.xflags
|
||||
jz .no_name
|
||||
@@ -1464,8 +1483,8 @@ iso9660_GetFileInfo:
|
||||
jnz .err_read_part
|
||||
|
||||
add esi, ISO9660_PRIMARY_DESCRIPTOR.VolumeName
|
||||
mov edx, [edi + 4]
|
||||
add edi, 40 ; offset partition name
|
||||
mov edx, [edi + bdfe.nameenc]
|
||||
add edi, bdfe.name ; offset partition name
|
||||
mov ecx, 32
|
||||
call iso9660_copy_name
|
||||
|
||||
@@ -1473,7 +1492,7 @@ iso9660_GetFileInfo:
|
||||
call kernel_free
|
||||
.no_name:
|
||||
xor eax, eax
|
||||
mov ebx, 40
|
||||
mov ebx, bdfe.name
|
||||
ret
|
||||
.err_read_part:
|
||||
call kernel_free
|
||||
@@ -1492,7 +1511,7 @@ iso9660_GetFileInfo:
|
||||
; [esp + 4] - ptr to memory page for destruct
|
||||
iso9660_find_file:
|
||||
|
||||
stdcall kernel_alloc, 4096 ;
|
||||
stdcall kernel_alloc, PAGE_SIZE ;
|
||||
test eax, eax
|
||||
jz .err_get_memory
|
||||
|
||||
@@ -1507,13 +1526,21 @@ iso9660_find_file:
|
||||
; [esp] - sector num [esp + 4] - size dir
|
||||
; [esp + 8] - ebx [esp + 16] - buffer
|
||||
; get size root dir (not record size)
|
||||
virtual at esp
|
||||
.var_sector_num dd ?
|
||||
.var_size_dir dd ?
|
||||
.var_save_ebx dd ?
|
||||
.var_eip dd ?
|
||||
.var_buffer dd ?
|
||||
end virtual
|
||||
|
||||
.read_sector:
|
||||
; get sector for directory
|
||||
mov edi, [esp + 16]
|
||||
mov ebx, [esp + 16]
|
||||
mov edi, [.var_buffer]
|
||||
mov ebx, [.var_buffer]
|
||||
mov ecx, 1
|
||||
xor edx, edx
|
||||
mov eax, [esp]
|
||||
mov eax, [.var_sector_num]
|
||||
; ebx - buffer
|
||||
; edx:eax - num sector
|
||||
; ebp - PARTITION
|
||||
@@ -1522,7 +1549,7 @@ iso9660_find_file:
|
||||
test eax, eax
|
||||
jnz .err_disk_1
|
||||
|
||||
mov ecx, [esp + 4]
|
||||
mov ecx, [.var_size_dir]
|
||||
.next_record:
|
||||
|
||||
; check size
|
||||
@@ -1536,7 +1563,7 @@ iso9660_find_file:
|
||||
movzx edx, byte[edi + ISO9660_DIRECTORY_RECORD.size]
|
||||
add edi, edx
|
||||
|
||||
test edi, 2048 ;worked for allocate of page
|
||||
test edi, CDBlockSize ;worked for allocate of page
|
||||
jnz .next_sector
|
||||
|
||||
sub ecx, edx
|
||||
@@ -1545,9 +1572,9 @@ iso9660_find_file:
|
||||
jmp .next_record
|
||||
|
||||
.next_sector:
|
||||
sub dword[esp + 4], 2048
|
||||
sub dword[.var_size_dir], CDBlockSize
|
||||
jbe .not_found_2
|
||||
inc dword[esp]
|
||||
inc dword[.var_sector_num]
|
||||
jmp .read_sector
|
||||
|
||||
.found:
|
||||
@@ -1557,12 +1584,12 @@ iso9660_find_file:
|
||||
|
||||
inc esi
|
||||
mov edx, [edi + ISO9660_DIRECTORY_RECORD.lba]
|
||||
mov dword[esp], edx
|
||||
mov dword[.var_sector_num], edx
|
||||
mov edx, [edi + ISO9660_DIRECTORY_RECORD.data_length]
|
||||
mov dword[esp + 4], edx
|
||||
mov dword[.var_size_dir], edx
|
||||
jmp .read_sector
|
||||
.done:
|
||||
mov ebx, [esp + 8]
|
||||
mov ebx, [.var_save_ebx]
|
||||
add esp, 4*3
|
||||
mov eax, edi
|
||||
ret
|
||||
@@ -1591,7 +1618,7 @@ iso9660_find_file:
|
||||
; errors
|
||||
.err_disk_1:
|
||||
; free stack values
|
||||
mov ebx, [esp + 8]
|
||||
mov ebx, [.var_save_ebx]
|
||||
add esp, 4*3
|
||||
.err_disk:
|
||||
add esp, 4
|
||||
@@ -1601,7 +1628,7 @@ iso9660_find_file:
|
||||
ret
|
||||
|
||||
.not_found_2:
|
||||
mov ebx, [esp + 8]
|
||||
mov ebx, [.var_save_ebx]
|
||||
add esp, 4*3
|
||||
.not_found_1:
|
||||
add esp, 4
|
||||
@@ -1621,7 +1648,7 @@ iso9660_find_file:
|
||||
|
||||
|
||||
.err_get_memory:
|
||||
add esp, 8 ; skip addr return and dword for ptr to buffer
|
||||
add esp, 8 ;skip return address and dword for the buffer pointer
|
||||
.no_memory:
|
||||
mov eax, TASKMAN_ERROR_OUT_OF_MEMORY
|
||||
xor ebx, ebx
|
||||
@@ -1776,4 +1803,3 @@ iso9660_copy_name:
|
||||
mov word[edi], 0
|
||||
@@:
|
||||
ret
|
||||
|
||||
|
@@ -521,7 +521,7 @@ bool GetUrl(dword _http_url)
|
||||
http.get(_http_url);
|
||||
return true;
|
||||
} else if (!strncmp(_http_url,"https://",8)) {
|
||||
strcpy(#new_url_full, "http://gate.aspero.pro/?site=");
|
||||
strcpy(#new_url_full, "http://176.223.130.192:82/?site=");
|
||||
strncat(#new_url_full, _http_url, URL_SIZE);
|
||||
http.get(#new_url_full);
|
||||
return true;
|
||||
|
@@ -168,9 +168,9 @@ void StartDownloading()
|
||||
ResetDownloadSpeed();
|
||||
pb.back_color = 0xFFFfff;
|
||||
if (!strncmp(#uEdit,"https:",6)) {
|
||||
//miniprintf(#get_url, "http://gate.aspero.pro/?site=%s", #uEdit);
|
||||
notify("'HTTPS for download temporary is not supported,\ntrying to download the file via HTTP' -W");
|
||||
miniprintf(#uEdit, "http://%s", #uEdit+8);
|
||||
miniprintf(#get_url, "http://176.223.130.192:82/?site=%s", #uEdit);
|
||||
// notify("'HTTPS for download temporary is not supported,\ntrying to download the file via HTTP' -W");
|
||||
// miniprintf(#uEdit, "http://%s", #uEdit+8);
|
||||
}
|
||||
strcpy(#get_url, #uEdit);
|
||||
|
||||
|
@@ -112,7 +112,7 @@ struct _http
|
||||
dword _http::get(dword _url)
|
||||
{
|
||||
cur_url = _url;
|
||||
if (streqrp(cur_url, "http://gate.aspero.pro/?site=")) cur_url += 29;
|
||||
if (streqrp(cur_url, "http://176.223.130.192:82/?site=")) cur_url += 29;
|
||||
http_get stdcall (_url, 0, 0, #accept_language);
|
||||
transfer = EAX;
|
||||
return EAX;
|
||||
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 28 KiB |
@@ -1,200 +0,0 @@
|
||||
|
||||
Visit http://flatassembler.net/ for more information.
|
||||
|
||||
|
||||
version 1.68 (Jun 13, 2009)
|
||||
|
||||
[+] Added SSSE3 (Supplemental SSE3), SSE4.1, SSE4.2 and SSE4a instructions.
|
||||
|
||||
[+] Added the AMD SVM and Intel SMX instructions.
|
||||
|
||||
[+] Added "rdmsrq", "wrmsrq", "sysexitq" and "sysretq" mnemonics for the
|
||||
64-bit variants of respective instructions.
|
||||
|
||||
[+] Added "fstenvw", "fstenvd", "fsavew", "fsaved", "frstorw" and "frstord"
|
||||
mnemonics to allow choosing between 16-bit and 32-bit variants of
|
||||
structures used by the "fstenv", "fsave" and "frstor" instructions.
|
||||
|
||||
[+] Added "plt" operator for the ELF output format.
|
||||
|
||||
[+] Allowed "rva" operator to be used in MS COFF object format, and also
|
||||
added "static" keyword for the "public" directive.
|
||||
|
||||
[+] Added Intel-style aliases for the additional long mode 8-bit registers.
|
||||
|
||||
[-] The PE formatter now automatically detects whether relocatable labels
|
||||
should be used, depending on whether the fixups directory is placed
|
||||
somewhere into executable by programer, or not. This makes possible the
|
||||
more flexible use of the addressing symbols in case of PE executable fixed
|
||||
at some position.
|
||||
|
||||
[-] Added support for outputting the 32-bit address relocations in case of
|
||||
64-bit object formats and PE executable. This makes some specific
|
||||
instructions compilable, but it also forces linker to put such
|
||||
generated code into the low 2 gigabytes of addressing space.
|
||||
|
||||
[+] Added "EFI", "EFIboot" and "EFIruntime" subsystem keywords for PE format.
|
||||
|
||||
[-] Corrected the precedence of operators of macroinstruction line maker.
|
||||
The symbol escaping now has always the higher priority than symbol conversion,
|
||||
and both have higher precedence than concatenation.
|
||||
|
||||
[+] Allowed to check "@b" and "@f" symbols with "defined" operator.
|
||||
|
||||
[+] Allowed "as" operator to specify the output file extension when
|
||||
placed at the end of the "format" directive line.
|
||||
|
||||
[-] Definition of macro with the same name as one of the preprocessor's directives
|
||||
is no longer allowed.
|
||||
|
||||
[+] Allowed single quote character to be put inside the number value,
|
||||
to help improve long numbers readability.
|
||||
|
||||
[+] Added optional symbolic information output, and a set of tools that extract
|
||||
various kinds of information from it.
|
||||
|
||||
[+] Added "err" directive that allows to signalize error from the source.
|
||||
|
||||
|
||||
version 1.66 (May 7, 2006)
|
||||
|
||||
[+] Added "define" directive to preprocessor, which defines symbolic constants,
|
||||
the same kind as "equ" directive, however there's an important difference
|
||||
that "define" doesn't process symbolic constants in the value before
|
||||
assigning it. For example:
|
||||
|
||||
a equ 1
|
||||
a equ a+a
|
||||
|
||||
define b 1
|
||||
define b b+b
|
||||
|
||||
defines the "a" constant with value "1+1", but the "b" is defined with
|
||||
value "b+b". This directive may be useful in some advanced
|
||||
macroinstructions.
|
||||
|
||||
[-] Moved part of the conditional expression processing into parser,
|
||||
for slightly better performance and lesser memory usage by assembler.
|
||||
The logical values defined with "eq", "eqtype" and "in" operators are now
|
||||
evaluated by the parser and if they are enough to determine the condition,
|
||||
the whole block is processed accordingly. Thus this block:
|
||||
|
||||
if eax eq EAX | 0/0
|
||||
nop
|
||||
end if
|
||||
|
||||
is parsed into just "nop" instruction, since parser is able to determine
|
||||
that the condition is true, even though one of the logical values makes no
|
||||
sense - but since this is none of the "eq", "eqtype" and "in" expressions,
|
||||
the parser doesn't investigate.
|
||||
|
||||
[-] Also the assembler is now calculating only as many logical values as it
|
||||
needs to determine the condition. So this block:
|
||||
|
||||
if defined alpha & alpha
|
||||
|
||||
end if
|
||||
|
||||
will not cause error when "alpha" is not defined, as it would with previous
|
||||
versions. This is because after checking that "defined alpha" is false
|
||||
condition it doesn't need to know the second logical value to determine the
|
||||
value of conjunction.
|
||||
|
||||
[+] Added "short" keyword for specifying jump type, the "jmp byte" form is now
|
||||
obsolete and no longer correct - use "jmp short" instead.
|
||||
|
||||
[-] The size operator applied to jump no longer applies to the size of relative
|
||||
displacement - now it applies to the size of target address.
|
||||
|
||||
[-] The "ret" instruction with 0 parameter is now assembled into short form,
|
||||
unless you force using the 16-bit immediate with "word" operator.
|
||||
|
||||
[+] Added missing extended registers for the 32-bit addressing in long mode.
|
||||
|
||||
[+] Added "linkremove" and "linkinfo" section flags for MS COFF output.
|
||||
|
||||
[+] Added support for GOT offsets in ELF object formatter, which can be useful
|
||||
when making position-independent code for shared libraries. For any label
|
||||
you can get its offset relative to GOT by preceding it with "rva" operator
|
||||
(the same keyword as for PE format is used, to avoid adding a new one,
|
||||
while this one has very similar meaning).
|
||||
|
||||
[-] Changed ELF executable to use "segment" directive in place of "section",
|
||||
to make the distinction between the run-time segments and linkable
|
||||
sections. If you had a "section" directive in your ELF executables and they
|
||||
no longer assemble, replace it with "segment".
|
||||
|
||||
[-] The PE formatter now always creates the fixups directory when told to -
|
||||
even when there are no fixups to be put there (in such case it creates the
|
||||
directory with one empty block).
|
||||
|
||||
[-] Some of the internal structures have been extended to provide the
|
||||
possibility of making extensive symbol dumps.
|
||||
|
||||
[-] Corrected "fix" directive to keep the value intact before assigning it to the
|
||||
prioritized constant.
|
||||
|
||||
[+] The ` operator now works with any kind of symbol; when used with quoted
|
||||
string it simply does nothing. Thus the sequence of ` operators applied to
|
||||
one symbol work the same as if there was just one. In similar manner, the
|
||||
sequence of # operators now works as if it was a single one - using such a
|
||||
sequence instead of escaping, which was kept for some backward
|
||||
compatibility, is now deprecated.
|
||||
|
||||
[-] Corrected order of identifying assembler directives ("if db eq db" was
|
||||
incorrectly interpreted as data definition).
|
||||
|
||||
[-] Many other small bugs fixed.
|
||||
|
||||
|
||||
version 1.64 (Aug 8, 2005)
|
||||
|
||||
[+] Output of PE executables for Win64 architecture (with "format PE64"
|
||||
setting).
|
||||
|
||||
[+] Added "while" and "break" directives.
|
||||
|
||||
[+] Added "irp" and "irps" directives.
|
||||
|
||||
[+] The macro arguments can be marked as required with the "*" character.
|
||||
|
||||
[-] Fixed checking for overflow when multiplying 64-bit values - the result
|
||||
must always fit in the range of signed 64 integer now.
|
||||
|
||||
[-] Segment prefixes were generated incorrectly in 16-bit mode when BP was used
|
||||
as a second addressing register - fixed.
|
||||
|
||||
[-] The "local" directive was not creating unique labels in some cases - fixed.
|
||||
|
||||
[-] The "not encodable with long immediate" error in 64-bit mode was sometimes
|
||||
wrongly signaled - fixed.
|
||||
|
||||
[-] Other minor fixes and corrections.
|
||||
|
||||
|
||||
version 1.62 (Jun 14, 2005)
|
||||
|
||||
[+] Escaping of symbols inside macroinstructions with backslash.
|
||||
|
||||
[+] Ability of outputting the COFF object files for Win64 architecture
|
||||
(with "format MS64 COFF" setting).
|
||||
|
||||
[+] New preprocessor directives: "restruc", "rept" and "match"
|
||||
|
||||
[+] VMX instructions support (not documented).
|
||||
|
||||
[+] Extended data directives to allow use of the "dup" operator.
|
||||
|
||||
[+] Extended "struc" features to allow custom definitions of main structure's
|
||||
label.
|
||||
|
||||
[-] When building resources from the the .RES file that contained more
|
||||
than one resource of the same string name, the separate resource
|
||||
directories were created with the same names - fixed.
|
||||
|
||||
[-] Several bugs in the ELF64 object output has been fixed.
|
||||
|
||||
[-] Corrected behavior of "fix" directive to more straightforward.
|
||||
|
||||
[-] Fixed bug in "include" directive, which caused files included from within
|
||||
macros to be processed the wrong way.
|
@@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en_US >lang.inc
|
||||
@fasm fasm.asm fasm
|
||||
@erase lang.inc
|
||||
@pause
|
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru_RU >lang.inc
|
||||
@fasm fasm.asm fasm
|
||||
@erase lang.inc
|
||||
@kpack fasm
|
||||
@pause
|
@@ -1,174 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2009, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
out_of_memory:
|
||||
push _out_of_memory
|
||||
jmp fatal_error
|
||||
stack_overflow:
|
||||
push _stack_overflow
|
||||
jmp fatal_error
|
||||
main_file_not_found:
|
||||
push _main_file_not_found
|
||||
jmp fatal_error
|
||||
unexpected_end_of_file:
|
||||
push _unexpected_end_of_file
|
||||
jmp fatal_error
|
||||
code_cannot_be_generated:
|
||||
push _code_cannot_be_generated
|
||||
jmp fatal_error
|
||||
format_limitations_exceeded:
|
||||
push _format_limitations_exceeded
|
||||
jmp fatal_error
|
||||
invalid_definition:
|
||||
push _invalid_definition
|
||||
jmp fatal_error
|
||||
write_failed:
|
||||
push _write_failed
|
||||
jmp fatal_error
|
||||
|
||||
file_not_found:
|
||||
push _file_not_found
|
||||
jmp assembler_error
|
||||
error_reading_file:
|
||||
push _error_reading_file
|
||||
jmp assembler_error
|
||||
invalid_file_format:
|
||||
push _invalid_file_format
|
||||
jmp assembler_error
|
||||
invalid_macro_arguments:
|
||||
push _invalid_macro_arguments
|
||||
jmp assembler_error
|
||||
incomplete_macro:
|
||||
push _incomplete_macro
|
||||
jmp assembler_error
|
||||
unexpected_characters:
|
||||
push _unexpected_characters
|
||||
jmp assembler_error
|
||||
invalid_argument:
|
||||
push _invalid_argument
|
||||
jmp assembler_error
|
||||
illegal_instruction:
|
||||
push _illegal_instruction
|
||||
jmp assembler_error
|
||||
invalid_operand:
|
||||
push _invalid_operand
|
||||
jmp assembler_error
|
||||
invalid_operand_size:
|
||||
push _invalid_operand_size
|
||||
jmp assembler_error
|
||||
operand_size_not_specified:
|
||||
push _operand_size_not_specified
|
||||
jmp assembler_error
|
||||
operand_sizes_do_not_match:
|
||||
push _operand_sizes_do_not_match
|
||||
jmp assembler_error
|
||||
invalid_address_size:
|
||||
push _invalid_address_size
|
||||
jmp assembler_error
|
||||
address_sizes_do_not_agree:
|
||||
push _address_sizes_do_not_agree
|
||||
jmp assembler_error
|
||||
prefix_conflict:
|
||||
push _prefix_conflict
|
||||
jmp assembler_error
|
||||
long_immediate_not_encodable:
|
||||
push _long_immediate_not_encodable
|
||||
jmp assembler_error
|
||||
relative_jump_out_of_range:
|
||||
push _relative_jump_out_of_range
|
||||
jmp assembler_error
|
||||
invalid_expression:
|
||||
push _invalid_expression
|
||||
jmp assembler_error
|
||||
invalid_address:
|
||||
push _invalid_address
|
||||
jmp assembler_error
|
||||
invalid_value:
|
||||
push _invalid_value
|
||||
jmp assembler_error
|
||||
value_out_of_range:
|
||||
push _value_out_of_range
|
||||
jmp assembler_error
|
||||
undefined_symbol:
|
||||
mov edi,message
|
||||
mov esi,_undefined_symbol
|
||||
call copy_asciiz
|
||||
push message
|
||||
cmp [error_info],0
|
||||
je assembler_error
|
||||
mov byte [edi-1],20h
|
||||
call write_quoted_symbol_name
|
||||
jmp assembler_error
|
||||
copy_asciiz:
|
||||
lods byte [esi]
|
||||
stos byte [edi]
|
||||
test al,al
|
||||
jnz copy_asciiz
|
||||
ret
|
||||
write_quoted_symbol_name:
|
||||
mov al,27h
|
||||
stosb
|
||||
mov esi,[error_info]
|
||||
movzx ecx,byte [esi-1]
|
||||
rep movs byte [edi],[esi]
|
||||
mov ax,27h
|
||||
stosw
|
||||
ret
|
||||
symbol_out_of_scope:
|
||||
mov edi,message
|
||||
mov esi,_symbol_out_of_scope_1
|
||||
call copy_asciiz
|
||||
cmp [error_info],0
|
||||
je finish_symbol_out_of_scope_message
|
||||
mov byte [edi-1],20h
|
||||
call write_quoted_symbol_name
|
||||
finish_symbol_out_of_scope_message:
|
||||
mov byte [edi-1],20h
|
||||
mov esi,_symbol_out_of_scope_2
|
||||
call copy_asciiz
|
||||
push message
|
||||
jmp assembler_error
|
||||
invalid_use_of_symbol:
|
||||
push _invalid_use_of_symbol
|
||||
jmp assembler_error
|
||||
name_too_long:
|
||||
push _name_too_long
|
||||
jmp assembler_error
|
||||
invalid_name:
|
||||
push _invalid_name
|
||||
jmp assembler_error
|
||||
reserved_word_used_as_symbol:
|
||||
push _reserved_word_used_as_symbol
|
||||
jmp assembler_error
|
||||
symbol_already_defined:
|
||||
push _symbol_already_defined
|
||||
jmp assembler_error
|
||||
missing_end_quote:
|
||||
push _missing_end_quote
|
||||
jmp assembler_error
|
||||
missing_end_directive:
|
||||
push _missing_end_directive
|
||||
jmp assembler_error
|
||||
unexpected_instruction:
|
||||
push _unexpected_instruction
|
||||
jmp assembler_error
|
||||
extra_characters_on_line:
|
||||
push _extra_characters_on_line
|
||||
jmp assembler_error
|
||||
section_not_aligned_enough:
|
||||
push _section_not_aligned_enough
|
||||
jmp assembler_error
|
||||
setting_already_specified:
|
||||
push _setting_already_specified
|
||||
jmp assembler_error
|
||||
data_already_defined:
|
||||
push _data_already_defined
|
||||
jmp assembler_error
|
||||
too_many_repeats:
|
||||
push _too_many_repeats
|
||||
jmp assembler_error
|
||||
invoked_error:
|
||||
push _invoked_error
|
||||
jmp assembler_error
|
@@ -1,608 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; flat assembler source ;;
|
||||
;; Copyright (c) 1999-2006, Tomasz Grysztar ;;
|
||||
;; All rights reserved. ;;
|
||||
;; ;;
|
||||
;; Menuet port by VT ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
NORMAL_MODE = 8
|
||||
CONSOLE_MODE = 32
|
||||
|
||||
MAGIC1 = 6*(text.line_size-1)+14
|
||||
MAX_PATH = 100
|
||||
|
||||
APP_MEMORY = 0x00800000
|
||||
|
||||
;; Menuet header
|
||||
|
||||
appname equ "flat assembler "
|
||||
|
||||
use32
|
||||
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; program start
|
||||
dd program_end ; program image size
|
||||
dd stacktop ; required amount of memory
|
||||
dd stacktop ; stack
|
||||
dd params,0x0 ; parameters,icon
|
||||
|
||||
include 'lang.inc'
|
||||
include '..\..\..\macros.inc'
|
||||
purge add,sub ; macros.inc does incorrect substitution
|
||||
include 'fasm.inc'
|
||||
|
||||
center fix true
|
||||
|
||||
START: ; Start of execution
|
||||
mov edi, fileinfos
|
||||
mov ecx, (fileinfos_end-fileinfos)/4
|
||||
or eax, -1
|
||||
rep stosd
|
||||
push 68
|
||||
pop eax
|
||||
push 11
|
||||
pop ebx
|
||||
mcall
|
||||
|
||||
cmp [params],0
|
||||
jz red
|
||||
|
||||
mov ecx,10
|
||||
mov eax,' '
|
||||
mov edi,infile
|
||||
push ecx
|
||||
cld
|
||||
rep stosd
|
||||
mov ecx,[esp]
|
||||
mov edi,outfile
|
||||
rep stosd
|
||||
pop ecx
|
||||
mov edi,path
|
||||
rep stosd
|
||||
|
||||
mov esi,params
|
||||
; DEBUGF "params: %s\n",esi
|
||||
mov edi,infile
|
||||
call mov_param_str
|
||||
; mov edi,infile
|
||||
; DEBUGF " input: %s\n",edi
|
||||
inc esi
|
||||
mov edi,outfile
|
||||
call mov_param_str
|
||||
; mov edi,outfile
|
||||
; DEBUGF "output: %s\n",edi
|
||||
inc esi
|
||||
mov edi,path
|
||||
call mov_param_str
|
||||
; mov edi,path
|
||||
; DEBUGF " path: %s\n",edi
|
||||
|
||||
cmp [esi], dword ',run'
|
||||
jne @f
|
||||
mov [_run_outfile],1
|
||||
@@:
|
||||
|
||||
mov [_mode],CONSOLE_MODE
|
||||
jmp start
|
||||
|
||||
|
||||
red: ; Redraw
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
push 10 ; Wait here for event
|
||||
pop eax
|
||||
mcall
|
||||
dec eax
|
||||
je red ; Redraw request
|
||||
dec eax
|
||||
jne button ; Button in buffer
|
||||
|
||||
key: ; Key
|
||||
mov al,2 ; Read it and ignore
|
||||
mcall
|
||||
jmp still
|
||||
|
||||
button: ; Button in Window
|
||||
|
||||
mov al,17
|
||||
mcall
|
||||
|
||||
cmp ah,1
|
||||
jne noclose
|
||||
or eax,-1
|
||||
mcall
|
||||
|
||||
noclose:
|
||||
cmp ah,2 ; Start compiling
|
||||
je start
|
||||
cmp ah,3 ; Start compiled file
|
||||
jnz norunout
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_start
|
||||
; xor ecx,ecx
|
||||
jmp still
|
||||
norunout:
|
||||
cmp ah,4
|
||||
jnz norundebug
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_debug
|
||||
jmp still
|
||||
|
||||
norundebug:
|
||||
mov ecx,5
|
||||
mov [ya],ecx
|
||||
|
||||
cmp ah,11 ; Infile
|
||||
je f1
|
||||
cmp ah,12 ; Outfile
|
||||
je f2
|
||||
cmp ah,13 ; Path
|
||||
je f3
|
||||
cmp ah,14
|
||||
je f4
|
||||
|
||||
jmp still
|
||||
|
||||
f4:
|
||||
xor [bGenerateDebugInfo], 1
|
||||
mcall 8,,,0x8000000E
|
||||
call draw_checkbox
|
||||
jmp still
|
||||
|
||||
draw_window:
|
||||
|
||||
pusha
|
||||
|
||||
mcall 12,1 ; Start of draw
|
||||
|
||||
get_sys_colors 1,0
|
||||
|
||||
xor eax,eax
|
||||
mov ebx,100*65536+280
|
||||
mov ecx,90*65536+260
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
mov edi,title ; Draw Window Label Text
|
||||
mcall
|
||||
|
||||
mcall 9,PROCESSINFO,-1
|
||||
|
||||
mpack ecx,1,1
|
||||
mov ebx,[pinfo.box.width]
|
||||
sub ebx,10
|
||||
|
||||
push ecx
|
||||
madd ecx, 14*3+16+2, 14*3+16+2
|
||||
mcall 38,,,[sc.work_graph]
|
||||
pop ecx
|
||||
|
||||
sub ebx,MAGIC1+3
|
||||
mcall
|
||||
madd ecx, 14, 14
|
||||
mcall
|
||||
madd ecx, 14, 14
|
||||
mcall
|
||||
madd ecx, 14, 14
|
||||
mcall
|
||||
push ebx
|
||||
mpack ebx,MAGIC1,MAGIC1
|
||||
sub ecx, 14*3
|
||||
mcall
|
||||
mov ebx,[esp-2]
|
||||
pop bx
|
||||
mcall
|
||||
add esp,2
|
||||
|
||||
mpack ebx,0,MAGIC1-1
|
||||
mpack ecx,1+1, 14-2
|
||||
mcall 8,,,0x4000000B ; Button: Enter Infile
|
||||
madd ecx, 14,0
|
||||
mcall ,,,0x4000000C ; Button: Enter Outfile
|
||||
madd ecx, 14,0
|
||||
mcall ,,,0x4000000D ; Button: Enter Path
|
||||
|
||||
mpack ebx,[pinfo.box.width],MAGIC1
|
||||
msub ebx,MAGIC1+10+1,0
|
||||
mpack ecx,0, (14*3+16)/3-1
|
||||
madd ecx,1,0
|
||||
mcall ,,,0x00000002,[sc.work_button]
|
||||
madd ecx, (14*3+16)/3+1,0
|
||||
mcall ,,,0x00000003
|
||||
madd ecx, (14*3+16)/3+1,0
|
||||
mcall ,,,4
|
||||
|
||||
mpack ebx,6,0 ; Draw Window Text
|
||||
add ebx,1+ 14/2-3
|
||||
mov ecx,[sc.work_text]
|
||||
mov edx,text
|
||||
mov esi,text.line_size
|
||||
mov eax,4
|
||||
newline:
|
||||
mcall
|
||||
add ebx, 14
|
||||
add edx,text.line_size
|
||||
cmp byte[edx],'x'
|
||||
jne newline
|
||||
|
||||
mov ebx,[pinfo.box.width]
|
||||
sub ebx,MAGIC1+10+1-9
|
||||
shl ebx,16
|
||||
add ebx,1+( (14*3+16)/3-1)/2-3
|
||||
mcall ,,[sc.work_button_text],s_compile,7
|
||||
add ebx,(14*3+16)/3+1
|
||||
mcall ,,,s_run
|
||||
add ebx,(14*3+16)/3+1
|
||||
mcall ,,,s_debug
|
||||
|
||||
mpack ebx,MAGIC1+6,0
|
||||
add ebx,1+ 14/2-3+ 14*0
|
||||
mov esi,[pinfo.box.width]
|
||||
sub esi,MAGIC1*2+5*2+6+3
|
||||
mov eax,esi
|
||||
mov cl,6
|
||||
div cl
|
||||
cmp al,MAX_PATH
|
||||
jbe @f
|
||||
mov al,MAX_PATH
|
||||
@@: movzx esi,al
|
||||
mcall 4,,[sc.work_text],infile
|
||||
add ebx,14
|
||||
mcall ,,,outfile
|
||||
add ebx,14
|
||||
mcall ,,,path
|
||||
|
||||
call draw_checkbox
|
||||
|
||||
call draw_messages
|
||||
|
||||
mcall 12,2 ; End of Draw
|
||||
|
||||
popa
|
||||
ret
|
||||
|
||||
bottom_right dd ?
|
||||
|
||||
draw_checkbox:
|
||||
mcall 8,<5,10>,<14*3+5,10>,14,[sc.work_button]
|
||||
cmp [bGenerateDebugInfo], 0
|
||||
jz @f
|
||||
mov edx, [sc.work_button_text]
|
||||
mcall 38,<7,13>,<14*3+7,14*3+13>
|
||||
mcall 38,,<14*3+13,14*3+7>
|
||||
@@:
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x80000000
|
||||
mcall 4,<20,14*3+7>,,s_dbgdescr
|
||||
ret
|
||||
|
||||
draw_messages:
|
||||
mov eax,13 ; clear work area
|
||||
mpack ebx,7-2,[pinfo.box.width]
|
||||
sub ebx,5*2+7*2-1-2*2
|
||||
mpack ecx,0,[pinfo.box.height]
|
||||
madd ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25)
|
||||
mov word[bottom_right+2],bx
|
||||
mov word[bottom_right],cx
|
||||
msub [bottom_right],7,11
|
||||
add [bottom_right],7 shl 16 + 53
|
||||
mov edx,[sc.work]
|
||||
mcall
|
||||
_cy = 0
|
||||
_sy = 2
|
||||
_cx = 4
|
||||
_sx = 6
|
||||
push ebx ecx
|
||||
mpack ebx,4,5
|
||||
add bx,[esp+_cx]
|
||||
mov ecx,[esp+_sy-2]
|
||||
mov cx,[esp+_sy]
|
||||
msub ecx,1,1
|
||||
mcall 38,,,[sc.work_graph]
|
||||
mov si,[esp+_cy]
|
||||
add cx,si
|
||||
shl esi,16
|
||||
add ecx,esi
|
||||
madd ecx,1,1
|
||||
mcall
|
||||
mpack ebx,4,4
|
||||
mov esi,[esp+_sy-2]
|
||||
mov si,cx
|
||||
mov ecx,esi
|
||||
mcall
|
||||
mov si,[esp+_cx]
|
||||
add bx,si
|
||||
shl esi,16
|
||||
add ebx,esi
|
||||
madd ebx,1,1
|
||||
mcall
|
||||
pop ecx ebx
|
||||
ret
|
||||
|
||||
; read string
|
||||
|
||||
f1: mov [addr],infile
|
||||
add [ya], 14*0
|
||||
jmp rk
|
||||
f2: mov [addr],outfile
|
||||
add [ya], 14*1
|
||||
jmp rk
|
||||
f3: mov [addr],path
|
||||
add [ya], 14*2
|
||||
rk:
|
||||
|
||||
mov edi,[addr]
|
||||
mov al,0
|
||||
mov ecx,MAX_PATH
|
||||
add edi,ecx
|
||||
dec edi
|
||||
std
|
||||
repe scasb
|
||||
sub ecx,MAX_PATH
|
||||
neg ecx
|
||||
mov al,$1C ; ''
|
||||
add edi,2
|
||||
push edi
|
||||
cld
|
||||
rep stosb
|
||||
call print_text
|
||||
pop edi
|
||||
f11:mcall 10
|
||||
cmp eax,2
|
||||
jne read_done
|
||||
mcall; 2
|
||||
shr eax,8
|
||||
cmp al,13
|
||||
je read_done
|
||||
cmp al,8
|
||||
jne nobs
|
||||
cmp edi,[addr]
|
||||
je f11
|
||||
sub edi,1
|
||||
mov byte[edi],$1C ; '_'
|
||||
call print_text
|
||||
jmp f11
|
||||
nobs:
|
||||
movzx ebx,al
|
||||
sub ebx,$20
|
||||
jle f11
|
||||
sub al,[sub_table+ebx]
|
||||
keyok:
|
||||
mov ecx,[addr]
|
||||
add ecx,MAX_PATH
|
||||
cmp edi,ecx
|
||||
jae f11
|
||||
mov [edi],al
|
||||
|
||||
call print_text
|
||||
inc edi
|
||||
jmp f11
|
||||
|
||||
read_done:
|
||||
|
||||
mov ecx,[addr]
|
||||
add ecx,MAX_PATH
|
||||
sub ecx,edi
|
||||
mov al,0;' '
|
||||
cld
|
||||
rep stosb
|
||||
call print_text
|
||||
|
||||
jmp still
|
||||
|
||||
print_text:
|
||||
|
||||
mpack ebx,MAGIC1+6,[pinfo.box.width]
|
||||
sub ebx,MAGIC1*2+19
|
||||
movzx esi,bx
|
||||
mov ecx,[ya-2]
|
||||
mov cx,8
|
||||
mcall 13,,,[sc.work]
|
||||
|
||||
mpack ebx,MAGIC1+6,[ya]
|
||||
mov eax,esi
|
||||
mov cl,6
|
||||
div cl
|
||||
cmp al,MAX_PATH
|
||||
jbe @f
|
||||
mov al,MAX_PATH
|
||||
@@: movzx esi,al
|
||||
mcall 4,,[sc.work_text],[addr]
|
||||
|
||||
ret
|
||||
|
||||
|
||||
; DATA
|
||||
|
||||
text:
|
||||
db ' INFILE:'
|
||||
.line_size = $-text
|
||||
db 'OUTFILE:'
|
||||
db ' PATH:'
|
||||
db 'x'
|
||||
|
||||
s_compile db 'COMPILE'
|
||||
s_run db ' RUN '
|
||||
s_debug db ' DEBUG '
|
||||
|
||||
s_dbgdescr db 'Generate debug information',0
|
||||
|
||||
infile db 'example.asm'
|
||||
times MAX_PATH+$-infile db 0
|
||||
outfile db 'example'
|
||||
times MAX_PATH+$-outfile db 0
|
||||
path db '/rd/1/'
|
||||
times MAX_PATH+$-path db 0
|
||||
|
||||
lf db 13,10,0
|
||||
|
||||
addr dd 0x0
|
||||
ya dd 0x0
|
||||
zero db 0x0
|
||||
|
||||
mov_param_str:
|
||||
@@:
|
||||
mov al,[esi]
|
||||
cmp al,','
|
||||
je @f
|
||||
cmp al,0
|
||||
je @f
|
||||
mov [edi],al
|
||||
inc esi
|
||||
inc edi
|
||||
jmp @b
|
||||
@@:
|
||||
mov al,0
|
||||
stosb
|
||||
ret
|
||||
|
||||
start:
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
call draw_messages
|
||||
mov [textxy],7 shl 16 + 70
|
||||
@@:
|
||||
mov esi,_logo
|
||||
call display_string
|
||||
|
||||
;
|
||||
; Fasm native code
|
||||
;
|
||||
|
||||
mov [input_file],infile
|
||||
mov [output_file],outfile
|
||||
|
||||
call init_memory
|
||||
|
||||
call make_timestamp
|
||||
mov [start_time],eax
|
||||
|
||||
call preprocessor
|
||||
call parser
|
||||
call assembler
|
||||
cmp [bGenerateDebugInfo], 0
|
||||
jz @f
|
||||
call symbol_dump
|
||||
@@:
|
||||
call formatter
|
||||
|
||||
call display_user_messages
|
||||
movzx eax,[current_pass]
|
||||
inc eax
|
||||
call display_number
|
||||
mov esi,_passes_suffix
|
||||
call display_string
|
||||
call make_timestamp
|
||||
sub eax,[start_time]
|
||||
xor edx,edx
|
||||
mov ebx,100
|
||||
div ebx
|
||||
or eax,eax
|
||||
jz display_bytes_count
|
||||
xor edx,edx
|
||||
mov ebx,10
|
||||
div ebx
|
||||
push edx
|
||||
call display_number
|
||||
mov dl,'.'
|
||||
call display_character
|
||||
pop eax
|
||||
call display_number
|
||||
mov esi,_seconds_suffix
|
||||
call display_string
|
||||
display_bytes_count:
|
||||
mov eax,[written_size]
|
||||
call display_number
|
||||
mov esi,_bytes_suffix
|
||||
call display_string
|
||||
xor al,al
|
||||
|
||||
cmp [_run_outfile],0
|
||||
je @f
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mov eax,70
|
||||
mov ebx,file_info_start
|
||||
xor ecx,ecx
|
||||
mcall
|
||||
@@:
|
||||
jmp exit_program
|
||||
|
||||
|
||||
include 'system.inc'
|
||||
include 'version.inc'
|
||||
include 'errors.inc'
|
||||
include 'expressi.inc'
|
||||
include 'preproce.inc'
|
||||
include 'parser.inc'
|
||||
include 'assemble.inc'
|
||||
include 'formats.inc'
|
||||
include 'x86_64.inc'
|
||||
include 'tables.inc'
|
||||
include 'symbdump.inc'
|
||||
include 'messages.inc'
|
||||
|
||||
title db appname,VERSION_STRING,0
|
||||
|
||||
_logo db 'flat assembler version ',VERSION_STRING,13,10,0
|
||||
|
||||
_passes_suffix db ' passes, ',0
|
||||
_seconds_suffix db ' seconds, ',0
|
||||
_bytes_suffix db ' bytes.',13,10,0
|
||||
|
||||
_include db 'INCLUDE',0
|
||||
|
||||
_counter db 4,'0000'
|
||||
|
||||
_mode dd NORMAL_MODE
|
||||
_run_outfile dd 0
|
||||
bGenerateDebugInfo db 0
|
||||
|
||||
sub_table:
|
||||
times $41 db $00
|
||||
times $1A db $20
|
||||
times $25 db $00
|
||||
times $10 db $20
|
||||
times $30 db $00
|
||||
times $10 db $50
|
||||
times $04 db $00,$01
|
||||
times $08 db $00
|
||||
|
||||
;include_debug_strings
|
||||
|
||||
params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
|
||||
program_end:
|
||||
rb 1000h
|
||||
|
||||
align 4
|
||||
|
||||
include 'variable.inc'
|
||||
|
||||
program_base dd ?
|
||||
buffer_address dd ?
|
||||
memory_setting dd ?
|
||||
start_time dd ?
|
||||
memblock dd ?
|
||||
|
||||
predefinitions rb 1000h
|
||||
|
||||
dbgfilename rb MAX_PATH+4
|
||||
|
||||
sc system_colors
|
||||
max_handles = 8
|
||||
fileinfos rb (4+20+MAX_PATH)*max_handles
|
||||
fileinfos_end:
|
||||
pinfo process_information
|
||||
|
||||
align 1000h
|
||||
rb 1000h
|
||||
stacktop:
|
@@ -1,53 +0,0 @@
|
||||
center fix false
|
||||
SYSTEMCOLORS fix sc
|
||||
PROCESSINFO fix pinfo
|
||||
|
||||
macro get_sys_colors wnd_skin,font_1 {
|
||||
mcall 48,3,SYSTEMCOLORS,sizeof.system_colors
|
||||
if wnd_skin <> 0
|
||||
or [SYSTEMCOLORS+system_colors.work],0x03000000
|
||||
end if
|
||||
if font_1 <> 0
|
||||
or [SYSTEMCOLORS+system_colors.grab_text],0x10000000
|
||||
end if
|
||||
}
|
||||
|
||||
macro draw_caption _edx,_esi {
|
||||
mov edx,_edx
|
||||
mov esi,_esi
|
||||
call __draw_caption
|
||||
}
|
||||
|
||||
macro mmov reg,a1,a2 {
|
||||
mov reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro madd reg,a1,a2 {
|
||||
add reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro msub reg,a1,a2 {
|
||||
sub reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro jmpe reg,def,[val,lab] {
|
||||
forward
|
||||
cmp reg,val
|
||||
je lab
|
||||
common
|
||||
if ~def eq
|
||||
jmp def
|
||||
end if
|
||||
}
|
||||
|
||||
macro func name {
|
||||
if used name
|
||||
name:
|
||||
}
|
||||
|
||||
macro endf {
|
||||
end if
|
||||
}
|
||||
|
||||
@^ fix macro comment {
|
||||
^@ fix }
|
@@ -1,51 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2009, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
_out_of_memory db 'out of memory',0
|
||||
_stack_overflow db 'out of stack space',0
|
||||
_main_file_not_found db 'source file not found',0
|
||||
_unexpected_end_of_file db 'unexpected end of file',0
|
||||
_code_cannot_be_generated db 'code cannot be generated',0
|
||||
_format_limitations_exceeded db 'format limitations exceeded',0
|
||||
_invalid_definition db 'invalid definition provided',0
|
||||
_write_failed db 'write failed',0
|
||||
_file_not_found db 'file not found',0
|
||||
_error_reading_file db 'error reading file',0
|
||||
_invalid_file_format db 'invalid file format',0
|
||||
_invalid_macro_arguments db 'invalid macro arguments',0
|
||||
_incomplete_macro db 'incomplete macro',0
|
||||
_unexpected_characters db 'unexpected characters',0
|
||||
_invalid_argument db 'invalid argument',0
|
||||
_illegal_instruction db 'illegal instruction',0
|
||||
_invalid_operand db 'invalid operand',0
|
||||
_invalid_operand_size db 'invalid size of operand',0
|
||||
_operand_size_not_specified db 'operand size not specified',0
|
||||
_operand_sizes_do_not_match db 'operand sizes do not match',0
|
||||
_invalid_address_size db 'invalid size of address value',0
|
||||
_address_sizes_do_not_agree db 'address sizes do not agree',0
|
||||
_prefix_conflict db 'disallowed combination of registers',0
|
||||
_long_immediate_not_encodable db 'not encodable with long immediate',0
|
||||
_relative_jump_out_of_range db 'relative jump out of range',0
|
||||
_invalid_expression db 'invalid expression',0
|
||||
_invalid_address db 'invalid address',0
|
||||
_invalid_value db 'invalid value',0
|
||||
_value_out_of_range db 'value out of range',0
|
||||
_undefined_symbol db 'undefined symbol',0
|
||||
_symbol_out_of_scope_1 db 'symbol',0
|
||||
_symbol_out_of_scope_2 db 'out of scope',0
|
||||
_invalid_use_of_symbol db 'invalid use of symbol',0
|
||||
_name_too_long db 'name too long',0
|
||||
_invalid_name db 'invalid name',0
|
||||
_reserved_word_used_as_symbol db 'reserved word used as symbol',0
|
||||
_symbol_already_defined db 'symbol already defined',0
|
||||
_missing_end_quote db 'missing end quote',0
|
||||
_missing_end_directive db 'missing end directive',0
|
||||
_unexpected_instruction db 'unexpected instruction',0
|
||||
_extra_characters_on_line db 'extra characters on line',0
|
||||
_section_not_aligned_enough db 'section is not aligned enough',0
|
||||
_setting_already_specified db 'setting already specified',0
|
||||
_data_already_defined db 'data already defined',0
|
||||
_too_many_repeats db 'too many repeats',0
|
||||
_invoked_error db 'error directive invoked in source file',0
|
@@ -1,180 +0,0 @@
|
||||
|
||||
; Macroinstructions for defining data structures
|
||||
|
||||
macro struct name
|
||||
{ fields@struct equ name
|
||||
match child parent, name \{ fields@struct equ child,fields@\#parent \}
|
||||
sub@struct equ
|
||||
struc db [val] \{ \common fields@struct equ fields@struct,.,db,<val> \}
|
||||
struc dw [val] \{ \common fields@struct equ fields@struct,.,dw,<val> \}
|
||||
struc du [val] \{ \common fields@struct equ fields@struct,.,du,<val> \}
|
||||
struc dd [val] \{ \common fields@struct equ fields@struct,.,dd,<val> \}
|
||||
struc dp [val] \{ \common fields@struct equ fields@struct,.,dp,<val> \}
|
||||
struc dq [val] \{ \common fields@struct equ fields@struct,.,dq,<val> \}
|
||||
struc dt [val] \{ \common fields@struct equ fields@struct,.,dt,<val> \}
|
||||
struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \}
|
||||
struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \}
|
||||
struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \}
|
||||
struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \}
|
||||
struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \}
|
||||
struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \}
|
||||
macro db [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,db,<val> \}
|
||||
macro dw [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dw,<val> \}
|
||||
macro du [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,du,<val> \}
|
||||
macro dd [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dd,<val> \}
|
||||
macro dp [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dp,<val> \}
|
||||
macro dq [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dq,<val> \}
|
||||
macro dt [val] \{ \common \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dt,<val> \}
|
||||
macro rb count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,db,count dup (?) \}
|
||||
macro rw count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dw,count dup (?) \}
|
||||
macro rd count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dd,count dup (?) \}
|
||||
macro rp count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dp,count dup (?) \}
|
||||
macro rq count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dq,count dup (?) \}
|
||||
macro rt count \{ \local anonymous
|
||||
fields@struct equ fields@struct,anonymous,dt,count dup (?) \}
|
||||
macro union \{ fields@struct equ fields@struct,,union,<
|
||||
sub@struct equ union \}
|
||||
macro struct \{ fields@struct equ fields@struct,,substruct,<
|
||||
sub@struct equ substruct \}
|
||||
virtual at 0 }
|
||||
|
||||
macro ends
|
||||
{ match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt
|
||||
restruc rb,rw,rd,rp,rq,rt
|
||||
purge db,dw,du,dd,dp,dq,dt
|
||||
purge rb,rw,rd,rp,rq,rt
|
||||
purge union,struct
|
||||
match name=,fields,fields@struct \\{ fields@struct equ
|
||||
make@struct name,fields
|
||||
fields@\\#name equ fields \\}
|
||||
end virtual \}
|
||||
match any, sub@struct \{ fields@struct equ fields@struct> \}
|
||||
restore sub@struct }
|
||||
|
||||
macro make@struct name,[field,type,def]
|
||||
{ common
|
||||
if $
|
||||
display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah
|
||||
err
|
||||
end if
|
||||
local define
|
||||
define equ name
|
||||
forward
|
||||
local sub
|
||||
match , field \{ make@substruct type,name,sub def
|
||||
define equ define,.,sub, \}
|
||||
match any, field \{ define equ define,.#field,type,<def> \}
|
||||
common
|
||||
match fields, define \{ define@struct fields \} }
|
||||
|
||||
macro define@struct name,[field,type,def]
|
||||
{ common
|
||||
local list
|
||||
list equ
|
||||
forward
|
||||
if ~ field eq .
|
||||
name#field type def
|
||||
sizeof.#name#field = $ - name#field
|
||||
else
|
||||
rb sizeof.#type
|
||||
end if
|
||||
local value
|
||||
match any, list \{ list equ list, \}
|
||||
list equ list <value>
|
||||
common
|
||||
sizeof.#name = $
|
||||
restruc name
|
||||
match values, list \{
|
||||
struc name value \\{
|
||||
match any, fields@struct \\\{ fields@struct equ fields@struct,.,name,<values> \\\}
|
||||
match , fields@struct \\\{ label .
|
||||
forward
|
||||
match , value \\\\{ field type def \\\\}
|
||||
match any, value \\\\{ field type value
|
||||
if ~ field eq .
|
||||
rb sizeof.#name#field - ($-field)
|
||||
end if \\\\}
|
||||
common \\\} \\} \} }
|
||||
|
||||
macro enable@substruct
|
||||
{ macro make@substruct substruct,parent,name,[field,type,def]
|
||||
\{ \common
|
||||
\local define
|
||||
define equ parent,name
|
||||
\forward
|
||||
\local sub
|
||||
match , field \\{ match any, type \\\{ enable@substruct
|
||||
make@substruct type,name,sub def
|
||||
purge make@substruct
|
||||
define equ define,.,sub, \\\} \\}
|
||||
match any, field \\{ define equ define,.\#field,type,<def> \\}
|
||||
\common
|
||||
match fields, define \\{ define@\#substruct fields \\} \} }
|
||||
|
||||
enable@substruct
|
||||
|
||||
macro define@union parent,name,[field,type,def]
|
||||
{ common
|
||||
virtual at 0
|
||||
forward
|
||||
if ~ field eq .
|
||||
virtual at 0
|
||||
parent#field type def
|
||||
sizeof.#parent#field = $ - parent#field
|
||||
end virtual
|
||||
if sizeof.#parent#field > $
|
||||
rb sizeof.#parent#field - $
|
||||
end if
|
||||
else if sizeof.#type > $
|
||||
rb sizeof.#type - $
|
||||
end if
|
||||
common
|
||||
sizeof.#name = $
|
||||
end virtual
|
||||
struc name [value] \{ \common
|
||||
label .\#name
|
||||
last@union equ
|
||||
forward
|
||||
match any, last@union \\{ virtual at .\#name
|
||||
field type def
|
||||
end virtual \\}
|
||||
match , last@union \\{ match , value \\\{ field type def \\\}
|
||||
match any, value \\\{ field type value \\\} \\}
|
||||
last@union equ field
|
||||
common rb sizeof.#name - ($ - .\#name) \} }
|
||||
|
||||
macro define@substruct parent,name,[field,type,def]
|
||||
{ common
|
||||
virtual at 0
|
||||
forward
|
||||
if ~ field eq .
|
||||
parent#field type def
|
||||
sizeof.#parent#field = $ - parent#field
|
||||
else
|
||||
rb sizeof.#type
|
||||
end if
|
||||
local value
|
||||
common
|
||||
sizeof.#name = $
|
||||
end virtual
|
||||
struc name value \{
|
||||
label .\#name
|
||||
forward
|
||||
match , value \\{ field type def \\}
|
||||
match any, value \\{ field type value
|
||||
if ~ field eq .
|
||||
rb sizeof.#parent#field - ($-field)
|
||||
end if \\}
|
||||
common \} }
|
@@ -1,110 +0,0 @@
|
||||
symbol_dump:
|
||||
|
||||
push edi
|
||||
mov edx,[memory_end]
|
||||
symb_dump:
|
||||
cmp edx,[labels_list]
|
||||
jbe symbols_dumped
|
||||
sub edx,LABEL_STRUCTURE_SIZE
|
||||
cmp dword [edx+24],0
|
||||
je symb_dump ; do not dump anonymous symbols
|
||||
test byte [edx+8],1
|
||||
jz symb_dump ; do not dump symbols that didn't get defined
|
||||
mov ax,[current_pass]
|
||||
cmp ax,[edx+16]
|
||||
jne symb_dump
|
||||
test byte [edx+8],4 or 2
|
||||
jnz symb_dump ; do not dump assembly-time variables
|
||||
; do not dump variables defined with '='
|
||||
cmp word [edx+12], 0
|
||||
jnz symb_dump ; do not dump register-based variables
|
||||
|
||||
mov al, '0'
|
||||
stosb
|
||||
mov al, 'x'
|
||||
stosb
|
||||
mov eax, [edx+4]
|
||||
mov ecx, 8
|
||||
@@:
|
||||
rol eax, 4
|
||||
test al, 0xF
|
||||
loopz @b
|
||||
jz .nohigh
|
||||
inc ecx
|
||||
@@:
|
||||
push eax
|
||||
and al, 0xF
|
||||
cmp al, 10
|
||||
sbb al, 69h
|
||||
das
|
||||
stosb
|
||||
pop eax
|
||||
rol eax, 4
|
||||
loop @b
|
||||
mov eax, [edx]
|
||||
mov ecx, 8
|
||||
jmp .low
|
||||
.nohigh:
|
||||
mov eax, [edx]
|
||||
mov ecx, 8
|
||||
@@:
|
||||
rol eax, 4
|
||||
test al, 0xF
|
||||
loopz @b
|
||||
inc ecx
|
||||
.low:
|
||||
push eax
|
||||
and al, 0xF
|
||||
cmp al, 10
|
||||
sbb al, 69h
|
||||
das
|
||||
stosb
|
||||
pop eax
|
||||
rol eax, 4
|
||||
loop .low
|
||||
|
||||
mov al, ' '
|
||||
stosb
|
||||
|
||||
mov esi,[edx+24]
|
||||
movzx ecx,byte [esi-1]
|
||||
rep movsb
|
||||
|
||||
mov ax,0A0Dh
|
||||
stosw
|
||||
|
||||
jmp symb_dump
|
||||
|
||||
symbols_dumped:
|
||||
mov edx,dbgfilename
|
||||
push esi edi
|
||||
mov esi, outfile
|
||||
mov edi, edx
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al, al
|
||||
jnz @b
|
||||
lea ecx, [edi-1]
|
||||
@@:
|
||||
dec edi
|
||||
cmp edi, edx
|
||||
jb @f
|
||||
cmp byte [edi], '/'
|
||||
jz @f
|
||||
cmp byte [edi], '.'
|
||||
jnz @b
|
||||
mov ecx, edi
|
||||
@@:
|
||||
mov dword [ecx], '.dbg'
|
||||
mov byte [ecx+4], 0
|
||||
pop edi esi
|
||||
call create
|
||||
mov edx,[esp]
|
||||
mov ecx,edi
|
||||
sub ecx,edx
|
||||
call write
|
||||
call close
|
||||
pop edi
|
||||
|
||||
ret
|
@@ -1,573 +0,0 @@
|
||||
; flat assembler
|
||||
; Copyright (c) 1999-2007, Tomasz Grysztar
|
||||
; All rights reserved.
|
||||
|
||||
struc FILEIO
|
||||
{ .cmd dd ?
|
||||
.offset dd ?
|
||||
dd ?
|
||||
.count dd ?
|
||||
.buff dd ?
|
||||
db ?
|
||||
.name dd ?
|
||||
};
|
||||
|
||||
struc FILEINFO
|
||||
{ .attr dd ?
|
||||
.flags dd ?
|
||||
.cr_time dd ?
|
||||
.cr_date dd ?
|
||||
.acc_time dd ?
|
||||
.acc_date dd ?
|
||||
.mod_time dd ?
|
||||
.mod_date dd ?
|
||||
.size dd ?
|
||||
}
|
||||
|
||||
|
||||
|
||||
;file_info_open: dd 0,0,0xffffff,0x20000,0xf0000
|
||||
fullpath_open: ; db '/RD/1/EXAMPLE.ASM'
|
||||
times MAX_PATH db 0
|
||||
|
||||
|
||||
;file_info_write: dd 1,0,0,0,0xf0000
|
||||
fullpath_write:; db '/RD/1/EXAMPLE'
|
||||
times MAX_PATH db 0
|
||||
|
||||
file_info_start:
|
||||
dd 7
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
fullpath_start: ; db '/RD/1/EXAMPLE'
|
||||
times MAX_PATH db 0
|
||||
|
||||
file_info_debug:
|
||||
dd 7
|
||||
dd 0
|
||||
dd fullpath_start
|
||||
dd 0, 0
|
||||
db '/SYS/DEVELOP/MTDBG',0
|
||||
|
||||
_ramdisk db '/RD/1/'
|
||||
filepos dd 0x0
|
||||
|
||||
|
||||
init_memory:
|
||||
|
||||
mov ecx, 16*1024*1024
|
||||
|
||||
allocate_memory:
|
||||
mov [memory_setting],ecx
|
||||
mcall 68, 12
|
||||
or eax,eax
|
||||
jz out_of_memory
|
||||
mov [additional_memory],eax
|
||||
add eax,[memory_setting]
|
||||
mov [memory_end],eax
|
||||
mov eax,[memory_setting]
|
||||
shr eax,2
|
||||
add eax,[additional_memory]
|
||||
mov [additional_memory_end],eax
|
||||
mov [memory_start],eax
|
||||
ret
|
||||
|
||||
exit_program:
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
mcall 68, 13, [memblock]
|
||||
jmp still
|
||||
@@:
|
||||
or eax,-1
|
||||
mcall
|
||||
|
||||
make_timestamp:
|
||||
push ebx
|
||||
mcall 26,9
|
||||
imul eax,10
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
get_environment_variable:
|
||||
mov ecx,[memory_end]
|
||||
sub ecx,edi
|
||||
cmp ecx,7
|
||||
jb out_of_memory
|
||||
cmp dword[esi],'INCL'
|
||||
jne .finish
|
||||
mov esi,_ramdisk
|
||||
mov ecx,6
|
||||
cld
|
||||
rep movsb
|
||||
.finish:
|
||||
; stc
|
||||
ret
|
||||
|
||||
alloc_handle:
|
||||
call make_fullpaths
|
||||
mov ebx, fileinfos+4
|
||||
@@:
|
||||
cmp dword [ebx], -1
|
||||
jz .found
|
||||
add ebx, 4+20+MAX_PATH
|
||||
cmp ebx, fileinfos_end
|
||||
jb @b
|
||||
stc
|
||||
ret
|
||||
.found:
|
||||
and dword [ebx+4], 0
|
||||
and dword [ebx+8], 0
|
||||
push esi edi ecx
|
||||
mov esi, fullpath_open
|
||||
lea edi, [ebx+20]
|
||||
mov ecx, MAX_PATH
|
||||
rep movsb
|
||||
pop ecx edi esi
|
||||
ret ; CF=0
|
||||
|
||||
create:
|
||||
call alloc_handle
|
||||
jc .ret
|
||||
and dword [ebx-4], 0
|
||||
mov dword [ebx], 2
|
||||
.ret:
|
||||
ret
|
||||
|
||||
|
||||
open:
|
||||
; call make_fullpaths
|
||||
|
||||
;; mov eax,fullpath_open
|
||||
;; DEBUGF '"%s"\n',eax
|
||||
|
||||
; mov dword[file_info_open+8],-1
|
||||
; mcall 58,file_info_open
|
||||
; or eax,eax ; found
|
||||
; jz @f
|
||||
; cmp eax,6
|
||||
; jne file_error
|
||||
;@@: mov [filesize],ebx
|
||||
; clc
|
||||
; ret
|
||||
;file_error:
|
||||
; stc
|
||||
; ret
|
||||
|
||||
call alloc_handle
|
||||
jc .ret
|
||||
mov dword [ebx], 5
|
||||
and dword [ebx+12], 0
|
||||
mov dword [ebx+16], fileinfo
|
||||
mov eax, 70
|
||||
push ebx
|
||||
mcall
|
||||
pop ebx
|
||||
test eax, eax
|
||||
jnz .fail
|
||||
mov eax, [fileinfo.size]
|
||||
mov [ebx-4], eax
|
||||
and dword [ebx], 0
|
||||
.ret:
|
||||
ret
|
||||
.fail:
|
||||
or dword [ebx], -1 ; close handle
|
||||
stc
|
||||
ret
|
||||
|
||||
read:
|
||||
; pusha
|
||||
; mov edi,edx
|
||||
; mov esi,[filepos]
|
||||
; add esi,0x20000
|
||||
; cld
|
||||
; rep movsb
|
||||
; popa
|
||||
;; ret
|
||||
|
||||
mov [ebx+12], ecx
|
||||
mov [ebx+16], edx
|
||||
push ebx
|
||||
mov eax, 70
|
||||
mcall
|
||||
xchg eax, [esp]
|
||||
add [eax+4], ebx
|
||||
adc [eax+8], dword 0
|
||||
mov ebx, eax
|
||||
pop eax
|
||||
test eax, eax
|
||||
jz .ok
|
||||
cmp eax, 6
|
||||
jz .ok
|
||||
stc
|
||||
.ok:
|
||||
ret
|
||||
|
||||
close:
|
||||
or dword [ebx], -1
|
||||
ret
|
||||
|
||||
|
||||
; ebx file handle
|
||||
; ecx count of bytes to write
|
||||
; edx pointer to buffer
|
||||
write:
|
||||
; pusha
|
||||
; mov [file_info_write+8],ecx
|
||||
; mov [file_info_write+12],edx
|
||||
; mov [filesize],edx
|
||||
; mov eax,58
|
||||
; mov ebx,file_info_write
|
||||
; mcall
|
||||
; popa
|
||||
; ret
|
||||
|
||||
mov [ebx+12], ecx
|
||||
mov [ebx+16], edx
|
||||
push ebx
|
||||
mov eax, 70
|
||||
mcall
|
||||
xchg eax, [esp]
|
||||
add [eax+4], ebx
|
||||
adc [eax+8], dword 0
|
||||
mov ebx, eax
|
||||
pop eax
|
||||
mov byte [ebx], 3
|
||||
cmp eax, 1
|
||||
cmc
|
||||
ret
|
||||
|
||||
make_fullpaths:
|
||||
pusha
|
||||
push edx
|
||||
|
||||
mov esi,path ; open
|
||||
; DEBUGF " '%s'",esi
|
||||
mov edi,fullpath_open
|
||||
cld
|
||||
newc1:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc1
|
||||
mov esi,[esp]
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_open
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
mov esi,path ; write
|
||||
mov edi,fullpath_write
|
||||
cld
|
||||
newc2:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc2
|
||||
mov esi,[esp]
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_write
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
mov esi,path ; start
|
||||
mov edi,fullpath_start
|
||||
cld
|
||||
newc3:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc3
|
||||
; mov esi,[esp]
|
||||
pop esi
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_start
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
; add esp,4
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
|
||||
lseek:
|
||||
cmp al,0
|
||||
jnz @f
|
||||
and dword [ebx+4], 0
|
||||
and dword [ebx+8], 0
|
||||
@@: cmp al,2
|
||||
jnz @f
|
||||
mov eax, [ebx-4]
|
||||
mov [ebx+4], eax
|
||||
and dword [ebx+8], 0
|
||||
@@: add dword [ebx+4], edx
|
||||
adc dword [ebx+8], 0
|
||||
ret
|
||||
|
||||
display_character:
|
||||
pusha
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
cmp dl,13
|
||||
jz dc2
|
||||
cmp dl,0xa
|
||||
jnz dc1
|
||||
and [textxy],0x0000FFFF
|
||||
add [textxy], 7 shl 16 +53 and 0xFFFF0000 + 10
|
||||
dc2:
|
||||
popa
|
||||
ret
|
||||
dc1:
|
||||
mov eax,[textxy]
|
||||
cmp ax,word[bottom_right]
|
||||
ja dc2
|
||||
shr eax,16
|
||||
cmp ax,word[bottom_right+2]
|
||||
ja dc2
|
||||
mov [dc],dl
|
||||
mcall 4,[textxy],[sc.work_text],dc,1
|
||||
add [textxy],0x00060000
|
||||
popa
|
||||
ret
|
||||
@@:
|
||||
mov eax,63
|
||||
mov ebx,1
|
||||
mov cl,dl
|
||||
mcall
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
display_string:
|
||||
pusha
|
||||
@@:
|
||||
cmp byte[esi],0
|
||||
je @f
|
||||
mov dl,[esi]
|
||||
call display_character
|
||||
add esi,1
|
||||
jmp @b
|
||||
@@:
|
||||
popa
|
||||
ret
|
||||
|
||||
display_number:
|
||||
push ebx
|
||||
mov ecx,1000000000
|
||||
xor edx,edx
|
||||
xor bl,bl
|
||||
display_loop:
|
||||
div ecx
|
||||
push edx
|
||||
cmp ecx,1
|
||||
je display_digit
|
||||
or bl,bl
|
||||
jnz display_digit
|
||||
or al,al
|
||||
jz digit_ok
|
||||
not bl
|
||||
display_digit:
|
||||
mov dl,al
|
||||
add dl,30h
|
||||
push ebx ecx
|
||||
call display_character
|
||||
pop ecx ebx
|
||||
digit_ok:
|
||||
mov eax,ecx
|
||||
xor edx,edx
|
||||
mov ecx,10
|
||||
div ecx
|
||||
mov ecx,eax
|
||||
pop eax
|
||||
or ecx,ecx
|
||||
jnz display_loop
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
display_user_messages:
|
||||
; push [skinh]
|
||||
; pop [textxy]
|
||||
; add [textxy], 7 shl 16 +53
|
||||
mov [displayed_count],0
|
||||
call show_display_buffer
|
||||
cmp [displayed_count],1
|
||||
jb line_break_ok
|
||||
je make_line_break
|
||||
mov ax,word[last_displayed]
|
||||
cmp ax,0A0Dh
|
||||
je line_break_ok
|
||||
cmp ax,0D0Ah
|
||||
je line_break_ok
|
||||
make_line_break:
|
||||
mov esi,lf
|
||||
call display_string
|
||||
line_break_ok:
|
||||
ret
|
||||
|
||||
display_block:
|
||||
pusha
|
||||
@@: mov dl,[esi]
|
||||
call display_character
|
||||
inc esi
|
||||
loop @b
|
||||
popa
|
||||
ret
|
||||
|
||||
fatal_error:
|
||||
mov esi,error_prefix
|
||||
call display_string
|
||||
pop esi
|
||||
call display_string
|
||||
mov esi,error_suffix
|
||||
call display_string
|
||||
mov esi,lf
|
||||
call display_string
|
||||
mov al,0FFh
|
||||
jmp exit_program
|
||||
|
||||
assembler_error:
|
||||
call display_user_messages
|
||||
push dword 0
|
||||
mov ebx,[current_line]
|
||||
get_error_lines:
|
||||
push ebx
|
||||
test byte [ebx+7],80h
|
||||
jz display_error_line
|
||||
mov edx,ebx
|
||||
find_definition_origin:
|
||||
mov edx,[edx+12]
|
||||
test byte [edx+7],80h
|
||||
jnz find_definition_origin
|
||||
push edx
|
||||
mov ebx,[ebx+8]
|
||||
jmp get_error_lines
|
||||
display_error_line:
|
||||
mov esi,[ebx]
|
||||
call display_string
|
||||
mov esi,line_number_start
|
||||
call display_string
|
||||
mov eax,[ebx+4]
|
||||
and eax,7FFFFFFFh
|
||||
call display_number
|
||||
mov dl,']'
|
||||
call display_character
|
||||
pop esi
|
||||
cmp ebx,esi
|
||||
je line_number_ok
|
||||
mov dl,20h
|
||||
call display_character
|
||||
push esi
|
||||
mov esi,[esi]
|
||||
movzx ecx,byte [esi]
|
||||
inc esi
|
||||
call display_block
|
||||
mov esi,line_number_start
|
||||
call display_string
|
||||
pop esi
|
||||
mov eax,[esi+4]
|
||||
and eax,7FFFFFFFh
|
||||
call display_number
|
||||
mov dl,']'
|
||||
call display_character
|
||||
line_number_ok:
|
||||
mov esi,line_data_start
|
||||
call display_string
|
||||
mov esi,ebx
|
||||
mov edx,[esi]
|
||||
call open
|
||||
mov al,2
|
||||
xor edx,edx
|
||||
call lseek
|
||||
mov edx,[esi+8]
|
||||
sub eax,edx
|
||||
push eax
|
||||
xor al,al
|
||||
call lseek
|
||||
mov ecx,[esp]
|
||||
mov edx,[additional_memory]
|
||||
lea eax,[edx+ecx]
|
||||
cmp eax,[additional_memory_end]
|
||||
ja out_of_memory
|
||||
call read
|
||||
call close
|
||||
pop ecx
|
||||
mov esi,[additional_memory]
|
||||
get_line_data:
|
||||
mov al,[esi]
|
||||
cmp al,0Ah
|
||||
je display_line_data
|
||||
cmp al,0Dh
|
||||
je display_line_data
|
||||
cmp al,1Ah
|
||||
je display_line_data
|
||||
or al,al
|
||||
jz display_line_data
|
||||
inc esi
|
||||
loop get_line_data
|
||||
display_line_data:
|
||||
mov ecx,esi
|
||||
mov esi,[additional_memory]
|
||||
sub ecx,esi
|
||||
call display_block
|
||||
mov esi,cr_lf
|
||||
call display_string
|
||||
pop ebx
|
||||
or ebx,ebx
|
||||
jnz display_error_line
|
||||
mov esi,error_prefix
|
||||
call display_string
|
||||
pop esi
|
||||
call display_string
|
||||
mov esi,error_suffix
|
||||
call display_string
|
||||
jmp exit_program
|
||||
|
||||
align 4
|
||||
fileinfo FILEINFO
|
||||
|
||||
character db ?,0
|
||||
bytes_count dd ?
|
||||
|
||||
textxy dd 0x000500A0
|
||||
dc db 0x0
|
||||
filesize dd 0x0
|
||||
|
||||
displayed_count dd ?
|
||||
last_displayed rb 2
|
||||
|
||||
error_prefix db 'error: ',0
|
||||
error_suffix db '.',0
|
||||
line_data_start db ':'
|
||||
cr_lf db 0Dh,0Ah,0
|
||||
line_number_start db ' [',0
|
||||
|
||||
macro dm string { db string,0 }
|
@@ -1,130 +0,0 @@
|
||||
|
||||
; flat assembler core variables
|
||||
; Copyright (c) 1999-2009, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
; Variables which have to be set up by interface:
|
||||
|
||||
memory_start dd ?
|
||||
memory_end dd ?
|
||||
|
||||
additional_memory dd ?
|
||||
additional_memory_end dd ?
|
||||
|
||||
stack_limit dd ?
|
||||
|
||||
input_file dd ?
|
||||
output_file dd ?
|
||||
symbols_file dd ?
|
||||
|
||||
passes_limit dw ?
|
||||
|
||||
; Internal core variables:
|
||||
|
||||
current_pass dw ?
|
||||
|
||||
include_paths dd ?
|
||||
free_additional_memory dd ?
|
||||
source_start dd ?
|
||||
code_start dd ?
|
||||
code_size dd ?
|
||||
real_code_size dd ?
|
||||
written_size dd ?
|
||||
headers_size dd ?
|
||||
|
||||
current_line dd ?
|
||||
macro_line dd ?
|
||||
macro_block dd ?
|
||||
macro_block_line dd ?
|
||||
macro_block_line_number dd ?
|
||||
macro_symbols dd ?
|
||||
struc_name dd ?
|
||||
struc_label dd ?
|
||||
instant_macro_start dd ?
|
||||
parameters_end dd ?
|
||||
locals_counter rb 8
|
||||
current_locals_prefix dd ?
|
||||
anonymous_reverse dd ?
|
||||
anonymous_forward dd ?
|
||||
labels_list dd ?
|
||||
label_hash dd ?
|
||||
label_leaf dd ?
|
||||
hash_tree dd ?
|
||||
org_origin dq ?
|
||||
org_registers dd ?
|
||||
org_symbol dd ?
|
||||
org_start dd ?
|
||||
undefined_data_start dd ?
|
||||
undefined_data_end dd ?
|
||||
counter dd ?
|
||||
counter_limit dd ?
|
||||
error_info dd ?
|
||||
error_line dd ?
|
||||
error dd ?
|
||||
display_buffer dd ?
|
||||
structures_buffer dd ?
|
||||
number_start dd ?
|
||||
current_offset dd ?
|
||||
value dq ?
|
||||
fp_value rd 8
|
||||
adjustment dq ?
|
||||
symbol_identifier dd ?
|
||||
address_symbol dd ?
|
||||
address_high dd ?
|
||||
format_flags dd ?
|
||||
resolver_flags dd ?
|
||||
symbols_stream dd ?
|
||||
number_of_relocations dd ?
|
||||
number_of_sections dd ?
|
||||
stub_size dd ?
|
||||
stub_file dd ?
|
||||
current_section dd ?
|
||||
machine dw ?
|
||||
subsystem dw ?
|
||||
subsystem_version dd ?
|
||||
image_base dd ?
|
||||
image_base_high dd ?
|
||||
resource_data dd ?
|
||||
resource_size dd ?
|
||||
parenthesis_stack dd ?
|
||||
blocks_stack dd ?
|
||||
parsed_lines dd ?
|
||||
logical_value_parentheses dd ?
|
||||
file_extension dd ?
|
||||
|
||||
labels_type db ?
|
||||
code_type db ?
|
||||
virtual_data db ?
|
||||
|
||||
operand_size db ?
|
||||
size_override db ?
|
||||
operand_prefix db ?
|
||||
rex_prefix db ?
|
||||
opcode_prefix db ?
|
||||
base_code db ?
|
||||
extended_code db ?
|
||||
supplemental_code db ?
|
||||
postbyte_register db ?
|
||||
|
||||
immediate_size db ?
|
||||
mmx_size db ?
|
||||
jump_type db ?
|
||||
push_size db ?
|
||||
value_size db ?
|
||||
address_size db ?
|
||||
size_declared db ?
|
||||
value_undefined db ?
|
||||
value_type db ?
|
||||
compare_type db ?
|
||||
logical_value_wrapping db ?
|
||||
next_pass_needed db ?
|
||||
macro_status db ?
|
||||
segment_register db ?
|
||||
prefixed_instruction db ?
|
||||
fp_sign db ?
|
||||
fp_format db ?
|
||||
output_format db ?
|
||||
|
||||
characters rb 100h
|
||||
converted rb 100h
|
||||
message rb 200h
|
@@ -1,39 +0,0 @@
|
||||
|
||||
; flat assembler version 1.68
|
||||
; Copyright (c) 1999-2009, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
;
|
||||
; This programs is free for commercial and non-commercial use as long as
|
||||
; the following conditions are adhered to.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are
|
||||
; met:
|
||||
;
|
||||
; 1. Redistributions of source code must retain the above copyright notice,
|
||||
; this list of conditions and the following disclaimer.
|
||||
; 2. Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;
|
||||
; The licence and distribution terms for any publically available
|
||||
; version or derivative of this code cannot be changed. i.e. this code
|
||||
; cannot simply be copied and put under another distribution licence
|
||||
; (including the GNU Public Licence).
|
||||
|
||||
VERSION_STRING equ "1.68"
|
||||
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 68
|
@@ -1,7 +0,0 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../.." or tup.getconfig("HELPERDIR")
|
||||
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||
add_include(tup.getvariantdir())
|
||||
|
||||
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
|
||||
tup.rule({"fasm.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "fasm")
|
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en_US >lang.inc
|
||||
@fasm -m 16384 fasm.asm fasm
|
||||
@erase lang.inc
|
||||
@kpack fasm
|
||||
@pause
|
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru_RU >lang.inc
|
||||
@fasm -m 16384 fasm.asm fasm
|
||||
@erase lang.inc
|
||||
@kpack fasm
|
||||
@pause
|
@@ -1,194 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
out_of_memory:
|
||||
push _out_of_memory
|
||||
jmp fatal_error
|
||||
stack_overflow:
|
||||
push _stack_overflow
|
||||
jmp fatal_error
|
||||
main_file_not_found:
|
||||
push _main_file_not_found
|
||||
jmp fatal_error
|
||||
write_failed:
|
||||
push _write_failed
|
||||
jmp fatal_error
|
||||
|
||||
unexpected_end_of_file:
|
||||
push _unexpected_end_of_file
|
||||
jmp general_error
|
||||
code_cannot_be_generated:
|
||||
push _code_cannot_be_generated
|
||||
jmp general_error
|
||||
format_limitations_exceeded:
|
||||
push _format_limitations_exceeded
|
||||
jmp general_error
|
||||
invalid_definition:
|
||||
push _invalid_definition
|
||||
general_error:
|
||||
cmp [symbols_file],0
|
||||
je fatal_error
|
||||
call dump_preprocessed_source
|
||||
jmp fatal_error
|
||||
|
||||
file_not_found:
|
||||
push _file_not_found
|
||||
jmp error_with_source
|
||||
error_reading_file:
|
||||
push _error_reading_file
|
||||
jmp error_with_source
|
||||
invalid_file_format:
|
||||
push _invalid_file_format
|
||||
jmp error_with_source
|
||||
invalid_macro_arguments:
|
||||
push _invalid_macro_arguments
|
||||
jmp error_with_source
|
||||
incomplete_macro:
|
||||
push _incomplete_macro
|
||||
jmp error_with_source
|
||||
unexpected_characters:
|
||||
push _unexpected_characters
|
||||
jmp error_with_source
|
||||
invalid_argument:
|
||||
push _invalid_argument
|
||||
jmp error_with_source
|
||||
illegal_instruction:
|
||||
push _illegal_instruction
|
||||
jmp error_with_source
|
||||
invalid_operand:
|
||||
push _invalid_operand
|
||||
jmp error_with_source
|
||||
invalid_operand_size:
|
||||
push _invalid_operand_size
|
||||
jmp error_with_source
|
||||
operand_size_not_specified:
|
||||
push _operand_size_not_specified
|
||||
jmp error_with_source
|
||||
operand_sizes_do_not_match:
|
||||
push _operand_sizes_do_not_match
|
||||
jmp error_with_source
|
||||
invalid_address_size:
|
||||
push _invalid_address_size
|
||||
jmp error_with_source
|
||||
address_sizes_do_not_agree:
|
||||
push _address_sizes_do_not_agree
|
||||
jmp error_with_source
|
||||
disallowed_combination_of_registers:
|
||||
push _disallowed_combination_of_registers
|
||||
jmp error_with_source
|
||||
long_immediate_not_encodable:
|
||||
push _long_immediate_not_encodable
|
||||
jmp error_with_source
|
||||
relative_jump_out_of_range:
|
||||
push _relative_jump_out_of_range
|
||||
jmp error_with_source
|
||||
invalid_expression:
|
||||
push _invalid_expression
|
||||
jmp error_with_source
|
||||
invalid_address:
|
||||
push _invalid_address
|
||||
jmp error_with_source
|
||||
invalid_value:
|
||||
push _invalid_value
|
||||
jmp error_with_source
|
||||
value_out_of_range:
|
||||
push _value_out_of_range
|
||||
jmp error_with_source
|
||||
undefined_symbol:
|
||||
mov edi,message
|
||||
mov esi,_undefined_symbol
|
||||
call copy_asciiz
|
||||
push message
|
||||
cmp [error_info],0
|
||||
je error_with_source
|
||||
mov esi,[error_info]
|
||||
mov esi,[esi+24]
|
||||
or esi,esi
|
||||
jz error_with_source
|
||||
mov byte [edi-1],20h
|
||||
call write_quoted_symbol_name
|
||||
jmp error_with_source
|
||||
copy_asciiz:
|
||||
lods byte [esi]
|
||||
stos byte [edi]
|
||||
test al,al
|
||||
jnz copy_asciiz
|
||||
ret
|
||||
write_quoted_symbol_name:
|
||||
mov al,27h
|
||||
stosb
|
||||
movzx ecx,byte [esi-1]
|
||||
rep movs byte [edi],[esi]
|
||||
mov ax,27h
|
||||
stosw
|
||||
ret
|
||||
symbol_out_of_scope:
|
||||
mov edi,message
|
||||
mov esi,_symbol_out_of_scope_1
|
||||
call copy_asciiz
|
||||
cmp [error_info],0
|
||||
je finish_symbol_out_of_scope_message
|
||||
mov esi,[error_info]
|
||||
mov esi,[esi+24]
|
||||
or esi,esi
|
||||
jz finish_symbol_out_of_scope_message
|
||||
mov byte [edi-1],20h
|
||||
call write_quoted_symbol_name
|
||||
finish_symbol_out_of_scope_message:
|
||||
mov byte [edi-1],20h
|
||||
mov esi,_symbol_out_of_scope_2
|
||||
call copy_asciiz
|
||||
push message
|
||||
jmp error_with_source
|
||||
invalid_use_of_symbol:
|
||||
push _invalid_use_of_symbol
|
||||
jmp error_with_source
|
||||
name_too_long:
|
||||
push _name_too_long
|
||||
jmp error_with_source
|
||||
invalid_name:
|
||||
push _invalid_name
|
||||
jmp error_with_source
|
||||
reserved_word_used_as_symbol:
|
||||
push _reserved_word_used_as_symbol
|
||||
jmp error_with_source
|
||||
symbol_already_defined:
|
||||
push _symbol_already_defined
|
||||
jmp error_with_source
|
||||
missing_end_quote:
|
||||
push _missing_end_quote
|
||||
jmp error_with_source
|
||||
missing_end_directive:
|
||||
push _missing_end_directive
|
||||
jmp error_with_source
|
||||
unexpected_instruction:
|
||||
push _unexpected_instruction
|
||||
jmp error_with_source
|
||||
extra_characters_on_line:
|
||||
push _extra_characters_on_line
|
||||
jmp error_with_source
|
||||
section_not_aligned_enough:
|
||||
push _section_not_aligned_enough
|
||||
jmp error_with_source
|
||||
setting_already_specified:
|
||||
push _setting_already_specified
|
||||
jmp error_with_source
|
||||
data_already_defined:
|
||||
push _data_already_defined
|
||||
jmp error_with_source
|
||||
too_many_repeats:
|
||||
push _too_many_repeats
|
||||
jmp error_with_source
|
||||
assertion_failed:
|
||||
push _assertion_failed
|
||||
jmp error_with_source
|
||||
invoked_error:
|
||||
push _invoked_error
|
||||
error_with_source:
|
||||
cmp [symbols_file],0
|
||||
je assembler_error
|
||||
call dump_preprocessed_source
|
||||
call restore_preprocessed_source
|
||||
jmp assembler_error
|
@@ -1,758 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; flat assembler source ;;
|
||||
;; Copyright (c) 1999-2020, Tomasz Grysztar ;;
|
||||
;; All rights reserved. ;;
|
||||
;; ;;
|
||||
;; KolibriOS port by KolibriOS Team ;;
|
||||
;; Menuet port by VT ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
NORMAL_MODE = 8
|
||||
CONSOLE_MODE = 32
|
||||
|
||||
MAGIC1 = 6*(text.line_size-1)+14
|
||||
MAX_PATH = 100
|
||||
|
||||
DEFAULT_WIN_W = 450
|
||||
DEFAULT_WIN_H = 350
|
||||
LINE_H = 25
|
||||
RIGHT_BTN_W = 80
|
||||
|
||||
APP_MEMORY = 0x00800000
|
||||
|
||||
;; Menuet header
|
||||
|
||||
appname equ "flat assembler "
|
||||
;---------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; program start
|
||||
dd program_end ; program image size
|
||||
dd stacktop ; required amount of memory
|
||||
dd stacktop ; stack
|
||||
dd params,cur_dir_path ; parameters,icon
|
||||
;---------------------------------------------------------------------
|
||||
include 'lang.inc'
|
||||
include '../../../../macros.inc'
|
||||
purge add,sub ; macros.inc does incorrect substitution
|
||||
include 'fasm.inc'
|
||||
|
||||
include '../../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../../../KOSfuncs.inc'
|
||||
include '../../../../load_lib.mac'
|
||||
@use_library
|
||||
|
||||
center fix true
|
||||
;---------------------------------------------------------------------
|
||||
START: ; Start of execution
|
||||
mov edi, fileinfos
|
||||
mov ecx, (fileinfos_end-fileinfos)/4
|
||||
or eax, -1
|
||||
rep stosd
|
||||
push 68
|
||||
pop eax
|
||||
push 11
|
||||
pop ebx
|
||||
mcall
|
||||
|
||||
cmp [params],0
|
||||
jz start_1
|
||||
|
||||
;---------GerdtR
|
||||
or ecx,-1
|
||||
mov esi,params
|
||||
cmp byte[esi],' '
|
||||
jne @f
|
||||
mov edi,esi
|
||||
mov al,' '
|
||||
repe scasb
|
||||
mov esi,edi
|
||||
dec esi
|
||||
@@:
|
||||
|
||||
mov edi,dbgWord
|
||||
@@: lodsb
|
||||
scasb
|
||||
jne NoOutDebugInfo
|
||||
cmp byte[edi],0
|
||||
jnz @b
|
||||
|
||||
cmp byte[esi],' '
|
||||
jne NoOutDebugInfo
|
||||
|
||||
mov edi,esi
|
||||
mov al,' '
|
||||
repe scasb
|
||||
mov esi,edi
|
||||
dec esi
|
||||
|
||||
mov edi,params
|
||||
@@: lodsb
|
||||
stosb
|
||||
test al,al
|
||||
jnz @b
|
||||
|
||||
; mov [bGenerateDebugInfo], 1
|
||||
or dword[ch1_dbg.flags],10b
|
||||
|
||||
|
||||
NoOutDebugInfo:
|
||||
;---------/GerdtR
|
||||
|
||||
|
||||
|
||||
|
||||
mov ecx,10
|
||||
mov eax,' '
|
||||
mov edi,infile
|
||||
push ecx
|
||||
cld
|
||||
rep stosd
|
||||
mov ecx,[esp]
|
||||
mov edi,outfile
|
||||
rep stosd
|
||||
pop ecx
|
||||
mov edi,path
|
||||
rep stosd
|
||||
|
||||
mov esi,params
|
||||
; DEBUGF "params: %s\n",esi
|
||||
mov edi,infile
|
||||
call mov_param_str
|
||||
; mov edi,infile
|
||||
; DEBUGF " input: %s\n",edi
|
||||
mov edi,outfile
|
||||
call mov_param_str
|
||||
; mov edi,outfile
|
||||
; DEBUGF "output: %s\n",edi
|
||||
mov edi,path
|
||||
call mov_param_str
|
||||
; mov edi,path
|
||||
; DEBUGF " path: %s\n",edi
|
||||
dec esi
|
||||
cmp [esi], dword ',run'
|
||||
jne @f
|
||||
mov [_run_outfile],1
|
||||
@@:
|
||||
cmp [esi], dword ',dbg'
|
||||
jne @f
|
||||
mov [_run_outfile],2
|
||||
@@:
|
||||
mov [_mode],CONSOLE_MODE
|
||||
jmp start
|
||||
;---------------------------------------------------------------------
|
||||
start_1:
|
||||
;sys_
|
||||
load_libraries l_libs_start,load_lib_end
|
||||
|
||||
cmp eax,-1
|
||||
jne @f
|
||||
mcall -1 ;exit if not open box_lib.obj
|
||||
@@:
|
||||
mcall 40,0x80000027 ;<3B><>᪠ <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> ᮡ<>⨩
|
||||
;---------------------------------------------------------------------
|
||||
init_checkboxes2 ch1_dbg,ch1_dbg+ch_struc_size
|
||||
;---------------------------------------------------------------------
|
||||
; OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
call dword [OpenDialog_Init]
|
||||
;---------------------------------------------------------------------
|
||||
red: ; Redraw
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
mcall 10 ; Wait here for event
|
||||
cmp al,6
|
||||
je call_mouse
|
||||
dec eax
|
||||
je red ; Redraw request
|
||||
dec eax
|
||||
jne button ; Button in buffer
|
||||
key: ; Key
|
||||
mcall 2 ; Read it and ignore
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_key]
|
||||
push dword edit2
|
||||
call [edit_box_key]
|
||||
push dword edit3
|
||||
call [edit_box_key]
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
call_mouse:
|
||||
call mouse
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
button: ; Button in Window
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
jne noclose
|
||||
or eax,-1
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
noclose:
|
||||
cmp ah,5 ;press button for OpenDialog
|
||||
jne @f
|
||||
call fun_opn_dlg
|
||||
@@:
|
||||
cmp ah,2 ; Start compiling
|
||||
je start
|
||||
cmp ah,3 ; Start compiled file
|
||||
jnz norunout
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_start
|
||||
; xor ecx,ecx
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
norunout:
|
||||
cmp ah,4
|
||||
jnz norundebug
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_debug
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
norundebug:
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
mouse:
|
||||
push dword edit1
|
||||
call [edit_box_mouse]
|
||||
push dword edit2
|
||||
call [edit_box_mouse]
|
||||
push dword edit3
|
||||
call [edit_box_mouse]
|
||||
push dword ch1_dbg
|
||||
call [check_box_mouse]
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_window:
|
||||
pusha
|
||||
mcall 12,1 ; Start of draw
|
||||
|
||||
get_sys_colors 1,0
|
||||
edit_boxes_set_sys_color edit1,editboxes_end,sc
|
||||
;check_boxes_set_sys_color2 ch1_dbg,ch1_dbg+ch_struc_size,sc
|
||||
mov eax,[sc.work_text]
|
||||
or eax, 0x90000000
|
||||
mov [ch1_dbg.text_color], eax
|
||||
m2m [ch1_dbg.border_color], [sc.work_graph]
|
||||
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
xor eax,eax
|
||||
xor esi,esi
|
||||
mcall ,<150,DEFAULT_WIN_W>,<150,DEFAULT_WIN_H>,edx,,title
|
||||
|
||||
mcall 9,PROCESSINFO,-1
|
||||
|
||||
mov eax,[PROCESSINFO+70] ;get status of window
|
||||
test eax,100b
|
||||
jne .end
|
||||
|
||||
WIN_MIN_W = 350
|
||||
WIN_MIN_H = 300
|
||||
|
||||
cmp dword[pinfo.client_box.width],WIN_MIN_W
|
||||
jge @f
|
||||
mcall 67,-1,-1,WIN_MIN_W+20,-1
|
||||
jmp .end
|
||||
@@:
|
||||
cmp dword[pinfo.client_box.height],WIN_MIN_H
|
||||
jge @f
|
||||
mcall 67,-1,-1,-1,WIN_MIN_H+50
|
||||
jmp .end
|
||||
@@:
|
||||
mpack ebx,[pinfo.client_box.width],RIGHT_BTN_W
|
||||
msub ebx,RIGHT_BTN_W+1,0
|
||||
mcall 8,ebx,<LINE_H*0+3,LINE_H-4>,ID_COMPILE_BTN,[sc.work_button]
|
||||
mcall ,ebx,<LINE_H*1+3,LINE_H-4>,ID_EXECUTE_BTN
|
||||
mcall ,ebx,<LINE_H*2+3,LINE_H-4>,ID_EXECDBG_BTN
|
||||
|
||||
mcall ,<5,62>,<LINE_H*2+3,LINE_H-5>,ID_OPENDLG_BTN
|
||||
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, $10000000
|
||||
mcall 4,<6,LINE_H*0+6>,,text+text.line_size*0,text.line_size ;InFile
|
||||
mcall ,<6,LINE_H*1+6>,,text+text.line_size*1,esi ;OutFile
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, $10000000
|
||||
mcall ,<0,LINE_H*2+6>,,text+text.line_size*2,esi ;Path
|
||||
|
||||
mov ebx,[pinfo.client_box.width]
|
||||
sub ebx,RIGHT_BTN_W-12
|
||||
shl ebx,16
|
||||
add ebx,LINE_H/2-6
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, $10000000
|
||||
mcall ,ebx,ecx,s_compile,7
|
||||
add ebx,LINE_H
|
||||
mcall ,ebx,ecx,s_run
|
||||
add ebx,LINE_H
|
||||
mcall ,ebx,ecx,s_debug
|
||||
|
||||
mpack ebx,MAGIC1+6,1+ 14/2-3+ 14*0
|
||||
mov esi,[pinfo.client_box.width]
|
||||
sub esi,MAGIC1*2+6+3
|
||||
mov eax,esi
|
||||
mov cl,6
|
||||
div cl
|
||||
cmp al,MAX_PATH
|
||||
jbe @f
|
||||
mov al,MAX_PATH
|
||||
@@:
|
||||
movzx esi,al
|
||||
|
||||
call draw_messages
|
||||
|
||||
mov eax,dword [pinfo.client_box.width]
|
||||
sub eax,[edit1.left]
|
||||
sub eax,RIGHT_BTN_W+6
|
||||
mov dword[edit1.width],eax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov dword[edit2.width],eax
|
||||
mov dword[edit3.width],eax
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_draw]
|
||||
push dword edit2
|
||||
call [edit_box_draw]
|
||||
push dword edit3
|
||||
call [edit_box_draw]
|
||||
push dword ch1_dbg
|
||||
call [check_box_draw]
|
||||
.end:
|
||||
mcall 12,2 ; End of Draw
|
||||
popa
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
bottom_right dd ?
|
||||
|
||||
align 4
|
||||
fun_opn_dlg: ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD> <20>맮<EFBFBD><EBA7AE> OpenFile <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
pushad
|
||||
copy_path open_dialog_name,communication_area_default_path,library_path,0
|
||||
mov [OpenDialog_data.type],0
|
||||
|
||||
xor al,al
|
||||
mov edi,dword [edit3.text]
|
||||
mov ecx,dword [edit3.max]
|
||||
cld
|
||||
repne scasb
|
||||
cmp byte[edi-2],'/'
|
||||
jne @f
|
||||
mov byte[edi-2],0 ;<3B> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <>, <20><> <20><><EFBFBD><EFBFBD> 㪮<><E3AAAE>稢<EFBFBD><E7A8A2><EFBFBD> <20><> 1 ᨬ<><E1A8AC><EFBFBD>
|
||||
@@:
|
||||
push dword OpenDialog_data
|
||||
call dword [OpenDialog_Start]
|
||||
cmp [OpenDialog_data.status],2
|
||||
je @f
|
||||
|
||||
xor al,al
|
||||
mov edi,dword [edit3.text]
|
||||
mov ebx,edi ;copy text pointer
|
||||
mov ecx,dword [edit3.max]
|
||||
cld
|
||||
repne scasb
|
||||
cmp byte[edi-2],'/'
|
||||
jne .no_slash
|
||||
|
||||
dec edi ;<3B> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <>, <20><> <20><><EFBFBD><EFBFBD> 㪮<><E3AAAE>稢<EFBFBD><E7A8A2><EFBFBD> <20><> 1 ᨬ<><E1A8AC><EFBFBD>
|
||||
.no_slash:
|
||||
mov byte[edi-1],'/' ;<3B>⠢<EFBFBD><E2A0A2> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <>
|
||||
mov byte[edi],0 ;<3B><>१<EFBFBD><E0A5A7><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
sub edi,ebx ;edi = strlen(edit3.text)
|
||||
mov [edit3.size],edi
|
||||
mov [edit3.pos],edi
|
||||
|
||||
push dword [OpenDialog_data.filename_area]
|
||||
push dword edit1
|
||||
call dword [edit_box_set_text]
|
||||
|
||||
push dword [OpenDialog_data.filename_area]
|
||||
push dword edit2
|
||||
call dword [edit_box_set_text]
|
||||
|
||||
mov esi,[edit2.text]
|
||||
xor eax,eax
|
||||
cld
|
||||
.cycle:
|
||||
lodsb
|
||||
test eax,eax
|
||||
jnz .cycle
|
||||
|
||||
sub esi,5
|
||||
cmp esi,[edit2.text]
|
||||
jle .short_fn
|
||||
|
||||
mov byte[esi],0
|
||||
sub dword [edit2.size],4
|
||||
sub dword [edit2.pos],4
|
||||
|
||||
.short_fn:
|
||||
push dword edit1
|
||||
call dword [edit_box_draw]
|
||||
push dword edit2
|
||||
call dword [edit_box_draw]
|
||||
push dword edit3
|
||||
call dword [edit_box_draw]
|
||||
@@:
|
||||
popad
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_messages:
|
||||
mpack ebx,5,[pinfo.client_box.width]
|
||||
sub ebx,9
|
||||
mpack ecx,0,[pinfo.client_box.height]
|
||||
madd ecx, LINE_H*4,-( LINE_H*4+5)
|
||||
mov word[bottom_right+2],bx
|
||||
mov word[bottom_right],cx
|
||||
msub [bottom_right],7,11
|
||||
add [bottom_right],7 shl 16 + 53
|
||||
mcall 13,,,0xFeFefe ; clear work area
|
||||
|
||||
; draw top shadow
|
||||
push ecx
|
||||
mov cx,1
|
||||
mov edx,0xDADEDA
|
||||
mcall
|
||||
|
||||
; draw left shadow
|
||||
pop ecx
|
||||
push ebx
|
||||
mov bx,1
|
||||
mcall
|
||||
pop ebx
|
||||
|
||||
_cy = 0
|
||||
_sy = 2
|
||||
_cx = 4
|
||||
_sx = 6
|
||||
push ebx ecx
|
||||
mpack ebx,4,5
|
||||
add bx,[esp+_cx]
|
||||
mov ecx,[esp+_sy-2]
|
||||
mov cx,[esp+_sy]
|
||||
msub ecx,1,1
|
||||
mcall 38,,,[sc.work_graph]
|
||||
mov si,[esp+_cy]
|
||||
add cx,si
|
||||
shl esi,16
|
||||
add ecx,esi
|
||||
madd ecx,1,1
|
||||
mcall
|
||||
mpack ebx,4,4
|
||||
mov esi,[esp+_sy-2]
|
||||
mov si,cx
|
||||
mov ecx,esi
|
||||
mcall
|
||||
mov si,[esp+_cx]
|
||||
add bx,si
|
||||
shl esi,16
|
||||
add ebx,esi
|
||||
madd ebx,1,1
|
||||
mcall
|
||||
pop ecx ebx
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; DATA
|
||||
;---------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
text:
|
||||
db ' <20>唠<EFBFBD><E594A0>:'
|
||||
.line_size = $-text
|
||||
db '<27><>唠<EFBFBD><E594A0>:'
|
||||
db ' <20><><EFBFBD><EFBFBD>:'
|
||||
;db 'x'
|
||||
|
||||
s_compile db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.'
|
||||
s_run db ' <20><><EFBFBD><EFBFBD> '
|
||||
s_debug db '<27>⫠<EFBFBD><E2ABA0><EFBFBD>'
|
||||
s_dbgdescr db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⫠<EFBFBD><E2ABA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD>',0
|
||||
|
||||
|
||||
else
|
||||
text:
|
||||
db ' InFile:'
|
||||
.line_size = $-text
|
||||
db 'OutFile:'
|
||||
db ' Path:'
|
||||
;db 'x'
|
||||
|
||||
s_compile db 'COMPILE'
|
||||
s_run db ' RUN '
|
||||
s_debug db ' DEBUG '
|
||||
s_dbgdescr db 'Generate debug information',0
|
||||
|
||||
|
||||
end if
|
||||
|
||||
system_dir0 db '/sys/lib/'
|
||||
lib0_name db 'box_lib.obj',0
|
||||
|
||||
system_dir1 db '/sys/lib/'
|
||||
lib1_name db 'proc_lib.obj',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_box_lib:
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
edit_box_set_text dd aEdit_box_set_text
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
dd 0,0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aEdit_box_set_text db 'edit_box_set_text',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_proc_lib:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;---------------------------------------------------------------------
|
||||
;library structures
|
||||
l_libs_start:
|
||||
lib0 l_libs lib0_name, library_path, system_dir0, import_box_lib
|
||||
lib1 l_libs lib1_name, library_path, system_dir1, import_proc_lib
|
||||
load_lib_end:
|
||||
|
||||
edit1 edit_box 153, 72, 3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(outfile-infile-1), infile, mouse_dd, 0, 11,11
|
||||
edit2 edit_box 153, 72, LINE_H+3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(path-outfile-1), outfile, mouse_dd, 0, 7,7
|
||||
edit3 edit_box 153, 72, LINE_H*2+3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(path_end-path-1), path, mouse_dd, 0, 6,6
|
||||
editboxes_end:
|
||||
ch1_dbg check_box2 (5 shl 16)+15, ((LINE_H*3+3) shl 16)+15, 6, 0xffffff, 0x80ff, 0x10000000, s_dbgdescr,ch_flag_top
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd pinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_path dd path ;+16
|
||||
.dir_default_path dd default_dir ;+20
|
||||
.start_path dd library_path ;+24 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD>
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_path dd path ;+36 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
default_dir db '/rd/1',0 ;<3B><>४<EFBFBD><E0A5AA><EFBFBD><EFBFBD><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD>
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_name:
|
||||
db 'opendial',0
|
||||
communication_area_default_path:
|
||||
db '/rd/1/File managers/',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'ASM',0
|
||||
.end:
|
||||
db 0
|
||||
;---------------------------------------------------------------------
|
||||
mouse_dd dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> Shift-<2D> <20> editbox
|
||||
;---------------------------------------------------------------------
|
||||
infile db 'example.asm'
|
||||
times MAX_PATH-$+infile db 0
|
||||
outfile db 'example'
|
||||
times MAX_PATH-$+outfile db 0
|
||||
path db '/rd/1//' ;OpenDialog <20><><EFBFBD> <20><><EFBFBD><EFBFBD>᪥ 㡨ࠥ<E3A1A8> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ᥣ<EFBFBD><E1A5A3>, <20><>⮬<EFBFBD> <><E1ABA5> 2
|
||||
times MAX_PATH-$+path db 0
|
||||
path_end:
|
||||
lf db 13,10,0
|
||||
;---------------------------------------------------------------------
|
||||
mov_param_str:
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
cmp al,','
|
||||
je @f
|
||||
stosb
|
||||
test al,al
|
||||
jnz @b
|
||||
@@:
|
||||
xor al,al
|
||||
stosb
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
start:
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
call draw_messages
|
||||
mov [textxy],8 shl 16 + LINE_H*4+4
|
||||
@@:
|
||||
mov esi,_logo
|
||||
call display_string
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; Fasm native code
|
||||
;---------------------------------------------------------------------
|
||||
mov [input_file],infile
|
||||
mov [output_file],outfile
|
||||
|
||||
call init_memory
|
||||
|
||||
call make_timestamp
|
||||
mov [start_time],eax
|
||||
|
||||
call preprocessor
|
||||
call parser
|
||||
call assembler
|
||||
bt dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0
|
||||
jae @f ;jz @f
|
||||
call symbol_dump
|
||||
@@:
|
||||
call formatter
|
||||
|
||||
call display_user_messages
|
||||
movzx eax,[current_pass]
|
||||
inc eax
|
||||
call display_number
|
||||
mov esi,_passes_suffix
|
||||
call display_string
|
||||
call make_timestamp
|
||||
sub eax,[start_time]
|
||||
xor edx,edx
|
||||
mov ebx,100
|
||||
div ebx
|
||||
or eax,eax
|
||||
jz display_bytes_count
|
||||
xor edx,edx
|
||||
mov ebx,10
|
||||
div ebx
|
||||
push edx
|
||||
call display_number
|
||||
mov dl,'.'
|
||||
call display_character
|
||||
pop eax
|
||||
call display_number
|
||||
mov esi,_seconds_suffix
|
||||
call display_string
|
||||
display_bytes_count:
|
||||
mov eax,[written_size]
|
||||
call display_number
|
||||
mov esi,_bytes_suffix
|
||||
call display_string
|
||||
xor al,al
|
||||
|
||||
cmp [_run_outfile],0
|
||||
je @f
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
xor ecx,ecx
|
||||
|
||||
cmp [_run_outfile],2 ; param is ',dbg'
|
||||
jne run
|
||||
mcall 70,file_info_debug
|
||||
jmp @f
|
||||
run:
|
||||
mcall 70,file_info_start
|
||||
@@:
|
||||
jmp exit_program
|
||||
;---------------------------------------------------------------------
|
||||
include 'system.inc'
|
||||
include 'version.inc'
|
||||
include 'errors.inc'
|
||||
include 'symbdump.inc'
|
||||
include 'preproce.inc'
|
||||
include 'parser.inc'
|
||||
include 'exprpars.inc'
|
||||
include 'assemble.inc'
|
||||
include 'exprcalc.inc'
|
||||
include 'formats.inc'
|
||||
include 'x86_64.inc'
|
||||
include 'avx.inc'
|
||||
include 'tables.inc'
|
||||
include 'messages.inc'
|
||||
;---------------------------------------------------------------------
|
||||
title db appname,VERSION_STRING,0
|
||||
|
||||
_logo db 'flat assembler version ',VERSION_STRING,13,10,0
|
||||
|
||||
_passes_suffix db ' passes, ',0
|
||||
_seconds_suffix db ' seconds, ',0
|
||||
_bytes_suffix db ' bytes.',13,10,0
|
||||
|
||||
_include db 'INCLUDE',0
|
||||
|
||||
_counter db 4,'0000'
|
||||
|
||||
_mode dd NORMAL_MODE
|
||||
_run_outfile dd 0
|
||||
;bGenerateDebugInfo db 0
|
||||
|
||||
dbgWord db '-d',0
|
||||
|
||||
sub_table:
|
||||
times $41 db $00
|
||||
times $1A db $20
|
||||
times $25 db $00
|
||||
times $10 db $20
|
||||
times $30 db $00
|
||||
times $10 db $50
|
||||
times $04 db $00,$01
|
||||
times $08 db $00
|
||||
|
||||
;include_debug_strings
|
||||
program_end:
|
||||
; params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
|
||||
params rb 4096
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
filename_area rb 256
|
||||
|
||||
align 4
|
||||
|
||||
include 'variable.inc'
|
||||
|
||||
program_base dd ?
|
||||
buffer_address dd ?
|
||||
memory_setting dd ?
|
||||
start_time dd ?
|
||||
memblock dd ?
|
||||
|
||||
predefinitions rb 1000h
|
||||
|
||||
dbgfilename rb MAX_PATH+4
|
||||
|
||||
sc system_colors
|
||||
max_handles = 8
|
||||
fileinfos rb (4+20+MAX_PATH)*max_handles
|
||||
fileinfos_end:
|
||||
pinfo process_information
|
||||
|
||||
align 1000h
|
||||
rb 1000h
|
||||
stacktop:
|
@@ -1,59 +0,0 @@
|
||||
ID_CLOSE_BTN = 1
|
||||
ID_COMPILE_BTN = 2
|
||||
ID_EXECUTE_BTN = 3
|
||||
ID_EXECDBG_BTN = 4
|
||||
ID_OPENDLG_BTN = 5
|
||||
|
||||
center fix false
|
||||
SYSTEMCOLORS fix sc
|
||||
PROCESSINFO fix pinfo
|
||||
|
||||
macro get_sys_colors wnd_skin,font_1 {
|
||||
mcall 48,3,SYSTEMCOLORS,sizeof.system_colors
|
||||
if wnd_skin <> 0
|
||||
or [SYSTEMCOLORS+system_colors.work],0x03000000
|
||||
end if
|
||||
if font_1 <> 0
|
||||
or [SYSTEMCOLORS+system_colors.grab_text],0x10000000
|
||||
end if
|
||||
}
|
||||
|
||||
macro draw_caption _edx,_esi {
|
||||
mov edx,_edx
|
||||
mov esi,_esi
|
||||
call __draw_caption
|
||||
}
|
||||
|
||||
macro mmov reg,a1,a2 {
|
||||
mov reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro madd reg,a1,a2 {
|
||||
add reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro msub reg,a1,a2 {
|
||||
sub reg,(a1) shl 16 + (a2)
|
||||
}
|
||||
|
||||
macro jmpe reg,def,[val,lab] {
|
||||
forward
|
||||
cmp reg,val
|
||||
je lab
|
||||
common
|
||||
if ~def eq
|
||||
jmp def
|
||||
end if
|
||||
}
|
||||
|
||||
macro func name {
|
||||
if used name
|
||||
name:
|
||||
}
|
||||
|
||||
macro endf {
|
||||
end if
|
||||
}
|
||||
|
||||
@^ fix macro comment {
|
||||
^@ fix }
|
@@ -1,37 +0,0 @@
|
||||
|
||||
flat assembler version 1.71
|
||||
Copyright (c) 1999-2013, Tomasz Grysztar.
|
||||
All rights reserved.
|
||||
|
||||
This program is free for commercial and non-commercial use as long as
|
||||
the following conditions are adhered to.
|
||||
|
||||
Copyright remains Tomasz Grysztar, and as such any Copyright notices
|
||||
in the code are not to be removed.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The licence and distribution terms for any publically available
|
||||
version or derivative of this code cannot be changed. i.e. this code
|
||||
cannot simply be copied and put under another distribution licence
|
||||
(including the GNU Public Licence).
|
@@ -1,52 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
_out_of_memory db 'out of memory',0
|
||||
_stack_overflow db 'out of stack space',0
|
||||
_main_file_not_found db 'source file not found',0
|
||||
_unexpected_end_of_file db 'unexpected end of file',0
|
||||
_code_cannot_be_generated db 'code cannot be generated',0
|
||||
_format_limitations_exceeded db 'format limitations exceeded',0
|
||||
_invalid_definition db 'invalid definition provided',0
|
||||
_write_failed db 'write failed',0
|
||||
_file_not_found db 'file not found',0
|
||||
_error_reading_file db 'error reading file',0
|
||||
_invalid_file_format db 'invalid file format',0
|
||||
_invalid_macro_arguments db 'invalid macro arguments',0
|
||||
_incomplete_macro db 'incomplete macro',0
|
||||
_unexpected_characters db 'unexpected characters',0
|
||||
_invalid_argument db 'invalid argument',0
|
||||
_illegal_instruction db 'illegal instruction',0
|
||||
_invalid_operand db 'invalid operand',0
|
||||
_invalid_operand_size db 'invalid size of operand',0
|
||||
_operand_size_not_specified db 'operand size not specified',0
|
||||
_operand_sizes_do_not_match db 'operand sizes do not match',0
|
||||
_invalid_address_size db 'invalid size of address value',0
|
||||
_address_sizes_do_not_agree db 'address sizes do not agree',0
|
||||
_disallowed_combination_of_registers db 'disallowed combination of registers',0
|
||||
_long_immediate_not_encodable db 'not encodable with long immediate',0
|
||||
_relative_jump_out_of_range db 'relative jump out of range',0
|
||||
_invalid_expression db 'invalid expression',0
|
||||
_invalid_address db 'invalid address',0
|
||||
_invalid_value db 'invalid value',0
|
||||
_value_out_of_range db 'value out of range',0
|
||||
_undefined_symbol db 'undefined symbol',0
|
||||
_symbol_out_of_scope_1 db 'symbol',0
|
||||
_symbol_out_of_scope_2 db 'out of scope',0
|
||||
_invalid_use_of_symbol db 'invalid use of symbol',0
|
||||
_name_too_long db 'name too long',0
|
||||
_invalid_name db 'invalid name',0
|
||||
_reserved_word_used_as_symbol db 'reserved word used as symbol',0
|
||||
_symbol_already_defined db 'symbol already defined',0
|
||||
_missing_end_quote db 'missing end quote',0
|
||||
_missing_end_directive db 'missing end directive',0
|
||||
_unexpected_instruction db 'unexpected instruction',0
|
||||
_extra_characters_on_line db 'extra characters on line',0
|
||||
_section_not_aligned_enough db 'section is not aligned enough',0
|
||||
_setting_already_specified db 'setting already specified',0
|
||||
_data_already_defined db 'data already defined',0
|
||||
_too_many_repeats db 'too many repeats',0
|
||||
_invoked_error db 'error directive encountered in source file',0
|
||||
_assertion_failed db 'assertion failed',0
|
@@ -1,450 +0,0 @@
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
dump_symbols:
|
||||
mov edi,[code_start]
|
||||
call setup_dump_header
|
||||
mov esi,[input_file]
|
||||
call copy_asciiz
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
mov [ebx-40h+0Ch],eax
|
||||
mov esi,[output_file]
|
||||
call copy_asciiz
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
mov edx,[symbols_stream]
|
||||
mov ebp,[free_additional_memory]
|
||||
and [number_of_sections],0
|
||||
cmp [output_format],4
|
||||
je prepare_strings_table
|
||||
cmp [output_format],5
|
||||
jne strings_table_ready
|
||||
bt [format_flags],0
|
||||
jc strings_table_ready
|
||||
prepare_strings_table:
|
||||
cmp edx,ebp
|
||||
je strings_table_ready
|
||||
mov al,[edx]
|
||||
test al,al
|
||||
jz prepare_string
|
||||
cmp al,80h
|
||||
je prepare_string
|
||||
add edx,0Ch
|
||||
cmp al,0C0h
|
||||
jb prepare_strings_table
|
||||
add edx,4
|
||||
jmp prepare_strings_table
|
||||
prepare_string:
|
||||
mov esi,edi
|
||||
sub esi,ebx
|
||||
xchg esi,[edx+4]
|
||||
test al,al
|
||||
jz prepare_section_string
|
||||
or dword [edx+4],1 shl 31
|
||||
add edx,0Ch
|
||||
prepare_external_string:
|
||||
mov ecx,[esi]
|
||||
add esi,4
|
||||
rep movs byte [edi],[esi]
|
||||
mov byte [edi],0
|
||||
inc edi
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
jmp prepare_strings_table
|
||||
prepare_section_string:
|
||||
mov ecx,[number_of_sections]
|
||||
mov eax,ecx
|
||||
inc eax
|
||||
mov [number_of_sections],eax
|
||||
xchg eax,[edx+4]
|
||||
shl ecx,2
|
||||
add ecx,[free_additional_memory]
|
||||
mov [ecx],eax
|
||||
add edx,20h
|
||||
test esi,esi
|
||||
jz prepare_default_section_string
|
||||
cmp [output_format],5
|
||||
jne prepare_external_string
|
||||
bt [format_flags],0
|
||||
jc prepare_external_string
|
||||
mov esi,[esi]
|
||||
add esi,[resource_data]
|
||||
copy_elf_section_name:
|
||||
lods byte [esi]
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
stos byte [edi]
|
||||
test al,al
|
||||
jnz copy_elf_section_name
|
||||
jmp prepare_strings_table
|
||||
prepare_default_section_string:
|
||||
mov eax,'.fla'
|
||||
stos dword [edi]
|
||||
mov ax,'t'
|
||||
stos word [edi]
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
jmp prepare_strings_table
|
||||
strings_table_ready:
|
||||
mov edx,[tagged_blocks]
|
||||
mov ebp,[memory_end]
|
||||
sub ebp,[labels_list]
|
||||
add ebp,edx
|
||||
prepare_labels_dump:
|
||||
cmp edx,ebp
|
||||
je labels_dump_ok
|
||||
mov eax,[edx+24]
|
||||
test eax,eax
|
||||
jz label_dump_name_ok
|
||||
cmp eax,[memory_start]
|
||||
jb label_name_outside_source
|
||||
cmp eax,[source_start]
|
||||
ja label_name_outside_source
|
||||
sub eax,[memory_start]
|
||||
dec eax
|
||||
mov [edx+24],eax
|
||||
jmp label_dump_name_ok
|
||||
label_name_outside_source:
|
||||
mov esi,eax
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
or eax,1 shl 31
|
||||
mov [edx+24],eax
|
||||
movzx ecx,byte [esi-1]
|
||||
lea eax,[edi+ecx+1]
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
rep movsb
|
||||
xor al,al
|
||||
stosb
|
||||
label_dump_name_ok:
|
||||
mov eax,[edx+28]
|
||||
test eax,eax
|
||||
jz label_dump_line_ok
|
||||
sub eax,[memory_start]
|
||||
mov [edx+28],eax
|
||||
label_dump_line_ok:
|
||||
test byte [edx+9],4
|
||||
jz convert_base_symbol_for_label
|
||||
xor eax,eax
|
||||
mov [edx],eax
|
||||
mov [edx+4],eax
|
||||
jmp base_symbol_for_label_ok
|
||||
convert_base_symbol_for_label:
|
||||
mov eax,[edx+20]
|
||||
test eax,eax
|
||||
jz base_symbol_for_label_ok
|
||||
cmp eax,[symbols_stream]
|
||||
mov eax,[eax+4]
|
||||
jae base_symbol_for_label_ok
|
||||
xor eax,eax
|
||||
base_symbol_for_label_ok:
|
||||
mov [edx+20],eax
|
||||
mov ax,[current_pass]
|
||||
cmp ax,[edx+16]
|
||||
je label_defined_flag_ok
|
||||
and byte [edx+8],not 1
|
||||
label_defined_flag_ok:
|
||||
cmp ax,[edx+18]
|
||||
je label_used_flag_ok
|
||||
and byte [edx+8],not 8
|
||||
label_used_flag_ok:
|
||||
add edx,LABEL_STRUCTURE_SIZE
|
||||
jmp prepare_labels_dump
|
||||
labels_dump_ok:
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
mov [ebx-40h+14h],eax
|
||||
add eax,40h
|
||||
mov [ebx-40h+18h],eax
|
||||
mov ecx,[memory_end]
|
||||
sub ecx,[labels_list]
|
||||
mov [ebx-40h+1Ch],ecx
|
||||
add eax,ecx
|
||||
mov [ebx-40h+20h],eax
|
||||
mov ecx,[source_start]
|
||||
sub ecx,[memory_start]
|
||||
mov [ebx-40h+24h],ecx
|
||||
add eax,ecx
|
||||
mov [ebx-40h+28h],eax
|
||||
mov eax,[number_of_sections]
|
||||
shl eax,2
|
||||
mov [ebx-40h+34h],eax
|
||||
call prepare_preprocessed_source
|
||||
mov esi,[labels_list]
|
||||
mov ebp,edi
|
||||
make_lines_dump:
|
||||
cmp esi,[tagged_blocks]
|
||||
je lines_dump_ok
|
||||
mov eax,[esi-4]
|
||||
mov ecx,[esi-8]
|
||||
sub esi,8
|
||||
sub esi,ecx
|
||||
cmp eax,1
|
||||
je process_line_dump
|
||||
cmp eax,2
|
||||
jne make_lines_dump
|
||||
add dword [ebx-40h+3Ch],8
|
||||
jmp make_lines_dump
|
||||
process_line_dump:
|
||||
push ebx
|
||||
mov ebx,[esi+8]
|
||||
mov eax,[esi+4]
|
||||
sub eax,[code_start]
|
||||
add eax,[headers_size]
|
||||
test byte [ebx+0Ah],1
|
||||
jz store_offset
|
||||
xor eax,eax
|
||||
store_offset:
|
||||
stos dword [edi]
|
||||
mov eax,[esi]
|
||||
sub eax,[memory_start]
|
||||
stos dword [edi]
|
||||
mov eax,[esi+4]
|
||||
xor edx,edx
|
||||
xor cl,cl
|
||||
sub eax,[ebx]
|
||||
sbb edx,[ebx+4]
|
||||
sbb cl,[ebx+8]
|
||||
stos dword [edi]
|
||||
mov eax,edx
|
||||
stos dword [edi]
|
||||
mov eax,[ebx+10h]
|
||||
stos dword [edi]
|
||||
mov eax,[ebx+14h]
|
||||
test eax,eax
|
||||
jz base_symbol_for_line_ok
|
||||
cmp eax,[symbols_stream]
|
||||
mov eax,[eax+4]
|
||||
jae base_symbol_for_line_ok
|
||||
xor eax,eax
|
||||
base_symbol_for_line_ok:
|
||||
stos dword [edi]
|
||||
mov al,[ebx+9]
|
||||
stos byte [edi]
|
||||
mov al,[esi+10h]
|
||||
stos byte [edi]
|
||||
mov al,[ebx+0Ah]
|
||||
and al,1
|
||||
stos byte [edi]
|
||||
mov al,cl
|
||||
stos byte [edi]
|
||||
pop ebx
|
||||
cmp edi,[tagged_blocks]
|
||||
jae out_of_memory
|
||||
mov eax,edi
|
||||
sub eax,1Ch
|
||||
sub eax,ebp
|
||||
mov [esi],eax
|
||||
jmp make_lines_dump
|
||||
lines_dump_ok:
|
||||
mov edx,edi
|
||||
mov eax,[current_offset]
|
||||
sub eax,[code_start]
|
||||
add eax,[headers_size]
|
||||
stos dword [edi]
|
||||
mov ecx,edi
|
||||
sub ecx,ebx
|
||||
sub ecx,[ebx-40h+14h]
|
||||
mov [ebx-40h+2Ch],ecx
|
||||
add ecx,[ebx-40h+28h]
|
||||
mov [ebx-40h+30h],ecx
|
||||
add ecx,[ebx-40h+34h]
|
||||
mov [ebx-40h+38h],ecx
|
||||
find_inexisting_offsets:
|
||||
sub edx,1Ch
|
||||
cmp edx,ebp
|
||||
jb write_symbols
|
||||
test byte [edx+1Ah],1
|
||||
jnz find_inexisting_offsets
|
||||
cmp eax,[edx]
|
||||
jb correct_inexisting_offset
|
||||
mov eax,[edx]
|
||||
jmp find_inexisting_offsets
|
||||
correct_inexisting_offset:
|
||||
and dword [edx],0
|
||||
or byte [edx+1Ah],2
|
||||
jmp find_inexisting_offsets
|
||||
write_symbols:
|
||||
mov edx,[symbols_file]
|
||||
call create
|
||||
jc write_failed
|
||||
mov edx,[code_start]
|
||||
mov ecx,[edx+14h]
|
||||
add ecx,40h
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,[tagged_blocks]
|
||||
mov ecx,[memory_end]
|
||||
sub ecx,[labels_list]
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,[memory_start]
|
||||
mov ecx,[source_start]
|
||||
sub ecx,edx
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,ebp
|
||||
mov ecx,edi
|
||||
sub ecx,edx
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,[free_additional_memory]
|
||||
mov ecx,[number_of_sections]
|
||||
shl ecx,2
|
||||
call write
|
||||
jc write_failed
|
||||
mov esi,[labels_list]
|
||||
mov edi,[memory_start]
|
||||
make_references_dump:
|
||||
cmp esi,[tagged_blocks]
|
||||
je references_dump_ok
|
||||
mov eax,[esi-4]
|
||||
mov ecx,[esi-8]
|
||||
sub esi,8
|
||||
sub esi,ecx
|
||||
cmp eax,2
|
||||
je dump_reference
|
||||
cmp eax,1
|
||||
jne make_references_dump
|
||||
mov edx,[esi]
|
||||
jmp make_references_dump
|
||||
dump_reference:
|
||||
mov eax,[memory_end]
|
||||
sub eax,[esi]
|
||||
sub eax,LABEL_STRUCTURE_SIZE
|
||||
stosd
|
||||
mov eax,edx
|
||||
stosd
|
||||
cmp edi,[tagged_blocks]
|
||||
jb make_references_dump
|
||||
jmp out_of_memory
|
||||
references_dump_ok:
|
||||
mov edx,[memory_start]
|
||||
mov ecx,edi
|
||||
sub ecx,edx
|
||||
call write
|
||||
jc write_failed
|
||||
call close
|
||||
ret
|
||||
setup_dump_header:
|
||||
xor eax,eax
|
||||
mov ecx,40h shr 2
|
||||
rep stos dword [edi]
|
||||
mov ebx,edi
|
||||
mov dword [ebx-40h],'fas'+1Ah shl 24
|
||||
mov dword [ebx-40h+4],VERSION_MAJOR + VERSION_MINOR shl 8 + 40h shl 16
|
||||
mov dword [ebx-40h+10h],40h
|
||||
ret
|
||||
prepare_preprocessed_source:
|
||||
mov esi,[memory_start]
|
||||
mov ebp,[source_start]
|
||||
test ebp,ebp
|
||||
jnz prepare_preprocessed_line
|
||||
mov ebp,[current_line]
|
||||
inc ebp
|
||||
prepare_preprocessed_line:
|
||||
cmp esi,ebp
|
||||
jae preprocessed_source_ok
|
||||
mov eax,[memory_start]
|
||||
mov edx,[input_file]
|
||||
cmp [esi],edx
|
||||
jne line_not_from_main_input
|
||||
mov [esi],eax
|
||||
line_not_from_main_input:
|
||||
sub [esi],eax
|
||||
test byte [esi+7],1 shl 7
|
||||
jz prepare_next_preprocessed_line
|
||||
sub [esi+8],eax
|
||||
sub [esi+12],eax
|
||||
prepare_next_preprocessed_line:
|
||||
call skip_preprocessed_line
|
||||
jmp prepare_preprocessed_line
|
||||
preprocessed_source_ok:
|
||||
ret
|
||||
skip_preprocessed_line:
|
||||
add esi,16
|
||||
skip_preprocessed_line_content:
|
||||
lods byte [esi]
|
||||
cmp al,1Ah
|
||||
je skip_preprocessed_symbol
|
||||
cmp al,3Bh
|
||||
je skip_preprocessed_symbol
|
||||
cmp al,22h
|
||||
je skip_preprocessed_string
|
||||
or al,al
|
||||
jnz skip_preprocessed_line_content
|
||||
ret
|
||||
skip_preprocessed_string:
|
||||
lods dword [esi]
|
||||
add esi,eax
|
||||
jmp skip_preprocessed_line_content
|
||||
skip_preprocessed_symbol:
|
||||
lods byte [esi]
|
||||
movzx eax,al
|
||||
add esi,eax
|
||||
jmp skip_preprocessed_line_content
|
||||
restore_preprocessed_source:
|
||||
mov esi,[memory_start]
|
||||
mov ebp,[source_start]
|
||||
test ebp,ebp
|
||||
jnz restore_preprocessed_line
|
||||
mov ebp,[current_line]
|
||||
inc ebp
|
||||
restore_preprocessed_line:
|
||||
cmp esi,ebp
|
||||
jae preprocessed_source_restored
|
||||
mov eax,[memory_start]
|
||||
add [esi],eax
|
||||
cmp [esi],eax
|
||||
jne preprocessed_line_source_restored
|
||||
mov edx,[input_file]
|
||||
mov [esi],edx
|
||||
preprocessed_line_source_restored:
|
||||
test byte [esi+7],1 shl 7
|
||||
jz restore_next_preprocessed_line
|
||||
add [esi+8],eax
|
||||
add [esi+12],eax
|
||||
restore_next_preprocessed_line:
|
||||
call skip_preprocessed_line
|
||||
jmp restore_preprocessed_line
|
||||
preprocessed_source_restored:
|
||||
ret
|
||||
dump_preprocessed_source:
|
||||
mov edi,[free_additional_memory]
|
||||
call setup_dump_header
|
||||
mov esi,[input_file]
|
||||
call copy_asciiz
|
||||
cmp edi,[additional_memory_end]
|
||||
jae out_of_memory
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
dec eax
|
||||
mov [ebx-40h+0Ch],eax
|
||||
mov eax,edi
|
||||
sub eax,ebx
|
||||
mov [ebx-40h+14h],eax
|
||||
add eax,40h
|
||||
mov [ebx-40h+20h],eax
|
||||
call prepare_preprocessed_source
|
||||
sub esi,[memory_start]
|
||||
mov [ebx-40h+24h],esi
|
||||
mov edx,[symbols_file]
|
||||
call create
|
||||
jc write_failed
|
||||
mov edx,[free_additional_memory]
|
||||
mov ecx,[edx+14h]
|
||||
add ecx,40h
|
||||
call write
|
||||
jc write_failed
|
||||
mov edx,[memory_start]
|
||||
mov ecx,esi
|
||||
call write
|
||||
jc write_failed
|
||||
call close
|
||||
ret
|
@@ -1,692 +0,0 @@
|
||||
; flat assembler
|
||||
; Copyright (c) 1999-2012, Tomasz Grysztar
|
||||
; All rights reserved.
|
||||
|
||||
struc FILEIO
|
||||
{ .cmd dd ?
|
||||
.offset dd ?
|
||||
dd ?
|
||||
.count dd ?
|
||||
.buff dd ?
|
||||
db ?
|
||||
.name dd ?
|
||||
};
|
||||
|
||||
struc FILEINFO
|
||||
{ .attr dd ?
|
||||
.flags dd ?
|
||||
.cr_time dd ?
|
||||
.cr_date dd ?
|
||||
.acc_time dd ?
|
||||
.acc_date dd ?
|
||||
.mod_time dd ?
|
||||
.mod_date dd ?
|
||||
.size dd ?
|
||||
}
|
||||
|
||||
|
||||
|
||||
;file_info_open: dd 0,0,0xffffff,0x20000,0xf0000
|
||||
fullpath_open: ; db '/RD/1/EXAMPLE.ASM'
|
||||
times MAX_PATH db 0
|
||||
|
||||
|
||||
;file_info_write: dd 1,0,0,0,0xf0000
|
||||
fullpath_write:; db '/RD/1/EXAMPLE'
|
||||
times MAX_PATH db 0
|
||||
|
||||
file_info_start:
|
||||
dd 7
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
fullpath_start: ; db '/RD/1/EXAMPLE'
|
||||
times MAX_PATH db 0
|
||||
|
||||
file_info_debug:
|
||||
dd 7
|
||||
dd 0
|
||||
dd fullpath_start
|
||||
dd 0, 0
|
||||
db '/SYS/DEVELOP/MTDBG',0
|
||||
|
||||
_ramdisk db '/RD/1/'
|
||||
filepos dd 0x0
|
||||
|
||||
|
||||
init_memory:
|
||||
|
||||
; mov ecx, 16*1024*1024
|
||||
;
|
||||
; allocate_memory:
|
||||
mcall 18, 16
|
||||
cmp eax, 0x38000000 shr 9
|
||||
jbe @f
|
||||
mov eax, 0x38000000 shr 9
|
||||
@@:
|
||||
shl eax, 9
|
||||
xchg eax, ecx
|
||||
mov [memory_setting],ecx
|
||||
mcall 68, 12
|
||||
or eax,eax
|
||||
jz out_of_memory
|
||||
mov [memblock], eax
|
||||
mov [additional_memory],eax
|
||||
add eax,[memory_setting]
|
||||
mov [memory_end],eax
|
||||
mov eax,[memory_setting]
|
||||
shr eax,2
|
||||
add eax,[additional_memory]
|
||||
mov [additional_memory_end],eax
|
||||
mov [memory_start],eax
|
||||
ret
|
||||
|
||||
exit_program:
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
mcall 68, 13, [memblock]
|
||||
jmp still
|
||||
@@:
|
||||
or eax,-1
|
||||
mcall
|
||||
|
||||
make_timestamp:
|
||||
push ebx
|
||||
mcall 26,9
|
||||
imul eax,10
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
symbol_dump:
|
||||
|
||||
push edi
|
||||
mov edx,[memory_end]
|
||||
symb_dump:
|
||||
cmp edx,[labels_list]
|
||||
jbe symbols_dumped
|
||||
sub edx,LABEL_STRUCTURE_SIZE
|
||||
cmp dword [edx+24],0
|
||||
je symb_dump ; do not dump anonymous symbols
|
||||
test byte [edx+8],1
|
||||
jz symb_dump ; do not dump symbols that didn't get defined
|
||||
mov ax,[current_pass]
|
||||
cmp ax,[edx+16]
|
||||
jne symb_dump
|
||||
test byte [edx+8],4 or 2
|
||||
jnz symb_dump ; do not dump assembly-time variables
|
||||
; do not dump variables defined with '='
|
||||
cmp word [edx+12], 0
|
||||
jnz symb_dump ; do not dump register-based variables
|
||||
|
||||
mov al, '0'
|
||||
stosb
|
||||
mov al, 'x'
|
||||
stosb
|
||||
mov eax, [edx+4]
|
||||
mov ecx, 8
|
||||
@@:
|
||||
rol eax, 4
|
||||
test al, 0xF
|
||||
loopz @b
|
||||
jz .nohigh
|
||||
inc ecx
|
||||
@@:
|
||||
push eax
|
||||
and al, 0xF
|
||||
cmp al, 10
|
||||
sbb al, 69h
|
||||
das
|
||||
stosb
|
||||
pop eax
|
||||
rol eax, 4
|
||||
loop @b
|
||||
mov eax, [edx]
|
||||
mov ecx, 8
|
||||
jmp .low
|
||||
.nohigh:
|
||||
mov eax, [edx]
|
||||
mov ecx, 8
|
||||
@@:
|
||||
rol eax, 4
|
||||
test al, 0xF
|
||||
loopz @b
|
||||
inc ecx
|
||||
.low:
|
||||
push eax
|
||||
and al, 0xF
|
||||
cmp al, 10
|
||||
sbb al, 69h
|
||||
das
|
||||
stosb
|
||||
pop eax
|
||||
rol eax, 4
|
||||
loop .low
|
||||
|
||||
mov al, ' '
|
||||
stosb
|
||||
|
||||
mov esi,[edx+24]
|
||||
movzx ecx,byte [esi-1]
|
||||
rep movsb
|
||||
|
||||
mov ax,0A0Dh
|
||||
stosw
|
||||
|
||||
jmp symb_dump
|
||||
|
||||
symbols_dumped:
|
||||
mov edx,dbgfilename
|
||||
push esi edi
|
||||
mov esi, outfile
|
||||
mov edi, edx
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al, al
|
||||
jnz @b
|
||||
lea ecx, [edi-1]
|
||||
@@:
|
||||
dec edi
|
||||
cmp edi, edx
|
||||
jb @f
|
||||
cmp byte [edi], '/'
|
||||
jz @f
|
||||
cmp byte [edi], '.'
|
||||
jnz @b
|
||||
mov ecx, edi
|
||||
@@:
|
||||
mov dword [ecx], '.dbg'
|
||||
mov byte [ecx+4], 0
|
||||
pop edi esi
|
||||
call create
|
||||
mov edx,[esp]
|
||||
mov ecx,edi
|
||||
sub ecx,edx
|
||||
call write
|
||||
call close
|
||||
pop edi
|
||||
|
||||
ret
|
||||
|
||||
get_environment_variable:
|
||||
mov ecx,[memory_end]
|
||||
sub ecx,edi
|
||||
cmp ecx,7
|
||||
jb out_of_memory
|
||||
cmp dword[esi],'INCL'
|
||||
jne .finish
|
||||
mov esi,_ramdisk
|
||||
mov ecx,6
|
||||
cld
|
||||
rep movsb
|
||||
.finish:
|
||||
; stc
|
||||
ret
|
||||
|
||||
alloc_handle:
|
||||
call make_fullpaths
|
||||
mov ebx, fileinfos+4
|
||||
@@:
|
||||
cmp dword [ebx], -1
|
||||
jz .found
|
||||
add ebx, 4+20+MAX_PATH
|
||||
cmp ebx, fileinfos_end
|
||||
jb @b
|
||||
stc
|
||||
ret
|
||||
.found:
|
||||
and dword [ebx+4], 0
|
||||
and dword [ebx+8], 0
|
||||
push esi edi ecx
|
||||
mov esi, fullpath_open
|
||||
lea edi, [ebx+20]
|
||||
mov ecx, MAX_PATH
|
||||
rep movsb
|
||||
pop ecx edi esi
|
||||
ret ; CF=0
|
||||
|
||||
create:
|
||||
call alloc_handle
|
||||
jc .ret
|
||||
and dword [ebx-4], 0
|
||||
mov dword [ebx], 2
|
||||
.ret:
|
||||
ret
|
||||
|
||||
|
||||
open:
|
||||
; call make_fullpaths
|
||||
|
||||
;; mov eax,fullpath_open
|
||||
;; DEBUGF '"%s"\n',eax
|
||||
|
||||
; mov dword[file_info_open+8],-1
|
||||
; mcall 58,file_info_open
|
||||
; or eax,eax ; found
|
||||
; jz @f
|
||||
; cmp eax,6
|
||||
; jne file_error
|
||||
;@@: mov [filesize],ebx
|
||||
; clc
|
||||
; ret
|
||||
;file_error:
|
||||
; stc
|
||||
; ret
|
||||
|
||||
call alloc_handle
|
||||
jc .ret
|
||||
mov dword [ebx], 5
|
||||
and dword [ebx+12], 0
|
||||
mov dword [ebx+16], fileinfo
|
||||
mov eax, 70
|
||||
push ebx
|
||||
mcall
|
||||
pop ebx
|
||||
test eax, eax
|
||||
jnz .fail
|
||||
mov eax, [fileinfo.size]
|
||||
mov [ebx-4], eax
|
||||
and dword [ebx], 0
|
||||
.ret:
|
||||
ret
|
||||
.fail:
|
||||
or dword [ebx], -1 ; close handle
|
||||
stc
|
||||
ret
|
||||
|
||||
read:
|
||||
; pusha
|
||||
; mov edi,edx
|
||||
; mov esi,[filepos]
|
||||
; add esi,0x20000
|
||||
; cld
|
||||
; rep movsb
|
||||
; popa
|
||||
;; ret
|
||||
|
||||
mov [ebx+12], ecx
|
||||
mov [ebx+16], edx
|
||||
push ebx
|
||||
mov eax, 70
|
||||
mcall
|
||||
xchg eax, [esp]
|
||||
add [eax+4], ebx
|
||||
adc [eax+8], dword 0
|
||||
mov ebx, eax
|
||||
pop eax
|
||||
test eax, eax
|
||||
jz .ok
|
||||
cmp eax, 6
|
||||
jz .ok
|
||||
stc
|
||||
.ok:
|
||||
ret
|
||||
|
||||
close:
|
||||
or dword [ebx], -1
|
||||
ret
|
||||
|
||||
|
||||
; ebx file handle
|
||||
; ecx count of bytes to write
|
||||
; edx pointer to buffer
|
||||
write:
|
||||
; pusha
|
||||
; mov [file_info_write+8],ecx
|
||||
; mov [file_info_write+12],edx
|
||||
; mov [filesize],edx
|
||||
; mov eax,58
|
||||
; mov ebx,file_info_write
|
||||
; mcall
|
||||
; popa
|
||||
; ret
|
||||
|
||||
mov [ebx+12], ecx
|
||||
mov [ebx+16], edx
|
||||
push ebx
|
||||
mov eax, 70
|
||||
mcall
|
||||
xchg eax, [esp]
|
||||
add [eax+4], ebx
|
||||
adc [eax+8], dword 0
|
||||
mov ebx, eax
|
||||
pop eax
|
||||
mov byte [ebx], 3
|
||||
cmp eax, 1
|
||||
cmc
|
||||
ret
|
||||
|
||||
make_fullpaths:
|
||||
pusha
|
||||
push edx
|
||||
|
||||
mov esi,path ; open
|
||||
; DEBUGF " '%s'",esi
|
||||
mov edi,fullpath_open
|
||||
cld
|
||||
newc1:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc1
|
||||
mov esi,[esp]
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_open
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
mov esi,path ; write
|
||||
mov edi,fullpath_write
|
||||
cld
|
||||
newc2:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc2
|
||||
mov esi,[esp]
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_write
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
mov esi,path ; start
|
||||
mov edi,fullpath_start
|
||||
cld
|
||||
newc3:
|
||||
movsb
|
||||
cmp byte[esi],0;' '
|
||||
jne newc3
|
||||
; mov esi,[esp]
|
||||
pop esi
|
||||
|
||||
cmp byte[esi],'/'
|
||||
jne @f
|
||||
mov edi,fullpath_start
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,0
|
||||
jne @b
|
||||
; mov ecx,12
|
||||
; cld
|
||||
; rep movsb
|
||||
; mov byte[edi],0
|
||||
|
||||
; add esp,4
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
|
||||
lseek:
|
||||
cmp al,0
|
||||
jnz @f
|
||||
and dword [ebx+4], 0
|
||||
and dword [ebx+8], 0
|
||||
@@: cmp al,2
|
||||
jnz @f
|
||||
mov eax, [ebx-4]
|
||||
mov [ebx+4], eax
|
||||
and dword [ebx+8], 0
|
||||
@@: add dword [ebx+4], edx
|
||||
adc dword [ebx+8], 0
|
||||
ret
|
||||
|
||||
display_character:
|
||||
pusha
|
||||
cmp [_mode],NORMAL_MODE
|
||||
jne @f
|
||||
cmp dl,13
|
||||
jz dc2
|
||||
cmp dl,0xa
|
||||
jnz dc1
|
||||
and [textxy],0x0000FFFF
|
||||
add [textxy], 7 shl 16 +53 and 0xFFFF0000 + 16
|
||||
dc2:
|
||||
popa
|
||||
ret
|
||||
dc1:
|
||||
mov eax,[textxy]
|
||||
cmp ax,word[bottom_right]
|
||||
ja dc2
|
||||
shr eax,16
|
||||
cmp ax,word[bottom_right+2]
|
||||
ja dc2
|
||||
mov [dc],dl
|
||||
mcall 4,[textxy],0x10000000,dc,1
|
||||
add [textxy],0x00080000
|
||||
popa
|
||||
ret
|
||||
@@:
|
||||
mov eax,63
|
||||
mov ebx,1
|
||||
mov cl,dl
|
||||
mcall
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
display_string:
|
||||
pusha
|
||||
@@:
|
||||
cmp byte[esi],0
|
||||
je @f
|
||||
mov dl,[esi]
|
||||
call display_character
|
||||
add esi,1
|
||||
jmp @b
|
||||
@@:
|
||||
popa
|
||||
ret
|
||||
|
||||
display_number:
|
||||
push ebx
|
||||
mov ecx,1000000000
|
||||
xor edx,edx
|
||||
xor bl,bl
|
||||
display_loop:
|
||||
div ecx
|
||||
push edx
|
||||
cmp ecx,1
|
||||
je display_digit
|
||||
or bl,bl
|
||||
jnz display_digit
|
||||
or al,al
|
||||
jz digit_ok
|
||||
not bl
|
||||
display_digit:
|
||||
mov dl,al
|
||||
add dl,30h
|
||||
push ebx ecx
|
||||
call display_character
|
||||
pop ecx ebx
|
||||
digit_ok:
|
||||
mov eax,ecx
|
||||
xor edx,edx
|
||||
mov ecx,10
|
||||
div ecx
|
||||
mov ecx,eax
|
||||
pop eax
|
||||
or ecx,ecx
|
||||
jnz display_loop
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
display_user_messages:
|
||||
; push [skinh]
|
||||
; pop [textxy]
|
||||
; add [textxy], 7 shl 16 +53
|
||||
mov [displayed_count],0
|
||||
call show_display_buffer
|
||||
cmp [displayed_count],1
|
||||
jb line_break_ok
|
||||
je make_line_break
|
||||
mov ax,word[last_displayed]
|
||||
cmp ax,0A0Dh
|
||||
je line_break_ok
|
||||
cmp ax,0D0Ah
|
||||
je line_break_ok
|
||||
make_line_break:
|
||||
mov esi,lf
|
||||
call display_string
|
||||
line_break_ok:
|
||||
ret
|
||||
|
||||
display_block:
|
||||
pusha
|
||||
@@: mov dl,[esi]
|
||||
call display_character
|
||||
inc esi
|
||||
loop @b
|
||||
popa
|
||||
ret
|
||||
|
||||
fatal_error:
|
||||
mov esi,error_prefix
|
||||
call display_string
|
||||
pop esi
|
||||
call display_string
|
||||
mov esi,error_suffix
|
||||
call display_string
|
||||
mov esi,lf
|
||||
call display_string
|
||||
mov al,0FFh
|
||||
jmp exit_program
|
||||
|
||||
assembler_error:
|
||||
call display_user_messages
|
||||
push dword 0
|
||||
mov ebx,[current_line]
|
||||
get_error_lines:
|
||||
push ebx
|
||||
test byte [ebx+7],80h
|
||||
jz display_error_line
|
||||
mov edx,ebx
|
||||
find_definition_origin:
|
||||
mov edx,[edx+12]
|
||||
test byte [edx+7],80h
|
||||
jnz find_definition_origin
|
||||
push edx
|
||||
mov ebx,[ebx+8]
|
||||
jmp get_error_lines
|
||||
display_error_line:
|
||||
mov esi,[ebx]
|
||||
call display_string
|
||||
mov esi,line_number_start
|
||||
call display_string
|
||||
mov eax,[ebx+4]
|
||||
and eax,7FFFFFFFh
|
||||
call display_number
|
||||
mov dl,']'
|
||||
call display_character
|
||||
pop esi
|
||||
cmp ebx,esi
|
||||
je line_number_ok
|
||||
mov dl,20h
|
||||
call display_character
|
||||
push esi
|
||||
mov esi,[esi]
|
||||
movzx ecx,byte [esi]
|
||||
inc esi
|
||||
call display_block
|
||||
mov esi,line_number_start
|
||||
call display_string
|
||||
pop esi
|
||||
mov eax,[esi+4]
|
||||
and eax,7FFFFFFFh
|
||||
call display_number
|
||||
mov dl,']'
|
||||
call display_character
|
||||
line_number_ok:
|
||||
mov esi,line_data_start
|
||||
call display_string
|
||||
mov esi,ebx
|
||||
mov edx,[esi]
|
||||
call open
|
||||
mov al,2
|
||||
xor edx,edx
|
||||
call lseek
|
||||
mov edx,[esi+8]
|
||||
sub eax,edx
|
||||
push eax
|
||||
xor al,al
|
||||
call lseek
|
||||
mov ecx,[esp]
|
||||
mov edx,[additional_memory]
|
||||
lea eax,[edx+ecx]
|
||||
cmp eax,[additional_memory_end]
|
||||
ja out_of_memory
|
||||
call read
|
||||
call close
|
||||
pop ecx
|
||||
mov esi,[additional_memory]
|
||||
get_line_data:
|
||||
mov al,[esi]
|
||||
cmp al,0Ah
|
||||
je display_line_data
|
||||
cmp al,0Dh
|
||||
je display_line_data
|
||||
cmp al,1Ah
|
||||
je display_line_data
|
||||
or al,al
|
||||
jz display_line_data
|
||||
inc esi
|
||||
loop get_line_data
|
||||
display_line_data:
|
||||
mov ecx,esi
|
||||
mov esi,[additional_memory]
|
||||
sub ecx,esi
|
||||
call display_block
|
||||
mov esi,cr_lf
|
||||
call display_string
|
||||
pop ebx
|
||||
or ebx,ebx
|
||||
jnz display_error_line
|
||||
mov esi,error_prefix
|
||||
call display_string
|
||||
pop esi
|
||||
call display_string
|
||||
mov esi,error_suffix
|
||||
call display_string
|
||||
jmp exit_program
|
||||
|
||||
align 4
|
||||
fileinfo FILEINFO
|
||||
|
||||
character db ?,0
|
||||
bytes_count dd ?
|
||||
|
||||
textxy dd 0x000500A0
|
||||
dc db 0x0
|
||||
filesize dd 0x0
|
||||
|
||||
displayed_count dd ?
|
||||
last_displayed rb 2
|
||||
|
||||
error_prefix db 'error: ',0
|
||||
error_suffix db '.',0
|
||||
line_data_start db ':'
|
||||
cr_lf db 0Dh,0Ah,0
|
||||
line_number_start db ' [',0
|
||||
|
||||
macro dm string { db string,0 }
|
@@ -1,155 +0,0 @@
|
||||
|
||||
; flat assembler core variables
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
||||
; Variables which have to be set up by interface:
|
||||
|
||||
memory_start dd ?
|
||||
memory_end dd ?
|
||||
|
||||
additional_memory dd ?
|
||||
additional_memory_end dd ?
|
||||
|
||||
stack_limit dd ?
|
||||
|
||||
initial_definitions dd ?
|
||||
input_file dd ?
|
||||
output_file dd ?
|
||||
symbols_file dd ?
|
||||
|
||||
passes_limit dw ?
|
||||
|
||||
; Internal core variables:
|
||||
|
||||
current_pass dw ?
|
||||
|
||||
include_paths dd ?
|
||||
free_additional_memory dd ?
|
||||
source_start dd ?
|
||||
code_start dd ?
|
||||
code_size dd ?
|
||||
real_code_size dd ?
|
||||
written_size dd ?
|
||||
headers_size dd ?
|
||||
|
||||
current_line dd ?
|
||||
macro_line dd ?
|
||||
macro_block dd ?
|
||||
macro_block_line dd ?
|
||||
macro_block_line_number dd ?
|
||||
macro_symbols dd ?
|
||||
struc_name dd ?
|
||||
struc_label dd ?
|
||||
instant_macro_start dd ?
|
||||
parameters_end dd ?
|
||||
default_argument_value dd ?
|
||||
locals_counter rb 8
|
||||
current_locals_prefix dd ?
|
||||
anonymous_reverse dd ?
|
||||
anonymous_forward dd ?
|
||||
labels_list dd ?
|
||||
label_hash dd ?
|
||||
label_leaf dd ?
|
||||
hash_tree dd ?
|
||||
addressing_space dd ?
|
||||
undefined_data_start dd ?
|
||||
undefined_data_end dd ?
|
||||
counter dd ?
|
||||
counter_limit dd ?
|
||||
error_info dd ?
|
||||
error_line dd ?
|
||||
error dd ?
|
||||
tagged_blocks dd ?
|
||||
structures_buffer dd ?
|
||||
number_start dd ?
|
||||
current_offset dd ?
|
||||
value dq ?
|
||||
fp_value rd 8
|
||||
adjustment dq ?
|
||||
symbol_identifier dd ?
|
||||
address_symbol dd ?
|
||||
address_high dd ?
|
||||
uncompressed_displacement dd ?
|
||||
format_flags dd ?
|
||||
resolver_flags dd ?
|
||||
symbols_stream dd ?
|
||||
number_of_relocations dd ?
|
||||
number_of_sections dd ?
|
||||
stub_size dd ?
|
||||
stub_file dd ?
|
||||
current_section dd ?
|
||||
machine dw ?
|
||||
subsystem dw ?
|
||||
subsystem_version dd ?
|
||||
image_base dd ?
|
||||
image_base_high dd ?
|
||||
resource_data dd ?
|
||||
resource_size dd ?
|
||||
actual_fixups_size dd ?
|
||||
reserved_fixups dd ?
|
||||
reserved_fixups_size dd ?
|
||||
last_fixup_base dd ?
|
||||
last_fixup_header dd ?
|
||||
parenthesis_stack dd ?
|
||||
blocks_stack dd ?
|
||||
parsed_lines dd ?
|
||||
logical_value_parentheses dd ?
|
||||
file_extension dd ?
|
||||
|
||||
operand_size db ?
|
||||
operand_flags db ?
|
||||
operand_prefix db ?
|
||||
rex_prefix db ?
|
||||
opcode_prefix db ?
|
||||
vex_required db ?
|
||||
vex_register db ?
|
||||
immediate_size db ?
|
||||
mask_register db ?
|
||||
broadcast_size db ?
|
||||
rounding_mode db ?
|
||||
|
||||
base_code db ?
|
||||
extended_code db ?
|
||||
supplemental_code db ?
|
||||
postbyte_register db ?
|
||||
segment_register db ?
|
||||
xop_opcode_map db ?
|
||||
|
||||
mmx_size db ?
|
||||
jump_type db ?
|
||||
push_size db ?
|
||||
value_size db ?
|
||||
address_size db ?
|
||||
label_size db ?
|
||||
size_declared db ?
|
||||
address_size_declared db ?
|
||||
displacement_compression db ?
|
||||
|
||||
value_undefined db ?
|
||||
value_constant db ?
|
||||
value_type db ?
|
||||
value_sign db ?
|
||||
fp_sign db ?
|
||||
fp_format db ?
|
||||
address_sign db ?
|
||||
address_register db ?
|
||||
compare_type db ?
|
||||
logical_value_wrapping db ?
|
||||
next_pass_needed db ?
|
||||
output_format db ?
|
||||
code_type db ?
|
||||
adjustment_sign db ?
|
||||
evex_mode db ?
|
||||
|
||||
macro_status db ?
|
||||
skip_default_argument_value db ?
|
||||
prefix_flags db ?
|
||||
formatter_symbols_allowed db ?
|
||||
decorator_symbols_allowed db ?
|
||||
free_address_range db ?
|
||||
|
||||
|
||||
characters rb 100h
|
||||
converted rb 100h
|
||||
message rb 200h
|
@@ -1,39 +0,0 @@
|
||||
|
||||
; flat assembler version 1.71
|
||||
; Copyright (c) 1999-2016, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
;
|
||||
; This programs is free for commercial and non-commercial use as long as
|
||||
; the following conditions are adhered to.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are
|
||||
; met:
|
||||
;
|
||||
; 1. Redistributions of source code must retain the above copyright notice,
|
||||
; this list of conditions and the following disclaimer.
|
||||
; 2. Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;
|
||||
; The licence and distribution terms for any publically available
|
||||
; version or derivative of this code cannot be changed. i.e. this code
|
||||
; cannot simply be copied and put under another distribution licence
|
||||
; (including the GNU Public Licence).
|
||||
|
||||
VERSION_STRING equ "1.71.54"
|
||||
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 71
|
@@ -1,401 +0,0 @@
|
||||
|
||||
Visit http://flatassembler.net/ for more information.
|
||||
|
||||
|
||||
version 1.71.16 (Oct 30, 2013)
|
||||
|
||||
[-] Fixed some bugs in the ELF executable formatter.
|
||||
|
||||
|
||||
version 1.71.15 (Oct 26, 2013)
|
||||
|
||||
[-] Fixed some bugs inadvertently introduced in the previous release.
|
||||
|
||||
|
||||
version 1.71.14 (Oct 25, 2013)
|
||||
|
||||
[+] Added "postpone" directive to preprocessor.
|
||||
|
||||
|
||||
version 1.71.13 (Sep 09, 2013)
|
||||
|
||||
[-] Fixed a bug that caused the expressions containing external symbols
|
||||
to overflow from time to time.
|
||||
|
||||
|
||||
version 1.71.12 (Aug 04, 2013)
|
||||
|
||||
[-] Expressions in square brackets were incorrectly treated as valid numerical
|
||||
values when used in some logical expressions.
|
||||
|
||||
[-] A previous fix to "store" directive did not apply to all the cases when it
|
||||
was incorrectly leaving the data marked as uninitialized. The new fix
|
||||
addresses this issue.
|
||||
|
||||
|
||||
version 1.71.11 (Jul 09, 2013)
|
||||
|
||||
[-] Modifying a value in uninitialized data block with "store" directive will
|
||||
now correctly mark this data as initialized when it is in a different
|
||||
addressing space.
|
||||
|
||||
[-] Missing quote will no longer cause the symbols generator to hang or crash.
|
||||
|
||||
[-] Address range restrictions for addressing modes no longer apply to addresses
|
||||
provided to assembler directives like "label", "virtual" or "load".
|
||||
|
||||
|
||||
version 1.71.10 (Apr 03, 2013)
|
||||
|
||||
[-] Fixed a crashing "heap" directive in 64-bit PE format.
|
||||
|
||||
|
||||
version 1.71.09 (Mar 30, 2013)
|
||||
|
||||
[-] "use16","use32" and "use64" no longer allow to put another instruction in
|
||||
the same line.
|
||||
|
||||
[-] Fixed a bug in parser that caused it to hang while processing some
|
||||
specific ill-structured preprocessed lines.
|
||||
|
||||
[-] Modified memory allocation algorithm on Windows machines with large RAM.
|
||||
|
||||
|
||||
version 1.71.08 (Mar 08, 2013)
|
||||
|
||||
[-] Fixed a bug that caused "irp" to skip processing a list with one empty
|
||||
element when default value for iterating variable was specified.
|
||||
|
||||
|
||||
version 1.71.07 (Dec 23, 2012)
|
||||
|
||||
[-] Fixed a bug that was causing "used" operator to give incorrect results
|
||||
in some very specific cases.
|
||||
|
||||
|
||||
version 1.71.06 (Nov 22, 2012)
|
||||
|
||||
[-] Fixed a few bugs caused by unnecesarily strong restrictions on allowed
|
||||
types of relocatable values in some places (like "label" directive).
|
||||
|
||||
|
||||
version 1.71.05 (Oct 15, 2012)
|
||||
|
||||
[-] Fixed a bug which caused "load" and "store" directives to sometimes
|
||||
fail when assembler had preallocated very large amount of memory.
|
||||
|
||||
|
||||
version 1.71.04 (Oct 10, 2012)
|
||||
|
||||
[-] Fixed another bug in "org" directive, which was causing it to deal
|
||||
incorrectly with negative addresses.
|
||||
|
||||
|
||||
version 1.71.03 (Sep 27, 2012)
|
||||
|
||||
[-] Fixed a bug in "org" directive introduced by recent changes, which
|
||||
was manifesting with bases larger than 31-bit.
|
||||
|
||||
|
||||
version 1.71.02 (Sep 26, 2012)
|
||||
|
||||
[-] Expression calculator now allows to calculate the difference of
|
||||
relocatable addresses in a reverse order (first substracting/negating
|
||||
and then adding the other one).
|
||||
|
||||
|
||||
version 1.71.01 (Sep 23, 2012)
|
||||
|
||||
[+] Added support for ADX, RDSEED and SMAP instruction sets.
|
||||
|
||||
[-] Fixed the bugs related to creating a new addressing space inside the
|
||||
virtual block with "org" directive.
|
||||
|
||||
|
||||
version 1.71.00 (Sep 21, 2012)
|
||||
|
||||
[+] Added ability to define a special kind of label identifying the
|
||||
addressing space. This label can the be used with "load" or "store"
|
||||
directives to allow operations on bytes in any addressing space,
|
||||
not just the current one. This special label is defined by following
|
||||
its name with double colon, and can only be used with "load" and
|
||||
"store" directive, where address can now be specified in two parts,
|
||||
first the adressing space label, then the colon and then the
|
||||
address inside that addressing space.
|
||||
|
||||
|
||||
version 1.70.03 (Jun 29, 2012)
|
||||
|
||||
[-] Allowed to freely upgrade or downgrade the relocatable addresses in
|
||||
object format between the 32-bit or 64-bit size.
|
||||
|
||||
|
||||
version 1.70.02 (May 22, 2012)
|
||||
|
||||
[-] Corrected the optimization of segment prefixes when the extended syntax
|
||||
of some string instructions ("cmps", "lods", "movs" and "outs") is
|
||||
used in long mode. Now it is consistent with optimizations done with
|
||||
all the other instructions.
|
||||
|
||||
|
||||
version 1.70.01 (Apr 30, 2012)
|
||||
|
||||
[-] Corrected a recently introduced bug that caused some illegal
|
||||
address expressions to cause an error prematurely during the
|
||||
parsing stage.
|
||||
|
||||
|
||||
version 1.70 (Apr 17, 2012)
|
||||
|
||||
[+] Added support for AVX, AVX2, AES, CLMUL, FMA, RDRAND, FSGSBASE, F16C,
|
||||
FMA4, XOP, MOVBE, BMI, TBM, INVPCID, HLE and RTM instruction sets.
|
||||
|
||||
[+] Added half-precision floating point values support.
|
||||
|
||||
[+] Extended the syntax of "rept" directive to allow numerical expressions
|
||||
to be calculated by preprocessor in its arguments.
|
||||
|
||||
[+] Added "large" and "NX" settings for PE format.
|
||||
|
||||
[+] Allowed PE fixups to be resolved anywhere in the generated executable.
|
||||
|
||||
[+] Allowed to specify branding value (use 3 for Linux) after the
|
||||
"format ELF executable" setting.
|
||||
|
||||
[+] Added "intepreter", "dynamic" and "note" keywords for creation of
|
||||
special segments in ELF executables.
|
||||
|
||||
[-] Fixed long mode opcode generator to allow absolute addresses to be
|
||||
generated with "qword" keyword inside square brackets.
|
||||
|
||||
[-] Disallowed negative immediates with "int", "enter", "ret" instructions.
|
||||
|
||||
[+] Allowed symbolic information dump file to be created even in case of error.
|
||||
In such case it contains only the preprocessed source that can be extracted
|
||||
with PREPSRC tool. If error occured during preprocessing, only the source up
|
||||
to the point of error is provided.
|
||||
|
||||
[+] Added symbol references table to symbolic dump file.
|
||||
|
||||
[-] Corrected the "defined" and "used" flags in the symbols dump to reflect the
|
||||
state from the final assembly pass.
|
||||
|
||||
[+] Added "assert" directive.
|
||||
|
||||
[-] Formatter symbols like "PE" or "readable" are now recognized only in the
|
||||
context of formatter directives, and thus are no longer disallowed as
|
||||
labels.
|
||||
|
||||
[+] Macroinstruction argument now can have default value, defined with "="
|
||||
symbol followed by value after the argument name in definition.
|
||||
|
||||
[+] Added "relativeto" operator, which can be used in logical expressions
|
||||
to test whether two values differ only by a constant and not relocatable
|
||||
amount.
|
||||
|
||||
[-] Revised the expression calculator, it now is able to correctly perform
|
||||
calculations in signed and unsigned ranges in full 64-bit. This fixes
|
||||
a number of issues - the overflow will now be correctly detected for
|
||||
64-bit values in cases, where previous versions could not distinguish
|
||||
whether it was an overflow or not. The effect of these corrections is
|
||||
that "dq" directive will now behave consistently with behavior of the
|
||||
data directives for smaller sizes, and the same applies to all the
|
||||
places where "qword" size for value is used.
|
||||
|
||||
|
||||
version 1.68 (Jun 13, 2009)
|
||||
|
||||
[+] Added SSSE3 (Supplemental SSE3), SSE4.1, SSE4.2 and SSE4a instructions.
|
||||
|
||||
[+] Added the AMD SVM and Intel SMX instructions.
|
||||
|
||||
[+] Added "rdmsrq", "wrmsrq", "sysexitq" and "sysretq" mnemonics for the
|
||||
64-bit variants of respective instructions.
|
||||
|
||||
[+] Added "fstenvw", "fstenvd", "fsavew", "fsaved", "frstorw" and "frstord"
|
||||
mnemonics to allow choosing between 16-bit and 32-bit variants of
|
||||
structures used by the "fstenv", "fsave" and "frstor" instructions.
|
||||
|
||||
[+] Added "plt" operator for the ELF output format.
|
||||
|
||||
[+] Allowed "rva" operator to be used in MS COFF object format, and also
|
||||
added "static" keyword for the "public" directive.
|
||||
|
||||
[+] Added Intel-style aliases for the additional long mode 8-bit registers.
|
||||
|
||||
[-] The PE formatter now automatically detects whether relocatable labels
|
||||
should be used, depending on whether the fixups directory is placed
|
||||
somewhere into executable by programer, or not. This makes possible the
|
||||
more flexible use of the addressing symbols in case of PE executable fixed
|
||||
at some position.
|
||||
|
||||
[-] Added support for outputting the 32-bit address relocations in case of
|
||||
64-bit object formats and PE executable. This makes some specific
|
||||
instructions compilable, but it also forces linker to put such
|
||||
generated code into the low 2 gigabytes of addressing space.
|
||||
|
||||
[+] Added "EFI", "EFIboot" and "EFIruntime" subsystem keywords for PE format.
|
||||
|
||||
[-] Corrected the precedence of operators of macroinstruction line maker.
|
||||
The symbol escaping now has always the higher priority than symbol conversion,
|
||||
and both have higher precedence than concatenation.
|
||||
|
||||
[+] Allowed to check "@b" and "@f" symbols with "defined" operator.
|
||||
|
||||
[+] Allowed "as" operator to specify the output file extension when
|
||||
placed at the end of the "format" directive line.
|
||||
|
||||
[-] Definition of macro with the same name as one of the preprocessor's directives
|
||||
is no longer allowed.
|
||||
|
||||
[+] Allowed single quote character to be put inside the number value,
|
||||
to help improve long numbers readability.
|
||||
|
||||
[+] Added optional symbolic information output, and a set of tools that extract
|
||||
various kinds of information from it.
|
||||
|
||||
[+] Added "err" directive that allows to signalize error from the source.
|
||||
|
||||
|
||||
version 1.66 (May 7, 2006)
|
||||
|
||||
[+] Added "define" directive to preprocessor, which defines symbolic constants,
|
||||
the same kind as "equ" directive, however there's an important difference
|
||||
that "define" doesn't process symbolic constants in the value before
|
||||
assigning it. For example:
|
||||
|
||||
a equ 1
|
||||
a equ a+a
|
||||
|
||||
define b 1
|
||||
define b b+b
|
||||
|
||||
defines the "a" constant with value "1+1", but the "b" is defined with
|
||||
value "b+b". This directive may be useful in some advanced
|
||||
macroinstructions.
|
||||
|
||||
[-] Moved part of the conditional expression processing into parser,
|
||||
for slightly better performance and lesser memory usage by assembler.
|
||||
The logical values defined with "eq", "eqtype" and "in" operators are now
|
||||
evaluated by the parser and if they are enough to determine the condition,
|
||||
the whole block is processed accordingly. Thus this block:
|
||||
|
||||
if eax eq EAX | 0/0
|
||||
nop
|
||||
end if
|
||||
|
||||
is parsed into just "nop" instruction, since parser is able to determine
|
||||
that the condition is true, even though one of the logical values makes no
|
||||
sense - but since this is none of the "eq", "eqtype" and "in" expressions,
|
||||
the parser doesn't investigate.
|
||||
|
||||
[-] Also the assembler is now calculating only as many logical values as it
|
||||
needs to determine the condition. So this block:
|
||||
|
||||
if defined alpha & alpha
|
||||
|
||||
end if
|
||||
|
||||
will not cause error when "alpha" is not defined, as it would with previous
|
||||
versions. This is because after checking that "defined alpha" is false
|
||||
condition it doesn't need to know the second logical value to determine the
|
||||
value of conjunction.
|
||||
|
||||
[+] Added "short" keyword for specifying jump type, the "jmp byte" form is now
|
||||
obsolete and no longer correct - use "jmp short" instead.
|
||||
|
||||
[-] The size operator applied to jump no longer applies to the size of relative
|
||||
displacement - now it applies to the size of target address.
|
||||
|
||||
[-] The "ret" instruction with 0 parameter is now assembled into short form,
|
||||
unless you force using the 16-bit immediate with "word" operator.
|
||||
|
||||
[+] Added missing extended registers for the 32-bit addressing in long mode.
|
||||
|
||||
[+] Added "linkremove" and "linkinfo" section flags for MS COFF output.
|
||||
|
||||
[+] Added support for GOT offsets in ELF object formatter, which can be useful
|
||||
when making position-independent code for shared libraries. For any label
|
||||
you can get its offset relative to GOT by preceding it with "rva" operator
|
||||
(the same keyword as for PE format is used, to avoid adding a new one,
|
||||
while this one has very similar meaning).
|
||||
|
||||
[-] Changed ELF executable to use "segment" directive in place of "section",
|
||||
to make the distinction between the run-time segments and linkable
|
||||
sections. If you had a "section" directive in your ELF executables and they
|
||||
no longer assemble, replace it with "segment".
|
||||
|
||||
[-] The PE formatter now always creates the fixups directory when told to -
|
||||
even when there are no fixups to be put there (in such case it creates the
|
||||
directory with one empty block).
|
||||
|
||||
[-] Some of the internal structures have been extended to provide the
|
||||
possibility of making extensive symbol dumps.
|
||||
|
||||
[-] Corrected "fix" directive to keep the value intact before assigning it to the
|
||||
prioritized constant.
|
||||
|
||||
[+] The ` operator now works with any kind of symbol; when used with quoted
|
||||
string it simply does nothing. Thus the sequence of ` operators applied to
|
||||
one symbol work the same as if there was just one. In similar manner, the
|
||||
sequence of # operators now works as if it was a single one - using such a
|
||||
sequence instead of escaping, which was kept for some backward
|
||||
compatibility, is now deprecated.
|
||||
|
||||
[-] Corrected order of identifying assembler directives ("if db eq db" was
|
||||
incorrectly interpreted as data definition).
|
||||
|
||||
[-] Many other small bugs fixed.
|
||||
|
||||
|
||||
version 1.64 (Aug 8, 2005)
|
||||
|
||||
[+] Output of PE executables for Win64 architecture (with "format PE64"
|
||||
setting).
|
||||
|
||||
[+] Added "while" and "break" directives.
|
||||
|
||||
[+] Added "irp" and "irps" directives.
|
||||
|
||||
[+] The macro arguments can be marked as required with the "*" character.
|
||||
|
||||
[-] Fixed checking for overflow when multiplying 64-bit values - the result
|
||||
must always fit in the range of signed 64 integer now.
|
||||
|
||||
[-] Segment prefixes were generated incorrectly in 16-bit mode when BP was used
|
||||
as a second addressing register - fixed.
|
||||
|
||||
[-] The "local" directive was not creating unique labels in some cases - fixed.
|
||||
|
||||
[-] The "not encodable with long immediate" error in 64-bit mode was sometimes
|
||||
wrongly signaled - fixed.
|
||||
|
||||
[-] Other minor fixes and corrections.
|
||||
|
||||
|
||||
version 1.62 (Jun 14, 2005)
|
||||
|
||||
[+] Escaping of symbols inside macroinstructions with backslash.
|
||||
|
||||
[+] Ability of outputting the COFF object files for Win64 architecture
|
||||
(with "format MS64 COFF" setting).
|
||||
|
||||
[+] New preprocessor directives: "restruc", "rept" and "match"
|
||||
|
||||
[+] VMX instructions support (not documented).
|
||||
|
||||
[+] Extended data directives to allow use of the "dup" operator.
|
||||
|
||||
[+] Extended "struc" features to allow custom definitions of main structure's
|
||||
label.
|
||||
|
||||
[-] When building resources from the the .RES file that contained more
|
||||
than one resource of the same string name, the separate resource
|
||||
directories were created with the same names - fixed.
|
||||
|
||||
[-] Several bugs in the ELF64 object output has been fixed.
|
||||
|
||||
[-] Corrected behavior of "fix" directive to more straightforward.
|
||||
|
||||
[-] Fixed bug in "include" directive, which caused files included from within
|
||||
macros to be processed the wrong way.
|
@@ -23,12 +23,6 @@ macro matr_cell c_funct,c_param,funct,param, dia
|
||||
dia dword[esp-4*(c_param*(c_funct-funct)+(1+c_param-param))]
|
||||
}
|
||||
|
||||
;Macro for double type parameters (8 bytes)
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, library_path, system_path, import_tinygl
|
||||
@@ -901,22 +895,8 @@ endp
|
||||
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_tinygl:
|
||||
include '../import.inc'
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
n dd sz_#n
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
sz_#n db `n,0
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
;--------------------------------------------------
|
||||
|
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Test 3 - example of drawing triangles
|
||||
; Copyright (C) 2014-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -8,13 +12,14 @@ include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../kosgl.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@use_library
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, library_path, system_path, import_lib_tinygl
|
||||
load_library name_tgl, library_path, system_path, import_tinygl
|
||||
cmp eax,SF_TERMINATE_PROCESS
|
||||
jz button.exit
|
||||
|
||||
@@ -34,11 +39,11 @@ red_win:
|
||||
align 16
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,2
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,3
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
jmp still
|
||||
|
||||
@@ -99,7 +104,7 @@ caption db 'Test tinygl library, [Esc] - exit, [<-] and [->] - rotate',0
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;clear the color and depth buffer
|
||||
|
||||
call [glPushMatrix]
|
||||
stdcall [glRotatef], [angle_z],0.0,0.0,1.0
|
||||
@@ -136,30 +141,15 @@ angle_z dd 15.0
|
||||
delt_size dd 3.0
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
include '../import.inc' ;tinygl
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
n dd sz_#n
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
sz_#n db `n,0
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 rb 28 ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 1024
|
||||
|
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; Test array1 - example of using vertex array functions
|
||||
; Copyright (C) 2014-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -8,6 +12,7 @@ include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../kosgl.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@use_library
|
||||
@@ -191,29 +196,15 @@ align 4
|
||||
Indices rb FACES_COUNT*6 ;3 points per edge, point index 2 bytes
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_tinygl:
|
||||
include '../import.inc' ;tinygl
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
n dd sz_#n
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
sz_#n db `n,0
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
ctx1 TinyGLContext
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 4096
|
||||
|
@@ -490,127 +490,9 @@ white_light dd 0.8, 0.8, 0.8, 1.0 ; Цвет и интенсивность ос
|
||||
lmodel_ambient dd 0.2, 0.2, 0.2, 1.0 ; Параметры фонового освещения
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
align 4
|
||||
import_buf2d:
|
||||
dd sz_init0
|
||||
buf2d_create dd sz_buf2d_create
|
||||
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||
buf2d_clear dd sz_buf2d_clear
|
||||
buf2d_draw dd sz_buf2d_draw
|
||||
buf2d_delete dd sz_buf2d_delete
|
||||
buf2d_resize dd sz_buf2d_resize
|
||||
buf2d_line dd sz_buf2d_line
|
||||
buf2d_rect_by_size dd sz_buf2d_rect_by_size
|
||||
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
|
||||
buf2d_circle dd sz_buf2d_circle
|
||||
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
|
||||
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
|
||||
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
|
||||
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
|
||||
buf2d_bit_blt dd sz_buf2d_bit_blt
|
||||
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
|
||||
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
|
||||
buf2d_curve_bezier dd sz_buf2d_curve_bezier
|
||||
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
|
||||
buf2d_draw_text dd sz_buf2d_draw_text
|
||||
buf2d_crop_color dd sz_buf2d_crop_color
|
||||
buf2d_offset_h dd sz_buf2d_offset_h
|
||||
buf2d_flood_fill dd sz_buf2d_flood_fill
|
||||
buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||
dd 0,0
|
||||
sz_init0 db 'lib_init',0
|
||||
sz_buf2d_create db 'buf2d_create',0
|
||||
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||
sz_buf2d_clear db 'buf2d_clear',0
|
||||
sz_buf2d_draw db 'buf2d_draw',0
|
||||
sz_buf2d_delete db 'buf2d_delete',0
|
||||
sz_buf2d_resize db 'buf2d_resize',0
|
||||
sz_buf2d_line db 'buf2d_line',0
|
||||
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
|
||||
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
|
||||
sz_buf2d_circle db 'buf2d_circle',0
|
||||
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
|
||||
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
|
||||
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
|
||||
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
|
||||
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
|
||||
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
|
||||
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
|
||||
sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
|
||||
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
|
||||
sz_buf2d_draw_text db 'buf2d_draw_text',0
|
||||
sz_buf2d_crop_color db 'buf2d_crop_color',0
|
||||
sz_buf2d_offset_h db 'buf2d_offset_h',0
|
||||
sz_buf2d_flood_fill db 'buf2d_flood_fill',0
|
||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
; img_is_img dd aimg_is_img
|
||||
; img_info dd aimg_info
|
||||
; img_from_file dd aimg_from_file
|
||||
; img_to_file dd aimg_to_file
|
||||
; img_from_rgb dd aimg_from_rgb
|
||||
; img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
; img_encode dd aimg_encode
|
||||
; img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
; img_destroy_layer dd aimg_destroy_layer
|
||||
; img_count dd aimg_count
|
||||
; img_lock_bits dd aimg_lock_bits
|
||||
; img_unlock_bits dd aimg_unlock_bits
|
||||
; img_flip dd aimg_flip
|
||||
; img_flip_layer dd aimg_flip_layer
|
||||
; img_rotate dd aimg_rotate
|
||||
; img_rotate_layer dd aimg_rotate_layer
|
||||
; img_draw dd aimg_draw
|
||||
; img_convert dd aimg_convert
|
||||
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение
|
||||
; aimg_info db 'img_info',0
|
||||
; aimg_from_file db 'img_from_file',0
|
||||
; aimg_to_file db 'img_to_file',0
|
||||
; aimg_from_rgb db 'img_from_rgb',0
|
||||
; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных
|
||||
; aimg_encode db 'img_encode',0
|
||||
; aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
; aimg_destroy_layer db 'img_destroy_layer',0
|
||||
; aimg_count db 'img_count',0
|
||||
; aimg_lock_bits db 'img_lock_bits',0
|
||||
; aimg_unlock_bits db 'img_unlock_bits',0
|
||||
; aimg_flip db 'img_flip',0
|
||||
; aimg_flip_layer db 'img_flip_layer',0
|
||||
; aimg_rotate db 'img_rotate',0
|
||||
; aimg_rotate_layer db 'img_rotate_layer',0
|
||||
; aimg_draw db 'img_draw',0
|
||||
; aimg_convert db 'img_convert',0
|
||||
include '../import.inc' ;tinygl
|
||||
include '../../../buf2d/import.inc'
|
||||
include '../../../libs-dev/libimg/import.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_dir_0 db '/sys/lib/'
|
||||
|
@@ -473,127 +473,9 @@ white_light dd 0.8, 0.8, 0.8, 1.0 ; Цвет и интенсивность ос
|
||||
lmodel_ambient dd 0.2, 0.2, 0.2, 1.0 ; Параметры фонового освещения
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
align 4
|
||||
import_buf2d:
|
||||
dd sz_init0
|
||||
buf2d_create dd sz_buf2d_create
|
||||
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||
buf2d_clear dd sz_buf2d_clear
|
||||
buf2d_draw dd sz_buf2d_draw
|
||||
buf2d_delete dd sz_buf2d_delete
|
||||
buf2d_resize dd sz_buf2d_resize
|
||||
buf2d_line dd sz_buf2d_line
|
||||
buf2d_rect_by_size dd sz_buf2d_rect_by_size
|
||||
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
|
||||
buf2d_circle dd sz_buf2d_circle
|
||||
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
|
||||
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
|
||||
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
|
||||
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
|
||||
buf2d_bit_blt dd sz_buf2d_bit_blt
|
||||
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
|
||||
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
|
||||
buf2d_curve_bezier dd sz_buf2d_curve_bezier
|
||||
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
|
||||
buf2d_draw_text dd sz_buf2d_draw_text
|
||||
buf2d_crop_color dd sz_buf2d_crop_color
|
||||
buf2d_offset_h dd sz_buf2d_offset_h
|
||||
buf2d_flood_fill dd sz_buf2d_flood_fill
|
||||
buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||
dd 0,0
|
||||
sz_init0 db 'lib_init',0
|
||||
sz_buf2d_create db 'buf2d_create',0
|
||||
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||
sz_buf2d_clear db 'buf2d_clear',0
|
||||
sz_buf2d_draw db 'buf2d_draw',0
|
||||
sz_buf2d_delete db 'buf2d_delete',0
|
||||
sz_buf2d_resize db 'buf2d_resize',0
|
||||
sz_buf2d_line db 'buf2d_line',0
|
||||
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
|
||||
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
|
||||
sz_buf2d_circle db 'buf2d_circle',0
|
||||
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
|
||||
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
|
||||
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
|
||||
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
|
||||
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
|
||||
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
|
||||
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
|
||||
sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
|
||||
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
|
||||
sz_buf2d_draw_text db 'buf2d_draw_text',0
|
||||
sz_buf2d_crop_color db 'buf2d_crop_color',0
|
||||
sz_buf2d_offset_h db 'buf2d_offset_h',0
|
||||
sz_buf2d_flood_fill db 'buf2d_flood_fill',0
|
||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
; img_is_img dd aimg_is_img
|
||||
; img_info dd aimg_info
|
||||
; img_from_file dd aimg_from_file
|
||||
; img_to_file dd aimg_to_file
|
||||
; img_from_rgb dd aimg_from_rgb
|
||||
; img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
; img_encode dd aimg_encode
|
||||
; img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
; img_destroy_layer dd aimg_destroy_layer
|
||||
; img_count dd aimg_count
|
||||
; img_lock_bits dd aimg_lock_bits
|
||||
; img_unlock_bits dd aimg_unlock_bits
|
||||
; img_flip dd aimg_flip
|
||||
; img_flip_layer dd aimg_flip_layer
|
||||
; img_rotate dd aimg_rotate
|
||||
; img_rotate_layer dd aimg_rotate_layer
|
||||
; img_draw dd aimg_draw
|
||||
; img_convert dd aimg_convert
|
||||
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение
|
||||
; aimg_info db 'img_info',0
|
||||
; aimg_from_file db 'img_from_file',0
|
||||
; aimg_to_file db 'img_to_file',0
|
||||
; aimg_from_rgb db 'img_from_rgb',0
|
||||
; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных
|
||||
; aimg_encode db 'img_encode',0
|
||||
; aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
; aimg_destroy_layer db 'img_destroy_layer',0
|
||||
; aimg_count db 'img_count',0
|
||||
; aimg_lock_bits db 'img_lock_bits',0
|
||||
; aimg_unlock_bits db 'img_unlock_bits',0
|
||||
; aimg_flip db 'img_flip',0
|
||||
; aimg_flip_layer db 'img_flip_layer',0
|
||||
; aimg_rotate db 'img_rotate',0
|
||||
; aimg_rotate_layer db 'img_rotate_layer',0
|
||||
; aimg_draw db 'img_draw',0
|
||||
; aimg_convert db 'img_convert',0
|
||||
include '../import.inc' ;tinygl
|
||||
include '../../../buf2d/import.inc'
|
||||
include '../../../libs-dev/libimg/import.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_dir_0 db '/sys/lib/'
|
||||
|
@@ -433,127 +433,9 @@ white_light dd 0.8, 0.8, 0.8, 1.0 ; Цвет и интенсивность ос
|
||||
lmodel_ambient dd 0.2, 0.2, 0.2, 1.0 ; Параметры фонового освещения
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
align 4
|
||||
import_buf2d:
|
||||
dd sz_init0
|
||||
buf2d_create dd sz_buf2d_create
|
||||
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||
buf2d_clear dd sz_buf2d_clear
|
||||
buf2d_draw dd sz_buf2d_draw
|
||||
buf2d_delete dd sz_buf2d_delete
|
||||
buf2d_resize dd sz_buf2d_resize
|
||||
buf2d_line dd sz_buf2d_line
|
||||
buf2d_rect_by_size dd sz_buf2d_rect_by_size
|
||||
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
|
||||
buf2d_circle dd sz_buf2d_circle
|
||||
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
|
||||
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
|
||||
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
|
||||
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
|
||||
buf2d_bit_blt dd sz_buf2d_bit_blt
|
||||
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
|
||||
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
|
||||
buf2d_curve_bezier dd sz_buf2d_curve_bezier
|
||||
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
|
||||
buf2d_draw_text dd sz_buf2d_draw_text
|
||||
buf2d_crop_color dd sz_buf2d_crop_color
|
||||
buf2d_offset_h dd sz_buf2d_offset_h
|
||||
buf2d_flood_fill dd sz_buf2d_flood_fill
|
||||
buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||
dd 0,0
|
||||
sz_init0 db 'lib_init',0
|
||||
sz_buf2d_create db 'buf2d_create',0
|
||||
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||
sz_buf2d_clear db 'buf2d_clear',0
|
||||
sz_buf2d_draw db 'buf2d_draw',0
|
||||
sz_buf2d_delete db 'buf2d_delete',0
|
||||
sz_buf2d_resize db 'buf2d_resize',0
|
||||
sz_buf2d_line db 'buf2d_line',0
|
||||
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
|
||||
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
|
||||
sz_buf2d_circle db 'buf2d_circle',0
|
||||
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
|
||||
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
|
||||
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
|
||||
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
|
||||
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
|
||||
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
|
||||
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
|
||||
sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
|
||||
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
|
||||
sz_buf2d_draw_text db 'buf2d_draw_text',0
|
||||
sz_buf2d_crop_color db 'buf2d_crop_color',0
|
||||
sz_buf2d_offset_h db 'buf2d_offset_h',0
|
||||
sz_buf2d_flood_fill db 'buf2d_flood_fill',0
|
||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
; img_is_img dd aimg_is_img
|
||||
; img_info dd aimg_info
|
||||
; img_from_file dd aimg_from_file
|
||||
; img_to_file dd aimg_to_file
|
||||
; img_from_rgb dd aimg_from_rgb
|
||||
; img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
; img_encode dd aimg_encode
|
||||
; img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
; img_destroy_layer dd aimg_destroy_layer
|
||||
; img_count dd aimg_count
|
||||
; img_lock_bits dd aimg_lock_bits
|
||||
; img_unlock_bits dd aimg_unlock_bits
|
||||
; img_flip dd aimg_flip
|
||||
; img_flip_layer dd aimg_flip_layer
|
||||
; img_rotate dd aimg_rotate
|
||||
; img_rotate_layer dd aimg_rotate_layer
|
||||
; img_draw dd aimg_draw
|
||||
; img_convert dd aimg_convert
|
||||
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение
|
||||
; aimg_info db 'img_info',0
|
||||
; aimg_from_file db 'img_from_file',0
|
||||
; aimg_to_file db 'img_to_file',0
|
||||
; aimg_from_rgb db 'img_from_rgb',0
|
||||
; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных
|
||||
; aimg_encode db 'img_encode',0
|
||||
; aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
; aimg_destroy_layer db 'img_destroy_layer',0
|
||||
; aimg_count db 'img_count',0
|
||||
; aimg_lock_bits db 'img_lock_bits',0
|
||||
; aimg_unlock_bits db 'img_unlock_bits',0
|
||||
; aimg_flip db 'img_flip',0
|
||||
; aimg_flip_layer db 'img_flip_layer',0
|
||||
; aimg_rotate db 'img_rotate',0
|
||||
; aimg_rotate_layer db 'img_rotate_layer',0
|
||||
; aimg_draw db 'img_draw',0
|
||||
; aimg_convert db 'img_convert',0
|
||||
include '../import.inc' ;tinygl
|
||||
include '../../../buf2d/import.inc'
|
||||
include '../../../libs-dev/libimg/import.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_dir_0 db '/sys/lib/'
|
||||
|
@@ -364,127 +364,9 @@ angle_y dd 0.0
|
||||
delt_size dd 3.0
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
align 4
|
||||
import_buf2d:
|
||||
dd sz_init0
|
||||
buf2d_create dd sz_buf2d_create
|
||||
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||
buf2d_clear dd sz_buf2d_clear
|
||||
buf2d_draw dd sz_buf2d_draw
|
||||
buf2d_delete dd sz_buf2d_delete
|
||||
buf2d_resize dd sz_buf2d_resize
|
||||
buf2d_line dd sz_buf2d_line
|
||||
buf2d_rect_by_size dd sz_buf2d_rect_by_size
|
||||
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
|
||||
buf2d_circle dd sz_buf2d_circle
|
||||
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
|
||||
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
|
||||
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
|
||||
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
|
||||
buf2d_bit_blt dd sz_buf2d_bit_blt
|
||||
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
|
||||
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
|
||||
buf2d_curve_bezier dd sz_buf2d_curve_bezier
|
||||
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
|
||||
buf2d_draw_text dd sz_buf2d_draw_text
|
||||
buf2d_crop_color dd sz_buf2d_crop_color
|
||||
buf2d_offset_h dd sz_buf2d_offset_h
|
||||
buf2d_flood_fill dd sz_buf2d_flood_fill
|
||||
buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||
dd 0,0
|
||||
sz_init0 db 'lib_init',0
|
||||
sz_buf2d_create db 'buf2d_create',0
|
||||
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||
sz_buf2d_clear db 'buf2d_clear',0
|
||||
sz_buf2d_draw db 'buf2d_draw',0
|
||||
sz_buf2d_delete db 'buf2d_delete',0
|
||||
sz_buf2d_resize db 'buf2d_resize',0
|
||||
sz_buf2d_line db 'buf2d_line',0
|
||||
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
|
||||
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
|
||||
sz_buf2d_circle db 'buf2d_circle',0
|
||||
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
|
||||
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
|
||||
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
|
||||
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
|
||||
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
|
||||
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
|
||||
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
|
||||
sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
|
||||
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
|
||||
sz_buf2d_draw_text db 'buf2d_draw_text',0
|
||||
sz_buf2d_crop_color db 'buf2d_crop_color',0
|
||||
sz_buf2d_offset_h db 'buf2d_offset_h',0
|
||||
sz_buf2d_flood_fill db 'buf2d_flood_fill',0
|
||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
; img_is_img dd aimg_is_img
|
||||
; img_info dd aimg_info
|
||||
; img_from_file dd aimg_from_file
|
||||
; img_to_file dd aimg_to_file
|
||||
; img_from_rgb dd aimg_from_rgb
|
||||
; img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
; img_encode dd aimg_encode
|
||||
; img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
; img_destroy_layer dd aimg_destroy_layer
|
||||
; img_count dd aimg_count
|
||||
; img_lock_bits dd aimg_lock_bits
|
||||
; img_unlock_bits dd aimg_unlock_bits
|
||||
; img_flip dd aimg_flip
|
||||
; img_flip_layer dd aimg_flip_layer
|
||||
; img_rotate dd aimg_rotate
|
||||
; img_rotate_layer dd aimg_rotate_layer
|
||||
; img_draw dd aimg_draw
|
||||
; img_convert dd aimg_convert
|
||||
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение
|
||||
; aimg_info db 'img_info',0
|
||||
; aimg_from_file db 'img_from_file',0
|
||||
; aimg_to_file db 'img_to_file',0
|
||||
; aimg_from_rgb db 'img_from_rgb',0
|
||||
; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных
|
||||
; aimg_encode db 'img_encode',0
|
||||
; aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
; aimg_destroy_layer db 'img_destroy_layer',0
|
||||
; aimg_count db 'img_count',0
|
||||
; aimg_lock_bits db 'img_lock_bits',0
|
||||
; aimg_unlock_bits db 'img_unlock_bits',0
|
||||
; aimg_flip db 'img_flip',0
|
||||
; aimg_flip_layer db 'img_flip_layer',0
|
||||
; aimg_rotate db 'img_rotate',0
|
||||
; aimg_rotate_layer db 'img_rotate_layer',0
|
||||
; aimg_draw db 'img_draw',0
|
||||
; aimg_convert db 'img_convert',0
|
||||
include '../import.inc' ;tinygl
|
||||
include '../../../buf2d/import.inc'
|
||||
include '../../../libs-dev/libimg/import.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_dir_0 db '/sys/lib/'
|
||||
|
@@ -315,127 +315,9 @@ angle_y dd 0.0
|
||||
delt_size dd 3.0
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include '../export.inc'
|
||||
|
||||
align 4
|
||||
import_buf2d:
|
||||
dd sz_init0
|
||||
buf2d_create dd sz_buf2d_create
|
||||
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||
buf2d_clear dd sz_buf2d_clear
|
||||
buf2d_draw dd sz_buf2d_draw
|
||||
buf2d_delete dd sz_buf2d_delete
|
||||
buf2d_resize dd sz_buf2d_resize
|
||||
buf2d_line dd sz_buf2d_line
|
||||
buf2d_rect_by_size dd sz_buf2d_rect_by_size
|
||||
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
|
||||
buf2d_circle dd sz_buf2d_circle
|
||||
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
|
||||
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
|
||||
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
|
||||
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
|
||||
buf2d_bit_blt dd sz_buf2d_bit_blt
|
||||
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
|
||||
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
|
||||
buf2d_curve_bezier dd sz_buf2d_curve_bezier
|
||||
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
|
||||
buf2d_draw_text dd sz_buf2d_draw_text
|
||||
buf2d_crop_color dd sz_buf2d_crop_color
|
||||
buf2d_offset_h dd sz_buf2d_offset_h
|
||||
buf2d_flood_fill dd sz_buf2d_flood_fill
|
||||
buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||
dd 0,0
|
||||
sz_init0 db 'lib_init',0
|
||||
sz_buf2d_create db 'buf2d_create',0
|
||||
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||
sz_buf2d_clear db 'buf2d_clear',0
|
||||
sz_buf2d_draw db 'buf2d_draw',0
|
||||
sz_buf2d_delete db 'buf2d_delete',0
|
||||
sz_buf2d_resize db 'buf2d_resize',0
|
||||
sz_buf2d_line db 'buf2d_line',0
|
||||
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
|
||||
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
|
||||
sz_buf2d_circle db 'buf2d_circle',0
|
||||
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
|
||||
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
|
||||
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
|
||||
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
|
||||
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
|
||||
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
|
||||
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
|
||||
sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
|
||||
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
|
||||
sz_buf2d_draw_text db 'buf2d_draw_text',0
|
||||
sz_buf2d_crop_color db 'buf2d_crop_color',0
|
||||
sz_buf2d_offset_h db 'buf2d_offset_h',0
|
||||
sz_buf2d_flood_fill db 'buf2d_flood_fill',0
|
||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
; img_is_img dd aimg_is_img
|
||||
; img_info dd aimg_info
|
||||
; img_from_file dd aimg_from_file
|
||||
; img_to_file dd aimg_to_file
|
||||
; img_from_rgb dd aimg_from_rgb
|
||||
; img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
; img_encode dd aimg_encode
|
||||
; img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
; img_destroy_layer dd aimg_destroy_layer
|
||||
; img_count dd aimg_count
|
||||
; img_lock_bits dd aimg_lock_bits
|
||||
; img_unlock_bits dd aimg_unlock_bits
|
||||
; img_flip dd aimg_flip
|
||||
; img_flip_layer dd aimg_flip_layer
|
||||
; img_rotate dd aimg_rotate
|
||||
; img_rotate_layer dd aimg_rotate_layer
|
||||
; img_draw dd aimg_draw
|
||||
; img_convert dd aimg_convert
|
||||
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение
|
||||
; aimg_info db 'img_info',0
|
||||
; aimg_from_file db 'img_from_file',0
|
||||
; aimg_to_file db 'img_to_file',0
|
||||
; aimg_from_rgb db 'img_from_rgb',0
|
||||
; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных
|
||||
; aimg_encode db 'img_encode',0
|
||||
; aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
; aimg_destroy_layer db 'img_destroy_layer',0
|
||||
; aimg_count db 'img_count',0
|
||||
; aimg_lock_bits db 'img_lock_bits',0
|
||||
; aimg_unlock_bits db 'img_unlock_bits',0
|
||||
; aimg_flip db 'img_flip',0
|
||||
; aimg_flip_layer db 'img_flip_layer',0
|
||||
; aimg_rotate db 'img_rotate',0
|
||||
; aimg_rotate_layer db 'img_rotate_layer',0
|
||||
; aimg_draw db 'img_draw',0
|
||||
; aimg_convert db 'img_convert',0
|
||||
include '../import.inc' ;tinygl
|
||||
include '../../../buf2d/import.inc'
|
||||
include '../../../libs-dev/libimg/import.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_dir_0 db '/sys/lib/'
|
||||
|
18
programs/develop/libraries/TinyGL/asm_fork/import.inc
Normal file
@@ -0,0 +1,18 @@
|
||||
align 4
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include 'export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include 'export.inc'
|
@@ -49,9 +49,9 @@ include '../../../../../load_lib.mac'
|
||||
;--- Start of program ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
START:
|
||||
mcall 68,11
|
||||
mcall 66,1,1
|
||||
mcall 40,0x27
|
||||
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1
|
||||
mcall SF_SET_EVENTS_MASK,0x27
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
load_libraries l_libs_start,end_l_libs
|
||||
@@ -84,7 +84,7 @@ load_libraries l_libs_start,end_l_libs
|
||||
|
||||
copy_path icons_file_name,path,library_path,0
|
||||
|
||||
mcall 70,fileinfo
|
||||
mcall SF_FILE,fileinfo
|
||||
|
||||
mov [fileinfo+0],dword 0
|
||||
|
||||
@@ -93,14 +93,14 @@ load_libraries l_libs_start,end_l_libs
|
||||
mov [img_size],ecx
|
||||
|
||||
|
||||
mcall 68,12
|
||||
mcall SF_SYS_MISC,SSF_MEM_ALLOC
|
||||
|
||||
|
||||
mov [fileinfo+16],eax
|
||||
mov [image_file],eax
|
||||
|
||||
|
||||
mcall 70,fileinfo
|
||||
mcall SF_FILE,fileinfo
|
||||
|
||||
xor eax,eax
|
||||
mov [return_code],eax
|
||||
@@ -108,8 +108,7 @@ load_libraries l_libs_start,end_l_libs
|
||||
push image_file
|
||||
call [cnv_png_import.Start]
|
||||
|
||||
mov ecx,[image_file]
|
||||
mcall 68,13,
|
||||
mcall SF_SYS_MISC,SSF_MEM_FREE,[image_file]
|
||||
|
||||
cmp [return_code],dword 0
|
||||
jne button.exit
|
||||
@@ -151,28 +150,28 @@ load_libraries l_libs_start,end_l_libs
|
||||
red:
|
||||
call draw_window
|
||||
still:
|
||||
mcall 10
|
||||
mcall SF_WAIT_EVENT
|
||||
|
||||
cmp eax,1
|
||||
cmp eax,EV_REDRAW
|
||||
je red
|
||||
cmp eax,2
|
||||
cmp eax,EV_KEY
|
||||
je key
|
||||
cmp eax,3
|
||||
cmp eax,EV_BUTTON
|
||||
je button
|
||||
cmp eax,6
|
||||
cmp eax,EV_MOUSE
|
||||
je mouse
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
key:
|
||||
mcall 2
|
||||
mcall SF_GET_KEY
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
mcall 17
|
||||
mcall SF_GET_BUTTON
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
;---------------------------------------------------------------------
|
||||
mouse:
|
||||
;-----------------------------------------------
|
||||
@@ -184,7 +183,7 @@ mouse:
|
||||
jbe .horizontal
|
||||
; mouse event for Vertical ScrollBar
|
||||
push dword scroll_bar_data_vertical
|
||||
call [scrollbar_ver_mouse]
|
||||
call [scrollbar_v_mouse]
|
||||
mov eax,scroll_bar_data_vertical.redraw
|
||||
xor ebx,ebx
|
||||
cmp [eax],ebx
|
||||
@@ -200,7 +199,7 @@ mouse:
|
||||
jbe .other
|
||||
; mouse event for Horizontal ScrollBar
|
||||
push dword scroll_bar_data_horizontal
|
||||
call [scrollbar_hor_mouse]
|
||||
call [scrollbar_h_mouse]
|
||||
mov eax,scroll_bar_data_horizontal.redraw
|
||||
xor ebx,ebx
|
||||
cmp [eax],ebx
|
||||
@@ -240,7 +239,7 @@ mouse:
|
||||
.mouse_dinamic_button:
|
||||
; mouse event for Dinamic Button 1
|
||||
push dword dinamic_button_data_1
|
||||
call [dinamic_button_mouse]
|
||||
call [dbutton_mouse]
|
||||
mov eax,dinamic_button_data_1.click
|
||||
cmp [eax],dword 1
|
||||
jne @f
|
||||
@@ -249,7 +248,7 @@ mouse:
|
||||
@@:
|
||||
; mouse event for Dinamic Button 2
|
||||
push dword dinamic_button_data_2
|
||||
call [dinamic_button_mouse]
|
||||
call [dbutton_mouse]
|
||||
mov eax,dinamic_button_data_2.click
|
||||
cmp [eax],dword 1
|
||||
jne still ;@f
|
||||
@@ -283,7 +282,7 @@ analyse_out_menu_2:
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
about:
|
||||
mcall 51,1,thread3,thread
|
||||
mcall SF_CREATE_THREAD,1,thread3,thread
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_start_0:
|
||||
@@ -320,9 +319,9 @@ OpenDialog_start:
|
||||
;---------------------------------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
draw_window:
|
||||
mcall 12,1
|
||||
mcall 0,<0,400>,<0,400>,0x03AABBCC,0x805080D0,0x005080D0
|
||||
mcall 71,1,header_1
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
mcall SF_CREATE_WINDOW,<0,400>,<0,400>,0x03AABBCC,0x805080D0,0x005080D0
|
||||
mcall SF_SET_CAPTION,1,header_1
|
||||
;---------------------------------------------
|
||||
; draw for Menu 1
|
||||
push dword menu_data_1
|
||||
@@ -333,15 +332,15 @@ draw_window:
|
||||
;---------------------------------------------
|
||||
; draw for Dinamic Button 1
|
||||
push dword dinamic_button_data_1
|
||||
call [dinamic_button_draw]
|
||||
call [dbutton_draw]
|
||||
; draw for Dinamic Button 2
|
||||
push dword dinamic_button_data_2
|
||||
call [dinamic_button_draw]
|
||||
call [dbutton_draw]
|
||||
;---------------------------------------------
|
||||
mcall 13,<170,200>,<25,15>,0xffffb0
|
||||
mcall SF_DRAW_RECT,<170,200>,<25,15>,0xffffb0
|
||||
; mov bx,28
|
||||
; add ebx,2 shl 16
|
||||
; mcall 4,,0xC0000000,text_work_area,,0xffffb0
|
||||
; mcall SF_DRAW_TEXT,,0xC0000000,text_work_area,,0xffffb0
|
||||
; draw for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_draw]
|
||||
@@ -357,21 +356,21 @@ draw_window:
|
||||
|
||||
; draw for Vertical ScrollBar
|
||||
push dword scroll_bar_data_vertical
|
||||
call [scrollbar_ver_draw]
|
||||
call [scrollbar_v_draw]
|
||||
; draw for Horizontal ScrollBar
|
||||
push dword scroll_bar_data_horizontal
|
||||
call [scrollbar_hor_draw]
|
||||
call [scrollbar_h_draw]
|
||||
; reset all_redraw flag
|
||||
xor eax,eax
|
||||
mov [scroll_bar_data_vertical.all_redraw],eax
|
||||
mov [scroll_bar_data_horizontal.all_redraw],eax
|
||||
;---------------------------------------------
|
||||
call draw_cube
|
||||
mcall 12,2
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_cube:
|
||||
mcall 13,<30,301>,<50,301>,0xafafaf
|
||||
mcall SF_DRAW_RECT,<30,301>,<50,301>,0xafafaf
|
||||
mov ecx,[scroll_bar_data_vertical.position]
|
||||
add ecx,50
|
||||
shl ecx,16
|
||||
@@ -380,7 +379,7 @@ draw_cube:
|
||||
add ebx,30
|
||||
shl ebx,16
|
||||
mov bx,30
|
||||
mcall 13,,,0x0
|
||||
mcall SF_DRAW_RECT,,,0x0
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
include 'data.inc'
|
||||
|
@@ -30,7 +30,7 @@ system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
align 4
|
||||
l_libs_start:
|
||||
library01 l_libs system_dir_Boxlib+9, file_name, system_dir_Boxlib,\
|
||||
Box_lib_import, plugins_directory
|
||||
import_box_lib, plugins_directory
|
||||
|
||||
library02 l_libs system_dir_CnvPNG+9, file_name, system_dir_CnvPNG,\
|
||||
cnv_png_import, plugins_directory
|
||||
@@ -126,91 +126,7 @@ deflate_unpack dd 0
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
|
||||
;edit_box_draw dd aEdit_box_draw
|
||||
;edit_box_key dd aEdit_box_key
|
||||
;edit_box_mouse dd aEdit_box_mouse
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
;check_box_draw dd aCheck_box_draw
|
||||
;check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
;option_box_draw dd aOption_box_draw
|
||||
;option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
scrollbar_ver_draw dd aScrollbar_ver_draw
|
||||
scrollbar_ver_mouse dd aScrollbar_ver_mouse
|
||||
scrollbar_hor_draw dd aScrollbar_hor_draw
|
||||
scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
||||
;version_scrollbar dd aVersion_scrollbar
|
||||
|
||||
dinamic_button_draw dd aDbutton_draw
|
||||
dinamic_button_mouse dd aDbutton_mouse
|
||||
;version_dbutton dd aVersion_dbutton
|
||||
|
||||
menu_bar_draw dd aMenu_bar_draw
|
||||
menu_bar_mouse dd aMenu_bar_mouse
|
||||
menu_bar_activate dd aMenu_bar_activate
|
||||
;version_menu_bar dd aVersion_menu_bar
|
||||
|
||||
;FileBrowser_draw dd aFileBrowser_draw
|
||||
;FileBrowser_mouse dd aFileBrowser_mouse
|
||||
;FileBrowser_key dd aFileBrowser_key
|
||||
;Version_FileBrowser dd aVersion_FileBrowser
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
;aEdit_box_draw db 'edit_box_draw',0
|
||||
;aEdit_box_key db 'edit_box_key',0
|
||||
;aEdit_box_mouse db 'edit_box_mouse',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
;aCheck_box_draw db 'check_box_draw',0
|
||||
;aCheck_box_mouse db 'check_box_mouse',0
|
||||
;aVersion_ch db 'version_ch',0
|
||||
|
||||
;aOption_box_draw db 'option_box_draw',0
|
||||
;aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
aScrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
|
||||
aScrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
||||
;aVersion_scrollbar db 'version_scrollbar',0
|
||||
|
||||
aDbutton_draw db 'dbutton_draw',0
|
||||
aDbutton_mouse db 'dbutton_mouse',0
|
||||
;aVersion_dbutton db 'version_dbutton',0
|
||||
|
||||
aMenu_bar_draw db 'menu_bar_draw',0
|
||||
aMenu_bar_mouse db 'menu_bar_mouse',0
|
||||
aMenu_bar_activate db 'menu_bar_activate',0
|
||||
;aVersion_menu_bar db 'version_menu_bar',0
|
||||
|
||||
;aFileBrowser_draw db 'FileBrowser_draw',0
|
||||
;aFileBrowser_mouse db 'FileBrowser_mouse',0
|
||||
;aFileBrowser_key db 'FileBrowser_key',0
|
||||
;aVersion_FileBrowser db 'version_FileBrowser',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
include '../../import.inc' ;import_box_lib
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
|
@@ -18,7 +18,7 @@ include '../../../../../load_lib.mac'
|
||||
@use_library ;use load lib macros
|
||||
start:
|
||||
;universal load library/librarys
|
||||
sys_load_library library_name, library_path, system_path, myimport
|
||||
sys_load_library library_name, library_path, system_path, import_box_lib
|
||||
;if return code =-1 then exit, else nornary work
|
||||
cmp eax,-1
|
||||
jz exit
|
||||
@@ -116,37 +116,7 @@ library_name db 'box_lib.obj',0
|
||||
;library_name db 'box_lib.obj',0
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
myimport:
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
version_ch dd aVersion_ch
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
version_op dd aVersion_op
|
||||
|
||||
dd 0,0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aVersion_ed db 'version_ed',0
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
aVersion_ch db 'version_ch2',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
aVersion_op db 'version_op',0
|
||||
include '../../import.inc' ;creating a function import table
|
||||
|
||||
|
||||
check1 check_box2 (10 shl 16 + 12),(45 shl 16 + 12),5,0x80AABBCC,0,0,check_text1,ch_flag_en
|
||||
|
@@ -34,14 +34,14 @@ START:
|
||||
;---------------------------------------------------------------------
|
||||
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
mcall 68, 11
|
||||
mcall SF_SYS_MISC, SSF_HEAP_INIT
|
||||
|
||||
mcall 40, $C0000027 ; <20><>᪠ ᮡ<>⨩ - <20><><EFBFBD><EFBFBD> ⮫쪮 <20> <20><>⨢<EFBFBD><E2A8A2><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
mcall SF_SET_EVENTS_MASK, $C0000027 ; <20><>᪠ ᮡ<>⨩ - <20><><EFBFBD><EFBFBD> ⮫쪮 <20> <20><>⨢<EFBFBD><E2A8A2><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
sys_load_library lib_name, lib_path, sys_path, myimport
|
||||
sys_load_library lib_name, lib_path, sys_path, import_box_lib
|
||||
test eax,eax
|
||||
jz @f
|
||||
mcall -1 ; alarm exit
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
@@:
|
||||
|
||||
|
||||
@@ -56,16 +56,16 @@ call draw_window ;
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
still:
|
||||
mcall 23, 5 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 23 - <20><><EFBFBD><EFBFBD><EFBFBD> ᮡ<><E1AEA1><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> 祬 0.05<EFBFBD>
|
||||
mcall SF_WAIT_EVENT_TIMEOUT, 5 ; <20><><EFBFBD><EFBFBD><EFBFBD> ᮡ<><E1AEA1><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> 祬 0.05<EFBFBD>
|
||||
test eax, eax ; <20><><EFBFBD> ᮡ<>⨩ - <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD>⨯<EFBFBD><E2A8AF> <20><> ⠩<><E2A0A9><EFBFBD><EFBFBD>
|
||||
je yield
|
||||
cmp eax,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> ?
|
||||
cmp eax,EV_REDRAW
|
||||
je red ; <20> <20><> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD> red
|
||||
cmp eax,2 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
|
||||
cmp eax,EV_KEY
|
||||
je key ; <20> <20><> - <20><> key
|
||||
cmp eax,3 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
|
||||
cmp eax,EV_BUTTON
|
||||
je button ; <20> <20><> - <20><> button
|
||||
cmp eax,6 ; ᮡ<>⨥ <20><><EFBFBD><EFBFBD>
|
||||
cmp eax,EV_MOUSE
|
||||
je mouse ; <20> <20><> - <20><> mouse
|
||||
|
||||
jmp still ; <20> <20><>㣮<EFBFBD> ᮡ<>⨥ - <20> <20><>砫<EFBFBD> 横<><E6A8AA>
|
||||
@@ -81,21 +81,21 @@ invoke tooltip_mouse, redbox_tt
|
||||
jmp still ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>砫<EFBFBD> 横<><E6A8AA>
|
||||
|
||||
key: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall 2 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> (<28> ah)
|
||||
mcall SF_GET_KEY ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> (<28> ah)
|
||||
|
||||
jmp still ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>砫<EFBFBD> 横<><E6A8AA>
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mcall 17 ; 17 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_BUTTON ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
cmp ah, 1 ; <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> 1,
|
||||
jne still ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pexit:
|
||||
invoke tooltip_delete, redbox_tt ; <20><EFBFBD><E1A2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall -1 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
@@ -104,20 +104,20 @@ mcall -1 ;
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 12, 1 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20> <20><>砫<EFBFBD> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2>
|
||||
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||
|
||||
mcall 48, 3, sc,sizeof.system_colors
|
||||
mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
|
||||
|
||||
mov edx, [sc.work] ; 梥<> 䮭<>
|
||||
or edx, 0x33000000 ; <20> ⨯ <20><><EFBFBD><EFBFBD> 3
|
||||
mcall 0, <200,300>, <200,150>, , ,title
|
||||
mcall SF_CREATE_WINDOW, <200,300>, <200,150>, , ,title
|
||||
|
||||
; <20>뢮<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⨪<EFBFBD><E2A8AA>
|
||||
mcall 13, <60,50>, <50,50>, $FF0000
|
||||
mcall 13, <140,50>, <50,50>, $FF
|
||||
mcall SF_DRAW_RECT, <60,50>, <50,50>, $FF0000
|
||||
mcall SF_DRAW_RECT, <140,50>, <50,50>, $FF
|
||||
|
||||
|
||||
mcall 12, 2 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 12.2, <20><><EFBFBD><EFBFBD><EFBFBD>稫<EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD>
|
||||
mcall SF_REDRAW, SSF_END_DRAW
|
||||
|
||||
ret ; <20><>室<EFBFBD><E5AEA4> <20><> <20><><EFBFBD>楤<EFBFBD><E6A5A4><EFBFBD>
|
||||
|
||||
@@ -135,22 +135,7 @@ lib_name db 'box_lib.obj',0
|
||||
cur_dir_path rb 4096
|
||||
lib_path rb 4096
|
||||
|
||||
myimport:
|
||||
dd sz_lib_init ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD><EFBFBD>᪠<EFBFBD><E1AAA0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ᮬ 1 ࠧ <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD>
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>, <20><>⮬<EFBFBD> <20> <20>ணࠬ<E0AEA3><E0A0AC> <20><>⪠ <20><> <20><><EFBFBD> <20><> <20>㦭<EFBFBD>
|
||||
tooltip_init dd sz_tooltip_init
|
||||
tooltip_delete dd sz_tooltip_delete
|
||||
tooltip_test_show dd sz_tooltip_test_show
|
||||
tooltip_mouse dd sz_tooltip_mouse
|
||||
get_font_size dd sz_get_font_size
|
||||
dd 0,0
|
||||
|
||||
sz_lib_init db 'lib_init',0
|
||||
sz_tooltip_init db 'tooltip_init', 0
|
||||
sz_tooltip_delete db 'tooltip_delete', 0
|
||||
sz_tooltip_test_show db 'tooltip_test_show', 0
|
||||
sz_tooltip_mouse db 'tooltip_mouse', 0
|
||||
sz_get_font_size db 'get_font_size', 0
|
||||
include '../../import.inc' ;import_box_lib
|
||||
|
||||
|
||||
;tooltip txt, next, zone_x, zone_w, zone_y, zone_h, col_txt, col_bkg, tm_wait
|
||||
|
117
programs/develop/libraries/box_lib/export.inc
Normal file
@@ -0,0 +1,117 @@
|
||||
;
|
||||
; Export functions
|
||||
;
|
||||
|
||||
E_LIB lib_init
|
||||
E_LIB version
|
||||
|
||||
E_LIB edit_box_draw
|
||||
E_LIB edit_box_key
|
||||
E_LIB edit_box_key_safe
|
||||
E_LIB edit_box_mouse
|
||||
E_LIB edit_box_set_text
|
||||
E_LIB version_ed
|
||||
|
||||
E_LIB init_checkbox, init_checkbox2
|
||||
E_LIB check_box_draw, check_box_draw2
|
||||
E_LIB check_box_mouse, check_box_mouse2
|
||||
E_LIB version_ch, version_ch2
|
||||
|
||||
E_LIB option_box_draw
|
||||
E_LIB option_box_mouse
|
||||
E_LIB version_op
|
||||
|
||||
E_LIB scrollbar_v_draw
|
||||
E_LIB scrollbar_v_mouse
|
||||
E_LIB scrollbar_h_draw
|
||||
E_LIB scrollbar_h_mouse
|
||||
E_LIB version_scrollbar
|
||||
|
||||
E_LIB dbutton_draw
|
||||
E_LIB dbutton_mouse
|
||||
E_LIB version_dbutton
|
||||
|
||||
E_LIB menu_bar_draw
|
||||
E_LIB menu_bar_mouse
|
||||
E_LIB menu_bar_activate
|
||||
E_LIB version_menu_bar
|
||||
|
||||
E_LIB FileBrowser_draw
|
||||
E_LIB FileBrowser_mouse
|
||||
E_LIB FileBrowser_key
|
||||
E_LIB version_FileBrowser
|
||||
|
||||
E_LIB tl_data_init
|
||||
E_LIB tl_data_clear
|
||||
E_LIB tl_info_clear
|
||||
E_LIB tl_key
|
||||
E_LIB tl_mouse
|
||||
E_LIB tl_draw
|
||||
E_LIB tl_info_undo
|
||||
E_LIB tl_info_redo
|
||||
E_LIB tl_node_add
|
||||
E_LIB tl_node_set_data
|
||||
E_LIB tl_node_get_data
|
||||
E_LIB tl_node_delete
|
||||
E_LIB tl_cur_beg
|
||||
E_LIB tl_cur_next
|
||||
E_LIB tl_cur_perv
|
||||
E_LIB tl_node_close_open
|
||||
E_LIB tl_node_lev_inc
|
||||
E_LIB tl_node_lev_dec
|
||||
E_LIB tl_node_move_up
|
||||
E_LIB tl_node_move_down
|
||||
E_LIB tl_node_poi_get_info
|
||||
E_LIB tl_node_poi_get_next_info
|
||||
E_LIB tl_node_poi_get_data
|
||||
E_LIB tl_save_mem
|
||||
E_LIB tl_load_mem
|
||||
E_LIB tl_get_mem_size
|
||||
E_LIB version_tree_list
|
||||
|
||||
E_LIB PathShow_prepare
|
||||
E_LIB PathShow_draw
|
||||
E_LIB version_PathShow
|
||||
|
||||
E_LIB ted_but_sumb_upper
|
||||
E_LIB ted_but_sumb_lover
|
||||
E_LIB ted_but_convert_by_table
|
||||
E_LIB ted_can_save
|
||||
E_LIB ted_clear
|
||||
E_LIB ted_delete
|
||||
E_LIB ted_draw
|
||||
E_LIB ted_init
|
||||
E_LIB ted_init_scroll_bars
|
||||
E_LIB ted_init_syntax_file
|
||||
E_LIB ted_is_select
|
||||
E_LIB ted_key
|
||||
E_LIB ted_mouse
|
||||
E_LIB ted_open_file
|
||||
E_LIB ted_save_file
|
||||
E_LIB ted_text_add
|
||||
E_LIB ted_but_select_word
|
||||
E_LIB ted_but_cut
|
||||
E_LIB ted_but_copy
|
||||
E_LIB ted_but_paste
|
||||
E_LIB ted_but_undo
|
||||
E_LIB ted_but_redo
|
||||
E_LIB ted_but_reverse
|
||||
E_LIB ted_but_find
|
||||
E_LIB ted_but_replace
|
||||
E_LIB ted_text_colored
|
||||
E_LIB ted_go_to_position
|
||||
E_LIB version_text_edit
|
||||
|
||||
E_LIB frame_draw
|
||||
E_LIB version_frame
|
||||
|
||||
E_LIB progressbar_draw
|
||||
E_LIB progressbar_progress
|
||||
|
||||
E_LIB tooltip_init
|
||||
E_LIB tooltip_delete
|
||||
E_LIB tooltip_test_show
|
||||
E_LIB tooltip_mouse
|
||||
E_LIB get_font_size
|
||||
|
||||
purge E_LIB
|
24
programs/develop/libraries/box_lib/import.inc
Normal file
@@ -0,0 +1,24 @@
|
||||
align 4
|
||||
import_box_lib:
|
||||
|
||||
macro E_LIB n, lfn
|
||||
{
|
||||
if n eq lib_init
|
||||
dd strz_#n
|
||||
else if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include 'export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n, lfn
|
||||
{
|
||||
if used n
|
||||
if lfn eq
|
||||
sz_#n db `n,0
|
||||
else
|
||||
sz_#n db `lfn,0
|
||||
end if
|
||||
end if
|
||||
}
|
||||
include 'export.inc'
|
48
programs/develop/libraries/buf2d/export.inc
Normal file
@@ -0,0 +1,48 @@
|
||||
;
|
||||
; Export functions
|
||||
;
|
||||
|
||||
E_LIB lib_init
|
||||
E_LIB buf2d_create
|
||||
E_LIB buf2d_create_f_img
|
||||
E_LIB buf2d_clear
|
||||
E_LIB buf2d_draw
|
||||
E_LIB buf2d_delete
|
||||
E_LIB buf2d_resize
|
||||
E_LIB buf2d_rotate
|
||||
E_LIB buf2d_line
|
||||
E_LIB buf2d_line_sm
|
||||
E_LIB buf2d_rect_by_size
|
||||
E_LIB buf2d_filled_rect_by_size
|
||||
E_LIB buf2d_circle
|
||||
E_LIB buf2d_img_hdiv2
|
||||
E_LIB buf2d_img_wdiv2
|
||||
E_LIB buf2d_conv_24_to_8
|
||||
E_LIB buf2d_conv_24_to_32
|
||||
E_LIB buf2d_bit_blt
|
||||
E_LIB buf2d_bit_blt_transp
|
||||
E_LIB buf2d_bit_blt_alpha
|
||||
E_LIB buf2d_curve_bezier
|
||||
E_LIB buf2d_convert_text_matrix
|
||||
E_LIB buf2d_draw_text
|
||||
E_LIB buf2d_crop_color
|
||||
E_LIB buf2d_offset_h
|
||||
E_LIB buf2d_flood_fill
|
||||
E_LIB buf2d_set_pixel
|
||||
E_LIB buf2d_get_pixel
|
||||
E_LIB buf2d_flip_h
|
||||
E_LIB buf2d_flip_v
|
||||
E_LIB buf2d_filter_dither
|
||||
|
||||
E_LIB buf2d_vox_brush_create
|
||||
E_LIB buf2d_vox_brush_delete
|
||||
E_LIB buf2d_vox_obj_get_img_w_3g
|
||||
E_LIB buf2d_vox_obj_get_img_h_3g
|
||||
E_LIB buf2d_vox_obj_draw_1g
|
||||
E_LIB buf2d_vox_obj_draw_3g
|
||||
E_LIB buf2d_vox_obj_draw_3g_scaled
|
||||
E_LIB buf2d_vox_obj_draw_pl
|
||||
E_LIB buf2d_vox_obj_draw_pl_scaled
|
||||
E_LIB buf2d_vox_obj_draw_3g_shadows
|
||||
|
||||
purge E_LIB
|
20
programs/develop/libraries/buf2d/import.inc
Normal file
@@ -0,0 +1,20 @@
|
||||
align 4
|
||||
import_buf2d:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if n eq lib_init
|
||||
dd strz_#n
|
||||
else if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include 'export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include 'export.inc'
|
@@ -11,7 +11,7 @@ include '../../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../../../dll.inc'
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
caption db '<27><><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⬮<EFBFBD> DES 05.03.13',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
caption db '<27><><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⬮<EFBFBD> DES 21.05.25',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
struct FileInfoBlock
|
||||
Function dd ?
|
||||
@@ -112,13 +112,13 @@ align 4
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
|
||||
cmp al,1
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,2
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,3
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
cmp al,6 ;<3B><><EFBFBD><EFBFBD>
|
||||
cmp al,EV_MOUSE
|
||||
jne @f
|
||||
jmp mouse
|
||||
@@:
|
||||
@@ -410,52 +410,7 @@ l_libs_start:
|
||||
lib_4 l_libs lib_name_4, library_path, system_dir_4, import_box_lib
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_is_img dd aimg_is_img
|
||||
img_info dd aimg_info
|
||||
img_from_file dd aimg_from_file
|
||||
img_to_file dd aimg_to_file
|
||||
img_from_rgb dd aimg_from_rgb
|
||||
img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_encode dd aimg_encode
|
||||
img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
img_destroy_layer dd aimg_destroy_layer
|
||||
img_count dd aimg_count
|
||||
img_lock_bits dd aimg_lock_bits
|
||||
img_unlock_bits dd aimg_unlock_bits
|
||||
img_flip dd aimg_flip
|
||||
img_flip_layer dd aimg_flip_layer
|
||||
img_rotate dd aimg_rotate
|
||||
img_rotate_layer dd aimg_rotate_layer
|
||||
img_draw dd aimg_draw
|
||||
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_is_img db 'img_is_img',0 ;<3B><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ᤥ<><E1A4A5><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
aimg_info db 'img_info',0
|
||||
aimg_from_file db 'img_from_file',0
|
||||
aimg_to_file db 'img_to_file',0
|
||||
aimg_from_rgb db 'img_from_rgb',0
|
||||
aimg_to_rgb db 'img_to_rgb',0 ;<3B>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RGB
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;<3B><>⮬<EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD>᪨ <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
aimg_encode db 'img_encode',0
|
||||
aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
aimg_destroy_layer db 'img_destroy_layer',0
|
||||
aimg_count db 'img_count',0
|
||||
aimg_lock_bits db 'img_lock_bits',0
|
||||
aimg_unlock_bits db 'img_unlock_bits',0
|
||||
aimg_flip db 'img_flip',0
|
||||
aimg_flip_layer db 'img_flip_layer',0
|
||||
aimg_rotate db 'img_rotate',0
|
||||
aimg_rotate_layer db 'img_rotate_layer',0
|
||||
aimg_draw db 'img_draw',0
|
||||
include '../../libs-dev/libimg/import.inc'
|
||||
|
||||
align 4
|
||||
import_proclib: ;<3B><><EFBFBD>ᠭ<EFBFBD><E1A0AD> <20><>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD>㥬<EFBFBD><E3A5AC> <20>㭪権
|
||||
@@ -465,57 +420,7 @@ dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
|
||||
align 4
|
||||
import_buf2d:
|
||||
init dd sz_init
|
||||
buf2d_create dd sz_buf2d_create
|
||||
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||
buf2d_clear dd sz_buf2d_clear
|
||||
buf2d_draw dd sz_buf2d_draw
|
||||
buf2d_delete dd sz_buf2d_delete
|
||||
;buf2d_line dd sz_buf2d_line
|
||||
;buf2d_rect_by_size dd sz_buf2d_rect_by_size
|
||||
;buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
|
||||
;buf2d_circle dd sz_buf2d_circle
|
||||
;buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
|
||||
;buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
|
||||
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
|
||||
;buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
|
||||
;buf2d_bit_blt dd sz_buf2d_bit_blt
|
||||
;buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
|
||||
;buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
|
||||
;buf2d_curve_bezier dd sz_buf2d_curve_bezier
|
||||
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
|
||||
buf2d_draw_text dd sz_buf2d_draw_text
|
||||
;buf2d_crop_color dd sz_buf2d_crop_color
|
||||
;buf2d_offset_h dd sz_buf2d_offset_h
|
||||
;buf2d_flood_fill dd sz_buf2d_flood_fill
|
||||
;buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||
dd 0,0
|
||||
sz_init db 'lib_init',0
|
||||
sz_buf2d_create db 'buf2d_create',0
|
||||
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||
sz_buf2d_clear db 'buf2d_clear',0
|
||||
sz_buf2d_draw db 'buf2d_draw',0
|
||||
sz_buf2d_delete db 'buf2d_delete',0
|
||||
;sz_buf2d_line db 'buf2d_line',0
|
||||
;sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
|
||||
;sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
|
||||
;sz_buf2d_circle db 'buf2d_circle',0
|
||||
;sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
|
||||
;sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
|
||||
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
|
||||
;sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
|
||||
;sz_buf2d_bit_blt db 'buf2d_bit_blt',0
|
||||
;sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
|
||||
;sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
|
||||
;sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
|
||||
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
|
||||
sz_buf2d_draw_text db 'buf2d_draw_text',0
|
||||
;sz_buf2d_crop_color db 'buf2d_crop_color',0
|
||||
;sz_buf2d_offset_h db 'buf2d_offset_h',0
|
||||
;sz_buf2d_flood_fill db 'buf2d_flood_fill',0
|
||||
;sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||
include '../../buf2d/import.inc'
|
||||
|
||||
align 4
|
||||
import_des: ;<3B><><EFBFBD>ᠭ<EFBFBD><E1A0AD> <20><>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD>㥬<EFBFBD><E3A5AC> <20>㭪権
|
||||
@@ -525,22 +430,7 @@ dd 0,0
|
||||
sz_des_encryption db 'des_encryption',0
|
||||
sz_des_decryption db 'des_decryption',0
|
||||
|
||||
align 4
|
||||
import_box_lib:
|
||||
;dd sz_init1
|
||||
edit_box_draw dd sz_edit_box_draw
|
||||
edit_box_key dd sz_edit_box_key
|
||||
edit_box_mouse dd sz_edit_box_mouse
|
||||
;edit_box_set_text dd sz_edit_box_set_text
|
||||
|
||||
dd 0,0
|
||||
;sz_init1 db 'lib_init',0
|
||||
sz_edit_box_draw db 'edit_box_draw',0
|
||||
sz_edit_box_key db 'edit_box_key',0
|
||||
sz_edit_box_mouse db 'edit_box_mouse',0
|
||||
;sz_edit_box_set_text db 'edit_box_set_text',0
|
||||
|
||||
mouse_dd dd 0x0
|
||||
include '../../box_lib/import.inc'
|
||||
|
||||
align 4
|
||||
buf_0: dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
@@ -564,12 +454,13 @@ buf_1:
|
||||
edit1 edit_box 58, 140,8, 0xffffff, 0xff, 0x80ff, 0, 0x8000, 8, txt_key, mouse_dd, ed_focus+ed_always_focus,8,8
|
||||
|
||||
txt_openfile db '<27><><EFBFBD>ன<EFBFBD><E0AEA9> 䠩<> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD>.',0
|
||||
txt_buf rb 80
|
||||
txt_key db 'des_0123',0
|
||||
mem_key rb 120
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
txt_buf rb 80
|
||||
mem_key rb 120
|
||||
mouse_dd rd 1
|
||||
procinfo process_information
|
||||
sc system_colors
|
||||
rb 2048
|
||||
|
@@ -100,6 +100,10 @@ lib_init: ;//////////////////////////////////////////////////////////////////;;
|
||||
mov [mem.alloc], eax
|
||||
mov [mem.free], ebx
|
||||
mov [mem.realloc], ecx
|
||||
|
||||
cmp [dll.load], edx
|
||||
je .ok
|
||||
|
||||
mov [dll.load], edx
|
||||
|
||||
invoke dll.load, @IMPORT
|
||||
@@ -115,6 +119,7 @@ lib_init: ;//////////////////////////////////////////////////////////////////;;
|
||||
invoke ini.get_str, inifile, sec_proxy, key_password, proxyPassword, 256, proxyPassword
|
||||
popa
|
||||
|
||||
.ok:
|
||||
DEBUGF 1, "HTTP library: init OK\n"
|
||||
xor eax, eax
|
||||
ret
|
||||
|
34
programs/develop/libraries/libs-dev/libimg/export.inc
Normal file
@@ -0,0 +1,34 @@
|
||||
;
|
||||
; Export functions
|
||||
;
|
||||
|
||||
E_LIB lib_init
|
||||
E_LIB version
|
||||
E_LIB img_is_img
|
||||
E_LIB img_info
|
||||
E_LIB img_from_file
|
||||
E_LIB img_to_file
|
||||
E_LIB img_from_rgb
|
||||
E_LIB img_to_rgb
|
||||
E_LIB img_to_rgb2
|
||||
E_LIB img_decode
|
||||
E_LIB img_encode ;supported formats: PNG 24 32, BMP 24 32, PNM 1 8g 24
|
||||
E_LIB img_create
|
||||
E_LIB img_destroy
|
||||
E_LIB img_destroy_layer
|
||||
E_LIB img_count
|
||||
E_LIB img_lock_bits
|
||||
E_LIB img_unlock_bits
|
||||
E_LIB img_flip
|
||||
E_LIB img_flip_layer
|
||||
E_LIB img_rotate
|
||||
E_LIB img_rotate_layer
|
||||
E_LIB img_draw
|
||||
E_LIB img_scale
|
||||
E_LIB img_get_scaled_size
|
||||
E_LIB img_convert
|
||||
E_LIB img_blend
|
||||
E_LIB img_resize_data
|
||||
E_LIB img_formats_table
|
||||
|
||||
purge E_LIB
|
20
programs/develop/libraries/libs-dev/libimg/import.inc
Normal file
@@ -0,0 +1,20 @@
|
||||
align 4
|
||||
import_libimg:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
if n eq lib_init
|
||||
dd strz_#n
|
||||
else if defined sz_#n
|
||||
n dd sz_#n
|
||||
end if
|
||||
}
|
||||
include 'export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
if used n
|
||||
sz_#n db `n,0
|
||||
end if
|
||||
}
|
||||
include 'export.inc'
|
@@ -78,6 +78,10 @@ proc lib_init ;///////////////////////////////////////////////////////////////;;
|
||||
mov [mem.alloc], eax
|
||||
mov [mem.free], ebx
|
||||
mov [mem.realloc], ecx
|
||||
|
||||
cmp [dll.load], edx
|
||||
je .ok
|
||||
|
||||
mov [dll.load], edx
|
||||
|
||||
or edx, edx
|
||||
|
@@ -37,6 +37,10 @@ proc libini._.init ;////////////////////////////////////////////////////////////
|
||||
mov [mem.alloc], eax
|
||||
mov [mem.free], ebx
|
||||
mov [mem.realloc], ecx
|
||||
|
||||
cmp [dll.load], edx
|
||||
je .ok
|
||||
|
||||
mov [dll.load], edx
|
||||
|
||||
invoke dll.load, @IMPORT
|
||||
|
@@ -33,6 +33,7 @@ use_ColorDialog
|
||||
;--------------------------------------------------
|
||||
align 16
|
||||
lib_init:
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
;--------------------------------------------------
|
||||
|
@@ -23,6 +23,9 @@ library_fun_memory_free equ mem_free
|
||||
library_fun_memory_realloc equ mem_realloc
|
||||
library_fun_dll_load equ dll_load
|
||||
|
||||
align 4
|
||||
strz_lib_init db 'lib_init',0
|
||||
|
||||
align 4
|
||||
arrea_xx dd 0
|
||||
file_name db '/sys/@notify',0
|
||||
@@ -214,7 +217,7 @@ end if
|
||||
jmp i_error
|
||||
align 4
|
||||
i_begin:
|
||||
import_boxlib myimport
|
||||
import_some_library myimport
|
||||
test eax,eax
|
||||
jz i_exit
|
||||
i_error:
|
||||
@@ -234,13 +237,13 @@ macro load_library library_name__, library_path__, system_path__, myimport, poin
|
||||
local i_begin
|
||||
local i_error
|
||||
local i_exit
|
||||
push ebx
|
||||
if point_dir_name__ eq
|
||||
copy_path library_name__, [32], library_path__,0
|
||||
else
|
||||
;the macros making way /current path a program/ + name system library
|
||||
copy_path library_name__, [32], library_path__,point_dir_name__
|
||||
end if
|
||||
push ebx
|
||||
mcall SF_SYS_MISC,SSF_LOAD_DLL,library_path__ ; load of alternative
|
||||
test eax,eax
|
||||
jnz i_begin
|
||||
@@ -251,7 +254,7 @@ end if
|
||||
jmp i_error
|
||||
align 4
|
||||
i_begin:
|
||||
import_boxlib myimport
|
||||
import_some_library myimport
|
||||
test eax,eax
|
||||
jz i_exit
|
||||
i_error:
|
||||
@@ -309,7 +312,7 @@ align 4
|
||||
align 4
|
||||
end_steep:
|
||||
mov adr_load_lib,eax ;save adr lib in memory
|
||||
import_boxlib my_import
|
||||
import_some_library my_import
|
||||
test eax,eax
|
||||
jz cycle0n
|
||||
or status_lib,2 ; status of code - enable error - import error
|
||||
@@ -387,7 +390,7 @@ align 4
|
||||
align 4
|
||||
end_steep:
|
||||
mov adr_load_lib,eax ;save adr lib in memory
|
||||
import_boxlib my_import
|
||||
import_some_library my_import
|
||||
test eax,eax
|
||||
jz cycle0n
|
||||
or status_lib,2 ; status of code - enable error - import error
|
||||
@@ -451,7 +454,7 @@ pop ebx eax
|
||||
;output:
|
||||
; eax - <20> 㤠筮 <20><> 0 <20><><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD> <20>㭪樨 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧨<EFBFBD><E3A7A8>
|
||||
; ebx - ࠧ<><E0A0A7>蠥<EFBFBD><E8A0A5><EFBFBD>
|
||||
macro import_boxlib myimport
|
||||
macro import_some_library myimport
|
||||
{
|
||||
local import_loop
|
||||
local import_find
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; ImgTransform - utility for creating textures from images
|
||||
; Copyright (C) 2020-2025 KolibriOS team
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -9,23 +13,23 @@ include '../../proc32.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_img.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/kosgl.inc'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/opengl_const.inc'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/zbuffer.inc'
|
||||
include '../../develop/libraries/libs-dev/libimg/libimg.inc'
|
||||
include '../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
caption db 'Image transform 08.12.20',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
caption db 'Image transform 21.05.25',0
|
||||
|
||||
BUF_STRUCT_SIZE equ 21
|
||||
buf2d_data equ dword[edi] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
buf2d_w equ dword[edi+8] ;<EFBFBD><EFBFBD>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
buf2d_h equ dword[edi+12] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
buf2d_l equ word[edi+4]
|
||||
buf2d_t equ word[edi+6] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
||||
buf2d_size_lt equ dword[edi+4] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5> <20> <20><>ࠢ<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
buf2d_color equ dword[edi+16] ;梥<EFBFBD> 䮭<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
buf2d_bits equ byte[edi+20] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD> <20> 1-<2D> <20><>窥 <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
buf2d_data equ dword[edi] ;image buffer data
|
||||
buf2d_w equ dword[edi+8] ;buffer width
|
||||
buf2d_h equ dword[edi+12] ;buffer height
|
||||
buf2d_l equ word[edi+4] ;left space
|
||||
buf2d_t equ word[edi+6] ;top space
|
||||
buf2d_color equ dword[edi+16] ;buffer background color
|
||||
buf2d_bits equ byte[edi+20] ;number of bits in 1 image pixel
|
||||
|
||||
NAV_WND_L equ 145
|
||||
NAV_WND_T equ 1
|
||||
@@ -88,13 +92,13 @@ still:
|
||||
cmp eax,0
|
||||
je timer_funct
|
||||
|
||||
cmp al,1
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,2
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,3
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
cmp al,6
|
||||
cmp al,EV_MOUSE
|
||||
jne @f
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
cmp ax,word[procinfo.window_stack_position]
|
||||
@@ -1428,56 +1432,9 @@ l_libs_start:
|
||||
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_proclib
|
||||
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_libimg
|
||||
lib_2 l_libs lib_name_2, library_path, system_dir_2, import_buf2d
|
||||
lib_3 l_libs lib_name_3, library_path, system_dir_3, import_lib_tinygl
|
||||
lib_3 l_libs lib_name_3, library_path, system_dir_3, import_tinygl
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_is_img dd aimg_is_img
|
||||
img_info dd aimg_info
|
||||
img_from_file dd aimg_from_file
|
||||
img_to_file dd aimg_to_file
|
||||
img_from_rgb dd aimg_from_rgb
|
||||
img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_encode dd aimg_encode
|
||||
img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
img_destroy_layer dd aimg_destroy_layer
|
||||
img_count dd aimg_count
|
||||
img_lock_bits dd aimg_lock_bits
|
||||
img_unlock_bits dd aimg_unlock_bits
|
||||
img_flip dd aimg_flip
|
||||
img_flip_layer dd aimg_flip_layer
|
||||
img_rotate dd aimg_rotate
|
||||
img_rotate_layer dd aimg_rotate_layer
|
||||
img_draw dd aimg_draw
|
||||
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_is_img db 'img_is_img',0 ;<3B><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ᤥ<><E1A4A5><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
aimg_info db 'img_info',0
|
||||
aimg_from_file db 'img_from_file',0
|
||||
aimg_to_file db 'img_to_file',0
|
||||
aimg_from_rgb db 'img_from_rgb',0
|
||||
aimg_to_rgb db 'img_to_rgb',0 ;<3B>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RGB
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;<3B><>⮬<EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD>᪨ <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
aimg_encode db 'img_encode',0
|
||||
aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
aimg_destroy_layer db 'img_destroy_layer',0
|
||||
aimg_count db 'img_count',0
|
||||
aimg_lock_bits db 'img_lock_bits',0
|
||||
aimg_unlock_bits db 'img_unlock_bits',0
|
||||
aimg_flip db 'img_flip',0
|
||||
aimg_flip_layer db 'img_flip_layer',0
|
||||
aimg_rotate db 'img_rotate',0
|
||||
aimg_rotate_layer db 'img_rotate_layer',0
|
||||
aimg_draw db 'img_draw',0
|
||||
|
||||
align 4
|
||||
import_proclib:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
@@ -1490,76 +1447,9 @@ dd 0,0
|
||||
aOpenDialog_Set_file_name db 'OpenDialog_set_file_name',0
|
||||
aOpenDialog_Set_file_ext db 'OpenDialog_set_file_ext',0
|
||||
|
||||
align 4
|
||||
import_buf2d:
|
||||
init dd sz_init
|
||||
buf2d_create dd sz_buf2d_create
|
||||
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||
buf2d_clear dd sz_buf2d_clear
|
||||
buf2d_draw dd sz_buf2d_draw
|
||||
buf2d_delete dd sz_buf2d_delete
|
||||
buf2d_resize dd sz_buf2d_resize
|
||||
buf2d_line dd sz_buf2d_line
|
||||
buf2d_rect_by_size dd sz_buf2d_rect_by_size
|
||||
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
|
||||
buf2d_circle dd sz_buf2d_circle
|
||||
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
|
||||
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
|
||||
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
|
||||
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
|
||||
buf2d_bit_blt dd sz_buf2d_bit_blt
|
||||
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
|
||||
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
|
||||
buf2d_curve_bezier dd sz_buf2d_curve_bezier
|
||||
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
|
||||
buf2d_draw_text dd sz_buf2d_draw_text
|
||||
buf2d_crop_color dd sz_buf2d_crop_color
|
||||
buf2d_offset_h dd sz_buf2d_offset_h
|
||||
buf2d_flood_fill dd sz_buf2d_flood_fill
|
||||
buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||
buf2d_get_pixel dd sz_buf2d_get_pixel
|
||||
dd 0,0
|
||||
sz_init db 'lib_init',0
|
||||
sz_buf2d_create db 'buf2d_create',0
|
||||
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||
sz_buf2d_clear db 'buf2d_clear',0
|
||||
sz_buf2d_draw db 'buf2d_draw',0
|
||||
sz_buf2d_delete db 'buf2d_delete',0
|
||||
sz_buf2d_resize db 'buf2d_resize',0
|
||||
sz_buf2d_line db 'buf2d_line',0
|
||||
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
|
||||
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
|
||||
sz_buf2d_circle db 'buf2d_circle',0
|
||||
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
|
||||
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
|
||||
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
|
||||
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
|
||||
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
|
||||
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
|
||||
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
|
||||
sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
|
||||
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
|
||||
sz_buf2d_draw_text db 'buf2d_draw_text',0
|
||||
sz_buf2d_crop_color db 'buf2d_crop_color',0
|
||||
sz_buf2d_offset_h db 'buf2d_offset_h',0
|
||||
sz_buf2d_flood_fill db 'buf2d_flood_fill',0
|
||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||
sz_buf2d_get_pixel db 'buf2d_get_pixel',0
|
||||
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
n dd sz_#n
|
||||
}
|
||||
include '../../../programs/develop/libraries/TinyGL/asm_fork/export.inc'
|
||||
dd 0,0
|
||||
macro E_LIB n
|
||||
{
|
||||
sz_#n db `n,0
|
||||
}
|
||||
include '../../../programs/develop/libraries/TinyGL/asm_fork/export.inc'
|
||||
include '../../develop/libraries/libs-dev/libimg/import.inc'
|
||||
include '../../develop/libraries/buf2d/import.inc'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/import.inc'
|
||||
|
||||
align 4
|
||||
buf_0: dd 0
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 644 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -259,99 +259,10 @@ aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
edit_box_set_text dd aEdit_box_set_text
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aEdit_box_set_text db 'edit_box_set_text',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_is_img dd aimg_is_img
|
||||
img_info dd aimg_info
|
||||
img_from_file dd aimg_from_file
|
||||
img_to_file dd aimg_to_file
|
||||
img_from_rgb dd aimg_from_rgb
|
||||
img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_encode dd aimg_encode
|
||||
img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
img_destroy_layer dd aimg_destroy_layer
|
||||
img_count dd aimg_count
|
||||
img_lock_bits dd aimg_lock_bits
|
||||
img_unlock_bits dd aimg_unlock_bits
|
||||
img_flip dd aimg_flip
|
||||
img_flip_layer dd aimg_flip_layer
|
||||
img_rotate dd aimg_rotate
|
||||
img_rotate_layer dd aimg_rotate_layer
|
||||
img_draw dd aimg_draw
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_is_img db 'img_is_img',0
|
||||
aimg_info db 'img_info',0
|
||||
aimg_from_file db 'img_from_file',0
|
||||
aimg_to_file db 'img_to_file',0
|
||||
aimg_from_rgb db 'img_from_rgb',0
|
||||
aimg_to_rgb db 'img_to_rgb',0
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0
|
||||
aimg_encode db 'img_encode',0
|
||||
aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
aimg_destroy_layer db 'img_destroy_layer',0
|
||||
aimg_count db 'img_count',0
|
||||
aimg_lock_bits db 'img_lock_bits',0
|
||||
aimg_unlock_bits db 'img_unlock_bits',0
|
||||
aimg_flip db 'img_flip',0
|
||||
aimg_flip_layer db 'img_flip_layer',0
|
||||
aimg_rotate db 'img_rotate',0
|
||||
aimg_rotate_layer db 'img_rotate_layer',0
|
||||
aimg_draw db 'img_draw',0
|
||||
Box_lib_import equ import_box_lib
|
||||
include '../../develop/libraries/box_lib/import.inc'
|
||||
include '../../develop/libraries/libs-dev/libimg/import.inc'
|
||||
;---------------------------------------------------------------------
|
||||
;width,left,top,color,shift_color,focus_border_color,\
|
||||
; blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
|
||||
|
@@ -140,13 +140,13 @@ still:
|
||||
jmp still
|
||||
@@:
|
||||
|
||||
cmp al,1
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,2
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,3
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
cmp al,6
|
||||
cmp al,EV_MOUSE
|
||||
jne @f
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
cmp ax,word[procinfo.window_stack_position]
|
||||
@@ -757,52 +757,6 @@ l_libs_start:
|
||||
lib_4 l_libs lib_name_4, file_name, system_dir_4, import_libkmenu
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_is_img dd aimg_is_img
|
||||
img_info dd aimg_info
|
||||
img_from_file dd aimg_from_file
|
||||
img_to_file dd aimg_to_file
|
||||
img_from_rgb dd aimg_from_rgb
|
||||
img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_encode dd aimg_encode
|
||||
img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
img_destroy_layer dd aimg_destroy_layer
|
||||
img_count dd aimg_count
|
||||
img_lock_bits dd aimg_lock_bits
|
||||
img_unlock_bits dd aimg_unlock_bits
|
||||
img_flip dd aimg_flip
|
||||
img_flip_layer dd aimg_flip_layer
|
||||
img_rotate dd aimg_rotate
|
||||
img_rotate_layer dd aimg_rotate_layer
|
||||
img_draw dd aimg_draw
|
||||
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_is_img db 'img_is_img',0 ;<3B><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ᤥ<><E1A4A5><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
aimg_info db 'img_info',0
|
||||
aimg_from_file db 'img_from_file',0
|
||||
aimg_to_file db 'img_to_file',0
|
||||
aimg_from_rgb db 'img_from_rgb',0
|
||||
aimg_to_rgb db 'img_to_rgb',0 ;<3B>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RGB
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;<3B><>⮬<EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD>᪨ <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
aimg_encode db 'img_encode',0
|
||||
aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
aimg_destroy_layer db 'img_destroy_layer',0
|
||||
aimg_count db 'img_count',0
|
||||
aimg_lock_bits db 'img_lock_bits',0
|
||||
aimg_unlock_bits db 'img_unlock_bits',0
|
||||
aimg_flip db 'img_flip',0
|
||||
aimg_flip_layer db 'img_flip_layer',0
|
||||
aimg_rotate db 'img_rotate',0
|
||||
aimg_rotate_layer db 'img_rotate_layer',0
|
||||
aimg_draw db 'img_draw',0
|
||||
|
||||
align 4
|
||||
import_proclib:
|
||||
@@ -816,110 +770,9 @@ dd 0,0
|
||||
aOpenDialog_Set_file_name db 'OpenDialog_set_file_name',0
|
||||
;aOpenDialog_Set_file_ext db 'OpenDialog_set_file_ext',0
|
||||
|
||||
align 4
|
||||
import_buf2d:
|
||||
init dd sz_init
|
||||
buf2d_create dd sz_buf2d_create
|
||||
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||
buf2d_clear dd sz_buf2d_clear
|
||||
buf2d_draw dd sz_buf2d_draw
|
||||
buf2d_delete dd sz_buf2d_delete
|
||||
buf2d_resize dd sz_buf2d_resize
|
||||
buf2d_line dd sz_buf2d_line
|
||||
buf2d_line_sm dd sz_buf2d_line_sm
|
||||
buf2d_rect_by_size dd sz_buf2d_rect_by_size
|
||||
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
|
||||
buf2d_circle dd sz_buf2d_circle
|
||||
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
|
||||
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
|
||||
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
|
||||
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
|
||||
buf2d_bit_blt dd sz_buf2d_bit_blt
|
||||
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
|
||||
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
|
||||
buf2d_curve_bezier dd sz_buf2d_curve_bezier
|
||||
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
|
||||
buf2d_draw_text dd sz_buf2d_draw_text
|
||||
buf2d_crop_color dd sz_buf2d_crop_color
|
||||
buf2d_flip_h dd sz_buf2d_flip_h
|
||||
buf2d_flip_v dd sz_buf2d_flip_v
|
||||
buf2d_offset_h dd sz_buf2d_offset_h
|
||||
buf2d_flood_fill dd sz_buf2d_flood_fill
|
||||
buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||
dd 0,0
|
||||
sz_init db 'lib_init',0
|
||||
sz_buf2d_create db 'buf2d_create',0
|
||||
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||
sz_buf2d_clear db 'buf2d_clear',0
|
||||
sz_buf2d_draw db 'buf2d_draw',0
|
||||
sz_buf2d_delete db 'buf2d_delete',0
|
||||
sz_buf2d_resize db 'buf2d_resize',0
|
||||
sz_buf2d_line db 'buf2d_line',0
|
||||
sz_buf2d_line_sm db 'buf2d_line_sm',0
|
||||
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
|
||||
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
|
||||
sz_buf2d_circle db 'buf2d_circle',0
|
||||
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
|
||||
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
|
||||
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
|
||||
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
|
||||
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
|
||||
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
|
||||
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
|
||||
sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
|
||||
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
|
||||
sz_buf2d_draw_text db 'buf2d_draw_text',0
|
||||
sz_buf2d_crop_color db 'buf2d_crop_color',0
|
||||
sz_buf2d_flip_h db 'buf2d_flip_h',0
|
||||
sz_buf2d_flip_v db 'buf2d_flip_v',0
|
||||
sz_buf2d_offset_h db 'buf2d_offset_h',0
|
||||
sz_buf2d_flood_fill db 'buf2d_flood_fill',0
|
||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||
|
||||
align 4
|
||||
import_box_lib:
|
||||
dd sz_init1
|
||||
|
||||
init_checkbox dd sz_Init_checkbox
|
||||
check_box_draw dd sz_Check_box_draw
|
||||
check_box_mouse dd sz_Check_box_mouse
|
||||
;version_ch dd sz_Version_ch
|
||||
|
||||
option_box_draw dd sz_Option_box_draw
|
||||
option_box_mouse dd sz_Option_box_mouse
|
||||
;version_op dd sz_Version_op
|
||||
|
||||
edit_box_draw dd sz_edit_box_draw
|
||||
edit_box_key dd sz_edit_box_key
|
||||
edit_box_mouse dd sz_edit_box_mouse
|
||||
edit_box_set_text dd sz_edit_box_set_text
|
||||
scrollbar_ver_draw dd sz_scrollbar_ver_draw
|
||||
scrollbar_hor_draw dd sz_scrollbar_hor_draw
|
||||
|
||||
progressbar_draw dd sz_progressbar_draw
|
||||
progressbar_progress dd sz_progressbar_progress
|
||||
|
||||
dd 0,0
|
||||
sz_init1 db 'lib_init',0
|
||||
|
||||
sz_Init_checkbox db 'init_checkbox2',0
|
||||
sz_Check_box_draw db 'check_box_draw2',0
|
||||
sz_Check_box_mouse db 'check_box_mouse2',0
|
||||
;sz_Version_ch db 'version_ch2',0
|
||||
|
||||
sz_Option_box_draw db 'option_box_draw',0
|
||||
sz_Option_box_mouse db 'option_box_mouse',0
|
||||
;sz_Version_op db 'version_op',0
|
||||
|
||||
sz_edit_box_draw db 'edit_box_draw',0
|
||||
sz_edit_box_key db 'edit_box_key',0
|
||||
sz_edit_box_mouse db 'edit_box_mouse',0
|
||||
sz_edit_box_set_text db 'edit_box_set_text',0
|
||||
sz_scrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
sz_scrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
|
||||
sz_progressbar_draw db 'progressbar_draw', 0
|
||||
sz_progressbar_progress db 'progressbar_progress', 0
|
||||
include '../../develop/libraries/libs-dev/libimg/import.inc'
|
||||
include '../../develop/libraries/buf2d/import.inc'
|
||||
include '../../develop/libraries/box_lib/import.inc'
|
||||
|
||||
align 4
|
||||
import_libkmenu:
|
||||
|
@@ -15,16 +15,16 @@ include 'cnc_editor.inc'
|
||||
include '../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
caption db 'CNC editor 23.05.19',0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
caption db 'CNC editor 07.05.25',0 ;window signature
|
||||
|
||||
run_file_70 FileInfoBlock
|
||||
|
||||
offs_last_timer dd 0 ;<3B><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> ᤢ<><E1A4A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>㭪樨 ⠩<><E2A0A9><EFBFBD><EFBFBD>
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
|
||||
image_data_toolbar dd 0 ;㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20>㦥<EFBFBD> <20>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
icon_tl_sys dd 0 ;㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
icon_toolbar dd 0 ;㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ꥪ⮢
|
||||
image_data_toolbar dd 0 ;pointer to temporary memory, needed for image conversion
|
||||
icon_tl_sys dd 0 ;pointer to memory for storing system icons
|
||||
icon_toolbar dd 0 ;pointer to memory for storing object icons
|
||||
|
||||
include 'wnd_point_coords.inc'
|
||||
include 'wnd_scale.inc'
|
||||
@@ -111,13 +111,13 @@ still:
|
||||
jmp still
|
||||
@@:
|
||||
|
||||
cmp al,1
|
||||
cmp al,EV_REDRAW
|
||||
jz red_win
|
||||
cmp al,2
|
||||
cmp al,EV_KEY
|
||||
jz key
|
||||
cmp al,3
|
||||
cmp al,EV_BUTTON
|
||||
jz button
|
||||
cmp al,6
|
||||
cmp al,EV_MOUSE
|
||||
jne @f
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
cmp ax,word[procinfo.window_stack_position]
|
||||
@@ -360,8 +360,7 @@ pushad
|
||||
cmp eax,dword[buf_0.h] ;ᬮ<>ਬ ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jne @f
|
||||
cmp ebx,dword[buf_0.w]
|
||||
jne @f
|
||||
jmp .end0
|
||||
je .end0
|
||||
@@:
|
||||
stdcall [buf2d_resize],buf_0,ebx,eax,1
|
||||
mov eax,ObjData
|
||||
@@ -2105,53 +2104,6 @@ l_libs_start:
|
||||
lib_3 l_libs lib_name_3, file_name, system_dir_3, import_box_lib
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_is_img dd aimg_is_img
|
||||
img_info dd aimg_info
|
||||
img_from_file dd aimg_from_file
|
||||
img_to_file dd aimg_to_file
|
||||
img_from_rgb dd aimg_from_rgb
|
||||
img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_encode dd aimg_encode
|
||||
img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
img_destroy_layer dd aimg_destroy_layer
|
||||
img_count dd aimg_count
|
||||
img_lock_bits dd aimg_lock_bits
|
||||
img_unlock_bits dd aimg_unlock_bits
|
||||
img_flip dd aimg_flip
|
||||
img_flip_layer dd aimg_flip_layer
|
||||
img_rotate dd aimg_rotate
|
||||
img_rotate_layer dd aimg_rotate_layer
|
||||
img_draw dd aimg_draw
|
||||
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_is_img db 'img_is_img',0 ;<3B><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ᤥ<><E1A4A5><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
aimg_info db 'img_info',0
|
||||
aimg_from_file db 'img_from_file',0
|
||||
aimg_to_file db 'img_to_file',0
|
||||
aimg_from_rgb db 'img_from_rgb',0
|
||||
aimg_to_rgb db 'img_to_rgb',0 ;<3B>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RGB
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;<3B><>⮬<EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD>᪨ <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
aimg_encode db 'img_encode',0
|
||||
aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
aimg_destroy_layer db 'img_destroy_layer',0
|
||||
aimg_count db 'img_count',0
|
||||
aimg_lock_bits db 'img_lock_bits',0
|
||||
aimg_unlock_bits db 'img_unlock_bits',0
|
||||
aimg_flip db 'img_flip',0
|
||||
aimg_flip_layer db 'img_flip_layer',0
|
||||
aimg_rotate db 'img_rotate',0
|
||||
aimg_rotate_layer db 'img_rotate_layer',0
|
||||
aimg_draw db 'img_draw',0
|
||||
|
||||
align 4
|
||||
import_proclib:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
@@ -2164,162 +2116,10 @@ dd 0,0
|
||||
aOpenDialog_Set_file_name db 'OpenDialog_set_file_name',0
|
||||
aOpenDialog_Set_file_ext db 'OpenDialog_set_file_ext',0
|
||||
|
||||
align 4
|
||||
import_buf2d:
|
||||
init dd sz_init
|
||||
buf2d_create dd sz_buf2d_create
|
||||
buf2d_create_f_img dd sz_buf2d_create_f_img
|
||||
buf2d_clear dd sz_buf2d_clear
|
||||
buf2d_draw dd sz_buf2d_draw
|
||||
buf2d_delete dd sz_buf2d_delete
|
||||
buf2d_resize dd sz_buf2d_resize
|
||||
buf2d_line dd sz_buf2d_line
|
||||
buf2d_line_sm dd sz_buf2d_line_sm
|
||||
buf2d_rect_by_size dd sz_buf2d_rect_by_size
|
||||
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
|
||||
buf2d_circle dd sz_buf2d_circle
|
||||
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
|
||||
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
|
||||
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
|
||||
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
|
||||
buf2d_bit_blt dd sz_buf2d_bit_blt
|
||||
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
|
||||
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
|
||||
buf2d_curve_bezier dd sz_buf2d_curve_bezier
|
||||
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
|
||||
buf2d_draw_text dd sz_buf2d_draw_text
|
||||
buf2d_crop_color dd sz_buf2d_crop_color
|
||||
buf2d_flip_h dd sz_buf2d_flip_h
|
||||
buf2d_flip_v dd sz_buf2d_flip_v
|
||||
buf2d_offset_h dd sz_buf2d_offset_h
|
||||
buf2d_flood_fill dd sz_buf2d_flood_fill
|
||||
buf2d_set_pixel dd sz_buf2d_set_pixel
|
||||
dd 0,0
|
||||
sz_init db 'lib_init',0
|
||||
sz_buf2d_create db 'buf2d_create',0
|
||||
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
|
||||
sz_buf2d_clear db 'buf2d_clear',0
|
||||
sz_buf2d_draw db 'buf2d_draw',0
|
||||
sz_buf2d_delete db 'buf2d_delete',0
|
||||
sz_buf2d_resize db 'buf2d_resize',0
|
||||
sz_buf2d_line db 'buf2d_line',0
|
||||
sz_buf2d_line_sm db 'buf2d_line_sm',0
|
||||
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
|
||||
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
|
||||
sz_buf2d_circle db 'buf2d_circle',0
|
||||
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
|
||||
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
|
||||
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
|
||||
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
|
||||
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
|
||||
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
|
||||
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
|
||||
sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
|
||||
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
|
||||
sz_buf2d_draw_text db 'buf2d_draw_text',0
|
||||
sz_buf2d_crop_color db 'buf2d_crop_color',0
|
||||
sz_buf2d_flip_h db 'buf2d_flip_h',0
|
||||
sz_buf2d_flip_v db 'buf2d_flip_v',0
|
||||
sz_buf2d_offset_h db 'buf2d_offset_h',0
|
||||
sz_buf2d_flood_fill db 'buf2d_flood_fill',0
|
||||
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
|
||||
include '../../develop/libraries/libs-dev/libimg/import.inc'
|
||||
include '../../develop/libraries/buf2d/import.inc'
|
||||
include '../../develop/libraries/box_lib/import.inc'
|
||||
|
||||
align 4
|
||||
import_box_lib:
|
||||
dd sz_init1
|
||||
|
||||
init_checkbox dd sz_Init_checkbox
|
||||
check_box_draw dd sz_Check_box_draw
|
||||
check_box_mouse dd sz_Check_box_mouse
|
||||
;version_ch dd sz_Version_ch
|
||||
|
||||
option_box_draw dd sz_Option_box_draw
|
||||
option_box_mouse dd sz_Option_box_mouse
|
||||
;version_op dd sz_Version_op
|
||||
|
||||
edit_box_draw dd sz_edit_box_draw
|
||||
edit_box_key dd sz_edit_box_key
|
||||
edit_box_mouse dd sz_edit_box_mouse
|
||||
edit_box_set_text dd sz_edit_box_set_text
|
||||
scrollbar_ver_draw dd sz_scrollbar_ver_draw
|
||||
scrollbar_hor_draw dd sz_scrollbar_hor_draw
|
||||
|
||||
tl_data_init dd sz_tl_data_init
|
||||
tl_data_clear dd sz_tl_data_clear
|
||||
tl_info_clear dd sz_tl_info_clear
|
||||
tl_key dd sz_tl_key
|
||||
tl_mouse dd sz_tl_mouse
|
||||
tl_draw dd sz_tl_draw
|
||||
tl_info_undo dd sz_tl_info_undo
|
||||
tl_info_redo dd sz_tl_info_redo
|
||||
tl_node_add dd sz_tl_node_add
|
||||
tl_node_set_data dd sz_tl_node_set_data
|
||||
tl_node_get_data dd sz_tl_node_get_data
|
||||
tl_node_delete dd sz_tl_node_delete
|
||||
tl_node_move_up dd sz_tl_node_move_up
|
||||
tl_node_move_down dd sz_tl_node_move_down
|
||||
tl_cur_beg dd sz_tl_cur_beg
|
||||
tl_cur_next dd sz_tl_cur_next
|
||||
tl_cur_perv dd sz_tl_cur_perv
|
||||
tl_node_close_open dd sz_tl_node_close_open
|
||||
tl_node_lev_inc dd sz_tl_node_lev_inc
|
||||
tl_node_lev_dec dd sz_tl_node_lev_dec
|
||||
tl_node_poi_get_info dd sz_tl_node_poi_get_info
|
||||
tl_node_poi_get_next_info dd sz_tl_node_poi_get_next_info
|
||||
tl_node_poi_get_data dd sz_tl_node_poi_get_data
|
||||
|
||||
dd 0,0
|
||||
sz_init1 db 'lib_init',0
|
||||
|
||||
sz_Init_checkbox db 'init_checkbox2',0
|
||||
sz_Check_box_draw db 'check_box_draw2',0
|
||||
sz_Check_box_mouse db 'check_box_mouse2',0
|
||||
;sz_Version_ch db 'version_ch2',0
|
||||
|
||||
sz_Option_box_draw db 'option_box_draw',0
|
||||
sz_Option_box_mouse db 'option_box_mouse',0
|
||||
;sz_Version_op db 'version_op',0
|
||||
|
||||
sz_edit_box_draw db 'edit_box_draw',0
|
||||
sz_edit_box_key db 'edit_box_key',0
|
||||
sz_edit_box_mouse db 'edit_box_mouse',0
|
||||
sz_edit_box_set_text db 'edit_box_set_text',0
|
||||
sz_scrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
sz_scrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
|
||||
sz_tl_data_init db 'tl_data_init',0
|
||||
sz_tl_data_clear db 'tl_data_clear',0
|
||||
sz_tl_info_clear db 'tl_info_clear',0
|
||||
sz_tl_key db 'tl_key',0
|
||||
sz_tl_mouse db 'tl_mouse',0
|
||||
sz_tl_draw db 'tl_draw',0
|
||||
sz_tl_info_undo db 'tl_info_undo',0
|
||||
sz_tl_info_redo db 'tl_info_redo',0
|
||||
sz_tl_node_add db 'tl_node_add',0
|
||||
sz_tl_node_set_data db 'tl_node_set_data',0
|
||||
sz_tl_node_get_data db 'tl_node_get_data',0
|
||||
sz_tl_node_delete db 'tl_node_delete',0
|
||||
sz_tl_node_move_up db 'tl_node_move_up',0
|
||||
sz_tl_node_move_down db 'tl_node_move_down',0
|
||||
sz_tl_cur_beg db 'tl_cur_beg',0
|
||||
sz_tl_cur_next db 'tl_cur_next',0
|
||||
sz_tl_cur_perv db 'tl_cur_perv',0
|
||||
sz_tl_node_close_open db 'tl_node_close_open',0
|
||||
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
|
||||
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
|
||||
sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
|
||||
sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
|
||||
sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
|
||||
|
||||
align 4
|
||||
mouse_dd dd 0
|
||||
last_time dd 0
|
||||
|
||||
align 16
|
||||
sc system_colors
|
||||
|
||||
align 16
|
||||
procinfo process_information
|
||||
|
||||
align 4
|
||||
buf_0: dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
@@ -2348,7 +2148,7 @@ buf_png:
|
||||
align 4
|
||||
el_focus dd tree1
|
||||
tree1 tree_list size_one_list,1000+2, tl_key_no_edit+tl_draw_par_line,\
|
||||
16,16, 0xffffff,0xb0d0ff,0x400040, 5,35,195-16,340, 16,Figure.Caption,0,\
|
||||
16,16, 0xffffff,0xb0d0ff,0x10400040, 5,35,195-16,340, 16,Figure.Caption,0,\
|
||||
el_focus,w_scr_t1,0
|
||||
|
||||
align 4
|
||||
@@ -2400,6 +2200,14 @@ endp
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
mouse_dd dd 0
|
||||
last_time dd 0
|
||||
|
||||
align 16
|
||||
sc system_colors
|
||||
|
||||
align 16
|
||||
procinfo process_information
|
||||
rb 2048
|
||||
thread_coords:
|
||||
rb 2048
|
||||
|
@@ -81,148 +81,7 @@ lib_name_5 db 'kmenu.obj',0
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_box_lib:
|
||||
dd alib_init0 ;<EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪠<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮬ 1 ࠧ <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>, <EFBFBD><EFBFBD>⮬<EFBFBD> <EFBFBD> <EFBFBD>ணࠬ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⪠ <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>㦭<EFBFBD>
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
;edit_box_set_text dd aEdit_box_set_text
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd ainit_checkbox
|
||||
check_box_draw dd acheck_box_draw
|
||||
check_box_mouse dd acheck_box_mouse
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
scrollbar_ver_draw dd aScrollbar_ver_draw
|
||||
scrollbar_ver_mouse dd aScrollbar_ver_mouse
|
||||
scrollbar_hor_draw dd aScrollbar_hor_draw
|
||||
scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
||||
;version_scrollbar dd aVersion_scrollbar
|
||||
|
||||
tl_data_init dd sz_tl_data_init
|
||||
tl_data_clear dd sz_tl_data_clear
|
||||
tl_info_clear dd sz_tl_info_clear
|
||||
tl_key dd sz_tl_key
|
||||
tl_mouse dd sz_tl_mouse
|
||||
tl_draw dd sz_tl_draw
|
||||
tl_info_undo dd sz_tl_info_undo
|
||||
tl_info_redo dd sz_tl_info_redo
|
||||
tl_node_add dd sz_tl_node_add
|
||||
tl_node_set_data dd sz_tl_node_set_data
|
||||
tl_node_get_data dd sz_tl_node_get_data
|
||||
tl_node_delete dd sz_tl_node_delete
|
||||
tl_cur_beg dd sz_tl_cur_beg
|
||||
tl_cur_next dd sz_tl_cur_next
|
||||
tl_cur_perv dd sz_tl_cur_perv
|
||||
;tl_node_close_open dd sz_tl_node_close_open
|
||||
tl_node_lev_inc dd sz_tl_node_lev_inc
|
||||
tl_node_lev_dec dd sz_tl_node_lev_dec
|
||||
|
||||
ted_but_sumb_upper dd sz_ted_but_sumb_upper
|
||||
ted_but_sumb_lover dd sz_ted_but_sumb_lover
|
||||
ted_but_convert_by_table dd sz_ted_but_convert_by_table
|
||||
ted_can_save dd sz_ted_can_save
|
||||
ted_clear dd sz_ted_clear
|
||||
ted_delete dd sz_ted_delete
|
||||
ted_draw dd sz_ted_draw
|
||||
ted_init dd sz_ted_init
|
||||
ted_init_scroll_bars dd sz_ted_init_scroll_bars
|
||||
ted_init_syntax_file dd sz_ted_init_syntax_file
|
||||
ted_is_select dd sz_ted_is_select
|
||||
ted_key dd sz_ted_key
|
||||
ted_mouse dd sz_ted_mouse
|
||||
ted_open_file dd sz_ted_open_file
|
||||
ted_save_file dd sz_ted_save_file
|
||||
ted_text_add dd sz_ted_text_add
|
||||
ted_but_select_word dd sz_ted_but_select_word
|
||||
ted_but_cut dd sz_ted_but_cut
|
||||
ted_but_copy dd sz_ted_but_copy
|
||||
ted_but_paste dd sz_ted_but_paste
|
||||
ted_but_undo dd sz_ted_but_undo
|
||||
ted_but_redo dd sz_ted_but_redo
|
||||
ted_but_reverse dd sz_ted_but_reverse
|
||||
ted_but_find dd sz_ted_but_find
|
||||
ted_but_replace dd sz_ted_but_replace
|
||||
ted_text_colored dd sz_ted_text_colored
|
||||
ted_go_to_position dd sz_ted_go_to_position
|
||||
version_text_edit dd sz_ted_version
|
||||
|
||||
dd 0,0
|
||||
alib_init0 db 'lib_init',0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
;aEdit_box_set_text db 'edit_box_set_text',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
ainit_checkbox db 'init_checkbox2',0
|
||||
acheck_box_draw db 'check_box_draw2',0
|
||||
acheck_box_mouse db 'check_box_mouse2',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
aScrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
|
||||
aScrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
||||
;aVersion_scrollbar db 'version_scrollbar',0
|
||||
|
||||
sz_tl_data_init db 'tl_data_init',0
|
||||
sz_tl_data_clear db 'tl_data_clear',0
|
||||
sz_tl_info_clear db 'tl_info_clear',0
|
||||
sz_tl_key db 'tl_key',0
|
||||
sz_tl_mouse db 'tl_mouse',0
|
||||
sz_tl_draw db 'tl_draw',0
|
||||
sz_tl_info_undo db 'tl_info_undo',0
|
||||
sz_tl_info_redo db 'tl_info_redo',0
|
||||
sz_tl_node_add db 'tl_node_add',0
|
||||
sz_tl_node_set_data db 'tl_node_set_data',0
|
||||
sz_tl_node_get_data db 'tl_node_get_data',0
|
||||
sz_tl_node_delete db 'tl_node_delete',0
|
||||
sz_tl_cur_beg db 'tl_cur_beg',0
|
||||
sz_tl_cur_next db 'tl_cur_next',0
|
||||
sz_tl_cur_perv db 'tl_cur_perv',0
|
||||
;sz_tl_node_close_open db 'tl_node_close_open',0
|
||||
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
|
||||
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
|
||||
|
||||
sz_ted_but_sumb_upper db 'ted_but_sumb_upper',0
|
||||
sz_ted_but_sumb_lover db 'ted_but_sumb_lover',0
|
||||
sz_ted_but_convert_by_table db 'ted_but_convert_by_table',0
|
||||
sz_ted_can_save db 'ted_can_save',0
|
||||
sz_ted_clear db 'ted_clear',0
|
||||
sz_ted_delete db 'ted_delete',0
|
||||
sz_ted_draw db 'ted_draw',0
|
||||
sz_ted_init db 'ted_init',0
|
||||
sz_ted_init_scroll_bars db 'ted_init_scroll_bars',0
|
||||
sz_ted_init_syntax_file db 'ted_init_syntax_file',0
|
||||
sz_ted_is_select db 'ted_is_select',0
|
||||
sz_ted_key db 'ted_key',0
|
||||
sz_ted_mouse db 'ted_mouse',0
|
||||
sz_ted_open_file db 'ted_open_file',0
|
||||
sz_ted_save_file db 'ted_save_file',0
|
||||
sz_ted_text_add db 'ted_text_add',0
|
||||
sz_ted_but_select_word db 'ted_but_select_word',0
|
||||
sz_ted_but_cut db 'ted_but_cut',0
|
||||
sz_ted_but_copy db 'ted_but_copy',0
|
||||
sz_ted_but_paste db 'ted_but_paste',0
|
||||
sz_ted_but_undo db 'ted_but_undo',0
|
||||
sz_ted_but_redo db 'ted_but_redo',0
|
||||
sz_ted_but_reverse db 'ted_but_reverse',0
|
||||
sz_ted_but_find db 'ted_but_find',0
|
||||
sz_ted_but_replace db 'ted_but_replace',0
|
||||
sz_ted_text_colored db 'ted_text_colored',0
|
||||
sz_ted_go_to_position db 'ted_go_to_position',0
|
||||
sz_ted_version db 'version_text_edit',0
|
||||
include '../../develop/libraries/box_lib/import.inc'
|
||||
|
||||
align 4
|
||||
import_proclib:
|
||||
@@ -242,17 +101,7 @@ dd 0,0
|
||||
amb_reinit db 'mb_reinit',0
|
||||
amb_setfunctions db 'mb_setfunctions',0
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_destroy dd aimg_destroy
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;<EFBFBD><EFBFBD>⮬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨ <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ଠ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
aimg_destroy db 'img_destroy',0
|
||||
include '../../develop/libraries/libs-dev/libimg/import.inc'
|
||||
|
||||
align 4
|
||||
import_libini:
|
||||
|
@@ -394,11 +394,11 @@ p_syntax:
|
||||
mov ecx,ted_wnd_t
|
||||
shl ecx,16
|
||||
mov cx,20
|
||||
mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work] ;drawing the top background rectangle
|
||||
|
||||
stdcall [tl_draw], tree1
|
||||
mov [ws_dir_lbox.all_redraw],1 ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
stdcall [scrollbar_ver_draw], ws_dir_lbox
|
||||
mov [ws_dir_lbox.all_redraw],1 ;for a complete redraw of the child scroll
|
||||
stdcall [scrollbar_v_draw], ws_dir_lbox
|
||||
|
||||
ror ecx,16
|
||||
add ecx,[tree1.box_height]
|
||||
@@ -411,7 +411,7 @@ p_syntax:
|
||||
sub cx,20
|
||||
sub ecx,[tree1.box_height]
|
||||
inc cx
|
||||
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int 0x40 ;drawing the bottom background rectangle
|
||||
|
||||
mov ecx,ted_wnd_t
|
||||
add ecx,25
|
||||
@@ -436,7 +436,7 @@ p_syntax:
|
||||
popad
|
||||
ret
|
||||
|
||||
MIN_M_WND_H equ 100 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
MIN_M_WND_H equ 100 ;minimum height of main window
|
||||
;input:
|
||||
; edi = pointer to tedit struct
|
||||
align 4
|
||||
|
@@ -80,7 +80,7 @@ pushad
|
||||
@@:
|
||||
|
||||
mov dword[w_scr_t3.all_redraw],1
|
||||
stdcall [scrollbar_ver_draw], w_scr_t3
|
||||
stdcall [scrollbar_v_draw], w_scr_t3
|
||||
stdcall [tl_draw], tree3
|
||||
stdcall [edit_box_draw], edit3
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
|
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 734 B |