Skip to content

Commit

Permalink
2.27.36
Browse files Browse the repository at this point in the history
  • Loading branch information
nidud committed Aug 9, 2018
1 parent 1c389a2 commit 2403c40
Show file tree
Hide file tree
Showing 20 changed files with 1,919 additions and 451 deletions.
Binary file modified bin/asmc.exe
Binary file not shown.
Binary file modified bin/asmc64.exe
Binary file not shown.
190 changes: 101 additions & 89 deletions include/tdialog.inc
Expand Up @@ -39,33 +39,6 @@ B_InvMenus equ 10
B_TextView equ 12
B_TextEdit equ 13

TCOLOR struc
foreground db 16 dup(?)
background db 16 dup(?)
TCOLOR ends

CURSOR_NORMAL equ 16

.classdef TCursor

CursorInfo CONSOLE_CURSOR_INFO <>
CursorPosition COORD <>

.ends


.classdef Clipboard

cp LPSTR ?
clen UINT ?

Free proc
Copy proc :LPSTR, :UINT
Paste proc

.ends


KEY_ALT equ 0x08
KEY_CTRL equ 0x04
KEY_SHIFT equ 0x03
Expand Down Expand Up @@ -258,35 +231,19 @@ SHIFT_MOUSEMOVED equ 0x00800000
SHIFT_MOUSEFLAGS equ 0x00FF0000
SHIFT_RELEASEKEY equ 0x80000000

MAXKEYSTACK equ 32

.classdef TEvent

keyshift dd ?
keybchar db ?
keybscan db ?
keybcode db ?
keybstate db ?
keybmouse_x dd ?
keybmouse_y dd ?
keybcount dd ?
keybstack dd MAXKEYSTACK dup(?)

ReadEvent proc
GetEvent proc
GetShiftState proc
MousePress proc
GetMouseX proc
GetMouseY proc
PushEvent proc :UINT
PopEvent proc
SetKeyState proc

.ends

MAXKEYSTACK equ 32
CURSOR_NORMAL equ 16

.pragma pack(push, 1)

CURSOR STRUC ; CONSOLE_CURSOR_INFO
dwSize dd ? ; .dwSize 1..100
bVisible dd ? ; .bVisible 0..1
x dw ? ; word x,y COORD
y dw ?
CURSOR ENDS
PCURSOR TYPEDEF PTR CURSOR

TRECT STRUC
x db ?
y db ?
Expand Down Expand Up @@ -339,11 +296,10 @@ _O_DEACT equ _O_STATE

.classdef TObject :LPROBJECT

_prev LPTOBJECT ?
_next LPTOBJECT ?

Flags UINT ?
Rect SMALL_RECT <>
flags dw ?
count db ?
index db ?
rc TRECT <>
pData PVOID ?

.ends
Expand All @@ -355,59 +311,115 @@ _TW_MOVEABLE equ 0x04
_TW_USESHADE equ 0x08
_TW_USECOLOR equ 0x10

.classdef TWindow :SINT, :SINT, :SINT, :SINT
.classdef TWindow

flags UINT ?
rect SMALL_RECT <>
window PCHAR_INFO ?
backgr PCHAR_INFO ?
shade PCHAR_INFO ?
flags UINT ?
rc TRECT <>
window PCHAR_INFO ?

Show proc
Hide proc
Read proc
Write proc :PCHAR_INFO
Move proc :SINT, :SINT
SetShade proc
ClearShade proc
Putc proc :SINT, :SINT, :BYTE, :SINT, :SBYTE
Puts proc :SINT, :SINT, :BYTE, :SINT, :LPSTR
Read proc
Write proc
Exchange proc
Setshade proc
Clearshade proc
Getshadeptr proc
Readshade proc
Alloc proc
Windowsize proc
Xyrow proc :SINT, :SINT
Winoffset proc :SINT, :SINT
Inside proc :TRECT
OPutw proc :UINT, :UINT, :UINT
OPutfg proc :UINT, :UINT, :BYTE
OPutbg proc :UINT, :UINT, :BYTE
OPuts proc :UINT, :UINT, :LPSTR
OPutsEx proc :UINT, :UINT, :BYTE, :BYTE, :LPSTR
OPath proc :UINT, :UINT, :LPSTR
OCenter proc :UINT, :UINT, :LPSTR

