6 Commits

Author SHA1 Message Date
d538e7b4e8 Blocks: add 3 models 2025-07-26 21:24:07 +03:00
6aff7b8c02 Kernel: Fixed bug in iso9660
Fixed a bug of outputting erroneous file names in iso9660 (not juliet)
2025-06-23 12:54:22 +02:00
e0d724286f Kernel: Fixed magic numbers and constants in iso9660 2025-06-23 12:54:22 +02:00
03dcc2051f FASM: Remove SVN tagged versions (#268)
- Delete SVN tagged versions `1.68` and `1.71`. We do not need to retain historic FASM versions in KolibriOS source code.

(Work towards #75, point 1)

Reviewed-on: KolibriOS/kolibrios#268
Reviewed-by: Burer <burer@noreply.localhost>
Co-authored-by: Andrew <dent.ace@gmail.com>
Co-committed-by: Andrew <dent.ace@gmail.com>
2025-06-23 09:08:41 +02:00
03111f5e99 programs: Optimize GIFs (Pt 2) (#238)
Lossless optimization of GIF image files.
Processed with `gifsicle -O3`(extreme) or `gifsicle --no-loopcount --no-comments` (when only minimal adjustment is permitted).
LZW stream optimized with `flexigif -p -f -a=1`. Methods selected to ensure optimal compression with final KPACK step, since better LZW may reduce LZMA used in bundling programs; evaluated with: `xz --format=lzma --check=none --lzma1=mode=normal,dict=64KiB,nice=273,lc=3,lp=0,pb=2 -k -c in.gif > out.lzma`
QA with [GIF Inspector](https://movableink.github.io/gif-inspector/) and via code review.

📦 Program graphics (compiled or included with software):
- Slimmed `demos/free3d04 `, saved 1489 bytes, ~4%.
- Slimmed `media/midamp/` 3 files, saving 131 bytes, average ~4%.
- Slimmed `testing/cpuid/trunk/cyrix.gif`, saved 25 bytes, ~3%.

📖 Documentation only artwork (distributed outside a program):
- Slimmed `Beat/Beat.gif`, saved 29 bytes, ~0.5%.

🥀 Old vestigial images, no longer used (pending deletion):
- Slimmed `demos/3detx60b/` 2 files, saving 762 bytes, average ~5%.

Reviewed-on: KolibriOS/kolibrios#238
Reviewed-by: Burer <burer@noreply.localhost>
Reviewed-by: Ivan B <dunkaist@noreply.localhost>
Co-authored-by: Andrew <dent.ace@gmail.com>
Co-committed-by: Andrew <dent.ace@gmail.com>
2025-06-18 07:04:52 +02:00
4cc716458a programs/games: Optimize GIFs (#235)
Lossless optimization of GIF image files.
Processed with `gifsicle -O3`(extreme) or `gifsicle --no-loopcount` (when only minimal adjustment is permitted).
LZW stream optimized with `flexigif -p -f -a=1`. Methods selected to ensure optimal compression with final KPACK step, since better LZW may reduce LZMA used in bundling programs, using: `xz --format=lzma --check=none --lzma1=mode=normal,dict=64KiB,nice=273,lc=3,lp=0,pb=2 -k -c in.gif > out.lzma`
QA with [GIF Inspector](https://movableink.github.io/gif-inspector/) and via code review.

📦 Program graphics (compiled or included with software):
- Slimmed `almaz/aniall.gif`, saving 380 bytes, ~9%.
- Slimmed `invaders/` 21 files, saving 1232 bytes, average ~3%.
- Slimmed `megamaze/orientg2.gif`, saving 986 bytes, ~31%.
- Slimmed `phenix/objects.gif`, saving 24 bytes, ~2%.

🥀 Old vestigial images, no longer used:
- Deleted `almaz/explode1.gif`, 4865 bytes.

Reviewed-on: KolibriOS/kolibrios#235
Reviewed-by: Burer <burer@noreply.localhost>
Reviewed-by: Ivan B <dunkaist@noreply.localhost>
Co-authored-by: Andrew <dent.ace@gmail.com>
Co-committed-by: Andrew <dent.ace@gmail.com>
2025-06-17 23:54:40 +02:00
81 changed files with 797 additions and 60598 deletions

View File

@@ -809,7 +809,8 @@ iglobal
align 4 align 4
iso9660_user_functions: iso9660_user_functions:
dd iso9660_free dd iso9660_free
dd (.end - $ - 4) / 4 dd (.end - .first) / 4
.first:
dd iso9660_Read dd iso9660_Read
dd iso9660_ReadFolder dd iso9660_ReadFolder
dd 0 dd 0
@@ -828,7 +829,7 @@ iso9660_create_partition:
; esi -> DISK structure ; esi -> DISK structure
; out: ; out:
; eax -> iso9660 partition structure, 0 = not iso9660 ; eax -> iso9660 partition structure, 0 = not iso9660
cmp dword [esi + DISK.MediaInfo.SectorSize], 2048 ; cd disks cmp dword [esi + DISK.MediaInfo.SectorSize], CDBlockSize
jnz .fail_disk_sector jnz .fail_disk_sector
push ebx push ebx
@@ -838,7 +839,7 @@ iso9660_create_partition:
add [esp], eax add [esp], eax
mov dword[esp + 4], 0 ; base encoding - ascii mov dword[esp + 4], 0 ; base encoding - ascii
add ebx, 2048 add ebx, CDBlockSize
.new_descr: .new_descr:
inc dword[esp] inc dword[esp]
; read 16 sector, check header of descriptor ; read 16 sector, check header of descriptor
@@ -899,7 +900,7 @@ iso9660_create_partition:
; copy data on struct ; copy data on struct
add esp, 4 add esp, 4
pop dword[eax + ISO9660.type_encoding] pop dword[eax + ISO9660.type_encoding]
mov dword[eax + ISO9660.lba_size], 2048 ;TODO mov dword[eax + ISO9660.lba_size], CDBlockSize
pop dword[eax + ISO9660.primary_descr] pop dword[eax + ISO9660.primary_descr]
mov ecx, dword[ebx + ISO9660_PRIMARY_DESCRIPTOR.root_dir_record + ISO9660_DIRECTORY_RECORD.lba] mov ecx, dword[ebx + ISO9660_PRIMARY_DESCRIPTOR.root_dir_record + ISO9660_DIRECTORY_RECORD.lba]
@@ -928,12 +929,10 @@ iso9660_create_partition:
; IN: eax - ptr PARTITION ; IN: eax - ptr PARTITION
; OUT: - ; OUT: -
; SAVE: esi, edi ; SAVE: esi, edi
; Function free PARTITION struct and all object this structure ; The function frees the PARTITION structure and all its elements from memory
iso9660_free: iso9660_free:
jmp free jmp free
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; ISO9660 external functions ; ISO9660 external functions
; in: ; in:
@@ -946,14 +945,14 @@ iso9660_Read:
sub esp, 4 ; for ptr on memory page sub esp, 4 ; for ptr on memory page
call iso9660_find_file call iso9660_find_file
mov esi, eax mov esi, eax
mov edi, [ebx + 16] ; ptr to programm buffer mov edi, [ebx + f70s0arg.buf] ; ptr to programm buffer
test byte[esi + ISO9660_DIRECTORY_RECORD.flags], 10b ; check dir test byte[esi + ISO9660_DIRECTORY_RECORD.flags], 10b ; check dir
jnz iso9660_find_file.not_found jnz iso9660_find_file.not_found
; check offset (offset <= size) ; check offset (offset <= size)
mov edx, [ebx + 4] ; low offset mov edx, [ebx + f70s0arg.offset.lo] ; low offset
cmp dword[ebx + 8], 0 ; high offset cmp dword[ebx + f70s0arg.offset.hi], 0 ; high offset
jnz iso9660_find_file.bad_offset ; error offset > max size jnz iso9660_find_file.bad_offset ; error offset > max size
cmp edx, [esi + ISO9660_DIRECTORY_RECORD.data_length] cmp edx, [esi + ISO9660_DIRECTORY_RECORD.data_length]
@@ -961,39 +960,48 @@ iso9660_Read:
; good file - copy file data ; good file - copy file data
sub esp, 4*4 sub esp, 4*4
mov dword[esp + 3*4], 0
mov [esp + 1*4], edx ; offset to start copy virtual at esp
mov dword[esp], 0 ; count copping byte .var_count_copied_data dd ?
.var_offset_copy dd ?
.var_size_copy_data dd ?
.var_fs_err dd ?
.var_buffer dd ?
end virtual
mov dword[.var_fs_err], 0 ; ENOERR
mov [.var_offset_copy], edx ; offset to start copy
mov dword[.var_count_copied_data], 0 ; count copping byte
; check end offset (offset+size_buff <= size) ; check end offset (offset+size_buff <= size)
mov ecx, [esi + ISO9660_DIRECTORY_RECORD.data_length] mov ecx, [esi + ISO9660_DIRECTORY_RECORD.data_length]
mov eax, [ebx + 12] ;size copy data - buffer size mov eax, [ebx + f70s0arg.count] ;size copy data - buffer size
sub ecx, edx sub ecx, edx
mov [esp + 2*4], eax ; set count copy = buffer size mov [.var_size_copy_data], eax ; set count copy = buffer size
cmp ecx, eax ; max copy size > buffer size cmp ecx, eax ; max copy size > buffer size
jae @f jae @f
mov [esp + 2*4], ecx mov [.var_size_copy_data], ecx
mov dword[esp + 3*4], ERROR_END_OF_FILE mov dword[.var_fs_err], ERROR_END_OF_FILE
@@: @@:
mov esi, [esi + ISO9660_DIRECTORY_RECORD.lba] mov esi, [esi + ISO9660_DIRECTORY_RECORD.lba]
; [esp + 4*4] = ptr temp buffer ; [esp + 4*4] = ptr temp buffer
; [esp+3*4] = fs err code [esp+2*4] = size copy data ; [esp+3*4] = fs err code [esp+2*4] = size copy data
; [esp+1*4] = offset copy [esp] = count copying data ; [esp+1*4] = offset copy [esp] = count copied data
.full_size: .full_size:
; check offset mod sector_size = 0 ; check offset mod sector_size = 0
test edx, not -2048 test edx, not -CDBlockSize
jz .first_align ; no creat buffer for first align jz .first_align
mov ebx, [esp + 4*4] mov ebx, [.var_buffer]
; read sector ; read sector
push edx push edx
and edx, -2048 and edx, -CDBlockSize
shr edx, BSF 2048 shr edx, BSF CDBlockSize
mov eax, esi ; ISO9660_DIRECTORY_RECORD.lba mov eax, esi ; ISO9660_DIRECTORY_RECORD.lba
add eax, edx add eax, edx
mov ecx, 1 mov ecx, 1
@@ -1010,18 +1018,18 @@ iso9660_Read:
mov ecx, edx mov ecx, edx
neg edx neg edx
and edx, not -2048 and edx, not -CDBlockSize
and ecx, not -2048 and ecx, not -CDBlockSize
; create new offset ; create new offset
add dword[esp + 1*4], not -2048 add dword[.var_offset_copy], not -CDBlockSize
and dword[esp + 1*4], -2048 and dword[.var_offset_copy], -CDBlockSize
cmp dword[esp + 2*4], edx ; copy data > read in this sector cmp dword[.var_size_copy_data], edx ;copy data > read in this sector
jae @f jae @f
mov edx, [esp + 2*4] mov edx, [.var_size_copy_data]
@@: @@:
sub dword[esp + 2*4], edx sub dword[.var_size_copy_data], edx
add dword[esp], edx add dword[.var_count_copied_data], edx
;DEBUGF 1, "K : iso c=%x d=%x Hz\n", ecx, edx ;DEBUGF 1, "K : iso c=%x d=%x Hz\n", ecx, edx
push esi push esi
@@ -1035,22 +1043,22 @@ iso9660_Read:
;stdcall kernel_free, ebx ;stdcall kernel_free, ebx
.first_align: .first_align:
mov ecx, [esp + 2*4] mov ecx, [.var_size_copy_data]
and ecx, -2048 and ecx, -CDBlockSize
cmp ecx, 2048 cmp ecx, CDBlockSize
jb .copy_finish_block jb .copy_finish_block
mov eax, [esp + 1*4] mov eax, [.var_offset_copy]
shr eax, BSF 2048 shr eax, BSF CDBlockSize
; copy main block ; copy main block
mov ebx, edi mov ebx, edi
add edi, ecx add edi, ecx
sub dword[esp + 2*4], ecx sub dword[.var_size_copy_data], ecx
add dword[esp + 1*4], ecx add dword[.var_offset_copy], ecx
add dword[esp], ecx add dword[.var_count_copied_data], ecx
shr ecx, BSF 2048 shr ecx, BSF CDBlockSize
xor edx, edx xor edx, edx
add eax, esi ; ISO9660_DIRECTORY_RECORD.lba add eax, esi ; ISO9660_DIRECTORY_RECORD.lba
; ebx - buffer ; ebx - buffer
@@ -1063,14 +1071,14 @@ iso9660_Read:
.copy_finish_block: .copy_finish_block:
cmp dword[esp + 2*4], 0 cmp dword[.var_size_copy_data], 0
jz .end_align ; creat buffer for end read sector jz .end_align
mov ebx, [esp + 4*4] mov ebx, [.var_buffer]
;copy finish block ;copy finish block
mov eax, [esp + 1*4] mov eax, [.var_offset_copy]
shr eax, BSF 2048 shr eax, BSF CDBlockSize
xor edx, edx xor edx, edx
mov ecx, 1 mov ecx, 1
@@ -1084,16 +1092,16 @@ iso9660_Read:
jnz .err_disk_1 jnz .err_disk_1
mov esi, ebx mov esi, ebx
mov ecx, [esp + 2*4] mov ecx, [.var_size_copy_data]
add dword[esp], ecx add dword[.var_count_copied_data], ecx
rep movsb rep movsb
;stdcall kernel_free, ebx ;stdcall kernel_free, ebx
.end_align: .end_align:
; set ebx size copy data ; set ebx size copy data
mov ebx, [esp] mov ebx, [.var_count_copied_data]
mov esi, [esp + 3*4] mov esi, [.var_fs_err]
add esp, 4*4 add esp, 4*4
call kernel_free call kernel_free
@@ -1124,13 +1132,13 @@ iso9660_ReadFolder:
test byte[eax + ISO9660_DIRECTORY_RECORD.flags], 10b ; check dir test byte[eax + ISO9660_DIRECTORY_RECORD.flags], 10b ; check dir
jz iso9660_find_file.not_found jz iso9660_find_file.not_found
mov edi, [ebx + 16] ; buffer mov edi, [ebx + f70s1arg.buf] ; buffer
push dword[ebx + 16] push dword[ebx + f70s1arg.buf]
push dword[ebx + 4] ; first file push dword[ebx + f70s1arg.start_idx] ; first file
push dword[ebx + 8] ; encoding push dword[ebx + f70s1arg.encoding] ; encoding
push dword 0 push dword 0
push dword 0 push dword 0
push dword[ebx + 12] ; count file push dword[ebx + f70s1arg.count] ; count files
push dword[eax + ISO9660_DIRECTORY_RECORD.data_length] push dword[eax + ISO9660_DIRECTORY_RECORD.data_length]
push dword[eax + ISO9660_DIRECTORY_RECORD.lba] push dword[eax + ISO9660_DIRECTORY_RECORD.lba]
@@ -1142,17 +1150,28 @@ iso9660_ReadFolder:
; [esp + 24] - first item 0..(2^32 -1) ; [esp + 24] - first item 0..(2^32 -1)
; [esp + 28] - user buffer ; [esp + 28] - user buffer
; edi - user buffer ; edi - user buffer
virtual at esp
.var_lba dd ?
.var_size dd ?
.var_max_count dd ?
.var_counter dd ?
.var_all_count_files dd ?
.var_encoding dd ?
.var_first_item dd ?
.var_user_buffer dd ?
.var_buffer dd ?
end virtual
; set header(32 byte) in buffer ; set header(32 byte) in buffer
mov dword[edi], 1 mov dword[edi], 1
add edi, 32 ;set on first item add edi, sizeof.bdfe_hdr ;set on first item
; loop copy file info and name ; loop copy file info and name
.read_sector: .read_sector:
mov ebx, [esp + 32] mov ebx, [.var_buffer]
mov ecx, 1 mov ecx, 1
xor edx, edx xor edx, edx
mov eax, [esp] mov eax, [.var_lba]
; ebx - buffer ; ebx - buffer
; edx:eax - num sector ; edx:eax - num sector
; ebp - PARTITION ; ebp - PARTITION
@@ -1165,27 +1184,27 @@ iso9660_ReadFolder:
jz .next_sector jz .next_sector
; inc counter all files ; inc counter all files
inc dword[esp + 16] inc dword[.var_all_count_files]
; check copy ; check copy
mov eax, [esp + 24] mov eax, [.var_first_item]
cmp [esp + 16], eax cmp [.var_all_count_files], eax
jbe .skip jbe .skip
mov eax, [esp + 12] mov eax, [.var_counter]
cmp [esp + 8], eax cmp [.var_max_count], eax
je .skip je .skip
inc dword[esp + 12] inc dword[.var_counter]
mov eax, ebx mov eax, ebx
mov ecx, edi mov ecx, edi
call iso9660_GetFileInfo.copy_file_info call iso9660_GetFileInfo.copy_file_info
; copy encoding ; copy encoding
movzx eax, byte[esp + 20] movzx eax, byte[.var_encoding]
mov [edi + 4], eax mov [edi + 4], eax
add edi, 40 add edi, bdfe.name
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; copy name ; copy name
push ebx push ebx
@@ -1219,9 +1238,9 @@ iso9660_ReadFolder:
cmp eax, 2 cmp eax, 2
je .ascii2utf16 je .ascii2utf16
@@: @@:
sub ecx, 1 ; CF + ZF sub ecx, 1 ; CF
jbe @f jb @f
movsd movsb
cmp byte[esi], ';' cmp byte[esi], ';'
jne @b jne @b
@@: @@:
@@ -1298,31 +1317,31 @@ iso9660_ReadFolder:
movzx ecx, byte[ebx] movzx ecx, byte[ebx]
add ebx, ecx add ebx, ecx
test ebx, 2048 test ebx, CDBlockSize
jnz .next_sector jnz .next_sector
mov eax, ebx mov eax, ebx
and eax, not -2048 and eax, not -CDBlockSize
cmp eax, [esp + 4] cmp eax, [.var_size]
jb .new_file jb .new_file
mov eax, [esp + 12] mov eax, [.var_counter]
cmp eax, [esp + 8] cmp eax, [.var_max_count]
jb .new_file jb .new_file
jmp .end_loop jmp .end_loop
.next_sector: .next_sector:
inc dword[esp] inc dword[.var_lba]
sub dword[esp + 4], 2048 sub dword[.var_size], CDBlockSize
ja .read_sector ja .read_sector
.end_loop: .end_loop:
mov ecx, [esp + 28] mov ecx, [.var_user_buffer]
mov ebx, [esp + 12] mov ebx, [.var_counter]
mov [ecx + 4], ebx mov [ecx + bdfe_hdr.read_cnt], ebx
mov esi, [esp + 16] mov esi, [.var_all_count_files]
mov [ecx + 8], esi mov [ecx + bdfe_hdr.total_cnt], esi
mov esi, [esp + 8] ; max count mov esi, [.var_max_count] ; max count
; free buffer ; free buffer
add esp, 8*4 add esp, 8*4
call kernel_free call kernel_free
@@ -1334,11 +1353,11 @@ iso9660_ReadFolder:
@@: @@:
ret ret
.err_disk: .err_disk:
mov ecx, [esp + 28] mov ecx, [.var_user_buffer]
mov ebx, [esp + 12] mov ebx, [.var_counter]
mov [ecx + 4], ebx mov [ecx + bdfe_hdr.read_cnt], ebx
mov esi, [esp + 16] mov esi, [.var_all_count_files]
mov [ecx + 8], esi mov [ecx + bdfe_hdr.total_cnt], esi
; free buffer ; free buffer
add esp, 8*4 add esp, 8*4
call kernel_free call kernel_free
@@ -1361,13 +1380,13 @@ iso9660_GetFileInfo:
sub esp, 4 ; for ptr on memory page sub esp, 4 ; for ptr on memory page
call iso9660_find_file call iso9660_find_file
mov ecx, [ebx + 16] ; buffer mov ecx, [ebx + f70s5arg.buf] ; buffer
call .copy_file_info call .copy_file_info
call kernel_free call kernel_free
xor eax, eax xor eax, eax
mov ebx, 40 mov ebx, bdfe.name
ret ret
; IN: eax -> ISO966_DIRECTORY_RECORD ; IN: eax -> ISO966_DIRECTORY_RECORD
@@ -1375,11 +1394,11 @@ iso9660_GetFileInfo:
; destruct: edx ; destruct: edx
.copy_file_info: .copy_file_info:
; copy size ; copy size
mov [ecx + 36], dword 0 mov [ecx + bdfe.size.hi], dword 0
mov edx, [eax + ISO9660_DIRECTORY_RECORD.data_length] mov edx, [eax + ISO9660_DIRECTORY_RECORD.data_length]
mov [ecx + 32], edx mov [ecx + bdfe.size.lo], edx
; copy flags(dir of file) ; copy flags(dir or file)
xor edx, edx xor edx, edx
or dl, 000001b or dl, 000001b
test byte[eax + ISO9660_DIRECTORY_RECORD.flags], 1b ; check hidden flag test byte[eax + ISO9660_DIRECTORY_RECORD.flags], 1b ; check hidden flag
@@ -1389,11 +1408,11 @@ iso9660_GetFileInfo:
test byte[eax + ISO9660_DIRECTORY_RECORD.flags], 10b ; check dir test byte[eax + ISO9660_DIRECTORY_RECORD.flags], 10b ; check dir
jz @f jz @f
or dl, 10000b ; dir flag or dl, 10000b ; dir flag
mov dword[ecx + 32], 0 ; size = zero mov dword[ecx + bdfe.size.lo], 0 ; size = zero
@@: @@:
mov [ecx], edx mov [ecx], edx ; set bdfe.attr
; copy date creat file ; copying the file creation date
movzx edx, byte[eax + ISO9660_DIRECTORY_RECORD.date_time] movzx edx, byte[eax + ISO9660_DIRECTORY_RECORD.date_time]
add edx, 1900 ; year add edx, 1900 ; year
shl edx, 8 shl edx, 8
@@ -1402,26 +1421,26 @@ iso9660_GetFileInfo:
shl edx, 8 shl edx, 8
mov dl, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 2] ;day mov dl, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 2] ;day
mov [ecx + 12], edx mov [ecx + bdfe.cdate], edx
mov [ecx + 20], edx mov [ecx + bdfe.adate], edx
mov [ecx + 28], edx mov [ecx + bdfe.mdate], edx
; copy time creat file ; copying the file creation time
movzx edx, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 3] ;hour movzx edx, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 3] ;hour
shl edx, 8 shl edx, 8
mov dl, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 4] ;minute mov dl, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 4] ;minute
shl edx, 8 shl edx, 8
mov dl, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 5] ;second mov dl, byte[eax + ISO9660_DIRECTORY_RECORD.date_time + 5] ;second
mov [ecx + 8], edx mov [ecx + bdfe.ctime], edx
mov [ecx + 16], edx mov [ecx + bdfe.atime], edx
mov [ecx + 24], edx mov [ecx + bdfe.mtime], edx
ret ret
.rootdir: .rootdir:
mov edi, [ebx + 16] ; edi = buffer mov edi, [ebx + f70s5arg.buf] ; edi = buffer
; copy flags (dir) ; copy flags (partition dir)
mov byte [edi], 8 mov byte [edi], 8
; copy size drive ; copy size drive
mov eax, dword[ebp + PARTITION.Length+DQ.lo] mov eax, dword[ebp + PARTITION.Length+DQ.lo]
@@ -1431,12 +1450,12 @@ iso9660_GetFileInfo:
bsf ecx, ecx bsf ecx, ecx
shld edx, eax, cl shld edx, eax, cl
shl eax, cl shl eax, cl
mov [edi + 32], eax ; bdfe.size.lo mov [edi + bdfe.size.lo], eax
mov [edi + 36], edx ; bdfe.size.hi mov [edi + bdfe.size.hi], edx
mov eax, [ebx + 8] mov eax, [ebx + f70s5arg.xflags]
; copy encoding ; copy encoding
mov [edi + 4], eax mov [edi + bdfe.nameenc], eax
; check encoding on fs struct ; check encoding on fs struct
test eax, eax ; check f70s5arg.xflags test eax, eax ; check f70s5arg.xflags
jz .no_name jz .no_name
@@ -1464,8 +1483,8 @@ iso9660_GetFileInfo:
jnz .err_read_part jnz .err_read_part
add esi, ISO9660_PRIMARY_DESCRIPTOR.VolumeName add esi, ISO9660_PRIMARY_DESCRIPTOR.VolumeName
mov edx, [edi + 4] mov edx, [edi + bdfe.nameenc]
add edi, 40 ; offset partition name add edi, bdfe.name ; offset partition name
mov ecx, 32 mov ecx, 32
call iso9660_copy_name call iso9660_copy_name
@@ -1473,7 +1492,7 @@ iso9660_GetFileInfo:
call kernel_free call kernel_free
.no_name: .no_name:
xor eax, eax xor eax, eax
mov ebx, 40 mov ebx, bdfe.name
ret ret
.err_read_part: .err_read_part:
call kernel_free call kernel_free
@@ -1492,7 +1511,7 @@ iso9660_GetFileInfo:
; [esp + 4] - ptr to memory page for destruct ; [esp + 4] - ptr to memory page for destruct
iso9660_find_file: iso9660_find_file:
stdcall kernel_alloc, 4096 ; stdcall kernel_alloc, PAGE_SIZE ;
test eax, eax test eax, eax
jz .err_get_memory jz .err_get_memory
@@ -1507,13 +1526,21 @@ iso9660_find_file:
; [esp] - sector num [esp + 4] - size dir ; [esp] - sector num [esp + 4] - size dir
; [esp + 8] - ebx [esp + 16] - buffer ; [esp + 8] - ebx [esp + 16] - buffer
; get size root dir (not record size) ; get size root dir (not record size)
virtual at esp
.var_sector_num dd ?
.var_size_dir dd ?
.var_save_ebx dd ?
.var_eip dd ?
.var_buffer dd ?
end virtual
.read_sector: .read_sector:
; get sector for directory ; get sector for directory
mov edi, [esp + 16] mov edi, [.var_buffer]
mov ebx, [esp + 16] mov ebx, [.var_buffer]
mov ecx, 1 mov ecx, 1
xor edx, edx xor edx, edx
mov eax, [esp] mov eax, [.var_sector_num]
; ebx - buffer ; ebx - buffer
; edx:eax - num sector ; edx:eax - num sector
; ebp - PARTITION ; ebp - PARTITION
@@ -1522,7 +1549,7 @@ iso9660_find_file:
test eax, eax test eax, eax
jnz .err_disk_1 jnz .err_disk_1
mov ecx, [esp + 4] mov ecx, [.var_size_dir]
.next_record: .next_record:
; check size ; check size
@@ -1536,7 +1563,7 @@ iso9660_find_file:
movzx edx, byte[edi + ISO9660_DIRECTORY_RECORD.size] movzx edx, byte[edi + ISO9660_DIRECTORY_RECORD.size]
add edi, edx add edi, edx
test edi, 2048 ;worked for allocate of page test edi, CDBlockSize ;worked for allocate of page
jnz .next_sector jnz .next_sector
sub ecx, edx sub ecx, edx
@@ -1545,9 +1572,9 @@ iso9660_find_file:
jmp .next_record jmp .next_record
.next_sector: .next_sector:
sub dword[esp + 4], 2048 sub dword[.var_size_dir], CDBlockSize
jbe .not_found_2 jbe .not_found_2
inc dword[esp] inc dword[.var_sector_num]
jmp .read_sector jmp .read_sector
.found: .found:
@@ -1557,12 +1584,12 @@ iso9660_find_file:
inc esi inc esi
mov edx, [edi + ISO9660_DIRECTORY_RECORD.lba] mov edx, [edi + ISO9660_DIRECTORY_RECORD.lba]
mov dword[esp], edx mov dword[.var_sector_num], edx
mov edx, [edi + ISO9660_DIRECTORY_RECORD.data_length] mov edx, [edi + ISO9660_DIRECTORY_RECORD.data_length]
mov dword[esp + 4], edx mov dword[.var_size_dir], edx
jmp .read_sector jmp .read_sector
.done: .done:
mov ebx, [esp + 8] mov ebx, [.var_save_ebx]
add esp, 4*3 add esp, 4*3
mov eax, edi mov eax, edi
ret ret
@@ -1591,7 +1618,7 @@ iso9660_find_file:
; errors ; errors
.err_disk_1: .err_disk_1:
; free stack values ; free stack values
mov ebx, [esp + 8] mov ebx, [.var_save_ebx]
add esp, 4*3 add esp, 4*3
.err_disk: .err_disk:
add esp, 4 add esp, 4
@@ -1601,7 +1628,7 @@ iso9660_find_file:
ret ret
.not_found_2: .not_found_2:
mov ebx, [esp + 8] mov ebx, [.var_save_ebx]
add esp, 4*3 add esp, 4*3
.not_found_1: .not_found_1:
add esp, 4 add esp, 4
@@ -1621,7 +1648,7 @@ iso9660_find_file:
.err_get_memory: .err_get_memory:
add esp, 8 ; skip addr return and dword for ptr to buffer add esp, 8 ;skip return address and dword for the buffer pointer
.no_memory: .no_memory:
mov eax, TASKMAN_ERROR_OUT_OF_MEMORY mov eax, TASKMAN_ERROR_OUT_OF_MEMORY
xor ebx, ebx xor ebx, ebx
@@ -1776,4 +1803,3 @@ iso9660_copy_name:
mov word[edi], 0 mov word[edi], 0
@@: @@:
ret ret

