├── .gitattributes ├── .gitignore ├── .vscode └── tasks.json ├── License ├── build.bat ├── documents ├── File_list_EN.mht ├── File_list_ZH.mht ├── MemMap.txt └── syscalls doc.txt ├── readme.md ├── src ├── apps │ ├── date │ │ └── date.asm │ ├── debug │ │ └── debug.asm │ ├── echo │ │ └── echo.asm │ ├── hello │ │ └── hello.asm │ ├── include │ │ └── string.inc │ ├── ls │ │ └── ls.asm │ └── time │ │ └── time.asm ├── bootsector │ ├── bootsect.asm │ └── bootsect.h ├── kernel │ ├── drivers │ │ ├── console.inc │ │ ├── i8259A.inc │ │ ├── keyboard.inc │ │ └── ramdiskfs.inc │ ├── include │ │ ├── ascii.h │ │ ├── drivers │ │ │ ├── console.h │ │ │ ├── i8259A.h │ │ │ ├── keyboard.h │ │ │ └── ramdiskfs.h │ │ ├── process.h │ │ └── sys32.h │ ├── misc.inc │ ├── pkernel.asm │ ├── process.inc │ └── sys32.inc └── shell │ ├── include │ ├── ascii.h │ ├── process.h │ └── string.inc │ └── shell.asm └── tools ├── Flat Assembler ├── EXAMPLES │ ├── BEER │ │ ├── BEER.ASM │ │ └── BEER.EXE │ ├── DDRAW │ │ ├── DDRAW.ASM │ │ ├── DDRAW.EXE │ │ ├── DDRAW.GIF │ │ ├── DDRAW.INC │ │ └── GIF87A.INC │ ├── DIALOG │ │ ├── DIALOG.ASM │ │ └── DIALOG.EXE │ ├── DLL │ │ ├── ERRORMSG.ASM │ │ ├── ERRORMSG.DLL │ │ ├── LASTERR.ASM │ │ └── LASTERR.EXE │ ├── HELLO │ │ ├── HELLO.ASM │ │ ├── HELLO.EXE │ │ ├── Program.ASM │ │ ├── Program.EXE │ │ ├── Program.sym │ │ └── program.ico │ ├── MINIPAD │ │ ├── MINIPAD.ASM │ │ ├── MINIPAD.EXE │ │ └── MINIPAD.ICO │ ├── MSCOFF │ │ ├── MSCOFF.ASM │ │ └── MSCOFF.OBJ │ ├── OPENGL │ │ ├── OPENGL.ASM │ │ ├── OPENGL.EXE │ │ └── OPENGL.INC │ ├── PEDEMO │ │ ├── PEDEMO.ASM │ │ ├── PEDEMO.EXE │ │ ├── Program.ASM │ │ ├── Program.EXE │ │ └── Program.sym │ ├── TEMPLATE │ │ ├── TEMPLATE.ASM │ │ └── TEMPLATE.EXE │ ├── USECOM │ │ ├── USECOM.ASM │ │ └── USECOM.EXE │ └── WIN64 │ │ ├── DLL │ │ ├── MSGDEMO.ASM │ │ ├── MSGDEMO.EXE │ │ ├── WRITEMSG.ASM │ │ └── WRITEMSG.DLL │ │ ├── MANDEL │ │ ├── DDRAW64.INC │ │ ├── MANDEL.ASM │ │ └── MANDEL.EXE │ │ ├── OPENGL │ │ ├── OPENGL.ASM │ │ └── OPENGL.EXE │ │ ├── PE64DEMO │ │ ├── PE64DEMO.ASM │ │ └── PE64DEMO.EXE │ │ ├── TEMPLATE │ │ ├── TEMPLATE.ASM │ │ └── TEMPLATE.EXE │ │ └── USECOM │ │ ├── USECOM.ASM │ │ └── USECOM.EXE ├── FASM.EXE ├── FASM.PDF ├── FASMW.EXE ├── FASMW.INI ├── INCLUDE │ ├── API │ │ ├── ADVAPI32.INC │ │ ├── COMCTL32.INC │ │ ├── COMDLG32.INC │ │ ├── GDI32.INC │ │ ├── KERNEL32.INC │ │ ├── SHELL32.INC │ │ ├── USER32.INC │ │ └── WSOCK32.INC │ ├── ENCODING │ │ ├── UTF8.INC │ │ ├── WIN1250.INC │ │ ├── WIN1251.INC │ │ ├── WIN1252.INC │ │ ├── WIN1253.INC │ │ ├── WIN1254.INC │ │ ├── WIN1255.INC │ │ ├── WIN1256.INC │ │ ├── WIN1257.INC │ │ ├── WIN1258.INC │ │ └── WIN874.INC │ ├── EQUATES │ │ ├── COMCTL32.INC │ │ ├── COMCTL64.INC │ │ ├── COMDLG32.INC │ │ ├── COMDLG64.INC │ │ ├── GDI32.INC │ │ ├── GDI64.INC │ │ ├── KERNEL32.INC │ │ ├── KERNEL64.INC │ │ ├── SHELL32.INC │ │ ├── SHELL64.INC │ │ ├── USER32.INC │ │ ├── USER64.INC │ │ └── WSOCK32.INC │ ├── MACRO │ │ ├── COM32.INC │ │ ├── COM64.INC │ │ ├── EXPORT.INC │ │ ├── IF.INC │ │ ├── IMPORT32.INC │ │ ├── IMPORT64.INC │ │ ├── MASM.INC │ │ ├── PROC32.INC │ │ ├── PROC64.INC │ │ ├── RESOURCE.INC │ │ └── STRUCT.INC │ ├── PCOUNT │ │ ├── ADVAPI32.INC │ │ ├── COMCTL32.INC │ │ ├── COMDLG32.INC │ │ ├── GDI32.INC │ │ ├── KERNEL32.INC │ │ ├── SHELL32.INC │ │ ├── USER32.INC │ │ └── WSOCK32.INC │ ├── WIN32A.INC │ ├── WIN32AX.INC │ ├── WIN32AXP.INC │ ├── WIN32W.INC │ ├── WIN32WX.INC │ ├── WIN32WXP.INC │ ├── WIN64A.INC │ ├── WIN64AX.INC │ ├── WIN64AXP.INC │ ├── WIN64W.INC │ ├── WIN64WX.INC │ └── WIN64WXP.INC ├── LICENSE.TXT ├── SOURCE │ ├── ASSEMBLE.INC │ ├── AVX.INC │ ├── DOS │ │ ├── FASM.ASM │ │ ├── MODES.INC │ │ └── SYSTEM.INC │ ├── ERRORS.INC │ ├── EXPRCALC.INC │ ├── EXPRPARS.INC │ ├── FORMATS.INC │ ├── IDE │ │ ├── BLOCKS.INC │ │ ├── EDIT.INC │ │ ├── FASMD │ │ │ └── FASMD.ASM │ │ ├── FASMW │ │ │ ├── ASMEDIT.ASH │ │ │ ├── ASMEDIT.INC │ │ │ ├── FASM.INC │ │ │ ├── FASMW.ASM │ │ │ ├── FASMW.EXE │ │ │ ├── FASMW.sym │ │ │ ├── FEDIT.ASH │ │ │ ├── FEDIT.INC │ │ │ └── RESOURCE │ │ │ │ ├── ASSIGN.BMP │ │ │ │ └── FASMW.ICO │ │ ├── MEMORY.INC │ │ ├── NAVIGATE.INC │ │ ├── SEARCH.INC │ │ ├── UNDO.INC │ │ ├── VARIABLE.INC │ │ └── VERSION.INC │ ├── LIBC │ │ ├── FASM.ASM │ │ └── SYSTEM.INC │ ├── LINUX │ │ ├── FASM.ASM │ │ └── SYSTEM.INC │ ├── MESSAGES.INC │ ├── PARSER.INC │ ├── PREPROCE.INC │ ├── SYMBDUMP.INC │ ├── TABLES.INC │ ├── VARIABLE.INC │ ├── VERSION.INC │ ├── VFASMCORE │ │ ├── VFASMCORE.ASM │ │ ├── VFASMCORE.DLL │ │ ├── VFASMCORE.def │ │ ├── VFASMCORE.sym │ │ ├── VFCINTERFACE.INC │ │ ├── lib │ │ │ ├── vfasmcore.exp │ │ │ └── vfasmcore.lib │ │ ├── makelib.bat │ │ ├── test │ │ │ ├── Debug │ │ │ │ ├── test.exe │ │ │ │ ├── test.ilk │ │ │ │ └── test.pdb │ │ │ ├── test.ncb │ │ │ ├── test.sln │ │ │ ├── test.suo │ │ │ └── test │ │ │ │ ├── Debug │ │ │ │ ├── BuildLog.htm │ │ │ │ ├── mt.dep │ │ │ │ ├── stdafx.obj │ │ │ │ ├── test.exe.embed.manifest │ │ │ │ ├── test.exe.embed.manifest.res │ │ │ │ ├── test.exe.intermediate.manifest │ │ │ │ ├── test.obj │ │ │ │ ├── test.pch │ │ │ │ ├── vc90.idb │ │ │ │ └── vc90.pdb │ │ │ │ ├── ReadMe.txt │ │ │ │ ├── VFASMCORE.DLL │ │ │ │ ├── stdafx.cpp │ │ │ │ ├── stdafx.h │ │ │ │ ├── targetver.h │ │ │ │ ├── test.cpp │ │ │ │ ├── test.vcproj │ │ │ │ ├── test.vcproj.Shion-PC.Tishion.user │ │ │ │ ├── vfasmcore.h │ │ │ │ └── vfasmcore.lib │ │ ├── tools │ │ │ ├── lib.exe │ │ │ ├── link.exe │ │ │ └── mspdb80.dll │ │ └── vfasmcore.h │ ├── WIN32 │ │ ├── FASM.ASM │ │ ├── FASM.EXE │ │ └── SYSTEM.INC │ └── X86_64.INC ├── TOOLS │ ├── DOS │ │ ├── LISTING.ASM │ │ ├── LOADER.INC │ │ ├── PREPSRC.ASM │ │ ├── SYMBOLS.ASM │ │ └── SYSTEM.INC │ ├── LIBC │ │ ├── CCALL.INC │ │ ├── LISTING.ASM │ │ ├── PREPSRC.ASM │ │ ├── SYMBOLS.ASM │ │ └── SYSTEM.INC │ ├── LISTING.INC │ ├── PREPSRC.INC │ ├── README.TXT │ ├── SYMBOLS.INC │ └── WIN32 │ │ ├── LISTING.ASM │ │ ├── PREPSRC.ASM │ │ ├── SYMBOLS.ASM │ │ └── SYSTEM.INC ├── WHATSNEW.TXT ├── readme_EN.txt └── readme_ZH.txt └── mtools ├── COPYING ├── README ├── mcopy.exe ├── mformat.exe └── mmd.exe /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "0.1.0", 5 | "command": "cmd", 6 | "isShellCommand": true, 7 | "args": ["Hello World"], 8 | "showOutput": "always", 9 | "tasks": [ 10 | { 11 | "taskName": "Build", 12 | "args": [ 13 | "/C", 14 | "${workspaceRoot}/build.bat" 15 | ], 16 | "isBuildCommand": true 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Sheen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Build batch file for Piscos OS 3 | rem Author: Tishion (tishion#163.com) 4 | rem 2016-03-26 11:58:38 5 | 6 | set RUN=%~1% 7 | echo %RUN% 8 | 9 | rem change work directory to build folder 10 | set PROJ_ROOT=%~dp0 11 | set FASM_PATH=%PROJ_ROOT%tools\Flat Assembler\FASM.EXE 12 | set SRC_ROOT=%PROJ_ROOT%src\ 13 | set SRC_APPS=%SRC_ROOT%apps\ 14 | set OUT_ROOT=%PROJ_ROOT%out\ 15 | set IMG_ROOT=%PROJ_ROOT%image\ 16 | set IMG_PATH=%IMG_ROOT%piscisos.img 17 | set BOCHS_SCRIPT=%IMG_ROOT%bochsrc.bxrc 18 | set OUT_APPS=%OUT_ROOT%bin\ 19 | set MTOOL_ROOT=%PROJ_ROOT%tools\mtools\ 20 | 21 | cd /d %PROJ_ROOT% 22 | 23 | rem create output folders 24 | if not exist "%OUT_ROOT%" mkdir "%OUT_ROOT%" 25 | if not exist "%OUT_APPS%" mkdir "%OUT_APPS%" 26 | if not exist "%IMG_ROOT%" mkdir "%IMG_ROOT%" 27 | 28 | rem build bootsector file 29 | echo ====== Building bootsector... ====== 30 | call "%FASM_PATH%" "%SRC_ROOT%bootsector\bootsect.asm" -s "%OUT_ROOT%bootsector.sym" "%OUT_ROOT%bootsector" 31 | if not %errorlevel% == 0 ( 32 | goto _l_end 33 | ) 34 | echo. 35 | 36 | rem build kernel file 37 | echo ====== Building pkernel... ====== 38 | call "%FASM_PATH%" "%SRC_ROOT%kernel\pkernel.asm" -s "%OUT_ROOT%pkernel.sym" "%OUT_ROOT%pkernel.bin" 39 | if not %errorlevel% == 0 ( 40 | goto _l_end 41 | ) 42 | echo. 43 | 44 | rem build shell file 45 | echo ====== Building shell... ====== 46 | call "%FASM_PATH%" "%SRC_ROOT%shell\shell.asm" -s "%OUT_ROOT%shell.sym" "%OUT_ROOT%shell" 47 | if not %errorlevel% == 0 ( 48 | goto _l_end 49 | ) 50 | echo. 51 | 52 | rem build apps 53 | echo ====== Building applications... ====== 54 | for /R "%SRC_APPS%" %%i in (*.asm) do ( 55 | echo +Building %%i 56 | call "%FASM_PATH%" "%%i" -s "%OUT_APPS%%%~ni.sym" "%OUT_APPS%%%~ni" 57 | ) 58 | echo. 59 | 60 | echo ====== Burning OS image... ====== 61 | 62 | echo +Creating image file with bootsector... 63 | "%MTOOL_ROOT%mformat.exe" -f 1440 -v PiscisOSVOL -B "%OUT_ROOT%bootsector" -C -i "%IMG_PATH%" :: 64 | if not %errorlevel% == 0 ( 65 | goto _l_end 66 | ) 67 | 68 | echo +Copying perkenel.bin to image file system... 69 | "%MTOOL_ROOT%mcopy.exe" -i "%IMG_PATH%" "%OUT_ROOT%pkernel.bin" :: 70 | if not %errorlevel% == 0 ( 71 | goto _l_end 72 | ) 73 | 74 | echo +Copying shell to image file system... 75 | "%MTOOL_ROOT%mcopy.exe" -i "%IMG_PATH%" "%OUT_ROOT%shell" :: 76 | if not %errorlevel% == 0 ( 77 | goto _l_end 78 | ) 79 | 80 | echo +Creating bin folder in image file system... 81 | "%MTOOL_ROOT%mmd.exe" -i "%IMG_PATH%" ::bin 82 | if not %errorlevel% == 0 ( 83 | goto _l_end 84 | ) 85 | 86 | echo +Copying all applications to image file system... 87 | "%MTOOL_ROOT%mcopy.exe" -i "%IMG_PATH%" "%OUT_ROOT%bin\*" ::bin 88 | if not %errorlevel% == 0 ( 89 | goto _l_end 90 | ) 91 | 92 | echo Build and burn done successfully! 93 | echo Output floppy image file: %IMG_PATH% 94 | 95 | echo +Creating bochs script... 96 | echo floppya: type=1_44, 1_44="%IMG_PATH%", status=inserted, write_protected=1 > %BOCHS_SCRIPT% 97 | echo Done! 98 | 99 | if "%RUN%" == "-run" ( 100 | %BOCHS_SCRIPT% 101 | ) 102 | 103 | :_l_end 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /documents/File_list_EN.mht: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/documents/File_list_EN.mht -------------------------------------------------------------------------------- /documents/File_list_ZH.mht: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/documents/File_list_ZH.mht -------------------------------------------------------------------------------- /documents/MemMap.txt: -------------------------------------------------------------------------------- 1 | ; ===Memory mapping of booting 2 | ; 00000000 -> 00000500 BIOS low [Reserved] 3 | ; 00000501 -> 00007BFF Boot Sector Stack 4 | ; 00007C00 -> 00007DFF Boot Sector [Reserved] 5 | ; 00007E00 -> 00007FFF Free 6 | ; 00008000 -> 00008FFF Free 7 | ; 00009000 -> 0000EFFF 8 | ; 0000F000 -> 0000FFFF System informations 9 | ; 0000F000 word System Total Memory size 10 | ; 0000F100 dword 11 | 12 | ; ====Memory mapping of Runtime 32 bit protect mode 13 | ; 00000000 -> 00000FFF Free [4k] 14 | ; 00001000 -> 00004FFF Process contro blocks [16k] 15 | ; +00h dword pid:process identifier 16 | ; +04h dword parent pid 17 | ; +10h dword mlocation:physical loaction of process code in memory 18 | ; +14h dword used syscall TSS descriptor number, -1 not use 19 | ; +20h dword tickcount:sum of clock tick count used 20 | ; +30h byte status:process status [0=terminated,1=ready, 2=running, 3=sleep, 4=zombie] 21 | ; +31h byte pcb status[0=free, 1=used] 22 | ; +34h dword wait pid 23 | 24 | 25 | PCB DEFINATION 26 | 27 | Pcb_strcuct: 28 | +00h dword PID(process identifier) 29 | +04h dword parent PID 30 | +08h dword reserved 31 | +0ch dword reserved 32 | +10h dword base memory address of the process image 33 | +14h dword index of syscall TSS descriptor this process is using 34 | +18h dword reserved 35 | +1ch dword reserved 36 | +20h dword Tick count 37 | +24h dword reserved 38 | +28h dword reserved 39 | +2ch dword reserved 40 | +30h byte process status 41 | +31h byte PCB Status 42 | +32h word reserved 43 | +34h dword PID of the process which is waiting for this process 44 | +38h dword reserved 45 | +3ch dword reserved 46 | 47 | ; 00004F40 48 | ; 00004FA0 49 | ; 00004FB0 50 | ; 00004FC0 51 | ; 00004FD0 52 | ; 00004FE0 53 | ; 00004FF0 dword number of current running process 54 | ; 00004FF4 dword base of current running process, =PCB_TABLE_BASE+pcb_current_no*PCB_SIZE 55 | ; 00004FF8 dword total count of processes in current system 56 | 57 | ; 00003000 -> 00003FFF Free [4k] 58 | ; 00004000 -> 00004FFF Free [4k] 59 | ; 00005000 -> 00005FFF Free [4k] 60 | ; 61 | ; 00006000 -> 00006FFF Free [4k] 62 | ; 00007000 -> 00007FFF Free [4k] 63 | ; 00008000 -> 00008FFF Free [4k] 64 | ; 00008000 word row_start-Number of start row in current screen 65 | ; 00008002 word x_cursor-Col of Cursor. 66 | ; 00008004 word y_cursor-Row of Cursor. 67 | 68 | ; 00009000 -> 0000EFFF Display String temp buffer 69 | ; 0000F000 -> 0000FFFF System informations [4K] 70 | ; 0000F000 dword System Total Memory size 71 | ; 0000F008 dword Pid Init 72 | ; 0000F010 dword System Tick count 73 | ; 0000F020 byte keyboard LEDS stauts change 0:no change 1:changed 74 | ; 0000F021 byte keyboard LEDS changed num : 0 = capsl 1 = numl 2 = scrl 75 | ; 76 | 77 | ; 0000F100 -> 0000F1FF Keyboard Ascii Code Buffer 78 | ; 0000F100->0000F17F Queue buffer 128 bytes 79 | ; 0000F190 byte Queue buffer head 80 | ; 0000F1A0 byte Queue buffer tail 81 | ; 0000F1B0 byte Queue data count 82 | 83 | ; 00010000 -> 0004FFFF Kernel Bin 84 | ; 00050000 -> 0006FFFF Stack 85 | ; 0005FFF0 16 bit Kernel stack top 86 | ; 0006C000 32 bit Kernel stack top 87 | ; 0006D000 esp0=6D000-50000 88 | ; 0006E000 esp1=6E000-50000 89 | ; 0006F000 esp2=6F000-50000 90 | ; 00070000 -> 00090000 Free 91 | 92 | ; 00090000 -> 0009FFFF Reserved 93 | 94 | ; 000A0000 -> 000AFFFF Screen access area [Reserved] 95 | ; 000B0000 -> 000FFFFF Bios [Reserved] 96 | ; = 1M Begin 97 | ; 00100000 -> 0027FFFF diskette image 98 | ; 00280000 -> 0028FFFF diskette fat 99 | ; 00290000 -> 0029FFFF Low Memory 100 | ; 002A0000 -> 002A7FFF TSS block of interrupts 101 | ; 002A8000 -> 002AFFFF TSS block of system calls - 256 entries 102 | ; 002B0000 -> 002B0FFF Page Directory Table:4k 103 | ; 002B1000 -> 002BFFFF Free 104 | ; 002C0000 -> 002FFFFF Stacks of intterupts[per stack 1024 bytes, Max 256 stacks] 105 | ; = 3M Begin 106 | ; 00300000 -> 003FFFFF Stacks of syscalls[per stack 4096 bytes, Max 256 stacks] 107 | ; = 4M Begin 108 | ; 00400000 -> 007FFFFF Page Table Entry 4M reserved for MAX 4G Memory 109 | ; = 8M Begin 110 | ; 00800000 -> 009FFFFF TSS block of processes [(128 bytes tss data + 8192 bytes IO map)*250 processes] 111 | ; = 10M Begin 112 | ; 00A00000 -> 0FA00000 Application mem, One process use 1M byte memory (1M*250) 113 | ; code segment:0-100000 114 | ; data segment:0-100000 115 | ; stack segment:0-100000 esp = 0FFFF0 116 | ; 117 | ; 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /documents/syscalls doc.txt: -------------------------------------------------------------------------------- 1 | ========================== 2 | sysc_gettick 3 | in: eax: 00h 4 | out:eax: tick count 5 | ========================== 6 | ========================== 7 | sysc_getkey 8 | in: eax: 01h 9 | out:eax: key ascii code 10 | ========================== 11 | ========================== 12 | sysc_screenandcursor 13 | in: eax: 02h 14 | ebx: 0=clear screen 15 | out: 16 | ebx: 1=setcursorpos 17 | ecx: X|Y 18 | out: 19 | ebx: 2=getcursorpos 20 | out:ecx:X|Y 21 | ========================== 22 | ========================== 23 | sysc_putchar 24 | in: eax: 03h 25 | bl: char ascii code 26 | out:eax: 27 | ========================== 28 | ========================== 29 | sysc_print 30 | in: eax: 04h 31 | ebx: bh=row bl=coloum 32 | if ebx=0ffffffff then print string at current position of cursor 33 | edi: buffer of string to print 34 | out: 35 | eax: 36 | ========================== 37 | ========================== 38 | sysc_time 39 | in: eax: 05h 40 | out:eax: |notuse|s|m|h| BCD 41 | ========================== 42 | ========================== 43 | sysc_date 44 | in: eax: 05h 45 | out:eax: |dw|d|m|y| BCD 46 | ========================== 47 | ========================== 48 | sysc_createprocess 49 | in: eax: 10h 50 | ebx: argments buffer 51 | edi: buffer of path 52 | out: 53 | eax: 54 | ========================== 55 | 56 | ========================== 57 | sysc_exitrocess 58 | in: eax: 11h 59 | out: 60 | ========================== 61 | ========================== 62 | sysc_waitpid 63 | in: eax: 12h 64 | ebx: pid to be waited 65 | out: 66 | eax: if the function success it will not return 0 untill the process exit, if failed, return -1 right now 67 | ========================== 68 | ========================== 69 | sysc_rdfs 70 | in: eax: 20h 71 | ebx: 0=GetFileAttribute 72 | edi: path 73 | ecx: buffer to save file item 74 | out:eax: -1 not found 75 | ebx: 1=readfile 76 | edi: path 77 | ecx: buffer to save the file 78 | out:eax: 79 | ebx: 2=writefile 80 | edi: path 81 | ecx: buffer to be saved into file 82 | out:eax: 83 | ========================== 84 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | PiscisOS https://tishion.github.io/PiscisOS 2 | ===== 3 | a tiny multi-task operating system based x86 architecture, run in protect mode 4 | 5 | Build in one step and Run 6 | ======= 7 | 8 | if you want to build in one step just run: 9 | 10 | > build.bat 11 | 12 | and also you can add paremeter -run to launch it with bochs (you need to install bochs first) 13 | 14 | > build.bat -run 15 | 16 | enjoy this tiny OS 17 | 18 | 19 | Build components 20 | ======== 21 | if you want to build some components, you can do as follows 22 | 23 | 1. install Flat assembler, add the environment path 24 | 25 | 2. build the boot sector 26 | > cd X:\xxxxx\PiscisOS\src\boot 27 | > 28 | > fasm bootsect.asm 29 | 30 | you will get X:\xxxxx\PiscisOS\out\bootsect.bin 31 | 32 | 3. build kernel 33 | > cd X:\xxxxx\PiscisOS\src\ 34 | > 35 | > fasm pkernel.asm 36 | 37 | then you will get X:\xxxxx\PiscisOS\out\pkernel.bin 38 | 39 | 4. build shell 40 | > cd X:\xxxxx\PiscisOS\src\shell 41 | > 42 | > fasm shell.asm 43 | 44 | then you will get X:\xxxxx\PiscisOS\out\shell.bin 45 | 46 | 4. make image file..... 47 | -------------------------------------------------------------------------------- /src/apps/date/date.asm: -------------------------------------------------------------------------------- 1 | use32 2 | 3 | org 00h 4 | APP_HEADER: 5 | db 'PISCISAPP000' ;;Signature 6 | dd 0 ;;Reserverd 7 | dd APP_START ;;Entry Point 8 | dd APP_ARGS ;;Arguments Buffer 9 | dd 0 ;;Reserved 10 | 11 | APP_ARGS: 12 | times (256) db 0 13 | 14 | APP_START: 15 | mov eax, 06h 16 | int 50h 17 | 18 | mov edi, str_yy 19 | call Bcd2Asc 20 | 21 | shr eax, 8 22 | mov edi, str_mm 23 | call Bcd2Asc 24 | 25 | shr eax, 8 26 | mov edi, str_dd 27 | call Bcd2Asc 28 | 29 | shr eax, 8 30 | mov edi, str_dw 31 | call Bcd2Asc 32 | 33 | mov edi, str_ti 34 | mov eax, 04h 35 | int 50h 36 | 37 | mov eax, 11h 38 | int 50h 39 | 40 | Bcd2Asc: 41 | ;;in al:bcd number 42 | ;; edi:destbuffer to store string 43 | push ebx 44 | 45 | mov bl, al 46 | and bl, 0f0h 47 | shr bl, 4 48 | add bl, '0' 49 | mov [edi], bl 50 | 51 | mov bl, al 52 | and bl, 0fh 53 | add bl, '0' 54 | mov [edi+1], bl 55 | 56 | pop ebx 57 | ret 58 | 59 | str_ti db 'Today is 20' 60 | str_yy db '00', '/' 61 | str_mm db '00', '/' 62 | str_dd db '00', ' ' 63 | str_dw db '0', 0 -------------------------------------------------------------------------------- /src/apps/debug/debug.asm: -------------------------------------------------------------------------------- 1 | use32 2 | 3 | org 00h 4 | APP_HEADER: 5 | db 'PISCISAPP000' ;;Signature 6 | dd 0 ;;Reserverd 7 | dd APP_START ;;Entry Point 8 | dd APP_ARGS ;;Arguments Buffer 9 | dd 0 ;;Reserved 10 | 11 | APP_ARGS: 12 | times (256) db 0 13 | 14 | APP_START: 15 | 16 | mov eax, 0 17 | mov eax, 1 18 | 19 | call func 20 | 21 | jmp $ 22 | 23 | func: 24 | ;;in al:bcd number 25 | ;; edi:destbuffer to store string 26 | push ebx 27 | 28 | mov ebx, 0 29 | 30 | pop ebx 31 | ret 32 | -------------------------------------------------------------------------------- /src/apps/echo/echo.asm: -------------------------------------------------------------------------------- 1 | use32 2 | 3 | org 00h 4 | APP_HEADER: 5 | db 'PISCISAPP000' ;;00h Signature 6 | dd 0 ;;0ch Reserverd 7 | dd APP_START ;;10h Entry Point 8 | dd APP_ARGS ;;14h Arguments Buffer 9 | dd 0 ;;18h Reserved 10 | 11 | APP_ARGS: 12 | times (256) db 0 13 | 14 | APP_START: 15 | mov edi, APP_ARGS 16 | mov eax, 04h 17 | int 50h 18 | 19 | mov eax, 11h 20 | int 50h -------------------------------------------------------------------------------- /src/apps/hello/hello.asm: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; Application for PiscisOS: Helloworld 3 | ;; Assembled by Flat Assembler 4 | ;; 5 | ;; 23/04/2012 6 | ;; Copyright (C) tishion 7 | ;; E-Mail:tishion#163.com 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9 | use32 10 | 11 | org 00h 12 | APP_HEADER: 13 | db 'PISCISAPP000' ;;Signature 14 | dd 0 ;;Reserverd 15 | dd APP_START ;;Entry Point 16 | dd APP_ARGS ;;Arguments Buffer 17 | dd 0 ;;Reserved 18 | 19 | APP_ARGS: 20 | times (256) db 0 21 | 22 | APP_START: 23 | mov edi, str_hw 24 | mov eax, 04h 25 | int 50h 26 | 27 | mov eax, 11h 28 | int 50h 29 | 30 | str_hw db 'Hello, world!', 0 -------------------------------------------------------------------------------- /src/apps/include/string.inc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;functions about string operation 3 | strcopy: 4 | ;;in esi:buffer of source 5 | ;; edi:buffer of destination 6 | ;;out eax:count of char copyed, not include '\0' 7 | push esi 8 | push edi 9 | 10 | xor ecx, ecx 11 | cmp [esi], byte 0 12 | je .final_ret 13 | cld 14 | .next_char: 15 | lodsb 16 | cmp al, 0 17 | je .copy_done 18 | mov [edi], al 19 | inc edi 20 | inc ecx 21 | jmp .next_char 22 | .copy_done: 23 | mov [edi], al 24 | mov eax, ecx 25 | .final_ret: 26 | pop edi 27 | pop esi 28 | ret 29 | 30 | strlen: 31 | ;;in esi:buffer 32 | ;;out ecx:length without '\0' 33 | push esi 34 | 35 | xor ecx, ecx 36 | cld 37 | .next_char: 38 | lodsb 39 | cmp al, 0 40 | je .ret 41 | inc ecx 42 | jmp .next_char 43 | 44 | .ret: 45 | pop esi 46 | ret 47 | 48 | 49 | strcmp: 50 | ;;in esi:buffer of source 51 | ;; edi:buffer os destination 52 | ;;out eax: 53 | push edi 54 | push esi 55 | push ecx 56 | 57 | call strlen 58 | mov ebx, ecx 59 | 60 | push esi 61 | mov esi, edi 62 | call strlen 63 | pop esi 64 | 65 | cmp ebx, ecx 66 | je .cmp_chars 67 | ja .ret_a 68 | jb .ret_b 69 | 70 | .cmp_chars: 71 | cld 72 | repe cmpsb 73 | je .ret_e 74 | ja .ret_a 75 | jb .ret_b 76 | .ret_a: 77 | mov eax, 1 78 | jmp .ret 79 | .ret_b: 80 | mov eax, 0ffffffffh 81 | jmp .ret 82 | .ret_e: 83 | mov eax, 0 84 | .ret: 85 | pop ecx 86 | pop esi 87 | pop edi 88 | ret 89 | 90 | strchr: 91 | ;;in esi:buffer of source 92 | ;; bl:char to find 93 | ;;out eax:index of the char first 94 | push esi 95 | push ebx 96 | xor eax, eax 97 | .next_char: 98 | cmp [esi+eax], byte 0 99 | je .not_found 100 | cmp [esi+eax], bl 101 | je .final_ret 102 | inc eax 103 | jmp .next_char 104 | .not_found: 105 | mov eax, 0ffffffffh 106 | .final_ret: 107 | pop ebx 108 | pop esi 109 | ret 110 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 111 | 112 | -------------------------------------------------------------------------------- /src/apps/ls/ls.asm: -------------------------------------------------------------------------------- 1 | DIRITEM_SIZE equ 20h 2 | FILEITEM_NAME equ 00h 3 | FILEITEM_EXTEND equ 08h 4 | FILEITEM_ATTR equ 0bh 5 | 6 | FATTR_RDONLY equ 00000001b 7 | FATTR_HIDDEN equ 00000010b 8 | FATTR_SYSTEM equ 00000100b 9 | FATTR_VOLLAB equ 00001000b 10 | FILEITEM_RESERVED equ 10h 11 | FILEITEM_WRITETIME equ 16h 12 | FILEITEM_WRITEDATE equ 18h 13 | FILEITEM_FIRSTCLUSTER equ 1ah 14 | FILEITEM_FILESIZE equ 1ch 15 | FULLFILENAME_LEN equ 0bh 16 | FATTR_SUBDIR equ 00010000b 17 | FATTR_DEVICE equ 00100000b 18 | FATTR_ARCHIV equ 01000000b 19 | FATTR_NOTUSE equ 10000000b 20 | 21 | use32 22 | org 00h 23 | APP_HEADER: 24 | db 'PISCISAPP000' ;;00h Signature 25 | dd 0 ;;0ch Reserverd 26 | dd APP_START ;;10h Entry Point 27 | dd APP_ARGS ;;14h Arguments Buffer 28 | dd 0 ;;18h Reserved 29 | 30 | APP_ARGS: 31 | times (256) db 0 32 | 33 | newline: db 0dh, 0ah, 0 34 | notfoundstr db 'Directory not found:', 0 35 | notsubdirstr db 'Path is not directory:', 0 36 | openerrstr db 'Open directory error:', 0 37 | 38 | APP_START: 39 | ; mov edi, APP_ARGS 40 | ; mov eax, 04h 41 | ; int 50h 42 | 43 | ; mov edi, newline 44 | ; mov eax, 04h 45 | ; int 50h 46 | 47 | mov esi, APP_ARGS 48 | call formatpath 49 | 50 | mov ebx, 00h 51 | mov edi, APP_ARGS 52 | mov ecx, .fitembuf 53 | mov eax, 20h 54 | int 50h 55 | 56 | cmp eax, 0ffffffffh 57 | je .not_found 58 | mov edi, .fitembuf 59 | mov bl, [edi+FILEITEM_ATTR] 60 | and bl, FATTR_SUBDIR 61 | jz .not_subdir 62 | 63 | mov ebx, 01h 64 | mov edi, APP_ARGS 65 | mov ecx, filebuf 66 | mov eax, 20h 67 | int 50h 68 | 69 | cmp eax, 0ffffffffh 70 | je .open_error 71 | 72 | mov esi, filebuf 73 | .next_fitem: 74 | cmp [esi], byte 00h 75 | je .end 76 | 77 | cmp [esi], byte 05h 78 | je .skip_item 79 | 80 | cmp [esi], byte 0e5h 81 | je .skip_item 82 | 83 | mov [.filename+0], dword 20202020h 84 | mov [.filename+4], dword 20202020h 85 | mov [.filename+8], dword 00002020h 86 | 87 | mov eax, [esi+0] 88 | mov [.filename+0], eax 89 | mov eax, [esi+4] 90 | mov [.filename+4], eax 91 | 92 | mov bl, [esi+FILEITEM_ATTR] 93 | and bl, FATTR_SUBDIR 94 | jz .show_itemname 95 | 96 | push esi 97 | mov esi, .filename 98 | mov bl, 20h 99 | call strchr 100 | mov [esi+eax], byte '\' 101 | pop esi 102 | 103 | .show_itemname: 104 | mov edi, .filename 105 | mov eax, 04h 106 | int 50h 107 | .skip_item: 108 | add esi, DIRITEM_SIZE 109 | jmp .next_fitem 110 | 111 | .not_found: 112 | mov edi, notfoundstr 113 | mov eax, 04h 114 | int 50h 115 | jmp .showpath 116 | 117 | .not_subdir: 118 | mov edi, notsubdirstr 119 | mov eax, 04h 120 | int 50h 121 | jmp .showpath 122 | 123 | .open_error: 124 | mov edi, openerrstr 125 | mov eax, 04h 126 | int 50h 127 | jmp .showpath 128 | 129 | .showpath: 130 | mov edi, APP_ARGS 131 | mov eax, 04h 132 | int 50h 133 | 134 | 135 | .end: 136 | mov eax, 11h 137 | int 50h 138 | 139 | 140 | .filename: times 12 db 20h 141 | .fitembuf: times 32 db 0 142 | 143 | formatpath: 144 | ;;in esi:path buffer 145 | ;; 146 | ;;out ecx:strlen after deleted '\'s 147 | call strlen 148 | .loop_1: 149 | cmp ecx, 2 150 | jb .final_ret 151 | cmp [esi+ecx-1], byte '\' 152 | jne .final_ret 153 | dec ecx 154 | mov [esi+ecx], byte 0 155 | jmp .loop_1 156 | .final_ret: 157 | ret 158 | 159 | include "..\include\string.inc" 160 | 161 | ;;dir data buffer 10k 162 | filebuf: times (1024*10+32) db 0 163 | 164 | 165 | -------------------------------------------------------------------------------- /src/apps/time/time.asm: -------------------------------------------------------------------------------- 1 | use32 2 | 3 | org 00h 4 | APP_HEADER: 5 | db 'PISCISAPP000' ;;Signature 6 | dd 0 ;;Reserverd 7 | dd APP_START ;;Entry Point 8 | dd APP_ARGS ;;Arguments Buffer 9 | dd 0 ;;Reserved 10 | 11 | APP_ARGS: 12 | times (256) db 0 13 | 14 | APP_START: 15 | mov edi, str_nt 16 | mov eax, 04h 17 | int 50h 18 | 19 | mov eax, 05h 20 | int 50h 21 | 22 | mov edi, str_hh 23 | call Bcd2Asc 24 | 25 | shr eax, 8 26 | mov edi, str_mm 27 | call Bcd2Asc 28 | 29 | shr eax, 8 30 | mov edi, str_ss 31 | call Bcd2Asc 32 | 33 | mov edi, str_hh 34 | mov eax, 04h 35 | int 50h 36 | 37 | mov eax, 11h 38 | int 50h 39 | 40 | Bcd2Asc: 41 | ;;in al:bcd number 42 | ;; edi:destbuffer to store string 43 | push ebx 44 | 45 | mov bl, al 46 | and bl, 0f0h 47 | shr bl, 4 48 | add bl, '0' 49 | mov [edi], bl 50 | 51 | mov bl, al 52 | and bl, 0fh 53 | add bl, '0' 54 | mov [edi+1], bl 55 | 56 | pop ebx 57 | ret 58 | 59 | str_nt db 'Now time ', 0 60 | str_hh db '00', ':' 61 | str_mm db '00', ':' 62 | str_ss db '00', 0 -------------------------------------------------------------------------------- /src/bootsector/bootsect.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/src/bootsector/bootsect.asm -------------------------------------------------------------------------------- /src/bootsector/bootsect.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/src/bootsector/bootsect.h -------------------------------------------------------------------------------- /src/kernel/drivers/console.inc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; i8259A.inc of the PiscisOS 3 | ;; Procs to operate the 8259 interrupt controller 4 | ;; 5 | ;; 23/01/2012 6 | ;; Copyright (C) tishion 7 | ;; E-Mail:tishion@163.com 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9 | CrtfnDisableCursor: 10 | push eax 11 | push edx 12 | 13 | mov dx, CRT_CTRL_ADDR_REG 14 | mov al, CRT_CTRL_DATA_CURBEGIN 15 | out dx, al 16 | 17 | mov al, 00100000b 18 | mov dx, CRT_CRTL_DATA_REG 19 | out dx, al 20 | 21 | pop edx 22 | pop eax 23 | 24 | ret 25 | 26 | CrtfnEnableCursor: 27 | push eax 28 | push edx 29 | 30 | mov dx, CRT_CTRL_ADDR_REG 31 | mov al, CRT_CTRL_DATA_CURBEGIN 32 | out dx, al 33 | 34 | mov al, 0dh 35 | and al, 11011111b 36 | mov dx, CRT_CRTL_DATA_REG 37 | out dx, al 38 | 39 | pop edx 40 | pop eax 41 | 42 | ret 43 | 44 | CrtfnSetStartRow: 45 | ;; Set start row of visible 46 | ;; ax=number of start row 47 | push eax 48 | push ebx 49 | push ecx 50 | push edx 51 | 52 | mov bx, COLUMN_COUNT 53 | mul bx 54 | mov cx, ax 55 | 56 | mov dx, CRT_CTRL_ADDR_REG 57 | mov al, CRT_CTRL_DATA_STARTADDR_H 58 | out dx, al 59 | 60 | mov dx, CRT_CRTL_DATA_REG 61 | mov al, ch 62 | out dx, al 63 | 64 | mov dx, CRT_CTRL_ADDR_REG 65 | mov al, CRT_CTRL_DATA_STARTADDR_L 66 | out dx, al 67 | 68 | mov dx, CRT_CRTL_DATA_REG 69 | mov al, cl 70 | out dx, al 71 | 72 | pop edx 73 | pop ecx 74 | pop ebx 75 | pop eax 76 | ret 77 | 78 | CrtfnSetCursorPos: 79 | ;; Set cursor position 80 | ;; ax=Y:row 81 | ;; cx=X:column 82 | push eax 83 | push ebx 84 | push ecx 85 | push edx 86 | 87 | mov bx, 80 88 | mul bx 89 | add cx, ax 90 | 91 | mov dx, CRT_CTRL_ADDR_REG 92 | mov al, CRT_CTRL_DATA_CURSORPOS_H 93 | out dx, al 94 | 95 | mov dx, CRT_CRTL_DATA_REG 96 | mov al, ch 97 | out dx, al 98 | 99 | mov dx, CRT_CTRL_ADDR_REG 100 | mov al, CRT_CTRL_DATA_CURSORPOS_L 101 | out dx, al 102 | 103 | mov dx, CRT_CRTL_DATA_REG 104 | mov al, cl 105 | out dx, al 106 | 107 | pop edx 108 | pop ecx 109 | pop ebx 110 | pop eax 111 | ret 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /src/kernel/drivers/i8259A.inc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; i8259A.inc of the PiscisOS 3 | ;; Procs to operate the 8259 interrupt controller 4 | ;; 5 | ;; 23/01/2012 6 | ;; Copyright (C) tishion 7 | ;; E-Mail:tishion@163.com 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9 | ResetIRQs: 10 | push eax 11 | stc 12 | 13 | mov al, 011h ; ICW1 to master 8259a 14 | out I8259A_M0, al 15 | call io_delay 16 | out I8259A_S0, al ; ICW1 to slave 8259a 17 | call io_delay 18 | 19 | mov al, 020h ; ICW2 to master 8259a 0x20 -> IRQ0 20 | out I8259A_M1, al 21 | call io_delay 22 | mov al, 028h ; ICW2 to slave 8259a 0x28 -> IRQ8 23 | out I8259A_S1, al 24 | call io_delay 25 | 26 | mov al, 004h ; ICW3 to master 8259a Slave 8259A -> IRQ2 27 | out I8259A_M1, al 28 | call io_delay 29 | 30 | mov al, 002h ; ICW3 to slave 8259a Slave 8259A -> IRQ2 31 | out I8259A_S1, al 32 | call io_delay 33 | 34 | mov al, 001h ; ICW4 to master 8259a 8086 mode 35 | out I8259A_M1, al 36 | call io_delay 37 | out I8259A_S1, al ; ICW4 to slave 8259a 8086 mode 38 | call io_delay 39 | 40 | mov al, IRQ_MF_ALL ; Mask all IRQs of master 8259a 41 | out I8259A_M1, al 42 | call io_delay 43 | 44 | mov al, IRQ_MF_ALL ; Mask all IRQs of slave 8259a 45 | out I8259A_S1, al 46 | call io_delay 47 | 48 | clc 49 | pop eax 50 | ret 51 | 52 | EnableAllIRQs: 53 | push eax 54 | stc 55 | 56 | mov al, IRQ_EF_ALL ; enable all irqs 57 | out I8259A_M1, al 58 | call io_delay 59 | 60 | mov al, IRQ_EF_ALL 61 | out I8259A_S1, al 62 | 63 | clc 64 | pop eax 65 | ret 66 | 67 | FlushAllIRQs: 68 | push eax 69 | push ecx 70 | 71 | mov ecx, 32 72 | .flush_all_irqs: 73 | mov al, 20h ; ready for irqs 74 | out I8259A_M0, al 75 | out I8259A_S0, al 76 | loop .flush_all_irqs ; flush the queue 77 | 78 | pop ecx 79 | pop eax 80 | ret 81 | 82 | SendEOI2Master: 83 | push eax 84 | push edx 85 | 86 | mov al, 20h 87 | mov dx, I8259A_M0 88 | out dx, al 89 | 90 | pop edx 91 | pop eax 92 | ret 93 | 94 | SendEOI2Slave: 95 | push eax 96 | push edx 97 | 98 | mov al, 20h 99 | mov dx, I8259A_S0 100 | out dx, al 101 | 102 | pop edx 103 | pop eax 104 | ret 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/kernel/include/ascii.h: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; ASCII Code define 4 | ;; 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | ;; Ascii code control char 8 | ASC_CC_NULL EQU 00H 9 | ASC_CC_SOH EQU 01H 10 | ASC_CC_STX EQU 02H 11 | ASC_CC_ETX EQU 03H 12 | ASC_CC_EOT EQU 04H 13 | ASC_CC_ENQ EQU 05H 14 | ASC_CC_ACK EQU 06H 15 | ASC_CC_BEEL EQU 07H 16 | ASC_CC_BS EQU 08H 17 | ASC_CC_HT EQU 09H 18 | ASC_CC_LF EQU 0AH 19 | ASC_CC_VT EQU 0BH 20 | ASC_CC_FF EQU 0CH 21 | ASC_CC_CR EQU 0DH 22 | ASC_CC_SO EQU 0EH 23 | ASC_CC_S_I EQU 0FH 24 | ASC_CC_DEL EQU 10H 25 | ASC_CC_DC1 EQU 11H 26 | ASC_CC_DC2 EQU 12H 27 | ASC_CC_DC3 EQU 13H 28 | ASC_CC_DC4 EQU 14H 29 | ASC_CC_NAK EQU 15H 30 | ASC_CC_SYN EQU 16H 31 | ASC_CC_ETB EQU 17H 32 | ASC_CC_CAN EQU 18H 33 | ASC_CC_EM EQU 19H 34 | ASC_CC_SUB EQU 1AH 35 | ASC_CC_ESC EQU 1BH 36 | ASC_CC_FS EQU 1CH 37 | ASC_CC_GS EQU 1DH 38 | ASC_CC_RS EQU 1EH 39 | ASC_CC_US EQU 1FH 40 | 41 | ;;Ascii Code extend char 42 | ;;80H~FFH 43 | ;;;;;;;;;;;;;;;; 44 | -------------------------------------------------------------------------------- /src/kernel/include/drivers/console.h: -------------------------------------------------------------------------------- 1 | COLUMN_COUNT equ 80 2 | 3 | CRT_CTRL_ADDR_REG equ 03d4h 4 | CRT_CRTL_DATA_REG equ 03d5h 5 | 6 | CRT_CTRL_DATA_CURBEGIN equ 0ah 7 | CRT_CTRL_DATA_STARTADDR_H equ 0ch 8 | CRT_CTRL_DATA_STARTADDR_L equ 0dh 9 | CRT_CTRL_DATA_CURSORPOS_H equ 0eh 10 | CRT_CTRL_DATA_CURSORPOS_L equ 0fh -------------------------------------------------------------------------------- /src/kernel/include/drivers/i8259A.h: -------------------------------------------------------------------------------- 1 | I8259A_M0 equ 020h 2 | I8259A_M1 equ 021h 3 | 4 | I8259A_S0 equ 0a0h 5 | I8259A_S1 equ 0a1h 6 | 7 | IRQ_EF_ALL equ 00000000b 8 | IRQ_MF_ALL equ 11111111b -------------------------------------------------------------------------------- /src/kernel/include/drivers/keyboard.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | ;------------------------------------------------------ 4 | ; key scan code 5 | ;------------------------------------------------------- 6 | SC_EX equ 0e0h 7 | SC_NULL equ 00h 8 | SC_ESC equ 01h 9 | SC_BS equ 0eh 10 | SC_TAB equ 0fh 11 | SC_CTRL equ 1dh 12 | SC_SHIFT_L equ 2ah 13 | SC_SHIFT_R equ 36h 14 | SC_PRINTSCREEN equ 37h 15 | SC_ALT equ 38h 16 | SC_SPACE equ 39h 17 | SC_CAPS equ 3ah 18 | SC_F1 equ 3bh 19 | SC_F2 equ 3ch 20 | SC_F3 equ 3dh 21 | SC_F4 equ 3eh 22 | SC_F5 equ 3fh 23 | SC_F6 equ 40h 24 | SC_F7 equ 41h 25 | SC_F8 equ 42h 26 | SC_F9 equ 43h 27 | SC_F10 equ 44h 28 | SC_NUM equ 45h 29 | SC_SCROLL equ 46h 30 | 31 | 32 | ;;Led status flags 33 | SCRLK_ON equ 0x01 34 | NUMLK_ON equ 0x02 35 | CAPLK_ON equ 0x10 36 | 37 | ;---------------------------- 38 | ; KEY ASCII CODE 39 | ;---------------------------- 40 | KEY_NULL equ 00h 41 | KEY_ESC equ 1bh 42 | KEY_BS equ 08h 43 | KEY_TAB equ 09h 44 | KEY_ENTER equ 0dh 45 | KEY_FS equ 1ch 46 | KEY_CTRL equ 00h 47 | KEY_SHIFT_L equ 0fh 48 | KEY_SHIFT_R equ 0fh 49 | KEY_PRINTSCREEN equ 00h 50 | KEY_ALT equ 00h 51 | KEY_SPACE equ 20h 52 | KEY_CAPS equ 00h 53 | KEY_F1 equ 00h 54 | KEY_F2 equ 00h 55 | KEY_F3 equ 00h 56 | KEY_F4 equ 00h 57 | KEY_F5 equ 00h 58 | KEY_F6 equ 00h 59 | KEY_F7 equ 00h 60 | KEY_F8 equ 00h 61 | KEY_F9 equ 00h 62 | KEY_F10 equ 00h 63 | KEY_F11 equ 00h 64 | KEY_F12 equ 00h 65 | KEY_NUM equ 00h 66 | KEY_SCROLL equ 00h 67 | KEY_HOME equ 00h 68 | KEY_PAGEUP equ 00h 69 | KEY_UP equ 00h 70 | KEY_PAGEDOWN equ 00h 71 | KEY_END equ 00h 72 | KEY_INSERT equ 00h 73 | KEY_DEL equ 00h 74 | KEY_LEFT equ 00h 75 | KEY_RIGHT equ 00h 76 | KEY_DOWN equ 00h 77 | KEY_SUB equ 00h 78 | KEY_ADD equ 00h 79 | KEY_MUL equ 00h 80 | KEY_DIV equ 00h 81 | 82 | -------------------------------------------------------------------------------- /src/kernel/include/drivers/ramdiskfs.h: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; ramdiskfs.h of the PiscisOS 3 | ;; driver of fat12 file system in ram 4 | ;; 5 | ;; 23/01/2012 6 | ;; Copyright (C) tishion 7 | ;; E-Mail:tishion@163.com 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9 | 10 | DIRITEM_SIZE equ 20h 11 | FILEITEM_NAME equ 00h 12 | FILEITEM_EXTEND equ 08h 13 | FILEITEM_ATTR equ 0bh 14 | FILEITEM_RESERVED equ 10h 15 | FILEITEM_WRITETIME equ 16h 16 | FILEITEM_WRITEDATE equ 18h 17 | FILEITEM_FIRSTCLUSTER equ 1ah 18 | FILEITEM_FILESIZE equ 1ch 19 | FULLFILENAME_LEN equ 0bh 20 | 21 | FATTR_RDONLY equ 00000001b 22 | FATTR_HIDDEN equ 00000010b 23 | FATTR_SYSTEM equ 00000100b 24 | FATTR_VOLLAB equ 00001000b 25 | FATTR_SUBDIR equ 00010000b 26 | FATTR_DEVICE equ 00100000b 27 | FATTR_ARCHIV equ 01000000b 28 | FATTR_NOTUSE equ 10000000b 29 | 30 | bsOEMString equ 03h 31 | wSectSize equ 0bh 32 | bClusterSize equ 0dh 33 | wReservedSect equ 0eh 34 | bFatCount equ 10h 35 | wRootDirSize equ 11h 36 | wTotalSect equ 13h 37 | bMediaType equ 15h 38 | wSectPerFat equ 16h 39 | wSectPerTrack equ 18h 40 | wHeadCount equ 1ah 41 | dwsHiddenSect equ 1ch 42 | dwHugeSect equ 20h 43 | bBootDrv equ 24h 44 | bBootSign equ 26h 45 | dwVolumeID equ 27h 46 | bsVolumeLabel equ 2bh 47 | bsFSType equ 36h -------------------------------------------------------------------------------- /src/kernel/include/process.h: -------------------------------------------------------------------------------- 1 | APPMEM_BASE equ 0a00000h 2 | 3 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4 | ;;PCB 5 | PCB_SIZE equ 64 ;PCB unit size 32 byte 6 | PCB_TABLE_BASE equ 1000h ;PCB table base 7 | 8 | pcb_total_count equ 4ff8h ;address of total count of processes in current system 9 | pcb_current_no equ 4ff0h ;address of number of current running process 10 | pcb_current_base equ 4ff4h ;address of base of current running process, =PCB_TABLE_BASE+pcb_current_no*PCB_SIZE 11 | 12 | PID_OFFSET equ 00h 13 | PPID_OFFSET equ 04h 14 | MLOC_OFFSET equ 10h 15 | SYSC_OFFSET equ 14h 16 | TICK_OFFSET equ 20h 17 | STAT_OFFSET equ 30h 18 | PCBS_OFFSET equ 31h 19 | WPID_OFFSET equ 34h 20 | 21 | PCBS_FREE equ 00h 22 | PCBS_USED equ 01h 23 | 24 | ;;Process status consts 25 | PS_TERMINATED equ 00h 26 | PS_READY equ 01h 27 | PS_RUNNING equ 02h 28 | PS_WAIT equ 03h 29 | PS_ZOMBIE equ 04h 30 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 31 | 32 | max_processes equ 250 33 | tss_unit_process_size equ (128+8192) 34 | 35 | tss_block_process_base equ 0800000h 36 | app_mem_base equ 0900000h ;;first process is os task, application process is beging at 0a00000h 37 | 38 | app_mem_size equ 0100000h 39 | 40 | app_esp equ 00ffff0h 41 | 42 | app_arg_size equ 256 43 | 44 | pid_init equ 0f008h 45 | 46 | 47 | APPH_SIG equ 00h 48 | APPH_START equ 10h 49 | APPH_ARGS equ 14h 50 | 51 | CPER_MAX_COUNT equ 0ffffffffh 52 | CPER_NOT_FOUND_FILE equ 0fffffffeh 53 | CPER_INVALID_FORMAT equ 0fffffffdh 54 | 55 | -------------------------------------------------------------------------------- /src/kernel/include/sys32.h: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;Stack 3 | KERNEL_STACK_BASE equ 05000h ;[50000:0000] 4 | 5 | STACK_SIZE_16BIT equ 05f000h - KERNEL_STACK_BASE*16 6 | STACK_SIZE_32BIT equ 06c000h - KERNEL_STACK_BASE*16 7 | 8 | RING0_ESP_0 equ 06d000h - KERNEL_STACK_BASE*16 9 | RING1_ESP_1 equ 06e000h - KERNEL_STACK_BASE*16 10 | RING2_ESP_2 equ 06f000h - KERNEL_STACK_BASE*16 11 | 12 | stack_size_int equ 1024 13 | stack_size_sysc equ 4096 14 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 15 | 16 | 17 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 18 | ;;Pagging table 19 | PDE_OFFSET equ 02b0000h 20 | PTE_OFFSET equ 0400000h 21 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 22 | 23 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 24 | ;;TSS 25 | max_interrupts equ 250 26 | tss_block_interrupt_base equ 02a0000h 27 | tss_block_syscall_base equ 02a8000h 28 | tss_unit_size equ 128 29 | 30 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 31 | ;;Keyboard Queue buffer 32 | kasbuf_len equ 40h 33 | kasbuf_base equ 0f100h 34 | kasbuf_head equ 0f190h 35 | kasbuf_tail equ 0f1a0h 36 | kasbuf_count equ 0f1b0h 37 | 38 | kbled_stat_change equ 0f020h 39 | kbled_num_change equ 0f021h -------------------------------------------------------------------------------- /src/kernel/misc.inc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; misc.inc of the PiscisOS 3 | ;; Sring and Memory functions 4 | ;; 5 | ;; 23/01/2012 6 | ;; Copyright (C) tishion 7 | ;; E-Mail:tishion@163.com 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9 | 10 | macro m_memcopy 11 | { 12 | cld 13 | rep movsb 14 | } 15 | 16 | macro m_memcmp 17 | { 18 | cld 19 | repe cmpsb 20 | } 21 | 22 | 23 | memcopy: 24 | ;;esi: source buffer 25 | ;;edi: dest buffer 26 | ;;ecx: byte count to copy 27 | ;;note: the es and da must be the same 28 | push edi 29 | push esi 30 | push ecx 31 | 32 | cld 33 | rep movsb 34 | 35 | pop ecx 36 | pop esi 37 | pop edi 38 | 39 | ret 40 | 41 | 42 | memcmp: 43 | ;;esi:mem 1 44 | ;;edi:mem 2 45 | ;;ecx:length to compare 46 | ;;return eax:0 equ, 0ffffff mem1 is less than mem2, 1 mem1 is greater than mem2 47 | ;;note: the es and da must be the same 48 | push edi 49 | push esi 50 | push ecx 51 | 52 | cld 53 | repe cmpsb 54 | je .ret_e 55 | ja .ret_a 56 | jb .ret_b 57 | .ret_a: 58 | mov eax, 1 59 | jmp .ret 60 | .ret_b: 61 | mov eax, 0ffffffffh 62 | jmp .ret 63 | .ret_e: 64 | mov eax, 0 65 | .ret: 66 | pop ecx 67 | pop esi 68 | pop edi 69 | ret 70 | 71 | strcopy: 72 | ;;in esi:buffer of source 73 | ;; edi:buffer fs destination 74 | ;;out eax:count of char copyed, not include '\0' 75 | push esi 76 | push edi 77 | 78 | xor ecx, ecx 79 | cmp [esi], byte 0 80 | je .final_ret 81 | cld 82 | .next_char: 83 | lodsb 84 | cmp al, 0 85 | je .copy_done 86 | mov [edi], al 87 | inc edi 88 | inc ecx 89 | jmp .next_char 90 | .copy_done: 91 | mov [edi], al 92 | mov eax, ecx 93 | .final_ret: 94 | pop edi 95 | pop esi 96 | ret 97 | 98 | strlen: 99 | ;;in esi:buffer 100 | ;;out ecx:length without '\0' 101 | push esi 102 | 103 | xor ecx, ecx 104 | cld 105 | .next_char: 106 | lodsb 107 | cmp al, 0 108 | je .ret 109 | inc ecx 110 | jmp .next_char 111 | 112 | .ret: 113 | pop esi 114 | ret 115 | 116 | 117 | strcmp: 118 | ;;in esi:buffer of source 119 | ;; edi:buffer os destination 120 | ;;out eax: 121 | push edi 122 | push esi 123 | push ecx 124 | push eax 125 | 126 | call strlen 127 | mov ebx, eax 128 | 129 | push esi 130 | mov esi, edi 131 | call strlen 132 | pop esi 133 | 134 | cmp ebx, eax 135 | je .cmp_chars 136 | ja .ret_a 137 | jb .ret_b 138 | 139 | .cmp_chars: 140 | mov ecx, eax 141 | .loop_1: 142 | cld 143 | repe cmpsb 144 | je .ret_e 145 | ja .ret_a 146 | jb .ret_b 147 | .ret_a: 148 | mov eax, 1 149 | jmp .ret 150 | .ret_b: 151 | mov eax, 0ffffffffh 152 | jmp .ret 153 | .ret_e: 154 | mov eax, 0 155 | .ret: 156 | pop ecx 157 | pop esi 158 | pop edi 159 | ret 160 | 161 | -------------------------------------------------------------------------------- /src/kernel/process.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/src/kernel/process.inc -------------------------------------------------------------------------------- /src/kernel/sys32.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/src/kernel/sys32.inc -------------------------------------------------------------------------------- /src/shell/include/ascii.h: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; 3 | ;; ASCII Code define 4 | ;; 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | ;; Ascii code control char 8 | ASC_CC_NULL EQU 00H 9 | ASC_CC_SOH EQU 01H 10 | ASC_CC_STX EQU 02H 11 | ASC_CC_ETX EQU 03H 12 | ASC_CC_EOT EQU 04H 13 | ASC_CC_ENQ EQU 05H 14 | ASC_CC_ACK EQU 06H 15 | ASC_CC_BEEL EQU 07H 16 | ASC_CC_BS EQU 08H 17 | ASC_CC_HT EQU 09H 18 | ASC_CC_LF EQU 0AH 19 | ASC_CC_VT EQU 0BH 20 | ASC_CC_FF EQU 0CH 21 | ASC_CC_CR EQU 0DH 22 | ASC_CC_SO EQU 0EH 23 | ASC_CC_S_I EQU 0FH 24 | ASC_CC_DEL EQU 10H 25 | ASC_CC_DC1 EQU 11H 26 | ASC_CC_DC2 EQU 12H 27 | ASC_CC_DC3 EQU 13H 28 | ASC_CC_DC4 EQU 14H 29 | ASC_CC_NAK EQU 15H 30 | ASC_CC_SYN EQU 16H 31 | ASC_CC_ETB EQU 17H 32 | ASC_CC_CAN EQU 18H 33 | ASC_CC_EM EQU 19H 34 | ASC_CC_SUB EQU 1AH 35 | ASC_CC_ESC EQU 1BH 36 | ASC_CC_FS EQU 1CH 37 | ASC_CC_GS EQU 1DH 38 | ASC_CC_RS EQU 1EH 39 | ASC_CC_US EQU 1FH 40 | 41 | ;;Ascii Code extend char 42 | ;;80H~FFH 43 | ;;;;;;;;;;;;;;;; 44 | -------------------------------------------------------------------------------- /src/shell/include/process.h: -------------------------------------------------------------------------------- 1 | CPER_MAX_COUNT equ 0ffffffffh 2 | CPER_NOT_FOUND_FILE equ 0fffffffeh 3 | CPER_INVALID_FORMAT equ 0fffffffdh -------------------------------------------------------------------------------- /src/shell/include/string.inc: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;functions about string operation 3 | strcopy: 4 | ;;in esi:buffer of source 5 | ;; edi:buffer of destination 6 | ;;out eax:count of char copyed, not include '\0' 7 | push esi 8 | push edi 9 | 10 | xor ecx, ecx 11 | cmp [esi], byte 0 12 | je .final_ret 13 | cld 14 | .next_char: 15 | lodsb 16 | cmp al, 0 17 | je .copy_done 18 | mov [edi], al 19 | inc edi 20 | inc ecx 21 | jmp .next_char 22 | .copy_done: 23 | mov [edi], al 24 | mov eax, ecx 25 | .final_ret: 26 | pop edi 27 | pop esi 28 | ret 29 | 30 | strlen: 31 | ;;in esi:buffer 32 | ;;out ecx:length without '\0' 33 | push esi 34 | 35 | xor ecx, ecx 36 | cld 37 | .next_char: 38 | lodsb 39 | cmp al, 0 40 | je .ret 41 | inc ecx 42 | jmp .next_char 43 | 44 | .ret: 45 | pop esi 46 | ret 47 | 48 | 49 | strcmp: 50 | ;;in esi:buffer of source 51 | ;; edi:buffer os destination 52 | ;;out eax: 53 | push edi 54 | push esi 55 | push ecx 56 | 57 | call strlen 58 | mov ebx, ecx 59 | 60 | push esi 61 | mov esi, edi 62 | call strlen 63 | pop esi 64 | 65 | cmp ebx, ecx 66 | je .cmp_chars 67 | ja .ret_a 68 | jb .ret_b 69 | 70 | .cmp_chars: 71 | cld 72 | repe cmpsb 73 | je .ret_e 74 | ja .ret_a 75 | jb .ret_b 76 | .ret_a: 77 | mov eax, 1 78 | jmp .ret 79 | .ret_b: 80 | mov eax, 0ffffffffh 81 | jmp .ret 82 | .ret_e: 83 | mov eax, 0 84 | .ret: 85 | pop ecx 86 | pop esi 87 | pop edi 88 | ret 89 | 90 | strchr: 91 | ;;in esi:buffer of source 92 | ;; bl:char to find 93 | ;;out eax:index of the char first 94 | push esi 95 | push ebx 96 | xor eax, eax 97 | .next_char: 98 | cmp [esi+eax], byte 0 99 | je .not_found 100 | cmp [esi+eax], bl 101 | je .final_ret 102 | inc eax 103 | jmp .next_char 104 | .not_found: 105 | mov eax, 0ffffffffh 106 | .final_ret: 107 | pop ebx 108 | pop esi 109 | ret 110 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 111 | 112 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/BEER/BEER.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; Beer - example of tiny (one section) Win32 program 3 | 4 | format PE GUI 4.0 5 | 6 | include 'win32a.inc' 7 | 8 | ; no section defined - fasm will automatically create .flat section for both 9 | ; code and data, and set entry point at the beginning of this section 10 | 11 | invoke MessageBoxA,0,_message,_caption,MB_ICONQUESTION+MB_YESNO 12 | cmp eax,IDYES 13 | jne exit 14 | 15 | invoke mciSendString,_cmd_open,0,0,0 16 | invoke mciSendString,_cmd_eject,0,0,0 17 | invoke mciSendString,_cmd_close,0,0,0 18 | 19 | exit: 20 | invoke ExitProcess,0 21 | 22 | _message db 'Do you need additional place for the beer?',0 23 | _caption db 'Desktop configuration',0 24 | 25 | _cmd_open db 'open cdaudio',0 26 | _cmd_eject db 'set cdaudio door open',0 27 | _cmd_close db 'close cdaudio',0 28 | 29 | ; import data in the same section 30 | 31 | data import 32 | 33 | library kernel32,'KERNEL32.DLL',\ 34 | user32,'USER32.DLL',\ 35 | winmm,'WINMM.DLL' 36 | 37 | import kernel32,\ 38 | ExitProcess,'ExitProcess' 39 | 40 | import user32,\ 41 | MessageBoxA,'MessageBoxA' 42 | 43 | import winmm,\ 44 | mciSendString,'mciSendStringA' 45 | 46 | end data 47 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/BEER/BEER.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/BEER/BEER.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/DDRAW/DDRAW.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/DDRAW/DDRAW.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/DDRAW/DDRAW.GIF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/DDRAW/DDRAW.GIF -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/DDRAW/GIF87A.INC: -------------------------------------------------------------------------------- 1 | 2 | virtual at buffer 3 | GIFHEADER: 4 | .ID dd ? 5 | .ver dw ? 6 | .width dw ? 7 | .height dw ? 8 | .bits db ? 9 | .background db ? 10 | .reserved db ? 11 | .length = $ - GIFHEADER 12 | end virtual 13 | 14 | load_picture: 15 | 16 | invoke CreateFileA,esi,GENERIC_READ,0,0,OPEN_EXISTING,0,0 17 | mov edi,eax 18 | invoke ReadFile,edi,GIFHEADER,40000h,bytes_count,0 19 | invoke CloseHandle,edi 20 | 21 | cmp [GIFHEADER.ID],'GIF8' 22 | jne picture_error 23 | cmp [GIFHEADER.ver],'7a' 24 | jne picture_error 25 | 26 | mov al,[GIFHEADER.bits] 27 | and al,10000111b 28 | cmp al,10000111b 29 | jne picture_error 30 | 31 | add [bytes_count],buffer 32 | 33 | mov esi,buffer+GIFHEADER.length+256*3 34 | mov edi,esi 35 | 36 | xor eax,eax 37 | find_image: 38 | cmp esi,[bytes_count] 39 | jae picture_error 40 | lodsb 41 | cmp al,',' 42 | je image_found 43 | cmp al,'!' 44 | jne picture_error 45 | inc esi 46 | skip_application_data: 47 | lodsb 48 | add esi,eax 49 | or al,al 50 | jnz skip_application_data 51 | jmp find_image 52 | image_found: 53 | add esi,4 54 | xor eax,eax 55 | lodsw 56 | mov ebx,eax 57 | lodsw 58 | inc esi 59 | cmp byte [esi],8 60 | jne picture_error 61 | inc esi 62 | 63 | mov [ddsd.dwSize],sizeof.DDSURFACEDESC 64 | mov [ddsd.dwFlags],DDSD_CAPS+DDSD_WIDTH+DDSD_HEIGHT+DDSD_CKSRCBLT 65 | mov [ddsd.ddsCaps.dwCaps],DDSCAPS_OFFSCREENPLAIN+DDSCAPS_SYSTEMMEMORY 66 | mov [ddsd.dwWidth],ebx 67 | mov [ddsd.dwHeight],eax 68 | movzx eax,[GIFHEADER.background] 69 | mov [ddsd.ddckCKSrcBlt.dwColorSpaceLowValue],eax 70 | mov [ddsd.ddckCKSrcBlt.dwColorSpaceHighValue],eax 71 | cominvk DDraw,CreateSurface,\ 72 | ddsd,DDSPicture,0 73 | or eax,eax 74 | jnz picture_error 75 | cominvk DDSPicture,Lock,\ 76 | 0,ddsd,DDLOCK_WAIT,0 77 | 78 | mov edi,esi 79 | mov edx,esi 80 | mov ebx,buffer 81 | add ebx,[bytes_count] 82 | link_streams: 83 | cmp esi,[bytes_count] 84 | jae picture_error 85 | lodsb 86 | movzx ecx,al 87 | rep movsb 88 | or al,al 89 | jnz link_streams 90 | 91 | mov edi,[ddsd.lpSurface] 92 | mov ebx,edx 93 | mov [LZW_bits],0 94 | LZW_clear: 95 | xor edx,edx 96 | LZW_decompress_loop: 97 | mov ch,9 98 | cmp edx,(100h-2)*8 99 | jbe LZW_read_bits 100 | mov ch,10 101 | cmp edx,(300h-2)*8 102 | jbe LZW_read_bits 103 | mov ch,11 104 | cmp edx,(700h-2)*8 105 | jbe LZW_read_bits 106 | mov ch,12 107 | LZW_read_bits: 108 | mov cl,[LZW_bits] 109 | mov eax,[ebx] 110 | shr eax,cl 111 | xchg cl,ch 112 | mov esi,1 113 | shl esi,cl 114 | dec esi 115 | and eax,esi 116 | add cl,ch 117 | LZW_read_bits_count: 118 | cmp cl,8 119 | jbe LZW_read_bits_ok 120 | sub cl,8 121 | inc ebx 122 | jmp LZW_read_bits_count 123 | LZW_read_bits_ok: 124 | mov [LZW_bits],cl 125 | cmp eax,100h 126 | jb LZW_single_byte 127 | je LZW_clear 128 | sub eax,102h 129 | jc LZW_end 130 | shl eax,3 131 | cmp eax,edx 132 | ja picture_error 133 | mov ecx,[LZW_table+eax] 134 | mov esi,[LZW_table+eax+4] 135 | mov [LZW_table+edx+4],edi 136 | rep movsb 137 | mov eax,[LZW_table+eax] 138 | inc eax 139 | mov [LZW_table+edx],eax 140 | jmp LZW_decompress_next 141 | LZW_single_byte: 142 | mov [LZW_table+edx],2 143 | mov [LZW_table+edx+4],edi 144 | stosb 145 | LZW_decompress_next: 146 | add edx,8 147 | jmp LZW_decompress_loop 148 | LZW_end: 149 | 150 | cominvk DDSPicture,Unlock,0 151 | 152 | mov eax,[DDSPicture] 153 | clc 154 | ret 155 | 156 | picture_error: 157 | stc 158 | ret 159 | 160 | load_palette: 161 | 162 | invoke CreateFileA,esi,GENERIC_READ,0,0,OPEN_EXISTING,0,0 163 | mov edi,eax 164 | invoke ReadFile,edi,buffer,GIFHEADER.length+256*3,bytes_count,0 165 | cmp [bytes_count],GIFHEADER.length+256*3 166 | jne picture_error 167 | invoke CloseHandle,edi 168 | 169 | cmp [GIFHEADER.ID],'GIF8' 170 | jne picture_error 171 | cmp [GIFHEADER.ver],'7a' 172 | jne picture_error 173 | mov al,[GIFHEADER.bits] 174 | and al,111b 175 | cmp al,111b 176 | jne picture_error 177 | 178 | mov esi,buffer+GIFHEADER.length 179 | mov edi,buffer+400h 180 | mov ecx,256 181 | convert_palette: 182 | movsw 183 | movsb 184 | xor al,al 185 | stosb 186 | loop convert_palette 187 | 188 | cominvk DDraw,CreatePalette,\ 189 | DDPCAPS_8BIT+DDPCAPS_ALLOW256,buffer+400h,DDPalette,0 190 | or eax,eax 191 | jnz picture_error 192 | 193 | clc 194 | ret 195 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/DIALOG/DIALOG.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; DialogBox example 3 | 4 | format PE GUI 4.0 5 | entry start 6 | 7 | include 'win32a.inc' 8 | 9 | ID_CAPTION = 101 10 | ID_MESSAGE = 102 11 | ID_ICONERROR = 201 12 | ID_ICONINFORMATION = 202 13 | ID_ICONQUESTION = 203 14 | ID_ICONWARNING = 204 15 | ID_TOPMOST = 301 16 | 17 | section '.text' code readable executable 18 | 19 | start: 20 | 21 | invoke GetModuleHandle,0 22 | invoke DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc,0 23 | or eax,eax 24 | jz exit 25 | invoke MessageBox,HWND_DESKTOP,message,caption,[flags] 26 | exit: 27 | invoke ExitProcess,0 28 | 29 | proc DialogProc hwnddlg,msg,wparam,lparam 30 | push ebx esi edi 31 | cmp [msg],WM_INITDIALOG 32 | je .wminitdialog 33 | cmp [msg],WM_COMMAND 34 | je .wmcommand 35 | cmp [msg],WM_CLOSE 36 | je .wmclose 37 | xor eax,eax 38 | jmp .finish 39 | .wminitdialog: 40 | invoke CheckRadioButton,[hwnddlg],ID_ICONERROR,ID_ICONWARNING,ID_ICONINFORMATION 41 | jmp .processed 42 | .wmcommand: 43 | cmp [wparam],BN_CLICKED shl 16 + IDCANCEL 44 | je .wmclose 45 | cmp [wparam],BN_CLICKED shl 16 + IDOK 46 | jne .processed 47 | invoke GetDlgItemText,[hwnddlg],ID_CAPTION,caption,40h 48 | invoke GetDlgItemText,[hwnddlg],ID_MESSAGE,message,100h 49 | mov [flags],MB_OK 50 | invoke IsDlgButtonChecked,[hwnddlg],ID_ICONERROR 51 | cmp eax,BST_CHECKED 52 | jne .iconerror_ok 53 | or [flags],MB_ICONERROR 54 | .iconerror_ok: 55 | invoke IsDlgButtonChecked,[hwnddlg],ID_ICONINFORMATION 56 | cmp eax,BST_CHECKED 57 | jne .iconinformation_ok 58 | or [flags],MB_ICONINFORMATION 59 | .iconinformation_ok: 60 | invoke IsDlgButtonChecked,[hwnddlg],ID_ICONQUESTION 61 | cmp eax,BST_CHECKED 62 | jne .iconquestion_ok 63 | or [flags],MB_ICONQUESTION 64 | .iconquestion_ok: 65 | invoke IsDlgButtonChecked,[hwnddlg],ID_ICONWARNING 66 | cmp eax,BST_CHECKED 67 | jne .iconwarning_ok 68 | or [flags],MB_ICONWARNING 69 | .iconwarning_ok: 70 | invoke IsDlgButtonChecked,[hwnddlg],ID_TOPMOST 71 | cmp eax,BST_CHECKED 72 | jne .topmost_ok 73 | or [flags],MB_TOPMOST 74 | .topmost_ok: 75 | invoke EndDialog,[hwnddlg],1 76 | jmp .processed 77 | .wmclose: 78 | invoke EndDialog,[hwnddlg],0 79 | .processed: 80 | mov eax,1 81 | .finish: 82 | pop edi esi ebx 83 | ret 84 | endp 85 | 86 | section '.bss' readable writeable 87 | 88 | flags dd ? 89 | caption rb 40h 90 | message rb 100h 91 | 92 | section '.idata' import data readable writeable 93 | 94 | library kernel,'KERNEL32.DLL',\ 95 | user,'USER32.DLL' 96 | 97 | import kernel,\ 98 | GetModuleHandle,'GetModuleHandleA',\ 99 | ExitProcess,'ExitProcess' 100 | 101 | import user,\ 102 | DialogBoxParam,'DialogBoxParamA',\ 103 | CheckRadioButton,'CheckRadioButton',\ 104 | GetDlgItemText,'GetDlgItemTextA',\ 105 | IsDlgButtonChecked,'IsDlgButtonChecked',\ 106 | MessageBox,'MessageBoxA',\ 107 | EndDialog,'EndDialog' 108 | 109 | section '.rsrc' resource data readable 110 | 111 | directory RT_DIALOG,dialogs 112 | 113 | resource dialogs,\ 114 | 37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration 115 | 116 | dialog demonstration,'Create message box',70,70,190,175,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME 117 | dialogitem 'STATIC','&Caption:',-1,10,10,70,8,WS_VISIBLE 118 | dialogitem 'EDIT','',ID_CAPTION,10,20,170,13,WS_VISIBLE+WS_BORDER+WS_TABSTOP 119 | dialogitem 'STATIC','&Message:',-1,10,40,70,8,WS_VISIBLE 120 | dialogitem 'EDIT','',ID_MESSAGE,10,50,170,13,WS_VISIBLE+WS_BORDER+WS_TABSTOP+ES_AUTOHSCROLL 121 | dialogitem 'BUTTON','&Icon',-1,10,70,80,70,WS_VISIBLE+BS_GROUPBOX 122 | dialogitem 'BUTTON','&Error',ID_ICONERROR,20,82,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON+WS_TABSTOP+WS_GROUP 123 | dialogitem 'BUTTON','I&nformation',ID_ICONINFORMATION,20,95,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON 124 | dialogitem 'BUTTON','&Question',ID_ICONQUESTION,20,108,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON 125 | dialogitem 'BUTTON','&Warning',ID_ICONWARNING,20,121,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON 126 | dialogitem 'BUTTON','&Style',-1,100,70,80,70,WS_VISIBLE+BS_GROUPBOX 127 | dialogitem 'BUTTON','&Top most',ID_TOPMOST,110,82,60,13,WS_VISIBLE+WS_TABSTOP+BS_AUTOCHECKBOX 128 | dialogitem 'BUTTON','OK',IDOK,85,150,45,15,WS_VISIBLE+WS_TABSTOP+BS_DEFPUSHBUTTON 129 | dialogitem 'BUTTON','C&ancel',IDCANCEL,135,150,45,15,WS_VISIBLE+WS_TABSTOP+BS_PUSHBUTTON 130 | enddialog 131 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/DIALOG/DIALOG.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/DIALOG/DIALOG.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/DLL/ERRORMSG.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; DLL creation example 3 | 4 | format PE GUI 4.0 DLL 5 | entry DllEntryPoint 6 | 7 | include 'win32a.inc' 8 | 9 | section '.text' code readable executable 10 | 11 | proc DllEntryPoint hinstDLL,fdwReason,lpvReserved 12 | mov eax,TRUE 13 | ret 14 | endp 15 | 16 | ; VOID ShowErrorMessage(HWND hWnd,DWORD dwError); 17 | 18 | proc ShowErrorMessage hWnd,dwError 19 | local lpBuffer:DWORD 20 | lea eax,[lpBuffer] 21 | invoke FormatMessage,FORMAT_MESSAGE_ALLOCATE_BUFFER+FORMAT_MESSAGE_FROM_SYSTEM,0,[dwError],LANG_NEUTRAL,eax,0,0 22 | invoke MessageBox,[hWnd],[lpBuffer],NULL,MB_ICONERROR+MB_OK 23 | invoke LocalFree,[lpBuffer] 24 | ret 25 | endp 26 | 27 | ; VOID ShowLastError(HWND hWnd); 28 | 29 | proc ShowLastError hWnd 30 | invoke GetLastError 31 | stdcall ShowErrorMessage,[hWnd],eax 32 | ret 33 | endp 34 | 35 | section '.idata' import data readable writeable 36 | 37 | library kernel,'KERNEL32.DLL',\ 38 | user,'USER32.DLL' 39 | 40 | import kernel,\ 41 | GetLastError,'GetLastError',\ 42 | SetLastError,'SetLastError',\ 43 | FormatMessage,'FormatMessageA',\ 44 | LocalFree,'LocalFree' 45 | 46 | import user,\ 47 | MessageBox,'MessageBoxA' 48 | 49 | section '.edata' export data readable 50 | 51 | export 'ERRORMSG.DLL',\ 52 | ShowErrorMessage,'ShowErrorMessage',\ 53 | ShowLastError,'ShowLastError' 54 | 55 | section '.reloc' fixups data readable discardable 56 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/DLL/ERRORMSG.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/DLL/ERRORMSG.DLL -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/DLL/LASTERR.ASM: -------------------------------------------------------------------------------- 1 | 2 | format PE GUI 4.0 3 | entry start 4 | 5 | include 'win32a.inc' 6 | 7 | section '.text' code readable executable 8 | 9 | start: 10 | invoke SetLastError,0 11 | invoke ShowLastError,HWND_DESKTOP 12 | invoke ExitProcess,0 13 | 14 | section '.idata' import data readable writeable 15 | 16 | library kernel,'KERNEL32.DLL',\ 17 | errormsg,'ERRORMSG.DLL' 18 | 19 | import kernel,\ 20 | SetLastError,'SetLastError',\ 21 | ExitProcess,'ExitProcess' 22 | 23 | import errormsg,\ 24 | ShowLastError,'ShowLastError' 25 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/DLL/LASTERR.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/DLL/LASTERR.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/HELLO/HELLO.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; example of simplified Windows programming using complex macro features 3 | 4 | include 'win32ax.inc' ; you can simply switch between win32ax, win32wx, win64ax and win64wx here 5 | 6 | .code 7 | 8 | start: 9 | invoke MessageBox,HWND_DESKTOP,"Hi! I'm the example program!",invoke GetCommandLine,MB_OK 10 | invoke ExitProcess,0 11 | 12 | .end start 13 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/HELLO/HELLO.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/HELLO/HELLO.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/HELLO/Program.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; example of simplified Windows programming using complex macro features 3 | 4 | format PE GUI 4.0 5 | 6 | include 'F:\Flat Assembler\INCLUDE\win32ax.inc' ; you can simply switch between win32ax, win32wx, win64ax and win64wx here 7 | 8 | .code 9 | start: 10 | invoke MessageBox, HWND_DESKTOP, invoke GetCommandLine, "Current CommanLine is:" ,MB_OK or MB_TOPMOST 11 | invoke ExitProcess,0 12 | 13 | .end start 14 | 15 | section '.rsrc' resource data readable 16 | 17 | ; resource directory 18 | directory RT_ICON,icons,\ 19 | RT_GROUP_ICON,group_icons,\ 20 | RT_VERSION,versions 21 | 22 | ; resource subdirectories 23 | resource icons,\ 24 | 1,LANG_NEUTRAL,icon_data 25 | 26 | resource group_icons,\ 27 | 17,LANG_NEUTRAL,main_icon 28 | 29 | resource versions,\ 30 | 1,LANG_NEUTRAL,version 31 | 32 | 33 | icon main_icon,icon_data,'program.ico' 34 | 35 | versioninfo version,VOS__WINDOWS32,VFT_APP,VFT2_UNKNOWN,LANG_ENGLISH+SUBLANG_DEFAULT,0,\ 36 | 'FileDescription','A tool for command line test.',\ 37 | 'LegalCopyright','Tishion (C) All rights reserved.',\ 38 | 'FileVersion','1.0',\ 39 | 'ProductVersion','1.0',\ 40 | 'OriginalFilename','Program.exe' 41 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/HELLO/Program.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/HELLO/Program.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/HELLO/Program.sym: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/HELLO/Program.sym -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/HELLO/program.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/HELLO/program.ico -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/MINIPAD/MINIPAD.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/MINIPAD/MINIPAD.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/MINIPAD/MINIPAD.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/MINIPAD/MINIPAD.ICO -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/MSCOFF/MSCOFF.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; example of making Win32 COFF object file 3 | 4 | format MS COFF 5 | 6 | extrn '__imp__MessageBoxA@16' as MessageBox:dword 7 | 8 | section '.text' code readable executable 9 | 10 | public _demo 11 | 12 | _demo: 13 | push 0 14 | push _caption 15 | push _message 16 | push 0 17 | call [MessageBox] 18 | ret 19 | 20 | section '.data' data readable writeable 21 | 22 | _caption db 'Win32 assembly',0 23 | _message db 'Coffee time!',0 24 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/MSCOFF/MSCOFF.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/MSCOFF/MSCOFF.OBJ -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/OPENGL/OPENGL.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/OPENGL/OPENGL.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/PEDEMO/PEDEMO.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; Example of making 32-bit PE program as raw code and data 3 | 4 | format PE GUI 5 | entry start 6 | 7 | section '.text' code readable executable 8 | 9 | start: 10 | 11 | push 0 12 | push _caption 13 | push _message 14 | push 0 15 | call [MessageBoxA] 16 | 17 | push 0 18 | call [ExitProcess] 19 | 20 | section '.data' data readable writeable 21 | 22 | _caption db 'Win32 assembly program',0 23 | _message db 'Hello World!',0 24 | 25 | section '.idata' import data readable writeable 26 | 27 | dd 0,0,0,RVA kernel_name,RVA kernel_table 28 | dd 0,0,0,RVA user_name,RVA user_table 29 | dd 0,0,0,0,0 30 | 31 | kernel_table: 32 | ExitProcess dd RVA _ExitProcess 33 | dd 0 34 | user_table: 35 | MessageBoxA dd RVA _MessageBoxA 36 | dd 0 37 | 38 | kernel_name db 'KERNEL32.DLL',0 39 | user_name db 'USER32.DLL',0 40 | 41 | _ExitProcess dw 0 42 | db 'ExitProcess',0 43 | _MessageBoxA dw 0 44 | db 'MessageBoxA',0 45 | 46 | section '.reloc' fixups data readable discardable ; needed for Win32s 47 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/PEDEMO/PEDEMO.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/PEDEMO/PEDEMO.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/PEDEMO/Program.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; Example of making 32-bit PE program as raw code and data 3 | 4 | format PE GUI 5 | entry start 6 | 7 | section '.text' code readable executable 8 | 9 | start: 10 | 11 | call [GetCommandLineA] 12 | 13 | push 0 14 | push _caption 15 | push eax 16 | push 0 17 | call [MessageBoxA] 18 | 19 | push 0 20 | call [ExitProcess] 21 | 22 | section '.data' data readable writeable 23 | 24 | _caption db 'Current Commandline is:',0 25 | _message db 'Hello World!',0 26 | 27 | section '.idata' import data readable writeable 28 | 29 | dd 0,0,0,RVA kernel_name,RVA kernel_table 30 | dd 0,0,0,RVA user_name,RVA user_table 31 | dd 0,0,0,0,0 32 | 33 | kernel_table: 34 | ExitProcess dd RVA _ExitProcess 35 | GetCommandLineA dd RVA _GetCommandLineA 36 | dd 0 37 | user_table: 38 | MessageBoxA dd RVA _MessageBoxA 39 | dd 0 40 | 41 | kernel_name db 'KERNEL32.DLL',0 42 | user_name db 'USER32.DLL',0 43 | 44 | _ExitProcess dw 0 45 | db 'ExitProcess',0 46 | _MessageBoxA dw 0 47 | db 'MessageBoxA',0 48 | _GetCommandLineA dw 0 49 | db 'GetCommandLineA',0 50 | 51 | section '.reloc' fixups data readable discardable ; needed for Win32s 52 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/PEDEMO/Program.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/PEDEMO/Program.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/PEDEMO/Program.sym: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/PEDEMO/Program.sym -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/TEMPLATE/TEMPLATE.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; Template for program using standard Win32 headers 3 | 4 | format PE GUI 4.0 5 | entry start 6 | 7 | include 'win32w.inc' 8 | 9 | section '.text' code readable executable 10 | 11 | start: 12 | 13 | invoke GetModuleHandle,0 14 | mov [wc.hInstance],eax 15 | invoke LoadIcon,0,IDI_APPLICATION 16 | mov [wc.hIcon],eax 17 | invoke LoadCursor,0,IDC_ARROW 18 | mov [wc.hCursor],eax 19 | invoke RegisterClass,wc 20 | test eax,eax 21 | jz error 22 | 23 | invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_DLGFRAME+WS_SYSMENU,128,128,256,192,NULL,NULL,[wc.hInstance],NULL 24 | test eax,eax 25 | jz error 26 | 27 | msg_loop: 28 | invoke GetMessage,msg,NULL,0,0 29 | cmp eax,1 30 | jb end_loop 31 | jne msg_loop 32 | invoke TranslateMessage,msg 33 | invoke DispatchMessage,msg 34 | jmp msg_loop 35 | 36 | error: 37 | invoke MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK 38 | 39 | end_loop: 40 | invoke ExitProcess,[msg.wParam] 41 | 42 | proc WindowProc uses ebx esi edi, hwnd,wmsg,wparam,lparam 43 | cmp [wmsg],WM_DESTROY 44 | je .wmdestroy 45 | .defwndproc: 46 | invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] 47 | jmp .finish 48 | .wmdestroy: 49 | invoke PostQuitMessage,0 50 | xor eax,eax 51 | .finish: 52 | ret 53 | endp 54 | 55 | section '.data' data readable writeable 56 | 57 | _class TCHAR 'FASMWIN32',0 58 | _title TCHAR 'Win32 program template',0 59 | _error TCHAR 'Startup failed.',0 60 | 61 | wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class 62 | 63 | msg MSG 64 | 65 | section '.idata' import data readable writeable 66 | 67 | library kernel32,'KERNEL32.DLL',\ 68 | user32,'USER32.DLL' 69 | 70 | include 'api\kernel32.inc' 71 | include 'api\user32.inc' 72 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/TEMPLATE/TEMPLATE.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/TEMPLATE/TEMPLATE.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/USECOM/USECOM.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; Component Object Model usage demonstration 3 | 4 | format PE GUI 4.0 5 | entry start 6 | 7 | include 'win32a.inc' 8 | 9 | struc GUID def 10 | { 11 | match d1-d2-d3-d4-d5, def 12 | \{ 13 | .Data1 dd 0x\#d1 14 | .Data2 dw 0x\#d2 15 | .Data3 dw 0x\#d3 16 | .Data4 db 0x\#d4 shr 8,0x\#d4 and 0FFh 17 | .Data5 db 0x\#d5 shr 40,0x\#d5 shr 32 and 0FFh,0x\#d5 shr 24 and 0FFh,0x\#d5 shr 16 and 0FFh,0x\#d5 shr 8 and 0FFh,0x\#d5 and 0FFh 18 | \} 19 | } 20 | 21 | interface ITaskBarList,\ 22 | QueryInterface,\ 23 | AddRef,\ 24 | Release,\ 25 | HrInit,\ 26 | AddTab,\ 27 | DeleteTab,\ 28 | ActivateTab,\ 29 | SetActiveAlt 30 | 31 | CLSCTX_INPROC_SERVER = 0x1 32 | CLSCTX_INPROC_HANDLER = 0x2 33 | CLSCTX_LOCAL_SERVER = 0x4 34 | CLSCTX_INPROC_SERVER16 = 0x8 35 | CLSCTX_REMOTE_SERVER = 0x10 36 | CLSCTX_INPROC_HANDLER16 = 0x20 37 | CLSCTX_INPROC_SERVERX86 = 0x40 38 | CLSCTX_INPROC_HANDLERX86 = 0x80 39 | CLSCTX_ESERVER_HANDLER = 0x100 40 | CLSCTX_NO_CODE_DOWNLOAD = 0x400 41 | CLSCTX_NO_CUSTOM_MARSHAL = 0x1000 42 | CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000 43 | CLSCTX_NO_FAILURE_LOG = 0x4000 44 | CLSCTX_DISABLE_AAA = 0x8000 45 | CLSCTX_ENABLE_AAA = 0x10000 46 | CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000 47 | 48 | ID_EXIT = IDCANCEL 49 | ID_SHOW = 100 50 | ID_HIDE = 101 51 | 52 | IDD_COMDEMO = 1 53 | 54 | section '.text' code readable executable 55 | 56 | start: 57 | 58 | invoke CoInitialize,NULL 59 | invoke CoCreateInstance,CLSID_TaskbarList,NULL,CLSCTX_INPROC_SERVER,IID_ITaskbarList,ShellTaskBar 60 | 61 | invoke GetModuleHandle,0 62 | invoke DialogBoxParam,eax,IDD_COMDEMO,HWND_DESKTOP,COMDemo,0 63 | 64 | cominvk ShellTaskBar,Release 65 | 66 | invoke ExitProcess,0 67 | 68 | proc COMDemo hwnd,msg,wparam,lparam 69 | push ebx esi edi 70 | cmp [msg],WM_INITDIALOG 71 | je .wminitdialog 72 | cmp [msg],WM_COMMAND 73 | je .wmcommand 74 | cmp [msg],WM_CLOSE 75 | je .wmclose 76 | xor eax,eax 77 | jmp .finish 78 | .wminitdialog: 79 | jmp .processed 80 | .wmcommand: 81 | cmp [wparam],BN_CLICKED shl 16 + ID_EXIT 82 | je .wmclose 83 | cmp [wparam],BN_CLICKED shl 16 + ID_SHOW 84 | je .show 85 | cmp [wparam],BN_CLICKED shl 16 + ID_HIDE 86 | jne .processed 87 | .hide: 88 | cominvk ShellTaskBar,HrInit 89 | cominvk ShellTaskBar,DeleteTab,[hwnd] 90 | jmp .processed 91 | .show: 92 | mov ebx,[ShellTaskBar] 93 | comcall ebx,ITaskBarList,HrInit 94 | comcall ebx,ITaskBarList,AddTab,[hwnd] 95 | comcall ebx,ITaskBarList,ActivateTab,[hwnd] 96 | jmp .processed 97 | .wmclose: 98 | invoke EndDialog,[hwnd],0 99 | .processed: 100 | mov eax,1 101 | .finish: 102 | pop edi esi ebx 103 | ret 104 | endp 105 | 106 | section '.data' data readable writeable 107 | 108 | CLSID_TaskbarList GUID 56FDF344-FD6D-11D0-958A-006097C9A090 109 | IID_ITaskbarList GUID 56FDF342-FD6D-11D0-958A-006097C9A090 110 | 111 | ShellTaskBar ITaskBarList 112 | 113 | section '.idata' import data readable 114 | 115 | library kernel,'KERNEL32.DLL',\ 116 | user,'USER32.DLL',\ 117 | ole,'OLE32.DLL' 118 | 119 | import kernel,\ 120 | GetModuleHandle,'GetModuleHandleA',\ 121 | ExitProcess,'ExitProcess' 122 | 123 | import user,\ 124 | DialogBoxParam,'DialogBoxParamA',\ 125 | EndDialog,'EndDialog' 126 | 127 | import ole,\ 128 | CoInitialize,'CoInitialize',\ 129 | CoCreateInstance,'CoCreateInstance' 130 | 131 | section '.rsrc' resource data readable 132 | 133 | directory RT_DIALOG,dialogs 134 | 135 | resource dialogs,\ 136 | IDD_COMDEMO,LANG_ENGLISH+SUBLANG_DEFAULT,comdemo 137 | 138 | dialog comdemo,'Taskbar item control',70,70,170,24,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME 139 | dialogitem 'BUTTON','Show',ID_SHOW,4,4,45,15,WS_VISIBLE+WS_TABSTOP 140 | dialogitem 'BUTTON','Hide',ID_HIDE,54,4,45,15,WS_VISIBLE+WS_TABSTOP 141 | dialogitem 'BUTTON','Exit',ID_EXIT,120,4,45,15,WS_VISIBLE+WS_TABSTOP 142 | enddialog 143 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/USECOM/USECOM.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/USECOM/USECOM.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/DLL/MSGDEMO.ASM: -------------------------------------------------------------------------------- 1 | format PE64 console 2 | entry start 3 | 4 | include 'win64a.inc' 5 | 6 | section '.text' code readable executable 7 | 8 | start: 9 | sub rsp,8 10 | 11 | invoke WriteMessage,message 12 | 13 | invoke ExitProcess,0 14 | 15 | section '.data' data readable 16 | 17 | message db "Hi! I'm the example program!",0 18 | 19 | section '.idata' import data readable writeable 20 | 21 | library kernel32,'KERNEL32.DLL',\ 22 | writemsg,'WRITEMSG.DLL' 23 | 24 | include 'api/kernel32.inc' 25 | 26 | import writemsg,\ 27 | WriteMessage,'WriteMessage' -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/DLL/MSGDEMO.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/WIN64/DLL/MSGDEMO.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/DLL/WRITEMSG.ASM: -------------------------------------------------------------------------------- 1 | format PE64 console DLL 2 | entry DllEntryPoint 3 | 4 | include 'win64a.inc' 5 | 6 | section '.text' code readable executable 7 | 8 | proc DllEntryPoint hinstDLL,fdwReason,lpvReserved 9 | mov eax,TRUE 10 | ret 11 | endp 12 | 13 | proc WriteMessage uses rbx rsi rdi, message 14 | mov rdi,rcx ; first parameter passed in RCX 15 | invoke GetStdHandle,STD_OUTPUT_HANDLE 16 | mov rbx,rax 17 | xor al,al 18 | or rcx,-1 19 | repne scasb 20 | dec rdi 21 | mov r8,-2 22 | sub r8,rcx 23 | sub rdi,r8 24 | invoke WriteFile,rbx,rdi,r8,bytes_count,0 25 | ret 26 | endp 27 | 28 | section '.bss' data readable writeable 29 | 30 | bytes_count dd ? 31 | 32 | section '.edata' export data readable 33 | 34 | export 'WRITEMSG.DLL',\ 35 | WriteMessage,'WriteMessage' 36 | 37 | section '.reloc' fixups data readable discardable 38 | 39 | if $=$$ 40 | dd 0,8 ; if there are no fixups, generate dummy entry 41 | end if 42 | 43 | section '.idata' import data readable writeable 44 | 45 | library kernel32,'KERNEL32.DLL' 46 | 47 | include 'api/kernel32.inc' 48 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/DLL/WRITEMSG.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/WIN64/DLL/WRITEMSG.DLL -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/MANDEL/MANDEL.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/WIN64/MANDEL/MANDEL.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/OPENGL/OPENGL.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/WIN64/OPENGL/OPENGL.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/PE64DEMO/PE64DEMO.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; Example of 64-bit PE program 3 | 4 | format PE64 GUI 5 | entry start 6 | 7 | section '.text' code readable executable 8 | 9 | start: 10 | sub rsp,8*5 ; reserve stack for API use and make stack dqword aligned 11 | 12 | mov r9d,0 13 | lea r8,[_caption] 14 | lea rdx,[_message] 15 | mov rcx,0 16 | call [MessageBoxA] 17 | 18 | mov ecx,eax 19 | call [ExitProcess] 20 | 21 | section '.data' data readable writeable 22 | 23 | _caption db 'Win64 assembly program',0 24 | _message db 'Hello World!',0 25 | 26 | section '.idata' import data readable writeable 27 | 28 | dd 0,0,0,RVA kernel_name,RVA kernel_table 29 | dd 0,0,0,RVA user_name,RVA user_table 30 | dd 0,0,0,0,0 31 | 32 | kernel_table: 33 | ExitProcess dq RVA _ExitProcess 34 | dq 0 35 | user_table: 36 | MessageBoxA dq RVA _MessageBoxA 37 | dq 0 38 | 39 | kernel_name db 'KERNEL32.DLL',0 40 | user_name db 'USER32.DLL',0 41 | 42 | _ExitProcess dw 0 43 | db 'ExitProcess',0 44 | _MessageBoxA dw 0 45 | db 'MessageBoxA',0 46 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/PE64DEMO/PE64DEMO.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/WIN64/PE64DEMO/PE64DEMO.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/TEMPLATE/TEMPLATE.ASM: -------------------------------------------------------------------------------- 1 | 2 | format PE64 GUI 5.0 3 | entry start 4 | 5 | include 'win64a.inc' 6 | 7 | section '.text' code readable executable 8 | 9 | start: 10 | sub rsp,8 ; Make stack dqword aligned 11 | 12 | invoke GetModuleHandle,0 13 | mov [wc.hInstance],rax 14 | invoke LoadIcon,0,IDI_APPLICATION 15 | mov [wc.hIcon],rax 16 | mov [wc.hIconSm],rax 17 | invoke LoadCursor,0,IDC_ARROW 18 | mov [wc.hCursor],rax 19 | invoke RegisterClassEx,wc 20 | test rax,rax 21 | jz error 22 | 23 | invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_DLGFRAME+WS_SYSMENU,128,128,256,192,NULL,NULL,[wc.hInstance],NULL 24 | test rax,rax 25 | jz error 26 | 27 | msg_loop: 28 | invoke GetMessage,msg,NULL,0,0 29 | cmp eax,1 30 | jb end_loop 31 | jne msg_loop 32 | invoke TranslateMessage,msg 33 | invoke DispatchMessage,msg 34 | jmp msg_loop 35 | 36 | error: 37 | invoke MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK 38 | 39 | end_loop: 40 | invoke ExitProcess,[msg.wParam] 41 | 42 | proc WindowProc uses rbx rsi rdi, hwnd,wmsg,wparam,lparam 43 | 44 | ; Note that first four parameters are passed in registers, 45 | ; while names given in the declaration of procedure refer to the stack 46 | ; space reserved for them - you may store them there to be later accessible 47 | ; if the contents of registers gets destroyed. This may look like: 48 | ; mov [hwnd],rcx 49 | ; mov [wmsg],edx 50 | ; mov [wparam],r8 51 | ; mov [lparam],r9 52 | 53 | cmp edx,WM_DESTROY 54 | je .wmdestroy 55 | .defwndproc: 56 | invoke DefWindowProc,rcx,rdx,r8,r9 57 | jmp .finish 58 | .wmdestroy: 59 | invoke PostQuitMessage,0 60 | xor eax,eax 61 | .finish: 62 | ret 63 | 64 | endp 65 | 66 | section '.data' data readable writeable 67 | 68 | _title TCHAR 'Win64 program template',0 69 | _class TCHAR 'FASMWIN64',0 70 | _error TCHAR 'Startup failed.',0 71 | 72 | wc WNDCLASSEX sizeof.WNDCLASSEX,0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class,NULL 73 | 74 | msg MSG 75 | 76 | section '.idata' import data readable writeable 77 | 78 | library kernel32,'KERNEL32.DLL',\ 79 | user32,'USER32.DLL' 80 | 81 | include 'api\kernel32.inc' 82 | include 'api\user32.inc' 83 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/TEMPLATE/TEMPLATE.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/WIN64/TEMPLATE/TEMPLATE.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/USECOM/USECOM.ASM: -------------------------------------------------------------------------------- 1 | 2 | ; Component Object Model usage demonstration 3 | 4 | format PE64 GUI 5.0 5 | entry start 6 | 7 | include 'win64a.inc' 8 | 9 | struc GUID def 10 | { 11 | match d1-d2-d3-d4-d5, def 12 | \{ 13 | .Data1 dd 0x\#d1 14 | .Data2 dw 0x\#d2 15 | .Data3 dw 0x\#d3 16 | .Data4 db 0x\#d4 shr 8,0x\#d4 and 0FFh 17 | .Data5 db 0x\#d5 shr 40,0x\#d5 shr 32 and 0FFh,0x\#d5 shr 24 and 0FFh,0x\#d5 shr 16 and 0FFh,0x\#d5 shr 8 and 0FFh,0x\#d5 and 0FFh 18 | \} 19 | } 20 | 21 | interface ITaskBarList,\ 22 | QueryInterface,\ 23 | AddRef,\ 24 | Release,\ 25 | HrInit,\ 26 | AddTab,\ 27 | DeleteTab,\ 28 | ActivateTab,\ 29 | SetActiveAlt 30 | 31 | CLSCTX_INPROC_SERVER = 0x1 32 | CLSCTX_INPROC_HANDLER = 0x2 33 | CLSCTX_LOCAL_SERVER = 0x4 34 | CLSCTX_INPROC_SERVER16 = 0x8 35 | CLSCTX_REMOTE_SERVER = 0x10 36 | CLSCTX_INPROC_HANDLER16 = 0x20 37 | CLSCTX_INPROC_SERVERX86 = 0x40 38 | CLSCTX_INPROC_HANDLERX86 = 0x80 39 | CLSCTX_ESERVER_HANDLER = 0x100 40 | CLSCTX_NO_CODE_DOWNLOAD = 0x400 41 | CLSCTX_NO_CUSTOM_MARSHAL = 0x1000 42 | CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000 43 | CLSCTX_NO_FAILURE_LOG = 0x4000 44 | CLSCTX_DISABLE_AAA = 0x8000 45 | CLSCTX_ENABLE_AAA = 0x10000 46 | CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000 47 | 48 | ID_EXIT = IDCANCEL 49 | ID_SHOW = 100 50 | ID_HIDE = 101 51 | 52 | IDD_COMDEMO = 1 53 | 54 | section '.text' code readable executable 55 | 56 | start: 57 | sub rsp,8 ; Make stack dqword aligned 58 | 59 | invoke CoInitialize,NULL 60 | invoke CoCreateInstance,CLSID_TaskbarList,NULL,CLSCTX_INPROC_SERVER,IID_ITaskbarList,ShellTaskBar 61 | 62 | invoke GetModuleHandle,0 63 | invoke DialogBoxParam,rax,IDD_COMDEMO,HWND_DESKTOP,COMDemo,0 64 | 65 | cominvk ShellTaskBar,Release 66 | 67 | invoke ExitProcess,0 68 | 69 | proc COMDemo uses rbx, hwnd,msg,wparam,lparam 70 | mov [hwnd],rcx 71 | cmp edx,WM_INITDIALOG 72 | je .wminitdialog 73 | cmp edx,WM_COMMAND 74 | je .wmcommand 75 | cmp edx,WM_CLOSE 76 | je .wmclose 77 | xor eax,eax 78 | jmp .finish 79 | .wminitdialog: 80 | jmp .processed 81 | .wmcommand: 82 | cmp r8,BN_CLICKED shl 16 + ID_EXIT 83 | je .wmclose 84 | cmp r8,BN_CLICKED shl 16 + ID_SHOW 85 | je .show 86 | cmp r8,BN_CLICKED shl 16 + ID_HIDE 87 | jne .processed 88 | .hide: 89 | cominvk ShellTaskBar,HrInit 90 | cominvk ShellTaskBar,DeleteTab,[hwnd] 91 | jmp .processed 92 | .show: 93 | mov rbx,[ShellTaskBar] 94 | comcall rbx,ITaskBarList,HrInit 95 | comcall rbx,ITaskBarList,AddTab,[hwnd] 96 | comcall rbx,ITaskBarList,ActivateTab,[hwnd] 97 | jmp .processed 98 | .wmclose: 99 | invoke EndDialog,[hwnd],0 100 | .processed: 101 | mov eax,1 102 | .finish: 103 | ret 104 | endp 105 | 106 | section '.data' data readable writeable 107 | 108 | CLSID_TaskbarList GUID 56FDF344-FD6D-11D0-958A-006097C9A090 109 | IID_ITaskbarList GUID 56FDF342-FD6D-11D0-958A-006097C9A090 110 | 111 | ShellTaskBar ITaskBarList 112 | 113 | section '.idata' import data readable 114 | 115 | library kernel,'KERNEL32.DLL',\ 116 | user,'USER32.DLL',\ 117 | ole,'OLE32.DLL' 118 | 119 | import kernel,\ 120 | GetModuleHandle,'GetModuleHandleA',\ 121 | ExitProcess,'ExitProcess' 122 | 123 | import user,\ 124 | DialogBoxParam,'DialogBoxParamA',\ 125 | EndDialog,'EndDialog' 126 | 127 | import ole,\ 128 | CoInitialize,'CoInitialize',\ 129 | CoCreateInstance,'CoCreateInstance' 130 | 131 | section '.rsrc' resource data readable 132 | 133 | directory RT_DIALOG,dialogs 134 | 135 | resource dialogs,\ 136 | IDD_COMDEMO,LANG_ENGLISH+SUBLANG_DEFAULT,comdemo 137 | 138 | dialog comdemo,'Taskbar item control',70,70,170,24,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME 139 | dialogitem 'BUTTON','Show',ID_SHOW,4,4,45,15,WS_VISIBLE+WS_TABSTOP 140 | dialogitem 'BUTTON','Hide',ID_HIDE,54,4,45,15,WS_VISIBLE+WS_TABSTOP 141 | dialogitem 'BUTTON','Exit',ID_EXIT,120,4,45,15,WS_VISIBLE+WS_TABSTOP 142 | enddialog 143 | -------------------------------------------------------------------------------- /tools/Flat Assembler/EXAMPLES/WIN64/USECOM/USECOM.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/EXAMPLES/WIN64/USECOM/USECOM.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/FASM.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/FASM.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/FASM.PDF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/FASM.PDF -------------------------------------------------------------------------------- /tools/Flat Assembler/FASMW.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/FASMW.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/FASMW.INI: -------------------------------------------------------------------------------- 1 | [Environment] 2 | Include=F:\Flat Assembler\INCLUDE 3 | [Compiler] 4 | Memory=65536 5 | Priority=0 6 | [Options] 7 | SecureSelection=0 8 | AutoBrackets=1 9 | AutoIndent=1 10 | SmartTabs=1 11 | OptimalFill=1 12 | ReviveDeadKeys=0 13 | ConsoleCaret=1 14 | [Colors] 15 | Text=0,0,0 16 | Background=255,255,255 17 | SelectionText=255,255,255 18 | SelectionBackground=51,153,255 19 | Symbols=48,48,240 20 | Numbers=0,144,0 21 | Strings=176,0,0 22 | Comments=128,128,128 23 | [Font] 24 | Face=Courier New 25 | Height=16 26 | Width=0 27 | Weight=0 28 | Italic=0 29 | CharSet=1 30 | [Window] 31 | Top=160 32 | Left=863 33 | Right=1835 34 | Bottom=868 35 | Maximized=0 36 | [Help] 37 | Path= 38 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/API/COMCTL32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; COMCTL32 API calls 3 | 4 | import comctl32,\ 5 | CreateMappedBitmap,'CreateMappedBitmap',\ 6 | CreatePropertySheetPageA,'CreatePropertySheetPageA',\ 7 | CreatePropertySheetPageW,'CreatePropertySheetPageW',\ 8 | CreateStatusWindowA,'CreateStatusWindowA',\ 9 | CreateStatusWindowW,'CreateStatusWindowW',\ 10 | CreateToolbar,'CreateToolbar',\ 11 | CreateToolbarEx,'CreateToolbarEx',\ 12 | CreateUpDownControl,'CreateUpDownControl',\ 13 | DestroyPropertySheetPage,'DestroyPropertySheetPage',\ 14 | DrawInsert,'DrawInsert',\ 15 | DrawStatusTextA,'DrawStatusTextA',\ 16 | DrawStatusTextW,'DrawStatusTextW',\ 17 | FlatSB_EnableScrollBar,'FlatSB_EnableScrollBar',\ 18 | FlatSB_GetScrollInfo,'FlatSB_GetScrollInfo',\ 19 | FlatSB_GetScrollPos,'FlatSB_GetScrollPos',\ 20 | FlatSB_GetScrollProp,'FlatSB_GetScrollProp',\ 21 | FlatSB_GetScrollRange,'FlatSB_GetScrollRange',\ 22 | FlatSB_SetScrollInfo,'FlatSB_SetScrollInfo',\ 23 | FlatSB_SetScrollPos,'FlatSB_SetScrollPos',\ 24 | FlatSB_SetScrollProp,'FlatSB_SetScrollProp',\ 25 | FlatSB_SetScrollRange,'FlatSB_SetScrollRange',\ 26 | FlatSB_ShowScrollBar,'FlatSB_ShowScrollBar',\ 27 | GetEffectiveClientRect,'GetEffectiveClientRect',\ 28 | ImageList_Add,'ImageList_Add',\ 29 | ImageList_AddIcon,'ImageList_AddIcon',\ 30 | ImageList_AddMasked,'ImageList_AddMasked',\ 31 | ImageList_BeginDrag,'ImageList_BeginDrag',\ 32 | ImageList_Copy,'ImageList_Copy',\ 33 | ImageList_Create,'ImageList_Create',\ 34 | ImageList_Destroy,'ImageList_Destroy',\ 35 | ImageList_DragEnter,'ImageList_DragEnter',\ 36 | ImageList_DragLeave,'ImageList_DragLeave',\ 37 | ImageList_DragMove,'ImageList_DragMove',\ 38 | ImageList_DragShowNolock,'ImageList_DragShowNolock',\ 39 | ImageList_Draw,'ImageList_Draw',\ 40 | ImageList_DrawEx,'ImageList_DrawEx',\ 41 | ImageList_DrawIndirect,'ImageList_DrawIndirect',\ 42 | ImageList_Duplicate,'ImageList_Duplicate',\ 43 | ImageList_EndDrag,'ImageList_EndDrag',\ 44 | ImageList_GetBkColor,'ImageList_GetBkColor',\ 45 | ImageList_GetDragImage,'ImageList_GetDragImage',\ 46 | ImageList_GetIcon,'ImageList_GetIcon',\ 47 | ImageList_GetIconSize,'ImageList_GetIconSize',\ 48 | ImageList_GetImageCount,'ImageList_GetImageCount',\ 49 | ImageList_GetImageInfo,'ImageList_GetImageInfo',\ 50 | ImageList_GetImageRect,'ImageList_GetImageRect',\ 51 | ImageList_LoadImageA,'ImageList_LoadImageA',\ 52 | ImageList_LoadImageW,'ImageList_LoadImageW',\ 53 | ImageList_Merge,'ImageList_Merge',\ 54 | ImageList_Read,'ImageList_Read',\ 55 | ImageList_Remove,'ImageList_Remove',\ 56 | ImageList_Replace,'ImageList_Replace',\ 57 | ImageList_ReplaceIcon,'ImageList_ReplaceIcon',\ 58 | ImageList_SetBkColor,'ImageList_SetBkColor',\ 59 | ImageList_SetDragCursorImage,'ImageList_SetDragCursorImage',\ 60 | ImageList_SetFilter,'ImageList_SetFilter',\ 61 | ImageList_SetIconSize,'ImageList_SetIconSize',\ 62 | ImageList_SetImageCount,'ImageList_SetImageCount',\ 63 | ImageList_SetOverlayImage,'ImageList_SetOverlayImage',\ 64 | ImageList_Write,'ImageList_Write',\ 65 | InitCommonControls,'InitCommonControls',\ 66 | InitCommonControlsEx,'InitCommonControlsEx',\ 67 | InitializeFlatSB,'InitializeFlatSB',\ 68 | LBItemFromPt,'LBItemFromPt',\ 69 | MakeDragList,'MakeDragList',\ 70 | MenuHelp,'MenuHelp',\ 71 | PropertySheetA,'PropertySheetA',\ 72 | PropertySheetW,'PropertySheetW',\ 73 | ShowHideMenuCtl,'ShowHideMenuCtl',\ 74 | UninitializeFlatSB,'UninitializeFlatSB',\ 75 | _TrackMouseEvent,'_TrackMouseEvent' 76 | 77 | api CreatePropertySheetPage,\ 78 | CreateStatusWindow,\ 79 | DrawStatusText,\ 80 | ImageList_LoadImage,\ 81 | PropertySheet 82 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/API/COMDLG32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; COMDLG32 API calls 3 | 4 | import comdlg32,\ 5 | ChooseColorA,'ChooseColorA',\ 6 | ChooseColorW,'ChooseColorW',\ 7 | ChooseFontA,'ChooseFontA',\ 8 | ChooseFontW,'ChooseFontW',\ 9 | CommDlgExtendedError,'CommDlgExtendedError',\ 10 | FindTextA,'FindTextA',\ 11 | FindTextW,'FindTextW',\ 12 | FormatCharDlgProc,'FormatCharDlgProc',\ 13 | GetFileTitleA,'GetFileTitleA',\ 14 | GetFileTitleW,'GetFileTitleW',\ 15 | GetOpenFileNameA,'GetOpenFileNameA',\ 16 | GetOpenFileNameW,'GetOpenFileNameW',\ 17 | GetSaveFileNameA,'GetSaveFileNameA',\ 18 | GetSaveFileNameW,'GetSaveFileNameW',\ 19 | LoadAlterBitmap,'LoadAlterBitmap',\ 20 | PageSetupDlgA,'PageSetupDlgA',\ 21 | PageSetupDlgW,'PageSetupDlgW',\ 22 | PrintDlgA,'PrintDlgA',\ 23 | PrintDlgW,'PrintDlgW',\ 24 | ReplaceTextA,'ReplaceTextA',\ 25 | ReplaceTextW,'ReplaceTextW',\ 26 | WantArrows,'WantArrows',\ 27 | dwLBSubclass,'dwLBSubclass',\ 28 | dwOKSubclass,'dwOKSubclass' 29 | 30 | api ChooseColor,\ 31 | ChooseFont,\ 32 | FindText,\ 33 | GetFileTitle,\ 34 | GetOpenFileName,\ 35 | GetSaveFileName,\ 36 | PageSetupDlg,\ 37 | PrintDlg,\ 38 | ReplaceText 39 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/API/WSOCK32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; WSOCK32 API calls 3 | 4 | import wsock32,\ 5 | AcceptEx,'AcceptEx',\ 6 | EnumProtocolsA,'EnumProtocolsA',\ 7 | EnumProtocolsW,'EnumProtocolsW',\ 8 | GetAcceptExSockaddrs,'GetAcceptExSockaddrs',\ 9 | GetAddressByNameA,'GetAddressByNameA',\ 10 | GetAddressByNameW,'GetAddressByNameW',\ 11 | GetNameByTypeA,'GetNameByTypeA',\ 12 | GetNameByTypeW,'GetNameByTypeW',\ 13 | GetServiceA,'GetServiceA',\ 14 | GetServiceW,'GetServiceW',\ 15 | GetTypeByNameA,'GetTypeByNameA',\ 16 | GetTypeByNameW,'GetTypeByNameW',\ 17 | MigrateWinsockConfiguration,'MigrateWinsockConfiguration',\ 18 | NPLoadNameSpaces,'NPLoadNameSpaces',\ 19 | SetServiceA,'SetServiceA',\ 20 | SetServiceW,'SetServiceW',\ 21 | TransmitFile,'TransmitFile',\ 22 | WEP,'WEP',\ 23 | WSAAsyncGetHostByAddr,'WSAAsyncGetHostByAddr',\ 24 | WSAAsyncGetHostByName,'WSAAsyncGetHostByName',\ 25 | WSAAsyncGetProtoByName,'WSAAsyncGetProtoByName',\ 26 | WSAAsyncGetProtoByNumber,'WSAAsyncGetProtoByNumber',\ 27 | WSAAsyncGetServByName,'WSAAsyncGetServByName',\ 28 | WSAAsyncGetServByPort,'WSAAsyncGetServByPort',\ 29 | WSAAsyncSelect,'WSAAsyncSelect',\ 30 | WSACancelAsyncRequest,'WSACancelAsyncRequest',\ 31 | WSACancelBlockingCall,'WSACancelBlockingCall',\ 32 | WSACleanup,'WSACleanup',\ 33 | WSAGetLastError,'WSAGetLastError',\ 34 | WSAIsBlocking,'WSAIsBlocking',\ 35 | WSARecvEx,'WSARecvEx',\ 36 | WSASetBlockingHook,'WSASetBlockingHook',\ 37 | WSASetLastError,'WSASetLastError',\ 38 | WSAStartup,'WSAStartup',\ 39 | WSAUnhookBlockingHook,'WSAUnhookBlockingHook',\ 40 | __WSAFDIsSet,'__WSAFDIsSet',\ 41 | accept,'accept',\ 42 | bind,'bind',\ 43 | closesocket,'closesocket',\ 44 | connect,'connect',\ 45 | dn_expand,'dn_expand',\ 46 | gethostbyaddr,'gethostbyaddr',\ 47 | gethostbyname,'gethostbyname',\ 48 | gethostname,'gethostname',\ 49 | getnetbyname,'getnetbyname',\ 50 | getpeername,'getpeername',\ 51 | getprotobyname,'getprotobyname',\ 52 | getprotobynumber,'getprotobynumber',\ 53 | getservbyname,'getservbyname',\ 54 | getservbyport,'getservbyport',\ 55 | getsockname,'getsockname',\ 56 | getsockopt,'getsockopt',\ 57 | htonl,'htonl',\ 58 | htons,'htons',\ 59 | inet_addr,'inet_addr',\ 60 | inet_network,'inet_network',\ 61 | inet_ntoa,'inet_ntoa',\ 62 | ioctlsocket,'ioctlsocket',\ 63 | listen,'listen',\ 64 | ntohl,'ntohl',\ 65 | ntohs,'ntohs',\ 66 | rcmd,'rcmd',\ 67 | recv,'recv',\ 68 | recvfrom,'recvfrom',\ 69 | rexec,'rexec',\ 70 | rresvport,'rresvport',\ 71 | s_perror,'s_perror',\ 72 | select,'select',\ 73 | send,'send',\ 74 | sendto,'sendto',\ 75 | sethostname,'sethostname',\ 76 | setsockopt,'setsockopt',\ 77 | shutdown,'shutdown',\ 78 | socket,'socket' 79 | 80 | api EnumProtocols,\ 81 | GetAddressByName,\ 82 | GetNameByType,\ 83 | GetService,\ 84 | GetTypeByName,\ 85 | SetService 86 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/UTF8.INC: -------------------------------------------------------------------------------- 1 | 2 | ; UTF-8 3 | 4 | macro du [arg] 5 | { local current,..input,char 6 | if arg eqtype '' 7 | virtual at 0 8 | ..input:: 9 | db arg 10 | count = $ 11 | end virtual 12 | current = 0 13 | while current < count 14 | load char byte from ..input:current 15 | wide = char 16 | current = current + 1 17 | if char > 0C0h 18 | if char < 0E0h 19 | wide = char and 11111b 20 | load char byte from ..input:current 21 | wide = wide shl 6 + (char and 111111b) 22 | current = current + 1 23 | else if char < 0F0h 24 | wide = char and 1111b 25 | load char byte from ..input:current 26 | wide = wide shl 6 + (char and 111111b) 27 | load char byte from ..input:current+1 28 | wide = wide shl 6 + (char and 111111b) 29 | current = current + 2 30 | else if char < 0F8h 31 | wide = char and 111b 32 | load char byte from ..input:current 33 | wide = wide shl 6 + (char and 111111b) 34 | load char byte from ..input:current+1 35 | wide = wide shl 6 + (char and 111111b) 36 | load char byte from ..input:current+2 37 | wide = wide shl 6 + (char and 111111b) 38 | current = current + 3 39 | else if char < 0FCh 40 | wide = char and 11b 41 | load char byte from ..input:current 42 | wide = wide shl 6 + (char and 111111b) 43 | load char byte from ..input:current+1 44 | wide = wide shl 6 + (char and 111111b) 45 | load char byte from ..input:current+2 46 | wide = wide shl 6 + (char and 111111b) 47 | load char byte from ..input:current+3 48 | wide = wide shl 6 + (char and 111111b) 49 | current = current + 4 50 | else 51 | wide = char and 1 52 | load char byte from ..input:current 53 | wide = wide shl 6 + (char and 111111b) 54 | load char byte from ..input:current+1 55 | wide = wide shl 6 + (char and 111111b) 56 | load char byte from ..input:current+2 57 | wide = wide shl 6 + (char and 111111b) 58 | load char byte from ..input:current+3 59 | wide = wide shl 6 + (char and 111111b) 60 | load char byte from ..input:current+4 61 | wide = wide shl 6 + (char and 111111b) 62 | current = current + 5 63 | end if 64 | end if 65 | if wide < 10000h 66 | dw wide 67 | else 68 | dw 0D7C0h + wide shr 10,0DC00h or (wide and 3FFh) 69 | end if 70 | end while 71 | else 72 | dw arg 73 | end if } 74 | 75 | struc du [args] 76 | { common label . word 77 | du args } 78 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN1250.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 1250 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 20ACh,?,201Ah,?,201Eh,2026h,2020h,2021h,?,2030h,160h,2039h,15Ah,164h,17Dh,179h 11 | dw ?,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,?,2122h,161h,203Ah,15Bh,165h,17Eh,17Ah 12 | dw 0A0h,2C7h,2D8h,141h,0A4h,104h,0A6h,0A7h,0A8h,0A9h,15Eh,0ABh,0ACh,0ADh,0AEh,17Bh 13 | dw 0B0h,0B1h,2DBh,142h,0B4h,0B5h,0B6h,0B7h,0B8h,105h,15Fh,0BBh,13Dh,2DDh,13Eh,17Ch 14 | dw 154h,0C1h,0C2h,102h,0C4h,139h,106h,0C7h,10Ch,0C9h,118h,0CBh,11Ah,0CDh,0CEh,10Eh 15 | dw 110h,143h,147h,0D3h,0D4h,150h,0D6h,0D7h,158h,16Eh,0DAh,170h,0DCh,0DDh,162h,0DFh 16 | dw 155h,0E1h,0E2h,103h,0E4h,13Ah,107h,0E7h,10Dh,0E9h,119h,0EBh,11Bh,0EDh,0EEh,10Fh 17 | dw 111h,144h,148h,0F3h,0F4h,151h,0F6h,0F7h,159h,16Fh,0FAh,171h,0FCh,0FDh,163h,2D9h 18 | end virtual 19 | 20 | macro du [arg] 21 | { local offset,char 22 | offset = $-$$ 23 | du arg 24 | if arg eqtype '' 25 | repeat ($-offset-$$)/2 26 | load char byte from $$+offset+(%-1)*2 27 | if char > 7Fh 28 | load char word from __encoding:char*2 29 | store word char at $$+offset+(%-1)*2 30 | end if 31 | end repeat 32 | end if } 33 | 34 | struc du [args] 35 | { common label . word 36 | du args } 37 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN1251.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 1251 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 401h,403h,201Ah,453h,201Eh,2026h,2020h,2021h,20ACh,2030h,409h,2039h,40Ah,40Ch,40Bh,40Fh 11 | dw 452h,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,?,2122h,459h,203Ah,45Ah,45Ch,45Bh,45Fh 12 | dw 0A0h,40Eh,45Eh,408h,0A4h,490h,0A6h,0A7h,401h,0A9h,404h,0ABh,0ACh,0ADh,0AEh,407h 13 | dw 0B0h,0B1h,406h,456h,491h,0B5h,0B6h,0B7h,451h,2116h,454h,0BBh,458h,405h,455h,457h 14 | times 40h dw 410h+%-1 15 | end virtual 16 | 17 | macro du [arg] 18 | { local offset,char 19 | offset = $-$$ 20 | du arg 21 | if arg eqtype '' 22 | repeat ($-offset-$$)/2 23 | load char byte from $$+offset+(%-1)*2 24 | if char > 7Fh 25 | load char word from __encoding:char*2 26 | store word char at $$+offset+(%-1)*2 27 | end if 28 | end repeat 29 | end if } 30 | 31 | struc du [args] 32 | { common label . word 33 | du args } 34 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN1252.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 1252 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 20ACh,?,201Ah,192h,201Eh,2026h,2020h,2021h,2C6h,2030h,160h,2039h,152h,?,17D,? 11 | dw ?,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,2DCh,2122h,161h,203Ah,153h,?,17Eh,178h 12 | times 60h dw 0A0h+%-1 13 | end virtual 14 | 15 | macro du [arg] 16 | { local offset,char 17 | offset = $-$$ 18 | du arg 19 | if arg eqtype '' 20 | repeat ($-offset-$$)/2 21 | load char byte from $$+offset+(%-1)*2 22 | if char > 7Fh 23 | load char word from __encoding:char*2 24 | store word char at $$+offset+(%-1)*2 25 | end if 26 | end repeat 27 | end if } 28 | 29 | struc du [args] 30 | { common label . word 31 | du args } 32 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN1253.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 1253 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 20ACh,?,201Ah,192h,201Eh,2026h,2020h,2021h,?,2030h,?,2039h,?,?,?,? 11 | dw ?,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,?,2122h,?,203Ah,?,?,?,? 12 | dw 0A0h,385h,386h,0A3h,0A4h,0A5h,0A6h,0A7h,0A8h,0A9h,?,0ABh,0ACh,0ADh,0AEh,2015h 13 | dw 0B0h,0B1h,0B2h,0B3h,384h,0B5h,0B6h,0B7h,288h,389h,38Ah,0BBh,38Ch,0BDh,38Eh,38Fh 14 | times 40h dw 390h+%-1 15 | end virtual 16 | 17 | macro du [arg] 18 | { local offset,char 19 | offset = $-$$ 20 | du arg 21 | if arg eqtype '' 22 | repeat ($-offset-$$)/2 23 | load char byte from $$+offset+(%-1)*2 24 | if char > 7Fh 25 | load char word from __encoding:char*2 26 | store word char at $$+offset+(%-1)*2 27 | end if 28 | end repeat 29 | end if } 30 | 31 | struc du [args] 32 | { common label . word 33 | du args } 34 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN1254.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 1254 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 20ACh,?,201Ah,192h,201Eh,2026h,2020h,2021h,2C6h,2030h,160h,2039h,152h,?,?,? 11 | dw ?,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,2DCh,2122h,161h,203Ah,153h,?,?,178h 12 | times 30h dw 0A0h+%-1 13 | dw 11Eh,0D1h,0D2h,0D3h,0D4h,0D5h,0D6h,0D7h,0D8h,0D9h,0DAh,0DBh,0DCh,130h,15Eh,0DFh 14 | times 10h dw 0E0h+%-1 15 | dw 11Fh,0F1h,0F2h,0F3h,0F4h,0F5h,0F6h,0F7h,0F8h,0F9h,0FAh,0FBh,0FCh,131h,15Fh,0FFh 16 | end virtual 17 | 18 | macro du [arg] 19 | { local offset,char 20 | offset = $-$$ 21 | du arg 22 | if arg eqtype '' 23 | repeat ($-offset-$$)/2 24 | load char byte from $$+offset+(%-1)*2 25 | if char > 7Fh 26 | load char word from __encoding:char*2 27 | store word char at $$+offset+(%-1)*2 28 | end if 29 | end repeat 30 | end if } 31 | 32 | struc du [args] 33 | { common label . word 34 | du args } 35 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN1255.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 1255 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 20ACh,?,201Ah,192h,201Eh,2026h,2020h,2021h,2C6h,2030h,?,2039h,?,?,?,? 11 | dw ?,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,2DCh,2122h,?,203Ah,?,?,?,? 12 | dw 0A0h,0A1h,0A2h,0A3h,20AAh,0A5h,0A6h,0A7h,0A8h,0A9h,0D7h,0ABh,0ACh,0ADh,0AEh,0AFh 13 | dw 0B0h,0B1h,0B2h,0B3h,0B4h,0B5h,0B6h,0B7h,0B8h,0B9h,0F7h,0BBh,0BCh,0BDh,0BEh,0BFh 14 | dw 5B0h,5B1h,5B2h,5B3h,5B4h,5B5h,5B6h,5B7h,5B8h,5B9h,?,5BBh,5BCh,5BDh,5BEh,5BFh 15 | dw 5C0h,5C1h,5C2h,5C3h,5F0h,5F1h,5F2h,5F3h,5F4h,?,?,?,?,?,?,? 16 | dw 5D0h,5D1h,5D2h,5D3h,5D4h,5D5h,5D6h,5D7h,5D8h,5D9h,5DAh,5DBh,5DCh,5DDh,5DEh,5DFh 17 | dw 5E0h,5E1h,5E2h,5E3h,5E4h,5E5h,5E6h,5E7h,5E8h,5E9h,5EAh,?,?,200Eh,200Fh,? 18 | end virtual 19 | 20 | macro du [arg] 21 | { local offset,char 22 | offset = $-$$ 23 | du arg 24 | if arg eqtype '' 25 | repeat ($-offset-$$)/2 26 | load char byte from $$+offset+(%-1)*2 27 | if char > 7Fh 28 | load char word from __encoding:char*2 29 | store word char at $$+offset+(%-1)*2 30 | end if 31 | end repeat 32 | end if } 33 | 34 | struc du [args] 35 | { common label . word 36 | du args } 37 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN1256.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 1256 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 20ACh,67Eh,201Ah,192h,201Eh,2026h,2020h,2021h,2C6h,2030h,679h,2039h,152h,686h,698h,688h 11 | dw 6AFh,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,6A9h,2122h,691h,203Ah,153h,200Ch,200Dh,6BAh 12 | dw 0A0h,60Ch,0A2h,0A3h,0A4h,0A5h,0A6h,0A7h,0A8h,0A9h,6BEh,0ABh,0ACh,0ADh,0AEh,0AFh 13 | dw 0B0h,0B1h,0B2h,0B3h,0B4h,0B5h,0B6h,0B7h,0B8h,0B9h,0BAh,0BBh,0BCh,0BDh,0BEh,0BFh 14 | dw 6C1h,621h,622h,623h,624h,625h,626h,627h,628h,629h,62Ah,62Bh,62Ch,62Dh,62Eh,62Fh 15 | dw 630h,631h,632h,633h,634h,635h,636h,0D7h,637h,638h,639h,63Ah,640h,641h,642h,643h 16 | dw 0E0h,644h,0E2h,645h,646h,647h,648h,0E7h,0E8h,0E9h,0EAh,0EBh,649h,64Ah,0EEh,0EFh 17 | dw 64Bh,64Ch,64Dh,64Eh,0F4h,64Fh,650h,0F7h,651h,0F9h,652h,0FBh,0FCh,200Eh,200Fh,6D2h 18 | end virtual 19 | 20 | macro du [arg] 21 | { local offset,char 22 | offset = $-$$ 23 | du arg 24 | if arg eqtype '' 25 | repeat ($-offset-$$)/2 26 | load char byte from $$+offset+(%-1)*2 27 | if char > 7Fh 28 | load char word from __encoding:char*2 29 | store word char at $$+offset+(%-1)*2 30 | end if 31 | end repeat 32 | end if } 33 | 34 | struc du [args] 35 | { common label . word 36 | du args } 37 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN1257.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 1257 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 20ACh,?,201Ah,?,201Eh,2026h,2020h,2021h,?,2030h,?,2039h,?,0A8h,2C7h,0B8h 11 | dw ?,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,?,2122h,?,203Ah,?,0AFh,2DBh,? 12 | dw 0A0h,?,0A2h,0A3h,0A4h,?,0A6h,0A7h,0D8h,0A9h,156h,0ABh,0ACh,0ADh,0AEh,0C6h 13 | dw 0B0h,0B1h,0B2h,0B3h,0B4h,0B5h,0B6h,0B7h,0F8h,0B9h,157h,0BBh,0BCh,0BDh,0BEh,0E6h 14 | dw 104h,12Eh,100h,106h,0C4h,0C5h,118h,112h,10Ch,0C9h,179h,116h,122h,136h,12Ah,13Bh 15 | dw 160h,143h,145h,0D3h,14Ch,0D5h,0D6h,0D7h,172h,141h,15Ah,16Ah,0DCh,17Bh,17Dh,0DFh 16 | dw 105h,12Fh,101h,107h,0E4h,0E5h,119h,113h,10Dh,0E9h,17Ah,117h,123h,137h,12Bh,13Ch 17 | dw 161h,144h,146h,0F3h,14Dh,0F5h,0F6h,0F7h,173h,142h,15Bh,16Bh,0FCh,17Ch,17Eh,2D9h 18 | end virtual 19 | 20 | macro du [arg] 21 | { local offset,char 22 | offset = $-$$ 23 | du arg 24 | if arg eqtype '' 25 | repeat ($-offset-$$)/2 26 | load char byte from $$+offset+(%-1)*2 27 | if char > 7Fh 28 | load char word from __encoding:char*2 29 | store word char at $$+offset+(%-1)*2 30 | end if 31 | end repeat 32 | end if } 33 | 34 | struc du [args] 35 | { common label . word 36 | du args } 37 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN1258.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 1258 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 20ACh,?,201Ah,192h,201Eh,2026h,2020h,2021h,2C6h,2030h,?,2039h,152h,?,?,? 11 | dw ?,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,2DCh,2122h,?,203Ah,153h,?,?,178h 12 | dw 0A0h,0A1h,0A2h,0A3h,0A4h,0A5h,0A6h,0A7h,0A8h,0A9h,0AAh,0ABh,0ACh,0ADh,0AEh,0AFh 13 | dw 0B0h,0B1h,0B2h,0B3h,0B4h,0B5h,0B6h,0B7h,0B8h,0B9h,0BAh,0BBh,0BCh,0BDh,0BEh,0BFh 14 | dw 0C0h,0C1h,0C2h,102h,0C4h,0C5h,0C6h,0C7h,0C8h,0C9h,0CAh,0CBh,300h,0CDh,0CEh,0CFh 15 | dw 110h,0D1h,309h,0D3h,0D4h,1A0h,0D6h,0D7h,0D8h,0D9h,0DAh,0DBh,0DCh,1AFh,303h,0DFh 16 | dw 0E0h,0E1h,0E2h,103h,0E4h,0E5h,0E6h,0E7h,0E8h,0E9h,0EAh,0EBh,301h,0EDh,0EEh,0EFh 17 | dw 111h,0F1h,323h,0F3h,0F4h,1A1h,0F6h,0F7h,0F8h,0F9h,0FAh,0FBh,0FCh,1B0h,20ABh,0FFh 18 | end virtual 19 | 20 | macro du [arg] 21 | { local offset,char 22 | offset = $-$$ 23 | du arg 24 | if arg eqtype '' 25 | repeat ($-offset-$$)/2 26 | load char byte from $$+offset+(%-1)*2 27 | if char > 7Fh 28 | load char word from __encoding:char*2 29 | store word char at $$+offset+(%-1)*2 30 | end if 31 | end repeat 32 | end if } 33 | 34 | struc du [args] 35 | { common label . word 36 | du args } 37 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/ENCODING/WIN874.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Windows 874 3 | 4 | rept 1 { local ..encoding 5 | __encoding equ ..encoding } 6 | 7 | virtual at 0 8 | __encoding:: 9 | times 80h dw %-1 10 | dw 20ACh,?,?,?,?,2026h,?,?,?,?,?,?,?,?,?,? 11 | dw ?,2018h,2019h,201Ch,201Dh,2022h,2013h,2014h,?,?,?,?,?,?,?,? 12 | times 60h dw 0E00h+%-1 13 | end virtual 14 | 15 | macro du [arg] 16 | { local offset,char 17 | offset = $-$$ 18 | du arg 19 | if arg eqtype '' 20 | repeat ($-offset-$$)/2 21 | load char byte from $$+offset+(%-1)*2 22 | if char > 7Fh 23 | load char word from __encoding:char*2 24 | store word char at $$+offset+(%-1)*2 25 | end if 26 | end repeat 27 | end if } 28 | 29 | struc du [args] 30 | { common label . word 31 | du args } 32 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/EQUATES/SHELL32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; SHELL32.DLL structures and constants 3 | 4 | struct NOTIFYICONDATA 5 | cbSize dd ? 6 | hWnd dd ? 7 | uID dd ? 8 | uFlags dd ? 9 | uCallbackMessage dd ? 10 | hIcon dd ? 11 | szTip TCHAR 64 dup (?) 12 | ends 13 | 14 | struct NOTIFYICONDATAA 15 | cbSize dd ? 16 | hWnd dd ? 17 | uID dd ? 18 | uFlags dd ? 19 | uCallbackMessage dd ? 20 | hIcon dd ? 21 | szTip db 64 dup (?) 22 | ends 23 | 24 | struct NOTIFYICONDATAW 25 | cbSize dd ? 26 | hWnd dd ? 27 | uID dd ? 28 | uFlags dd ? 29 | uCallbackMessage dd ? 30 | hIcon dd ? 31 | szTip du 64 dup (?) 32 | ends 33 | 34 | struct BROWSEINFO 35 | hwndOwner dd ? 36 | pidlRoot dd ? 37 | pszDisplayName dd ? 38 | lpszTitle dd ? 39 | ulFlags dd ? 40 | lpfn dd ? 41 | lParam dd ? 42 | iImage dd ? 43 | ends 44 | 45 | ; Taskbar icon messages 46 | 47 | NIM_ADD = 0 48 | NIM_MODIFY = 1 49 | NIM_DELETE = 2 50 | NIM_SETFOCUS = 3 51 | NIM_SETVERSION = 4 52 | 53 | ; Taskbar icon flags 54 | 55 | NIF_MESSAGE = 01h 56 | NIF_ICON = 02h 57 | NIF_TIP = 04h 58 | NIF_STATE = 08h 59 | NIF_INFO = 10h 60 | NIF_GUID = 20h 61 | 62 | ; Constant Special Item ID List 63 | 64 | CSIDL_DESKTOP = 0x0000 65 | CSIDL_INTERNET = 0x0001 66 | CSIDL_PROGRAMS = 0x0002 67 | CSIDL_CONTROLS = 0x0003 68 | CSIDL_PRINTERS = 0x0004 69 | CSIDL_PERSONAL = 0x0005 70 | CSIDL_FAVORITES = 0x0006 71 | CSIDL_STARTUP = 0x0007 72 | CSIDL_RECENT = 0x0008 73 | CSIDL_SENDTO = 0x0009 74 | CSIDL_BITBUCKET = 0x000A 75 | CSIDL_STARTMENU = 0x000B 76 | CSIDL_MYDOCUMENTS = 0x000C 77 | CSIDL_MYMUSIC = 0x000D 78 | CSIDL_MYVIDEO = 0x000E 79 | CSIDL_DESKTOPDIRECTORY = 0x0010 80 | CSIDL_DRIVES = 0x0011 81 | CSIDL_NETWORK = 0x0012 82 | CSIDL_NETHOOD = 0x0013 83 | CSIDL_FONTS = 0x0014 84 | CSIDL_TEMPLATES = 0x0015 85 | CSIDL_COMMON_STARTMENU = 0x0016 86 | CSIDL_COMMON_PROGRAMS = 0x0017 87 | CSIDL_COMMON_STARTUP = 0x0018 88 | CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019 89 | CSIDL_APPDATA = 0x001A 90 | CSIDL_PRINTHOOD = 0x001B 91 | CSIDL_LOCAL_APPDATA = 0x001C 92 | CSIDL_ALTSTARTUP = 0x001D 93 | CSIDL_COMMON_ALTSTARTUP = 0x001E 94 | CSIDL_COMMON_FAVORITES = 0x001F 95 | CSIDL_INTERNET_CACHE = 0x0020 96 | CSIDL_COOKIES = 0x0021 97 | CSIDL_HISTORY = 0x0022 98 | CSIDL_COMMON_APPDATA = 0x0023 99 | CSIDL_WINDOWS = 0x0024 100 | CSIDL_SYSTEM = 0x0025 101 | CSIDL_PROGRAM_FILES = 0x0026 102 | CSIDL_MYPICTURES = 0x0027 103 | CSIDL_PROFILE = 0x0028 104 | CSIDL_SYSTEMX86 = 0x0029 105 | CSIDL_PROGRAM_FILESX86 = 0x002A 106 | CSIDL_PROGRAM_FILES_COMMON = 0x002B 107 | CSIDL_PROGRAM_FILES_COMMONX86 = 0x002C 108 | CSIDL_COMMON_TEMPLATES = 0x002D 109 | CSIDL_COMMON_DOCUMENTS = 0x002E 110 | CSIDL_COMMON_ADMINTOOLS = 0x002F 111 | CSIDL_ADMINTOOLS = 0x0030 112 | CSIDL_CONNECTIONS = 0x0031 113 | CSIDL_COMMON_MUSIC = 0x0035 114 | CSIDL_COMMON_PICTURES = 0x0036 115 | CSIDL_COMMON_VIDEO = 0x0037 116 | CSIDL_RESOURCES = 0x0038 117 | CSIDL_RESOURCES_LOCALIZED = 0x0039 118 | CSIDL_COMMON_OEM_LINKS = 0x003A 119 | CSIDL_CDBURN_AREA = 0x003B 120 | CSIDL_COMPUTERSNEARME = 0x003D 121 | CSIDL_PROFILES = 0x003E 122 | CSIDL_FOLDER_MASK = 0x00FF 123 | CSIDL_FLAG_PER_USER_INIT = 0x0800 124 | CSIDL_FLAG_NO_ALIAS = 0x1000 125 | CSIDL_FLAG_DONT_VERIFY = 0x4000 126 | CSIDL_FLAG_CREATE = 0x8000 127 | CSIDL_FLAG_MASK = 0xFF00 128 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/EQUATES/SHELL64.INC: -------------------------------------------------------------------------------- 1 | 2 | ; SHELL32.DLL structures and constants 3 | 4 | struct NOTIFYICONDATA 5 | cbSize dd ?,? 6 | hWnd dq ? 7 | uID dd ? 8 | uFlags dd ? 9 | uCallbackMessage dd ?,? 10 | hIcon dq ? 11 | szTip TCHAR 64 dup (?) 12 | ends 13 | 14 | struct NOTIFYICONDATAA 15 | cbSize dd ?,? 16 | hWnd dq ? 17 | uID dd ? 18 | uFlags dd ? 19 | uCallbackMessage dd ?,? 20 | hIcon dq ? 21 | szTip db 64 dup (?) 22 | ends 23 | 24 | struct NOTIFYICONDATAW 25 | cbSize dd ?,? 26 | hWnd dq ? 27 | uID dd ? 28 | uFlags dd ? 29 | uCallbackMessage dd ?,? 30 | hIcon dq ? 31 | szTip du 64 dup (?) 32 | ends 33 | 34 | struct BROWSEINFO 35 | hwndOwner dq ? 36 | pidlRoot dq ? 37 | pszDisplayName dq ? 38 | lpszTitle dq ? 39 | ulFlags dd ?,? 40 | lpfn dq ? 41 | lParam dq ? 42 | iImage dq ? 43 | ends 44 | 45 | ; Taskbar icon messages 46 | 47 | NIM_ADD = 0 48 | NIM_MODIFY = 1 49 | NIM_DELETE = 2 50 | NIM_SETFOCUS = 3 51 | NIM_SETVERSION = 4 52 | 53 | ; Taskbar icon flags 54 | 55 | NIF_MESSAGE = 01h 56 | NIF_ICON = 02h 57 | NIF_TIP = 04h 58 | NIF_STATE = 08h 59 | NIF_INFO = 10h 60 | NIF_GUID = 20h 61 | 62 | ; Constant Special Item ID List 63 | 64 | CSIDL_DESKTOP = 0x0000 65 | CSIDL_INTERNET = 0x0001 66 | CSIDL_PROGRAMS = 0x0002 67 | CSIDL_CONTROLS = 0x0003 68 | CSIDL_PRINTERS = 0x0004 69 | CSIDL_PERSONAL = 0x0005 70 | CSIDL_FAVORITES = 0x0006 71 | CSIDL_STARTUP = 0x0007 72 | CSIDL_RECENT = 0x0008 73 | CSIDL_SENDTO = 0x0009 74 | CSIDL_BITBUCKET = 0x000A 75 | CSIDL_STARTMENU = 0x000B 76 | CSIDL_MYDOCUMENTS = 0x000C 77 | CSIDL_MYMUSIC = 0x000D 78 | CSIDL_MYVIDEO = 0x000E 79 | CSIDL_DESKTOPDIRECTORY = 0x0010 80 | CSIDL_DRIVES = 0x0011 81 | CSIDL_NETWORK = 0x0012 82 | CSIDL_NETHOOD = 0x0013 83 | CSIDL_FONTS = 0x0014 84 | CSIDL_TEMPLATES = 0x0015 85 | CSIDL_COMMON_STARTMENU = 0x0016 86 | CSIDL_COMMON_PROGRAMS = 0x0017 87 | CSIDL_COMMON_STARTUP = 0x0018 88 | CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019 89 | CSIDL_APPDATA = 0x001A 90 | CSIDL_PRINTHOOD = 0x001B 91 | CSIDL_LOCAL_APPDATA = 0x001C 92 | CSIDL_ALTSTARTUP = 0x001D 93 | CSIDL_COMMON_ALTSTARTUP = 0x001E 94 | CSIDL_COMMON_FAVORITES = 0x001F 95 | CSIDL_INTERNET_CACHE = 0x0020 96 | CSIDL_COOKIES = 0x0021 97 | CSIDL_HISTORY = 0x0022 98 | CSIDL_COMMON_APPDATA = 0x0023 99 | CSIDL_WINDOWS = 0x0024 100 | CSIDL_SYSTEM = 0x0025 101 | CSIDL_PROGRAM_FILES = 0x0026 102 | CSIDL_MYPICTURES = 0x0027 103 | CSIDL_PROFILE = 0x0028 104 | CSIDL_SYSTEMX86 = 0x0029 105 | CSIDL_PROGRAM_FILESX86 = 0x002A 106 | CSIDL_PROGRAM_FILES_COMMON = 0x002B 107 | CSIDL_PROGRAM_FILES_COMMONX86 = 0x002C 108 | CSIDL_COMMON_TEMPLATES = 0x002D 109 | CSIDL_COMMON_DOCUMENTS = 0x002E 110 | CSIDL_COMMON_ADMINTOOLS = 0x002F 111 | CSIDL_ADMINTOOLS = 0x0030 112 | CSIDL_CONNECTIONS = 0x0031 113 | CSIDL_COMMON_MUSIC = 0x0035 114 | CSIDL_COMMON_PICTURES = 0x0036 115 | CSIDL_COMMON_VIDEO = 0x0037 116 | CSIDL_RESOURCES = 0x0038 117 | CSIDL_RESOURCES_LOCALIZED = 0x0039 118 | CSIDL_COMMON_OEM_LINKS = 0x003A 119 | CSIDL_CDBURN_AREA = 0x003B 120 | CSIDL_COMPUTERSNEARME = 0x003D 121 | CSIDL_PROFILES = 0x003E 122 | CSIDL_FOLDER_MASK = 0x00FF 123 | CSIDL_FLAG_PER_USER_INIT = 0x0800 124 | CSIDL_FLAG_NO_ALIAS = 0x1000 125 | CSIDL_FLAG_DONT_VERIFY = 0x4000 126 | CSIDL_FLAG_CREATE = 0x8000 127 | CSIDL_FLAG_MASK = 0xFF00 128 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/EQUATES/WSOCK32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; WSOCK32.DLL structures and constants 3 | 4 | struct WSADATA 5 | wVersion dw ? 6 | wHighVersion dw ? 7 | szDescription db 256+1 dup (?) 8 | szSystemStatus db 128+1 dup (?) 9 | iMaxSockets dw ? 10 | iMaxUdpDg dw ? 11 | _padding_ db 2 dup (?) 12 | lpVendorInfo dd ? 13 | ends 14 | 15 | struct hostent 16 | h_name dd ? 17 | h_aliases dd ? 18 | h_addrtype dw ? 19 | h_length dw ? 20 | h_addr_list dd ? 21 | ends 22 | 23 | struct sockaddr_in 24 | sin_family dw ? 25 | sin_port dw ? 26 | sin_addr dd ? 27 | sin_zero db 8 dup (?) 28 | ends 29 | 30 | struct sockaddr 31 | sa_family dw ? 32 | sa_data db 14 dup (?) 33 | ends 34 | 35 | ; Socket types 36 | 37 | SOCK_STREAM = 1 38 | SOCK_DGRAM = 2 39 | SOCK_RAW = 3 40 | SOCK_RDM = 4 41 | SOCK_SEQPACKET = 5 42 | 43 | ; Address formats 44 | 45 | AF_UNSPEC = 0 46 | AF_UNIX = 1 47 | AF_INET = 2 48 | AF_IMPLINK = 3 49 | AF_PUP = 4 50 | AF_CHAOS = 5 51 | AF_NS = 6 52 | AF_IPX = 6 53 | AF_ISO = 7 54 | AF_OSI = AF_ISO 55 | AF_ECMA = 8 56 | AF_DATAKIT = 9 57 | AF_CCITT = 10 58 | AF_SNA = 11 59 | AF_DECnet = 12 60 | AF_DLI = 13 61 | AF_LAT = 14 62 | AF_HYLINK = 15 63 | AF_APPLETALK = 16 64 | AF_NETBIOS = 17 65 | 66 | ; Protocol formats 67 | 68 | PF_UNSPEC = 0 69 | PF_UNIX = 1 70 | PF_INET = 2 71 | PF_IMPLINK = 3 72 | PF_PUP = 4 73 | PF_CHAOS = 5 74 | PF_NS = 6 75 | PF_IPX = 6 76 | PF_ISO = 7 77 | PF_OSI = PF_ISO 78 | PF_ECMA = 8 79 | PF_DATAKIT = 9 80 | PF_CCITT = 10 81 | PF_SNA = 11 82 | PF_DECnet = 12 83 | PF_DLI = 13 84 | PF_LAT = 14 85 | PF_HYLINK = 15 86 | PF_APPLETALK = 16 87 | PF_NETBIOS = 17 88 | 89 | ; IP Ports 90 | 91 | IPPORT_ECHO = 7 92 | IPPORT_DISCARD = 9 93 | IPPORT_SYSTAT = 11 94 | IPPORT_DAYTIME = 13 95 | IPPORT_NETSTAT = 15 96 | IPPORT_FTP = 21 97 | IPPORT_TELNET = 23 98 | IPPORT_SMTP = 25 99 | IPPORT_TIMESERVER = 37 100 | IPPORT_NAMESERVER = 42 101 | IPPORT_WHOIS = 43 102 | IPPORT_MTP = 57 103 | IPPORT_TFTP = 69 104 | IPPORT_RJE = 77 105 | IPPORT_FINGER = 79 106 | IPPORT_TTYLINK = 87 107 | IPPORT_SUPDUP = 95 108 | IPPORT_EXECSERVER = 512 109 | IPPORT_LOGINSERVER = 513 110 | IPPORT_CMDSERVER = 514 111 | IPPORT_EFSSERVER = 520 112 | IPPORT_BIFFUDP = 512 113 | IPPORT_WHOSERVER = 513 114 | IPPORT_ROUTESERVER = 520 115 | IPPORT_RESERVED = 1024 116 | 117 | ; Notifications 118 | 119 | FD_READ = 01h 120 | FD_WRITE = 02h 121 | FD_OOB = 04h 122 | FD_ACCEPT = 08h 123 | FD_CONNECT = 10h 124 | FD_CLOSE = 20h 125 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/MACRO/COM32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Macroinstructions for interfacing the COM (Component Object Model) classes 3 | 4 | macro cominvk object,proc,[arg] 5 | { common 6 | if ~ arg eq 7 | reverse 8 | pushd arg 9 | common 10 | end if 11 | assert defined object#.com.object ; must be a COM object 12 | mov eax,[object] 13 | push eax 14 | mov eax,[eax] 15 | call [eax+object#.#proc] } 16 | 17 | macro comcall handle,interface,proc,[arg] 18 | { common 19 | if ~ arg eq 20 | reverse 21 | pushd arg 22 | common 23 | end if 24 | assert defined interface#.com.interface ; must be a COM interface 25 | if handle eqtype eax | handle eqtype 0 26 | push handle 27 | local ..handle 28 | label ..handle at handle 29 | mov eax,[..handle] 30 | else 31 | mov eax,handle 32 | push eax 33 | mov eax,[eax] 34 | end if 35 | call [eax+interface#.#proc] } 36 | 37 | macro interface name,[proc] 38 | { common 39 | struc name \{ 40 | match , @struct \\{ define field@struct .,name, \\} 41 | match no, @struct \\{ . dd ? 42 | virtual at 0 43 | forward 44 | .#proc dd ? 45 | common 46 | .\#\\.com.object = name#.com.interface 47 | end virtual \\} \} 48 | virtual at 0 49 | forward 50 | name#.#proc dd ? 51 | common 52 | name#.com.interface = $ shr 2 53 | end virtual } 54 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/MACRO/COM64.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Macroinstructions for interfacing the COM (Component Object Model) classes 3 | 4 | macro cominvk object,proc,[arg] 5 | { common 6 | assert defined object#.com.object ; must be a COM object 7 | macro call dummy 8 | \{ mov rax,[object] 9 | mov rax,[rax] 10 | call [rax+object#.#proc] \} 11 | fastcall ,[object],arg 12 | purge call } 13 | 14 | macro comcall handle,interface,proc,[arg] 15 | { common 16 | assert defined interface#.com.interface ; must be a COM interface 17 | macro call dummy 18 | \{ if handle eqtype rax | handle eqtype 0 19 | local ..handle 20 | label ..handle at handle 21 | mov rax,[..handle] 22 | else 23 | mov rax,handle 24 | mov rax,[rax] 25 | end if 26 | call [rax+interface#.#proc] \} 27 | fastcall ,handle,arg 28 | purge call } 29 | 30 | macro interface name,[proc] 31 | { common 32 | struc name \{ 33 | match , @struct \\{ define field@struct .,name, \\} 34 | match no, @struct \\{ . dq ? 35 | virtual at 0 36 | forward 37 | .#proc dq ? 38 | common 39 | .\#\\.com.object = name#.com.interface 40 | end virtual \\} \} 41 | virtual at 0 42 | forward 43 | name#.#proc dq ? 44 | common 45 | name#.com.interface = $ shr 3 46 | end virtual } 47 | 48 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/MACRO/EXPORT.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Macroinstruction for making export section 3 | 4 | macro export dllname,[label,string] 5 | { common 6 | local module,addresses,names,ordinal,count 7 | count = 0 8 | forward 9 | count = count+1 10 | common 11 | dd 0,0,0,RVA module,1 12 | dd count,count,RVA addresses,RVA names,RVA ordinal 13 | addresses: 14 | forward 15 | dd RVA label 16 | common 17 | names: 18 | forward 19 | local name 20 | dd RVA name 21 | common 22 | ordinal: count = 0 23 | forward 24 | dw count 25 | count = count+1 26 | common 27 | module db dllname,0 28 | forward 29 | name db string,0 30 | common 31 | local x,y,z,str1,str2,v1,v2 32 | x = count shr 1 33 | while x > 0 34 | y = x 35 | while y < count 36 | z = y 37 | while z-x >= 0 38 | load v1 dword from names+z*4 39 | str1=($-RVA $)+v1 40 | load v2 dword from names+(z-x)*4 41 | str2=($-RVA $)+v2 42 | while v1 > 0 43 | load v1 from str1+%-1 44 | load v2 from str2+%-1 45 | if v1 <> v2 46 | break 47 | end if 48 | end while 49 | if v1 name#.lookup 41 | name#.redundant = 0 42 | dd 0 43 | else 44 | name#.redundant = 1 45 | end if 46 | name#.address: 47 | forward 48 | if used label 49 | if string eqtype '' 50 | label dd RVA _label 51 | else 52 | label dd 80000000h + string 53 | end if 54 | end if 55 | common 56 | if ~ name#.redundant 57 | dd 0 58 | end if 59 | forward 60 | if used label & string eqtype '' 61 | _label dw 0 62 | db string,0 63 | rb RVA $ and 1 64 | end if 65 | common 66 | end if } 67 | 68 | macro api [name] {} 69 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/MACRO/IMPORT64.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Macroinstructions for making import section (64-bit) 3 | 4 | macro library [name,string] 5 | { common 6 | import.data: 7 | forward 8 | local _label 9 | if defined name#.redundant 10 | if ~ name#.redundant 11 | dd RVA name#.lookup,0,0,RVA _label,RVA name#.address 12 | end if 13 | end if 14 | name#.referred = 1 15 | common 16 | dd 0,0,0,0,0 17 | forward 18 | if defined name#.redundant 19 | if ~ name#.redundant 20 | _label db string,0 21 | rb RVA $ and 1 22 | end if 23 | end if } 24 | 25 | macro import name,[label,string] 26 | { common 27 | rb (- rva $) and 7 28 | if defined name#.referred 29 | name#.lookup: 30 | forward 31 | if used label 32 | if string eqtype '' 33 | local _label 34 | dq RVA _label 35 | else 36 | dq 8000000000000000h + string 37 | end if 38 | end if 39 | common 40 | if $ > name#.lookup 41 | name#.redundant = 0 42 | dq 0 43 | else 44 | name#.redundant = 1 45 | end if 46 | name#.address: 47 | forward 48 | if used label 49 | if string eqtype '' 50 | label dq RVA _label 51 | else 52 | label dq 8000000000000000h + string 53 | end if 54 | end if 55 | common 56 | if ~ name#.redundant 57 | dq 0 58 | end if 59 | forward 60 | if used label & string eqtype '' 61 | _label dw 0 62 | db string,0 63 | rb RVA $ and 1 64 | end if 65 | common 66 | end if } 67 | 68 | macro api [name] {} 69 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/MACRO/MASM.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Simulate MASM's syntax 3 | 4 | struc struct 5 | { struct . 6 | name@struct equ . } 7 | 8 | struc ends 9 | { match =.,name@struct \{ ends \} } 10 | 11 | struc proc [params] 12 | { common define@proc ., 13 | name@proc equ . } 14 | 15 | struc endp 16 | { match =.,name@proc \{ endp \} } 17 | 18 | macro option setting 19 | { match =prologue:macro, setting \{ prologue@proc equ macro \} 20 | match =epilogue:macro, setting \{ epilogue@proc equ macro \} } 21 | 22 | macro none procname,flag,parmbytes,localbytes,reglist { } 23 | 24 | macro assume params 25 | { 26 | local expr 27 | define expr params 28 | match reg:struct, expr 29 | \{ 30 | match assumed, reg\#@assumed \\{ irp name, assumed \\\{ restore name \\\} \\} 31 | macro label . \\{ local def 32 | define def . 33 | match =reg =at label, def \\\{ define def \\\} 34 | match name at,def \\\{ def@assumed reg,name,label at 35 | define def \\\} 36 | match name,def \\\{ def@assumed reg,.,: \\\} \\} 37 | struc db [val] \\{ \common def@assumed reg,., \\} 38 | struc dw [val] \\{ \common def@assumed reg,., \\} 39 | struc dp [val] \\{ \common def@assumed reg,., \\} 40 | struc dd [val] \\{ \common def@assumed reg,.,
\\} 41 | struc dt [val] \\{ \common def@assumed reg,.,
\\} 42 | struc dq [val] \\{ \common def@assumed reg,., \\} 43 | struc rb cnt \\{ def@assumed reg,.,rb cnt \\} 44 | struc rw cnt \\{ def@assumed reg,.,rw cnt \\} 45 | struc rp cnt \\{ def@assumed reg,.,rp cnt \\} 46 | struc rd cnt \\{ def@assumed reg,.,rd cnt \\} 47 | struc rt cnt \\{ def@assumed reg,.,rt cnt \\} 48 | struc rq cnt \\{ def@assumed reg,.,rq cnt \\} 49 | reg\#@assumed equ 50 | virtual at reg 51 | reg struct 52 | end virtual 53 | purge label 54 | restruc db,dw,dp,dd,dt,dq 55 | restruc rb,rw,rp,rd,rt,rq \} } 56 | 57 | macro def@assumed reg,name,def 58 | { match vars, reg#@assumed \{ reg#@assumed equ reg#@assumed, \} 59 | reg#@assumed equ reg#@assumed name 60 | local ..label 61 | name equ ..label 62 | ..label def } 63 | 64 | struc label type { label . type } 65 | 66 | struc none { label . } 67 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/PCOUNT/COMCTL32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; COMCTL32 API calls parameters' count 3 | 4 | CreateMappedBitmap% = 5 5 | CreatePropertySheetPage% = 1 6 | CreateStatusWindow% = 4 7 | CreateToolbar% = 8 8 | CreateToolbarEx% = 13 9 | CreateUpDownControl% = 12 10 | DestroyPropertySheetPage% = 1 11 | DrawInsert% = 3 12 | DrawStatusText% = 4 13 | FlatSB_EnableScrollBar% = 3 14 | FlatSB_GetScrollInfo% = 3 15 | FlatSB_GetScrollPos% = 2 16 | FlatSB_GetScrollProp% = 3 17 | FlatSB_GetScrollRange% = 4 18 | FlatSB_SetScrollInfo% = 4 19 | FlatSB_SetScrollPos% = 4 20 | FlatSB_SetScrollProp% = 4 21 | FlatSB_SetScrollRange% = 5 22 | FlatSB_ShowScrollBar% = 3 23 | GetEffectiveClientRect% = 3 24 | ImageList_Add% = 3 25 | ImageList_AddIcon% = 2 26 | ImageList_AddMasked% = 3 27 | ImageList_BeginDrag% = 4 28 | ImageList_Copy% = 5 29 | ImageList_Create% = 5 30 | ImageList_Destroy% = 1 31 | ImageList_DragEnter% = 3 32 | ImageList_DragLeave% = 1 33 | ImageList_DragMove% = 2 34 | ImageList_DragShowNolock% = 1 35 | ImageList_Draw% = 6 36 | ImageList_DrawEx% = 10 37 | ImageList_DrawIndirect% = 1 38 | ImageList_Duplicate% = 1 39 | ImageList_EndDrag% = 0 40 | ImageList_GetBkColor% = 1 41 | ImageList_GetDragImage% = 2 42 | ImageList_GetIcon% = 3 43 | ImageList_GetIconSize% = 3 44 | ImageList_GetImageCount% = 1 45 | ImageList_GetImageInfo% = 3 46 | ImageList_GetImageRect% = 3 47 | ImageList_LoadImage% = 7 48 | ImageList_Merge% = 6 49 | ImageList_Read% = 1 50 | ImageList_Remove% = 2 51 | ImageList_Replace% = 4 52 | ImageList_ReplaceIcon% = 3 53 | ImageList_SetBkColor% = 2 54 | ImageList_SetDragCursorImage% = 4 55 | ImageList_SetFilter% = 3 56 | ImageList_SetIconSize% = 3 57 | ImageList_SetImageCount% = 2 58 | ImageList_SetOverlayImage% = 3 59 | ImageList_Write% = 2 60 | InitCommonControls% = 0 61 | InitCommonControlsEx% = 1 62 | InitializeFlatSB% = 1 63 | LBItemFromPt% = 4 64 | MakeDragList% = 1 65 | MenuHelp% = 7 66 | PropertySheet% = 1 67 | ShowHideMenuCtl% = 3 68 | UninitializeFlatSB% = 1 69 | _TrackMouseEvent% = 1 70 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/PCOUNT/COMDLG32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; COMDLG32 API calls parameters' count 3 | 4 | ChooseColor% = 1 5 | ChooseFont% = 1 6 | CommDlgExtendedError% = 0 7 | FindText% = 1 8 | FormatCharDlgProc% = 4 9 | GetFileTitle% = 3 10 | GetOpenFileName% = 1 11 | GetSaveFileName% = 1 12 | LoadAlterBitmap% = 3 13 | PageSetupDlg% = 1 14 | PrintDlg% = 1 15 | ReplaceText% = 1 16 | WantArrows% = 4 17 | dwLBSubclass% = 4 18 | dwOKSubclass% = 4 19 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/PCOUNT/SHELL32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; SHELL32 API calls parameters' count 3 | 4 | CheckEscapes% = 2 5 | DoEnvironmentSubst% = 2 6 | DragAcceptFiles% = 2 7 | DragFinish% = 1 8 | DragQueryFile% = 4 9 | DragQueryPoint% = 2 10 | DuplicateIcon% = 2 11 | ExtractAssociatedIcon% = 3 12 | ExtractAssociatedIconEx% = 4 13 | ExtractIcon% = 3 14 | ExtractIconEx% = 5 15 | ExtractIconResInfo% = 5 16 | FindExeDlgProc% = 4 17 | FindExecutable% = 3 18 | FreeIconList% = 2 19 | InternalExtractIconList% = 3 20 | RealShellExecute% = 10 21 | RealShellExecuteEx% = 11 22 | RegenerateUserEnvironment% = 2 23 | SHAddToRecentDocs% = 2 24 | SHAppBarMessage% = 2 25 | SHBrowseForFolder% = 1 26 | SHChangeNotify% = 4 27 | SHEmptyRecycleBin% = 3 28 | SHFileOperation% = 1 29 | SHFormatDrive% = 4 30 | SHFreeNameMappings% = 1 31 | SHGetDataFromIDList% = 5 32 | SHGetDesktopFolder% = 1 33 | SHGetDiskFreeSpace% = 4 34 | SHGetFileInfo% = 5 35 | SHGetInstanceExplorer% = 1 36 | SHGetMalloc% = 1 37 | SHGetNewLinkInfo% = 5 38 | SHGetPathFromIDList% = 2 39 | SHGetSettings% = 2 40 | SHGetSpecialFolderLocation% = 3 41 | SHGetSpecialFolderPath% = 4 42 | SHInvokePrinterCommand% = 5 43 | SHLoadInProc% = 1 44 | SHQueryRecycleBin% = 2 45 | SHUpdateRecycleBinIcon% = 0 46 | SheChangeDir% = 1 47 | SheChangeDirEx% = 1 48 | SheFullPath% = 3 49 | SheGetCurDrive% = 0 50 | SheGetDir% = 2 51 | SheRemoveQuotes% = 1 52 | SheSetCurDrive% = 1 53 | SheShortenPath% = 2 54 | ShellAbout% = 4 55 | ShellExecute% = 6 56 | ShellExecuteEx% = 1 57 | ShellHookProc% = 3 58 | Shell_NotifyIcon% = 2 59 | StrChr% = 2 60 | StrChrI% = 2 61 | StrCmpN% = 3 62 | StrCmpNI% = 3 63 | StrCpyN% = 3 64 | StrNCmp% = 3 65 | StrNCmpI% = 3 66 | StrNCpy% = 3 67 | StrRChr% = 3 68 | StrRChrI% = 3 69 | StrRStr% = 3 70 | StrRStrI% = 3 71 | StrStr% = 2 72 | StrStrI% = 2 73 | WOWShellExecute% = 7 74 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/PCOUNT/WSOCK32.INC: -------------------------------------------------------------------------------- 1 | 2 | ; WSOCK32 API calls parameters' count 3 | 4 | AcceptEx% = 8 5 | EnumProtocols% = 3 6 | GetAcceptExSockaddrs% = 8 7 | GetAddressByName% = 10 8 | GetNameByType% = 3 9 | GetService% = 7 10 | GetTypeByName% = 2 11 | MigrateWinsockConfiguration% = 3 12 | NPLoadNameSpaces% = 3 13 | SetService% = 6 14 | TransmitFile% = 7 15 | WEP% = 0 16 | WSAAsyncGetHostByAddr% = 7 17 | WSAAsyncGetHostByName% = 5 18 | WSAAsyncGetProtoByName% = 5 19 | WSAAsyncGetProtoByNumber% = 5 20 | WSAAsyncGetServByName% = 6 21 | WSAAsyncGetServByPort% = 6 22 | WSACancelAsyncRequest% = 4 23 | WSACancelBlockingCall% = 0 24 | WSACleanup% = 0 25 | WSAGetLastError% = 0 26 | WSAIsBlocking% = 0 27 | WSARecvEx% = 4 28 | WSASetBlockingHook% = 1 29 | WSASetLastError% = 1 30 | WSAStartup% = 2 31 | WSAUnhookBlockingHook% = 0 32 | __WSAFDIsSet% = 2 33 | accept% = 3 34 | bind% = 3 35 | closesocket% = 1 36 | connect% = 3 37 | dn_expand% = 5 38 | gethostbyaddr% = 3 39 | gethostbyname% = 1 40 | gethostname% = 2 41 | getnetbyname% = 1 42 | getpeername% = 3 43 | getprotobyname% = 1 44 | getprotobynumber% = 1 45 | getservbyname% = 2 46 | getservbyport% = 2 47 | getsockname% = 3 48 | getsockopt% = 5 49 | htonl% = 1 50 | htons% = 1 51 | inet_addr% = 1 52 | inet_network% = 1 53 | inet_ntoa% = 1 54 | ioctlsocket% = 3 55 | listen% = 2 56 | ntohl% = 1 57 | ntohs% = 1 58 | rcmd% = 6 59 | recv% = 4 60 | recvfrom% = 6 61 | rexec% = 6 62 | rresvport% = 1 63 | s_perror% = 2 64 | select% = 5 65 | send% = 4 66 | sendto% = 6 67 | sethostname% = 2 68 | setsockopt% = 5 69 | shutdown% = 2 70 | socket% = 3 71 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/WIN32A.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Win32 programming headers (ASCII) 3 | 4 | include 'macro/struct.inc' 5 | include 'macro/proc32.inc' 6 | include 'macro/com32.inc' 7 | include 'macro/import32.inc' 8 | include 'macro/export.inc' 9 | include 'macro/resource.inc' 10 | 11 | struc TCHAR [val] { common match any, val \{ . db val \} 12 | match , val \{ . db ? \} } 13 | sizeof.TCHAR = 1 14 | 15 | include 'equates/kernel32.inc' 16 | include 'equates/user32.inc' 17 | include 'equates/gdi32.inc' 18 | include 'equates/comctl32.inc' 19 | include 'equates/comdlg32.inc' 20 | include 'equates/shell32.inc' 21 | include 'equates/wsock32.inc' 22 | 23 | macro api [name] { if used name 24 | label name dword at name#A 25 | end if } 26 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/WIN32AX.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Extended Win32 programming headers (ASCII) 3 | 4 | include 'win32a.inc' 5 | 6 | include 'macro/if.inc' 7 | 8 | macro allow_nesting 9 | { macro pushd value 10 | \{ match ,value \\{ 11 | pushx equ \\} 12 | match =pushx =invoke proc,pushx value \\{ 13 | allow_nesting 14 | invoke proc 15 | purge pushd,invoke,stdcall,cinvoke,ccall 16 | push eax 17 | pushx equ \\} 18 | match =pushx =stdcall proc,pushx value \\{ 19 | allow_nesting 20 | stdcall proc 21 | purge pushd,invoke,stdcall,cinvoke,ccall 22 | push eax 23 | pushx equ \\} 24 | match =pushx =cinvoke proc,pushx value \\{ 25 | allow_nesting 26 | cinvoke proc 27 | purge pushd,invoke,stdcall,cinvoke,ccall 28 | push eax 29 | pushx equ \\} 30 | match =pushx =ccall proc,pushx value \\{ 31 | allow_nesting 32 | ccall proc 33 | purge pushd,invoke,stdcall,cinvoke,ccall 34 | push eax 35 | pushx equ \\} 36 | match =pushx,pushx \\{ 37 | pushd 38 | pushx equ \\} 39 | restore pushx \} 40 | macro invoke proc,[arg] 41 | \{ \reverse pushd 42 | \common call [proc] \} 43 | macro stdcall proc,[arg] 44 | \{ \reverse pushd 45 | \common call proc \} 46 | macro cinvoke proc,[arg] 47 | \{ \common \local size 48 | size = 0 49 | if ~ arg eq 50 | \reverse pushd 51 | size = size+4 52 | match =double any,arg \\{ size = size+4 \\} 53 | \common end if 54 | call [proc] 55 | if size 56 | add esp,size 57 | end if \} 58 | macro ccall proc,[arg] 59 | \{ \common \local size 60 | size = 0 61 | if ~ arg eq 62 | \reverse pushd 63 | size = size+4 64 | match =double any,arg \\{ size = size+4 \\} 65 | \common end if 66 | call proc 67 | if size 68 | add esp,size 69 | end if \} } 70 | 71 | macro pushd value 72 | { match first=,more, value \{ \local ..continue 73 | call ..continue 74 | db value,0 75 | ..continue: 76 | pushd equ \} 77 | match pushd =addr var,pushd value \{ \local ..opcode,..address 78 | if +var relativeto 0 | +var relativeto $ 79 | push var 80 | else 81 | lea edx,[var] 82 | push edx 83 | end if 84 | pushd equ \} 85 | match pushd =double [var],pushd value \{ 86 | push dword [var+4] 87 | push dword [var] 88 | pushd equ \} 89 | match pushd =double =ptr var,pushd value \{ 90 | push dword [var+4] 91 | push dword [var] 92 | pushd equ \} 93 | match pushd =double num,pushd value \{ \local ..high,..low 94 | virtual at 0 95 | dq num 96 | load ..low dword from 0 97 | load ..high dword from 4 98 | end virtual 99 | push ..high 100 | push ..low 101 | pushd equ \} 102 | match pushd,pushd \{ \local ..continue 103 | if value eqtype '' 104 | call ..continue 105 | db value,0 106 | ..continue: 107 | else 108 | push value 109 | end if 110 | pushd equ \} 111 | restore pushd } 112 | 113 | allow_nesting 114 | 115 | macro import lib,[functions] 116 | { common macro import_#lib \{ import lib,functions \} } 117 | 118 | macro api [functions] 119 | { common macro all_api \{ all_api 120 | api functions \} } 121 | macro all_api {} 122 | 123 | include 'api/kernel32.inc' 124 | include 'api/user32.inc' 125 | include 'api/gdi32.inc' 126 | include 'api/advapi32.inc' 127 | include 'api/comctl32.inc' 128 | include 'api/comdlg32.inc' 129 | include 'api/shell32.inc' 130 | include 'api/wsock32.inc' 131 | 132 | purge import,api 133 | 134 | macro .data { section '.data' data readable writeable } 135 | 136 | macro .code { section '.text' code readable executable } 137 | 138 | macro .end label 139 | { 140 | entry label 141 | 142 | section '.idata' import data readable writeable 143 | 144 | library kernel32,'KERNEL32.DLL',\ 145 | user32,'USER32.DLL',\ 146 | gdi32,'GDI32.DLL',\ 147 | advapi32,'ADVAPI32.DLL',\ 148 | comctl32,'COMCTL32.DLL',\ 149 | comdlg32,'COMDLG32.DLL',\ 150 | shell32,'SHELL32.DLL',\ 151 | wsock32,'WSOCK32.DLL' 152 | 153 | import_kernel32 154 | import_user32 155 | import_gdi32 156 | import_advapi32 157 | import_comctl32 158 | import_comdlg32 159 | import_shell32 160 | import_wsock32 161 | 162 | all_api 163 | } 164 | 165 | virtual at 0 166 | xchg eax,eax 167 | detected_16bit = $-1 168 | end virtual 169 | 170 | if detected_16bit 171 | format PE GUI 4.0 172 | end if 173 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/WIN32W.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Win32 programming headers (WideChar) 3 | 4 | include 'macro/struct.inc' 5 | include 'macro/proc32.inc' 6 | include 'macro/com32.inc' 7 | include 'macro/import32.inc' 8 | include 'macro/export.inc' 9 | include 'macro/resource.inc' 10 | 11 | struc TCHAR [val] { common match any, val \{ . du val \} 12 | match , val \{ . du ? \} } 13 | sizeof.TCHAR = 2 14 | 15 | include 'equates/kernel32.inc' 16 | include 'equates/user32.inc' 17 | include 'equates/gdi32.inc' 18 | include 'equates/comctl32.inc' 19 | include 'equates/comdlg32.inc' 20 | include 'equates/shell32.inc' 21 | include 'equates/wsock32.inc' 22 | 23 | macro api [name] { if used name 24 | label name dword at name#W 25 | end if } 26 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/WIN32WX.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Extended Win32 programming headers (WideChar) 3 | 4 | include 'win32w.inc' 5 | 6 | include 'macro/if.inc' 7 | 8 | macro allow_nesting 9 | { macro pushd value 10 | \{ match ,value \\{ 11 | pushx equ \\} 12 | match =pushx =invoke proc,pushx value \\{ 13 | allow_nesting 14 | invoke proc 15 | purge pushd,invoke,stdcall,cinvoke,ccall 16 | push eax 17 | pushx equ \\} 18 | match =pushx =stdcall proc,pushx value \\{ 19 | allow_nesting 20 | stdcall proc 21 | purge pushd,invoke,stdcall,cinvoke,ccall 22 | push eax 23 | pushx equ \\} 24 | match =pushx =cinvoke proc,pushx value \\{ 25 | allow_nesting 26 | cinvoke proc 27 | purge pushd,invoke,stdcall,cinvoke,ccall 28 | push eax 29 | pushx equ \\} 30 | match =pushx =ccall proc,pushx value \\{ 31 | allow_nesting 32 | ccall proc 33 | purge pushd,invoke,stdcall,cinvoke,ccall 34 | push eax 35 | pushx equ \\} 36 | match =pushx,pushx \\{ 37 | pushd 38 | pushx equ \\} 39 | restore pushx \} 40 | macro invoke proc,[arg] 41 | \{ \reverse pushd 42 | \common call [proc] \} 43 | macro stdcall proc,[arg] 44 | \{ \reverse pushd 45 | \common call proc \} 46 | macro cinvoke proc,[arg] 47 | \{ \common \local size 48 | size = 0 49 | if ~ arg eq 50 | \reverse pushd 51 | size = size+4 52 | match =double any,arg \\{ size = size+4 \\} 53 | \common end if 54 | call [proc] 55 | if size 56 | add esp,size 57 | end if \} 58 | macro ccall proc,[arg] 59 | \{ \common \local size 60 | size = 0 61 | if ~ arg eq 62 | \reverse pushd 63 | size = size+4 64 | match =double any,arg \\{ size = size+4 \\} 65 | \common end if 66 | call proc 67 | if size 68 | add esp,size 69 | end if \} } 70 | 71 | macro pushd value 72 | { match first=,more, value \{ \local ..continue 73 | times 1 - (rva $ and 1) nop 74 | call ..continue 75 | du value,0 76 | ..continue: 77 | pushd equ \} 78 | match pushd =addr var,pushd value \{ \local ..opcode,..address 79 | if +var relativeto 0 | +var relativeto $ 80 | push var 81 | else 82 | lea edx,[var] 83 | push edx 84 | end if 85 | pushd equ \} 86 | match pushd =double [var],pushd value \{ 87 | push dword [var+4] 88 | push dword [var] 89 | pushd equ \} 90 | match pushd =double =ptr var,pushd value \{ 91 | push dword [var+4] 92 | push dword [var] 93 | pushd equ \} 94 | match pushd =double num,pushd value \{ \local ..high,..low 95 | virtual at 0 96 | dq num 97 | load ..low dword from 0 98 | load ..high dword from 4 99 | end virtual 100 | push ..high 101 | push ..low 102 | pushd equ \} 103 | match pushd,pushd \{ \local ..continue 104 | if value eqtype '' 105 | times 1 - (rva $ and 1) nop 106 | call ..continue 107 | du value,0 108 | ..continue: 109 | else 110 | push value 111 | end if 112 | pushd equ \} 113 | restore pushd } 114 | 115 | allow_nesting 116 | 117 | macro import lib,[functions] 118 | { common macro import_#lib \{ import lib,functions \} } 119 | 120 | macro api [functions] 121 | { common macro all_api \{ all_api 122 | api functions \} } 123 | macro all_api {} 124 | 125 | include 'api/kernel32.inc' 126 | include 'api/user32.inc' 127 | include 'api/gdi32.inc' 128 | include 'api/advapi32.inc' 129 | include 'api/comctl32.inc' 130 | include 'api/comdlg32.inc' 131 | include 'api/shell32.inc' 132 | include 'api/wsock32.inc' 133 | 134 | purge import,api 135 | 136 | macro .data { section '.data' data readable writeable } 137 | 138 | macro .code { section '.text' code readable executable } 139 | 140 | macro .end label 141 | { 142 | entry label 143 | 144 | section '.idata' import data readable writeable 145 | 146 | library kernel32,'KERNEL32.DLL',\ 147 | user32,'USER32.DLL',\ 148 | gdi32,'GDI32.DLL',\ 149 | advapi32,'ADVAPI32.DLL',\ 150 | comctl32,'COMCTL32.DLL',\ 151 | comdlg32,'COMDLG32.DLL',\ 152 | shell32,'SHELL32.DLL',\ 153 | wsock32,'WSOCK32.DLL' 154 | 155 | import_kernel32 156 | import_user32 157 | import_gdi32 158 | import_advapi32 159 | import_comctl32 160 | import_comdlg32 161 | import_shell32 162 | import_wsock32 163 | 164 | all_api 165 | } 166 | 167 | virtual at 0 168 | xchg eax,eax 169 | detected_16bit = $-1 170 | end virtual 171 | 172 | if detected_16bit 173 | format PE GUI 4.0 174 | end if 175 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/WIN64A.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Win64 programming headers (ASCII) 3 | 4 | include 'macro/struct.inc' 5 | include 'macro/proc64.inc' 6 | include 'macro/com64.inc' 7 | include 'macro/import64.inc' 8 | include 'macro/export.inc' 9 | include 'macro/resource.inc' 10 | 11 | struc TCHAR [val] { common match any, val \{ . db val \} 12 | match , val \{ . db ? \} } 13 | sizeof.TCHAR = 1 14 | 15 | include 'equates/kernel64.inc' 16 | include 'equates/user64.inc' 17 | include 'equates/gdi64.inc' 18 | include 'equates/comctl64.inc' 19 | include 'equates/comdlg64.inc' 20 | include 'equates/shell64.inc' 21 | 22 | macro api [name] { if used name 23 | label name qword at name#A 24 | end if } 25 | 26 | -------------------------------------------------------------------------------- /tools/Flat Assembler/INCLUDE/WIN64W.INC: -------------------------------------------------------------------------------- 1 | 2 | ; Win64 programming headers (WideChar) 3 | 4 | include 'macro/struct.inc' 5 | include 'macro/proc64.inc' 6 | include 'macro/com64.inc' 7 | include 'macro/import64.inc' 8 | include 'macro/export.inc' 9 | include 'macro/resource.inc' 10 | 11 | struc TCHAR [val] { common match any, val \{ . du val \} 12 | match , val \{ . du ? \} } 13 | sizeof.TCHAR = 2 14 | 15 | include 'equates/kernel64.inc' 16 | include 'equates/user64.inc' 17 | include 'equates/gdi64.inc' 18 | include 'equates/comctl64.inc' 19 | include 'equates/comdlg64.inc' 20 | include 'equates/shell64.inc' 21 | 22 | macro api [name] { if used name 23 | label name qword at name#W 24 | end if } -------------------------------------------------------------------------------- /tools/Flat Assembler/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | 2 | flat assembler version 1.71 3 | Copyright (c) 1999-2016, Tomasz Grysztar. 4 | All rights reserved. 5 | 6 | This program is free for commercial and non-commercial use as long as 7 | the following conditions are adhered to. 8 | 9 | Copyright remains Tomasz Grysztar, and as such any Copyright notices 10 | in the code are not to be removed. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are 14 | met: 15 | 16 | 1. Redistributions of source code must retain the above copyright notice, 17 | this list of conditions and the following disclaimer. 18 | 2. Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 24 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 25 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR 26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | 34 | The licence and distribution terms for any publically available 35 | version or derivative of this code cannot be changed. i.e. this code 36 | cannot simply be copied and put under another distribution licence 37 | (including the GNU Public Licence). 38 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/IDE/FASMD/FASMD.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/IDE/FASMD/FASMD.ASM -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/IDE/FASMW/ASMEDIT.ASH: -------------------------------------------------------------------------------- 1 | 2 | ; Assembly Editor mode flags 3 | 4 | AEMODE_OVERWRITE = 1 5 | AEMODE_VERTICALSEL = 2 6 | AEMODE_NOUNDO = 4 7 | 8 | ; Assembly Editor search flags 9 | 10 | AEFIND_CASESENSITIVE = 1 11 | AEFIND_WHOLEWORDS = 2 12 | AEFIND_BACKWARD = 4 13 | 14 | ; Assembly Editor styles 15 | 16 | AES_AUTOINDENT = 0001h 17 | AES_AUTOBRACKETS = 0002h 18 | AES_SMARTTABS = 0004h 19 | AES_SECURESEL = 0008h 20 | AES_OPTIMALFILL = 0010h 21 | AES_CONSOLECARET = 0020h 22 | AES_REVIVEDEADKEYS = 0040h 23 | 24 | ; Assembly Editor messages 25 | 26 | AEM_SETMODE = WM_USER + 0 27 | AEM_GETMODE = WM_USER + 1 28 | AEM_SETPOS = WM_USER + 2 29 | AEM_GETPOS = WM_USER + 3 30 | AEM_SETSYNTAXHIGHLIGHT = WM_USER + 4 31 | AEM_SETRIGHTCLICKMENU = WM_USER + 5 32 | AEM_SETTEXTCOLOR = WM_USER + 6 33 | AEM_SETSELCOLOR = WM_USER + 7 34 | AEM_FINDFIRST = WM_USER + 8 35 | AEM_FINDNEXT = WM_USER + 9 36 | AEM_CANFINDNEXT = WM_USER + 10 37 | AEM_GETLINELENGTH = WM_USER + 11 38 | AEM_GETLINE = WM_USER + 12 39 | AEM_GETWORDATCARET = WM_USER + 13 40 | AEM_BEGINOPERATION = WM_USER + 14 41 | AEM_ENDOPERATION = WM_USER + 15 42 | AEM_MARKUNMODIFIED = WM_USER + 16 43 | AEM_ISUNMODIFIED = WM_USER + 17 44 | AEM_GETSEARCHTEXT = WM_USER + 18 45 | AEM_GETSEARCHFLAGS = WM_USER + 19 46 | AEM_RELEASESEARCH = WM_USER + 20 47 | 48 | ; Assembly Editor notifications 49 | 50 | AEN_SETFOCUS = 01h 51 | AEN_KILLFOCUS = 02h 52 | AEN_TEXTCHANGE = 03h 53 | AEN_POSCHANGE = 04h 54 | AEN_MODECHANGE = 05h 55 | AEN_OUTOFMEMORY = 0Fh 56 | 57 | ; Assembly Editor position structure 58 | 59 | struct AEPOS 60 | selectionPosition dd ? 61 | selectionLine dd ? 62 | caretPosition dd ? 63 | caretLine dd ? 64 | ends 65 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/IDE/FASMW/FASMW.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/IDE/FASMW/FASMW.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/IDE/FASMW/FASMW.sym: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/IDE/FASMW/FASMW.sym -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/IDE/FASMW/FEDIT.ASH: -------------------------------------------------------------------------------- 1 | 2 | ; flat editor mode flags 3 | 4 | FEMODE_OVERWRITE = 1 5 | FEMODE_VERTICALSEL = 2 6 | FEMODE_NOUNDO = 4 7 | FEMODE_READONLY = 8 8 | 9 | ; flat editor search flags 10 | 11 | FEFIND_CASESENSITIVE = 1 12 | FEFIND_WHOLEWORDS = 2 13 | FEFIND_BACKWARD = 4 14 | FEFIND_INWHOLETEXT = 8 15 | 16 | ; flat editor styles 17 | 18 | FES_AUTOINDENT = 0001h 19 | FES_AUTOBRACKETS = 0002h 20 | FES_SMARTTABS = 0004h 21 | FES_SECURESEL = 0008h 22 | FES_OPTIMALFILL = 0010h 23 | FES_CONSOLECARET = 0020h 24 | FES_REVIVEDEADKEYS = 0040h 25 | 26 | ; flat editor messages 27 | 28 | FEM_SETMODE = WM_USER + 0 29 | FEM_GETMODE = WM_USER + 1 30 | FEM_SETPOS = WM_USER + 2 31 | FEM_GETPOS = WM_USER + 3 32 | FEM_SETSYNTAXHIGHLIGHT = WM_USER + 4 33 | FEM_SETRIGHTCLICKMENU = WM_USER + 5 34 | FEM_SETTEXTCOLOR = WM_USER + 6 35 | FEM_SETSELCOLOR = WM_USER + 7 36 | FEM_FINDFIRST = WM_USER + 8 37 | FEM_FINDNEXT = WM_USER + 9 38 | FEM_CANFINDNEXT = WM_USER + 10 39 | FEM_GETLINELENGTH = WM_USER + 11 40 | FEM_GETLINE = WM_USER + 12 41 | FEM_GETWORDATCARET = WM_USER + 13 42 | FEM_BEGINOPERATION = WM_USER + 14 43 | FEM_ENDOPERATION = WM_USER + 15 44 | FEM_MARKUNMODIFIED = WM_USER + 16 45 | FEM_ISUNMODIFIED = WM_USER + 17 46 | FEM_GETSEARCHTEXT = WM_USER + 18 47 | FEM_GETSEARCHFLAGS = WM_USER + 19 48 | FEM_RELEASESEARCH = WM_USER + 20 49 | FEM_REDO = WM_USER + 84 50 | FEM_CANREDO = WM_USER + 85 51 | 52 | ; flat editor notifications 53 | 54 | FEN_SETFOCUS = 01h 55 | FEN_KILLFOCUS = 02h 56 | FEN_TEXTCHANGE = 03h 57 | FEN_POSCHANGE = 04h 58 | FEN_MODECHANGE = 05h 59 | FEN_OUTOFMEMORY = 0Fh 60 | 61 | ; flat editor position structure 62 | 63 | struct FEPOS 64 | selectionPosition dd ? 65 | selectionLine dd ? 66 | caretPosition dd ? 67 | caretLine dd ? 68 | ends 69 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/IDE/FASMW/RESOURCE/ASSIGN.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/IDE/FASMW/RESOURCE/ASSIGN.BMP -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/IDE/FASMW/RESOURCE/FASMW.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/IDE/FASMW/RESOURCE/FASMW.ICO -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/IDE/VARIABLE.INC: -------------------------------------------------------------------------------- 1 | 2 | ; flat editor core 3 | ; Copyright (c) 1999-2015, Tomasz Grysztar. 4 | ; All rights reserved. 5 | 6 | editor_memory dd ? 7 | 8 | label editor_status 9 | 10 | first_line dd ? 11 | lines_count dd ? 12 | peak_line_length dd ? 13 | maximum_position dd ? 14 | window_line dd ? 15 | window_position dd ? 16 | window_line_number dd ? 17 | caret_line dd ? 18 | caret_position dd ? 19 | caret_line_number dd ? 20 | selection_line dd ? 21 | selection_position dd ? 22 | selection_line_number dd ? 23 | editor_mode dd ? 24 | 25 | editor_status_size = $ - editor_status 26 | 27 | window_width dd ? 28 | window_height dd ? 29 | unallocated_segments dd ? 30 | unallocated_segments_end dd ? 31 | released_segments dd ? 32 | memory_search_block dd ? 33 | memory_search_segment dd ? 34 | lengths_table dd ? 35 | undo_data dd ? 36 | redo_data dd ? 37 | search_data dd ? 38 | search_flags dd ? 39 | search_handle dd ? 40 | unmodified_state dd ? 41 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/IDE/VERSION.INC: -------------------------------------------------------------------------------- 1 | 2 | ; flat editor version 3.12 3 | ; Copyright (c) 1999-2015, Tomasz Grysztar. 4 | ; All rights reserved. 5 | ; 6 | ; This programs is free for commercial and non-commercial use as long as 7 | ; the following conditions are adhered to. 8 | ; 9 | ; Redistribution and use in source and binary forms, with or without 10 | ; modification, are permitted provided that the following conditions are 11 | ; met: 12 | ; 13 | ; 1. Redistributions of source code must retain the above copyright notice, 14 | ; this list of conditions and the following disclaimer. 15 | ; 2. Redistributions in binary form must reproduce the above copyright 16 | ; notice, this list of conditions and the following disclaimer in the 17 | ; documentation and/or other materials provided with the distribution. 18 | ; 19 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | ; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 22 | ; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR 23 | ; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | ; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | ; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | ; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | ; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | ; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | ; 31 | ; The licence and distribution terms for any publically available 32 | ; version or derivative of this code cannot be changed. i.e. this code 33 | ; cannot simply be copied and put under another distribution licence 34 | ; (including the GNU Public Licence). 35 | 36 | FEDIT_VERSION_STRING equ "3.12" 37 | 38 | FEDIT_VERSION_MAJOR = 3 39 | FEDIT_VERSION_MINOR = 12 40 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/MESSAGES.INC: -------------------------------------------------------------------------------- 1 | 2 | ; flat assembler core 3 | ; Copyright (c) 1999-2016, Tomasz Grysztar. 4 | ; All rights reserved. 5 | 6 | _out_of_memory db 'out of memory',0 7 | _stack_overflow db 'out of stack space',0 8 | _main_file_not_found db 'source file not found',0 9 | _unexpected_end_of_file db 'unexpected end of file',0 10 | _code_cannot_be_generated db 'code cannot be generated',0 11 | _format_limitations_exceeded db 'format limitations exceeded',0 12 | _invalid_definition db 'invalid definition provided',0 13 | _write_failed db 'write failed',0 14 | _file_not_found db 'file not found',0 15 | _error_reading_file db 'error reading file',0 16 | _invalid_file_format db 'invalid file format',0 17 | _invalid_macro_arguments db 'invalid macro arguments',0 18 | _incomplete_macro db 'incomplete macro',0 19 | _unexpected_characters db 'unexpected characters',0 20 | _invalid_argument db 'invalid argument',0 21 | _illegal_instruction db 'illegal instruction',0 22 | _invalid_operand db 'invalid operand',0 23 | _invalid_operand_size db 'invalid size of operand',0 24 | _operand_size_not_specified db 'operand size not specified',0 25 | _operand_sizes_do_not_match db 'operand sizes do not match',0 26 | _invalid_address_size db 'invalid size of address value',0 27 | _address_sizes_do_not_agree db 'address sizes do not agree',0 28 | _disallowed_combination_of_registers db 'disallowed combination of registers',0 29 | _long_immediate_not_encodable db 'not encodable with long immediate',0 30 | _relative_jump_out_of_range db 'relative jump out of range',0 31 | _invalid_expression db 'invalid expression',0 32 | _invalid_address db 'invalid address',0 33 | _invalid_value db 'invalid value',0 34 | _value_out_of_range db 'value out of range',0 35 | _undefined_symbol db 'undefined symbol',0 36 | _symbol_out_of_scope_1 db 'symbol',0 37 | _symbol_out_of_scope_2 db 'out of scope',0 38 | _invalid_use_of_symbol db 'invalid use of symbol',0 39 | _name_too_long db 'name too long',0 40 | _invalid_name db 'invalid name',0 41 | _reserved_word_used_as_symbol db 'reserved word used as symbol',0 42 | _symbol_already_defined db 'symbol already defined',0 43 | _missing_end_quote db 'missing end quote',0 44 | _missing_end_directive db 'missing end directive',0 45 | _unexpected_instruction db 'unexpected instruction',0 46 | _extra_characters_on_line db 'extra characters on line',0 47 | _section_not_aligned_enough db 'section is not aligned enough',0 48 | _setting_already_specified db 'setting already specified',0 49 | _data_already_defined db 'data already defined',0 50 | _too_many_repeats db 'too many repeats',0 51 | _invoked_error db 'error directive encountered in source file',0 52 | _assertion_failed db 'assertion failed',0 53 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VARIABLE.INC: -------------------------------------------------------------------------------- 1 | 2 | ; flat assembler core variables 3 | ; Copyright (c) 1999-2016, Tomasz Grysztar. 4 | ; All rights reserved. 5 | 6 | ; Variables which have to be set up by interface: 7 | 8 | memory_start dd ? 9 | memory_end dd ? 10 | 11 | additional_memory dd ? 12 | additional_memory_end dd ? 13 | 14 | stack_limit dd ? 15 | 16 | initial_definitions dd ? 17 | input_file dd ? 18 | output_file dd ? 19 | symbols_file dd ? 20 | 21 | passes_limit dw ? 22 | 23 | ; Internal core variables: 24 | 25 | current_pass dw ? 26 | 27 | include_paths dd ? 28 | free_additional_memory dd ? 29 | source_start dd ? 30 | code_start dd ? 31 | code_size dd ? 32 | real_code_size dd ? 33 | written_size dd ? 34 | headers_size dd ? 35 | 36 | current_line dd ? 37 | macro_line dd ? 38 | macro_block dd ? 39 | macro_block_line dd ? 40 | macro_block_line_number dd ? 41 | macro_symbols dd ? 42 | struc_name dd ? 43 | struc_label dd ? 44 | instant_macro_start dd ? 45 | parameters_end dd ? 46 | default_argument_value dd ? 47 | locals_counter rb 8 48 | current_locals_prefix dd ? 49 | anonymous_reverse dd ? 50 | anonymous_forward dd ? 51 | labels_list dd ? 52 | label_hash dd ? 53 | label_leaf dd ? 54 | hash_tree dd ? 55 | addressing_space dd ? 56 | undefined_data_start dd ? 57 | undefined_data_end dd ? 58 | counter dd ? 59 | counter_limit dd ? 60 | error_info dd ? 61 | error_line dd ? 62 | error dd ? 63 | tagged_blocks dd ? 64 | structures_buffer dd ? 65 | number_start dd ? 66 | current_offset dd ? 67 | value dq ? 68 | fp_value rd 8 69 | adjustment dq ? 70 | symbol_identifier dd ? 71 | address_symbol dd ? 72 | address_high dd ? 73 | uncompressed_displacement dd ? 74 | format_flags dd ? 75 | resolver_flags dd ? 76 | symbols_stream dd ? 77 | number_of_relocations dd ? 78 | number_of_sections dd ? 79 | stub_size dd ? 80 | stub_file dd ? 81 | current_section dd ? 82 | machine dw ? 83 | subsystem dw ? 84 | subsystem_version dd ? 85 | image_base dd ? 86 | image_base_high dd ? 87 | resource_data dd ? 88 | resource_size dd ? 89 | actual_fixups_size dd ? 90 | reserved_fixups dd ? 91 | reserved_fixups_size dd ? 92 | last_fixup_base dd ? 93 | last_fixup_header dd ? 94 | parenthesis_stack dd ? 95 | blocks_stack dd ? 96 | parsed_lines dd ? 97 | logical_value_parentheses dd ? 98 | file_extension dd ? 99 | 100 | operand_size db ? 101 | operand_flags db ? 102 | operand_prefix db ? 103 | rex_prefix db ? 104 | opcode_prefix db ? 105 | vex_required db ? 106 | vex_register db ? 107 | immediate_size db ? 108 | mask_register db ? 109 | broadcast_size db ? 110 | rounding_mode db ? 111 | 112 | base_code db ? 113 | extended_code db ? 114 | supplemental_code db ? 115 | postbyte_register db ? 116 | segment_register db ? 117 | xop_opcode_map db ? 118 | 119 | mmx_size db ? 120 | jump_type db ? 121 | push_size db ? 122 | value_size db ? 123 | address_size db ? 124 | label_size db ? 125 | size_declared db ? 126 | address_size_declared db ? 127 | displacement_compression db ? 128 | 129 | value_undefined db ? 130 | value_constant db ? 131 | value_type db ? 132 | value_sign db ? 133 | fp_sign db ? 134 | fp_format db ? 135 | address_sign db ? 136 | address_register db ? 137 | compare_type db ? 138 | logical_value_wrapping db ? 139 | next_pass_needed db ? 140 | output_format db ? 141 | code_type db ? 142 | adjustment_sign db ? 143 | evex_mode db ? 144 | 145 | macro_status db ? 146 | skip_default_argument_value db ? 147 | prefix_flags db ? 148 | formatter_symbols_allowed db ? 149 | decorator_symbols_allowed db ? 150 | free_address_range db ? 151 | 152 | 153 | characters rb 100h 154 | converted rb 100h 155 | message rb 200h 156 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VERSION.INC: -------------------------------------------------------------------------------- 1 | 2 | ; flat assembler version 1.71 3 | ; Copyright (c) 1999-2016, Tomasz Grysztar. 4 | ; All rights reserved. 5 | ; 6 | ; This programs is free for commercial and non-commercial use as long as 7 | ; the following conditions are adhered to. 8 | ; 9 | ; Redistribution and use in source and binary forms, with or without 10 | ; modification, are permitted provided that the following conditions are 11 | ; met: 12 | ; 13 | ; 1. Redistributions of source code must retain the above copyright notice, 14 | ; this list of conditions and the following disclaimer. 15 | ; 2. Redistributions in binary form must reproduce the above copyright 16 | ; notice, this list of conditions and the following disclaimer in the 17 | ; documentation and/or other materials provided with the distribution. 18 | ; 19 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | ; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 22 | ; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR 23 | ; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | ; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | ; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | ; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | ; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | ; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | ; 31 | ; The licence and distribution terms for any publically available 32 | ; version or derivative of this code cannot be changed. i.e. this code 33 | ; cannot simply be copied and put under another distribution licence 34 | ; (including the GNU Public Licence). 35 | 36 | VERSION_STRING equ "1.71.51" 37 | 38 | VERSION_MAJOR = 1 39 | VERSION_MINOR = 71 40 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/VFASMCORE.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/VFASMCORE.DLL -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/VFASMCORE.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | RunFasmCore -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/VFASMCORE.sym: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/VFASMCORE.sym -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/lib/vfasmcore.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/lib/vfasmcore.exp -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/lib/vfasmcore.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/lib/vfasmcore.lib -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/makelib.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | .\tools\lib.exe /MACHINE:IX86 /out:.\lib\vfasmcore.lib /def:VFASMCORE.DEF 3 | @pause -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/Debug/test.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/Debug/test.exe -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/Debug/test.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/Debug/test.ilk -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/Debug/test.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/Debug/test.pdb -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test.ncb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test.ncb -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcproj", "{5B4B0BFE-74BC-49A5-AD71-3C054E26B1C3}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {5B4B0BFE-74BC-49A5-AD71-3C054E26B1C3}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {5B4B0BFE-74BC-49A5-AD71-3C054E26B1C3}.Debug|Win32.Build.0 = Debug|Win32 14 | {5B4B0BFE-74BC-49A5-AD71-3C054E26B1C3}.Release|Win32.ActiveCfg = Release|Win32 15 | {5B4B0BFE-74BC-49A5-AD71-3C054E26B1C3}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test.suo -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/BuildLog.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/BuildLog.htm -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/mt.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/mt.dep -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/stdafx.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/stdafx.obj -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/test.exe.embed.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/test.exe.embed.manifest.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/test.exe.embed.manifest.res -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/test.exe.intermediate.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/test.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/test.obj -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/test.pch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/test.pch -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/vc90.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/vc90.idb -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/vc90.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/Debug/vc90.pdb -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | 控制台应用程序:test 项目概述 3 | ======================================================================== 4 | 5 | 应用程序向导已为您创建了此 test 应用程序。 6 | 7 | 本文件概要介绍组成 test 应用程序的 8 | 的每个文件的内容。 9 | 10 | 11 | test.vcproj 12 | 这是使用应用程序向导生成的 VC++ 项目的主项目文件, 13 | 其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 14 | 15 | test.cpp 16 | 这是主应用程序源文件。 17 | 18 | ///////////////////////////////////////////////////////////////////////////// 19 | 其他标准文件: 20 | 21 | StdAfx.h, StdAfx.cpp 22 | 这些文件用于生成名为 test.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | 其他注释: 26 | 27 | 应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 28 | 29 | ///////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/VFASMCORE.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/VFASMCORE.DLL -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/stdafx.cpp -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/stdafx.h -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/targetver.h -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/test.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/test.cpp -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/test.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/test.vcproj -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/test.vcproj.Shion-PC.Tishion.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/vfasmcore.h: -------------------------------------------------------------------------------- 1 | #ifndef _VFASMCORE_H_ 2 | #define _VFASMCORE_H_ 3 | 4 | #define EXTERN_IMPORT extern "C" _declspec(dllimport) 5 | 6 | EXTERN_IMPORT __int32 RunFasmCore( 7 | const char* lpInPutFile, 8 | const char* lpOutPutFile, 9 | const char* lpSymbolsFile, 10 | __int32 dwMemorySize, 11 | __int16 wPassessLimit); 12 | 13 | #endif -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/test/test/vfasmcore.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/test/test/vfasmcore.lib -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/tools/lib.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/tools/lib.exe -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/tools/link.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/tools/link.exe -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/tools/mspdb80.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/VFASMCORE/tools/mspdb80.dll -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/VFASMCORE/vfasmcore.h: -------------------------------------------------------------------------------- 1 | #ifndef _VFASMCORE_H_ 2 | #define _VFASMCORE_H_ 3 | 4 | #define EXTERN_IMPORT extern "C" _declspec(dllimport) 5 | 6 | EXTERN_IMPORT __int32 RunFasmCore( 7 | const char* lpInPutFile, 8 | const char* lpOutPutFile, 9 | const char* lpSymbolsFile, 10 | __int32 dwMemorySize, 11 | __int16 wPassessLimit); 12 | 13 | #endif -------------------------------------------------------------------------------- /tools/Flat Assembler/SOURCE/WIN32/FASM.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/SOURCE/WIN32/FASM.EXE -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/DOS/LOADER.INC: -------------------------------------------------------------------------------- 1 | 2 | segment loader use16 3 | 4 | init: 5 | 6 | mov ax,1687h 7 | int 2Fh 8 | or ax,ax ; DPMI installed? 9 | jnz short no_dpmi 10 | test bl,1 ; 32-bit programs supported? 11 | jz short no_dpmi 12 | mov word [cs:mode_switch],di 13 | mov word [cs:mode_switch+2],es 14 | mov bx,si ; allocate memory for DPMI data 15 | mov ah,48h 16 | int 21h 17 | jnc init_protected_mode 18 | init_failed: 19 | call init_error 20 | db 'error: DPMI initialization failed.',0Dh,0Ah,0 21 | no_dpmi: 22 | call init_error 23 | db 'error: 32-bit DPMI services are not available.',0Dh,0Ah,0 24 | init_error: 25 | pop si 26 | push cs 27 | pop ds 28 | display_error: 29 | lodsb 30 | test al,al 31 | jz short error_finish 32 | mov dl,al 33 | mov ah,2 34 | int 21h 35 | jmp short display_error 36 | error_finish: 37 | mov ax,4CFFh 38 | int 21h 39 | init_protected_mode: 40 | mov es,ax 41 | mov ds,[ds:2Ch] 42 | mov ax,1 43 | call far [cs:mode_switch] ; switch to protected mode 44 | jc init_failed 45 | mov cx,1 46 | xor ax,ax 47 | int 31h ; allocate descriptor for code 48 | jc init_failed 49 | mov si,ax 50 | xor ax,ax 51 | int 31h ; allocate descriptor for data 52 | jc init_failed 53 | mov di,ax 54 | mov dx,cs 55 | lar cx,dx 56 | shr cx,8 57 | or cx,0C000h 58 | mov bx,si 59 | mov ax,9 60 | int 31h ; set code descriptor access rights 61 | jc init_failed 62 | mov dx,ds 63 | lar cx,dx 64 | shr cx,8 65 | or cx,0C000h 66 | mov bx,di 67 | int 31h ; set data descriptor access rights 68 | jc init_failed 69 | mov ecx,main 70 | shl ecx,4 71 | mov dx,cx 72 | shr ecx,16 73 | mov ax,7 74 | int 31h ; set data descriptor base address 75 | jc init_failed 76 | mov bx,si 77 | int 31h ; set code descriptor base address 78 | jc init_failed 79 | mov cx,0FFFFh 80 | mov dx,0FFFFh 81 | mov ax,8 ; set segment limit to 4 GB 82 | int 31h 83 | jc init_failed 84 | mov bx,di 85 | int 31h 86 | jc init_failed 87 | mov ax,ds 88 | mov ds,di 89 | mov [psp_selector],es 90 | mov [environment_selector],ax 91 | cli 92 | mov ss,di 93 | mov esp,stack_top 94 | sti 95 | mov es,di 96 | xor eax,eax 97 | mov [memory_handles_count],eax 98 | push si 99 | push start 100 | retf 101 | 102 | mode_switch dd ? 103 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/DOS/PREPSRC.ASM: -------------------------------------------------------------------------------- 1 | 2 | format MZ 3 | heap 0 4 | stack 8000h 5 | entry loader:init 6 | 7 | include 'loader.inc' 8 | 9 | segment main use32 10 | 11 | start: 12 | 13 | call get_params 14 | jnc make_dump 15 | 16 | mov esi,_usage 17 | call display_string 18 | mov ax,4C02h 19 | int 21h 20 | 21 | make_dump: 22 | call preprocessed_source 23 | mov ax,4C00h 24 | int 21h 25 | 26 | error: 27 | mov esi,_error_prefix 28 | call display_string 29 | pop esi 30 | call display_string 31 | mov esi,_error_suffix 32 | call display_string 33 | mov ax,4C00h 34 | int 21h 35 | 36 | get_params: 37 | push ds 38 | mov ds,[psp_selector] 39 | mov esi,81h 40 | mov edi,params 41 | find_param: 42 | lodsb 43 | cmp al,20h 44 | je find_param 45 | cmp al,0Dh 46 | je all_params 47 | or al,al 48 | jz all_params 49 | cmp [es:input_file],0 50 | jne get_output_file 51 | mov [es:input_file],edi 52 | jmp process_param 53 | get_output_file: 54 | cmp [es:output_file],0 55 | jne bad_params 56 | mov [es:output_file],edi 57 | process_param: 58 | cmp al,22h 59 | je string_param 60 | copy_param: 61 | stosb 62 | lodsb 63 | cmp al,20h 64 | je param_end 65 | cmp al,0Dh 66 | je param_end 67 | or al,al 68 | jz param_end 69 | jmp copy_param 70 | string_param: 71 | lodsb 72 | cmp al,22h 73 | je string_param_end 74 | cmp al,0Dh 75 | je param_end 76 | or al,al 77 | jz param_end 78 | stosb 79 | jmp string_param 80 | bad_params_value: 81 | stc 82 | ret 83 | param_end: 84 | dec esi 85 | string_param_end: 86 | xor al,al 87 | stosb 88 | jmp find_param 89 | all_params: 90 | xor al,al 91 | stosb 92 | pop ds 93 | cmp [input_file],0 94 | je bad_params 95 | cmp [output_file],0 96 | je bad_params 97 | clc 98 | ret 99 | bad_params: 100 | stc 101 | ret 102 | 103 | include 'system.inc' 104 | 105 | include '..\prepsrc.inc' 106 | 107 | _usage db 'preprocessed source dumper for flat assembler',0Dh,0Ah 108 | db 'usage: prepsrc ',0Dh,0Ah 109 | db 0 110 | _error_prefix db 'error: ',0 111 | _error_suffix db '.',0Dh,0Ah,0 112 | 113 | input_file dd 0 114 | output_file dd 0 115 | 116 | psp_selector dw ? 117 | environment_selector dw ? 118 | 119 | memory_handles_count dd ? 120 | memory_handles rd 400h 121 | 122 | params rb 1000h 123 | 124 | segment buffer_segment 125 | 126 | buffer = (buffer_segment-main) shl 4 127 | 128 | db 1000h dup ? 129 | 130 | segment stack_segment 131 | 132 | stack_bottom = (stack_segment-main) shl 4 133 | 134 | db 4000h dup ? 135 | 136 | stack_top = stack_bottom + $ 137 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/DOS/SYMBOLS.ASM: -------------------------------------------------------------------------------- 1 | 2 | format MZ 3 | heap 0 4 | stack 8000h 5 | entry loader:init 6 | 7 | include 'loader.inc' 8 | 9 | segment main use32 10 | 11 | start: 12 | 13 | call get_params 14 | jnc make_dump 15 | 16 | mov esi,_usage 17 | call display_string 18 | mov ax,4C02h 19 | int 21h 20 | 21 | make_dump: 22 | call symbols 23 | mov ax,4C00h 24 | int 21h 25 | 26 | error: 27 | mov esi,_error_prefix 28 | call display_string 29 | pop esi 30 | call display_string 31 | mov esi,_error_suffix 32 | call display_string 33 | mov ax,4C00h 34 | int 21h 35 | 36 | get_params: 37 | push ds 38 | mov ds,[psp_selector] 39 | mov esi,81h 40 | mov edi,params 41 | find_param: 42 | lodsb 43 | cmp al,20h 44 | je find_param 45 | cmp al,0Dh 46 | je all_params 47 | or al,al 48 | jz all_params 49 | cmp [es:input_file],0 50 | jne get_output_file 51 | mov [es:input_file],edi 52 | jmp process_param 53 | get_output_file: 54 | cmp [es:output_file],0 55 | jne bad_params 56 | mov [es:output_file],edi 57 | process_param: 58 | cmp al,22h 59 | je string_param 60 | copy_param: 61 | stosb 62 | lodsb 63 | cmp al,20h 64 | je param_end 65 | cmp al,0Dh 66 | je param_end 67 | or al,al 68 | jz param_end 69 | jmp copy_param 70 | string_param: 71 | lodsb 72 | cmp al,22h 73 | je string_param_end 74 | cmp al,0Dh 75 | je param_end 76 | or al,al 77 | jz param_end 78 | stosb 79 | jmp string_param 80 | bad_params_value: 81 | stc 82 | ret 83 | param_end: 84 | dec esi 85 | string_param_end: 86 | xor al,al 87 | stosb 88 | jmp find_param 89 | all_params: 90 | xor al,al 91 | stosb 92 | pop ds 93 | cmp [input_file],0 94 | je bad_params 95 | cmp [output_file],0 96 | je bad_params 97 | clc 98 | ret 99 | bad_params: 100 | stc 101 | ret 102 | 103 | include 'system.inc' 104 | 105 | include '..\symbols.inc' 106 | 107 | _usage db 'symbols dumper for flat assembler',0Dh,0Ah 108 | db 'usage: symbols ',0Dh,0Ah 109 | db 0 110 | _error_prefix db 'error: ',0 111 | _error_suffix db '.',0Dh,0Ah,0 112 | 113 | input_file dd 0 114 | output_file dd 0 115 | 116 | input dd ? 117 | output_buffer dd ? 118 | output_handle dd ? 119 | 120 | psp_selector dw ? 121 | environment_selector dw ? 122 | 123 | memory_handles_count dd ? 124 | memory_handles rd 400h 125 | 126 | params rb 1000h 127 | 128 | segment buffer_segment 129 | 130 | buffer = (buffer_segment-main) shl 4 131 | 132 | db 1000h dup ? 133 | 134 | segment stack_segment 135 | 136 | stack_bottom = (stack_segment-main) shl 4 137 | 138 | db 4000h dup ? 139 | 140 | stack_top = stack_bottom + $ 141 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/DOS/SYSTEM.INC: -------------------------------------------------------------------------------- 1 | 2 | display_string: 3 | lods byte [esi] 4 | or al,al 5 | jz string_end 6 | mov dl,al 7 | mov ah,2 8 | int 21h 9 | jmp display_string 10 | string_end: 11 | ret 12 | alloc: 13 | push ebx esi edi 14 | mov cx,ax 15 | shr eax,16 16 | mov bx,ax 17 | mov ax,501h 18 | int 31h 19 | jc dpmi_allocation_failed 20 | mov ax,bx 21 | shl eax,16 22 | mov ax,cx 23 | mov edx,main 24 | shl edx,4 25 | sub eax,edx 26 | mov bx,si 27 | shl ebx,16 28 | mov bx,di 29 | mov ecx,[memory_handles_count] 30 | inc [memory_handles_count] 31 | shl ecx,3 32 | add ecx,memory_handles 33 | mov [ecx],eax 34 | mov [ecx+4],ebx 35 | pop edi esi ebx 36 | clc 37 | ret 38 | dpmi_allocation_failed: 39 | pop edi esi ebx 40 | stc 41 | ret 42 | free: 43 | push ebx esi edi 44 | mov esi,memory_handles 45 | mov ecx,[memory_handles_count] 46 | find_memory_handle: 47 | cmp eax,[esi] 48 | je memory_handle_found 49 | add esi,8 50 | loop find_memory_handle 51 | pop edi esi 52 | ret 53 | memory_handle_found: 54 | mov ebx,[esi+4] 55 | dec [memory_handles_count] 56 | dec ecx 57 | jz free_memory 58 | remove_memory_handle: 59 | mov edx,[esi+8] 60 | mov edi,[esi+8+4] 61 | mov [esi],edx 62 | mov [esi+4],edi 63 | add esi,8 64 | loop remove_memory_handle 65 | free_memory: 66 | mov esi,ebx 67 | shr esi,16 68 | mov di,bx 69 | mov ax,502h 70 | int 31h 71 | pop edi esi ebx 72 | ret 73 | open: 74 | push esi edi ebp 75 | call adapt_path 76 | mov ax,716Ch 77 | mov bx,100000b 78 | mov dx,1 79 | xor cx,cx 80 | xor si,si 81 | call dos_int 82 | jnc open_done 83 | cmp ax,7100h 84 | je old_open 85 | stc 86 | jmp open_done 87 | old_open: 88 | mov ax,3D00h 89 | xor dx,dx 90 | call dos_int 91 | open_done: 92 | mov bx,ax 93 | pop ebp edi esi 94 | ret 95 | adapt_path: 96 | mov esi,edx 97 | mov edi,buffer 98 | copy_path: 99 | lodsb 100 | cmp al,'/' 101 | jne path_char_ok 102 | mov al,'\' 103 | path_char_ok: 104 | stosb 105 | or al,al 106 | jnz copy_path 107 | ret 108 | dos_int: 109 | push 0 0 0 110 | pushw buffer_segment buffer_segment 111 | stc 112 | pushfw 113 | push eax 114 | push ecx 115 | push edx 116 | push ebx 117 | push 0 118 | push ebp 119 | push esi 120 | push edi 121 | mov ax,300h 122 | mov bx,21h 123 | xor cx,cx 124 | mov edi,esp 125 | push es ss 126 | pop es 127 | int 31h 128 | pop es 129 | mov edi,[esp] 130 | mov esi,[esp+4] 131 | mov ebp,[esp+8] 132 | mov ebx,[esp+10h] 133 | mov edx,[esp+14h] 134 | mov ecx,[esp+18h] 135 | mov ah,[esp+20h] 136 | add esp,32h 137 | sahf 138 | mov eax,[esp-32h+1Ch] 139 | ret 140 | create: 141 | push esi edi ebp 142 | call adapt_path 143 | mov ax,716Ch 144 | mov bx,100001b 145 | mov dx,10010b 146 | xor cx,cx 147 | xor si,si 148 | xor di,di 149 | call dos_int 150 | jnc create_done 151 | cmp ax,7100h 152 | je old_create 153 | stc 154 | jmp create_done 155 | old_create: 156 | mov ah,3Ch 157 | xor cx,cx 158 | xor dx,dx 159 | call dos_int 160 | create_done: 161 | mov bx,ax 162 | pop ebp edi esi 163 | ret 164 | write: 165 | push edx esi edi ebp 166 | mov ebp,ecx 167 | mov esi,edx 168 | write_loop: 169 | mov ecx,1000h 170 | sub ebp,1000h 171 | jnc do_write 172 | add ebp,1000h 173 | mov ecx,ebp 174 | xor ebp,ebp 175 | do_write: 176 | push ecx 177 | mov edi,buffer 178 | shr ecx,2 179 | rep movsd 180 | mov ecx,[esp] 181 | and ecx,11b 182 | rep movsb 183 | pop ecx 184 | mov ah,40h 185 | xor dx,dx 186 | call dos_int 187 | or ebp,ebp 188 | jnz write_loop 189 | pop ebp edi esi edx 190 | ret 191 | read: 192 | push edx esi edi ebp 193 | mov ebp,ecx 194 | mov edi,edx 195 | read_loop: 196 | mov ecx,1000h 197 | sub ebp,1000h 198 | jnc do_read 199 | add ebp,1000h 200 | mov ecx,ebp 201 | xor ebp,ebp 202 | do_read: 203 | push ecx 204 | mov ah,3Fh 205 | xor dx,dx 206 | call dos_int 207 | cmp ax,cx 208 | jne eof 209 | mov esi,buffer 210 | mov ecx,[esp] 211 | shr ecx,2 212 | rep movsd 213 | pop ecx 214 | and ecx,11b 215 | rep movsb 216 | or ebp,ebp 217 | jnz read_loop 218 | read_done: 219 | pop ebp edi esi edx 220 | ret 221 | eof: 222 | pop ecx 223 | stc 224 | jmp read_done 225 | close: 226 | mov ah,3Eh 227 | int 21h 228 | ret 229 | lseek: 230 | mov ah,42h 231 | mov ecx,edx 232 | shr ecx,16 233 | int 21h 234 | pushf 235 | shl edx,16 236 | popf 237 | mov dx,ax 238 | mov eax,edx 239 | ret 240 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/LIBC/CCALL.INC: -------------------------------------------------------------------------------- 1 | 2 | macro ccall proc,[arg] 3 | { common 4 | push ebp 5 | mov ebp,esp 6 | local size 7 | size = 0 8 | if ~ arg eq 9 | forward 10 | size = size + 4 11 | common 12 | sub esp,size 13 | end if 14 | and esp,-16 15 | if ~ arg eq 16 | add esp,size 17 | reverse 18 | pushd arg 19 | common 20 | end if 21 | call proc 22 | leave } 23 | 24 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/LIBC/LISTING.ASM: -------------------------------------------------------------------------------- 1 | 2 | format ELF 3 | public main 4 | 5 | include 'ccall.inc' 6 | 7 | section '.text' executable align 16 8 | 9 | main: 10 | mov ecx,[esp+4] 11 | mov [argc],ecx 12 | mov ebx,[esp+8] 13 | mov [argv],ebx 14 | 15 | mov [display_handle],1 16 | 17 | call get_params 18 | jnc make_listing 19 | 20 | mov esi,_usage 21 | call display_string 22 | ccall exit,2 23 | 24 | make_listing: 25 | call listing 26 | ccall exit,0 27 | 28 | error: 29 | mov [display_handle],2 30 | mov esi,_error_prefix 31 | call display_string 32 | pop esi 33 | call display_string 34 | mov esi,_error_suffix 35 | call display_string 36 | ccall exit,0 37 | 38 | get_params: 39 | mov ecx,[argc] 40 | mov ebx,[argv] 41 | add ebx,4 42 | dec ecx 43 | jz bad_params 44 | get_param: 45 | mov esi,[ebx] 46 | mov al,[esi] 47 | cmp al,'-' 48 | je option_param 49 | cmp [input_file],0 50 | jne get_output_file 51 | mov [input_file],esi 52 | jmp next_param 53 | get_output_file: 54 | cmp [output_file],0 55 | jne bad_params 56 | mov [output_file],esi 57 | jmp next_param 58 | option_param: 59 | inc esi 60 | lodsb 61 | cmp al,'a' 62 | je addresses_option 63 | cmp al,'A' 64 | je addresses_option 65 | cmp al,'b' 66 | je bytes_per_line_option 67 | cmp al,'B' 68 | je bytes_per_line_option 69 | bad_params: 70 | stc 71 | ret 72 | addresses_option: 73 | cmp byte [esi],0 74 | jne bad_params 75 | mov [show_addresses],1 76 | jmp next_param 77 | bytes_per_line_option: 78 | cmp byte [esi],0 79 | jne get_bytes_per_line_setting 80 | dec ecx 81 | jz bad_params 82 | add ebx,4 83 | mov esi,[ebx] 84 | get_bytes_per_line_setting: 85 | call get_option_value 86 | or edx,edx 87 | jz bad_params 88 | cmp edx,1000 89 | ja bad_params 90 | mov [code_bytes_per_line],edx 91 | next_param: 92 | add ebx,4 93 | dec ecx 94 | jnz get_param 95 | cmp [input_file],0 96 | je bad_params 97 | cmp [output_file],0 98 | je bad_params 99 | clc 100 | ret 101 | get_option_value: 102 | xor eax,eax 103 | mov edx,eax 104 | get_option_digit: 105 | lodsb 106 | cmp al,20h 107 | je option_value_ok 108 | cmp al,0Dh 109 | je option_value_ok 110 | or al,al 111 | jz option_value_ok 112 | sub al,30h 113 | jc invalid_option_value 114 | cmp al,9 115 | ja invalid_option_value 116 | imul edx,10 117 | jo invalid_option_value 118 | add edx,eax 119 | jc invalid_option_value 120 | jmp get_option_digit 121 | option_value_ok: 122 | dec esi 123 | clc 124 | ret 125 | invalid_option_value: 126 | stc 127 | ret 128 | 129 | include 'system.inc' 130 | 131 | include '..\listing.inc' 132 | 133 | section '.data' writeable align 4 134 | 135 | input_file dd 0 136 | output_file dd 0 137 | code_bytes_per_line dd 16 138 | show_addresses db 0 139 | 140 | line_break db 0Dh,0Ah 141 | 142 | _usage db 'listing generator for flat assembler',0Dh,0Ah 143 | db 'usage: listing ',0Dh,0Ah 144 | db 'optional settings:',0Dh,0Ah 145 | db ' -a show target addresses for assembled code',0Dh,0Ah 146 | db ' -b set the amount of bytes listed per line',0Dh,0Ah 147 | db 0 148 | _error_prefix db 'error: ',0 149 | _error_suffix db '.',0Dh,0Ah,0 150 | 151 | section '.bss' writeable align 4 152 | 153 | argc dd ? 154 | argv dd ? 155 | 156 | input dd ? 157 | assembled_code dd ? 158 | assembled_code_length dd ? 159 | code_end dd ? 160 | code_offset dd ? 161 | code_length dd ? 162 | output_handle dd ? 163 | output_buffer dd ? 164 | current_source_file dd ? 165 | current_source_line dd ? 166 | source dd ? 167 | source_length dd ? 168 | maximum_address_length dd ? 169 | address_start dd ? 170 | last_listed_address dd ? 171 | 172 | display_handle dd ? 173 | character db ? 174 | 175 | params rb 1000h 176 | characters rb 100h 177 | buffer rb 1000h 178 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/LIBC/PREPSRC.ASM: -------------------------------------------------------------------------------- 1 | 2 | format ELF 3 | public main 4 | 5 | include 'ccall.inc' 6 | 7 | section '.text' executable align 16 8 | 9 | main: 10 | mov ecx,[esp+4] 11 | mov [argc],ecx 12 | mov ebx,[esp+8] 13 | mov [argv],ebx 14 | 15 | mov [display_handle],1 16 | 17 | call get_params 18 | jnc make_dump 19 | 20 | mov esi,_usage 21 | call display_string 22 | ccall exit,2 23 | 24 | make_dump: 25 | call preprocessed_source 26 | ccall exit,0 27 | 28 | error: 29 | mov [display_handle],2 30 | mov esi,_error_prefix 31 | call display_string 32 | pop esi 33 | call display_string 34 | mov esi,_error_suffix 35 | call display_string 36 | ccall exit,0 37 | 38 | get_params: 39 | mov ecx,[argc] 40 | mov ebx,[argv] 41 | add ebx,4 42 | dec ecx 43 | jz bad_params 44 | get_param: 45 | mov esi,[ebx] 46 | mov al,[esi] 47 | cmp [input_file],0 48 | jne get_output_file 49 | mov [input_file],esi 50 | jmp next_param 51 | get_output_file: 52 | cmp [output_file],0 53 | jne bad_params 54 | mov [output_file],esi 55 | jmp next_param 56 | bad_params: 57 | stc 58 | ret 59 | next_param: 60 | add ebx,4 61 | dec ecx 62 | jnz get_param 63 | cmp [input_file],0 64 | je bad_params 65 | cmp [output_file],0 66 | je bad_params 67 | clc 68 | ret 69 | 70 | include 'system.inc' 71 | 72 | include '..\prepsrc.inc' 73 | 74 | section '.data' writeable align 4 75 | 76 | input_file dd 0 77 | output_file dd 0 78 | 79 | _usage db 'preprocessed source dumper for flat assembler',0Dh,0Ah 80 | db 'usage: prepsrc ',0Dh,0Ah 81 | db 0 82 | _error_prefix db 'error: ',0 83 | _error_suffix db '.',0Dh,0Ah,0 84 | 85 | section '.bss' writeable align 4 86 | 87 | argc dd ? 88 | argv dd ? 89 | 90 | display_handle dd ? 91 | character db ? 92 | 93 | params rb 1000h 94 | buffer rb 1000h 95 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/LIBC/SYMBOLS.ASM: -------------------------------------------------------------------------------- 1 | 2 | format ELF 3 | public main 4 | 5 | include 'ccall.inc' 6 | 7 | section '.text' executable align 16 8 | 9 | main: 10 | mov ecx,[esp+4] 11 | mov [argc],ecx 12 | mov ebx,[esp+8] 13 | mov [argv],ebx 14 | 15 | mov [display_handle],1 16 | 17 | call get_params 18 | jnc make_dump 19 | 20 | mov esi,_usage 21 | call display_string 22 | ccall exit,2 23 | 24 | make_dump: 25 | call symbols 26 | ccall exit,0 27 | 28 | error: 29 | mov [display_handle],2 30 | mov esi,_error_prefix 31 | call display_string 32 | pop esi 33 | call display_string 34 | mov esi,_error_suffix 35 | call display_string 36 | ccall exit,0 37 | 38 | get_params: 39 | mov ecx,[argc] 40 | mov ebx,[argv] 41 | add ebx,4 42 | dec ecx 43 | jz bad_params 44 | get_param: 45 | mov esi,[ebx] 46 | mov al,[esi] 47 | cmp [input_file],0 48 | jne get_output_file 49 | mov [input_file],esi 50 | jmp next_param 51 | get_output_file: 52 | cmp [output_file],0 53 | jne bad_params 54 | mov [output_file],esi 55 | jmp next_param 56 | bad_params: 57 | stc 58 | ret 59 | next_param: 60 | add ebx,4 61 | dec ecx 62 | jnz get_param 63 | cmp [input_file],0 64 | je bad_params 65 | cmp [output_file],0 66 | je bad_params 67 | clc 68 | ret 69 | 70 | include 'system.inc' 71 | 72 | include '..\symbols.inc' 73 | 74 | section '.data' writeable align 4 75 | 76 | input_file dd 0 77 | output_file dd 0 78 | 79 | _usage db 'symbols dumper for flat assembler',0Dh,0Ah 80 | db 'usage: symbols ',0Dh,0Ah 81 | db 0 82 | _error_prefix db 'error: ',0 83 | _error_suffix db '.',0Dh,0Ah,0 84 | 85 | section '.bss' writeable align 4 86 | 87 | input dd ? 88 | output_buffer dd ? 89 | output_handle dd ? 90 | 91 | argc dd ? 92 | argv dd ? 93 | 94 | display_handle dd ? 95 | character db ? 96 | 97 | params rb 1000h 98 | buffer rb 1000h 99 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/LIBC/SYSTEM.INC: -------------------------------------------------------------------------------- 1 | 2 | extrn malloc 3 | extrn getenv 4 | extrn fopen 5 | extrn fclose 6 | extrn fread 7 | extrn fwrite 8 | extrn fseek 9 | extrn ftell 10 | extrn time 11 | extrn exit 12 | extrn 'free' as libc_free 13 | extrn 'write' as libc_write 14 | 15 | alloc: 16 | ccall malloc,eax 17 | test eax,eax 18 | jz allocation_failed 19 | clc 20 | ret 21 | allocation_failed: 22 | stc 23 | ret 24 | free: 25 | ccall libc_free,eax 26 | ret 27 | display_string: 28 | lodsb 29 | or al,al 30 | jz string_displayed 31 | mov dl,al 32 | call display_character 33 | jmp display_string 34 | string_displayed: 35 | ret 36 | display_character: 37 | mov [character],dl 38 | ccall libc_write,[display_handle],character,1 39 | ret 40 | open: 41 | push esi edi ebp 42 | call adapt_path 43 | ccall fopen,buffer,open_mode 44 | pop ebp edi esi 45 | or eax,eax 46 | jz file_error 47 | mov ebx,eax 48 | clc 49 | ret 50 | adapt_path: 51 | mov esi,edx 52 | mov edi,buffer 53 | copy_path: 54 | lods byte [esi] 55 | cmp al,'\' 56 | jne path_char_ok 57 | mov al,'/' 58 | path_char_ok: 59 | stos byte [edi] 60 | or al,al 61 | jnz copy_path 62 | cmp edi,buffer+1000h 63 | ja not_enough_memory 64 | ret 65 | create: 66 | push esi edi ebp 67 | call adapt_path 68 | ccall fopen,buffer,create_mode 69 | pop ebp edi esi 70 | or eax,eax 71 | jz file_error 72 | mov ebx,eax 73 | clc 74 | ret 75 | close: 76 | ccall fclose,ebx 77 | ret 78 | read: 79 | push ebx ecx edx esi edi 80 | ccall fread,edx,1,ecx,ebx 81 | pop edi esi edx ecx ebx 82 | cmp eax,ecx 83 | jne file_error 84 | clc 85 | ret 86 | file_error: 87 | stc 88 | ret 89 | write: 90 | push ebx ecx edx esi edi 91 | ccall fwrite,edx,1,ecx,ebx 92 | pop edi esi edx ecx ebx 93 | cmp eax,ecx 94 | jne file_error 95 | clc 96 | ret 97 | lseek: 98 | push ebx 99 | movzx eax,al 100 | ccall fseek,ebx,edx,eax 101 | mov ebx,[esp] 102 | ccall ftell,ebx 103 | pop ebx 104 | ret 105 | 106 | open_mode db 'r',0 107 | create_mode db 'w',0 108 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/PREPSRC.INC: -------------------------------------------------------------------------------- 1 | 2 | preprocessed_source: 3 | mov edx,[input_file] 4 | call open 5 | jc input_not_found 6 | mov al,2 7 | xor edx,edx 8 | call lseek 9 | cmp eax,30h 10 | jb invalid_input 11 | push eax 12 | call alloc 13 | jc not_enough_memory 14 | push eax 15 | xor al,al 16 | xor edx,edx 17 | call lseek 18 | mov ecx,[esp+4] 19 | mov edx,[esp] 20 | call read 21 | jc reading_error 22 | pop eax ecx 23 | cmp dword [eax],1A736166h 24 | jne invalid_input 25 | mov esi,[eax+32] 26 | add esi,eax 27 | mov ebp,[eax+36] 28 | add ebp,esi 29 | mov edi,eax 30 | push eax 31 | preprocessed_to_text: 32 | cmp esi,ebp 33 | jae conversion_done 34 | add esi,16 35 | xor dl,dl 36 | convert_preprocessed_line: 37 | lodsb 38 | cmp al,1Ah 39 | je copy_symbol 40 | cmp al,22h 41 | je copy_symbol 42 | cmp al,3Bh 43 | je preprocessor_symbols 44 | or al,al 45 | jz line_converted 46 | stosb 47 | xor dl,dl 48 | jmp convert_preprocessed_line 49 | copy_symbol: 50 | or dl,dl 51 | jz space_ok 52 | mov byte [edi],20h 53 | inc edi 54 | space_ok: 55 | cmp al,22h 56 | je quoted 57 | lodsb 58 | movzx ecx,al 59 | rep movsb 60 | or dl,-1 61 | jmp convert_preprocessed_line 62 | quoted: 63 | mov al,27h 64 | stosb 65 | lodsd 66 | mov ecx,eax 67 | jecxz quoted_copied 68 | copy_quoted: 69 | lodsb 70 | stosb 71 | cmp al,27h 72 | jne quote_ok 73 | stosb 74 | quote_ok: 75 | loop copy_quoted 76 | quoted_copied: 77 | mov al,27h 78 | stosb 79 | or dl,-1 80 | jmp convert_preprocessed_line 81 | preprocessor_symbols: 82 | mov al,3Bh 83 | stosb 84 | jmp copy_symbol 85 | line_converted: 86 | mov ax,0A0Dh 87 | stosw 88 | jmp preprocessed_to_text 89 | conversion_done: 90 | mov edx,[output_file] 91 | call create 92 | jc writing_error 93 | pop edx 94 | mov ecx,edi 95 | sub ecx,edx 96 | call write 97 | jc writing_error 98 | call close 99 | ret 100 | 101 | not_enough_memory: 102 | call error 103 | db 'not enough memory to load the required data',0 104 | input_not_found: 105 | call error 106 | db 'the input file was not found',0 107 | reading_error: 108 | call error 109 | db 'some error occured while trying to read file',0 110 | writing_error: 111 | call error 112 | db 'some error occured while trying to write file',0 113 | invalid_input: 114 | call error 115 | db 'input file is not a recognized assembly information format',0 116 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/README.TXT: -------------------------------------------------------------------------------- 1 | 2 | This directory contains some tools, which extract various types of information 3 | from the symbolic information file generated by flat assembler, and present 4 | them in a human-readable form. 5 | 6 | The listing tool creates a listing of assembled code - this tool needs to be 7 | executed in the exact configuration, in which the assembly was taking place. 8 | All the source files and the output file aswell must not have been moved or 9 | modified - if any of them was altered before generating the listing, it is 10 | going to contain garbage instead of useful information. For example, if you 11 | assembled the file with the command like: 12 | 13 | fasm example.asm example.exe -s example.fas 14 | 15 | you should generate listing by immediately running this command from the same 16 | directory: 17 | 18 | listing example.fas example.lst 19 | 20 | In addition, the "-a" switch is recommended to use in the case of executable 21 | formats, as it allows to get the run-time addresses for all the assembled code 22 | and data. 23 | 24 | The preprocessed source and symbols dump tools are simpler ones - they only 25 | need the symbolic information file as input and generate proper output text 26 | regardless of the availability of other files. 27 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/WIN32/PREPSRC.ASM: -------------------------------------------------------------------------------- 1 | 2 | format PE console 4.0 3 | entry start 4 | 5 | include 'win32a.inc' 6 | 7 | section '.data' data readable writeable 8 | 9 | _usage db 'preprocessed source dumper for flat assembler',0Dh,0Ah 10 | db 'usage: prepsrc ',0Dh,0Ah 11 | db 0 12 | _error_prefix db 'error: ',0 13 | _error_suffix db '.',0Dh,0Ah,0 14 | 15 | input_file dd 0 16 | output_file dd 0 17 | 18 | display_handle dd ? 19 | bytes_count dd ? 20 | 21 | params rb 1000h 22 | 23 | section '.text' code readable executable 24 | 25 | start: 26 | 27 | mov [display_handle],STD_OUTPUT_HANDLE 28 | 29 | call get_params 30 | jnc make_dump 31 | 32 | mov esi,_usage 33 | call display_string 34 | invoke ExitProcess,2 35 | 36 | make_dump: 37 | call preprocessed_source 38 | invoke ExitProcess,0 39 | 40 | error: 41 | mov [display_handle],STD_ERROR_HANDLE 42 | mov esi,_error_prefix 43 | call display_string 44 | pop esi 45 | call display_string 46 | mov esi,_error_suffix 47 | call display_string 48 | invoke ExitProcess,1 49 | 50 | get_params: 51 | invoke GetCommandLine 52 | mov esi,eax 53 | mov edi,params 54 | find_command_start: 55 | lodsb 56 | cmp al,20h 57 | je find_command_start 58 | cmp al,22h 59 | je skip_quoted_name 60 | skip_name: 61 | lodsb 62 | cmp al,20h 63 | je find_param 64 | or al,al 65 | jz all_params 66 | jmp skip_name 67 | skip_quoted_name: 68 | lodsb 69 | cmp al,22h 70 | je find_param 71 | or al,al 72 | jz all_params 73 | jmp skip_quoted_name 74 | find_param: 75 | lodsb 76 | cmp al,20h 77 | je find_param 78 | cmp al,0Dh 79 | je all_params 80 | or al,al 81 | jz all_params 82 | cmp [input_file],0 83 | jne get_output_file 84 | mov [input_file],edi 85 | jmp process_param 86 | get_output_file: 87 | cmp [output_file],0 88 | jne bad_params 89 | mov [output_file],edi 90 | process_param: 91 | cmp al,22h 92 | je string_param 93 | copy_param: 94 | stosb 95 | lodsb 96 | cmp al,20h 97 | je param_end 98 | cmp al,0Dh 99 | je param_end 100 | or al,al 101 | jz param_end 102 | jmp copy_param 103 | string_param: 104 | lodsb 105 | cmp al,22h 106 | je string_param_end 107 | cmp al,0Dh 108 | je param_end 109 | or al,al 110 | jz param_end 111 | stosb 112 | jmp string_param 113 | bad_params: 114 | stc 115 | ret 116 | param_end: 117 | dec esi 118 | string_param_end: 119 | xor al,al 120 | stosb 121 | jmp find_param 122 | all_params: 123 | cmp [input_file],0 124 | je bad_params 125 | cmp [output_file],0 126 | je bad_params 127 | clc 128 | ret 129 | 130 | include 'system.inc' 131 | 132 | include '..\prepsrc.inc' 133 | 134 | section '.idata' import data readable writeable 135 | 136 | library kernel32,'KERNEL32.DLL' 137 | 138 | include 'api\kernel32.inc' 139 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/WIN32/SYMBOLS.ASM: -------------------------------------------------------------------------------- 1 | 2 | format PE console 4.0 3 | entry start 4 | 5 | include 'win32a.inc' 6 | 7 | section '.data' data readable writeable 8 | 9 | _usage db 'symbols dumper for flat assembler',0Dh,0Ah 10 | db 'usage: symbols ',0Dh,0Ah 11 | db 0 12 | _error_prefix db 'error: ',0 13 | _error_suffix db '.',0Dh,0Ah,0 14 | 15 | input_file dd 0 16 | output_file dd 0 17 | 18 | input dd ? 19 | output_buffer dd ? 20 | output_handle dd ? 21 | 22 | display_handle dd ? 23 | bytes_count dd ? 24 | 25 | params rb 1000h 26 | 27 | section '.text' code readable executable 28 | 29 | start: 30 | 31 | mov [display_handle],STD_OUTPUT_HANDLE 32 | 33 | call get_params 34 | jnc make_dump 35 | 36 | mov esi,_usage 37 | call display_string 38 | invoke ExitProcess,2 39 | 40 | make_dump: 41 | call symbols 42 | invoke ExitProcess,0 43 | 44 | error: 45 | mov [display_handle],STD_ERROR_HANDLE 46 | mov esi,_error_prefix 47 | call display_string 48 | pop esi 49 | call display_string 50 | mov esi,_error_suffix 51 | call display_string 52 | invoke ExitProcess,1 53 | 54 | get_params: 55 | invoke GetCommandLine 56 | mov esi,eax 57 | mov edi,params 58 | find_command_start: 59 | lodsb 60 | cmp al,20h 61 | je find_command_start 62 | cmp al,22h 63 | je skip_quoted_name 64 | skip_name: 65 | lodsb 66 | cmp al,20h 67 | je find_param 68 | or al,al 69 | jz all_params 70 | jmp skip_name 71 | skip_quoted_name: 72 | lodsb 73 | cmp al,22h 74 | je find_param 75 | or al,al 76 | jz all_params 77 | jmp skip_quoted_name 78 | find_param: 79 | lodsb 80 | cmp al,20h 81 | je find_param 82 | cmp al,0Dh 83 | je all_params 84 | or al,al 85 | jz all_params 86 | cmp [input_file],0 87 | jne get_output_file 88 | mov [input_file],edi 89 | jmp process_param 90 | get_output_file: 91 | cmp [output_file],0 92 | jne bad_params 93 | mov [output_file],edi 94 | process_param: 95 | cmp al,22h 96 | je string_param 97 | copy_param: 98 | stosb 99 | lodsb 100 | cmp al,20h 101 | je param_end 102 | cmp al,0Dh 103 | je param_end 104 | or al,al 105 | jz param_end 106 | jmp copy_param 107 | string_param: 108 | lodsb 109 | cmp al,22h 110 | je string_param_end 111 | cmp al,0Dh 112 | je param_end 113 | or al,al 114 | jz param_end 115 | stosb 116 | jmp string_param 117 | bad_params: 118 | stc 119 | ret 120 | param_end: 121 | dec esi 122 | string_param_end: 123 | xor al,al 124 | stosb 125 | jmp find_param 126 | all_params: 127 | cmp [input_file],0 128 | je bad_params 129 | cmp [output_file],0 130 | je bad_params 131 | clc 132 | ret 133 | 134 | include 'system.inc' 135 | 136 | include '..\symbols.inc' 137 | 138 | section '.idata' import data readable writeable 139 | 140 | library kernel32,'KERNEL32.DLL' 141 | 142 | include 'api\kernel32.inc' 143 | -------------------------------------------------------------------------------- /tools/Flat Assembler/TOOLS/WIN32/SYSTEM.INC: -------------------------------------------------------------------------------- 1 | 2 | display_string: 3 | invoke GetStdHandle,[display_handle] 4 | mov edx,eax 5 | mov edi,esi 6 | or ecx,-1 7 | xor al,al 8 | repne scasb 9 | neg ecx 10 | sub ecx,2 11 | invoke WriteFile,edx,esi,ecx,bytes_count,0 12 | retn 13 | alloc: 14 | invoke VirtualAlloc,0,eax,MEM_COMMIT,PAGE_READWRITE 15 | or eax,eax 16 | jz allocation_error 17 | clc 18 | retn 19 | allocation_error: 20 | stc 21 | retn 22 | free: 23 | invoke VirtualFree,eax,0,MEM_RELEASE 24 | retn 25 | open: 26 | invoke CreateFile,edx,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,0,0 27 | cmp eax,-1 28 | je file_error 29 | mov ebx,eax 30 | clc 31 | retn 32 | file_error: 33 | stc 34 | retn 35 | create: 36 | invoke CreateFile,edx,GENERIC_WRITE,0,0,CREATE_ALWAYS,0,0 37 | cmp eax,-1 38 | je file_error 39 | mov ebx,eax 40 | clc 41 | retn 42 | write: 43 | invoke WriteFile,ebx,edx,ecx,bytes_count,0 44 | or eax,eax 45 | jz file_error 46 | clc 47 | retn 48 | read: 49 | push ecx 50 | invoke ReadFile,ebx,edx,ecx,bytes_count,0 51 | pop edx 52 | or eax,eax 53 | jz file_error 54 | cmp edx,[bytes_count] 55 | jne file_error 56 | clc 57 | retn 58 | close: 59 | invoke CloseHandle,ebx 60 | retn 61 | lseek: 62 | movzx eax,al 63 | invoke SetFilePointer,ebx,edx,0,eax 64 | cmp eax,-1 65 | je file_error 66 | retn 67 | -------------------------------------------------------------------------------- /tools/Flat Assembler/readme_EN.txt: -------------------------------------------------------------------------------- 1 | ================================= 2 | tishion 2012/06/08 3 | 4 | Please visit the following sites to obtain it. 5 | http://flatassembler.net/ -------------------------------------------------------------------------------- /tools/Flat Assembler/readme_ZH.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/Flat Assembler/readme_ZH.txt -------------------------------------------------------------------------------- /tools/mtools/README: -------------------------------------------------------------------------------- 1 | Compilation 2 | ----------- 3 | 4 | To compile mtools on Unix, first type ./configure, then make. To 5 | compile mtools on a Bebox, refer to README.BEBOX. 6 | 7 | Doc 8 | --- 9 | 10 | The most uptodate doc of this package is the texinfo doc. Type 'make 11 | info' to get online info doc, and 'make dvi ; dvips mtools.dvi' to get 12 | a printed copy. The info doc has a concept index. Make use of it. 13 | You may get an info copy using the following command 'make info'. 14 | This can then be viewed using emacs' info mode, or using a standalone 15 | info viewer. 16 | Man pages are still present, but contain less information. 17 | If you do not have the necessary tools to view the texinfo doc, you 18 | may also find it on the World Wide Web at the following locations: 19 | http://ftp.gnu.org/software/mtools/manual/mtools.html 20 | 21 | Compiler 22 | -------- 23 | 24 | Mtools should be compiled with an Ansi compiler, preferably gcc 25 | 26 | Authors 27 | ------- 28 | 29 | Original code (versions through 2.0.7?) by Emmet P. Gray (Texas, USA). 30 | Viktor Dukhovni (at Princeton, USA) had major input into v2.0. 31 | 32 | Since 2.0.7: maintained primarily and until now by Alain Knaff 33 | (Luxembourg) and David Niemi (Reston, Virginia, USA). 34 | 35 | Please report bugs to the mtools mailing list at mtools@www.tux.org. 36 | Before reporting any problems, check whether they have already been 37 | fixed in the Alpha patches at http://mtools.linux.lu and 38 | http://www.tux.org/pub/knaff 39 | 40 | You may subscribe to the mtools mailing list by sending a message 41 | containing 'subscribe mtools' in its body to majordomo@www.tux.org 42 | 43 | Since March 3rd 2009, mtools is now officially a GNU package. Special 44 | thanks to Emmet P. Gray, the original developer of the program, who 45 | supported dubbing mtools a GNU package. 46 | 47 | Current Status 48 | -------------- 49 | 50 | Stable release 4.0.x 51 | 52 | Copying 53 | ------- 54 | Mtools is a GNU program published under GPL v3.0 (code) and GNU Free 55 | Documentation License. 56 | 57 | Most files of mtools bears a notice describing the copyright, and 58 | whether it is covered by GPL or GFDL 59 | 60 | GPL: 61 | 62 | debian/control Copyright 2007 Alain Knaff 63 | 64 | debian/changelog Copyright 2007-2009 Alain Knaff 65 | 66 | NEWS Copyright 1995 David C. Niemi 67 | Copyright 1995-2009 Alain Knaff 68 | 69 | mtools.spec Copyright 2003-2005,2007-2009 Alain Knaff 70 | 71 | 72 | GFDL: 73 | 74 | README Copyright 1996-1998,2001,2002,2009 Alain Knaff. 75 | Release.notes Copyright 1995 Alain Knaff 76 | 77 | -------------------------------------------------------------------------------- /tools/mtools/mcopy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/mtools/mcopy.exe -------------------------------------------------------------------------------- /tools/mtools/mformat.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/mtools/mformat.exe -------------------------------------------------------------------------------- /tools/mtools/mmd.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tishion/PiscisOS/0ff2bb30265749e9ea42a11e04e44e301e848506/tools/mtools/mmd.exe --------------------------------------------------------------------------------