.ends


.classdef TDialog :LPIDDOBJ
.classdef TDialog

flags UINT ?
count UINT ?
index UINT ?
window LPTWINDOW ?
object LPTOBJECT ?

Show proc
Hide proc
Open proc :TRECT, :UINT
OpenIDD proc :LPIDDOBJ

.ends


.classdef TConsole

flags UINT ?
rect SMALL_RECT <>
window PCHAR_INFO ?
backgr PCHAR_INFO ?

Show proc
Hide proc
Read proc
Write proc :PCHAR_INFO
GetChar proc :SINT, :SINT
PutChar proc :SINT, :SINT, :UINT
IsInsideX proc :SINT
IsInsideY proc :SINT
IsInsideXY proc :SINT, :SINT
SetMaxConsole proc
SetConsoleSize proc cols:UINT, rows:UINT
flags UINT ?
rc TRECT <>
window PCHAR_INFO ?
backgr PCHAR_INFO ?

foreground db 16 dup(?)
background db 16 dup(?)

keyshift dd ?
keybchar db ?
keybscan db ?
keybcode db ?
keybstate db ?
keybmouse_x dd ?
keybmouse_y dd ?
keybcount dd ?
keybstack dd MAXKEYSTACK dup(?)

clipboard dq ?
clipbsize dd ?


Update proc
Hide proc
Read proc
Write proc :PCHAR_INFO
Getchar proc :SINT, :SINT
Putchar proc :SINT, :SINT, :UINT
Putattrib proc :SINT, :SINT, :UINT
Getattrib proc :UINT, :UINT
Setattrib proc :BYTE
Clrconsole proc
CPrintf proc :SINT, :SINT, :LPSTR, :VARARG
CPuta proc :SINT, :SINT, :SINT, :BYTE
Getrectptr proc :TRECT
Insidex proc :SINT
Insidey proc :SINT
Inside proc :SINT, :SINT
Maxconsole proc
Setconsole proc :UINT, :UINT
Moveconsole proc :UINT, :UINT

Readevent proc
Getevent proc
Getch proc
Shiftstate proc
Mousepress proc
Getmousex proc
Getmousey proc
Pushevent proc :UINT
Popevent proc
SetKeystate proc

ClipFree proc
ClipCopy proc :LPSTR, :UINT
ClipPaste proc

CursorOn proc
CursorOff proc
CursorGet proc :PCURSOR
CursorSet proc :PCURSOR

.ends

Expand Down
7 changes: 6 additions & 1 deletion source/asmc/src/X86/asmc.asm
Expand Up @@ -14,7 +14,9 @@ close_files proto
CmdlineFini proto
ParseCmdline proto :ptr, :ptr
write_usage proto

ifdef __ASMC64__
define_name proto :LPSTR, :LPSTR
endif
.code

strfcat proc uses esi edi ecx edx buffer:LPSTR, path:LPSTR, file:LPSTR
Expand Down Expand Up @@ -125,6 +127,9 @@ if CATCHBREAK
else
signal(SIGTERM, GeneralFailure)
endif
ifdef __ASMC64__
define_name( "_WIN64", "1" )
endif

xor eax,eax
mov rc,eax
Expand Down
10 changes: 10 additions & 0 deletions source/asmc/src/X86/assemble.asm
Expand Up @@ -473,7 +473,9 @@ ModulePassInit proc uses esi
mov eax,ecx
and eax,P_CPU_MASK