View File

@@ -60412,6 +60412,67 @@ dd -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\ 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0
@@: @@:
db 'r1x3x1',0
align 4
dd (@f-$)/24 ;points
dd -1.95, -1.95, 0.0, -1.95, 9.95, 3.0, -1.95, 9.95,\
0.0, -1.95, 9.95, 3.0, -1.95, -1.95, 0.0, -1.95, -1.95,\
3.0, -1.95, 9.95, 3.0, 1.95, -1.95, 3.0, 1.95, 9.95,\
3.0, 1.95, -1.95, 3.0, -1.95, 9.95, 3.0, -1.95, -1.95,\
3.0, 1.95, -1.95, 3.0, 1.95, 9.95, 0.0, 1.95, 9.95,\
3.0, 1.95, 9.95, 0.0, 1.95, -1.95, 3.0, 1.95, -1.95,\
0.0, 1.95, -1.95, 0.0, 1.25, -1.25, 0.0, 1.95, 9.95,\
0.0, 1.95, -1.95, 0.0, -1.25, -1.25, 0.0, 1.25, -1.25,\
0.0, -1.25, -1.25, 0.0, -1.95, -1.95, 0.0, -1.25, 9.25,\
0.0, -1.95, -1.95, 0.0, -1.25, -1.25, 0.0, 1.95, -1.95,\
0.0, 1.25, 9.25, 0.0, 1.95, 9.95, 0.0, 1.25, -1.25,\
0.0, -1.25, 9.25, 0.0, 1.95, 9.95, 0.0, 1.25, 9.25,\
0.0, -1.25, 9.25, 0.0, -1.95, 9.95, 0.0, 1.95, 9.95,\
0.0, -1.95, 9.95, 0.0, -1.25, 9.25, 0.0, -1.95, -1.95,\
0.0, -1.95, -1.95, 0.0, 1.95, -1.95, 3.0, -1.95, -1.95,\
3.0, 1.95, -1.95, 3.0, -1.95, -1.95, 0.0, 1.95, -1.95,\
0.0, 1.95, 9.95, 0.0, -1.95, 9.95, 3.0, 1.95, 9.95,\
3.0, -1.95, 9.95, 3.0, 1.95, 9.95, 0.0, -1.95, 9.95,\
0.0, -1.25, -1.25, 1.999, -1.25, 9.25, 0.0, -1.25, 9.25,\
1.999, -1.25, 9.25, 0.0, -1.25, -1.25, 1.999, -1.25, -1.25,\
0.0, -1.25, -1.25, 1.999, 1.25, 9.25, 1.999, 1.25, -1.25,\
1.999, 1.25, 9.25, 1.999, -1.25, -1.25, 1.999, -1.25, 9.25,\
1.999, 1.25, -1.25, 0.0, 1.25, 9.25, 1.999, 1.25, 9.25,\
0.0, 1.25, 9.25, 1.999, 1.25, -1.25, 0.0, 1.25, -1.25,\
1.999, -1.25, 9.25, 0.0, 1.25, 9.25, 1.999, -1.25, 9.25,\
1.999, 1.25, 9.25, 1.999, -1.25, 9.25, 0.0, 1.25, 9.25,\
0.0, 1.25, -1.25, 0.0, -1.25, -1.25, 1.999, 1.25, -1.25,\
1.999, -1.25, -1.25, 1.999, 1.25, -1.25, 0.0, -1.25, -1.25,\
0.0
dd -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,\
0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,\
1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,\
1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\
0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\
1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,\
1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\
0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0
@@:
db 'f1x2x1',0 db 'f1x2x1',0
align 4 align 4
dd (@f-$)/24 ;points dd (@f-$)/24 ;points
@@ -65876,6 +65937,76 @@ dd 0.32144, -0.94693, 0.0, 0.13052, -0.99145, 0.0, 0.44229, -0.89687, 0.0,\
-0.7071, -0.70711, 0.0, -0.38269, -0.92388, 0.0, -0.70711, -0.70711, 0.0,\ -0.7071, -0.70711, 0.0, -0.38269, -0.92388, 0.0, -0.70711, -0.70711, 0.0,\
-0.38268, -0.92388, 0.0, -0.70711, -0.70711, 0.0, -0.38268, -0.92388, 0.0 -0.38268, -0.92388, 0.0, -0.70711, -0.70711, 0.0, -0.38268, -0.92388, 0.0
@@: @@:
db 'a1x1x2',0
align 4
dd (@f-$)/24 ;points
dd -1.95, -1.95, 0.0, -1.95, 1.95, 3.0, -1.95, 1.95,\
0.0, -1.95, 1.95, 3.0, -1.95, -1.95, 0.0, -1.95, -1.94994,\
6.0, -1.95, -1.94994, 6.0, -1.95, -1.95, 0.0, -1.95, -1.95,\
6.0, -1.95, -1.94994, 6.0, 1.95, -1.95, 6.0, 1.95, -1.94994,\
6.0, 1.95, -1.95, 6.0, -1.95, -1.94994, 6.0, -1.95, -1.95,\
6.0, 1.95, -1.95, 0.0, 1.95, 1.95, 3.0, 1.95, -1.94994,\
6.0, 1.95, -1.95, 0.0, 1.95, -1.94994, 6.0, 1.95, -1.95,\
6.0, 1.95, 1.95, 3.0, 1.95, -1.95, 0.0, 1.95, 1.95,\
0.0, -1.95, -1.95, 0.0, 1.95, -1.95, 6.0, -1.95, -1.95,\
6.0, 1.95, -1.95, 6.0, -1.95, -1.95, 0.0, 1.95, -1.95,\
0.0, 1.95, 1.95, 0.0, -1.95, 1.95, 3.0, 1.95, 1.95,\
3.0, -1.95, 1.95, 3.0, 1.95, 1.95, 0.0, -1.95, 1.95,\
0.0, -1.95, 1.95, 3.0, 1.95, -1.94994, 6.0, 1.95, 1.95,\
3.0, 1.95, -1.94994, 6.0, -1.95, 1.95, 3.0, -1.95, -1.94994,\
6.0, 1.95, -1.95, 0.0, 1.25, -1.25, 0.0, 1.95, 1.95,\
0.0, 1.95, -1.95, 0.0, -1.25, -1.25, 0.0, 1.25, -1.25,\
0.0, -1.25, -1.25, 0.0, -1.95, -1.95, 0.0, -1.25, 1.25,\
0.0, -1.95, -1.95, 0.0, -1.25, -1.25, 0.0, 1.95, -1.95,\
0.0, 1.25, 1.25, 0.0, 1.95, 1.95, 0.0, 1.25, -1.25,\
0.0, -1.25, 1.25, 0.0, 1.95, 1.95, 0.0, 1.25, 1.25,\
0.0, -1.25, 1.25, 0.0, -1.95, 1.95, 0.0, 1.95, 1.95,\
0.0, -1.95, 1.95, 0.0, -1.25, 1.25, 0.0, -1.95, -1.95,\
0.0, -1.25, -1.25, 1.999, -1.25, 1.25, 0.0, -1.25, 1.25,\
1.999, -1.25, 1.25, 0.0, -1.25, -1.25, 1.999, -1.25, -1.25,\
0.0, -1.25, -1.25, 1.999, 1.25, 1.25, 1.999, 1.25, -1.25,\
1.999, 1.25, 1.25, 1.999, -1.25, -1.25, 1.999, -1.25, 1.25,\
1.999, 1.25, -1.25, 0.0, 1.25, 1.25, 1.999, 1.25, 1.25,\
0.0, 1.25, 1.25, 1.999, 1.25, -1.25, 0.0, 1.25, -1.25,\
1.999, -1.25, 1.25, 0.0, 1.25, 1.25, 1.999, -1.25, 1.25,\
1.999, 1.25, 1.25, 1.999, -1.25, 1.25, 0.0, 1.25, 1.25,\
0.0, 1.25, -1.25, 0.0, -1.25, -1.25, 1.999, 1.25, -1.25,\
1.999, -1.25, -1.25, 1.999, 1.25, -1.25, 0.0, -1.25, -1.25,\
0.0
dd -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,\
1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,\
1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\
0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\
0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,\
0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,\
0.0, 0.0, 0.60972, 0.79262, 0.0, 0.60972, 0.79262, 0.0, 0.60972,\
0.79262, 0.0, 0.60972, 0.79262, 0.0, 0.60972, 0.79262, 0.0, 0.60972,\
0.79262, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\
0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\
0.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\
-1.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0,\
0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,\
0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,\
0.0
@@:
db 'a1x2x2',0 db 'a1x2x2',0
align 4 align 4
dd (@f-$)/24 ;points dd (@f-$)/24 ;points

View File

@@ -0,0 +1,170 @@
// block name, color, step, coord: x,y,z, rotation: x,y,z
const m1=6740181;
const m2=6650840;
const m3=16777215;
const m4=16757993;
const m5=8454144;
model_list=[
['b1x6x1', m1, 0, 0, -4, 0, 0,0,90],
['b2x6x1', m1, 0, 0, 0, 0, 0,0,90],
['b2x6x1', m1, 0, 0,-12, 0, 0,0,90],
['b2x4x1', m1, 0, 16, 0, 0, 0,0,90],
['b2x4x1', m1, 0, 16,-12, 0, 0,0,90],
['b1x4x1', m1, 0, 16, -4, 0, 0,0,90],
['u1x2x1', m1, 0,-24, -4, 0, 0,0,90],
['u1x2x1', m1, 0,-24, 0, 0, 0,0,90],
['u1x2x1', m1, 0,-24, -8, 0, 0,0,90],
['b2x3x1', m1, 0, 20, -8, 0, 0,0,0],
['t2x3x1', m1, 0, 28, -4, 0, 0,0,0],
['b1x3x1', m2, 0, -8,-16, 0, 0,0,90],
['b1x3x1', m2, 0, -8, 8, 0, 0,0,90],
['b1x3x1', m2, 0, 16, 8, 0, 0,0,90],
['b1x3x1', m2, 0, 16,-16, 0, 0,0,90],
['b1x3x1', m2, 0, 36, -8, 0, 0,0,0],
['b1x2x1', m2, 0, -8, 12, 0, 0,0,90],
['b1x2x1', m2, 0, -8,-20, 0, 0,0,90],
['b1x2x1', m2, 0, 20, 12, 0, 0,0,90],
['b1x2x1', m2, 0, 20,-20, 0, 0,0,90],
['b1x2x1', m2, 0, 16,-24, 0, 0,0,90],
['b1x2x1', m2, 0, 16, 16, 0, 0,0,90],
['b1x2x1', m2, 0,-12, 16, 0, 0,0,90],
['b1x2x1', m2, 0,-12,-24, 0, 0,0,90],
['t2x3x1', m2, 0, 40, -4, 0, 0,0,0],
['a1x2x2', m3, 0,-16,-20, 0, 0,0,90],
['a1x2x2', m3, 0,-16, 12, 0, 0,0,90],
['a1x2x2', m3, 0, 12, 12, 0, 0,0,90],
['a1x2x2', m3, 0, 12,-20, 0, 0,0,90],
['u1x2x2', m1, 1,-28, 0, 3, 0,0,90],
['u1x2x2', m1, 1,-28, -4, 3, 0,0,90],
['u1x2x2', m1, 1,-28, -8, 3, 0,0,90],
['b2x3x1', m1, 1,-24, -8, 3, 0,0,0],
['l2x2x1', m1, 1,-16, 4, 3, 0,0,180],
['l2x2x1', m1, 1,-16,-12, 3, 0,0,90],
['b2x3x1', m1, 1,-12, -8, 3, 0,0,0],
['t2x3x1', m1, 1, -8, 4, 3, 0,0,90],
['t2x3x1', m1, 1,-12, 12, 3, 0,0,180],
['t2x3x1', m1, 1,-12,-20, 3, 0,0,180],
['t2x3x1', m1, 1, -8,-12, 3, 0,0,-90],
['b2x3x1', m1, 1, 0, -8, 3, 0,0,0],
['b2x3x1', m1, 1, 8, -8, 3, 0,0,0],
['b1x2x1', m1, 1, 4, 4, 3, 0,0,90],
['b1x2x1', m1, 1, 4,-12, 3, 0,0,90],
['b1x2x1', m1, 1, 8,-16, 3, 0,0,0],
['b1x2x1', m1, 1, 8, 4, 3, 0,0,0],
['b1x4x1', m1, 1, 12, 4, 3, 0,0,0],
['b1x4x1', m1, 1, 12,-24, 3, 0,0,0],
['b1x2x1', m1, 1, 20, 0, 3, 0,0,90],
['b1x2x1', m1, 1, 20, -8, 3, 0,0,90],
['b1x4x1', m2, 1, 28, -4, 3, 0,0,90],
['b1x3x1', m1, 1, 40, -4, 3, 0,0,90],
['b2x3x1', m1, 2,-28, -8, 6, 0,0,0],
['t2x3x1', m1, 2,-20, -4, 6, 0,0,0],
['b2x3x1', m1, 2, -8, 0, 6, 0,0,90],
['b2x3x1', m1, 2, -8,-12, 6, 0,0,90],
['b2x3x1', m1, 2, 4,-16, 6, 0,0,90],
['b2x3x1', m1, 2, 4, 4, 6, 0,0,90],
['l2x2x1', m1, 2, 8, 0, 6, 0,0,90],
['l2x2x1', m1, 2, 8, -8, 6, 0,0,180],
['t2x3x1', m1, 2, 12, -4, 6, 0,0,0],
['u1x2x2', m1, 3,-32, -4, 9, 0,0,90],
['u1x2x2', m1, 3,-32, -8, 9, 0,0,90],
['u1x2x2', m1, 3,-32, 0, 9, 0,0,90],
['a1x2x3', m1, 3,-28, 0, 9, 0,0,-90],
['a1x2x3', m1, 3,-28, -8, 9, 0,0,-90],
['b1x3x1', m1, 3,-20, -4, 9, 0,0,90],
['b2x3x1', m1, 3,-16, -8, 9, 0,0,0],
['b2x3x1', m1, 3, -8, -8, 9, 0,0,0],
['b2x3x1', m1, 3, 0, 4, 9, 0,0,90],
['b2x3x1', m1, 3, 0,-16, 9, 0,0,90],
['b1x1x1', m1, 3,-12, 4, 9, 0,0,0],
['b1x1x1', m1, 3,-12,-12, 9, 0,0,0],
['l2x2x1', m1, 3, 4, 0, 9, 0,0,90],
['t2x3x1', m1, 3, 8, -4, 9, 0,0,0],
['t2x3x1', m1, 3, 4, -8, 9, 0,0,-180],
['b2x3x1', m1, 4,-32, -8, 12, 0,0,0],
['b1x1x1', m1, 4,-24, -4, 12, 0,0,0],
['b2x3x1', m1, 4,-12, -8, 12, 0,0,0],
['b1x1x1', m1, 4,-12, 4, 12, 0,0,0],
['b1x2x1', m1, 4, -4, 0, 12, 0,0,0],
['b1x3x1', m1, 4, -4,-12, 12, 0,0,0],
['b1x3x1', m1, 4, 4, -8, 12, 0,0,0],
['b1x4x1', m2, 4, 0,-12, 12, 0,0,0],
['b1x1x1', m2, 4, 8, -4, 12, 0,0,0],
['b1x1x1', m2, 4, 0, 4, 12, 0,0,0],
['b1x1x1', m2, 4, -8, 4, 12, 0,0,0],
['b1x1x1', m2, 4,-16, -4, 12, 0,0,0],
['b1x1x1', m2, 4, -8,-12, 12, 0,0,0],
['b2x3x1', m1, 5,-36, -8, 15, 0,0,0],
['t2x3x1', m1, 5,-28, -4, 15, 0,0,0],
['b1x3x1', m1, 5, -4, -8, 15, 0,0,0],
['b1x1x1', m2, 5, 0, -4, 15, 0,0,0],
['b1x3x1', m2, 5, -8, -8, 15, 0,0,0],
['b2x3x1', m1, 6,-36, -8, 18, 0,0,0],
['t2x3x1', m1, 6,-28, -4, 18, 0,0,0],
['l2x2x1', m1, 7,-36, -8, 21, 0,0,-90],
['l2x2x1', m1, 7,-36, 0, 21, 0,0,0],
['b1x4x1', m1, 7,-36, -4, 21, 0,0,-90],
['u1x2x1', m1, 7,-28, 0, 21, 0,0,-90],
['u1x2x1', m1, 7,-28, -8, 21, 0,0,-90],
['b2x3x1', m1, 8,-48, -8, 24, 0,0,0],
['b2x3x1', m1, 8,-40, -8, 24, 0,0,0],
['u1x2x1', m4, 8,-40, -8, 21, 0,0,90],
['u1x2x1', m4, 8,-40, -4, 21, 0,0,90],
['u1x2x1', m4, 8,-40, 0, 21, 0,0,90],
['b2x3x1', m1, 8,-32,-12, 24, 0,0,0],
['b2x2x1', m1, 8,-32, 0, 24, 0,0,0],
['b1x3x1', m1, 8,-36, 4, 24, 0,0,90],
['b1x3x1', m1, 8,-36,-12, 24, 0,0,90],
['b1x1x1', m1, 8,-24, 0, 24, 0,0,0],
['b1x1x1', m1, 8,-24, -8, 24, 0,0,0],
['b1x1x1', m2, 8,-24, -4, 24, 0,0,0],
['u1x2x1', m1, 8,-32, 4, 21, 0,0,-90],
['u1x2x1', m1, 8,-32,-12, 21, 0,0,-90],
['b1x2x1', m2, 9,-24, -4, 27, 0,0,90],
['a1x1x2', m2, 9,-48, 0, 27, 0,0,90],
['a1x1x2', m2, 9,-48, -8, 27, 0,0,90],
['a1x1x2', m1, 9,-48, -4, 27, 0,0,90],
['b2x3x1', m1, 9,-44,-12, 27, 0,0,0],
['b2x3x1', m1, 9,-36, -8, 27, 0,0,0],
['b2x2x1', m1, 9,-44, 0, 27, 0,0,0],
['a1x2x3', m1, 9,-28, 0, 27, 0,0,-90],
['a1x2x3', m1, 9,-28, -8, 27, 0,0,-90],
['b1x1x1', m1, 9,-28,-12, 27, 0,0,0],
['b1x1x1', m1, 9,-28, 4, 27, 0,0,0],
['b1x1x1', m4, 9,-32,-12, 27, 0,0,90],
['b1x1x1', m4, 9,-32, 4, 27, 0,0,90],
['b1x1x1', m5, 9,-36,-12, 27, 0,0,90],
['b1x1x1', m5, 9,-36, 4, 27, 0,0,90],
['b1x1x1', m5, 10,-36, 4, 30, 0,0,90],
['b1x1x1', m5, 10,-36,-12, 30, 0,0,90],
['a1x2x3', m2, 10,-28, -4, 30, 0,0,-90],
['b2x3x1', m1, 10,-44, -8, 30, 0,0,0],
['b1x1x1', m1, 10,-40, 4, 30, 0,0,0],
['b1x1x1', m1, 10,-40,-12, 30, 0,0,0],
['l2x2x1', m1, 10,-32, -8, 30, 0,0,-90],
['l2x2x1', m1, 10,-32, 0, 30, 0,0,0],
['a1x1x2', m1, 10,-44, 4, 30, 0,0,90],
['a1x1x2', m1, 10,-44,-12, 30, 0,0,90],
['a1x1x2', m1, 10,-28,-12, 30, 0,0,-90],
['a1x1x2', m1, 10,-28, 4, 30, 0,0,-90],
['t2x3x1', m1, 11,-40, -4, 33, 0,0,-180],
['t2x3x1', m2, 11,-32, -4, 33, 0,0,0],
['a1x1x2', m1, 11,-40, 4, 33, 0,0,0],
['a1x1x2', m1, 11,-36, 4, 33, 0,0,0],
['a1x1x2', m1, 11,-32, 4, 33, 0,0,0],
['a1x1x2', m1, 11,-28, 0, 33, 0,0,-90],
['a1x1x2', m1, 11,-28, -8, 33, 0,0,-90],
['a1x1x2', m1, 11,-32,-12, 33, 0,0,-180],
['a1x1x2', m1, 11,-36,-12, 33, 0,0,-180],
['a1x1x2', m1, 11,-40,-12, 33, 0,0,-180],
['a1x1x2', m1, 11,-44, -8, 33, 0,0,90],
['a1x1x2', m1, 11,-44, 0, 33, 0,0,90],
['a1x1x2', m2, 12,-44, -4, 36, 0,0,90],
['a1x1x2', m2, 12,-28, -4, 36, 0,0,-90],
['b1x3x1', m1, 12,-32, -4, 36, 0,0,90],
['r1x3x1', m1, 12,-32, 0, 36, 0,0,90],
['r1x3x1', m1, 12,-32, -8, 36, 0,0,90],
['r1x3x1', m2, 13,-32, -4, 39, 0,0,90],
];

View File

@@ -0,0 +1,200 @@
// block name, color, step, coord: x,y,z, rotation: x,y,z
const m1=0x008000;
const m2=0xffffff;
const m3=0xfff5be;
const m4=0x005100;
const m5=0xff0000;
const m6=0x510000;
const m7=0xffaaaa;
model_list=[
['b2x3x1', m1, 0, 32, -4, 9, 0,0,0],
['b1x1x1', m2, 0,-16, 4, 9, 0,0,0],
['b1x1x1', m2, 0,-16, -4, 9, 0,0,0],
['b1x1x1', m2, 0,-16, 12, 9, 0,0,0],
['b1x1x1', m2, 0,-16,-12, 9, 0,0,0],
['b1x3x1', m3, 0, 0, -4, 9, 0,0,0],
['b1x4x1', m3, 0, 16, 0, 9, 0,0,90],
['b1x3x1', m3, 0, 28, 0, 9, 0,0,90],
['b1x3x1', m1, 0, 40, -4, 9, 0,0,0],
['b1x1x1', m3, 0, 44, 0, 9, 0,0,0],
['b2x6x1', m3, 0, 24, 4, 9, 0,0,90],
['b2x6x1', m3, 0, 24, -8, 9, 0,0,90],
['l2x2x1', m1, 0, 16, 12, 9, 0,0,0],
['l2x2x1', m1, 0, 12, 12, 9, 0,0,90],
['l2x2x1', m1, 0, 12,-12, 9, 0,0,180],
['l2x2x1', m1, 0, 16,-12, 9, 0,0,-90],
['b2x3x1', m1, 1,-16, 4, 12, 0,0,0],
['b2x3x1', m1, 1,-16,-12, 12, 0,0,0],
['b1x4x1', m3, 1, 4, 4, 12, 0,0,90],
['b1x2x1', m3, 1, 12, 4, 12, 0,0,90],
['b2x6x1', m3, 1, 12, -4, 12, 0,0,90],
['b2x3x1', m1, 1, 16, -4, 12, 0,0,0],
['b2x2x1', m1, 1, 12, 8, 12, 0,0,0],
['b2x2x1', m1, 1, 12,-12, 12, 0,0,0],
['b1x2x1', m1, 1, 8, -8, 12, 0,0,90],
['b1x2x1', m1, 1, 24, -8, 12, 0,0,90],
['b1x2x1', m1, 1, 24, 8, 12, 0,0,90],
['b1x2x1', m1, 1, 8, 8, 12, 0,0,90],
['b1x3x1', m1, 1, 32, 4, 12, 0,0,90],
['b1x3x1', m1, 1, 32, -4, 12, 0,0,90],
['b1x6x1', m1, 1, 44, 0, 12, 0,0,90],
['b1x2x1', m1, 1, 44, 4, 12, 0,0,90],
['b1x2x1', m1, 1, 44, -4, 12, 0,0,90],
['b2x3x1', m1, 2, -4, 8, 15, 0,0,90],
['b2x3x1', m1, 2, -4,-12, 15, 0,0,90],
['b2x3x1', m1, 2, 8, -8, 15, 0,0,90],
['b2x3x1', m1, 2, 8, 4, 15, 0,0,90],
['b2x3x1', m1, 2, 12, -8, 15, 0,0,0],
['b2x3x1', m1, 2, 20, -8, 15, 0,0,0],
['b2x2x1', m1, 2, 12, 4, 15, 0,0,0],
['b2x2x1', m1, 2, 20, 4, 15, 0,0,0],
['t2x3x1', m1, 2, 28, 0, 15, 0,0,0],
['b2x3x1', m3, 2,-12, -4, 15, 0,0,0],
['b1x1x1', m4, 2, 36, 0, 15, 0,0,0],
['b1x3x1', m5, 2, 44, 0, 15, 0,0,-90],
['b1x2x1', m5, 2, 44, 4, 15, 0,0,-90],
['b1x2x1', m5, 2, 44, -4, 15, 0,0,-90],
['b1x1x1', m5, 2, 48, 0, 12, 0,0,0],
['b2x3x1', m3, 3,-16, -4, 18, 0,0,0],
['b1x1x1', m5, 3, 48, 0, 18, 0,0,0],
['b1x1x1', m4, 3, 28, 0, 18, 0,0,0],
['b1x3x1', m1, 3, -8, 4, 18, 0,0,0],
['b1x3x1', m1, 3, -8,-12, 18, 0,0,0],
['l2x2x1', m1, 3, -4, 8, 18, 0,0,0],
['l2x2x1', m1, 3, -4, -8, 18, 0,0,-90],
['b2x3x1', m1, 3, 12, 4, 18, 0,0,90],
['b2x3x1', m1, 3, 12, -8, 18, 0,0,90],
['b2x2x1', m1, 3, 16, 4, 18, 0,0,0],
['b2x2x1', m1, 3, 16, -8, 18, 0,0,0],
['b1x3x1', m1, 3, 24, -4, 18, 0,0,0],
['a1x1x2', m1, 3, 32, 0, 18, 0,0,90],
['b1x6x1', m1, 4, -8, 0, 21, 0,0,90],
['b1x6x1', m1, 4, -8, 4, 21, 0,0,90],
['b1x6x1', m1, 4, -8, -4, 21, 0,0,90],
['b1x6x1', m1, 4, -4, 8, 21, 0,0,90],
['b1x6x1', m1, 4, -4, -8, 21, 0,0,90],
['b1x2x1', m1, 4, 4, -8, 21, 0,0,90],
['b1x2x1', m1, 4, 4, 8, 21, 0,0,90],
['b2x3x1', m1, 4, 16, 4, 21, 0,0,90],
['b2x3x1', m1, 4, 16, -8, 21, 0,0,90],
['t2x3x1', m1, 4, 20, 0, 21, 0,0,0],
['b1x1x1', m4, 4, 28, 0, 21, 0,0,0],
['b2x3x1', m5, 5,-20, -4, 24, 0,0,0],
['b1x3x1', m5, 5,-12, -4, 24, 0,0,0],
['b1x1x1', m2, 5,-24, 0, 24, 0,0,0],
['c1x1x1', m2, 5,-16, 8, 24, 0,0,0],
['c1x1x1', m2, 5,-24, 8, 24, 0,0,0],
['c1x1x1', m2, 5,-24, -8, 24, 0,0,0],
['c1x1x1', m2, 5,-16, -8, 24, 0,0,0],
['b2x3x1', m1, 5, -8, 0, 24, 0,0,0],
['b2x3x1', m1, 5, 8, 4, 24, 0,0,90],
['b2x3x1', m1, 5, 4, -8, 24, 0,0,0],
['b2x3x1', m1, 5, 0, -8, 24, 0,0,90],
['b2x3x1', m1, 5, 12, -4, 24, 0,0,0],
['b1x1x1', m4, 5, 20, 0, 24, 0,0,0],
['b1x1x1', m1, 5, 24, 0, 24, 0,0,0],
['a1x1x2', m4, 5, 28, 0, 24, 0,0,90],
['b2x3x1', m5, 6,-28, -4, 27, 0,0,0],
['b2x3x1', m5, 6,-20, -4, 27, 0,0,0],
['b2x3x1', m5, 6,-12, -4, 27, 0,0,0],
['b2x3x1', m1, 6, -4, -8, 27, 0,0,0],
['b2x2x1', m1, 6, -4, 4, 27, 0,0,0],
['b1x6x1', m1, 6, -8, 8, 27, 0,0,90],
['b1x6x1', m1, 6, -8, -8, 27, 0,0,90],
['t2x3x1', m1, 6, 4, 0, 27, 0,0,0],
['b1x1x1', m4, 6, 12, 0, 27, 0,0,90],
['b1x1x1', m1, 6, 16, 0, 27, 0,0,0],
['b1x1x1', m4, 6, 20, 0, 27, 0,0,90],
['a1x1x2', m1, 6, 24, 0, 27, 0,0,90],
['b1x3x1', m1, 6,-32, -4, 27, 0,0,0],
['a1x2x2', m1, 7,-28, 4, 30, 0,0,90],
['a1x2x2', m1, 7,-28, 0, 30, 0,0,90],
['a1x2x2', m1, 7,-28, -4, 30, 0,0,90],
['b2x3x1', m1, 7,-24, -4, 30, 0,0,0],
['a1x3x2', m1, 7,-20, 8, 30, 0,0,90],
['a1x3x2', m1, 7,-20, -8, 30, 0,0,90],
['l2x2x1', m1, 7,-16, 4, 30, 0,0,0],
['l2x2x1', m1, 7,-16, -4, 30, 0,0,-90],
['b1x1x1', m6, 7,-12, -8, 30, 0,0,0],
['b1x1x1', m6, 7,-12, 8, 30, 0,0,0],
['b1x2x1', m7, 7, -8, -8, 30, 0,0,0],
['b1x2x1', m7, 7, -8, 4, 30, 0,0,0],
['b1x1x1', m1, 7, -4, 8, 30, 0,0,0],
['b1x1x1', m1, 7, -4, -8, 30, 0,0,0],
['a1x2x3', m1, 7, -4, 4, 30, 0,0,-90],
['a1x2x3', m1, 7, -4, -4, 30, 0,0,-90],
['b1x3x1', m1, 7, 0, 0, 30, 0,0,90],
['a1x1x2', m4, 7, 4, 0, 30, 0,0,90],
['b1x1x1', m1, 7, 8, 0, 30, 0,0,0],
['b1x1x1', m4, 7, 12, 0, 30, 0,0,0],
['b1x1x1', m1, 7, 16, 0, 30, 0,0,0],
['a1x1x2', m4, 7, 20, 0, 30, 0,0,90],
['r1x1x1', m1, 8,-28, 0, 33, 0,0,0],
['a1x3x2', m1, 8,-20, 4, 33, 0,0,90],
['a1x3x2', m1, 8,-20, -4, 33, 0,0,90],
['a1x2x2', m1, 8,-16, -8, 33, 0,0,90],
['a1x2x2', m1, 8,-16, 8, 33, 0,0,90],
['a1x2x2', m1, 8, -4, 4, 33, 0,0,0],
['a1x2x2', m1, 8, -4, -4, 33, 0,0,180],
['l2x2x1', m1, 8, -8, -4, 33, 0,0,180],
['l2x2x1', m1, 8, -8, 4, 33, 0,0,90],
['b1x2x1', m1, 8,-20, 0, 33, 0,0,90],
['b1x3x1', m1, 8,-16, -4, 33, 0,0,0],
['a1x2x3', m1, 8, -4, 0, 33, 0,0,-90],
['b1x1x1', m6, 8,-12, 8, 33, 0,0,0],
['b1x1x1', m6, 8,-12, -8, 33, 0,0,0],
['a1x1x2', m1, 8, 8, 0, 33, 0,0,90],
['a1x1x2', m4, 8, 12, 0, 33, 0,0,-90],
['a1x1x2', m1, 8, 16, 0, 33, 0,0,90],
['a1x1x2', m1, 9,-16, -8, 36, 0,0,180],
['a1x1x2', m1, 9,-12, -8, 36, 0,0,180],
['a1x1x2', m1, 9, -8, -8, 36, 0,0,180],
['a1x1x2', m1, 9,-16, 8, 36, 0,0,0],
['a1x1x2', m1, 9,-12, 8, 36, 0,0,0],
['a1x1x2', m1, 9, -8, 8, 36, 0,0,0],
['a1x1x2', m1, 9, -4, 4, 36, 0,0,-90],
['a1x1x2', m1, 9, -4, -4, 36, 0,0,-90],
['a1x1x2', m1, 9,-20, 4, 36, 0,0,90],
['a1x1x2', m1, 9,-20, -4, 36, 0,0,90],
['a1x2x2', m1, 9,-20, 0, 36, 0,0,90],
['b2x3x1', m1, 9,-16, -4, 36, 0,0,0],
['t2x3x1', m1, 9, -8, 0, 36, 0,0,0],
['a1x1x2', m5, 10,-20, 0, 39, 0,0,90],
['a1x1x2', m5, 10, -4, 0, 39, 0,0,-90],
['b1x3x1', m5, 10, -8, 0, 39, 0,0,90],
['r1x1x1', m1, 10,-16, -4, 39, 0,0,90],
['r1x1x1', m1, 10,-12, -4, 39, 0,0,90],
['r1x1x1', m1, 10, -8, -4, 39, 0,0,90],
['r1x1x1', m1, 10, -8, 4, 39, 0,0,90],
['r1x1x1', m1, 10,-12, 4, 39, 0,0,90],
['r1x1x1', m1, 10,-16, 4, 39, 0,0,90],
['r1x3x1', m5, 11, -8, 0, 42, 0,0,90],
['b1x2x1', m1, 12, -8,-12, 12, 0,0,0],
['b1x2x1', m1, 12, -8, 8, 12, 0,0,0],
['b1x2x1', m3, 12, 0, 8, 12, 0,0,90],
['b1x2x1', m3, 12, 0, -8, 12, 0,0,90],
['b2x2x1', m1, 12, 16, 8, 6, 0,0,0],
['b2x2x1', m1, 12, 16,-12, 6, 0,0,0],
['l2x2x1', m1, 12, 12,-16, 6, 0,0,0],
['l2x2x1', m1, 12, 12, 16, 6, 0,0,-90],
['b1x1x1', m1, 12, 12, 8, 6, 0,0,0],
['b1x1x1', m1, 12, 8, 12, 6, 0,0,0],
['b1x1x1', m1, 12, 12, -8, 6, 0,0,0],
['b1x1x1', m1, 12, 8,-12, 6, 0,0,0],
['b1x3x1', m3, 12, 40, 0, 6, 0,0,90],
['b2x3x1', m1, 13, 4,-16, 3, 0,0,0],
['b2x3x1', m1, 13, 4, 8, 3, 0,0,0],
['l2x2x1', m1, 13, 12, 12, 3, 0,0,-90],
['l2x2x1', m1, 13, 12,-12, 3, 0,0,0],
['b1x2x1', m1, 14, 12,-16, 0, 0,0,90],
['b1x2x1', m1, 14, 12, 16, 0, 0,0,90],
['t2x3x1', m1, 14, 8, 12, 0, 0,0,-90],
['t2x3x1', m1, 14, 8,-12, 0, 0,0,90],
['a1x2x2', m2, 14, 4,-16, 0, 0,0,90],
['a1x2x2', m2, 14, 4, -8, 0, 0,0,90],
['a1x2x2', m2, 14, 4, 8, 0, 0,0,90],
['a1x2x2', m2, 14, 4, 16, 0, 0,0,90],
];

View File