ifndef __ASMC64__
.if ModuleInfo.sub_format == SFORMAT_64BIT
endif
;
; v2.06: force cpu to be at least P_64, without side effect to Options.cpu
;
Expand All @@ -494,6 +496,7 @@ ModulePassInit proc uses esi
mov ModuleInfo.langtype,LANG_SYSCALL
.endif
.endif
ifndef __ASMC64__
.else
;
; if model FLAT is to be set, ensure that cpu is compat.
Expand All @@ -503,19 +506,26 @@ ModulePassInit proc uses esi
mov ecx,P_386
.endif
.endif
endif
SetCPU(ecx)
;
; table ModelToken starts with MODEL_TINY, which is index 1"
;
ifndef __ASMC64__
.if esi != MODEL_NONE

AddLineQueueX("%r %s", T_DOT_MODEL, ModelToken[esi*4-4])
.endif
endif
.endif

movzx eax,Options.masm51_compat
SetMasm510(eax)
ifndef __ASMC64__
mov ModuleInfo.defOfssize,USE16
else
mov ModuleInfo.defOfssize,USE64
endif
mov ModuleInfo.ljmp,1
mov al,Options.write_listing
mov ModuleInfo.list,al
Expand Down
15 changes: 15 additions & 0 deletions source/asmc/src/X86/fastcall.asm
Expand Up @@ -9,7 +9,9 @@ include token.inc
public fastcall_tab

GetGroup proto :ptr asym
ifndef __ASMC64__
GetSegmentPart proto :ptr expr, :LPSTR, :LPSTR
endif
search_assume proto :ptr asym, :SINT, :SINT

invoke_conv struc
Expand Down Expand Up @@ -46,6 +48,7 @@ REGPAR_WIN64 equ 0x0306 ; regs 1, 2, 8 and 9
REGPAR_ELF64 equ 0x03C6 ; regs 1, 2, 6, 7, 8 and 9

fastcall_tab label invoke_conv
ifndef __ASMC64__
dd ms32_fcstart, ms32_fcend , ms32_param ; FCT_MSC
dd watc_fcstart, watc_fcend , watc_param ; FCT_WATCOMC
dd ms64_fcstart, ms64_fcend , ms64_param ; FCT_WIN64
Expand All @@ -58,6 +61,14 @@ ms16_regs label byte

ms32_regs label byte
db T_ECX, T_EDX
else
dd 0, 0, 0 ; FCT_MSC
dd 0, 0, 0 ; FCT_WATCOMC
dd ms64_fcstart, ms64_fcend , ms64_param ; FCT_WIN64
dd elf64_fcstart,elf64_fcend,elf64_param ; FCT_ELF64
dd 0, 0, 0 ; FCT_VEC32
dd ms64_fcstart, ms64_fcend , ms64_param ; FCT_VEC64
endif

ms64_regs label byte
db T_CL, T_DL, T_R8B, T_R9B
Expand Down Expand Up @@ -97,6 +108,7 @@ GetSegm macro x
exitm<[x].asym._segment>
endm

ifndef __ASMC64__
GetSegmentPart proc uses esi edi ebx opnd:ptr expr, buffer:LPSTR, fullparam:LPSTR

mov esi,T_NULL
Expand Down Expand Up @@ -147,6 +159,7 @@ GetSegmentPart proc uses esi edi ebx opnd:ptr expr, buffer:LPSTR, fullparam:LPST
ret

GetSegmentPart endp
endif

option proc:private

Expand All @@ -169,6 +182,7 @@ GetParmIndex macro x
;-------------------------------------------------------------------------------
; FCT_MSC
;-------------------------------------------------------------------------------
ifndef __ASMC64__

ms32_fcstart proc pp:ptr nsym, numparams:SINT, start:SINT,
tokenarray:ptr asm_tok, value:ptr SINT
Expand Down Expand Up @@ -558,6 +572,7 @@ watc_fcend proc pp, numparams, value
ret

watc_fcend endp
endif

;-------------------------------------------------------------------------------
; FCT_WIN64
Expand Down

0 comments on commit 2403c40

Please sign in to comment.