@@ -446,9 +446,9 @@ model_list=[
['f1x2x1', m5, 29,-28, 12, 72, 0,0,90], ['f1x2x1', m5, 29,-28, 12, 72, 0,0,90],
['f1x2x1', m5, 29,-28, 16, 72, 0,0,90], ['f1x2x1', m5, 29,-28, 16, 72, 0,0,90],
['f1x2x1', m5, 29,-30, 12, 75, 0,0,0], ['f1x2x1', m5, 29,-30, 12, 75, 0,0,0],
['c1x1x1', m5, 29,-30, 12, 78, 0,0,0], ['c1x1x1', m5, 29,-30, 14, 78, 0,0,0],
['c1x1x1', m5, 29,-30, 12, 81, 0,0,0], ['c1x1x1', m5, 29,-30, 14, 81, 0,0,0],
['c1x1x1', m7, 29,-30, 12, 84, 0,0,0], ['c1x1x1', m7, 29,-30, 14, 84, 0,0,0],
['b2x3x1', m5, 30, -8, 0, 57, 0,0,0], ['b2x3x1', m5, 30, -8, 0, 57, 0,0,0],
['b2x3x1', m5, 30,-16, 0, 57, 0,0,0], ['b2x3x1', m5, 30,-16, 0, 57, 0,0,0],
['b2x3x1', m5, 30,-24, 0, 57, 0,0,0], ['b2x3x1', m5, 30,-24, 0, 57, 0,0,0],

View File

@@ -0,0 +1,139 @@
// block name, color, step, coord: x,y,z, rotation: x,y,z
const m1=0xffecca;
const m2=0xff0000;
const m3=0;
const m4=0xffffff;
model_list=[
['t2x3x1', m1, 0, 0, -8, 0, 0,0,90],
['t2x3x1', m2, 0, -8, -4, 0, 0,0,-90],
['t2x3x1', m2, 0, 8, -4, 0, 0,0,-90],
['b1x2x1', m2, 0,-20, 0, 0, 0,0,90],
['b1x2x1', m2, 0,-12, 0, 0, 0,0,0],
['b1x2x1', m2, 0, 12, 0, 0, 0,0,0],
['b1x2x1', m2, 0, 24, 0, 0, 0,0,90],
['b2x3x1', m2, 0, -8, 0, 0, 0,0,0],
['b2x3x1', m2, 0, 4, 0, 0, 0,0,0],
['b1x3x1', m2, 0, 0, 0, 0, 0,0,0],
['b2x3x1', m1, 1, 0,-12, 3, 0,0,90],
['b2x2x1', m1, 1, 4,-12, 3, 0,0,0],
['t2x3x1', m2, 1,-12, -4, 3, 0,0,-90],
['t2x3x1', m2, 1, 12, -4, 3, 0,0,-90],
['b2x3x1', m2, 1, 4, -4, 3, 0,0,90],
['b1x4x1', m2, 1, -8, 0, 3, 0,0,90],
['b1x4x1', m2, 1, 20, 0, 3, 0,0,90],
['b1x3x1', m2, 1, -8, 4, 3, 0,0,90],
['b1x3x1', m2, 1, 4, 4, 3, 0,0,90],
['b1x3x1', m2, 1, 16, 4, 3, 0,0,90],
['l2x2x1', m2, 1, -8, 8, 3, 0,0,90],
['l2x2x1', m2, 1, 8, 8, 3, 0,0,0],
['b2x3x1', m2, 1, 4, 8, 3, 0,0,90],
['b2x3x1', m1, 2, 4,-12, 6, 0,0,90],
['b2x3x1', m2, 2, -8, -4, 6, 0,0,0],
['b2x3x1', m2, 2, 4, -4, 6, 0,0,0],
['b2x3x1', m2, 2, -4, 8, 6, 0,0,90],
['b2x4x1', m2, 2, 12, 8, 6, 0,0,90],
['b1x4x1', m2, 2,-16, -4, 6, 0,0,0],
['b1x4x1', m2, 2, 16, -4, 6, 0,0,0],
['b1x3x1', m2, 2, -8, -8, 6, 0,0,90],
['b1x3x1', m2, 2, 16, -8, 6, 0,0,90],
['b1x2x1', m2, 2, -8,-12, 6, 0,0,90],
['b1x2x1', m2, 2, 12,-12, 6, 0,0,90],
['b1x1x1', m2, 3,-28, 4, 3, 0,0,0],
['b1x1x1', m2, 3, 28, 4, 3, 0,0,0],
['t2x3x1', m2, 3,-24, 4, 6, 0,0,-90],
['t2x3x1', m2, 3, 24, 4, 6, 0,0,-90],
['b1x3x1', m2, 3,-16, 0, 9, 0,0,90],
['b1x3x1', m2, 3, 24, 0, 9, 0,0,90],
['l2x2x1', m2, 3,-16, -4, 9, 0,0,-90],
['l2x2x1', m2, 3, 16, -4, 9, 0,0,-180],
['b2x3x1', m2, 3, -4,-12, 9, 0,0,90],
['b2x4x1', m2, 3, 12,-12, 9, 0,0,90],
['b2x2x1', m2, 3,-16, 4, 9, 0,0,0],
['b2x2x1', m2, 3, 12, 4, 9, 0,0,0],
['b1x4x1', m2, 3, 0, 12, 9, 0,0,90],
['b1x3x1', m2, 3, 12, 12, 9, 0,0,90],
['b1x4x1', m2, 4, 28, 4, 12, 0,0,90],
['b1x4x1', m2, 4,-16, 4, 12, 0,0,90],
['l2x2x1', m2, 4,-12, 8, 12, 0,0,90],
['l2x2x1', m2, 4, 12, 8, 12, 0,0,0],
['b2x2x1', m2, 4, -8, 8, 12, 0,0,0],
['b2x3x1', m2, 4, 8, 8, 12, 0,0,90],
['b2x2x1', m2, 4,-16, -4, 12, 0,0,0],
['b2x2x1', m2, 4, 12, -4, 12, 0,0,0],
['b2x3x1', m2, 4, 4,-12, 12, 0,0,90],
['a1x2x2', m2, 4,-12, -8, 12, 0,0,90],
['a1x2x2', m2, 4, -8,-12, 12, 0,0,90],
['a1x2x2', m2, 4, 8,-12, 12, 0,0,-90],
['a1x2x2', m2, 4, 12, -8, 12, 0,0,-90],
['b1x1x1', m2, 5,-28, 4, 15, 0,0,0],
['b1x1x1', m2, 5, 28, 4, 15, 0,0,0],
['b1x2x1', m2, 5,-16, 0, 15, 0,0,0],
['b1x2x1', m2, 5, 16, 0, 15, 0,0,0],
['b1x3x1', m2, 5,-12, 0, 15, 0,0,0],
['b1x3x1', m2, 5, 12, 0, 15, 0,0,0],
['b2x3x1', m2, 5, 0, 8, 15, 0,0,90],
['b2x2x1', m2, 5, 4, 8, 15, 0,0,0],
['b2x2x1', m2, 5, 4, -8, 15, 0,0,0],
['b2x3x1', m2, 5, 0, -8, 15, 0,0,90],
['a1x2x2', m2, 5,-12, -4, 15, 0,0,90],
['a1x2x2', m2, 5, 12, -4, 15, 0,0,-90],
['r1x3x1', m3, 5, 4,-12, 15, 0,0,90],
['r1x1x1', m2, 5, -8,-12, 15, 0,0,0],
['r1x1x1', m2, 5, 8,-12, 15, 0,0,0],
['r1x1x1', m2, 5, 12, -8, 15, 0,0,0],
['r1x1x1', m2, 5,-12, -8, 15, 0,0,0],
['u1x2x1', m2, 6,-20, 0, 15, 0,0,90],
['t2x3x1', m2, 6,-20, 0, 18, 0,0,0],
['u1x2x2', m2, 6,-24, 0, 18, 0,0,90],
['u1x2x1', m2, 6, 20, 0, 15, 0,0,-90],
['t2x3x1', m2, 6, 20, 0, 18, 0,0,180],
['u1x2x2', m2, 6, 24, 0, 18, 0,0,-90],
['b1x2x1', m2, 6,-12, 0, 18, 0,0,0],
['b1x2x1', m2, 6, 12, 0, 18, 0,0,0],
['b2x4x1', m2, 6, -8, -4, 18, 0,0,0],
['b2x4x1', m2, 6, 0, -4, 18, 0,0,0],
['b1x4x1', m2, 6, 8, -4, 18, 0,0,0],
['r1x1x1', m2, 6,-12, -4, 18, 0,0,0],
['r1x1x1', m2, 6, 12, -4, 18, 0,0,0],
['r1x1x1', m3, 6, -8, -8, 18, 0,0,0],
['r1x1x1', m3, 6, 8, -8, 18, 0,0,0],
['b1x3x1', m2, 6, 4, -8, 18, 0,0,90],
['b1x3x1', m2, 7,-16, 4, 21, 0,0,90],
['b1x3x1', m2, 7, 24, 4, 21, 0,0,90],
['b2x3x1', m2, 7, 24, -4, 21, 0,0,90],
['b2x3x1', m2, 7,-16, -4, 21, 0,0,90],
['b1x2x1', m2, 7, -8, -4, 21, 0,0,0],
['b1x2x1', m2, 7, 8, -4, 21, 0,0,0],
['a1x1x2', m2, 8,-24, -4, 24, 0,0,90],
['a1x1x2', m2, 8, 24, -4, 24, 0,0,-90],
['l2x2x1', m2, 8, 24, 0, 24, 0,0,0],
['l2x2x1', m2, 8,-24, 0, 24, 0,0,90],
['b1x3x1', m2, 8,-16, -4, 24, 0,0,0],
['b1x3x1', m2, 8, 16, -4, 24, 0,0,0],
['b1x3x1', m2, 8, -4, 0, 24, 0,0,90],
['b1x3x1', m2, 8, 12, 0, 24, 0,0,90],
['b1x3x1', m4, 8, 12, -4, 24, 0,0,90],
['b1x3x1', m4, 8, -4, -4, 24, 0,0,90],
['a1x1x2', m2, 9,-28, 0, 27, 0,0,90],
['a1x1x2', m2, 9, 28, 0, 27, 0,0,-90],
['l2x2x1', m2, 9, 24, 4, 27, 0,0,180],
['l2x2x1', m2, 9, 20, 0, 27, 0,0,180],
['l2x2x1', m2, 9,-24, 4, 27, 0,0,-90],
['l2x2x1', m2, 9,-20, 0, 27, 0,0,-90],
['b1x3x1', m2, 9, -4, 0, 27, 0,0,90],
['b1x3x1', m2, 9, 12, 0, 27, 0,0,90],
['b1x1x1', m4, 9,-12, -4, 27, 0,0,90],
['b1x1x1', m4, 9, -4, -4, 27, 0,0,90],
['b1x1x1', m4, 9, 4, -4, 27, 0,0,90],
['b1x1x1', m4, 9, 12, -4, 27, 0,0,90],
['c1x1x1', m3, 9, -8, -4, 27, 0,0,90],
['c1x1x1', m3, 9, 8, -4, 27, 0,0,90],
['b1x2x1', m2, 10,-20, 0, 30, 0,0,90],
['b1x2x1', m2, 10, 24, 0, 30, 0,0,90],
['r1x3x1', m2, 10, -4, 0, 30, 0,0,90],
['r1x3x1', m2, 10, 12, 0, 30, 0,0,90],
['r1x3x1', m4, 10, 12, -4, 30, 0,0,90],
['r1x3x1', m4, 10, -4, -4, 30, 0,0,90],
];

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -1,200 +0,0 @@
Visit http://flatassembler.net/ for more information.
version 1.68 (Jun 13, 2009)
[+] Added SSSE3 (Supplemental SSE3), SSE4.1, SSE4.2 and SSE4a instructions.
[+] Added the AMD SVM and Intel SMX instructions.
[+] Added "rdmsrq", "wrmsrq", "sysexitq" and "sysretq" mnemonics for the
64-bit variants of respective instructions.
[+] Added "fstenvw", "fstenvd", "fsavew", "fsaved", "frstorw" and "frstord"
mnemonics to allow choosing between 16-bit and 32-bit variants of
structures used by the "fstenv", "fsave" and "frstor" instructions.
[+] Added "plt" operator for the ELF output format.
[+] Allowed "rva" operator to be used in MS COFF object format, and also
added "static" keyword for the "public" directive.
[+] Added Intel-style aliases for the additional long mode 8-bit registers.
[-] The PE formatter now automatically detects whether relocatable labels
should be used, depending on whether the fixups directory is placed
somewhere into executable by programer, or not. This makes possible the
more flexible use of the addressing symbols in case of PE executable fixed
at some position.
[-] Added support for outputting the 32-bit address relocations in case of
64-bit object formats and PE executable. This makes some specific
instructions compilable, but it also forces linker to put such
generated code into the low 2 gigabytes of addressing space.
[+] Added "EFI", "EFIboot" and "EFIruntime" subsystem keywords for PE format.
[-] Corrected the precedence of operators of macroinstruction line maker.
The symbol escaping now has always the higher priority than symbol conversion,
and both have higher precedence than concatenation.
[+] Allowed to check "@b" and "@f" symbols with "defined" operator.
[+] Allowed "as" operator to specify the output file extension when
placed at the end of the "format" directive line.
[-] Definition of macro with the same name as one of the preprocessor's directives
is no longer allowed.
[+] Allowed single quote character to be put inside the number value,
to help improve long numbers readability.
[+] Added optional symbolic information output, and a set of tools that extract
various kinds of information from it.
[+] Added "err" directive that allows to signalize error from the source.
version 1.66 (May 7, 2006)
[+] Added "define" directive to preprocessor, which defines symbolic constants,
the same kind as "equ" directive, however there's an important difference
that "define" doesn't process symbolic constants in the value before
assigning it. For example:
a equ 1
a equ a+a
define b 1
define b b+b
defines the "a" constant with value "1+1", but the "b" is defined with
value "b+b". This directive may be useful in some advanced
macroinstructions.
[-] Moved part of the conditional expression processing into parser,
for slightly better performance and lesser memory usage by assembler.
The logical values defined with "eq", "eqtype" and "in" operators are now
evaluated by the parser and if they are enough to determine the condition,
the whole block is processed accordingly. Thus this block:
if eax eq EAX | 0/0
nop
end if
is parsed into just "nop" instruction, since parser is able to determine
that the condition is true, even though one of the logical values makes no
sense - but since this is none of the "eq", "eqtype" and "in" expressions,
the parser doesn't investigate.
[-] Also the assembler is now calculating only as many logical values as it
needs to determine the condition. So this block:
if defined alpha & alpha
end if
will not cause error when "alpha" is not defined, as it would with previous
versions. This is because after checking that "defined alpha" is false
condition it doesn't need to know the second logical value to determine the
value of conjunction.
[+] Added "short" keyword for specifying jump type, the "jmp byte" form is now
obsolete and no longer correct - use "jmp short" instead.
[-] The size operator applied to jump no longer applies to the size of relative
displacement - now it applies to the size of target address.
[-] The "ret" instruction with 0 parameter is now assembled into short form,
unless you force using the 16-bit immediate with "word" operator.
[+] Added missing extended registers for the 32-bit addressing in long mode.
[+] Added "linkremove" and "linkinfo" section flags for MS COFF output.
[+] Added support for GOT offsets in ELF object formatter, which can be useful
when making position-independent code for shared libraries. For any label
you can get its offset relative to GOT by preceding it with "rva" operator
(the same keyword as for PE format is used, to avoid adding a new one,
while this one has very similar meaning).
[-] Changed ELF executable to use "segment" directive in place of "section",
to make the distinction between the run-time segments and linkable
sections. If you had a "section" directive in your ELF executables and they
no longer assemble, replace it with "segment".
[-] The PE formatter now always creates the fixups directory when told to -
even when there are no fixups to be put there (in such case it creates the
directory with one empty block).
[-] Some of the internal structures have been extended to provide the
possibility of making extensive symbol dumps.
[-] Corrected "fix" directive to keep the value intact before assigning it to the
prioritized constant.
[+] The ` operator now works with any kind of symbol; when used with quoted
string it simply does nothing. Thus the sequence of ` operators applied to
one symbol work the same as if there was just one. In similar manner, the
sequence of # operators now works as if it was a single one - using such a
sequence instead of escaping, which was kept for some backward
compatibility, is now deprecated.
[-] Corrected order of identifying assembler directives ("if db eq db" was
incorrectly interpreted as data definition).
[-] Many other small bugs fixed.
version 1.64 (Aug 8, 2005)
[+] Output of PE executables for Win64 architecture (with "format PE64"
setting).
[+] Added "while" and "break" directives.
[+] Added "irp" and "irps" directives.
[+] The macro arguments can be marked as required with the "*" character.
[-] Fixed checking for overflow when multiplying 64-bit values - the result
must always fit in the range of signed 64 integer now.
[-] Segment prefixes were generated incorrectly in 16-bit mode when BP was used
as a second addressing register - fixed.
[-] The "local" directive was not creating unique labels in some cases - fixed.
[-] The "not encodable with long immediate" error in 64-bit mode was sometimes
wrongly signaled - fixed.
[-] Other minor fixes and corrections.
version 1.62 (Jun 14, 2005)
[+] Escaping of symbols inside macroinstructions with backslash.
[+] Ability of outputting the COFF object files for Win64 architecture
(with "format MS64 COFF" setting).
[+] New preprocessor directives: "restruc", "rept" and "match"
[+] VMX instructions support (not documented).
[+] Extended data directives to allow use of the "dup" operator.
[+] Extended "struc" features to allow custom definitions of main structure's
label.
[-] When building resources from the the .RES file that contained more
than one resource of the same string name, the separate resource
directories were created with the same names - fixed.
[-] Several bugs in the ELF64 object output has been fixed.
[-] Corrected behavior of "fix" directive to more straightforward.
[-] Fixed bug in "include" directive, which caused files included from within
macros to be processed the wrong way.

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en_US >lang.inc
@fasm fasm.asm fasm
@erase lang.inc
@pause

View File

@@ -1,6 +0,0 @@
@erase lang.inc
@echo lang fix ru_RU >lang.inc
@fasm fasm.asm fasm
@erase lang.inc
@kpack fasm
@pause

View File

@@ -1,174 +0,0 @@
; flat assembler core
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
out_of_memory:
push _out_of_memory
jmp fatal_error
stack_overflow:
push _stack_overflow
jmp fatal_error
main_file_not_found:
push _main_file_not_found
jmp fatal_error
unexpected_end_of_file:
push _unexpected_end_of_file
jmp fatal_error
code_cannot_be_generated:
push _code_cannot_be_generated
jmp fatal_error
format_limitations_exceeded:
push _format_limitations_exceeded
jmp fatal_error
invalid_definition:
push _invalid_definition
jmp fatal_error
write_failed:
push _write_failed
jmp fatal_error
file_not_found:
push _file_not_found
jmp assembler_error
error_reading_file:
push _error_reading_file
jmp assembler_error
invalid_file_format:
push _invalid_file_format
jmp assembler_error
invalid_macro_arguments:
push _invalid_macro_arguments
jmp assembler_error
incomplete_macro:
push _incomplete_macro
jmp assembler_error
unexpected_characters:
push _unexpected_characters
jmp assembler_error
invalid_argument:
push _invalid_argument
jmp assembler_error
illegal_instruction:
push _illegal_instruction
jmp assembler_error
invalid_operand:
push _invalid_operand
jmp assembler_error
invalid_operand_size:
push _invalid_operand_size
jmp assembler_error
operand_size_not_specified:
push _operand_size_not_specified
jmp assembler_error
operand_sizes_do_not_match:
push _operand_sizes_do_not_match
jmp assembler_error
invalid_address_size:
push _invalid_address_size
jmp assembler_error
address_sizes_do_not_agree:
push _address_sizes_do_not_agree
jmp assembler_error
prefix_conflict:
push _prefix_conflict
jmp assembler_error
long_immediate_not_encodable:
push _long_immediate_not_encodable
jmp assembler_error
relative_jump_out_of_range:
push _relative_jump_out_of_range
jmp assembler_error
invalid_expression:
push _invalid_expression
jmp assembler_error
invalid_address:
push _invalid_address
jmp assembler_error
invalid_value:
push _invalid_value
jmp assembler_error
value_out_of_range:
push _value_out_of_range
jmp assembler_error
undefined_symbol:
mov edi,message
mov esi,_undefined_symbol
call copy_asciiz
push message
cmp [error_info],0
je assembler_error
mov byte [edi-1],20h
call write_quoted_symbol_name
jmp assembler_error
copy_asciiz:
lods byte [esi]
stos byte [edi]
test al,al
jnz copy_asciiz
ret
write_quoted_symbol_name:
mov al,27h
stosb
mov esi,[error_info]
movzx ecx,byte [esi-1]
rep movs byte [edi],[esi]
mov ax,27h
stosw
ret
symbol_out_of_scope:
mov edi,message
mov esi,_symbol_out_of_scope_1
call copy_asciiz
cmp [error_info],0
je finish_symbol_out_of_scope_message
mov byte [edi-1],20h
call write_quoted_symbol_name
finish_symbol_out_of_scope_message:
mov byte [edi-1],20h
mov esi,_symbol_out_of_scope_2
call copy_asciiz
push message
jmp assembler_error
invalid_use_of_symbol:
push _invalid_use_of_symbol
jmp assembler_error
name_too_long:
push _name_too_long
jmp assembler_error
invalid_name:
push _invalid_name
jmp assembler_error
reserved_word_used_as_symbol:
push _reserved_word_used_as_symbol
jmp assembler_error
symbol_already_defined:
push _symbol_already_defined
jmp assembler_error
missing_end_quote:
push _missing_end_quote
jmp assembler_error
missing_end_directive:
push _missing_end_directive
jmp assembler_error
unexpected_instruction:
push _unexpected_instruction
jmp assembler_error
extra_characters_on_line:
push _extra_characters_on_line
jmp assembler_error
section_not_aligned_enough:
push _section_not_aligned_enough
jmp assembler_error
setting_already_specified:
push _setting_already_specified
jmp assembler_error
data_already_defined:
push _data_already_defined
jmp assembler_error
too_many_repeats:
push _too_many_repeats
jmp assembler_error
invoked_error:
push _invoked_error
jmp assembler_error

File diff suppressed because it is too large Load Diff

View File

@@ -1,608 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; flat assembler source ;;
;; Copyright (c) 1999-2006, Tomasz Grysztar ;;
;; All rights reserved. ;;
;; ;;
;; Menuet port by VT ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
NORMAL_MODE = 8
CONSOLE_MODE = 32
MAGIC1 = 6*(text.line_size-1)+14
MAX_PATH = 100
APP_MEMORY = 0x00800000
;; Menuet header
appname equ "flat assembler "
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; program start
dd program_end ; program image size
dd stacktop ; required amount of memory
dd stacktop ; stack
dd params,0x0 ; parameters,icon
include 'lang.inc'
include '..\..\..\macros.inc'
purge add,sub ; macros.inc does incorrect substitution
include 'fasm.inc'
center fix true
START: ; Start of execution
mov edi, fileinfos
mov ecx, (fileinfos_end-fileinfos)/4
or eax, -1
rep stosd
push 68
pop eax
push 11
pop ebx
mcall
cmp [params],0
jz red
mov ecx,10
mov eax,' '
mov edi,infile
push ecx
cld
rep stosd
mov ecx,[esp]
mov edi,outfile
rep stosd
pop ecx
mov edi,path
rep stosd
mov esi,params
; DEBUGF "params: %s\n",esi
mov edi,infile
call mov_param_str
; mov edi,infile
; DEBUGF " input: %s\n",edi
inc esi
mov edi,outfile
call mov_param_str
; mov edi,outfile
; DEBUGF "output: %s\n",edi
inc esi
mov edi,path
call mov_param_str
; mov edi,path
; DEBUGF " path: %s\n",edi
cmp [esi], dword ',run'
jne @f
mov [_run_outfile],1
@@:
mov [_mode],CONSOLE_MODE
jmp start
red: ; Redraw
call draw_window
still:
push 10 ; Wait here for event
pop eax
mcall
dec eax
je red ; Redraw request
dec eax
jne button ; Button in buffer
key: ; Key
mov al,2 ; Read it and ignore
mcall
jmp still
button: ; Button in Window
mov al,17
mcall
cmp ah,1
jne noclose
or eax,-1
mcall
noclose:
cmp ah,2 ; Start compiling
je start
cmp ah,3 ; Start compiled file
jnz norunout
mov edx,outfile
call make_fullpaths
mcall 70,file_info_start
; xor ecx,ecx
jmp still
norunout:
cmp ah,4
jnz norundebug
mov edx,outfile
call make_fullpaths
mcall 70,file_info_debug
jmp still
norundebug:
mov ecx,5
mov [ya],ecx
cmp ah,11 ; Infile
je f1
cmp ah,12 ; Outfile
je f2
cmp ah,13 ; Path
je f3
cmp ah,14
je f4
jmp still
f4:
xor [bGenerateDebugInfo], 1
mcall 8,,,0x8000000E
call draw_checkbox
jmp still
draw_window:
pusha
mcall 12,1 ; Start of draw
get_sys_colors 1,0
xor eax,eax
mov ebx,100*65536+280
mov ecx,90*65536+260
mov edx,[sc.work]
or edx,0x33000000
mov edi,title ; Draw Window Label Text
mcall
mcall 9,PROCESSINFO,-1
mpack ecx,1,1
mov ebx,[pinfo.box.width]
sub ebx,10
push ecx
madd ecx, 14*3+16+2, 14*3+16+2
mcall 38,,,[sc.work_graph]
pop ecx
sub ebx,MAGIC1+3
mcall
madd ecx, 14, 14
mcall
madd ecx, 14, 14
mcall
madd ecx, 14, 14
mcall
push ebx
mpack ebx,MAGIC1,MAGIC1
sub ecx, 14*3
mcall
mov ebx,[esp-2]
pop bx
mcall
add esp,2
mpack ebx,0,MAGIC1-1
mpack ecx,1+1, 14-2
mcall 8,,,0x4000000B ; Button: Enter Infile
madd ecx, 14,0
mcall ,,,0x4000000C ; Button: Enter Outfile
madd ecx, 14,0
mcall ,,,0x4000000D ; Button: Enter Path
mpack ebx,[pinfo.box.width],MAGIC1
msub ebx,MAGIC1+10+1,0
mpack ecx,0, (14*3+16)/3-1
madd ecx,1,0
mcall ,,,0x00000002,[sc.work_button]
madd ecx, (14*3+16)/3+1,0
mcall ,,,0x00000003
madd ecx, (14*3+16)/3+1,0
mcall ,,,4
mpack ebx,6,0 ; Draw Window Text
add ebx,1+ 14/2-3
mov ecx,[sc.work_text]
mov edx,text
mov esi,text.line_size
mov eax,4
newline:
mcall
add ebx, 14
add edx,text.line_size
cmp byte[edx],'x'
jne newline
mov ebx,[pinfo.box.width]
sub ebx,MAGIC1+10+1-9
shl ebx,16
add ebx,1+( (14*3+16)/3-1)/2-3
mcall ,,[sc.work_button_text],s_compile,7
add ebx,(14*3+16)/3+1
mcall ,,,s_run
add ebx,(14*3+16)/3+1
mcall ,,,s_debug
mpack ebx,MAGIC1+6,0
add ebx,1+ 14/2-3+ 14*0
mov esi,[pinfo.box.width]
sub esi,MAGIC1*2+5*2+6+3
mov eax,esi
mov cl,6
div cl
cmp al,MAX_PATH
jbe @f
mov al,MAX_PATH
@@: movzx esi,al
mcall 4,,[sc.work_text],infile
add ebx,14
mcall ,,,outfile
add ebx,14
mcall ,,,path
call draw_checkbox
call draw_messages
mcall 12,2 ; End of Draw
popa
ret
bottom_right dd ?
draw_checkbox:
mcall 8,<5,10>,<14*3+5,10>,14,[sc.work_button]
cmp [bGenerateDebugInfo], 0
jz @f
mov edx, [sc.work_button_text]
mcall 38,<7,13>,<14*3+7,14*3+13>
mcall 38,,<14*3+13,14*3+7>
@@:
mov ecx, [sc.work_text]
or ecx, 0x80000000
mcall 4,<20,14*3+7>,,s_dbgdescr
ret
draw_messages:
mov eax,13 ; clear work area
mpack ebx,7-2,[pinfo.box.width]
sub ebx,5*2+7*2-1-2*2
mpack ecx,0,[pinfo.box.height]
madd ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25)
mov word[bottom_right+2],bx
mov word[bottom_right],cx
msub [bottom_right],7,11
add [bottom_right],7 shl 16 + 53
mov edx,[sc.work]
mcall
_cy = 0
_sy = 2
_cx = 4
_sx = 6
push ebx ecx
mpack ebx,4,5
add bx,[esp+_cx]
mov ecx,[esp+_sy-2]
mov cx,[esp+_sy]
msub ecx,1,1
mcall 38,,,[sc.work_graph]
mov si,[esp+_cy]
add cx,si
shl esi,16
add ecx,esi
madd ecx,1,1
mcall
mpack ebx,4,4
mov esi,[esp+_sy-2]
mov si,cx
mov ecx,esi
mcall
mov si,[esp+_cx]
add bx,si
shl esi,16
add ebx,esi
madd ebx,1,1
mcall
pop ecx ebx
ret
; read string
f1: mov [addr],infile
add [ya], 14*0
jmp rk
f2: mov [addr],outfile
add [ya], 14*1
jmp rk
f3: mov [addr],path
add [ya], 14*2
rk:
mov edi,[addr]
mov al,0
mov ecx,MAX_PATH
add edi,ecx
dec edi
std
repe scasb
sub ecx,MAX_PATH
neg ecx
mov al,$1C ; ''
add edi,2
push edi
cld
rep stosb
call print_text
pop edi
f11:mcall 10
cmp eax,2
jne read_done
mcall; 2
shr eax,8
cmp al,13
je read_done
cmp al,8
jne nobs
cmp edi,[addr]
je f11
sub edi,1
mov byte[edi],$1C ; '_'
call print_text
jmp f11
nobs:
movzx ebx,al
sub ebx,$20
jle f11
sub al,[sub_table+ebx]
keyok:
mov ecx,[addr]
add ecx,MAX_PATH
cmp edi,ecx
jae f11
mov [edi],al
call print_text
inc edi
jmp f11
read_done:
mov ecx,[addr]
add ecx,MAX_PATH
sub ecx,edi
mov al,0;' '
cld
rep stosb
call print_text
jmp still
print_text:
mpack ebx,MAGIC1+6,[pinfo.box.width]
sub ebx,MAGIC1*2+19
movzx esi,bx
mov ecx,[ya-2]
mov cx,8
mcall 13,,,[sc.work]
mpack ebx,MAGIC1+6,[ya]
mov eax,esi
mov cl,6
div cl
cmp al,MAX_PATH
jbe @f
mov al,MAX_PATH
@@: movzx esi,al
mcall 4,,[sc.work_text],[addr]
ret
; DATA
text:
db ' INFILE:'
.line_size = $-text
db 'OUTFILE:'
db ' PATH:'
db 'x'
s_compile db 'COMPILE'
s_run db ' RUN '
s_debug db ' DEBUG '
s_dbgdescr db 'Generate debug information',0
infile db 'example.asm'
times MAX_PATH+$-infile db 0
outfile db 'example'
times MAX_PATH+$-outfile db 0
path db '/rd/1/'
times MAX_PATH+$-path db 0
lf db 13,10,0
addr dd 0x0
ya dd 0x0
zero db 0x0
mov_param_str:
@@:
mov al,[esi]
cmp al,','
je @f
cmp al,0
je @f
mov [edi],al
inc esi
inc edi
jmp @b
@@:
mov al,0
stosb
ret
start:
cmp [_mode],NORMAL_MODE
jne @f
call draw_messages
mov [textxy],7 shl 16 + 70
@@:
mov esi,_logo
call display_string
;
; Fasm native code
;
mov [input_file],infile
mov [output_file],outfile
call init_memory
call make_timestamp
mov [start_time],eax
call preprocessor
call parser
call assembler
cmp [bGenerateDebugInfo], 0
jz @f
call symbol_dump
@@:
call formatter
call display_user_messages
movzx eax,[current_pass]
inc eax
call display_number
mov esi,_passes_suffix
call display_string
call make_timestamp
sub eax,[start_time]
xor edx,edx
mov ebx,100
div ebx
or eax,eax
jz display_bytes_count
xor edx,edx
mov ebx,10
div ebx
push edx
call display_number
mov dl,'.'
call display_character
pop eax
call display_number
mov esi,_seconds_suffix
call display_string
display_bytes_count:
mov eax,[written_size]
call display_number
mov esi,_bytes_suffix
call display_string
xor al,al
cmp [_run_outfile],0
je @f
mov edx,outfile
call make_fullpaths
mov eax,70
mov ebx,file_info_start
xor ecx,ecx
mcall
@@:
jmp exit_program
include 'system.inc'
include 'version.inc'
include 'errors.inc'
include 'expressi.inc'
include 'preproce.inc'
include 'parser.inc'
include 'assemble.inc'
include 'formats.inc'
include 'x86_64.inc'
include 'tables.inc'
include 'symbdump.inc'
include 'messages.inc'
title db appname,VERSION_STRING,0
_logo db 'flat assembler version ',VERSION_STRING,13,10,0
_passes_suffix db ' passes, ',0
_seconds_suffix db ' seconds, ',0
_bytes_suffix db ' bytes.',13,10,0
_include db 'INCLUDE',0
_counter db 4,'0000'
_mode dd NORMAL_MODE
_run_outfile dd 0
bGenerateDebugInfo db 0
sub_table:
times $41 db $00
times $1A db $20
times $25 db $00
times $10 db $20
times $30 db $00
times $10 db $50
times $04 db $00,$01
times $08 db $00
;include_debug_strings
params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
program_end:
rb 1000h
align 4
include 'variable.inc'
program_base dd ?
buffer_address dd ?
memory_setting dd ?
start_time dd ?
memblock dd ?
predefinitions rb 1000h
dbgfilename rb MAX_PATH+4
sc system_colors
max_handles = 8
fileinfos rb (4+20+MAX_PATH)*max_handles
fileinfos_end:
pinfo process_information
align 1000h
rb 1000h
stacktop:

View File

@@ -1,53 +0,0 @@
center fix false
SYSTEMCOLORS fix sc
PROCESSINFO fix pinfo
macro get_sys_colors wnd_skin,font_1 {
mcall 48,3,SYSTEMCOLORS,sizeof.system_colors
if wnd_skin <> 0
or [SYSTEMCOLORS+system_colors.work],0x03000000
end if
if font_1 <> 0
or [SYSTEMCOLORS+system_colors.grab_text],0x10000000
end if
}
macro draw_caption _edx,_esi {
mov edx,_edx
mov esi,_esi
call __draw_caption
}
macro mmov reg,a1,a2 {
mov reg,(a1) shl 16 + (a2)
}
macro madd reg,a1,a2 {
add reg,(a1) shl 16 + (a2)
}
macro msub reg,a1,a2 {
sub reg,(a1) shl 16 + (a2)
}
macro jmpe reg,def,[val,lab] {
forward
cmp reg,val
je lab
common
if ~def eq
jmp def
end if
}
macro func name {
if used name
name:
}
macro endf {
end if
}
@^ fix macro comment {
^@ fix }

File diff suppressed because it is too large Load Diff

View File

@@ -1,51 +0,0 @@
; flat assembler core
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
_out_of_memory db 'out of memory',0
_stack_overflow db 'out of stack space',0
_main_file_not_found db 'source file not found',0
_unexpected_end_of_file db 'unexpected end of file',0
_code_cannot_be_generated db 'code cannot be generated',0
_format_limitations_exceeded db 'format limitations exceeded',0
_invalid_definition db 'invalid definition provided',0
_write_failed db 'write failed',0
_file_not_found db 'file not found',0
_error_reading_file db 'error reading file',0
_invalid_file_format db 'invalid file format',0
_invalid_macro_arguments db 'invalid macro arguments',0
_incomplete_macro db 'incomplete macro',0
_unexpected_characters db 'unexpected characters',0
_invalid_argument db 'invalid argument',0
_illegal_instruction db 'illegal instruction',0
_invalid_operand db 'invalid operand',0
_invalid_operand_size db 'invalid size of operand',0
_operand_size_not_specified db 'operand size not specified',0
_operand_sizes_do_not_match db 'operand sizes do not match',0
_invalid_address_size db 'invalid size of address value',0
_address_sizes_do_not_agree db 'address sizes do not agree',0
_prefix_conflict db 'disallowed combination of registers',0
_long_immediate_not_encodable db 'not encodable with long immediate',0
_relative_jump_out_of_range db 'relative jump out of range',0
_invalid_expression db 'invalid expression',0
_invalid_address db 'invalid address',0
_invalid_value db 'invalid value',0
_value_out_of_range db 'value out of range',0
_undefined_symbol db 'undefined symbol',0
_symbol_out_of_scope_1 db 'symbol',0
_symbol_out_of_scope_2 db 'out of scope',0
_invalid_use_of_symbol db 'invalid use of symbol',0
_name_too_long db 'name too long',0
_invalid_name db 'invalid name',0
_reserved_word_used_as_symbol db 'reserved word used as symbol',0
_symbol_already_defined db 'symbol already defined',0
_missing_end_quote db 'missing end quote',0
_missing_end_directive db 'missing end directive',0
_unexpected_instruction db 'unexpected instruction',0
_extra_characters_on_line db 'extra characters on line',0
_section_not_aligned_enough db 'section is not aligned enough',0
_setting_already_specified db 'setting already specified',0
_data_already_defined db 'data already defined',0
_too_many_repeats db 'too many repeats',0
_invoked_error db 'error directive invoked in source file',0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,180 +0,0 @@
; Macroinstructions for defining data structures
macro struct name
{ fields@struct equ name
match child parent, name \{ fields@struct equ child,fields@\#parent \}
sub@struct equ
struc db [val] \{ \common fields@struct equ fields@struct,.,db,<val> \}
struc dw [val] \{ \common fields@struct equ fields@struct,.,dw,<val> \}
struc du [val] \{ \common fields@struct equ fields@struct,.,du,<val> \}
struc dd [val] \{ \common fields@struct equ fields@struct,.,dd,<val> \}
struc dp [val] \{ \common fields@struct equ fields@struct,.,dp,<val> \}
struc dq [val] \{ \common fields@struct equ fields@struct,.,dq,<val> \}
struc dt [val] \{ \common fields@struct equ fields@struct,.,dt,<val> \}
struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \}
struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \}
struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \}
struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \}
struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \}
struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \}
macro db [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,db,<val> \}
macro dw [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dw,<val> \}
macro du [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,du,<val> \}
macro dd [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dd,<val> \}
macro dp [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dp,<val> \}
macro dq [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dq,<val> \}
macro dt [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dt,<val> \}
macro rb count \{ \local anonymous
fields@struct equ fields@struct,anonymous,db,count dup (?) \}
macro rw count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dw,count dup (?) \}
macro rd count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dd,count dup (?) \}
macro rp count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dp,count dup (?) \}
macro rq count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dq,count dup (?) \}
macro rt count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dt,count dup (?) \}
macro union \{ fields@struct equ fields@struct,,union,<
sub@struct equ union \}
macro struct \{ fields@struct equ fields@struct,,substruct,<
sub@struct equ substruct \}
virtual at 0 }
macro ends
{ match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt
restruc rb,rw,rd,rp,rq,rt
purge db,dw,du,dd,dp,dq,dt
purge rb,rw,rd,rp,rq,rt
purge union,struct
match name=,fields,fields@struct \\{ fields@struct equ
make@struct name,fields
fields@\\#name equ fields \\}
end virtual \}
match any, sub@struct \{ fields@struct equ fields@struct> \}
restore sub@struct }
macro make@struct name,[field,type,def]
{ common
if $
display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah
err
end if
local define
define equ name
forward
local sub
match , field \{ make@substruct type,name,sub def
define equ define,.,sub, \}
match any, field \{ define equ define,.#field,type,<def> \}
common
match fields, define \{ define@struct fields \} }
macro define@struct name,[field,type,def]
{ common
local list
list equ
forward
if ~ field eq .
name#field type def
sizeof.#name#field = $ - name#field
else
rb sizeof.#type
end if
local value
match any, list \{ list equ list, \}
list equ list <value>
common
sizeof.#name = $
restruc name
match values, list \{
struc name value \\{
match any, fields@struct \\\{ fields@struct equ fields@struct,.,name,<values> \\\}
match , fields@struct \\\{ label .
forward
match , value \\\\{ field type def \\\\}
match any, value \\\\{ field type value
if ~ field eq .
rb sizeof.#name#field - ($-field)
end if \\\\}
common \\\} \\} \} }
macro enable@substruct
{ macro make@substruct substruct,parent,name,[field,type,def]
\{ \common
\local define
define equ parent,name
\forward
\local sub
match , field \\{ match any, type \\\{ enable@substruct
make@substruct type,name,sub def
purge make@substruct
define equ define,.,sub, \\\} \\}
match any, field \\{ define equ define,.\#field,type,<def> \\}
\common
match fields, define \\{ define@\#substruct fields \\} \} }
enable@substruct
macro define@union parent,name,[field,type,def]
{ common
virtual at 0
forward
if ~ field eq .
virtual at 0
parent#field type def
sizeof.#parent#field = $ - parent#field
end virtual
if sizeof.#parent#field > $
rb sizeof.#parent#field - $
end if
else if sizeof.#type > $
rb sizeof.#type - $
end if
common
sizeof.#name = $
end virtual
struc name [value] \{ \common
label .\#name
last@union equ
forward
match any, last@union \\{ virtual at .\#name
field type def
end virtual \\}
match , last@union \\{ match , value \\\{ field type def \\\}
match any, value \\\{ field type value \\\} \\}
last@union equ field
common rb sizeof.#name - ($ - .\#name) \} }
macro define@substruct parent,name,[field,type,def]
{ common
virtual at 0
forward
if ~ field eq .
parent#field type def
sizeof.#parent#field = $ - parent#field
else
rb sizeof.#type
end if
local value
common
sizeof.#name = $
end virtual
struc name value \{
label .\#name
forward
match , value \\{ field type def \\}
match any, value \\{ field type value
if ~ field eq .
rb sizeof.#parent#field - ($-field)
end if \\}
common \} }

View File

@@ -1,110 +0,0 @@
symbol_dump:
push edi
mov edx,[memory_end]
symb_dump:
cmp edx,[labels_list]
jbe symbols_dumped
sub edx,LABEL_STRUCTURE_SIZE
cmp dword [edx+24],0
je symb_dump ; do not dump anonymous symbols
test byte [edx+8],1
jz symb_dump ; do not dump symbols that didn't get defined
mov ax,[current_pass]
cmp ax,[edx+16]
jne symb_dump
test byte [edx+8],4 or 2
jnz symb_dump ; do not dump assembly-time variables
; do not dump variables defined with '='
cmp word [edx+12], 0
jnz symb_dump ; do not dump register-based variables
mov al, '0'
stosb
mov al, 'x'
stosb
mov eax, [edx+4]
mov ecx, 8
@@:
rol eax, 4
test al, 0xF
loopz @b
jz .nohigh
inc ecx
@@:
push eax
and al, 0xF
cmp al, 10
sbb al, 69h
das
stosb
pop eax
rol eax, 4
loop @b
mov eax, [edx]
mov ecx, 8
jmp .low
.nohigh:
mov eax, [edx]
mov ecx, 8
@@:
rol eax, 4
test al, 0xF
loopz @b
inc ecx
.low:
push eax
and al, 0xF
cmp al, 10
sbb al, 69h
das
stosb
pop eax
rol eax, 4
loop .low
mov al, ' '
stosb
mov esi,[edx+24]
movzx ecx,byte [esi-1]
rep movsb
mov ax,0A0Dh
stosw
jmp symb_dump
symbols_dumped:
mov edx,dbgfilename
push esi edi
mov esi, outfile
mov edi, edx
@@:
lodsb
stosb
test al, al
jnz @b
lea ecx, [edi-1]
@@:
dec edi
cmp edi, edx
jb @f
cmp byte [edi], '/'
jz @f
cmp byte [edi], '.'
jnz @b
mov ecx, edi
@@:
mov dword [ecx], '.dbg'
mov byte [ecx+4], 0
pop edi esi
call create
mov edx,[esp]
mov ecx,edi
sub ecx,edx
call write
call close
pop edi
ret

View File

@@ -1,573 +0,0 @@
; flat assembler
; Copyright (c) 1999-2007, Tomasz Grysztar
; All rights reserved.
struc FILEIO
{ .cmd dd ?
.offset dd ?
dd ?
.count dd ?
.buff dd ?
db ?
.name dd ?
};
struc FILEINFO
{ .attr dd ?
.flags dd ?
.cr_time dd ?
.cr_date dd ?
.acc_time dd ?
.acc_date dd ?
.mod_time dd ?
.mod_date dd ?
.size dd ?
}
;file_info_open: dd 0,0,0xffffff,0x20000,0xf0000
fullpath_open: ; db '/RD/1/EXAMPLE.ASM'
times MAX_PATH db 0
;file_info_write: dd 1,0,0,0,0xf0000
fullpath_write:; db '/RD/1/EXAMPLE'
times MAX_PATH db 0
file_info_start:
dd 7
dd 0
dd 0
dd 0
dd 0
fullpath_start: ; db '/RD/1/EXAMPLE'
times MAX_PATH db 0
file_info_debug:
dd 7
dd 0
dd fullpath_start
dd 0, 0
db '/SYS/DEVELOP/MTDBG',0
_ramdisk db '/RD/1/'
filepos dd 0x0
init_memory:
mov ecx, 16*1024*1024
allocate_memory:
mov [memory_setting],ecx
mcall 68, 12
or eax,eax
jz out_of_memory
mov [additional_memory],eax
add eax,[memory_setting]
mov [memory_end],eax
mov eax,[memory_setting]
shr eax,2
add eax,[additional_memory]
mov [additional_memory_end],eax
mov [memory_start],eax
ret
exit_program:
cmp [_mode],NORMAL_MODE
jne @f
mcall 68, 13, [memblock]
jmp still
@@:
or eax,-1
mcall
make_timestamp:
push ebx
mcall 26,9
imul eax,10
pop ebx
ret
get_environment_variable:
mov ecx,[memory_end]
sub ecx,edi
cmp ecx,7
jb out_of_memory
cmp dword[esi],'INCL'
jne .finish
mov esi,_ramdisk
mov ecx,6
cld
rep movsb
.finish:
; stc
ret
alloc_handle:
call make_fullpaths
mov ebx, fileinfos+4
@@:
cmp dword [ebx], -1
jz .found
add ebx, 4+20+MAX_PATH
cmp ebx, fileinfos_end
jb @b
stc
ret
.found:
and dword [ebx+4], 0
and dword [ebx+8], 0
push esi edi ecx
mov esi, fullpath_open
lea edi, [ebx+20]
mov ecx, MAX_PATH
rep movsb
pop ecx edi esi
ret ; CF=0
create:
call alloc_handle
jc .ret
and dword [ebx-4], 0
mov dword [ebx], 2
.ret:
ret
open:
; call make_fullpaths
;; mov eax,fullpath_open
;; DEBUGF '"%s"\n',eax
; mov dword[file_info_open+8],-1
; mcall 58,file_info_open
; or eax,eax ; found
; jz @f
; cmp eax,6
; jne file_error
;@@: mov [filesize],ebx
; clc
; ret
;file_error:
; stc
; ret
call alloc_handle
jc .ret
mov dword [ebx], 5
and dword [ebx+12], 0
mov dword [ebx+16], fileinfo
mov eax, 70
push ebx
mcall
pop ebx
test eax, eax
jnz .fail
mov eax, [fileinfo.size]
mov [ebx-4], eax
and dword [ebx], 0
.ret:
ret
.fail:
or dword [ebx], -1 ; close handle
stc
ret
read:
; pusha
; mov edi,edx
; mov esi,[filepos]
; add esi,0x20000
; cld
; rep movsb
; popa
;; ret
mov [ebx+12], ecx
mov [ebx+16], edx
push ebx
mov eax, 70
mcall
xchg eax, [esp]
add [eax+4], ebx
adc [eax+8], dword 0
mov ebx, eax
pop eax
test eax, eax
jz .ok
cmp eax, 6
jz .ok
stc
.ok:
ret
close:
or dword [ebx], -1
ret
; ebx file handle
; ecx count of bytes to write
; edx pointer to buffer
write:
; pusha
; mov [file_info_write+8],ecx
; mov [file_info_write+12],edx
; mov [filesize],edx
; mov eax,58
; mov ebx,file_info_write
; mcall
; popa
; ret
mov [ebx+12], ecx
mov [ebx+16], edx
push ebx
mov eax, 70
mcall
xchg eax, [esp]
add [eax+4], ebx
adc [eax+8], dword 0
mov ebx, eax
pop eax
mov byte [ebx], 3
cmp eax, 1
cmc
ret
make_fullpaths:
pusha
push edx
mov esi,path ; open
; DEBUGF " '%s'",esi
mov edi,fullpath_open
cld
newc1:
movsb
cmp byte[esi],0;' '
jne newc1
mov esi,[esp]
cmp byte[esi],'/'
jne @f
mov edi,fullpath_open
@@:
lodsb
stosb
cmp al,0
jne @b
; mov ecx,12
; cld
; rep movsb
; mov byte[edi],0
mov esi,path ; write
mov edi,fullpath_write
cld
newc2:
movsb
cmp byte[esi],0;' '
jne newc2
mov esi,[esp]
cmp byte[esi],'/'
jne @f
mov edi,fullpath_write
@@:
lodsb
stosb
cmp al,0
jne @b
; mov ecx,12
; cld
; rep movsb
; mov byte[edi],0
mov esi,path ; start
mov edi,fullpath_start
cld
newc3:
movsb
cmp byte[esi],0;' '
jne newc3
; mov esi,[esp]
pop esi
cmp byte[esi],'/'
jne @f
mov edi,fullpath_start
@@:
lodsb
stosb
cmp al,0
jne @b
; mov ecx,12
; cld
; rep movsb
; mov byte[edi],0
; add esp,4
popa
ret
lseek:
cmp al,0
jnz @f
and dword [ebx+4], 0
and dword [ebx+8], 0
@@: cmp al,2
jnz @f
mov eax, [ebx-4]
mov [ebx+4], eax
and dword [ebx+8], 0
@@: add dword [ebx+4], edx
adc dword [ebx+8], 0
ret
display_character:
pusha
cmp [_mode],NORMAL_MODE
jne @f
cmp dl,13
jz dc2
cmp dl,0xa
jnz dc1
and [textxy],0x0000FFFF
add [textxy], 7 shl 16 +53 and 0xFFFF0000 + 10
dc2:
popa
ret
dc1:
mov eax,[textxy]
cmp ax,word[bottom_right]
ja dc2
shr eax,16
cmp ax,word[bottom_right+2]
ja dc2
mov [dc],dl
mcall 4,[textxy],[sc.work_text],dc,1
add [textxy],0x00060000
popa
ret
@@:
mov eax,63
mov ebx,1
mov cl,dl
mcall
popa
ret
display_string:
pusha
@@:
cmp byte[esi],0
je @f
mov dl,[esi]
call display_character
add esi,1
jmp @b
@@:
popa
ret
display_number:
push ebx
mov ecx,1000000000
xor edx,edx
xor bl,bl
display_loop:
div ecx
push edx
cmp ecx,1
je display_digit
or bl,bl
jnz display_digit
or al,al
jz digit_ok
not bl
display_digit:
mov dl,al
add dl,30h
push ebx ecx
call display_character
pop ecx ebx
digit_ok:
mov eax,ecx
xor edx,edx
mov ecx,10
div ecx
mov ecx,eax
pop eax
or ecx,ecx
jnz display_loop
pop ebx
ret
display_user_messages:
; push [skinh]
; pop [textxy]
; add [textxy], 7 shl 16 +53
mov [displayed_count],0
call show_display_buffer
cmp [displayed_count],1
jb line_break_ok
je make_line_break
mov ax,word[last_displayed]
cmp ax,0A0Dh
je line_break_ok
cmp ax,0D0Ah
je line_break_ok
make_line_break:
mov esi,lf
call display_string
line_break_ok:
ret
display_block:
pusha
@@: mov dl,[esi]
call display_character
inc esi
loop @b
popa
ret
fatal_error:
mov esi,error_prefix
call display_string
pop esi
call display_string
mov esi,error_suffix
call display_string
mov esi,lf
call display_string
mov al,0FFh
jmp exit_program
assembler_error:
call display_user_messages
push dword 0
mov ebx,[current_line]
get_error_lines:
push ebx
test byte [ebx+7],80h
jz display_error_line
mov edx,ebx
find_definition_origin:
mov edx,[edx+12]
test byte [edx+7],80h
jnz find_definition_origin
push edx
mov ebx,[ebx+8]
jmp get_error_lines
display_error_line:
mov esi,[ebx]
call display_string
mov esi,line_number_start
call display_string
mov eax,[ebx+4]
and eax,7FFFFFFFh
call display_number
mov dl,']'
call display_character
pop esi
cmp ebx,esi
je line_number_ok
mov dl,20h
call display_character
push esi
mov esi,[esi]
movzx ecx,byte [esi]
inc esi
call display_block
mov esi,line_number_start
call display_string
pop esi
mov eax,[esi+4]
and eax,7FFFFFFFh
call display_number
mov dl,']'
call display_character
line_number_ok:
mov esi,line_data_start
call display_string
mov esi,ebx
mov edx,[esi]
call open
mov al,2
xor edx,edx
call lseek
mov edx,[esi+8]
sub eax,edx
push eax
xor al,al
call lseek
mov ecx,[esp]
mov edx,[additional_memory]
lea eax,[edx+ecx]
cmp eax,[additional_memory_end]
ja out_of_memory
call read
call close
pop ecx
mov esi,[additional_memory]
get_line_data:
mov al,[esi]
cmp al,0Ah
je display_line_data
cmp al,0Dh
je display_line_data
cmp al,1Ah
je display_line_data
or al,al
jz display_line_data
inc esi
loop get_line_data
display_line_data:
mov ecx,esi
mov esi,[additional_memory]
sub ecx,esi
call display_block
mov esi,cr_lf
call display_string
pop ebx
or ebx,ebx
jnz display_error_line
mov esi,error_prefix
call display_string
pop esi
call display_string
mov esi,error_suffix
call display_string
jmp exit_program
align 4
fileinfo FILEINFO
character db ?,0
bytes_count dd ?
textxy dd 0x000500A0
dc db 0x0
filesize dd 0x0
displayed_count dd ?
last_displayed rb 2
error_prefix db 'error: ',0
error_suffix db '.',0
line_data_start db ':'
cr_lf db 0Dh,0Ah,0
line_number_start db ' [',0
macro dm string { db string,0 }

File diff suppressed because it is too large Load Diff

View File

@@ -1,130 +0,0 @@
; flat assembler core variables
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
; Variables which have to be set up by interface:
memory_start dd ?
memory_end dd ?
additional_memory dd ?
additional_memory_end dd ?
stack_limit dd ?
input_file dd ?
output_file dd ?
symbols_file dd ?
passes_limit dw ?
; Internal core variables:
current_pass dw ?
include_paths dd ?
free_additional_memory dd ?
source_start dd ?
code_start dd ?
code_size dd ?
real_code_size dd ?
written_size dd ?
headers_size dd ?
current_line dd ?
macro_line dd ?
macro_block dd ?
macro_block_line dd ?
macro_block_line_number dd ?
macro_symbols dd ?
struc_name dd ?
struc_label dd ?
instant_macro_start dd ?
parameters_end dd ?
locals_counter rb 8
current_locals_prefix dd ?
anonymous_reverse dd ?
anonymous_forward dd ?
labels_list dd ?
label_hash dd ?
label_leaf dd ?
hash_tree dd ?
org_origin dq ?
org_registers dd ?
org_symbol dd ?
org_start dd ?
undefined_data_start dd ?
undefined_data_end dd ?
counter dd ?
counter_limit dd ?
error_info dd ?
error_line dd ?
error dd ?
display_buffer dd ?
structures_buffer dd ?
number_start dd ?
current_offset dd ?
value dq ?
fp_value rd 8
adjustment dq ?
symbol_identifier dd ?
address_symbol dd ?
address_high dd ?
format_flags dd ?
resolver_flags dd ?
symbols_stream dd ?
number_of_relocations dd ?
number_of_sections dd ?
stub_size dd ?
stub_file dd ?
current_section dd ?
machine dw ?
subsystem dw ?
subsystem_version dd ?
image_base dd ?
image_base_high dd ?
resource_data dd ?
resource_size dd ?
parenthesis_stack dd ?
blocks_stack dd ?
parsed_lines dd ?
logical_value_parentheses dd ?
file_extension dd ?
labels_type db ?
code_type db ?
virtual_data db ?
operand_size db ?
size_override db ?
operand_prefix db ?
rex_prefix db ?
opcode_prefix db ?
base_code db ?
extended_code db ?
supplemental_code db ?
postbyte_register db ?
immediate_size db ?
mmx_size db ?
jump_type db ?
push_size db ?
value_size db ?
address_size db ?
size_declared db ?
value_undefined db ?
value_type db ?
compare_type db ?
logical_value_wrapping db ?
next_pass_needed db ?
macro_status db ?
segment_register db ?
prefixed_instruction db ?
fp_sign db ?
fp_format db ?
output_format db ?
characters rb 100h
converted rb 100h
message rb 200h

View File

@@ -1,39 +0,0 @@
; flat assembler version 1.68
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
;
; This programs is free for commercial and non-commercial use as long as
; the following conditions are adhered to.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are
; met:
;
; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
; The licence and distribution terms for any publically available
; version or derivative of this code cannot be changed. i.e. this code
; cannot simply be copied and put under another distribution licence
; (including the GNU Public Licence).
VERSION_STRING equ "1.68"
VERSION_MAJOR = 1
VERSION_MINOR = 68

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
if tup.getconfig("NO_FASM") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_fasm.lua")
add_include(tup.getvariantdir())
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
tup.rule({"fasm.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "fasm")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +0,0 @@
@erase lang.inc
@echo lang fix en_US >lang.inc
@fasm -m 16384 fasm.asm fasm
@erase lang.inc
@kpack fasm
@pause

View File

@@ -1,6 +0,0 @@
@erase lang.inc
@echo lang fix ru_RU >lang.inc
@fasm -m 16384 fasm.asm fasm
@erase lang.inc
@kpack fasm
@pause

View File

@@ -1,194 +0,0 @@
; flat assembler core
; Copyright (c) 1999-2016, Tomasz Grysztar.
; All rights reserved.
out_of_memory:
push _out_of_memory
jmp fatal_error
stack_overflow:
push _stack_overflow
jmp fatal_error
main_file_not_found:
push _main_file_not_found
jmp fatal_error
write_failed:
push _write_failed
jmp fatal_error
unexpected_end_of_file:
push _unexpected_end_of_file
jmp general_error
code_cannot_be_generated:
push _code_cannot_be_generated
jmp general_error
format_limitations_exceeded:
push _format_limitations_exceeded
jmp general_error
invalid_definition:
push _invalid_definition
general_error:
cmp [symbols_file],0
je fatal_error
call dump_preprocessed_source
jmp fatal_error
file_not_found:
push _file_not_found
jmp error_with_source
error_reading_file:
push _error_reading_file
jmp error_with_source
invalid_file_format:
push _invalid_file_format
jmp error_with_source
invalid_macro_arguments:
push _invalid_macro_arguments
jmp error_with_source
incomplete_macro:
push _incomplete_macro
jmp error_with_source
unexpected_characters:
push _unexpected_characters
jmp error_with_source
invalid_argument:
push _invalid_argument
jmp error_with_source
illegal_instruction:
push _illegal_instruction
jmp error_with_source
invalid_operand:
push _invalid_operand
jmp error_with_source
invalid_operand_size:
push _invalid_operand_size
jmp error_with_source
operand_size_not_specified:
push _operand_size_not_specified
jmp error_with_source
operand_sizes_do_not_match:
push _operand_sizes_do_not_match
jmp error_with_source
invalid_address_size:
push _invalid_address_size
jmp error_with_source
address_sizes_do_not_agree:
push _address_sizes_do_not_agree
jmp error_with_source
disallowed_combination_of_registers:
push _disallowed_combination_of_registers
jmp error_with_source
long_immediate_not_encodable:
push _long_immediate_not_encodable
jmp error_with_source
relative_jump_out_of_range:
push _relative_jump_out_of_range
jmp error_with_source
invalid_expression:
push _invalid_expression
jmp error_with_source
invalid_address:
push _invalid_address
jmp error_with_source
invalid_value:
push _invalid_value
jmp error_with_source
value_out_of_range:
push _value_out_of_range
jmp error_with_source
undefined_symbol:
mov edi,message
mov esi,_undefined_symbol
call copy_asciiz
push message
cmp [error_info],0
je error_with_source
mov esi,[error_info]
mov esi,[esi+24]
or esi,esi
jz error_with_source
mov byte [edi-1],20h
call write_quoted_symbol_name
jmp error_with_source
copy_asciiz:
lods byte [esi]
stos byte [edi]
test al,al
jnz copy_asciiz
ret
write_quoted_symbol_name:
mov al,27h
stosb
movzx ecx,byte [esi-1]
rep movs byte [edi],[esi]
mov ax,27h
stosw
ret
symbol_out_of_scope:
mov edi,message
mov esi,_symbol_out_of_scope_1
call copy_asciiz
cmp [error_info],0
je finish_symbol_out_of_scope_message
mov esi,[error_info]
mov esi,[esi+24]
or esi,esi
jz finish_symbol_out_of_scope_message
mov byte [edi-1],20h
call write_quoted_symbol_name
finish_symbol_out_of_scope_message:
mov byte [edi-1],20h
mov esi,_symbol_out_of_scope_2
call copy_asciiz
push message
jmp error_with_source
invalid_use_of_symbol:
push _invalid_use_of_symbol
jmp error_with_source
name_too_long:
push _name_too_long
jmp error_with_source
invalid_name:
push _invalid_name
jmp error_with_source
reserved_word_used_as_symbol:
push _reserved_word_used_as_symbol
jmp error_with_source
symbol_already_defined:
push _symbol_already_defined
jmp error_with_source
missing_end_quote:
push _missing_end_quote
jmp error_with_source
missing_end_directive:
push _missing_end_directive
jmp error_with_source
unexpected_instruction:
push _unexpected_instruction
jmp error_with_source
extra_characters_on_line:
push _extra_characters_on_line
jmp error_with_source
section_not_aligned_enough:
push _section_not_aligned_enough
jmp error_with_source
setting_already_specified:
push _setting_already_specified
jmp error_with_source
data_already_defined:
push _data_already_defined
jmp error_with_source
too_many_repeats:
push _too_many_repeats
jmp error_with_source
assertion_failed:
push _assertion_failed
jmp error_with_source
invoked_error:
push _invoked_error
error_with_source:
cmp [symbols_file],0
je assembler_error
call dump_preprocessed_source
call restore_preprocessed_source
jmp assembler_error

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,758 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; flat assembler source ;;
;; Copyright (c) 1999-2020, Tomasz Grysztar ;;
;; All rights reserved. ;;
;; ;;
;; KolibriOS port by KolibriOS Team ;;
;; Menuet port by VT ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
NORMAL_MODE = 8
CONSOLE_MODE = 32
MAGIC1 = 6*(text.line_size-1)+14
MAX_PATH = 100
DEFAULT_WIN_W = 450
DEFAULT_WIN_H = 350
LINE_H = 25
RIGHT_BTN_W = 80
APP_MEMORY = 0x00800000
;; Menuet header
appname equ "flat assembler "
;---------------------------------------------------------------------
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; program start
dd program_end ; program image size
dd stacktop ; required amount of memory
dd stacktop ; stack
dd params,cur_dir_path ; parameters,icon
;---------------------------------------------------------------------
include 'lang.inc'
include '../../../../macros.inc'
purge add,sub ; macros.inc does incorrect substitution
include 'fasm.inc'
include '../../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../../KOSfuncs.inc'
include '../../../../load_lib.mac'
@use_library
center fix true
;---------------------------------------------------------------------
START: ; Start of execution
mov edi, fileinfos
mov ecx, (fileinfos_end-fileinfos)/4
or eax, -1
rep stosd
push 68
pop eax
push 11
pop ebx
mcall
cmp [params],0
jz start_1
;---------GerdtR
or ecx,-1
mov esi,params
cmp byte[esi],' '
jne @f
mov edi,esi
mov al,' '
repe scasb
mov esi,edi
dec esi
@@:
mov edi,dbgWord
@@: lodsb
scasb
jne NoOutDebugInfo
cmp byte[edi],0
jnz @b
cmp byte[esi],' '
jne NoOutDebugInfo
mov edi,esi
mov al,' '
repe scasb
mov esi,edi
dec esi
mov edi,params
@@: lodsb
stosb
test al,al
jnz @b
; mov [bGenerateDebugInfo], 1
or dword[ch1_dbg.flags],10b
NoOutDebugInfo:
;---------/GerdtR
mov ecx,10
mov eax,' '
mov edi,infile
push ecx
cld
rep stosd
mov ecx,[esp]
mov edi,outfile
rep stosd
pop ecx
mov edi,path
rep stosd
mov esi,params
; DEBUGF "params: %s\n",esi
mov edi,infile
call mov_param_str
; mov edi,infile
; DEBUGF " input: %s\n",edi
mov edi,outfile
call mov_param_str
; mov edi,outfile
; DEBUGF "output: %s\n",edi
mov edi,path
call mov_param_str
; mov edi,path
; DEBUGF " path: %s\n",edi
dec esi
cmp [esi], dword ',run'
jne @f
mov [_run_outfile],1
@@:
cmp [esi], dword ',dbg'
jne @f
mov [_run_outfile],2
@@:
mov [_mode],CONSOLE_MODE
jmp start
;---------------------------------------------------------------------
start_1:
;sys_
load_libraries l_libs_start,load_lib_end
cmp eax,-1
jne @f
mcall -1 ;exit if not open box_lib.obj
@@:
mcall 40,0x80000027 ;<3B><><20><><EFBFBD><EFBFBD><E2A5AC><EFBFBD><>
;---------------------------------------------------------------------
init_checkboxes2 ch1_dbg,ch1_dbg+ch_struc_size
;---------------------------------------------------------------------
; OpenDialog initialisation
push dword OpenDialog_data
call dword [OpenDialog_Init]
;---------------------------------------------------------------------
red: ; Redraw
call draw_window
still:
mcall 10 ; Wait here for event
cmp al,6
je call_mouse
dec eax
je red ; Redraw request
dec eax
jne button ; Button in buffer
key: ; Key
mcall 2 ; Read it and ignore
push dword edit1
call [edit_box_key]
push dword edit2
call [edit_box_key]
push dword edit3
call [edit_box_key]
jmp still
;---------------------------------------------------------------------
call_mouse:
call mouse
jmp still
;---------------------------------------------------------------------
button: ; Button in Window
mcall 17
cmp ah,1
jne noclose
or eax,-1
mcall
;---------------------------------------------------------------------
noclose:
cmp ah,5 ;press button for OpenDialog
jne @f
call fun_opn_dlg
@@:
cmp ah,2 ; Start compiling
je start
cmp ah,3 ; Start compiled file
jnz norunout
mov edx,outfile
call make_fullpaths
mcall 70,file_info_start
; xor ecx,ecx
jmp still
;---------------------------------------------------------------------
norunout:
cmp ah,4
jnz norundebug
mov edx,outfile
call make_fullpaths
mcall 70,file_info_debug
jmp still
;---------------------------------------------------------------------
norundebug:
jmp still
;---------------------------------------------------------------------
mouse:
push dword edit1
call [edit_box_mouse]
push dword edit2
call [edit_box_mouse]
push dword edit3
call [edit_box_mouse]
push dword ch1_dbg
call [check_box_mouse]
ret
;---------------------------------------------------------------------
draw_window:
pusha
mcall 12,1 ; Start of draw
get_sys_colors 1,0
edit_boxes_set_sys_color edit1,editboxes_end,sc
;check_boxes_set_sys_color2 ch1_dbg,ch1_dbg+ch_struc_size,sc
mov eax,[sc.work_text]
or eax, 0x90000000
mov [ch1_dbg.text_color], eax
m2m [ch1_dbg.border_color], [sc.work_graph]
mov edx,[sc.work]
or edx,0x33000000
xor eax,eax
xor esi,esi
mcall ,<150,DEFAULT_WIN_W>,<150,DEFAULT_WIN_H>,edx,,title
mcall 9,PROCESSINFO,-1
mov eax,[PROCESSINFO+70] ;get status of window
test eax,100b
jne .end
WIN_MIN_W = 350
WIN_MIN_H = 300
cmp dword[pinfo.client_box.width],WIN_MIN_W
jge @f
mcall 67,-1,-1,WIN_MIN_W+20,-1
jmp .end
@@:
cmp dword[pinfo.client_box.height],WIN_MIN_H
jge @f
mcall 67,-1,-1,-1,WIN_MIN_H+50
jmp .end
@@:
mpack ebx,[pinfo.client_box.width],RIGHT_BTN_W
msub ebx,RIGHT_BTN_W+1,0
mcall 8,ebx,<LINE_H*0+3,LINE_H-4>,ID_COMPILE_BTN,[sc.work_button]
mcall ,ebx,<LINE_H*1+3,LINE_H-4>,ID_EXECUTE_BTN
mcall ,ebx,<LINE_H*2+3,LINE_H-4>,ID_EXECDBG_BTN
mcall ,<5,62>,<LINE_H*2+3,LINE_H-5>,ID_OPENDLG_BTN
mov ecx, [sc.work_text]
or ecx, $10000000
mcall 4,<6,LINE_H*0+6>,,text+text.line_size*0,text.line_size ;InFile
mcall ,<6,LINE_H*1+6>,,text+text.line_size*1,esi ;OutFile
mov ecx, [sc.work_button_text]
or ecx, $10000000
mcall ,<0,LINE_H*2+6>,,text+text.line_size*2,esi ;Path
mov ebx,[pinfo.client_box.width]
sub ebx,RIGHT_BTN_W-12
shl ebx,16
add ebx,LINE_H/2-6
mov ecx, [sc.work_button_text]
or ecx, $10000000
mcall ,ebx,ecx,s_compile,7
add ebx,LINE_H
mcall ,ebx,ecx,s_run
add ebx,LINE_H
mcall ,ebx,ecx,s_debug
mpack ebx,MAGIC1+6,1+ 14/2-3+ 14*0
mov esi,[pinfo.client_box.width]
sub esi,MAGIC1*2+6+3
mov eax,esi
mov cl,6
div cl
cmp al,MAX_PATH
jbe @f
mov al,MAX_PATH
@@:
movzx esi,al
call draw_messages
mov eax,dword [pinfo.client_box.width]
sub eax,[edit1.left]
sub eax,RIGHT_BTN_W+6
mov dword[edit1.width],eax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
mov dword[edit2.width],eax
mov dword[edit3.width],eax
push dword edit1
call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword edit3
call [edit_box_draw]
push dword ch1_dbg
call [check_box_draw]
.end:
mcall 12,2 ; End of Draw
popa
ret
;---------------------------------------------------------------------
bottom_right dd ?
align 4
fun_opn_dlg: ;<3B><EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD> <20><EFBFBD><EBA7AE> OpenFile <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
pushad
copy_path open_dialog_name,communication_area_default_path,library_path,0
mov [OpenDialog_data.type],0
xor al,al
mov edi,dword [edit3.text]
mov ecx,dword [edit3.max]
cld
repne scasb
cmp byte[edi-2],'/'
jne @f
mov byte[edi-2],0 ;<3B><20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><>, <20><> <20><><EFBFBD><EFBFBD><><E3AAAE><EFBFBD><E7A8A2><EFBFBD> <20><> 1 ᨬ<><E1A8AC><EFBFBD>
@@:
push dword OpenDialog_data
call dword [OpenDialog_Start]
cmp [OpenDialog_data.status],2
je @f
xor al,al
mov edi,dword [edit3.text]
mov ebx,edi ;copy text pointer
mov ecx,dword [edit3.max]
cld
repne scasb
cmp byte[edi-2],'/'
jne .no_slash
dec edi ;<3B><20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><>, <20><> <20><><EFBFBD><EFBFBD><><E3AAAE><EFBFBD><E7A8A2><EFBFBD> <20><> 1 ᨬ<><E1A8AC><EFBFBD>
.no_slash:
mov byte[edi-1],'/' ;<3B><EFBFBD><E2A0A2> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><>
mov byte[edi],0 ;<3B><><EFBFBD><E0A5A7><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4A0A9>
sub edi,ebx ;edi = strlen(edit3.text)
mov [edit3.size],edi
mov [edit3.pos],edi
push dword [OpenDialog_data.filename_area]
push dword edit1
call dword [edit_box_set_text]
push dword [OpenDialog_data.filename_area]
push dword edit2
call dword [edit_box_set_text]
mov esi,[edit2.text]
xor eax,eax
cld
.cycle:
lodsb
test eax,eax
jnz .cycle
sub esi,5
cmp esi,[edit2.text]
jle .short_fn
mov byte[esi],0
sub dword [edit2.size],4
sub dword [edit2.pos],4
.short_fn:
push dword edit1
call dword [edit_box_draw]
push dword edit2
call dword [edit_box_draw]
push dword edit3
call dword [edit_box_draw]
@@:
popad
ret
;---------------------------------------------------------------------
draw_messages:
mpack ebx,5,[pinfo.client_box.width]
sub ebx,9
mpack ecx,0,[pinfo.client_box.height]
madd ecx, LINE_H*4,-( LINE_H*4+5)
mov word[bottom_right+2],bx
mov word[bottom_right],cx
msub [bottom_right],7,11
add [bottom_right],7 shl 16 + 53
mcall 13,,,0xFeFefe ; clear work area
; draw top shadow
push ecx
mov cx,1
mov edx,0xDADEDA
mcall
; draw left shadow
pop ecx
push ebx
mov bx,1
mcall
pop ebx
_cy = 0
_sy = 2
_cx = 4
_sx = 6
push ebx ecx
mpack ebx,4,5
add bx,[esp+_cx]
mov ecx,[esp+_sy-2]
mov cx,[esp+_sy]
msub ecx,1,1
mcall 38,,,[sc.work_graph]
mov si,[esp+_cy]
add cx,si
shl esi,16
add ecx,esi
madd ecx,1,1
mcall
mpack ebx,4,4
mov esi,[esp+_sy-2]
mov si,cx
mov ecx,esi
mcall
mov si,[esp+_cx]
add bx,si
shl esi,16
add ebx,esi
madd ebx,1,1
mcall
pop ecx ebx
ret
;---------------------------------------------------------------------
; DATA
;---------------------------------------------------------------------
if lang eq ru_RU
text:
db ' <20><EFBFBD><E594A0>:'
.line_size = $-text
db '<27><><EFBFBD><E594A0>:'
db ' <20><><EFBFBD><EFBFBD>:'
;db 'x'
s_compile db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.'
s_run db ' <20><><EFBFBD><EFBFBD> '
s_debug db '<27><EFBFBD><E2ABA0><EFBFBD>'
s_dbgdescr db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E2ABA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0ACA0><EFBFBD>',0
else
text:
db ' InFile:'
.line_size = $-text
db 'OutFile:'
db ' Path:'
;db 'x'
s_compile db 'COMPILE'
s_run db ' RUN '
s_debug db ' DEBUG '
s_dbgdescr db 'Generate debug information',0
end if
system_dir0 db '/sys/lib/'
lib0_name db 'box_lib.obj',0
system_dir1 db '/sys/lib/'
lib1_name db 'proc_lib.obj',0
;---------------------------------------------------------------------
align 4
import_box_lib:
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse
edit_box_set_text dd aEdit_box_set_text
;version_ed dd aVersion_ed
init_checkbox dd aInit_checkbox
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
;version_ch dd aVersion_ch
dd 0,0
aEdit_box_draw db 'edit_box_draw',0
aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0
aEdit_box_set_text db 'edit_box_set_text',0
;aVersion_ed db 'version_ed',0
aInit_checkbox db 'init_checkbox2',0
aCheck_box_draw db 'check_box_draw2',0
aCheck_box_mouse db 'check_box_mouse2',0
;aVersion_ch db 'version_ch2',0
;---------------------------------------------------------------------
align 4
import_proc_lib:
OpenDialog_Init dd aOpenDialog_Init
OpenDialog_Start dd aOpenDialog_Start
dd 0,0
aOpenDialog_Init db 'OpenDialog_init',0
aOpenDialog_Start db 'OpenDialog_start',0
;---------------------------------------------------------------------
;library structures
l_libs_start:
lib0 l_libs lib0_name, library_path, system_dir0, import_box_lib
lib1 l_libs lib1_name, library_path, system_dir1, import_proc_lib
load_lib_end:
edit1 edit_box 153, 72, 3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(outfile-infile-1), infile, mouse_dd, 0, 11,11
edit2 edit_box 153, 72, LINE_H+3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(path-outfile-1), outfile, mouse_dd, 0, 7,7
edit3 edit_box 153, 72, LINE_H*2+3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(path_end-path-1), path, mouse_dd, 0, 6,6
editboxes_end:
ch1_dbg check_box2 (5 shl 16)+15, ((LINE_H*3+3) shl 16)+15, 6, 0xffffff, 0x80ff, 0x10000000, s_dbgdescr,ch_flag_top
;---------------------------------------------------------------------
align 4
OpenDialog_data:
.type dd 0
.procinfo dd pinfo ;+4
.com_area_name dd communication_area_name ;+8
.com_area dd 0 ;+12
.opendir_path dd path ;+16
.dir_default_path dd default_dir ;+20
.start_path dd library_path ;+24 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4A0A9><EFBFBD>
.draw_window dd draw_window ;+28
.status dd 0 ;+32
.openfile_path dd path ;+36 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EBA2A0><EFBFBD><EFBFBD><EFBFBD><><E4A0A9>
.filename_area dd filename_area ;+40
.filter_area dd Filter
.x:
.x_size dw 420 ;+48 ; Window X size
.x_start dw 10 ;+50 ; Window X position
.y:
.y_size dw 320 ;+52 ; Window y size
.y_start dw 10 ;+54 ; Window Y position
default_dir db '/rd/1',0 ;<3B><><EFBFBD><E0A5AA><EFBFBD><EFBFBD><EFBFBD> <20><><><EFBFBD><E7A0AD>
communication_area_name:
db 'FFFFFFFF_open_dialog',0
open_dialog_name:
db 'opendial',0
communication_area_default_path:
db '/rd/1/File managers/',0
Filter:
dd Filter.end - Filter
.1:
db 'ASM',0
.end:
db 0
;---------------------------------------------------------------------
mouse_dd dd 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> Shift-<2D> <20> editbox
;---------------------------------------------------------------------
infile db 'example.asm'
times MAX_PATH-$+infile db 0
outfile db 'example'
times MAX_PATH-$+outfile db 0
path db '/rd/1//' ;OpenDialog <20><><EFBFBD> <20><><EFBFBD><EFBFBD>᪥ 㡨ࠥ<E3A1A8> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD><>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD><E1A5A3>, <20><><EFBFBD><><E1ABA5> 2
times MAX_PATH-$+path db 0
path_end:
lf db 13,10,0
;---------------------------------------------------------------------
mov_param_str:
cld
@@:
lodsb
cmp al,','
je @f
stosb
test al,al
jnz @b
@@:
xor al,al
stosb
ret
;---------------------------------------------------------------------
start:
cmp [_mode],NORMAL_MODE
jne @f
call draw_messages
mov [textxy],8 shl 16 + LINE_H*4+4
@@:
mov esi,_logo
call display_string
;---------------------------------------------------------------------
; Fasm native code
;---------------------------------------------------------------------
mov [input_file],infile
mov [output_file],outfile
call init_memory
call make_timestamp
mov [start_time],eax
call preprocessor
call parser
call assembler
bt dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0
jae @f ;jz @f
call symbol_dump
@@:
call formatter
call display_user_messages
movzx eax,[current_pass]
inc eax
call display_number
mov esi,_passes_suffix
call display_string
call make_timestamp
sub eax,[start_time]
xor edx,edx
mov ebx,100
div ebx
or eax,eax
jz display_bytes_count
xor edx,edx
mov ebx,10
div ebx
push edx
call display_number
mov dl,'.'
call display_character
pop eax
call display_number
mov esi,_seconds_suffix
call display_string
display_bytes_count:
mov eax,[written_size]
call display_number
mov esi,_bytes_suffix
call display_string
xor al,al
cmp [_run_outfile],0
je @f
mov edx,outfile
call make_fullpaths
xor ecx,ecx
cmp [_run_outfile],2 ; param is ',dbg'
jne run
mcall 70,file_info_debug
jmp @f
run:
mcall 70,file_info_start
@@:
jmp exit_program
;---------------------------------------------------------------------
include 'system.inc'
include 'version.inc'
include 'errors.inc'
include 'symbdump.inc'
include 'preproce.inc'
include 'parser.inc'
include 'exprpars.inc'
include 'assemble.inc'
include 'exprcalc.inc'
include 'formats.inc'
include 'x86_64.inc'
include 'avx.inc'
include 'tables.inc'
include 'messages.inc'
;---------------------------------------------------------------------
title db appname,VERSION_STRING,0
_logo db 'flat assembler version ',VERSION_STRING,13,10,0
_passes_suffix db ' passes, ',0
_seconds_suffix db ' seconds, ',0
_bytes_suffix db ' bytes.',13,10,0
_include db 'INCLUDE',0
_counter db 4,'0000'
_mode dd NORMAL_MODE
_run_outfile dd 0
;bGenerateDebugInfo db 0
dbgWord db '-d',0
sub_table:
times $41 db $00
times $1A db $20
times $25 db $00
times $10 db $20
times $30 db $00
times $10 db $50
times $04 db $00,$01
times $08 db $00
;include_debug_strings
program_end:
; params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
params rb 4096
cur_dir_path rb 4096
library_path rb 4096
filename_area rb 256
align 4
include 'variable.inc'
program_base dd ?
buffer_address dd ?
memory_setting dd ?
start_time dd ?
memblock dd ?
predefinitions rb 1000h
dbgfilename rb MAX_PATH+4
sc system_colors
max_handles = 8
fileinfos rb (4+20+MAX_PATH)*max_handles
fileinfos_end:
pinfo process_information
align 1000h
rb 1000h
stacktop:

View File

@@ -1,59 +0,0 @@
ID_CLOSE_BTN = 1
ID_COMPILE_BTN = 2
ID_EXECUTE_BTN = 3
ID_EXECDBG_BTN = 4
ID_OPENDLG_BTN = 5
center fix false
SYSTEMCOLORS fix sc
PROCESSINFO fix pinfo
macro get_sys_colors wnd_skin,font_1 {
mcall 48,3,SYSTEMCOLORS,sizeof.system_colors
if wnd_skin <> 0
or [SYSTEMCOLORS+system_colors.work],0x03000000
end if
if font_1 <> 0
or [SYSTEMCOLORS+system_colors.grab_text],0x10000000
end if
}
macro draw_caption _edx,_esi {
mov edx,_edx
mov esi,_esi
call __draw_caption
}
macro mmov reg,a1,a2 {
mov reg,(a1) shl 16 + (a2)
}
macro madd reg,a1,a2 {
add reg,(a1) shl 16 + (a2)
}
macro msub reg,a1,a2 {
sub reg,(a1) shl 16 + (a2)
}
macro jmpe reg,def,[val,lab] {
forward
cmp reg,val
je lab
common
if ~def eq
jmp def
end if
}
macro func name {
if used name
name:
}
macro endf {
end if
}
@^ fix macro comment {
^@ fix }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,37 +0,0 @@
flat assembler version 1.71
Copyright (c) 1999-2013, Tomasz Grysztar.
All rights reserved.
This program is free for commercial and non-commercial use as long as
the following conditions are adhered to.
Copyright remains Tomasz Grysztar, and as such any Copyright notices
in the code are not to be removed.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The licence and distribution terms for any publically available
version or derivative of this code cannot be changed. i.e. this code
cannot simply be copied and put under another distribution licence
(including the GNU Public Licence).

View File

@@ -1,52 +0,0 @@
; flat assembler core
; Copyright (c) 1999-2016, Tomasz Grysztar.
; All rights reserved.
_out_of_memory db 'out of memory',0
_stack_overflow db 'out of stack space',0
_main_file_not_found db 'source file not found',0
_unexpected_end_of_file db 'unexpected end of file',0
_code_cannot_be_generated db 'code cannot be generated',0
_format_limitations_exceeded db 'format limitations exceeded',0
_invalid_definition db 'invalid definition provided',0
_write_failed db 'write failed',0
_file_not_found db 'file not found',0
_error_reading_file db 'error reading file',0
_invalid_file_format db 'invalid file format',0
_invalid_macro_arguments db 'invalid macro arguments',0
_incomplete_macro db 'incomplete macro',0
_unexpected_characters db 'unexpected characters',0
_invalid_argument db 'invalid argument',0
_illegal_instruction db 'illegal instruction',0
_invalid_operand db 'invalid operand',0
_invalid_operand_size db 'invalid size of operand',0
_operand_size_not_specified db 'operand size not specified',0
_operand_sizes_do_not_match db 'operand sizes do not match',0
_invalid_address_size db 'invalid size of address value',0
_address_sizes_do_not_agree db 'address sizes do not agree',0
_disallowed_combination_of_registers db 'disallowed combination of registers',0
_long_immediate_not_encodable db 'not encodable with long immediate',0
_relative_jump_out_of_range db 'relative jump out of range',0
_invalid_expression db 'invalid expression',0
_invalid_address db 'invalid address',0
_invalid_value db 'invalid value',0
_value_out_of_range db 'value out of range',0
_undefined_symbol db 'undefined symbol',0
_symbol_out_of_scope_1 db 'symbol',0
_symbol_out_of_scope_2 db 'out of scope',0
_invalid_use_of_symbol db 'invalid use of symbol',0
_name_too_long db 'name too long',0
_invalid_name db 'invalid name',0
_reserved_word_used_as_symbol db 'reserved word used as symbol',0
_symbol_already_defined db 'symbol already defined',0
_missing_end_quote db 'missing end quote',0
_missing_end_directive db 'missing end directive',0
_unexpected_instruction db 'unexpected instruction',0
_extra_characters_on_line db 'extra characters on line',0
_section_not_aligned_enough db 'section is not aligned enough',0
_setting_already_specified db 'setting already specified',0
_data_already_defined db 'data already defined',0
_too_many_repeats db 'too many repeats',0
_invoked_error db 'error directive encountered in source file',0
_assertion_failed db 'assertion failed',0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,450 +0,0 @@
; flat assembler core
; Copyright (c) 1999-2016, Tomasz Grysztar.
; All rights reserved.
dump_symbols:
mov edi,[code_start]
call setup_dump_header
mov esi,[input_file]
call copy_asciiz
cmp edi,[tagged_blocks]
jae out_of_memory
mov eax,edi
sub eax,ebx
mov [ebx-40h+0Ch],eax
mov esi,[output_file]
call copy_asciiz
cmp edi,[tagged_blocks]
jae out_of_memory
mov edx,[symbols_stream]
mov ebp,[free_additional_memory]
and [number_of_sections],0
cmp [output_format],4
je prepare_strings_table
cmp [output_format],5
jne strings_table_ready
bt [format_flags],0
jc strings_table_ready
prepare_strings_table:
cmp edx,ebp
je strings_table_ready
mov al,[edx]
test al,al
jz prepare_string
cmp al,80h
je prepare_string
add edx,0Ch
cmp al,0C0h
jb prepare_strings_table
add edx,4
jmp prepare_strings_table
prepare_string:
mov esi,edi
sub esi,ebx
xchg esi,[edx+4]
test al,al
jz prepare_section_string
or dword [edx+4],1 shl 31
add edx,0Ch
prepare_external_string:
mov ecx,[esi]
add esi,4
rep movs byte [edi],[esi]
mov byte [edi],0
inc edi
cmp edi,[tagged_blocks]
jae out_of_memory
jmp prepare_strings_table
prepare_section_string:
mov ecx,[number_of_sections]
mov eax,ecx
inc eax
mov [number_of_sections],eax
xchg eax,[edx+4]
shl ecx,2
add ecx,[free_additional_memory]
mov [ecx],eax
add edx,20h
test esi,esi
jz prepare_default_section_string
cmp [output_format],5
jne prepare_external_string
bt [format_flags],0
jc prepare_external_string
mov esi,[esi]
add esi,[resource_data]
copy_elf_section_name:
lods byte [esi]
cmp edi,[tagged_blocks]
jae out_of_memory
stos byte [edi]
test al,al
jnz copy_elf_section_name
jmp prepare_strings_table
prepare_default_section_string:
mov eax,'.fla'
stos dword [edi]
mov ax,'t'
stos word [edi]
cmp edi,[tagged_blocks]
jae out_of_memory
jmp prepare_strings_table
strings_table_ready:
mov edx,[tagged_blocks]
mov ebp,[memory_end]
sub ebp,[labels_list]
add ebp,edx
prepare_labels_dump:
cmp edx,ebp
je labels_dump_ok
mov eax,[edx+24]
test eax,eax
jz label_dump_name_ok
cmp eax,[memory_start]
jb label_name_outside_source
cmp eax,[source_start]
ja label_name_outside_source
sub eax,[memory_start]
dec eax
mov [edx+24],eax
jmp label_dump_name_ok
label_name_outside_source:
mov esi,eax
mov eax,edi
sub eax,ebx
or eax,1 shl 31
mov [edx+24],eax
movzx ecx,byte [esi-1]
lea eax,[edi+ecx+1]
cmp edi,[tagged_blocks]
jae out_of_memory
rep movsb
xor al,al
stosb
label_dump_name_ok:
mov eax,[edx+28]
test eax,eax
jz label_dump_line_ok
sub eax,[memory_start]
mov [edx+28],eax
label_dump_line_ok:
test byte [edx+9],4
jz convert_base_symbol_for_label
xor eax,eax
mov [edx],eax
mov [edx+4],eax
jmp base_symbol_for_label_ok
convert_base_symbol_for_label:
mov eax,[edx+20]
test eax,eax
jz base_symbol_for_label_ok
cmp eax,[symbols_stream]
mov eax,[eax+4]
jae base_symbol_for_label_ok
xor eax,eax
base_symbol_for_label_ok:
mov [edx+20],eax
mov ax,[current_pass]
cmp ax,[edx+16]
je label_defined_flag_ok
and byte [edx+8],not 1
label_defined_flag_ok:
cmp ax,[edx+18]
je label_used_flag_ok
and byte [edx+8],not 8
label_used_flag_ok:
add edx,LABEL_STRUCTURE_SIZE
jmp prepare_labels_dump
labels_dump_ok:
mov eax,edi
sub eax,ebx
mov [ebx-40h+14h],eax
add eax,40h
mov [ebx-40h+18h],eax
mov ecx,[memory_end]
sub ecx,[labels_list]
mov [ebx-40h+1Ch],ecx
add eax,ecx
mov [ebx-40h+20h],eax
mov ecx,[source_start]
sub ecx,[memory_start]
mov [ebx-40h+24h],ecx
add eax,ecx
mov [ebx-40h+28h],eax
mov eax,[number_of_sections]
shl eax,2
mov [ebx-40h+34h],eax
call prepare_preprocessed_source
mov esi,[labels_list]
mov ebp,edi
make_lines_dump:
cmp esi,[tagged_blocks]
je lines_dump_ok
mov eax,[esi-4]
mov ecx,[esi-8]
sub esi,8
sub esi,ecx
cmp eax,1
je process_line_dump
cmp eax,2
jne make_lines_dump
add dword [ebx-40h+3Ch],8
jmp make_lines_dump
process_line_dump:
push ebx
mov ebx,[esi+8]
mov eax,[esi+4]
sub eax,[code_start]
add eax,[headers_size]
test byte [ebx+0Ah],1
jz store_offset
xor eax,eax
store_offset:
stos dword [edi]
mov eax,[esi]
sub eax,[memory_start]
stos dword [edi]
mov eax,[esi+4]
xor edx,edx
xor cl,cl
sub eax,[ebx]
sbb edx,[ebx+4]
sbb cl,[ebx+8]
stos dword [edi]
mov eax,edx
stos dword [edi]
mov eax,[ebx+10h]
stos dword [edi]
mov eax,[ebx+14h]
test eax,eax
jz base_symbol_for_line_ok
cmp eax,[symbols_stream]
mov eax,[eax+4]
jae base_symbol_for_line_ok
xor eax,eax
base_symbol_for_line_ok:
stos dword [edi]
mov al,[ebx+9]
stos byte [edi]
mov al,[esi+10h]
stos byte [edi]
mov al,[ebx+0Ah]
and al,1
stos byte [edi]
mov al,cl
stos byte [edi]
pop ebx
cmp edi,[tagged_blocks]
jae out_of_memory
mov eax,edi
sub eax,1Ch
sub eax,ebp
mov [esi],eax
jmp make_lines_dump
lines_dump_ok:
mov edx,edi
mov eax,[current_offset]
sub eax,[code_start]
add eax,[headers_size]
stos dword [edi]
mov ecx,edi
sub ecx,ebx
sub ecx,[ebx-40h+14h]
mov [ebx-40h+2Ch],ecx
add ecx,[ebx-40h+28h]
mov [ebx-40h+30h],ecx
add ecx,[ebx-40h+34h]
mov [ebx-40h+38h],ecx
find_inexisting_offsets:
sub edx,1Ch
cmp edx,ebp
jb write_symbols
test byte [edx+1Ah],1
jnz find_inexisting_offsets
cmp eax,[edx]
jb correct_inexisting_offset
mov eax,[edx]
jmp find_inexisting_offsets
correct_inexisting_offset:
and dword [edx],0
or byte [edx+1Ah],2
jmp find_inexisting_offsets
write_symbols:
mov edx,[symbols_file]
call create
jc write_failed
mov edx,[code_start]
mov ecx,[edx+14h]
add ecx,40h
call write
jc write_failed
mov edx,[tagged_blocks]
mov ecx,[memory_end]
sub ecx,[labels_list]
call write
jc write_failed
mov edx,[memory_start]
mov ecx,[source_start]
sub ecx,edx
call write
jc write_failed
mov edx,ebp
mov ecx,edi
sub ecx,edx
call write
jc write_failed
mov edx,[free_additional_memory]
mov ecx,[number_of_sections]
shl ecx,2
call write
jc write_failed
mov esi,[labels_list]
mov edi,[memory_start]
make_references_dump:
cmp esi,[tagged_blocks]
je references_dump_ok
mov eax,[esi-4]
mov ecx,[esi-8]
sub esi,8
sub esi,ecx
cmp eax,2
je dump_reference
cmp eax,1
jne make_references_dump
mov edx,[esi]
jmp make_references_dump
dump_reference:
mov eax,[memory_end]
sub eax,[esi]
sub eax,LABEL_STRUCTURE_SIZE
stosd
mov eax,edx
stosd
cmp edi,[tagged_blocks]
jb make_references_dump
jmp out_of_memory
references_dump_ok:
mov edx,[memory_start]
mov ecx,edi
sub ecx,edx
call write
jc write_failed
call close
ret
setup_dump_header:
xor eax,eax
mov ecx,40h shr 2
rep stos dword [edi]
mov ebx,edi
mov dword [ebx-40h],'fas'+1Ah shl 24
mov dword [ebx-40h+4],VERSION_MAJOR + VERSION_MINOR shl 8 + 40h shl 16
mov dword [ebx-40h+10h],40h
ret
prepare_preprocessed_source:
mov esi,[memory_start]
mov ebp,[source_start]
test ebp,ebp
jnz prepare_preprocessed_line
mov ebp,[current_line]
inc ebp
prepare_preprocessed_line:
cmp esi,ebp
jae preprocessed_source_ok
mov eax,[memory_start]
mov edx,[input_file]
cmp [esi],edx
jne line_not_from_main_input
mov [esi],eax
line_not_from_main_input:
sub [esi],eax
test byte [esi+7],1 shl 7
jz prepare_next_preprocessed_line
sub [esi+8],eax
sub [esi+12],eax
prepare_next_preprocessed_line:
call skip_preprocessed_line
jmp prepare_preprocessed_line
preprocessed_source_ok:
ret
skip_preprocessed_line:
add esi,16
skip_preprocessed_line_content:
lods byte [esi]
cmp al,1Ah
je skip_preprocessed_symbol
cmp al,3Bh
je skip_preprocessed_symbol
cmp al,22h
je skip_preprocessed_string
or al,al
jnz skip_preprocessed_line_content
ret
skip_preprocessed_string:
lods dword [esi]
add esi,eax
jmp skip_preprocessed_line_content
skip_preprocessed_symbol:
lods byte [esi]
movzx eax,al
add esi,eax
jmp skip_preprocessed_line_content
restore_preprocessed_source:
mov esi,[memory_start]
mov ebp,[source_start]
test ebp,ebp
jnz restore_preprocessed_line
mov ebp,[current_line]
inc ebp
restore_preprocessed_line:
cmp esi,ebp
jae preprocessed_source_restored
mov eax,[memory_start]
add [esi],eax
cmp [esi],eax
jne preprocessed_line_source_restored
mov edx,[input_file]
mov [esi],edx
preprocessed_line_source_restored:
test byte [esi+7],1 shl 7
jz restore_next_preprocessed_line
add [esi+8],eax
add [esi+12],eax
restore_next_preprocessed_line:
call skip_preprocessed_line
jmp restore_preprocessed_line
preprocessed_source_restored:
ret
dump_preprocessed_source:
mov edi,[free_additional_memory]
call setup_dump_header
mov esi,[input_file]
call copy_asciiz
cmp edi,[additional_memory_end]
jae out_of_memory
mov eax,edi
sub eax,ebx
dec eax
mov [ebx-40h+0Ch],eax
mov eax,edi
sub eax,ebx
mov [ebx-40h+14h],eax
add eax,40h
mov [ebx-40h+20h],eax
call prepare_preprocessed_source
sub esi,[memory_start]
mov [ebx-40h+24h],esi
mov edx,[symbols_file]
call create
jc write_failed
mov edx,[free_additional_memory]
mov ecx,[edx+14h]
add ecx,40h
call write
jc write_failed
mov edx,[memory_start]
mov ecx,esi
call write
jc write_failed
call close
ret

View File

@@ -1,692 +0,0 @@
; flat assembler
; Copyright (c) 1999-2012, Tomasz Grysztar
; All rights reserved.
struc FILEIO
{ .cmd dd ?
.offset dd ?
dd ?
.count dd ?
.buff dd ?
db ?
.name dd ?
};
struc FILEINFO
{ .attr dd ?
.flags dd ?
.cr_time dd ?
.cr_date dd ?
.acc_time dd ?
.acc_date dd ?
.mod_time dd ?
.mod_date dd ?
.size dd ?
}
;file_info_open: dd 0,0,0xffffff,0x20000,0xf0000
fullpath_open: ; db '/RD/1/EXAMPLE.ASM'
times MAX_PATH db 0
;file_info_write: dd 1,0,0,0,0xf0000
fullpath_write:; db '/RD/1/EXAMPLE'
times MAX_PATH db 0
file_info_start:
dd 7
dd 0
dd 0
dd 0
dd 0
fullpath_start: ; db '/RD/1/EXAMPLE'
times MAX_PATH db 0
file_info_debug:
dd 7
dd 0
dd fullpath_start
dd 0, 0
db '/SYS/DEVELOP/MTDBG',0
_ramdisk db '/RD/1/'
filepos dd 0x0
init_memory:
; mov ecx, 16*1024*1024
;
; allocate_memory:
mcall 18, 16
cmp eax, 0x38000000 shr 9
jbe @f
mov eax, 0x38000000 shr 9
@@:
shl eax, 9
xchg eax, ecx
mov [memory_setting],ecx
mcall 68, 12
or eax,eax
jz out_of_memory
mov [memblock], eax
mov [additional_memory],eax
add eax,[memory_setting]
mov [memory_end],eax
mov eax,[memory_setting]
shr eax,2
add eax,[additional_memory]
mov [additional_memory_end],eax
mov [memory_start],eax
ret
exit_program:
cmp [_mode],NORMAL_MODE
jne @f
mcall 68, 13, [memblock]
jmp still
@@:
or eax,-1
mcall
make_timestamp:
push ebx
mcall 26,9
imul eax,10
pop ebx
ret
symbol_dump:
push edi
mov edx,[memory_end]
symb_dump:
cmp edx,[labels_list]
jbe symbols_dumped
sub edx,LABEL_STRUCTURE_SIZE
cmp dword [edx+24],0
je symb_dump ; do not dump anonymous symbols
test byte [edx+8],1
jz symb_dump ; do not dump symbols that didn't get defined
mov ax,[current_pass]
cmp ax,[edx+16]
jne symb_dump
test byte [edx+8],4 or 2
jnz symb_dump ; do not dump assembly-time variables
; do not dump variables defined with '='
cmp word [edx+12], 0
jnz symb_dump ; do not dump register-based variables
mov al, '0'
stosb
mov al, 'x'
stosb
mov eax, [edx+4]
mov ecx, 8
@@:
rol eax, 4
test al, 0xF
loopz @b
jz .nohigh
inc ecx
@@:
push eax
and al, 0xF
cmp al, 10
sbb al, 69h
das
stosb
pop eax
rol eax, 4
loop @b
mov eax, [edx]
mov ecx, 8
jmp .low
.nohigh:
mov eax, [edx]
mov ecx, 8
@@:
rol eax, 4
test al, 0xF
loopz @b
inc ecx
.low:
push eax
and al, 0xF
cmp al, 10
sbb al, 69h
das
stosb
pop eax
rol eax, 4
loop .low
mov al, ' '
stosb
mov esi,[edx+24]
movzx ecx,byte [esi-1]
rep movsb
mov ax,0A0Dh
stosw
jmp symb_dump
symbols_dumped:
mov edx,dbgfilename
push esi edi
mov esi, outfile
mov edi, edx
@@:
lodsb
stosb
test al, al
jnz @b
lea ecx, [edi-1]
@@:
dec edi
cmp edi, edx
jb @f
cmp byte [edi], '/'
jz @f
cmp byte [edi], '.'
jnz @b
mov ecx, edi
@@:
mov dword [ecx], '.dbg'
mov byte [ecx+4], 0
pop edi esi
call create
mov edx,[esp]
mov ecx,edi
sub ecx,edx
call write
call close
pop edi
ret
get_environment_variable:
mov ecx,[memory_end]
sub ecx,edi
cmp ecx,7
jb out_of_memory
cmp dword[esi],'INCL'
jne .finish
mov esi,_ramdisk
mov ecx,6
cld
rep movsb
.finish:
; stc
ret
alloc_handle:
call make_fullpaths
mov ebx, fileinfos+4
@@:
cmp dword [ebx], -1
jz .found
add ebx, 4+20+MAX_PATH
cmp ebx, fileinfos_end
jb @b
stc
ret
.found:
and dword [ebx+4], 0
and dword [ebx+8], 0
push esi edi ecx
mov esi, fullpath_open
lea edi, [ebx+20]
mov ecx, MAX_PATH
rep movsb
pop ecx edi esi
ret ; CF=0
create:
call alloc_handle
jc .ret
and dword [ebx-4], 0
mov dword [ebx], 2
.ret:
ret
open:
; call make_fullpaths
;; mov eax,fullpath_open
;; DEBUGF '"%s"\n',eax
; mov dword[file_info_open+8],-1
; mcall 58,file_info_open
; or eax,eax ; found
; jz @f
; cmp eax,6
; jne file_error
;@@: mov [filesize],ebx
; clc
; ret
;file_error:
; stc
; ret
call alloc_handle
jc .ret
mov dword [ebx], 5
and dword [ebx+12], 0
mov dword [ebx+16], fileinfo
mov eax, 70
push ebx
mcall
pop ebx
test eax, eax
jnz .fail
mov eax, [fileinfo.size]
mov [ebx-4], eax
and dword [ebx], 0
.ret:
ret
.fail:
or dword [ebx], -1 ; close handle
stc
ret
read:
; pusha
; mov edi,edx
; mov esi,[filepos]
; add esi,0x20000
; cld
; rep movsb
; popa
;; ret
mov [ebx+12], ecx
mov [ebx+16], edx
push ebx
mov eax, 70
mcall
xchg eax, [esp]
add [eax+4], ebx
adc [eax+8], dword 0
mov ebx, eax
pop eax
test eax, eax
jz .ok
cmp eax, 6
jz .ok
stc
.ok:
ret
close:
or dword [ebx], -1
ret
; ebx file handle
; ecx count of bytes to write
; edx pointer to buffer
write:
; pusha
; mov [file_info_write+8],ecx
; mov [file_info_write+12],edx
; mov [filesize],edx
; mov eax,58
; mov ebx,file_info_write
; mcall
; popa
; ret
mov [ebx+12], ecx
mov [ebx+16], edx
push ebx
mov eax, 70
mcall
xchg eax, [esp]
add [eax+4], ebx
adc [eax+8], dword 0
mov ebx, eax
pop eax
mov byte [ebx], 3
cmp eax, 1
cmc
ret
make_fullpaths:
pusha
push edx
mov esi,path ; open
; DEBUGF " '%s'",esi
mov edi,fullpath_open
cld
newc1:
movsb
cmp byte[esi],0;' '
jne newc1
mov esi,[esp]
cmp byte[esi],'/'
jne @f
mov edi,fullpath_open
@@:
lodsb
stosb
cmp al,0
jne @b
; mov ecx,12
; cld
; rep movsb
; mov byte[edi],0
mov esi,path ; write
mov edi,fullpath_write
cld
newc2:
movsb
cmp byte[esi],0;' '
jne newc2
mov esi,[esp]
cmp byte[esi],'/'
jne @f
mov edi,fullpath_write
@@:
lodsb
stosb
cmp al,0
jne @b
; mov ecx,12
; cld
; rep movsb
; mov byte[edi],0
mov esi,path ; start
mov edi,fullpath_start
cld
newc3:
movsb
cmp byte[esi],0;' '
jne newc3
; mov esi,[esp]
pop esi
cmp byte[esi],'/'
jne @f
mov edi,fullpath_start
@@:
lodsb
stosb
cmp al,0
jne @b
; mov ecx,12
; cld
; rep movsb
; mov byte[edi],0
; add esp,4
popa
ret
lseek:
cmp al,0
jnz @f
and dword [ebx+4], 0
and dword [ebx+8], 0
@@: cmp al,2
jnz @f
mov eax, [ebx-4]
mov [ebx+4], eax
and dword [ebx+8], 0
@@: add dword [ebx+4], edx
adc dword [ebx+8], 0
ret
display_character:
pusha
cmp [_mode],NORMAL_MODE
jne @f
cmp dl,13
jz dc2
cmp dl,0xa
jnz dc1
and [textxy],0x0000FFFF
add [textxy], 7 shl 16 +53 and 0xFFFF0000 + 16
dc2:
popa
ret
dc1:
mov eax,[textxy]
cmp ax,word[bottom_right]
ja dc2
shr eax,16
cmp ax,word[bottom_right+2]
ja dc2
mov [dc],dl
mcall 4,[textxy],0x10000000,dc,1
add [textxy],0x00080000
popa
ret
@@:
mov eax,63
mov ebx,1
mov cl,dl
mcall
popa
ret
display_string:
pusha
@@:
cmp byte[esi],0
je @f
mov dl,[esi]
call display_character
add esi,1
jmp @b
@@:
popa
ret
display_number:
push ebx
mov ecx,1000000000
xor edx,edx
xor bl,bl
display_loop:
div ecx
push edx
cmp ecx,1
je display_digit
or bl,bl
jnz display_digit
or al,al
jz digit_ok
not bl
display_digit:
mov dl,al
add dl,30h
push ebx ecx
call display_character
pop ecx ebx
digit_ok:
mov eax,ecx
xor edx,edx
mov ecx,10
div ecx
mov ecx,eax
pop eax
or ecx,ecx
jnz display_loop
pop ebx
ret
display_user_messages:
; push [skinh]
; pop [textxy]
; add [textxy], 7 shl 16 +53
mov [displayed_count],0
call show_display_buffer
cmp [displayed_count],1
jb line_break_ok
je make_line_break
mov ax,word[last_displayed]
cmp ax,0A0Dh
je line_break_ok
cmp ax,0D0Ah
je line_break_ok
make_line_break:
mov esi,lf
call display_string
line_break_ok:
ret
display_block:
pusha
@@: mov dl,[esi]
call display_character
inc esi
loop @b
popa
ret
fatal_error:
mov esi,error_prefix
call display_string
pop esi
call display_string
mov esi,error_suffix
call display_string
mov esi,lf
call display_string
mov al,0FFh
jmp exit_program
assembler_error:
call display_user_messages
push dword 0
mov ebx,[current_line]
get_error_lines:
push ebx
test byte [ebx+7],80h
jz display_error_line
mov edx,ebx
find_definition_origin:
mov edx,[edx+12]
test byte [edx+7],80h
jnz find_definition_origin
push edx
mov ebx,[ebx+8]
jmp get_error_lines
display_error_line:
mov esi,[ebx]
call display_string
mov esi,line_number_start
call display_string
mov eax,[ebx+4]
and eax,7FFFFFFFh
call display_number
mov dl,']'
call display_character
pop esi
cmp ebx,esi
je line_number_ok
mov dl,20h
call display_character
push esi
mov esi,[esi]
movzx ecx,byte [esi]
inc esi
call display_block
mov esi,line_number_start
call display_string
pop esi
mov eax,[esi+4]
and eax,7FFFFFFFh
call display_number
mov dl,']'
call display_character
line_number_ok:
mov esi,line_data_start
call display_string
mov esi,ebx
mov edx,[esi]
call open
mov al,2
xor edx,edx
call lseek
mov edx,[esi+8]
sub eax,edx
push eax
xor al,al
call lseek
mov ecx,[esp]
mov edx,[additional_memory]
lea eax,[edx+ecx]
cmp eax,[additional_memory_end]
ja out_of_memory
call read
call close
pop ecx
mov esi,[additional_memory]
get_line_data:
mov al,[esi]
cmp al,0Ah
je display_line_data
cmp al,0Dh
je display_line_data
cmp al,1Ah
je display_line_data
or al,al
jz display_line_data
inc esi
loop get_line_data
display_line_data:
mov ecx,esi
mov esi,[additional_memory]
sub ecx,esi
call display_block
mov esi,cr_lf
call display_string
pop ebx
or ebx,ebx
jnz display_error_line
mov esi,error_prefix
call display_string
pop esi
call display_string
mov esi,error_suffix
call display_string
jmp exit_program
align 4
fileinfo FILEINFO
character db ?,0
bytes_count dd ?
textxy dd 0x000500A0
dc db 0x0
filesize dd 0x0
displayed_count dd ?
last_displayed rb 2
error_prefix db 'error: ',0
error_suffix db '.',0
line_data_start db ':'
cr_lf db 0Dh,0Ah,0
line_number_start db ' [',0
macro dm string { db string,0 }

File diff suppressed because it is too large Load Diff

View File

@@ -1,155 +0,0 @@
; flat assembler core variables
; Copyright (c) 1999-2016, Tomasz Grysztar.
; All rights reserved.
; Variables which have to be set up by interface:
memory_start dd ?
memory_end dd ?
additional_memory dd ?
additional_memory_end dd ?
stack_limit dd ?
initial_definitions dd ?
input_file dd ?
output_file dd ?
symbols_file dd ?
passes_limit dw ?
; Internal core variables:
current_pass dw ?
include_paths dd ?
free_additional_memory dd ?
source_start dd ?
code_start dd ?
code_size dd ?
real_code_size dd ?
written_size dd ?
headers_size dd ?
current_line dd ?
macro_line dd ?
macro_block dd ?
macro_block_line dd ?
macro_block_line_number dd ?
macro_symbols dd ?
struc_name dd ?
struc_label dd ?
instant_macro_start dd ?
parameters_end dd ?
default_argument_value dd ?
locals_counter rb 8
current_locals_prefix dd ?
anonymous_reverse dd ?
anonymous_forward dd ?
labels_list dd ?
label_hash dd ?
label_leaf dd ?
hash_tree dd ?
addressing_space dd ?
undefined_data_start dd ?
undefined_data_end dd ?
counter dd ?
counter_limit dd ?
error_info dd ?
error_line dd ?
error dd ?
tagged_blocks dd ?
structures_buffer dd ?
number_start dd ?
current_offset dd ?
value dq ?
fp_value rd 8
adjustment dq ?
symbol_identifier dd ?
address_symbol dd ?
address_high dd ?
uncompressed_displacement dd ?
format_flags dd ?
resolver_flags dd ?
symbols_stream dd ?
number_of_relocations dd ?
number_of_sections dd ?
stub_size dd ?
stub_file dd ?
current_section dd ?
machine dw ?
subsystem dw ?
subsystem_version dd ?
image_base dd ?
image_base_high dd ?
resource_data dd ?
resource_size dd ?
actual_fixups_size dd ?
reserved_fixups dd ?
reserved_fixups_size dd ?
last_fixup_base dd ?
last_fixup_header dd ?
parenthesis_stack dd ?
blocks_stack dd ?
parsed_lines dd ?
logical_value_parentheses dd ?
file_extension dd ?
operand_size db ?
operand_flags db ?
operand_prefix db ?
rex_prefix db ?
opcode_prefix db ?
vex_required db ?
vex_register db ?
immediate_size db ?
mask_register db ?
broadcast_size db ?
rounding_mode db ?
base_code db ?
extended_code db ?
supplemental_code db ?
postbyte_register db ?
segment_register db ?
xop_opcode_map db ?
mmx_size db ?
jump_type db ?
push_size db ?
value_size db ?
address_size db ?
label_size db ?
size_declared db ?
address_size_declared db ?
displacement_compression db ?
value_undefined db ?
value_constant db ?
value_type db ?
value_sign db ?
fp_sign db ?
fp_format db ?
address_sign db ?
address_register db ?
compare_type db ?
logical_value_wrapping db ?
next_pass_needed db ?
output_format db ?
code_type db ?
adjustment_sign db ?
evex_mode db ?
macro_status db ?
skip_default_argument_value db ?
prefix_flags db ?
formatter_symbols_allowed db ?
decorator_symbols_allowed db ?
free_address_range db ?
characters rb 100h
converted rb 100h
message rb 200h

View File

@@ -1,39 +0,0 @@
; flat assembler version 1.71
; Copyright (c) 1999-2016, Tomasz Grysztar.
; All rights reserved.
;
; This programs is free for commercial and non-commercial use as long as
; the following conditions are adhered to.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are
; met:
;
; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
; The licence and distribution terms for any publically available
; version or derivative of this code cannot be changed. i.e. this code
; cannot simply be copied and put under another distribution licence
; (including the GNU Public Licence).
VERSION_STRING equ "1.71.54"
VERSION_MAJOR = 1
VERSION_MINOR = 71

View File

@@ -1,401 +0,0 @@
Visit http://flatassembler.net/ for more information.
version 1.71.16 (Oct 30, 2013)
[-] Fixed some bugs in the ELF executable formatter.
version 1.71.15 (Oct 26, 2013)
[-] Fixed some bugs inadvertently introduced in the previous release.
version 1.71.14 (Oct 25, 2013)
[+] Added "postpone" directive to preprocessor.
version 1.71.13 (Sep 09, 2013)
[-] Fixed a bug that caused the expressions containing external symbols
to overflow from time to time.
version 1.71.12 (Aug 04, 2013)
[-] Expressions in square brackets were incorrectly treated as valid numerical
values when used in some logical expressions.
[-] A previous fix to "store" directive did not apply to all the cases when it
was incorrectly leaving the data marked as uninitialized. The new fix
addresses this issue.
version 1.71.11 (Jul 09, 2013)
[-] Modifying a value in uninitialized data block with "store" directive will
now correctly mark this data as initialized when it is in a different
addressing space.
[-] Missing quote will no longer cause the symbols generator to hang or crash.
[-] Address range restrictions for addressing modes no longer apply to addresses
provided to assembler directives like "label", "virtual" or "load".
version 1.71.10 (Apr 03, 2013)
[-] Fixed a crashing "heap" directive in 64-bit PE format.
version 1.71.09 (Mar 30, 2013)
[-] "use16","use32" and "use64" no longer allow to put another instruction in
the same line.
[-] Fixed a bug in parser that caused it to hang while processing some
specific ill-structured preprocessed lines.
[-] Modified memory allocation algorithm on Windows machines with large RAM.
version 1.71.08 (Mar 08, 2013)
[-] Fixed a bug that caused "irp" to skip processing a list with one empty
element when default value for iterating variable was specified.
version 1.71.07 (Dec 23, 2012)
[-] Fixed a bug that was causing "used" operator to give incorrect results
in some very specific cases.
version 1.71.06 (Nov 22, 2012)
[-] Fixed a few bugs caused by unnecesarily strong restrictions on allowed
types of relocatable values in some places (like "label" directive).
version 1.71.05 (Oct 15, 2012)
[-] Fixed a bug which caused "load" and "store" directives to sometimes
fail when assembler had preallocated very large amount of memory.
version 1.71.04 (Oct 10, 2012)
[-] Fixed another bug in "org" directive, which was causing it to deal
incorrectly with negative addresses.
version 1.71.03 (Sep 27, 2012)
[-] Fixed a bug in "org" directive introduced by recent changes, which
was manifesting with bases larger than 31-bit.
version 1.71.02 (Sep 26, 2012)
[-] Expression calculator now allows to calculate the difference of
relocatable addresses in a reverse order (first substracting/negating
and then adding the other one).
version 1.71.01 (Sep 23, 2012)
[+] Added support for ADX, RDSEED and SMAP instruction sets.
[-] Fixed the bugs related to creating a new addressing space inside the
virtual block with "org" directive.
version 1.71.00 (Sep 21, 2012)
[+] Added ability to define a special kind of label identifying the
addressing space. This label can the be used with "load" or "store"
directives to allow operations on bytes in any addressing space,
not just the current one. This special label is defined by following
its name with double colon, and can only be used with "load" and
"store" directive, where address can now be specified in two parts,
first the adressing space label, then the colon and then the
address inside that addressing space.
version 1.70.03 (Jun 29, 2012)
[-] Allowed to freely upgrade or downgrade the relocatable addresses in
object format between the 32-bit or 64-bit size.
version 1.70.02 (May 22, 2012)
[-] Corrected the optimization of segment prefixes when the extended syntax
of some string instructions ("cmps", "lods", "movs" and "outs") is
used in long mode. Now it is consistent with optimizations done with
all the other instructions.
version 1.70.01 (Apr 30, 2012)
[-] Corrected a recently introduced bug that caused some illegal
address expressions to cause an error prematurely during the
parsing stage.
version 1.70 (Apr 17, 2012)
[+] Added support for AVX, AVX2, AES, CLMUL, FMA, RDRAND, FSGSBASE, F16C,
FMA4, XOP, MOVBE, BMI, TBM, INVPCID, HLE and RTM instruction sets.
[+] Added half-precision floating point values support.
[+] Extended the syntax of "rept" directive to allow numerical expressions
to be calculated by preprocessor in its arguments.
[+] Added "large" and "NX" settings for PE format.
[+] Allowed PE fixups to be resolved anywhere in the generated executable.
[+] Allowed to specify branding value (use 3 for Linux) after the
"format ELF executable" setting.
[+] Added "intepreter", "dynamic" and "note" keywords for creation of
special segments in ELF executables.
[-] Fixed long mode opcode generator to allow absolute addresses to be
generated with "qword" keyword inside square brackets.
[-] Disallowed negative immediates with "int", "enter", "ret" instructions.
[+] Allowed symbolic information dump file to be created even in case of error.
In such case it contains only the preprocessed source that can be extracted
with PREPSRC tool. If error occured during preprocessing, only the source up
to the point of error is provided.
[+] Added symbol references table to symbolic dump file.
[-] Corrected the "defined" and "used" flags in the symbols dump to reflect the
state from the final assembly pass.
[+] Added "assert" directive.
[-] Formatter symbols like "PE" or "readable" are now recognized only in the
context of formatter directives, and thus are no longer disallowed as
labels.
[+] Macroinstruction argument now can have default value, defined with "="
symbol followed by value after the argument name in definition.
[+] Added "relativeto" operator, which can be used in logical expressions
to test whether two values differ only by a constant and not relocatable
amount.
[-] Revised the expression calculator, it now is able to correctly perform
calculations in signed and unsigned ranges in full 64-bit. This fixes
a number of issues - the overflow will now be correctly detected for
64-bit values in cases, where previous versions could not distinguish
whether it was an overflow or not. The effect of these corrections is
that "dq" directive will now behave consistently with behavior of the
data directives for smaller sizes, and the same applies to all the
places where "qword" size for value is used.
version 1.68 (Jun 13, 2009)
[+] Added SSSE3 (Supplemental SSE3), SSE4.1, SSE4.2 and SSE4a instructions.
[+] Added the AMD SVM and Intel SMX instructions.
[+] Added "rdmsrq", "wrmsrq", "sysexitq" and "sysretq" mnemonics for the
64-bit variants of respective instructions.
[+] Added "fstenvw", "fstenvd", "fsavew", "fsaved", "frstorw" and "frstord"
mnemonics to allow choosing between 16-bit and 32-bit variants of
structures used by the "fstenv", "fsave" and "frstor" instructions.
[+] Added "plt" operator for the ELF output format.
[+] Allowed "rva" operator to be used in MS COFF object format, and also
added "static" keyword for the "public" directive.
[+] Added Intel-style aliases for the additional long mode 8-bit registers.
[-] The PE formatter now automatically detects whether relocatable labels
should be used, depending on whether the fixups directory is placed
somewhere into executable by programer, or not. This makes possible the
more flexible use of the addressing symbols in case of PE executable fixed
at some position.
[-] Added support for outputting the 32-bit address relocations in case of
64-bit object formats and PE executable. This makes some specific
instructions compilable, but it also forces linker to put such
generated code into the low 2 gigabytes of addressing space.
[+] Added "EFI", "EFIboot" and "EFIruntime" subsystem keywords for PE format.
[-] Corrected the precedence of operators of macroinstruction line maker.
The symbol escaping now has always the higher priority than symbol conversion,
and both have higher precedence than concatenation.
[+] Allowed to check "@b" and "@f" symbols with "defined" operator.
[+] Allowed "as" operator to specify the output file extension when
placed at the end of the "format" directive line.
[-] Definition of macro with the same name as one of the preprocessor's directives
is no longer allowed.
[+] Allowed single quote character to be put inside the number value,
to help improve long numbers readability.
[+] Added optional symbolic information output, and a set of tools that extract
various kinds of information from it.
[+] Added "err" directive that allows to signalize error from the source.
version 1.66 (May 7, 2006)
[+] Added "define" directive to preprocessor, which defines symbolic constants,
the same kind as "equ" directive, however there's an important difference
that "define" doesn't process symbolic constants in the value before
assigning it. For example:
a equ 1
a equ a+a
define b 1
define b b+b
defines the "a" constant with value "1+1", but the "b" is defined with
value "b+b". This directive may be useful in some advanced
macroinstructions.
[-] Moved part of the conditional expression processing into parser,
for slightly better performance and lesser memory usage by assembler.
The logical values defined with "eq", "eqtype" and "in" operators are now
evaluated by the parser and if they are enough to determine the condition,
the whole block is processed accordingly. Thus this block:
if eax eq EAX | 0/0
nop
end if
is parsed into just "nop" instruction, since parser is able to determine
that the condition is true, even though one of the logical values makes no
sense - but since this is none of the "eq", "eqtype" and "in" expressions,
the parser doesn't investigate.
[-] Also the assembler is now calculating only as many logical values as it
needs to determine the condition. So this block:
if defined alpha & alpha
end if
will not cause error when "alpha" is not defined, as it would with previous
versions. This is because after checking that "defined alpha" is false
condition it doesn't need to know the second logical value to determine the
value of conjunction.
[+] Added "short" keyword for specifying jump type, the "jmp byte" form is now
obsolete and no longer correct - use "jmp short" instead.
[-] The size operator applied to jump no longer applies to the size of relative
displacement - now it applies to the size of target address.
[-] The "ret" instruction with 0 parameter is now assembled into short form,
unless you force using the 16-bit immediate with "word" operator.
[+] Added missing extended registers for the 32-bit addressing in long mode.
[+] Added "linkremove" and "linkinfo" section flags for MS COFF output.
[+] Added support for GOT offsets in ELF object formatter, which can be useful
when making position-independent code for shared libraries. For any label
you can get its offset relative to GOT by preceding it with "rva" operator
(the same keyword as for PE format is used, to avoid adding a new one,
while this one has very similar meaning).
[-] Changed ELF executable to use "segment" directive in place of "section",
to make the distinction between the run-time segments and linkable
sections. If you had a "section" directive in your ELF executables and they
no longer assemble, replace it with "segment".
[-] The PE formatter now always creates the fixups directory when told to -
even when there are no fixups to be put there (in such case it creates the
directory with one empty block).
[-] Some of the internal structures have been extended to provide the
possibility of making extensive symbol dumps.
[-] Corrected "fix" directive to keep the value intact before assigning it to the
prioritized constant.
[+] The ` operator now works with any kind of symbol; when used with quoted
string it simply does nothing. Thus the sequence of ` operators applied to
one symbol work the same as if there was just one. In similar manner, the
sequence of # operators now works as if it was a single one - using such a
sequence instead of escaping, which was kept for some backward
compatibility, is now deprecated.
[-] Corrected order of identifying assembler directives ("if db eq db" was
incorrectly interpreted as data definition).
[-] Many other small bugs fixed.
version 1.64 (Aug 8, 2005)
[+] Output of PE executables for Win64 architecture (with "format PE64"
setting).
[+] Added "while" and "break" directives.
[+] Added "irp" and "irps" directives.
[+] The macro arguments can be marked as required with the "*" character.
[-] Fixed checking for overflow when multiplying 64-bit values - the result
must always fit in the range of signed 64 integer now.
[-] Segment prefixes were generated incorrectly in 16-bit mode when BP was used
as a second addressing register - fixed.
[-] The "local" directive was not creating unique labels in some cases - fixed.
[-] The "not encodable with long immediate" error in 64-bit mode was sometimes
wrongly signaled - fixed.
[-] Other minor fixes and corrections.
version 1.62 (Jun 14, 2005)
[+] Escaping of symbols inside macroinstructions with backslash.
[+] Ability of outputting the COFF object files for Win64 architecture
(with "format MS64 COFF" setting).
[+] New preprocessor directives: "restruc", "rept" and "match"
[+] VMX instructions support (not documented).
[+] Extended data directives to allow use of the "dup" operator.
[+] Extended "struc" features to allow custom definitions of main structure's
label.
[-] When building resources from the the .RES file that contained more
than one resource of the same string name, the separate resource
directories were created with the same names - fixed.
[-] Several bugs in the ELF64 object output has been fixed.
[-] Corrected behavior of "fix" directive to more straightforward.
[-] Fixed bug in "include" directive, which caused files included from within
macros to be processed the wrong way.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 B

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 680 B

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1010 B

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 734 B