max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
src/bootloader.asm
edwardatki/eDOS
1
102192
<gh_stars>1-10 ;+---------------------------------+ ;| SECTOR 1 - Primary Bootloader | ;+---------------------------------+ [bits 16] [org 0x0000] Start: jmp 0x07C0:Loader ; Jump over OEM block nop ;*************************************************; ; OEM Parameter block / BIOS Parameter Block ; ;*************************************************; TIMES 0Bh-$+Start DB 0 bpbBytesPerSector: DW 512 ; 11 Byte offset bpbSectorsPerCluster: DB 1 ; 13 bpbReservedSectors: DW 1 ; 14 bpbNumberOfFATs: DB 2 ; 16 bpbRootEntries: DW 224 ; 17 bpbTotalSectors: DW 2880 ; 19 bpbMedia: DB 0xF0 ; 21 bpbSectorsPerFAT: DW 9 ; 22 bpbSectorsPerTrack: DW 18 ; 24 bpbHeadsPerCylinder: DW 2 ; 26 bpbHiddenSectors: DD 0 ; 28 bpbTotalSectorsBig: DD 0 ; 32 bsDriveNumber: DB 0 ; 36 bsUnused: DB 0 ; 37 bsExtBootSignature: DB 0x29 ; 38 bsSerialNumber: DD 0xa0a1a2a3 ; 42 bsVolumeLabel: DB "EDOS " ; 43 bsFileSystem: DB "FAT12 " ; 44 ;*************************************************; Loader: ; Setup Segments and Stack cli mov ax, 0x07C0 mov ds, ax mov es, ax mov ax, 0x0000 mov ss, ax mov sp, 0xFFFF sti mov [DISK], dl ; Set disk mov si, FILENAME mov bx, 0x0000 ; Offset mov ax, 0x0050 ; Segment call Disk.GetFile jmp 0x0000:0x0500 ; Jump to Second Stage ; ----- Routines ----- %include "src/disk.asm" Print: push ax .Loop: lodsb or al, al jz .Exit mov ah, 0x0e int 0x10 jmp .Loop .Exit: pop ax ret ; ----- Variables ----- DISK EQU 0xF000 LBA EQU 0xF002 RD_START EQU 0xF004 RD_SIZE EQU 0xF006 MEM_OFFSET: dw 0x0200 FILENAME: db "LOADER SYS" times 510 - ($-$$) db 0 dw 0xAA55
x86/Uci.asm
lucabrivio/asmFish-fasmg
1
101987
Options_Init: lea rdx, [options] mov byte[rdx + Options.displayInfoMove], -1 mov dword[rdx + Options.contempt], 0 mov dword[rdx + Options.threads], 1 mov dword[rdx + Options.hash], 16 mov byte[rdx + Options.ponder], 0 mov dword[rdx + Options.multiPV], 1 mov dword[rdx + Options.moveOverhead], 50 mov byte[rdx + Options.chess960], 0 mov dword[rdx + Options.syzygyProbeDepth], 1 mov byte[rdx + Options.syzygy50MoveRule], -1 mov dword[rdx + Options.syzygyProbeLimit], 6 mov byte[rdx + Options.largePages], 0 lea rcx, [rdx + Options.hashPathBuffer] mov rax, '<empty>' mov qword[rdx + Options.hashPath], rcx mov qword[rcx], rax mov qword[ioBuffer + IOBuffer.log], -1 ret Options_Destroy: push rbx mov rcx, qword[options.hashPath] mov rdx, qword[options.hashPathSizeB] lea rax, [options.hashPathBuffer] cmp rcx, rax je @1f call Os_VirtualFree @1: pop rbx ret UciLoop: virtual at rsp .th1 Thread .th2 Thread .states rb 2*sizeof.State .limits Limits .time rq 1 .nodes rq 1 .extra rq 4 .localend rb 0 end virtual .localsize = ((.localend-rsp+15) and (-16)) push rbp rsi rdi rbx r11 r12 r13 r14 r15 _chkstk_ms rsp, UciLoop.localsize sub rsp, UciLoop.localsize mov byte[options.displayInfoMove], -1 xor eax, eax mov qword[UciLoop.th1.rootPos.stateTable], rax lea rcx, [UciLoop.states] lea rdx, [rcx+2*sizeof.State] mov qword[UciLoop.th2.rootPos.state], rcx mov qword[UciLoop.th2.rootPos.stateTable], rcx mov qword[UciLoop.th2.rootPos.stateEnd], rdx UciNewGame: mov rcx, qword[UciLoop.th1.rootPos.stateTable] mov rdx, qword[UciLoop.th1.rootPos.stateEnd] sub rdx, rcx call Os_VirtualFree xor eax, eax lea rbp, [UciLoop.th1.rootPos] mov qword[UciLoop.th1.rootPos.state], rax mov qword[UciLoop.th1.rootPos.stateTable], rax mov qword[UciLoop.th1.rootPos.stateEnd], rax lea rsi, [szStartFEN] xor ecx, ecx call Position_ParseFEN call Search_Clear if USE_BOOK call Book_Refresh end if jmp UciGetInput UciNextCmdFromCmdLine: ; rsi is the address of the current command string to process (qword[CmdLineStart]) ; if this string is empty, we should either ; set CmdLineStart=NULL or goto quit depending on USE_CMDLINEQUIT ; if this string is not empty, we should ; set CmdLineStart to be the address of the next command xor eax, eax mov r15, rsi ; save current command address mov qword[ioBuffer.cmdLineStart], rax cmp al, byte[rsi] if USE_CMDLINEQUIT je UciQuit else je UciGetInput end if ; find start of next command .Next: mov al, byte[rsi] test al, al jz .Found add rsi, 1 cmp al, ' ' jae .Next ; we have hit the new line char .Found: ; rsi is now the address of next command mov qword[ioBuffer.cmdLineStart], rsi mov rsi, r15 ; restore current command address Display 1, 'processing cmd line command: %S6%n' jmp UciChoose ; UciGetInput is where we expect to get a new command ; this can either come from the command line or from reading from stdin ; when processing this string, we can modify it, ; but we must not modify anything after the newline char, which signifies the start of next command ; we usually display something before getting new input or even need to put a newline on the end of it UciWriteOut_NewLine: PrintNL UciWriteOut: call WriteLine_Output UciGetInput: mov rsi, qword[ioBuffer.cmdLineStart] test rsi, rsi jnz UciNextCmdFromCmdLine call ReadLine test eax, eax jnz UciQuit UciChoose: ; rsi is the address of the string to process cmp byte[rsi], ' ' jb UciGetInput ; don't process empty lines call SkipSpaces lea rcx, [sz_go] call CmpString test eax, eax jnz UciGo lea rcx, [sz_position] call CmpString test eax, eax jnz UciPosition lea rcx, [sz_stop] call CmpString test eax, eax jnz UciStop lea rcx, [sz_isready] call CmpString test eax, eax jnz UciIsReady lea rcx, [sz_ponderhit] call CmpString test eax, eax jnz UciPonderHit lea rcx, [sz_ucinewgame] ; check before uci :) call CmpString test eax, eax jnz UciNewGame lea rcx, [sz_uci] call CmpString test eax, eax jnz UciUci lea rcx, [sz_setoption] call CmpString test eax, eax jnz UciSetOption lea rcx, [sz_quit] call CmpString test eax, eax jnz UciQuit lea rcx, [sz_wait] call CmpString test eax, eax jnz UciWait lea rcx, [sz_perft] call CmpString test eax, eax jnz UciPerft lea rcx, [sz_bench] call CmpString test eax, eax jnz UciBench if VERBOSE > 0 szcall CmpString, 'show' test eax, eax jnz UciShow szcall CmpString, 'undo' test eax, eax jnz UciUndo szcall CmpString, 'moves' test eax, eax jnz UciMoves szcall CmpString, 'donull' test eax, eax jnz UciDoNull szcall CmpString, 'eval' test eax, eax jnz UciEval end if if USE_BOOK > 0 szcall CmpString, 'bookprobe' test eax, eax jz @1f call Book_DisplayProbe jmp UciGetInput @1: end if if PROFILE > 0 szcall CmpString, 'profile' test eax, eax jnz UciProfile end if UciUnknown: lea rdi, [Output] lea rcx, [sz_error_unknown] call PrintString mov ecx, 64 call ParseToken PrintNL jmp UciWriteOut UciQuit: mov byte[signals.stop], -1 mov rcx, qword[threadPool.threadTable + 8*0] call Thread_StartSearching_TRUE mov rcx, qword[threadPool.threadTable + 8*0] call Thread_WaitForSearchFinished mov rcx, qword[UciLoop.th1.rootPos.stateTable] mov rdx, qword[UciLoop.th1.rootPos.stateEnd] sub rdx, rcx call Os_VirtualFree add rsp, UciLoop.localsize pop r15 r14 r13 r12 r11 rbx rdi rsi rbp ret ;;;;;;;; ; uci ;;;;;;;; UciUci: lea rcx, [szUciResponse] lea rdi, [szUciResponseEnd] call WriteLine jmp UciGetInput ;;;;;;;;;;;; ; isready ;;;;;;;;;;;; UciIsReady: mov al, byte[options.changed] test al, al jz .ok call UciSync .ok: lea rdi, [Output] mov rax, 'readyok' stosq sub rdi, 1 PrintNL jmp UciWriteOut ;;;;;;;;;;;;; ; ponderhit ;;;;;;;;;;;;; UciPonderHit: movzx eax, byte[signals.stopOnPonderhit] test al, al jnz .stop mov byte[limits.ponder], al if USE_BOOK ; if have a book move, the search should be stopped cmp eax, dword[book.move] je @1f mov byte[signals.stop], -1 @1: end if ; we are now switching to normal search mode ; check the time in case we have to abort the search asap call CheckTime jmp UciGetInput .stop: mov byte[signals.stop], -1 mov rcx, qword[threadPool.threadTable + 8*0] call Thread_StartSearching_TRUE jmp UciGetInput ;;;;;;;; ; stop ;;;;;;;; UciStop: mov byte[signals.stop], -1 mov rcx, qword[threadPool.threadTable + 8*0] call Thread_StartSearching_TRUE UciWait: mov rcx, qword[threadPool.threadTable + 8*0] call Thread_WaitForSearchFinished jmp UciGetInput UciSync: push rbx call MainHash_ReadOptions call ThreadPool_ReadOptions mov byte[options.changed], 0 pop rbx ret ;;;;;;; ; go ;;;;;;; UciGo: mov al, byte[options.changed] test al, al jz .ok call UciSync .ok: lea rcx, [UciLoop.limits] call Limits_Init .ReadLoop: call SkipSpaces cmp byte[rsi], ' ' jb .ReadLoopDone lea rdi, [UciLoop.limits.time+4*White] lea rcx, [sz_wtime] call CmpString test eax, eax jnz .parse_dword lea rdi, [UciLoop.limits.time+4*Black] lea rcx, [sz_btime] call CmpString test eax, eax jnz .parse_dword lea rdi, [UciLoop.limits.incr+4*White] lea rcx, [sz_winc] call CmpString test eax, eax jnz .parse_dword lea rdi, [UciLoop.limits.incr+4*Black] lea rcx, [sz_binc] call CmpString test eax, eax jnz .parse_dword lea rdi, [UciLoop.limits.infinite] lea rcx, [sz_infinite] call CmpString test eax, eax jnz .parse_true lea rdi, [UciLoop.limits.movestogo] lea rcx, [sz_movestogo] call CmpString test eax, eax jnz .parse_dword lea rdi, [UciLoop.limits.nodes] lea rcx, [sz_nodes] call CmpString test eax, eax jnz .parse_qword lea rdi, [UciLoop.limits.movetime] lea rcx, [sz_movetime] call CmpString test eax, eax jnz .parse_dword lea rdi, [UciLoop.limits.depth] lea rcx, [sz_depth] call CmpString test eax, eax jnz .parse_dword lea rdi, [UciLoop.limits.mate] lea rcx, [sz_mate] call CmpString test eax, eax jnz .parse_dword lea rdi, [UciLoop.limits.ponder] lea rcx, [sz_ponder] call CmpString test eax, eax jnz .parse_true lea rcx, [sz_searchmoves] call CmpString test eax, eax jnz .parse_searchmoves .Error: lea rdi, [Output] lea rcx, [sz_error_token] call PrintString mov ecx, 64 call ParseToken PrintNL jmp UciWriteOut .ReadLoopDone: lea rcx, [UciLoop.limits] call Limits_Set lea rcx, [UciLoop.limits] call ThreadPool_StartThinking jmp UciGetInput .parse_qword: call SkipSpaces call ParseInteger mov qword[rdi], rax jmp .ReadLoop .parse_dword: call SkipSpaces call ParseInteger mov dword[rdi], eax jmp .ReadLoop .parse_true: mov byte[rdi], -1 jmp .ReadLoop .parse_searchmoves: call SkipSpaces call ParseUciMove test eax, eax jz .ReadLoop mov ecx, dword[UciLoop.limits.moveVecSize] lea rdi, [UciLoop.limits.moveVec] repne scasw test ecx, ecx ; is the move already in the list? jnz .parse_searchmoves stosw add dword[UciLoop.limits.moveVecSize], 1 jmp .parse_searchmoves ;;;;;;;;;;;; ; position ;;;;;;;;;;;; UciPosition: call SkipSpaces cmp byte[rsi], ' ' jb UciUnknown ; write to pos2 in case of failure lea rbp, [UciLoop.th2.rootPos] lea rcx, [sz_fen] call CmpString test eax, eax jnz .Fen lea rcx, [sz_startpos] call CmpString test eax, eax jz .BadCmd .Start: mov r15, rsi lea rsi, [szStartFEN] xor ecx, ecx call Position_ParseFEN mov rsi, r15 jmp .check .Fen: movzx ecx, byte[options.chess960] call Position_ParseFEN .check: test eax, eax jnz .illegal .moves: ; copy pos2 to pos before parsing moves lea rcx, [UciLoop.th1.rootPos] call Position_CopyTo lea rbp, [UciLoop.th1.rootPos] call SkipSpaces lea rcx, [sz_moves] call CmpString lea rdi, [Output] test eax, eax jz .CheckJunk call UciParseMoves test rax, rax jz UciGetInput .badmove: mov rsi, rax lea rcx, [sz_error_moves] call PrintString mov ecx, 6 call ParseToken PrintNL lea rbp, [UciLoop.th1.rootPos] jmp UciWriteOut .illegal: lea rdi, [Output] lea rcx, [sz_error_fen] call PrintString PrintNL lea rbp, [UciLoop.th1.rootPos] jmp UciWriteOut .BadCmd: lea rbp, [UciLoop.th1.rootPos] jmp UciUnknown .CheckJunk: mov al, byte[rsi] cmp al, ' ' jb UciGetInput lea rcx, [sz_error_token] call PrintString mov ecx, 6 call ParseToken jmp UciWriteOut_NewLine UciParseMoves: ; in: rbp position ; rsi string ; rax = 0 if full string could be parsed ; = address of illegal move if there is one push rbx rsi rdi .get_move: call SkipSpaces xor eax, eax cmp byte[rsi], ' ' jb .done call ParseUciMove mov edi, eax test eax, eax mov rax, rsi jz .done mov ecx, 2 call Position_SetExtraCapacity mov rbx, qword[rbp + Pos.state] mov ecx, edi mov dword[rbx + sizeof.State+State.currentMove], edi call Move_GivesCheck mov ecx, edi mov byte[rbx + State.givesCheck], al call Move_Do__UciParseMoves inc dword[rbp + Pos.gamePly] mov qword[rbp + Pos.state], rbx call SetCheckInfo jmp .get_move .done: pop rdi rcx rbx ret ;;;;;;;;;;;; ; setoption ;;;;;;;;;;;; UciSetOption: mov rax, qword[threadPool.threadTable+8*0] mov al, byte[rax+Thread.searching] lea rcx, [sz_error_think] test al, al jnz .Error .Read: call SkipSpaces lea rcx, [sz_name] call CmpString lea rcx, [sz_error_name] test eax, eax jz .Error call SkipSpaces lea rcx, [sz_threads] call CmpStringCaseless lea rbx, [.Threads] test eax, eax jnz .CheckValue lea rcx, [sz_hash] call CmpStringCaseless lea rbx, [.Hash] test eax, eax jnz .CheckValue lea rcx, [sz_largepages] call CmpStringCaseless lea rbx, [.LargePages] test eax, eax jnz .CheckValue lea rcx, [sz_nodeaffinity] call CmpStringCaseless lea rbx, [.NodeAffinity] test eax, eax jnz .CheckValue lea rcx, [sz_priority] call CmpStringCaseless lea rbx, [.Priority] test eax, eax jnz .CheckValue lea rcx, [sz_clear_hash] ; arena may send Clear Hash call CmpStringCaseless ; instead of ClearHash test eax, eax ; jnz .ClearHash ; lea rcx, [sz_ponder] call CmpStringCaseless lea rbx, [.Ponder] test eax, eax jnz .CheckValue lea rcx, [sz_contempt] call CmpStringCaseless lea rbx, [.Contempt] test eax, eax jnz .CheckValue lea rcx, [sz_multipv] call CmpStringCaseless lea rbx, [.MultiPv] test eax, eax jnz .CheckValue lea rcx, [sz_moveoverhead] call CmpStringCaseless lea rbx, [.MoveOverhead] test eax, eax jnz .CheckValue lea rcx, [sz_uci_chess960] call CmpStringCaseless lea rbx, [.Chess960] test eax, eax jnz .CheckValue lea rcx, [sz_logfile] call CmpStringCaseless lea rbx, [.Log] test eax, eax jnz .CheckValue if USE_SYZYGY = 1 lea rcx, [sz_syzygypath] call CmpStringCaseless lea rbx, [.SyzygyPath] test eax, eax jnz .CheckValue lea rcx, [sz_syzygyprobedepth] call CmpStringCaseless lea rbx, [.SyzygyProbeDepth] test eax, eax jnz .CheckValue lea rcx, [sz_syzygy50moverule] call CmpStringCaseless lea rbx, [.Syzygy50MoveRule] test eax, eax jnz .CheckValue lea rcx, [sz_syzygyprobelimit] call CmpStringCaseless lea rbx, [.SyzygyProbeLimit] test eax, eax jnz .CheckValue end if lea rcx, [sz_ttfile] call CmpStringCaseless lea rbx, [.HashFile] test eax, eax jnz .CheckValue lea rcx, [sz_ttsave] call CmpStringCaseless test eax, eax jnz .HashSave lea rcx, [sz_ttload] call CmpStringCaseless test eax, eax jnz .HashLoad if USE_BOOK = 1 lea rcx, [sz_bookfile] call CmpStringCaseless lea rbx, [.BookFile] test eax, eax jnz .CheckValue lea rcx, [sz_ownbook] call CmpStringCaseless lea rbx, [.OwnBook] test eax, eax jnz .CheckValue lea rcx, [sz_bestbookmove] call CmpStringCaseless lea rbx, [.BestBookMove] test eax, eax jnz .CheckValue lea rcx, [sz_bookdepth] call CmpStringCaseless lea rbx, [.BookDepth] test eax, eax jnz .CheckValue end if if USE_WEAKNESS = 1 lea rcx, [sz_uci_limitstrength] call CmpStringCaseless lea rbx, [.UciLimitStrength] test eax, eax jnz .CheckValue lea rcx, [sz_uci_elo] call CmpStringCaseless lea rbx, [.UciElo] test eax, eax jnz .CheckValue end if if USE_VARIETY = 1 lea rcx, [sz_variety] call CmpStringCaseless lea rbx, [.Variety] test eax, eax jnz .CheckValue end if lea rdi, [Output] lea rcx, [sz_error_option] call PrintString mov ecx, 64 call ParseToken PrintNL jmp UciWriteOut .Error: lea rdi, [Output] call PrintString PrintNL call WriteLine_Output jmp UciGetInput .CheckValue: call SkipSpaces lea rcx, [sz_value] call CmpString lea rcx, [sz_error_value] test eax, eax jz .Error call SkipSpaces jmp rbx ; these options require further careful processing in UciSync and set changed = true .LargePages: call ParseBoole mov byte[options.largePages], al mov byte[options.changed], -1 jmp UciGetInput .Hash: call ParseInteger ClampUnsigned eax, 1, 1 shl MAX_HASH_LOG2MB mov ecx, eax mov dword[options.hash], eax mov byte[options.changed], -1 jmp UciGetInput .Threads: call ParseInteger ClampUnsigned eax, 1, MAX_THREADS mov dword[options.threads], eax mov byte[options.changed], -1 jmp UciGetInput ; these options are processed right away .NodeAffinity: call ThreadPool_Destroy mov rcx, rsi call ThreadPool_Create call Os_DisplayThreadPoolInfo call ThreadPool_ReadOptions jmp UciGetInput .Priority: call SkipSpaces lea rcx, [sz_none] call CmpStringCaseless test eax, eax jnz UciGetInput lea rcx, [sz_normal] call CmpStringCaseless test eax, eax jnz .PriorityNormal lea rcx, [sz_low] call CmpStringCaseless test eax, eax jnz .PriorityLow lea rcx, [sz_idle] call CmpStringCaseless test eax, eax jnz .PriorityIdle lea rdi, [Output] lea rcx, [sz_error_priority] call PrintString mov ecx, 64 call ParseToken jmp UciWriteOut_NewLine .PriorityNormal: call Os_SetPriority_Normal jmp UciGetInput .PriorityLow: call Os_SetPriority_Low jmp UciGetInput .PriorityIdle: call Os_SetPriority_Idle jmp UciGetInput .ClearHash: call Search_Clear lea rdi, [Output] lea rcx, [sz_hash_cleared] call PrintString jmp UciWriteOut_NewLine if USE_SYZYGY = 1 .SyzygyPath: ; if path is <empty>, send NULL to init lea rcx, [sz_empty] call CmpString xor ecx, ecx test eax, eax jnz .SyzygyPathDone ; find terminator and replace it with zero mov rcx, rsi @1: add rsi, 1 cmp byte[rsi], ' ' jae @1b mov byte[rsi], 0 .SyzygyPathDone: call Tablebase_Init call Tablebase_DisplayInfo jmp UciGetInput end if .HashFile: call SkipSpaces ; find terminator and replace it with zero or ebx, -1 @1: add ebx, 1 cmp byte[rsi+rbx], ' ' jae @1b ; back up if any spaces are present on the end add ebx, 1 @1: sub ebx, 1 mov byte[rsi+rbx], 0 jz @2f cmp byte[rsi+rbx-1], ' ' je @1b @2: add ebx, 1 ; null term string is now at rsi ; null terminated length is in ebx mov rcx, qword[options.hashPath] mov rdx, qword[options.hashPathSizeB] lea rax, [options.hashPathBuffer] cmp rcx, rax je @1f call Os_VirtualFree @1: mov ecx, ebx lea rax, [options.hashPathBuffer] cmp ecx, 100 jb @1f call Os_VirtualAlloc @1: mov rdi, rax mov qword[options.hashPath], rax mov qword[options.hashPathSizeB], rbx ; copy null terminated string mov ecx, ebx rep movsb lea rdi, [Output] lea rcx, [sz_path_set] call PrintString mov rcx, qword[options.hashPath] call PrintString jmp UciWriteOut_NewLine .HashSave: call MainHash_SaveFile jmp UciGetInput .HashLoad: call MainHash_LoadFile jmp UciGetInput ; these options don't require any processing .MultiPv: call ParseInteger ClampUnsigned eax, 1, MAX_MOVES mov dword[options.multiPV], eax jmp UciGetInput .Chess960: call ParseBoole mov byte[options.chess960], al jmp UciGetInput .Ponder: call ParseBoole mov byte[options.ponder], al jmp UciGetInput .Contempt: call ParseInteger ClampSigned eax, -100, 100 mov dword[options.contempt], eax jmp UciGetInput .MoveOverhead: call ParseInteger ClampUnsigned eax, 0, 5000 mov dword[options.moveOverhead], eax jmp UciGetInput .Log: ; if path is <empty>, send NULL to init lea rcx, [sz_empty] call CmpString xor ecx, ecx test eax, eax jnz .LogPathDone ; find terminator and replace it with zero mov rcx, rsi @1: add rsi, 1 cmp byte[rsi], ' ' jae @1b mov byte[rsi], 0 .LogPathDone: call Log_Init jmp UciGetInput if USE_SYZYGY = 1 .SyzygyProbeDepth: call ParseInteger ClampUnsigned eax, 1, 100 mov dword[options.syzygyProbeDepth], eax jmp UciGetInput .Syzygy50MoveRule: call ParseBoole mov byte[options.syzygy50MoveRule], al jmp UciGetInput .SyzygyProbeLimit: call ParseInteger ClampUnsigned eax, 0, 6 mov dword[options.syzygyProbeLimit], eax jmp UciGetInput end if if USE_BOOK = 1 .BookFile: call Book_Load jmp UciGetInput .OwnBook: call ParseBoole mov byte[book.ownBook], al jmp UciGetInput .BestBookMove: call ParseBoole mov byte[book.bestBookMove], al jmp UciGetInput .BookDepth: call ParseInteger ClampSigned eax, -10, 100 mov dword[book.bookDepth], eax jmp UciGetInput end if if USE_WEAKNESS = 1 .UciLimitStrength: call ParseBoole mov byte[weakness.enabled], al jmp UciGetInput .UciElo: call ParseInteger ClampSigned eax, 0, 3300 mov ecx, eax call Weakness_SetElo jmp UciGetInput end if if USE_VARIETY = 1 .Variety: call ParseInteger ClampSigned eax, 0, 100 lea rdx, [variety] _vxorps xmm0, xmm0, xmm0 _vmovaps dqword[rdx + Variety.a_float], xmm0 _vmovaps dqword[rdx + Variety.b_float], xmm0 _vmovaps dqword[rdx + Variety.clamp], xmm0 _vmovaps dqword[rdx + Variety.a_bound], xmm0 ; clear b_bound also test eax, eax jz UciGetInput _vcvtsi2ss xmm0, xmm0, eax _vmovaps xmm1, dqword[.two] _vmovaps xmm2, dqword[.epsilon] _vpunpckldq xmm0, xmm0, xmm0 _vpunpckldq xmm0, xmm0, xmm0 _vdivps xmm1, xmm1, xmm0 _vmulps xmm2, xmm2, xmm0 _vmovaps dqword[rdx + Variety.a_float], xmm0 _vmovaps dqword[rdx + Variety.b_float], xmm1 _vmovaps dqword[rdx + Variety.clamp], xmm2 lea eax, [4*rax] lea ecx, [2*rax+1000] mov dword[rdx + Variety.a_bound], eax mov dword[rdx + Variety.b_bound], ecx jmp UciGetInput align 16 .two: dd -2.0, -2.0, -2.0, -2.0 .epsilon: dd -0.9999997, -0.9999997, -0.9999997, -0.9999997 end if ;;;;;;;;;;;; ; *extras* ;;;;;;;;;;;; UciPerft: call SkipSpaces call ParseInteger test eax, eax jz .bad_depth cmp eax, 10 ; probably will take a long time ja .bad_depth mov esi, eax mov ecx, eax call Position_SetExtraCapacity call Os_SetPriority_Realtime mov ecx, esi call Perft_Root call Os_SetPriority_Normal jmp UciGetInput .bad_depth: lea rdi, [Output] lea rcx, [sz_error_depth] call PrintString mov ecx, 8 call ParseToken jmp UciWriteOut_NewLine UciBench: mov r12d, 13 ; depth mov r13d, 1 ; threads mov r14d, 16 ; hash lea rdi, [.parse_hash] .parse_loop: call SkipSpaces cmp byte[rsi], ' ' jb .parse_done movzx eax, byte[rsi] cmp eax, '1' jb @1f cmp eax, '9' ja @1f test rdi, rdi jz @1f jmp rdi ; we have a number without preceding depth, threads, hash, or realtime token @1: lea rcx, [sz_threads] call CmpString test eax, eax jnz .parse_threads lea rcx, [sz_depth] call CmpString test eax, eax jnz .parse_depth lea rcx, [sz_hash] call CmpString test eax, eax jnz .parse_hash jmp .parse_done .parse_hash: lea rdi, [.parse_threads] call SkipSpaces call ParseInteger ClampUnsigned eax, 1, 1 shl MAX_HASH_LOG2MB mov r14d, eax jmp .parse_loop .parse_threads: lea rdi, [.parse_depth] call SkipSpaces call ParseInteger ClampUnsigned eax, 1, MAX_THREADS mov r13d, eax jmp .parse_loop .parse_depth: xor edi, edi call SkipSpaces call ParseInteger ClampUnsigned eax, 1, 40 mov r12d, eax jmp .parse_loop .parse_done: ; write out stats for this bench lea rdi, [Output] mov qword[UciLoop.extra+8*0], r14 mov qword[UciLoop.extra+8*1], r13 mov qword[UciLoop.extra+8*2], r12 lea rcx, [sz_format_bench1] lea rdx, [UciLoop.extra] xor r8, r8 call PrintFancy if VERBOSE = 0 call WriteLine_Output end if mov dword[options.hash], r14d call MainHash_ReadOptions mov dword[options.threads], r13d call ThreadPool_ReadOptions xor eax, eax mov qword[UciLoop.nodes], rax if VERBOSE = 0 mov byte[options.displayInfoMove], al end if call Search_Clear xor r13d, r13d mov qword[UciLoop.time], r13 mov qword[UciLoop.nodes], r13 lea rsi, [BenchFens] .nextpos: add r13d, 1 call SkipSpaces lea rcx, [Bench960Fens] sub rcx, rsi neg ecx sar ecx, 31 not ecx lea rbp, [UciLoop.th1.rootPos] mov byte[options.chess960], cl call Position_ParseFEN call SkipSpaces lea rcx, [sz_moves] call CmpString test eax, eax jz @1f call UciParseMoves @1: lea rcx, [UciLoop.limits] call Limits_Init lea rcx, [UciLoop.limits] mov dword[rcx+Limits.depth], r12d call Limits_Set lea rcx, [UciLoop.limits] call Os_GetTime mov r14, rax lea rcx, [UciLoop.limits] call ThreadPool_StartThinking mov rcx, qword[threadPool.threadTable + 8*0] call Thread_WaitForSearchFinished call Os_GetTime sub r14, rax neg r14 call ThreadPool_NodesSearched_TbHits add qword[UciLoop.time], r14 add qword[UciLoop.nodes], rax mov r15, rax ; write out stats for this position lea rdi, [Output] mov rcx, r14 cmp r14, 1 adc rcx, 0 mov rax, r15 xor edx, edx div rcx mov qword[UciLoop.extra + 8*0], r13 mov qword[UciLoop.extra + 8*1], r15 mov qword[UciLoop.extra + 8*2], rax mov qword[UciLoop.extra + 8*3], r14 lea rcx, [sz_format_bench2] lea rdx, [UciLoop.extra] xor r8, r8 call PrintFancy if VERBOSE = 0 call WriteLine_Output else lea rcx, [Output] call Os_WriteError end if cmp rsi, BenchFensEnd jb .nextpos ; write out stats for overall bench lea rdi, [Output] mov rax, qword[UciLoop.nodes] mov rcx, qword[UciLoop.time] mov edx, 1000 mov qword[UciLoop.extra+8*0], rcx mov qword[UciLoop.extra+8*1], rax mul rdx cmp rcx, 1 adc rcx, 0 div rcx mov qword[UciLoop.extra+8*2], rax lea rcx, [sz_format_bench3] lea rdx, [UciLoop.extra] xor r8, r8 call PrintFancy if VERBOSE = 0 call WriteLine_Output else lea rcx, [Output] call Os_WriteError end if mov byte[options.displayInfoMove], -1 jmp UciGetInput if VERBOSE > 0 UciDoNull: mov rbx, qword[rbp + Pos.state] mov rax, qword[rbx + State.checkersBB] test rax, rax jnz UciGetInput mov rax, rbx sub rax, qword[rbp + Pos.stateTable] xor edx, edx mov ecx, sizeof.State div ecx lea ecx, [rax + 8] shr ecx, 2 add ecx, eax call Position_SetExtraCapacity mov rbx, qword[rbp + Pos.state] mov dword[rbx + sizeof.State + State.currentMove], MOVE_NULL call Move_DoNull mov qword[rbp + Pos.state], rbx call SetCheckInfo jmp UciShow UciShow: lea rdi, [Output] mov rbx, qword[rbp + Pos.state] call Position_Print jmp UciWriteOut UciUndo: mov rbx, qword[rbp + Pos.state] call SkipSpaces call ParseInteger sub eax, 1 adc eax, 0 mov r15d, eax .Undo: cmp rbx, qword[rbp + Pos.stateTable] jbe UciShow mov ecx, dword[rbx + State.currentMove] call Move_Undo sub r15d, 1 jns .Undo jmp UciShow UciMoves: call UciParseMoves jmp UciShow UciEval: mov rbx, qword[rbp+Pos.state] ; allocate pawn hash mov ecx, PAWN_HASH_ENTRY_COUNT*sizeof.PawnEntry call Os_VirtualAlloc mov qword[rbp+Pos.pawnTable], rax ; allocate material hash mov ecx, MATERIAL_HASH_ENTRY_COUNT*sizeof.MaterialEntry call Os_VirtualAlloc mov qword[rbp+Pos.materialTable], rax call Evaluate mov r15d, eax ; free material hash mov rcx, qword[rbp+Pos.materialTable] mov edx, MATERIAL_HASH_ENTRY_COUNT*sizeof.MaterialEntry call Os_VirtualFree xor eax, eax mov qword[rbp+Pos.materialTable], rax ; free pawn hash mov rcx, qword[rbp+Pos.pawnTable] mov edx, PAWN_HASH_ENTRY_COUNT*sizeof.PawnEntry call Os_VirtualFree xor eax, eax mov qword[rbp+Pos.pawnTable], rax lea rdi, [Output] movsxd rax, r15d call PrintSignedInteger mov eax, ' == ' stosd mov ecx, r15d call PrintScore_Uci PrintNL jmp UciWriteOut end if
nasm assembly/assgnments/question6.asm
AI-Factor-y/NASM-library
0
81286
<gh_stars>0 section .data msg1 : db 'Enter first digit of first number :' l1 : equ $-msg1 msg2 : db 'Enter second digit of first number :' l2 : equ $-msg2 msg3 : db 'its is not prime' l3 : equ $-msg3 msg4 : db 'it is prime ' l4 : equ $-msg4 section .bss num11 : resb 1 num12 : resb 1 num21 : resb 1 num22 :resb 1 num31 : resb 1 num32 : resb 1 n1 : resb 1 n2 : resb 1 n3 : resb 1 ans1 : resb 1 ans2 : resb 1 ans3 : resb 1 ans4 : resw 1 junk : resb 1 junk1 : resb 1 junk2 : resb 1 junk3 : resb 1 junk4 : resb 1 junk5 : resb 1 check_var1 : resb 1 check_var2 : resb 1 counter : resb 1 section .text global _start: _start: mov eax, 4 mov ebx, 1 mov ecx, msg1 mov edx, l1 int 80h mov eax, 3 mov ebx, 0 mov ecx, num11 mov edx, 1 int 80h mov eax, 3 mov ebx, 0 mov ecx, junk mov edx, 1 int 80h mov eax, 4 mov ebx, 1 mov ecx, msg2 mov edx, l1 int 80h mov eax, 3 mov ebx, 0 mov ecx, num12 mov edx, 1 int 80h mov eax, 3 mov ebx, 0 mov ecx, junk1 mov edx, 1 int 80h ; calculating first number mov al, byte[num11] sub al, 30h mov bl, 10 mov ah, 0 mul bl mov bx, word[num12] sub bx, 30h add ax, bx mov [n1], ax cmp byte[n1],1 je onecase mov byte[counter],2 for: mov ax,word[n1] mov bl,byte[counter] mov ah,0 div bl cmp ah,0 je exit_full add byte[counter],1 mov bl,byte[n1] cmp byte[counter],bl je exit_yes jmp for exit_full: mov eax, 4 mov ebx, 1 mov ecx, msg3 mov edx, l3 int 80h mov eax, 1 mov ebx, 0 int 80h exit_yes: mov eax, 4 mov ebx, 1 mov ecx, msg4 mov edx, l4 int 80h mov eax, 1 mov ebx, 0 int 80h onecase: mov eax, 4 mov ebx, 1 mov ecx, msg3 mov edx, l3 int 80h mov eax, 1 mov ebx, 0 int 80h
programs/oeis/280/A280154.asm
neoneye/loda
22
245061
<reponame>neoneye/loda<gh_stars>10-100 ; A280154: a(n) = 5*Lucas(n). ; 10,5,15,20,35,55,90,145,235,380,615,995,1610,2605,4215,6820,11035,17855,28890,46745,75635,122380,198015,320395,518410,838805,1357215,2196020,3553235,5749255,9302490,15051745,24354235,39405980,63760215,103166195,166926410,270092605,437019015,707111620,1144130635,1851242255,2995372890,4846615145,7841988035,12688603180,20530591215,33219194395,53749785610,86968980005,140718765615,227687745620,368406511235,596094256855,964500768090,1560595024945,2525095793035,4085690817980,6610786611015,10696477428995,17307264040010,28003741469005,45311005509015,73314746978020,118625752487035,191940499465055,310566251952090,502506751417145,813073003369235,1315579754786380,2128652758155615,3444232512941995,5572885271097610,9017117784039605,14590003055137215,23607120839176820,38197123894314035,61804244733490855,100001368627804890,161805613361295745,261806981989100635,423612595350396380,685419577339497015,1109032172689893395,1794451750029390410,2903483922719283805,4697935672748674215,7601419595467958020,12299355268216632235,19900774863684590255,32200130131901222490,52100904995585812745,84301035127487035235,136401940123072847980,220702975250559883215,357104915373632731195,577807890624192614410,934912805997825345605,1512720696622017960015,2447633502619843305620 seq $0,156279 ; 4 times the Lucas number A000032(n). div $0,4 mul $0,5
opengl-buffer_object.adb
io7m/coreland-opengl-ada
1
16821
with OpenGL.Error; package body OpenGL.Buffer_Object is -- -- Generate buffer name(s). -- procedure Generate (Buffers : in out Buffer_Array_t) is begin Thin.Gen_Buffers (Size => Buffers'Length, Buffers => Buffers (Buffers'First)'Address); end Generate; -- -- Delete buffer. -- procedure Delete (Buffers : in Buffer_Array_t) is begin Thin.Delete_Buffers (Size => Buffers'Length, Buffers => Buffers (Buffers'First)'Address); end Delete; function Target_To_Constant (Target : in Target_t) return Thin.Enumeration_t is begin case Target is when Array_Buffer => return Thin.GL_ARRAY_BUFFER; when Copy_Read_Buffer => return Thin.GL_COPY_READ_BUFFER; when Copy_Write_Buffer => return Thin.GL_COPY_WRITE_BUFFER; when Element_Array_Buffer => return Thin.GL_ELEMENT_ARRAY_BUFFER; when Pixel_Pack_Buffer => return Thin.GL_PIXEL_PACK_BUFFER; when Pixel_Unpack_Buffer => return Thin.GL_PIXEL_UNPACK_BUFFER; when Texture_Buffer => return Thin.GL_TEXTURE_BUFFER; when Transform_Feedback_Buffer => return Thin.GL_TRANSFORM_FEEDBACK_BUFFER; when Uniform_Buffer => return Thin.GL_UNIFORM_BUFFER; end case; end Target_To_Constant; -- -- Bind object to target. -- procedure Bind (Target : in Target_t; Buffer : in Buffer_t) is begin Thin.Bind_Buffer (Target => Target_To_Constant (Target), Buffer => Thin.Unsigned_Integer_t (Buffer)); end Bind; function Usage_To_Constant (Usage : in Usage_t) return Thin.Enumeration_t is begin case Usage is when Stream_Draw => return Thin.GL_STREAM_DRAW; when Stream_Read => return Thin.GL_STREAM_READ; when Stream_Copy => return Thin.GL_STREAM_COPY; when Static_Draw => return Thin.GL_STATIC_DRAW; when Static_Read => return Thin.GL_STATIC_READ; when Static_Copy => return Thin.GL_STATIC_COPY; when Dynamic_Draw => return Thin.GL_DYNAMIC_DRAW; when Dynamic_Read => return Thin.GL_DYNAMIC_READ; when Dynamic_Copy => return Thin.GL_DYNAMIC_COPY; end case; end Usage_To_Constant; -- -- Buffer data. -- procedure Data (Target : in Target_t; Data : in Array_Type; Usage : in Usage_t) is use type Thin.Size_Pointer_t; T_E_Size : constant Thin.Size_Pointer_t := Element_Type'Size / System.Storage_Unit; T_Size : constant Thin.Size_Pointer_t := Data'Length * T_E_Size; T_Address : constant System.Address := Data (Data'First)'Address; begin Thin.Buffer_Data (Target => Target_To_Constant (Target), Size => T_Size, Data => T_Address, Usage => Usage_To_Constant (Usage)); end Data; procedure Sub_Data (Target : in Target_t; Offset : in Index_Type; Data : in Array_Type) is use type Thin.Size_Pointer_t; T_Offset : constant Thin.Integer_Pointer_t := Thin.Integer_Pointer_t (Offset); T_E_Size : constant Thin.Size_Pointer_t := Element_Type'Size / System.Storage_Unit; T_Size : constant Thin.Size_Pointer_t := Data'Length * T_E_Size; T_Address : constant System.Address := Data (Data'First)'Address; begin Thin.Buffer_Sub_Data (Target => Target_To_Constant (Target), Offset => T_Offset, Size => T_Size, Data => T_Address); end Sub_Data; -- -- Map buffer data. -- function Map_Range (Target : in Target_t; Offset : in Index_Type; Length : in Index_Type; Access_Policy : in Access_Policy_t) return System.Address is use type Thin.Size_Pointer_t; use type System.Address; T_Offset : constant Thin.Integer_Pointer_t := Thin.Integer_Pointer_t (Offset); T_E_Size : constant Thin.Size_Pointer_t := Element_Type'Size / System.Storage_Unit; T_Size : constant Thin.Size_Pointer_t := Thin.Size_Pointer_t (Length) * T_E_Size; Address : System.Address; begin Address := Thin.Map_Buffer_Range (Target => Target_To_Constant (Target), Offset => T_Offset, Length => T_Size, Access_Policy => Thin.Bitfield_t (Access_Policy)); if Address = System.Null_Address then raise Constraint_Error with OpenGL.Error.Error_t'Image (OpenGL.Error.Get_Error); end if; return Address; end Map_Range; function Map (Target : in Target_t; Access_Policy : in Access_Policy_t) return System.Address is use type System.Address; Address : System.Address; begin Address := Thin.Map_Buffer (Target => Target_To_Constant (Target), Access_Policy => Thin.Enumeration_t (Access_Policy)); if Address = System.Null_Address then raise Constraint_Error with OpenGL.Error.Error_t'Image (OpenGL.Error.Get_Error); end if; return Address; end Map; -- -- Flush mapped buffer. -- procedure Flush_Range (Target : in Target_t; Offset : in Index_Type; Length : in Index_Type) is begin Thin.Flush_Mapped_Buffer_Range (Target => Target_To_Constant (Target), Offset => Thin.Integer_Pointer_t (Offset), Length => Thin.Size_Pointer_t (Length)); end Flush_Range; -- -- Unmap buffer. -- function Unmap (Target : in Target_t) return Boolean is use type Thin.Boolean_t; OK : constant Thin.Boolean_t := Thin.Unmap_Buffer (Target_To_Constant (Target)); begin if OK = Thin.Boolean_t'Val (1) then return True; else return False; end if; end Unmap; end OpenGL.Buffer_Object;
commands/system/open-selection-with.applescript
afrazkhan/script-commands
5
3673
<reponame>afrazkhan/script-commands #!/usr/bin/osascript # Required parameters: # @raycast.schemaVersion 1 # @raycast.title Open Selection With # @raycast.mode silent # @raycast.packageName System # @raycast.argument1 { "type": "text", "placeholder": "Application", "optional": false } # # Optional parameters: # @raycast.icon 🗃 # # Documentation: # @raycast.description Open selected items in Finder with the given application. # @raycast.author <NAME> # @raycast.authorURL https://felipeturcheti.com on run {appName} log "Opening selection with \"" & appName & "\"…" -- get the bundle id for the application name received as a parameter set bundleId to id of application appName tell application "Finder" -- get Finder selected items set theItems to selection -- get the path for the applicaction with the bundle id defined above set appPath to (POSIX path of (application file id bundleId as alias)) end tell -- for each item in the Finder selection repeat with itemRef in theItems -- get the item path set theItem to POSIX path of (itemRef as string) -- set a shell command to open the item with the desired application -- note: -- opening the file with applescript often results in permission errors -- but opening it with a shell script seems to bypass this issue set command to "open -a " & quoted form of appPath & " " & quoted form of theItem do shell script command end repeat end run
regtests/ado-parameters-tests.adb
Letractively/ada-ado
0
28051
----------------------------------------------------------------------- -- ado-parameters-tests -- Test query parameters and SQL expansion -- Copyright (C) 2011 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Test_Caller; with Util.Measures; package body ADO.Parameters.Tests is use Util.Tests; -- Test the Add_Param operation for various types. generic type T (<>) is private; with procedure Add_Param (L : in out ADO.Parameters.Abstract_List; V : in T) is <>; Value : T; Name : String; procedure Test_Add_Param_T (Tst : in out Test); -- Test the Bind_Param operation for various types. generic type T (<>) is private; with procedure Bind_Param (L : in out ADO.Parameters.Abstract_List; N : in String; V : in T) is <>; Value : T; Name : String; procedure Test_Bind_Param_T (Tst : in out Test); -- Test the Add_Param operation for various types. procedure Test_Add_Param_T (Tst : in out Test) is Count : constant Positive := 100; SQL : ADO.Parameters.List; S : Util.Measures.Stamp; begin for I in 1 .. Count loop Add_Param (ADO.Parameters.Abstract_List (SQL), Value); end loop; Util.Measures.Report (S, "Add_Param " & Name & "(" & Positive'Image (Count) & " calls)"); Util.Tests.Assert_Equals (Tst, Count, SQL.Length, "Invalid param list for " & Name); end Test_Add_Param_T; -- Test the Bind_Param operation for various types. procedure Test_Bind_Param_T (Tst : in out Test) is Count : constant Positive := 100; SQL : ADO.Parameters.List; S : Util.Measures.Stamp; begin for I in 1 .. Count loop Bind_Param (ADO.Parameters.Abstract_List (SQL), "a_parameter_name", Value); end loop; Util.Measures.Report (S, "Bind_Param " & Name & "(" & Positive'Image (Count) & " calls)"); Util.Tests.Assert_Equals (Tst, Count, SQL.Length, "Invalid param list for " & Name); end Test_Bind_Param_T; procedure Test_Add_Param_Integer is new Test_Add_Param_T (Integer, Add_Param, 10, "Integer"); procedure Test_Add_Param_Identifier is new Test_Add_Param_T (Identifier, Add_Param, 100, "Identifier"); procedure Test_Add_Param_Boolean is new Test_Add_Param_T (Boolean, Add_Param, False, "Boolean"); procedure Test_Add_Param_String is new Test_Add_Param_T (String, Add_Param, "0123456789ABCDEF", "String"); procedure Test_Add_Param_Calendar is new Test_Add_Param_T (Ada.Calendar.Time, Add_Param, Ada.Calendar.Clock, "Time"); procedure Test_Add_Param_Unbounded_String is new Test_Add_Param_T (Unbounded_String, Add_Param, To_Unbounded_String ("0123456789ABCDEF"), "Unbounded_String"); procedure Test_Bind_Param_Integer is new Test_Bind_Param_T (Integer, Bind_Param, 10, "Integer"); procedure Test_Bind_Param_Identifier is new Test_Bind_Param_T (Identifier, Bind_Param, 100, "Identifier"); procedure Test_Bind_Param_Boolean is new Test_Bind_Param_T (Boolean, Bind_Param, False, "Boolean"); procedure Test_Bind_Param_String is new Test_Bind_Param_T (String, Bind_Param, "0123456789ABCDEF", "String"); procedure Test_Bind_Param_Calendar is new Test_Bind_Param_T (Ada.Calendar.Time, Bind_Param, Ada.Calendar.Clock, "Time"); procedure Test_Bind_Param_Unbounded_String is new Test_Bind_Param_T (Unbounded_String, Bind_Param, To_Unbounded_String ("0123456789ABCDEF"), "Unbounded_String"); package Caller is new Util.Test_Caller (Test, "ADO.Parameters"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test ADO.Parameters.Expand", Test_Expand_Sql'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Expand (invalid params)", Test_Expand_Error'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Expand (perf)", Test_Expand_Perf'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Add_Param (Boolean)", Test_Add_Param_Boolean'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Add_Param (Integer)", Test_Add_Param_Integer'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Add_Param (Identifier)", Test_Add_Param_Identifier'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Add_Param (Calendar)", Test_Add_Param_Calendar'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Add_Param (String)", Test_Add_Param_String'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Add_Param (Unbounded_String)", Test_Add_Param_Unbounded_String'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Bind_Param (Boolean)", Test_Bind_Param_Boolean'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Bind_Param (Integer)", Test_Bind_Param_Integer'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Bind_Param (Identifier)", Test_Bind_Param_Identifier'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Bind_Param (Calendar)", Test_Bind_Param_Calendar'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Bind_Param (String)", Test_Bind_Param_String'Access); Caller.Add_Test (Suite, "Test ADO.Parameters.Bind_Param (Unbounded_String)", Test_Bind_Param_Unbounded_String'Access); end Add_Tests; -- ------------------------------ -- Test expand SQL with parameters. -- ------------------------------ procedure Test_Expand_Sql (T : in out Test) is SQL : ADO.Parameters.List; D : aliased ADO.Drivers.Dialects.Dialect; procedure Check (Pattern : in String; Expect : in String); procedure Check (Pattern : in String; Expect : in String) is Result : constant String := SQL.Expand (Pattern); begin Assert_Equals (T, Expect, Result, "Invalid SQL expansion"); end Check; begin SQL.Set_Dialect (D'Unchecked_Access); SQL.Bind_Param (1, "select '"); SQL.Bind_Param (2, "from"); SQL.Bind_Param ("user_id", String '("23")); SQL.Bind_Param ("object_23_identifier", Integer (44)); SQL.Bind_Param ("bool", True); SQL.Bind_Param (6, False); SQL.Bind_Param ("_date", Ada.Calendar.Clock); SQL.Bind_Null_Param ("_null"); Check ("?", "'select '''"); Check (":2", "'from'"); Check (":6", "0"); Check (":user_id", "'23'"); Check (":bool", "1"); Check (":_null", "NULL"); Check ("select :1 :2 :3 :4 :5 :6", "select 'select ''' 'from' '23' 44 1 0"); Check ("select ? ? ? ? ? ?", "select 'select ''' 'from' '23' 44 1 0"); Check ("select ? :2 :user_id :object_23_identifier :bool :6", "select 'select ''' 'from' '23' 44 1 0"); end Test_Expand_Sql; -- ------------------------------ -- Test expand with invalid parameters. -- ------------------------------ procedure Test_Expand_Error (T : in out Test) is SQL : ADO.Parameters.List; procedure Check (Pattern : in String; Expect : in String); procedure Check (Pattern : in String; Expect : in String) is Result : constant String := SQL.Expand (Pattern); begin Assert_Equals (T, Expect, Result, "Invalid SQL expansion"); end Check; begin Check (":<", "<"); Check (":234", ""); Check (":name", ""); Check ("select :", "select :"); end Test_Expand_Error; -- ------------------------------ -- Test expand performance. -- ------------------------------ procedure Test_Expand_Perf (T : in out Test) is pragma Unreferenced (T); SQL : ADO.Parameters.List; D : aliased ADO.Drivers.Dialects.Dialect; begin SQL.Set_Dialect (D'Unchecked_Access); declare T : Util.Measures.Stamp; begin for I in 1 .. 1_000 loop SQL.Bind_Param (I, I); end loop; Util.Measures.Report (T, "Bind_Param (1000 calls)"); end; declare B : constant Unbounded_String := To_Unbounded_String ("select t.a, t.b, t.c, t.d, t.e, t.f " & "from T where t.b = 23"); T : Util.Measures.Stamp; begin for I in 1 .. 1_000 loop declare S : constant String := To_String (B); pragma Unreferenced (S); begin null; end; end loop; Util.Measures.Report (T, "Expand reference To_String"); end; declare T : Util.Measures.Stamp; begin for I in 1 .. 1_000 loop declare S : constant String := SQL.Expand ("select t.a, t.b, t.c, t.d, t.e, t.f " & "from T where t.b = 23"); pragma Unreferenced (S); begin null; end; end loop; Util.Measures.Report (T, "Expand (1000 calls with 0 parameter)"); end; declare T : Util.Measures.Stamp; begin for I in 1 .. 1_000 loop declare S : constant String := SQL.Expand ("select t.a, t.b, t.c, t.d, t.e, t.f " & "from T where t.b = :10"); pragma Unreferenced (S); begin null; end; end loop; Util.Measures.Report (T, "Expand (1000 calls with 1 parameter)"); end; declare T : Util.Measures.Stamp; begin for I in 1 .. 1_000 loop declare S : constant String := SQL.Expand (":10 :20 :30 :40 :50 :60 :70 :80 :90 :100"); pragma Unreferenced (S); begin null; end; end loop; Util.Measures.Report (T, "Expand (1000 calls with 10 parameters)"); end; end Test_Expand_Perf; end ADO.Parameters.Tests;
adium/ASUnitTests/CantSetServiceName.applescript
sin-ivan/AdiumPipeEvent
0
358
global HandyAdiumScripts on run tell application "Adium" set n to (get name of service "AIM") set s to (get service "AIM") try set name of service "AIM" to "dummy" --should never get here! set name of s to n --restore --actually this won't restore because service names are what's --used in objectSpecifier to refer to these objects... error on error number num if num is -2700 then error end try end tell end run
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0x84_notsx.log_21829_2213.asm
ljhsiun2/medusa
9
16792
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r14 push %r9 push %rbx push %rdx push %rsi // Store lea addresses_normal+0x12168, %r11 nop nop nop inc %r13 mov $0x5152535455565758, %r14 movq %r14, %xmm0 movups %xmm0, (%r11) inc %r14 // Store lea addresses_RW+0x3e68, %rbx nop nop nop nop nop dec %rdx mov $0x5152535455565758, %rsi movq %rsi, %xmm4 vmovups %ymm4, (%rbx) nop nop nop dec %r14 // Store lea addresses_WT+0xb2a8, %rdx nop nop nop nop cmp $59216, %r13 movl $0x51525354, (%rdx) sub $6155, %r11 // Store lea addresses_WT+0xcdca, %rsi nop nop nop nop and $60283, %rbx movl $0x51525354, (%rsi) dec %r13 // Store lea addresses_UC+0x1508, %r9 nop nop nop nop inc %r11 mov $0x5152535455565758, %rsi movq %rsi, %xmm6 movups %xmm6, (%r9) nop nop nop nop nop and %r13, %r13 // Faulty Load mov $0x7d34be0000000568, %rsi nop nop nop nop dec %rdx mov (%rsi), %r14w lea oracles, %r11 and $0xff, %r14 shlq $12, %r14 mov (%r11,%r14,1), %r14 pop %rsi pop %rdx pop %rbx pop %r9 pop %r14 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_RW', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_NC', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
src/Categories/NaturalTransformation/NaturalIsomorphism/Functors.agda
Trebor-Huang/agda-categories
279
14378
{-# OPTIONS --without-K --safe #-} module Categories.NaturalTransformation.NaturalIsomorphism.Functors where open import Level open import Categories.Category open import Categories.Category.Construction.Functors open import Categories.Functor open import Categories.NaturalTransformation.NaturalIsomorphism import Categories.Morphism as Mor private variable o ℓ e : Level C D : Category o ℓ e -- isomorphism in Functors category is the same as natural isomorphism module _ {F G : Functor C D} where open Mor (Functors C D) Functors-iso⇒NI : F ≅ G → NaturalIsomorphism F G Functors-iso⇒NI F≅G = record { F⇒G = from ; F⇐G = to ; iso = λ X → record { isoˡ = isoˡ ; isoʳ = isoʳ } } where open Mor._≅_ F≅G NI⇒Functors-iso : NaturalIsomorphism F G → F ≅ G NI⇒Functors-iso α = record { from = F⇒G ; to = F⇐G ; iso = record { isoˡ = isoˡ (iso _) ; isoʳ = isoʳ (iso _) } } where open NaturalIsomorphism α open Mor.Iso
oeis/199/A199802.asm
neoneye/loda-programs
11
92153
<filename>oeis/199/A199802.asm ; A199802: G.f.: 1/(1-2*x+2*x^2-x^3+x^4). ; Submitted by <NAME> ; 1,2,2,1,-1,-4,-7,-8,-5,3,15,27,32,22,-8,-55,-104,-128,-95,17,200,399,510,405,-11,-721,-1525,-2024,-1708,-172,2573,5806,8002,7137,1503,-9072,-22015,-31520,-29585,-9073,31519,83119,123712,121778,47732,-107499,-312396,-483840,-498119,-233455,357884,1168399,1885694,2025929,1090985,-1152593 mov $2,1 mov $3,1 mov $5,1 lpb $0 sub $0,1 sub $3,$4 mov $4,$2 mov $2,$3 sub $5,$1 add $5,$4 add $1,$5 add $2,$4 mov $3,$5 lpe mov $0,$3
util/cv/gitem.asm
olifink/smsqe
0
177295
<gh_stars>0 * Get an "item" from a string v0.00  July 1988 J.R.Oakley QJUMP * section cv * include 'dev8_keys_err' include 'dev8_keys_k' * xdef cv_gitem *+++ * Copy an "item" from a string to a buffer. The item is enclosed by spaces * or the end of the string. The string pointer and length are updated * to point to the first space after the item, or to the end (length=0). * * Registers: * Entry Exit * D0 0 or ERR.BFFL * D1 string length updated * D7 end of buffer preserved * A0 buffer pointer updated * A1 string pointer updated *--- cv_gitem gitreg reg d2 movem.l gitreg,-(sp) moveq #k.space,d2 tst.w d1 ; anything in string? uci_rmls beq.s uci_exok ; no, that's OK cmp.b (a1)+,d2 ; yes, is it space? bne.s uci_cpts ; no, copy from here subq.w #1,d1 bra.s uci_rmls uci_cpts subq.l #1,a1 ; back to non-space character uci_cplp cmp.l a0,d7 ; off end of buffer? ble.s uci_exbf ; yes move.b (a1)+,d0 ; no, get character cmp.b d0,d2 ; is it a space? beq.s uci_sfnd ; yes, finished move.b d0,(a0)+ ; no, copy it subq.w #1,d1 ; one character fewer in source bgt.s uci_cplp ; there's more to come bra.s uci_exok ; there isn't, we're OK uci_sfnd subq.l #1,a1 ; backspace to terminating space uci_exok moveq #0,d0 uci_exit movem.l (sp)+,gitreg rts uci_exbf moveq #err.bffl,d0 bra.s uci_exit * end
extern/gnat_sdl/gnat_sdl2/src/sdl_pixels_h.ads
AdaCore/training_material
15
5990
<reponame>AdaCore/training_material pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with SDL_stdinc_h; with Interfaces.C.Strings; package SDL_pixels_h is SDL_ALPHA_OPAQUE : constant := 255; -- ..\SDL2_tmp\SDL_pixels.h:46 SDL_ALPHA_TRANSPARENT : constant := 0; -- ..\SDL2_tmp\SDL_pixels.h:47 -- Manual Fix for unnamed enum -- /** Pixel type. */ --enum --{ type SDL_PIXELTYPE_TYPE is (SDL_PIXELTYPE_UNKNOWN, SDL_PIXELTYPE_INDEX1, SDL_PIXELTYPE_INDEX4, SDL_PIXELTYPE_INDEX8, SDL_PIXELTYPE_PACKED8, SDL_PIXELTYPE_PACKED16, SDL_PIXELTYPE_PACKED32, SDL_PIXELTYPE_ARRAYU8, SDL_PIXELTYPE_ARRAYU16, SDL_PIXELTYPE_ARRAYU32, SDL_PIXELTYPE_ARRAYF16, SDL_PIXELTYPE_ARRAYF32); --}; --/** Bitmap pixel order, high bit -> low bit. */ --enum --{ type SDL_BITMAPORDER_TYPE is ( SDL_BITMAPORDER_NONE, SDL_BITMAPORDER_4321, SDL_BITMAPORDER_1234); --}; --/** Packed component order, high bit -> low bit. */ --enum --{ type SDL_PACKEDORDER_TYPE is ( SDL_PACKEDORDER_NONE, SDL_PACKEDORDER_XRGB, SDL_PACKEDORDER_RGBX, SDL_PACKEDORDER_ARGB, SDL_PACKEDORDER_RGBA, SDL_PACKEDORDER_XBGR, SDL_PACKEDORDER_BGRX, SDL_PACKEDORDER_ABGR, SDL_PACKEDORDER_BGRA); --}; -- /** Array component order, low byte -> high byte. */ --/* !!! FIXME: in 2.1, make these not overlap differently with -- !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ --enum --{ type SDL_ARRAYORDER_TYPE is ( SDL_ARRAYORDER_NONE, SDL_ARRAYORDER_RGB, SDL_ARRAYORDER_RGBA, SDL_ARRAYORDER_ARGB, SDL_ARRAYORDER_BGR, SDL_ARRAYORDER_BGRA, SDL_ARRAYORDER_ABGR); --}; --/** Packed component layout. */ --enum --{ type SDL_PACKEDLAYOUT_TYPE is ( SDL_PACKEDLAYOUT_NONE, SDL_PACKEDLAYOUT_332, SDL_PACKEDLAYOUT_4444, SDL_PACKEDLAYOUT_1555, SDL_PACKEDLAYOUT_5551, SDL_PACKEDLAYOUT_565, SDL_PACKEDLAYOUT_8888, SDL_PACKEDLAYOUT_2101010, SDL_PACKEDLAYOUT_1010102); --}; -- arg-macro: procedure SDL_DEFINE_PIXELFOURCC (A, B, C, D) -- SDL_FOURCC(A, B, C, D) -- arg-macro: function SDL_DEFINE_PIXELFORMAT (type, order, layout, bits, bytes) -- return (2 ** 28) or ((type) << 24) or ((order) << 20) or ((layout) << 16) or ((bits) << 8) or ((bytes) << 0); -- arg-macro: function SDL_PIXELFLAG (X) -- return ((X) >> 28) and 16#0F#; -- arg-macro: function SDL_PIXELTYPE (X) -- return ((X) >> 24) and 16#0F#; -- arg-macro: function SDL_PIXELORDER (X) -- return ((X) >> 20) and 16#0F#; -- arg-macro: function SDL_PIXELLAYOUT (X) -- return ((X) >> 16) and 16#0F#; -- arg-macro: function SDL_BITSPERPIXEL (X) -- return ((X) >> 8) and 16#FF#; -- arg-macro: function SDL_BYTESPERPIXEL (X) -- return SDL_ISPIXELFORMAT_FOURCC(X) ? ((((X) = SDL_PIXELFORMAT_YUY2) or else ((X) = SDL_PIXELFORMAT_UYVY) or else ((X) = SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) and 16#FF#); -- arg-macro: function SDL_ISPIXELFORMAT_INDEXED (format) -- return notSDL_ISPIXELFORMAT_FOURCC(format) and then ((SDL_PIXELTYPE(format) = SDL_PIXELTYPE_INDEX1) or else (SDL_PIXELTYPE(format) = SDL_PIXELTYPE_INDEX4) or else (SDL_PIXELTYPE(format) = SDL_PIXELTYPE_INDEX8)); -- arg-macro: function SDL_ISPIXELFORMAT_PACKED (format) -- return notSDL_ISPIXELFORMAT_FOURCC(format) and then ((SDL_PIXELTYPE(format) = SDL_PIXELTYPE_PACKED8) or else (SDL_PIXELTYPE(format) = SDL_PIXELTYPE_PACKED16) or else (SDL_PIXELTYPE(format) = SDL_PIXELTYPE_PACKED32)); -- arg-macro: function SDL_ISPIXELFORMAT_ARRAY (format) -- return notSDL_ISPIXELFORMAT_FOURCC(format) and then ((SDL_PIXELTYPE(format) = SDL_PIXELTYPE_ARRAYU8) or else (SDL_PIXELTYPE(format) = SDL_PIXELTYPE_ARRAYU16) or else (SDL_PIXELTYPE(format) = SDL_PIXELTYPE_ARRAYU32) or else (SDL_PIXELTYPE(format) = SDL_PIXELTYPE_ARRAYF16) or else (SDL_PIXELTYPE(format) = SDL_PIXELTYPE_ARRAYF32)); -- arg-macro: function SDL_ISPIXELFORMAT_ALPHA (format) -- return (SDL_ISPIXELFORMAT_PACKED(format) and then ((SDL_PIXELORDER(format) = SDL_PACKEDORDER_ARGB) or else (SDL_PIXELORDER(format) = SDL_PACKEDORDER_RGBA) or else (SDL_PIXELORDER(format) = SDL_PACKEDORDER_ABGR) or else (SDL_PIXELORDER(format) = SDL_PACKEDORDER_BGRA))) or else (SDL_ISPIXELFORMAT_ARRAY(format) and then ((SDL_PIXELORDER(format) = SDL_ARRAYORDER_ARGB) or else (SDL_PIXELORDER(format) = SDL_ARRAYORDER_RGBA) or else (SDL_PIXELORDER(format) = SDL_ARRAYORDER_ABGR) or else (SDL_PIXELORDER(format) = SDL_ARRAYORDER_BGRA))); -- arg-macro: function SDL_ISPIXELFORMAT_FOURCC (format) -- return (format) and then (SDL_PIXELFLAG(format) /= 1); -- unsupported macro: SDL_Colour SDL_Color -- Simple DirectMedia Layer -- Copyright (C) 1997-2018 <NAME> <<EMAIL>> -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- 3. This notice may not be removed or altered from any source distribution. -- --* -- * \file SDL_pixels.h -- * -- * Header for the enumerated pixel format definitions. -- -- Set up for C function definitions, even when using C++ --* -- * \name Transparency definitions -- * -- * These define alpha as the opacity of a surface. -- -- @{ -- @} --* Pixel type. --* Bitmap pixel order, high bit -> low bit. --* Packed component order, high bit -> low bit. --* Array component order, low byte -> high byte. -- !!! FIXME: in 2.1, make these not overlap differently with -- !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA --* Packed component layout. -- The flag is set to 1 because 0x1? is not in the printable ASCII range -- Note: If you modify this list, update SDL_GetPixelFormatName() -- Aliases for RGBA byte arrays of color data, for the current platform --*< Planar mode: Y + V + U (3 planes) --*< Planar mode: Y + U + V (3 planes) --*< Packed mode: Y0+U0+Y1+V0 (1 plane) --*< Packed mode: U0+Y0+V0+Y1 (1 plane) --*< Packed mode: Y0+V0+Y1+U0 (1 plane) --*< Planar mode: Y + U/V interleaved (2 planes) --*< Planar mode: Y + V/U interleaved (2 planes) --*< Android video texture format type SDL_Color is record r : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:297 g : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:298 b : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:299 a : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:300 end record; pragma Convention (C_Pass_By_Copy, SDL_Color); -- ..\SDL2_tmp\SDL_pixels.h:295 type SDL_Palette is record ncolors : aliased int; -- ..\SDL2_tmp\SDL_pixels.h:306 colors : access SDL_Color; -- ..\SDL2_tmp\SDL_pixels.h:307 version : aliased SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_pixels.h:308 refcount : aliased int; -- ..\SDL2_tmp\SDL_pixels.h:309 end record; pragma Convention (C_Pass_By_Copy, SDL_Palette); -- ..\SDL2_tmp\SDL_pixels.h:304 --* -- * \note Everything in the pixel format structure is read-only. -- type SDL_PixelFormat_padding_array is array (0 .. 1) of aliased SDL_stdinc_h.Uint8; type SDL_PixelFormat; type SDL_PixelFormat is record format : aliased SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_pixels.h:317 palette : access SDL_Palette; -- ..\SDL2_tmp\SDL_pixels.h:318 BitsPerPixel : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:319 BytesPerPixel : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:320 padding : aliased SDL_PixelFormat_padding_array; -- ..\SDL2_tmp\SDL_pixels.h:321 Rmask : aliased SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_pixels.h:322 Gmask : aliased SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_pixels.h:323 Bmask : aliased SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_pixels.h:324 Amask : aliased SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_pixels.h:325 Rloss : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:326 Gloss : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:327 Bloss : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:328 Aloss : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:329 Rshift : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:330 Gshift : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:331 Bshift : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:332 Ashift : aliased SDL_stdinc_h.Uint8; -- ..\SDL2_tmp\SDL_pixels.h:333 refcount : aliased int; -- ..\SDL2_tmp\SDL_pixels.h:334 next : access SDL_PixelFormat; -- ..\SDL2_tmp\SDL_pixels.h:335 end record; pragma Convention (C_Pass_By_Copy, SDL_PixelFormat); -- ..\SDL2_tmp\SDL_pixels.h:315 --* -- * \brief Get the human readable name of a pixel format -- function SDL_GetPixelFormatName (format : SDL_stdinc_h.Uint32) return Interfaces.C.Strings.chars_ptr; -- ..\SDL2_tmp\SDL_pixels.h:341 pragma Import (C, SDL_GetPixelFormatName, "SDL_GetPixelFormatName"); --* -- * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. -- * -- * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. -- * -- * \sa SDL_MasksToPixelFormatEnum() -- function SDL_PixelFormatEnumToMasks (format : SDL_stdinc_h.Uint32; bpp : access int; Rmask : access SDL_stdinc_h.Uint32; Gmask : access SDL_stdinc_h.Uint32; Bmask : access SDL_stdinc_h.Uint32; Amask : access SDL_stdinc_h.Uint32) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_pixels.h:350 pragma Import (C, SDL_PixelFormatEnumToMasks, "SDL_PixelFormatEnumToMasks"); --* -- * \brief Convert a bpp and RGBA masks to an enumerated pixel format. -- * -- * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion -- * wasn't possible. -- * -- * \sa SDL_PixelFormatEnumToMasks() -- function SDL_MasksToPixelFormatEnum (bpp : int; Rmask : SDL_stdinc_h.Uint32; Gmask : SDL_stdinc_h.Uint32; Bmask : SDL_stdinc_h.Uint32; Amask : SDL_stdinc_h.Uint32) return SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_pixels.h:365 pragma Import (C, SDL_MasksToPixelFormatEnum, "SDL_MasksToPixelFormatEnum"); --* -- * \brief Create an SDL_PixelFormat structure from a pixel format enum. -- function SDL_AllocFormat (pixel_format : SDL_stdinc_h.Uint32) return access SDL_PixelFormat; -- ..\SDL2_tmp\SDL_pixels.h:374 pragma Import (C, SDL_AllocFormat, "SDL_AllocFormat"); --* -- * \brief Free an SDL_PixelFormat structure. -- procedure SDL_FreeFormat (format : access SDL_PixelFormat); -- ..\SDL2_tmp\SDL_pixels.h:379 pragma Import (C, SDL_FreeFormat, "SDL_FreeFormat"); --* -- * \brief Create a palette structure with the specified number of color -- * entries. -- * -- * \return A new palette, or NULL if there wasn't enough memory. -- * -- * \note The palette entries are initialized to white. -- * -- * \sa SDL_FreePalette() -- function SDL_AllocPalette (ncolors : int) return access SDL_Palette; -- ..\SDL2_tmp\SDL_pixels.h:391 pragma Import (C, SDL_AllocPalette, "SDL_AllocPalette"); --* -- * \brief Set the palette for a pixel format structure. -- function SDL_SetPixelFormatPalette (format : access SDL_PixelFormat; palette : access SDL_Palette) return int; -- ..\SDL2_tmp\SDL_pixels.h:396 pragma Import (C, SDL_SetPixelFormatPalette, "SDL_SetPixelFormatPalette"); --* -- * \brief Set a range of colors in a palette. -- * -- * \param palette The palette to modify. -- * \param colors An array of colors to copy into the palette. -- * \param firstcolor The index of the first palette entry to modify. -- * \param ncolors The number of entries to modify. -- * -- * \return 0 on success, or -1 if not all of the colors could be set. -- function SDL_SetPaletteColors (palette : access SDL_Palette; colors : access constant SDL_Color; firstcolor : int; ncolors : int) return int; -- ..\SDL2_tmp\SDL_pixels.h:409 pragma Import (C, SDL_SetPaletteColors, "SDL_SetPaletteColors"); --* -- * \brief Free a palette created with SDL_AllocPalette(). -- * -- * \sa SDL_AllocPalette() -- procedure SDL_FreePalette (palette : access SDL_Palette); -- ..\SDL2_tmp\SDL_pixels.h:418 pragma Import (C, SDL_FreePalette, "SDL_FreePalette"); --* -- * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. -- * -- * \sa SDL_MapRGBA -- function SDL_MapRGB (format : access constant SDL_PixelFormat; r : SDL_stdinc_h.Uint8; g : SDL_stdinc_h.Uint8; b : SDL_stdinc_h.Uint8) return SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_pixels.h:425 pragma Import (C, SDL_MapRGB, "SDL_MapRGB"); --* -- * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. -- * -- * \sa SDL_MapRGB -- function SDL_MapRGBA (format : access constant SDL_PixelFormat; r : SDL_stdinc_h.Uint8; g : SDL_stdinc_h.Uint8; b : SDL_stdinc_h.Uint8; a : SDL_stdinc_h.Uint8) return SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_pixels.h:433 pragma Import (C, SDL_MapRGBA, "SDL_MapRGBA"); --* -- * \brief Get the RGB components from a pixel of the specified format. -- * -- * \sa SDL_GetRGBA -- procedure SDL_GetRGB (pixel : SDL_stdinc_h.Uint32; format : access constant SDL_PixelFormat; r : access SDL_stdinc_h.Uint8; g : access SDL_stdinc_h.Uint8; b : access SDL_stdinc_h.Uint8); -- ..\SDL2_tmp\SDL_pixels.h:442 pragma Import (C, SDL_GetRGB, "SDL_GetRGB"); --* -- * \brief Get the RGBA components from a pixel of the specified format. -- * -- * \sa SDL_GetRGB -- procedure SDL_GetRGBA (pixel : SDL_stdinc_h.Uint32; format : access constant SDL_PixelFormat; r : access SDL_stdinc_h.Uint8; g : access SDL_stdinc_h.Uint8; b : access SDL_stdinc_h.Uint8; a : access SDL_stdinc_h.Uint8); -- ..\SDL2_tmp\SDL_pixels.h:451 pragma Import (C, SDL_GetRGBA, "SDL_GetRGBA"); --* -- * \brief Calculate a 256 entry gamma ramp for a gamma value. -- procedure SDL_CalculateGammaRamp (gamma : float; ramp : access SDL_stdinc_h.Uint16); -- ..\SDL2_tmp\SDL_pixels.h:459 pragma Import (C, SDL_CalculateGammaRamp, "SDL_CalculateGammaRamp"); -- Ends C function definitions when using C++ -- vi: set ts=4 sw=4 expandtab: end SDL_pixels_h;
tests/typing/bad/testfile-inout-5.adb
xuedong/mini-ada
0
21063
<reponame>xuedong/mini-ada with Ada.Text_IO; use Ada.Text_IO; procedure Test is function F(X: in Integer) return integer is begin X:= 1; return 0; end; begin if F(42) = 0 then new_line; end if; end;
programs/oeis/294/A294630.asm
karttu/loda
0
15169
<reponame>karttu/loda<gh_stars>0 ; A294630: Partial sums of A294629. ; 4,20,48,104,172,292,424,616,844,1140,1448,1888,2340,2876,3488,4224,4972,5892,6824,7936,9140,10460,11792,13416,15092,16900,18816,20960,23116,25612,28120,30880,33764,36812,39968,43568,47180,50972,54904,59240,63588,68372,73168,78288,83676,89276,94888,101112,107404,114044,120856,128040,135236,142964,150832,159216,167788,176620,185464,195176,204900,214900,225232,236072,247068,258692,270328,282432,294756,307676,320608,334528,348460,362716,377368,392536,407860,423908,439968,456880,474116,491708,509312,528040,546956,566244,585800,606096,626404,647868,669504,691752,714284,737220,760360,784752,809156,834148,859600,885992,912396,939716,967048,995232,1024116,1053452,1082800,1113528,1144268,1175860,1207784,1240800,1273828,1307868,1342144,1377176,1412732,1448788,1485048,1523232,1561516,1600316,1639480,1679448,1719668,1761380,1803104,1845848,1888972,1933076,1977192,2022944,2068916,2115452,2162832,2211288,2259756,2309428,2359112,2410368,2462036,2514300,2566768,2621312,2676140,2731580,2787672,2844712,2901764,2960596,3019440,3079472,3140156,3201916,3263976,3327928,3391892,3456516,3521600,3588432,3655516,3724212,3792920,3862672,3933412,4004844,4076288,4150232,4224292,4299588,4375600,4452704,4529820,4608428,4687624,4768392,4849668,4931684,5013712,5098672,5183644,5269852,5356584,5444728,5533220,5623300,5713616,5805120,5897676,5991596,6085528,6181992,6278468,6375748,6474160,6574200,6674252,6776468,6878696,6983048,7087972,7193732,7299792,7408256,7517100,7626796,7737336,7849688,7962292,8077828,8193376,8310256,8427740,8546108,8664872,8786712,8908868,9031924,9155600,9281552,9407756,9535836,9663928,9794264,9926028,10058724,10191432,10326800,10462180,10599180,10737408,10877384,11017372,11159860,11302776,11447168,11592228,11738844,11885472,12036136,12186812,12338748,12491656,12646088,12801300,12958580,13116128,13275536,13435644,13597500 mov $2,$0 add $2,1 mov $3,$0 lpb $2,1 mov $0,$3 sub $2,1 sub $0,$2 cal $0,294629 ; Partial sums of A294628. add $1,$0 lpe
dmvpn-as-code/window_layout.scpt
nobuhikosekiya/sbx_multi_ios
64
3797
<reponame>nobuhikosekiya/sbx_multi_ios # AppleScript for Demo Window layout # execute with `osascript window_layout.scpt` tell application "iTerm" activate tell current window create tab with default profile end tell set pane_1 to (current session of current window) tell pane_1 set pane_3 to (split horizontally with same profile) end tell tell pane_1 set pane_2 to (split vertically with same profile) end tell tell pane_3 set pane_4 to (split vertically with same profile) end tell tell pane_1 write text "workon cicd-dmvpn" end tell tell pane_2 write text "workon cicd-dmvpn" write text "cd virl/test" write text "virl nodes" end tell tell pane_3 write text "workon cicd-dmvpn" write text "cd logs/" write text "tail -f ncs-python-vm.log" end tell tell pane_4 write text "workon cicd-dmvpn" write text "cd packages/dmvpn/" write text "ncs_hot_reload" end tell end tell
native/standalone/sandbox/seccomp_filter.asm
minad/crts
1
18113
#define KILL #0 #define ALLOW #0x7fff0000 /* struct seccomp_data */ #define nr [0] #define arch [4] #define arg0_lo [16] #define arg0_hi [20] #define arg1_lo [24] #define arg1_hi [28] #define arg2_lo [32] #define arg2_hi [36] #define arg3_lo [40] #define arg3_hi [44] #define arg4_lo [48] #define arg4_hi [52] #define arg5_lo [56] #define arg5_hi [60] /* pread64, pwrite64 and fallocate offsets/sizes */ #define block1_lo arg2_lo #define block1_hi arg2_hi #define block2_lo arg3_lo #define block2_hi arg3_hi #define BLOCK_JMP(i) jeq $BPF_BLOCK_FD(i), block_fd_##i #define BLOCK_SIZE(i) \ block_fd_##i: \ ld $BPF_BLOCK_LO(i) \ st M[2] \ ld $BPF_BLOCK_HI(i) \ st M[3] \ jmp block_check_range #define BLOCK_FOREACH(f) \ f(0) f(1) f(2) f(3) \ f(4) f(5) f(6) f(7) start: ld arch jne $AUDIT_ARCH, kill ld nr jeq $SYS_pread64, block_call jeq $SYS_pwrite64, block_call jeq $SYS_clock_gettime, clock_gettime jeq $SYS_write, write jeq $SYS_read, read jeq $SYS_fallocate, fallocate jeq $SYS_fdatasync, fdatasync jeq $SYS_ppoll, ppoll jeq $SYS_exit_group, allow jmp kill clock_gettime: ld arg0_hi jne #0, kill ld arg0_lo jeq $CLOCK_MONOTONIC, allow jeq $CLOCK_REALTIME, allow, kill ppoll: ld arg3_hi jne #0, kill /* no signals */ ld arg3_lo jne #0, kill /* no signals */ ld arg4_hi jne #0, kill /* no signals */ ld arg4_lo jne #0, kill /* no signals */ ld arg1_hi jne #0, kill /* nfd */ ld arg1_lo jeq $BPF_PPOLL_COUNT, allow, kill /* nfd */ write: ld arg0_hi jne #0, kill ld arg0_lo jge #32, kill tax ld $write_fd_mask rsh %x jset #1, allow, kill read: ld arg0_hi jne #0, kill ld arg0_lo jge #32, kill tax ld $read_fd_mask rsh %x jset #1, allow, kill fdatasync: ld arg0_hi jne #0, kill ld arg0_lo jlt $BPF_BLOCK_MIN, kill jge $BPF_BLOCK_MAX, kill, allow fallocate: ld arg0_hi jne #0, kill ld arg1_lo jne $FALLOC_MODE, kill jmp block_call block_call: /* check block fd */ ld arg0_hi jne #0, kill ld arg0_lo jlt $BPF_BLOCK_MIN, kill jge $BPF_BLOCK_MAX, kill /* check nonnegative, the kernel would also catch that, but we do it earlier */ ld block1_hi and #0x80000000 jne #0, kill ld block2_hi and #0x80000000 jne #0, kill /* check alignment */ ld block1_lo and $BPF_BLOCK_MASK jne #0, kill ld block2_lo and $BPF_BLOCK_MASK jne #0, kill /* M[0] = size_lo + off_lo */ ld block1_lo tax ld block2_lo add %x st M[0] /* M[1] = size_hi + off_hi */ ld block1_hi tax ld block2_hi add %x st M[1] /* check if low addition overflowed */ ld block2_lo tax ld M[0] jlt %x, block_ovf jmp block_no_ovf /* add carry to M[1] */ block_ovf: ld M[1] add #1 st M[1] block_no_ovf: /* load sizes to M[2] and M[3] */ ld arg0_lo BLOCK_FOREACH(BLOCK_JMP) jmp kill BLOCK_FOREACH(BLOCK_SIZE) block_check_range: /* check size_hi + off_hi <= BLOCK_SIZE_HI */ ld M[1] ldx M[3] jlt %x, allow jgt %x, kill /* check size_lo + off_lo <= BLOCK_SIZE_LO */ ld M[0] ldx M[2] jgt %x, kill, allow kill: ret KILL allow: ret ALLOW
programs/oeis/176/A176640.asm
neoneye/loda
22
94705
; A176640: Partial sums of A005985. ; 0,1,5,14,46,111,303,688,1712,3761,8881,19122,43698,92851,207539,436916,961204,2009781,4369077,9087670,19573430,40544951,86682295,178956984,380283576,782936761,1655351993,3400182458,7158278842 lpb $0 mov $2,$0 sub $0,1 seq $2,5985 ; Length of longest trail (i.e., path with all distinct edges) on the edges of an n-cube. add $1,$2 lpe mov $0,$1
src/Categories/Pseudofunctor/Identity.agda
Trebor-Huang/agda-categories
279
1125
<gh_stars>100-1000 {-# OPTIONS --without-K --safe #-} -- The identity pseudofunctor module Categories.Pseudofunctor.Identity where open import Data.Product using (_,_) open import Categories.Bicategory using (Bicategory) import Categories.Bicategory.Extras as BicategoryExt open import Categories.Category using (Category) open import Categories.Category.Instance.One using (shift) open import Categories.Category.Product using (_⁂_) open import Categories.Functor using (Functor; _∘F_) renaming (id to idF) import Categories.Morphism.Reasoning as MorphismReasoning open import Categories.NaturalTransformation using (NaturalTransformation) open import Categories.NaturalTransformation.NaturalIsomorphism using (NaturalIsomorphism; _≃_; niHelper) open import Categories.Pseudofunctor using (Pseudofunctor) open Category using (module HomReasoning) open NaturalIsomorphism using (F⇒G; F⇐G) -- The identity pseudofunctor idP : ∀ {o ℓ e t} {C : Bicategory o ℓ e t} → Pseudofunctor C C idP {o} {ℓ} {e} {t} {C = C} = record { P₀ = λ x → x ; P₁ = idF ; P-identity = P-identity ; P-homomorphism = P-homomorphism ; unitaryˡ = unitaryˡ ; unitaryʳ = unitaryʳ ; assoc = assoc } where open BicategoryExt C P-identity : ∀ {x} → id {x} ∘F shift o ℓ e ≃ idF ∘F id P-identity {x} = niHelper (record { η = λ _ → id₂ ; η⁻¹ = λ _ → id₂ ; commute = λ _ → MorphismReasoning.id-comm-sym (hom x x) ; iso = λ _ → record { isoˡ = hom.identity² ; isoʳ = hom.identity² } }) P-homomorphism : ∀ {x y z} → ⊚ ∘F (idF ⁂ idF) ≃ idF ∘F ⊚ {x} {y} {z} P-homomorphism {x} {_} {z} = niHelper (record { η = λ _ → id₂ ; η⁻¹ = λ _ → id₂ ; commute = λ _ → MorphismReasoning.id-comm-sym (hom x z) ; iso = λ _ → record { isoˡ = hom.identity² ; isoʳ = hom.identity² } }) Pid = λ {A} → NaturalTransformation.η (F⇒G (P-identity {A})) _ Phom = λ {x} {y} {z} f,g → NaturalTransformation.η (F⇒G (P-homomorphism {x} {y} {z})) f,g λ⇒ = unitorˡ.from ρ⇒ = unitorʳ.from α⇒ = associator.from unitaryˡ : ∀ {x y} {f : x ⇒₁ y} → let open ComHom in [ id₁ ⊚₀ f ⇒ f ]⟨ Pid ⊚₁ id₂ ⇒⟨ id₁ ⊚₀ f ⟩ Phom (id₁ , f) ⇒⟨ id₁ ⊚₀ f ⟩ λ⇒ ≈ λ⇒ ⟩ unitaryˡ {x} {y} {f} = begin λ⇒ ∘ᵥ Phom (id₁ , f) ∘ᵥ (Pid ⊚₁ id₂) ≈⟨ refl⟩∘⟨ elimʳ ⊚.identity ⟩ λ⇒ ∘ᵥ Phom (id₁ , f) ≈⟨ hom.identityʳ ⟩ λ⇒ ∎ where open HomReasoning (hom x y) open MorphismReasoning (hom x y) unitaryʳ : ∀ {x y} {f : x ⇒₁ y} → let open ComHom in [ f ⊚₀ id₁ ⇒ f ]⟨ id₂ ⊚₁ Pid ⇒⟨ f ⊚₀ id₁ ⟩ Phom (f , id₁) ⇒⟨ f ⊚₀ id₁ ⟩ ρ⇒ ≈ ρ⇒ ⟩ unitaryʳ {x} {y} {f} = begin ρ⇒ ∘ᵥ Phom (f , id₁) ∘ᵥ (id₂ ⊚₁ Pid) ≈⟨ refl⟩∘⟨ elimʳ ⊚.identity ⟩ ρ⇒ ∘ᵥ Phom (f , id₁) ≈⟨ hom.identityʳ ⟩ ρ⇒ ∎ where open HomReasoning (hom x y) open MorphismReasoning (hom x y) assoc : ∀ {x y z w} {f : x ⇒₁ y} {g : y ⇒₁ z} {h : z ⇒₁ w} → let open ComHom in [ (h ⊚₀ g) ⊚₀ f ⇒ h ⊚₀ (g ⊚₀ f) ]⟨ Phom (h , g) ⊚₁ id₂ ⇒⟨ (h ⊚₀ g) ⊚₀ f ⟩ Phom (_ , f) ⇒⟨ (h ⊚₀ g) ⊚₀ f ⟩ α⇒ ≈ α⇒ ⇒⟨ h ⊚₀ (g ⊚₀ f) ⟩ id₂ ⊚₁ Phom (g , f) ⇒⟨ h ⊚₀ (g ⊚₀ f) ⟩ Phom (h , _) ⟩ assoc {x} {_} {_} {w} {f} {g} {h} = begin α⇒ ∘ᵥ Phom (_ , f) ∘ᵥ Phom (h , g) ⊚₁ id₂ ≈⟨ refl⟩∘⟨ elimʳ ⊚.identity ⟩ α⇒ ∘ᵥ Phom (_ , f) ≈⟨ hom.identityʳ ⟩ α⇒ ≈˘⟨ elimˡ ⊚.identity ⟩ id₂ ⊚₁ Phom (g , f) ∘ᵥ α⇒ ≈˘⟨ hom.identityˡ ⟩ Phom (h , _) ∘ᵥ id₂ ⊚₁ Phom (g , f) ∘ᵥ α⇒ ∎ where open HomReasoning (hom x w) open MorphismReasoning (hom x w)
titanium_native/TitaniumNative.g4
shivanshu3/titanium_native
0
3404
grammar TitaniumNative; /* * Parser rules */ // This is the root node tnProgram : tnExpression EOF ; tnExpression : (tnTerm)+ ; tnTerm : tnOperand | tnOperator ; tnOperand : tnLiteral | tnProcedure ; tnProcedure : '(' tnExpression ')' ; tnLiteral : TN_NUMBER | TN_BOOL | tnString ; tnString : TN_NON_VERBATIM_STRING | TN_VERBATIM_STRING ; tnOperator : tnWordOperator | tnVariableOperator | tnSymbolOperator ; tnWordOperator : TN_IDENTIFIER ; tnVariableOperator : '=' TN_IDENTIFIER | '!' TN_IDENTIFIER ; tnSymbolOperator : '++' | '--' | '[]' | '<=' | '>=' | '==' | '+' | '-' | '*' | '/' | '<' | '>' ; /* * Lexer rules */ TN_PLUS : '+' ; TN_MINUS : '-' ; TN_TIMES : '*' ; TN_DIV : '/' ; TN_IDENTIFIER : TN_LETTER TN_LETTER_OR_DIGIT* ; fragment TN_LETTER : [a-zA-Z_] ; fragment TN_LETTER_OR_DIGIT : TN_LETTER | [0-9] ; TN_NUMBER : ('0' .. '9')+ ('.' ('0' .. '9')+)? ; TN_BOOL : 'true' | 'false' ; TN_NON_VERBATIM_STRING : '`' TN_NON_VERBATIM_CHAR* '`' ; TN_VERBATIM_STRING : '@' '`' TN_VERBATIM_CHAR* '`' ; fragment TN_NON_VERBATIM_CHAR : ~["\\\r\n] | TN_ESCAPE_SEQUENCE ; fragment TN_VERBATIM_CHAR : ~[\u0000-\u001F\u0060] ; fragment TN_ESCAPE_SEQUENCE : '\\' [btnfr"'\\] ; TN_WS : [ \r\n\t]+ -> skip ;
src/data/lib/prim/Agda/Builtin/TrustMe.agda
bennn/agda
0
4639
<filename>src/data/lib/prim/Agda/Builtin/TrustMe.agda module Agda.Builtin.TrustMe where open import Agda.Builtin.Equality open import Agda.Builtin.Equality.Erase private postulate unsafePrimTrustMe : ∀ {a} {A : Set a} {x y : A} → x ≡ y primTrustMe : ∀ {a} {A : Set a} {x y : A} → x ≡ y primTrustMe = primEraseEquality unsafePrimTrustMe {-# DISPLAY primEraseEquality unsafePrimTrustMe = primTrustMe #-}
src/keyboard/igkb_handlers.asm
Q-Bert-Reynolds/gbedit
1
83471
<filename>src/keyboard/igkb_handlers.asm IGKBHandleCode::;a = scan code .handleSpace cp a, 137 jr nz, .handlePeriod ld a, " " jp KBHandleCharacter .handlePeriod cp a, 148 jr nz, .handleApostrophe ld a, "." jp KBHandleCharacter .handleApostrophe cp a, 145 jr nz, .handleComma ld a, "'" jp KBHandleCharacter .handleComma cp a, 147 jr nz, .handleEnter ld a, "," jp KBHandleCharacter .handleEnter cp a, 133 jr nz, .handleBackspace jp KBHandleEnter .handleBackspace cp a, 135 jr nz, .handleZero jp KBHandleBackspace .handleZero cp a, 132 jr nz, .handleNumber ld a, "0" call KBHandleCharacter .handleNumber cp a, 123 jr c, .handleCharacter cp a, 132 jr nc, .handleCharacter sub a, 74 .handleCharacter ; For all other characters, IG does the following to get the keycode: ; ASCIICode += char((unsigned char)HIDCode + (shift ? 61 : 93)); ; ASCII ends at 127, so anything above that must be readjusted jp nc, .handleOther call KBHandleCharacter .handleOther ;The shift trick that IG does fucks up most special keys. ;assuming that shift key not pressed sub a, 93;HID codes >40 ld b, 0 ld c, a ld hl, IGKBJumpTable add hl, bc add hl, bc ld a, [hli] ld b, a ld a, [hl] ld h, a ld l, b jp hl IGKBHandleEnter: jp KBHandleEnter IGKBHandleCharacter: ret IGKBHandleEscape: jp KBHandleEscape IGKBHandleBackspace: jp KBHandleBackspace IGKBHandleTab: jp KBHandleTab IGKBHandleFunctionKey: ret IGKBHandlePrintScreen: ret IGKBHandleScrollLock: ret IGKBHandleNumLock: ret IGKBHandleCapsLock: ret IGKBHandlePauseKey: ret IGKBHandleInsertKey: ret IGKBHandleHomeKey: ret IGKBHandlePageUp: ret IGKBHandleDelete: ret IGKBHandleEndKey: ret IGKBHandlePageDown: ret IGKBHandleArrowKey: ret IGKBHandleError:;a = scan code ;TODO ret
app/assets/images/materials/course4/rEqualsItsClosure.als
se-unrc/cacic-site
0
905
<gh_stars>0 sig A { } one sig Rel { r : A -> A } fact reflexive { A<:iden in Rel.r } fact transitive { (Rel.r).(Rel.r) in Rel.r } assert rEqualsItsClosure { Rel.r = A<:*(Rel.r)} check rEqualsItsClosure for 5
GetWindowSize.applescript
u-4/AppleScript
0
3122
-- http://battleformac.blog.jp/archives/52367319.html tell application "System Events" set topProcess to item 1 of (every process whose frontmost is true) tell topProcess set topDocWindow to item 1 of (every window whose subrole is "AXStandardWindow") set bestSize to size of topDocWindow end tell end tell display dialog (" Window Size is " & (item 1 of bestSize) as text) & " x " & (item 2 of bestSize) as text
Kernel/IO_ASM.asm
foviedoITBA/TPE-Arqui
0
175496
<reponame>foviedoITBA/TPE-Arqui global _out_16 global _in_16 section .text ; void _out_16(uint16_t port, uint16_t data) _out_16: push rbp mov rbp, rsp push rdx push rax mov rdx, rdi mov rax, rsi out dx, ax pop rax pop rdx leave ret ; uint16_t _in_16(uint16_t port) _in_16: push rbp mov rbp, rsp push rdx mov rdx, rdi in ax, dx pop rdx leave ret
out/aaa_02if.adb
Melyodas/metalang
22
12058
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C; use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C; procedure aaa_02if is type stringptr is access all char_array; procedure PString(s : stringptr) is begin String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all)); end; function f(i : in Integer) return Boolean is begin if i = 0 then return TRUE; end if; return FALSE; end; begin if f(4) then PString(new char_array'( To_C("true <-" & Character'Val(10) & " ->" & Character'Val(10)))); else PString(new char_array'( To_C("false <-" & Character'Val(10) & " ->" & Character'Val(10)))); end if; PString(new char_array'( To_C("small test end" & Character'Val(10)))); end;
programs/oeis/056/A056810.asm
neoneye/loda
22
243724
<gh_stars>10-100 ; A056810: Numbers whose fourth power is a palindrome. ; 0,1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001 sub $0,1 mov $2,$0 mov $3,$0 lpb $3 div $2,3 max $2,1 sub $3,2 lpe mov $1,10 pow $1,$0 mov $4,$1 cmp $4,0 add $1,$4 add $1,$2 mov $0,$1
oeis/135/A135593.asm
neoneye/loda-programs
11
245527
; A135593: Number of n X n symmetric (0,1)-matrices with exactly n+1 entries equal to 1 and no zero rows or columns. ; Submitted by <NAME> ; 2,9,36,140,540,2142,8624,35856,152280,666380,2982672,13716144,64487696,310693320,1528801920,7691652992,39474925344,206758346256,1103332900160,5999356762560,33197323465152,186925844947424,1069977071943936,6225010338067200,36781106159907200,220661643838364352,1343284218678576384,8295373370026862336,51939654075612483840,329641985716146138240,2119676498419809800192,13805976878644366209024,91046983755689907872256,607793106631531238324480,4105721954640864158254080,28058407925954159197596672 mov $1,$0 add $0,2 seq $1,189940 ; Number of connected components in all simple labeled graphs with n nodes having degrees at most one. mul $1,79 mul $1,$0 mov $0,$1 div $0,79
external/src/libvpx/vpx_config_x86.asm
emarc99/SLib
146
91771
%include "vpx_config_common.asm" ARCH_ARM EQU 0 ARCH_X86 EQU 1 ARCH_X86_64 EQU 0 HAVE_NEON EQU 0 HAVE_NEON_ASM EQU 0 HAVE_MMX EQU 1 HAVE_SSE EQU 1 HAVE_SSE2 EQU 1 HAVE_SSE3 EQU 1 HAVE_SSSE3 EQU 1 HAVE_SSE4_1 EQU 1 HAVE_AVX EQU 1 HAVE_AVX2 EQU 1 HAVE_AVX512 EQU 0
alloy4fun_models/trainstlt/models/2/ZnSXv5rwsCyDZTsJR.als
Kaixi26/org.alloytools.alloy
0
147
<reponame>Kaixi26/org.alloytools.alloy open main pred idZnSXv5rwsCyDZTsJR_prop3 { all t : Train , x : t.pos | no x.prox } pred __repair { idZnSXv5rwsCyDZTsJR_prop3 } check __repair { idZnSXv5rwsCyDZTsJR_prop3 <=> prop3o }
oeis/052/A052216.asm
neoneye/loda-programs
11
247745
; A052216: Sum of two powers of 10. ; Submitted by <NAME> ; 2,11,20,101,110,200,1001,1010,1100,2000,10001,10010,10100,11000,20000,100001,100010,100100,101000,110000,200000,1000001,1000010,1000100,1001000,1010000,1100000,2000000,10000001,10000010,10000100,10001000,10010000,10100000,11000000,20000000,100000001,100000010,100000100,100001000,100010000,100100000,101000000,110000000,200000000,1000000001,1000000010,1000000100,1000001000,1000010000,1000100000,1001000000,1010000000,1100000000,2000000000,10000000001,10000000010,10000000100,10000001000,10000010000 seq $0,55235 ; Sums of two powers of 3. seq $0,7089 ; Numbers in base 3.
data/maps/objects/Route11Gate2F.asm
opiter09/ASM-Machina
1
13193
Route11Gate2F_Object: db $a ; border block def_warps warp 7, 7, 4, ROUTE_11_GATE_1F def_signs sign 1, 2, 3 ; Route11GateUpstairsText3 sign 6, 2, 4 ; Route11GateUpstairsText4 def_objects object SPRITE_YOUNGSTER, 4, 2, WALK, LEFT_RIGHT, 1 ; person object SPRITE_SCIENTIST, 2, 6, STAY, NONE, 2 ; person def_warps_to ROUTE_11_GATE_2F
week_08/ProgramFlow/BasicLoop/BasicLoop.asm
DaviNakamuraCardoso/nand2tetris
0
89638
<gh_stars>0 @256 D=A @SP M=D @300 D=A @LCL M=D @400 D=A @ARG M=D @3000 D=A @THIS M=D @3010 D=A @THAT M=D // // This file is part of www.nand2tetris.org // // and the book "The Elements of Computing Systems" // // by <NAME>, MIT Press. // // File name: projects/08/ProgramFlow/BasicLoop/BasicLoop.vm // // // Computes the sum 1 + 2 + ... + argument[0] and pushes the // // result onto the stack. Argument[0] is initialized by the test // // script before this code starts running. // push constant 0 @0 D=A @SP A=M M=D @SP M=M+1 // pop local 0 // initializes sum = 0 @0 D=A @LCL D=M+D @temp M=D @SP M=M-1 A=M D=M @temp A=M M=D // label LOOP_START (LOOP_START) // push argument 0 @0 D=A @ARG A=D+M D=M @SP A=M M=D @SP M=M+1 // push local 0 @0 D=A @LCL A=D+M D=M @SP A=M M=D @SP M=M+1 // add @SP M=M-1 A=M D=M @SP M=M-1 A=M M=M+D @SP M=M+1 // pop local 0 // sum = sum + counter @0 D=A @LCL D=M+D @temp M=D @SP M=M-1 A=M D=M @temp A=M M=D // push argument 0 @0 D=A @ARG A=D+M D=M @SP A=M M=D @SP M=M+1 // push constant 1 @1 D=A @SP A=M M=D @SP M=M+1 // sub @SP M=M-1 A=M D=M @SP M=M-1 A=M M=M-D @SP M=M+1 // pop argument 0 // counter-- @0 D=A @ARG D=M+D @temp M=D @SP M=M-1 A=M D=M @temp A=M M=D // push argument 0 @0 D=A @ARG A=D+M D=M @SP A=M M=D @SP M=M+1 // if-goto LOOP_START // If counter != 0, goto LOOP_START @SP M=M-1 A=M D=M @LOOP_START D;JNE // push local 0 @0 D=A @LCL A=D+M D=M @SP A=M M=D @SP M=M+1 (END) @END 0;JMP
iod/iob/gbps.asm
olifink/smsqe
0
163575
; Buffering (get byte parity set) utility V2.00  1989 <NAME> QJUMP section iou xdef iob_gbps xref iob_fbfl xref iob_fbuf xref iob_prts include 'dev8_keys_buf' include 'dev8_keys_err' ;+++ ; This routine gets a single byte from an IO buffer and sets the parity ; according to the parity code in d7. If the byte is in a new buffer, ; the old buffer is added to the linked list of throwaways. ; If it is end of file, the buffer is thrown away and A2 is returned as ; either the next list of buffers or zero. ; When A2 is modified, the corresponding current output queue pointer is ; updated. ; ; This routine can be called from an interrupt server. ; ; This is a clean routine. ; ; d0 r status: 0, err.nc, or +1 for end of file ; d1 r byte fetched, not modified if err.nc, eof flag if end of file ; d7 c p byte parity code ; a2 c u pointer to buffer header, updated if new buffer or eof ; a6 c p pointer to system variables ; all other registers preserved ;-- iob_gbps ibgb.reg reg a3 move.l a3,-(sp) move.l buf_nxtg(a2),a3 ; next get tst.b buf_nxtb(a2) ; is it dynamic? bge.s ibgb_dyn cmp.l buf_nxtp(a2),a3 beq.s ibgb_nc ; nothing to come move.b (a3)+,d1 ; get byte out cmp.l buf_endb(a2),a3 ; off end? blt.s ibgb_ok ; ... no lea buf_strt(a2),a3 ; ... yes, start again bra.s ibgb_ok ibgb_dyn cmp.l buf_nxtp(a2),a3 ; at end blt.s ibgb_gbf ; get byte cmp.l buf_endb(a2),a3 ; off end? blt.s ibgb_nc ; ... no move.l buf_nxtb(a2),d0 ; ... yes, find next one beq.s ibgb_nc ; ... none move.l d0,a3 move.l buf_nxtg(a3),d0 ; check if anything in next buffer yet cmp.l buf_nxtp(a3),d0 beq.s ibgb_nc ; ... no jsr iob_fbfl move.l d0,a3 ; next get pointer ibgb_gbf move.b (a3)+,d1 ; get byte out ibgb_ok move.l a3,buf_nxtg(a2) ; OK, update pointer move.l (sp)+,a3 moveq #0,d0 move.b d7,d0 bne.l iob_prts ; set parity rts ibgb_nc move.b buf_eoff(a2),d0 ; nothing more, is it end of file? bmi.s ibgb_eof moveq #err.nc,d0 ibgb_exit move.l (sp)+,a3 rts ibgb_eof move.b d0,d1 bclr #7,d1 ; set eof flag move.l buf_nxtl(a2),a3 ; next buffer is in next list jsr iob_fbuf moveq #1,d0 bra.s ibgb_exit end
sbsext/ext/exsbas.asm
olifink/smsqe
0
165334
* EX, EW and ET V2.00  1984 Sinclair Research and <NAME> QJUMP *  1994 Tony Tebby SBASIC compatible version * ; 2003-11-10 2.01 Added functions FET, FEX, FEW pjwitte 2oo3 * 2004-05-15 2.02 Added ex_m (wl) * 2005-01-25 2.03 Added call to Home thing (wl) * 2005-11-17 2.04 If A1 absolute, use supervisor mode when calling home thing * 2006-03-27 2.05 Use system specific execution delay (MK) ; 2014-06-08 2.06 Added function FEX_M (pjw) section exten * xdef etsb xdef ewsb xdef exsb xdef emsb xdef fetsb xdef fewsb xdef fexsb xdef femsb * xref ut_ckcomma xref ut_cksemi xref ut_ckto xref ut_openj xref ut_opdefxj xref ut_openp xref ut_fopen xref ut_fname xref ut_gtnm1 xref ut_chanf xref prior xref ut_rtfd1 xref uxt_bopt xref gu_shome xref gu_exdelay * include 'dev8_keys_sbasic' include 'dev8_keys_sys' include 'dev8_keys_err' include 'dev8_keys_jcb' include 'dev8_keys_chn' include 'dev8_keys_thg' include 'dev8_keys_qdos_io' include 'dev8_keys_qdos_ioa' include 'dev8_keys_qdos_sms' include 'dev8_sbsext_ext_ex_defs' include 'dev8_sbsext_ut_opdefx_keys' * femsb ; Function: No waiting, owned by me pea fex_exit stack return address bra.s emsb fexsb pea fex_exit stack return address bra.s exsb Function EX fetsb bsr.s etsb Function ET fex_exit tst.l d1 parameter error? bne.l ut_rtfd1 no, ret job ID fex_rts rts hard error fewsb bsr.s ewsb Function EW tst.l d1 parameter error? beq.s fex_rts yes, return hard error move.l d0,d1 no, return program's error code bra.l ut_rtfd1 * emsb clr.w -(sp) no waiting moveq #-1,d0 job owned by me bra.s ex_ew_et etsb move.w #1,-(sp) flag to prevent activation bra.s ex_et ewsb moveq #-1,d0 jobs owned by me move.w d0,-(sp) wait until complete bra.s ex_ew_et exsb clr.w -(sp) no waiting ex_et moveq #0,d0 jobs independent ex_ew_et clr.l -(sp) save the SBAS flag / channel ID move.l a3,-(sp) save the start pointer clr.l -(sp) clear pointer to options on ri stack clr.l -(sp) clear the final pipe id clr.w -(sp) clear out the pipe flags clr.l -(sp) clr.l -(sp) the last job id move.l d0,-(sp) and the owner job id clr.l -(sp) ; future pointer to filename * cmp.l a5,a3 any parameters? beq.s ex_bp.1 ... no!! * tst.b -7(a6,a5.l) is last one to #? bge.s prg_loop ... not # lea -8(a5),a3 ... is #, look at it bsr.l ut_ckto is it preceded by to? bne.s prg_loop ... not to cmp.l parm_st(sp),a3 it must not be first ex_bp.1 beq.l ex_bp ... but it is **** tst.w job_wait(sp) must not be ew **** bmi.l ex_bp ... but it is bsr.l ut_chanf find channel table address bne.s ex_err.4 bsr.l ut_openp open a pipe bne.s ex_err.4 move.l a0,(a6,d4.l) one end for basic sub.l sb_chanb(a6),d4 move.l d4,pipe_end(sp) keep pointer in case of error move.l d3,pipe_out(sp) and save other end in the pipe_out flag subq.l #8,a5 remove last parameter * prg_loop clr.l job_sbas(sp) clear sbas pointer clr.l opt_ptr(sp) clear the option pointer moveq #0,d5 no space is required lea -8(a5),a3 look at previous parameter bsr.l ut_cksemi is it preceded by a semicolon? bne.s prog_find ... no bsr.l ut_gtnm1 ... yes, get string ex_err.4 bne.s ex_err.3 move.l a3,a5 remove last parameter move.w (a6,a1.l),d5 keep the number of bytes addq.l #1,d5 rounded up bclr #0,d5 move.l a1,sb_arthp(a6) ... save the pointer so we do not loose string sub.l sb_arthb(a6),a1 and keep the pointer relative to base of ri move.l a1,opt_ptr(sp) * prog_find move.l a5,a3 now start looking for program name moveq #-1,d7 count the number of bits skipped prog_look subq.l #8,a3 move back one addq.l #1,d7 cmp.l parm_st(sp),a3 is it the first on the line? beq.s prog_found yes bsr.l ut_ckcomma is it a data file (preceded by ',')? beq.s prog_look ... yes, try again bsr.l ut_ckto is it preceded by to? bne.s ex_err.3 ... no, bad, bad, bad st pipe_in(sp) ... yes, remember that we have a pipe in prog_found moveq #ioa.kshr,d3 moveq #uod.extn+uod.prgd,d2 ; program default lea uxt_bopt,a2 ; optional basic extensions jsr ut_fopen open program file ex_err.3 bne.l ex_error or.b #$10,1(a6,a3.l) and reset the separator to comma xref ut_getext xref uxt.bas xref uxt.sav * ! move.l a1,file_nm(sp) * ! jsr ut_getext get extension cmp.l uxt.bas,d1 was it _bas? seq job_sbas(sp) ... yes flag it beq.s prog_sbas cmp.l uxt.sav,d1 was it _sav? seq job_sbas(sp) ... yes flag it beq.s prog_sbas moveq #iof.rhdr,d0 not SBASIC, read the header moveq #$e,d2 14 bytes moveq #-1,d3 move.l sb_buffb(a6),a1 into the basic buffer trap #4 trap #3 tst.l d0 done? ;!!! bne.s ex_close ... no, it errored bne ex_close ... no, it errored sub.w d2,a1 backspace to start moveq #err.ipar,d0 ... assume it will error subq.b #1,5(a6,a1.l) is it executable? bne.s ex_close ... no move.l 6(a6,a1.l),d0 data space move.l (a6,a1.l),d2 length of file sub.l a1,a1 start at start bra.s prog_create prog_sbst moveq #sms.xtop,d0 trap #do.sms2 move.l sys_jbtb(a6),a5 move.l (a5),a5 move.l sb_vars+sb_sbjob(a5),d0 start address rts prog_sbas move.l a0,job_sbas(sp) it's SBASIC bsr.s prog_sbst set start address move.l d0,a1 move.l #sb.jobsz,d0 data space moveq #$10,d2 program size prog_create move.l a0,a4 save channel id move.l job_id(sp),d1 owned by 0 or previous job move.l d7,d3 number of files addq.l #3,d3 plus two pipes (and two counts) lsl.l #2,d3 *4 add.l d5,d3 plus string length add.l d0,d3 plus data space required moveq #sms.crjb,d0 create job trap #1 exg a0,a4 restore channel id tst.l d0 did it create ok bne.s ex_close ... no * !!! * additions for "home" thing move.l file_nm(sp),a1 ; filename to set move sr,d4 trap #0 ; supervisor mode for absolute a1 add.l a6,a1 ; now absolute jsr gu_shome ; job ID is already in d1 move d4,sr ; !!! ; end additions move.l a4,a1 set address to load move.l a4,a2 ... and keep it add.l d2,a4 set up address of stack add.l d3,a4 move.l d1,job_id(sp) and save the job id tst.l top_id(sp) is it the first job? bne.s ex_load move.l d1,top_id(sp) yes, save the top job id ex_load tst.l job_sbas(sp) sbasic? bne.s ex_sbload ... yes moveq #iof.load,d0 ... no, load the program moveq #-1,d3 trap #3 ex_close move.l d0,d4 save error code moveq #ioa.clos,d0 and close channel trap #2 move.l d4,d0 beq.s ex_parm_set bne.l ex_error ex_sbload moveq #ioa.sown,d0 trap #2 set channel owned by job bsr.s prog_sbst set start address move.l d0,a0 move.l (a0)+,(a1)+ bra.s; 0000 move.l (a0)+,(a1)+ 00004afb move.l (a0)+,(a1)+ 0006'SB' move.l (a0)+,(a1)+ 'ASIC' clr.l (a1)+ ... no second flag ex_parm_set clr.w -(a4) leave a zero option string on the job's stack move.l opt_ptr(sp),d1 get the option pointer beq.s ex_pip_in ... it's zero add.l sb_arthb(a6),d1 plus bas of ri stack addq.l #2,a4 remove zero from job's stack add.l d5,d1 end of string ex_opt_loop move.w (a6,d1.l),-(a4) copy a word at a time subq.l #2,d1 sub.l #2,d5 bge.s ex_opt_loop * ex_pip_in moveq #0,d5 no channel ids put on stack so far move.l a4,a1 and a1 points to command string tst.b pipe_in(sp) ... is there an input pipe? beq.s ex_pip_out ... no addq.w #1,d7 ... yes, so there is one more file ex_pip_out move.l pipe_out(sp),d4 is there an output pipe beq.s ex_files ... no addq.w #1,d7 ... yes, one more file move.l d4,-(a4) id on stack addq.w #1,d5 ... yes, one more * * now transfer ownership of pipe to job (to get eof when job removes itself) * move.l job_id(sp),d1 move.l d4,a0 moveq #ioa.sown,d0 trap #2 * ex_files addq.l #6,a2 look for flag cmp.w #$4afb,(a2)+ bne.s ex_standard ... not there move.w (a2)+,d1 get name length addq.w #1,d1 skip name bclr #0,d1 add.w d1,a2 cmp.w #$4afb,(a2)+ is there another flag? beq.l ex_special ... yes, special file handling * ex_standard move.l a5,a3 set start pointer ex_floop subq.l #8,a3 take next parameter bsr.l ut_ckcomma ... filenames are preceded by comma bne.s ex_set_in ... done bsr.l ut_fname get filename or id blt.s ex_err.1 ... oops addq.w #1,d5 one more file tst.l d0 is it a channel id? bgt.s ex_set_ch ... yes moveq #ioa.kovr,d3 assume overwrite tst.b pipe_in(a7) can it be primary input? bne.s ex_fopen ... no cmp.w d5,d7 is it primary input? bne.s ex_fopen ... no moveq #ioa.kshr,d3 ... yes, assume share cmp.w #1,d5 but is it also primary output? bne.s ex_fopen ... no moveq #ioa.kexc,d3 ... yes, open for input and output ex_fopen bsr.l ut_openj open file ex_err.1 bne.s ex_err.0 oops ex_set_ch move.l a0,-(a4) put channel id on stack bra.s ex_floop next * ex_set_in tst.b pipe_in(sp) was there an input pipe? beq.s ex_fend ... no bsr.l ut_openp ... yes, open a pipe move.l a0,-(a4) put id on stack addq.w #1,d5 (one more) move.l d3,pipe_out(sp) set output from next sf pipe_in(sp) there may not be another input ex_fend move.l job_sbas(sp),d0 is there a BASIC source file? beq.s ex_snchn ... no move.l d0,-(a4) addq.w #1,d5 ex_snchn move.w d5,-(a4) put the number of channel ids on stack moveq #sms.spjb,d0 get address of job header by devious means move.l job_id(sp),d1 moveq #0,d2 trap #1 move.l a4,jcb_a7(a0) and put the stack pointer in * ex_next move.l a3,a5 set new end pointer subq.l #8,a3 cmp.l parm_st(sp),a3 is there just one item left? blt.s ex_active ... no, none bgt.l prg_loop ... no, look at next group tst.b 1(a6,a3.l) ... yes, is it #? bpl.l prg_loop ... no **** tst.w job_wait(sp) ... yes, it must not be ew **** bmi.s ex_bp ... oh! but it is bsr.l ut_chanf ... find channel pointer ex_err.0 bne.s ex_error move.l pipe_out(sp),(a6,d4.l) ... and set pipe id in it * ex_active move.w job_wait(sp),d7 is it et (or ex or ew)? bgt.s ex_exit_ok ... et, do not activate move.l job_id(sp),d5 start at most recent job ex_act_loop move.l d5,d1 moveq #sms.injb,d0 find owner move.l d1,d4 but save this job's id moveq #0,d2 trap #1 move.l d2,d5 save owner moveq #sms.acjb,d0 activate move.l d4,d1 this job move.w prior(pc),d2 at given priority cmp.l top_id(sp),d1 is this the top job? beq.s ex_act_top moveq #0,d3 do not wait trap #1 bra.s ex_act_loop ex_act_top move.w d7,d3 top job waits if ew trap #1 tst.w d7 ew? bne.s ex_exit_ok ... yes, do not pause * ;;; moveq #25,d3 suspend for .5 of a second, to give job a chance ;;; bsr.s ex_proc ;;; sub.b #$30,d0 030? ;;; blt.s ex_susp ;;; beq.s ex_susp30 ;;; moveq #3,d3 ;;; bra.s ex_susp ;;;ex_susp30 ;;; moveq #5,d3 ;;;ex_susp jsr gu_exdelay ; get system specific execution delay move.l d0,d3 moveq #sms.ssjb,d0 suspend moveq #myself,d1 myself sub.l a1,a1 no flag trap #1 * ex_exit_ok ; pjw move.l job_id(sp),d1 return this job's ID add.w #ex_frame,sp remove local variables rts ex_exit ; pjw moveq #0,d1 flag parameter error add.w #ex_frame,sp remove local variables rts ;;;ex_proc ;;; moveq #sms.xtop,d0 ;;; trap #1 ;;; moveq #70,d0 ; Is the 7 here by mistake? Doesn't make sense ;;; add.b sys_ptyp(a6),d0 ;;; rts ex_bp moveq #err.ipar,d0 ex_error move.l d0,d4 save error code moveq #sms.frjb,d0 and get rid of all jobs and their channels move.l top_id(sp),d1 ... by removing the top job trap #1 move.l pipe_end(sp),d5 get pipe connected to basic beq.s ex_err_out ... it does not exist add.l sb_chanb(a6),d5 move.l (a6,d5.l),a0 get id moveq #-1,d0 move.l d0,(a6,d5.l) close in channel table moveq #ioa.clos,d0 close it trap #2 ex_err_out move.l pipe_out(sp),d0 is there a dangling output pipe? beq.s ex_err_d0 ... no move.l d0,a0 ... yes, close it (it might be gone already) moveq #ioa.clos,d0 trap #2 ex_err_d0 move.l d4,d0 restore the error code bra.s ex_exit * ex_special moveq #1,d4 get 1 in d4 if there is an input pipe and.b pipe_in(sp),d4 (already 1 in d5 if there is an output) move.l job_id(sp),d6 job id in d6 lea ex_extra(pc),a0 routine to be called to get a filename move.l a3,-(sp) save current parameter pointer addq.l #8,a3 it used to point to program jsr (a2) call program's own initialisation move.l (sp)+,a3 tst.l d0 bpl.l ex_set_in bra.s ex_error * * extra routines to support program initialisation * ex_extra bra.s ex_ut_fname * movem.l d6/a2,-(sp) move.l d6,d1 set owner job moveq #uod.datd,d2 bsr.l ut_opdefxj and open data channel for extra movem.l (sp)+,d6/a2 rts * ex_ut_fname movem.l d4/d6/a2,-(sp) get a name/id without smashing the registers bsr.l ut_fname movem.l (sp)+,d4/d6/a2 rts end
lang/english/okov.asm
olifink/smsqe
0
178751
; Text string for overwrite query V2.00  1990 <NAME> QJUMP section language include 'dev8_mac_text' mktext okov,{OK to Overwrite} end
oeis/127/A127847.asm
neoneye/loda-programs
11
88794
<reponame>neoneye/loda-programs ; A127847: a(n)=4^C(n,2)*(4^n-1)/3. ; Submitted by <NAME>(s3) ; 0,1,20,1344,348160,357564416,1465657589760,24017731997138944,1574098141758535761920,412645105639632468417970176,432690992231222540584116394393600,1814838857553600260569028862094736359424,30447948962887853884238295543591323273401466880 mov $2,$0 mov $4,$0 lpb $2 mov $0,$4 pow $0,2 add $0,$4 div $1,2 sub $2,1 sub $0,$2 mov $3,2 pow $3,$0 add $1,$3 lpe mov $0,$1 div $0,4
test/Fail/UnknownNameInFixityDecl.agda
cruhland/agda
1,989
16563
{-# OPTIONS --warning=error #-} module UnknownNameInFixityDecl where infix 40 _+_ infixr 60 _*_
programs/oeis/130/A130497.asm
karttu/loda
0
94404
; A130497: Repetition of odd numbers five times. ; 1,1,1,1,1,3,3,3,3,3,5,5,5,5,5,7,7,7,7,7,9,9,9,9,9,11,11,11,11,11,13,13,13,13,13,15,15,15,15,15,17,17,17,17,17,19,19,19,19,19,21,21,21,21,21,23,23,23,23,23,25,25,25,25,25,27,27,27,27,27,29,29,29,29,29,31,31,31 div $0,5 mul $0,2 mov $1,$0 add $1,1
src/core/asm/arm/aarch64/inst_0xf0.asm
Hiroshi123/bin_tools
0
104820
<reponame>Hiroshi123/bin_tools<gh_stars>0 ;;; 1 immlo(2) 1 | 0 0 0 0 | 0 N ;;; where immlo = 0x11 __0xf0_adrp: ret ;;; subs ;;; sf 1 1 1 | 0 0 0 1 | ;;; where sf = 1 __0xf1_cmp: ret ;;; 1 x 1 1 | 1 0 0 0 __0xf8_ldr_str: ret ;;; 1 x 1 1 | 1 0 0 1 __0xf9_ldr_str: ret ;;; conditional cmp ;;; sf 1 1 1 | 1 0 1 0 | ;;; where sf = 1 __0xfa_ccmp: ret ;;; 1 x 1 1 | 1 1 0 1 __0xfc_ldr_str: ret ;;; 1 x 1 1 | 1 1 0 1 ;;; where x(size) = 1 __0xfd_ldr_str: ret
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_703_1201.asm
ljhsiun2/medusa
9
170828
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0xb608, %rsi lea addresses_WC_ht+0x175c8, %rdi nop nop nop add $46504, %rdx mov $106, %rcx rep movsl lfence lea addresses_D_ht+0xef28, %rcx sub $22347, %rdi mov $0x6162636465666768, %r10 movq %r10, %xmm3 vmovups %ymm3, (%rcx) nop inc %rsi lea addresses_normal_ht+0x2248, %r14 dec %rdi mov (%r14), %edx nop nop nop nop nop sub %r10, %r10 lea addresses_UC_ht+0x1d48, %rsi lea addresses_normal_ht+0x1e4c8, %rdi nop and %rax, %rax mov $106, %rcx rep movsq nop add %r14, %r14 lea addresses_normal_ht+0x13e66, %rsi nop cmp $57508, %rcx mov (%rsi), %eax nop nop nop inc %rsi lea addresses_WC_ht+0x15ac8, %rsi nop nop sub %r14, %r14 mov $0x6162636465666768, %rcx movq %rcx, %xmm5 movups %xmm5, (%rsi) nop nop xor $57376, %rax lea addresses_WT_ht+0x11fc8, %r14 nop nop add %rdi, %rdi movb $0x61, (%r14) nop nop nop xor %r10, %r10 lea addresses_A_ht+0x90c8, %r10 nop nop sub %rcx, %rcx mov $0x6162636465666768, %rsi movq %rsi, %xmm7 and $0xffffffffffffffc0, %r10 vmovaps %ymm7, (%r10) nop cmp %r14, %r14 lea addresses_normal_ht+0xd858, %rsi lea addresses_WT_ht+0x11dbc, %rdi clflush (%rsi) nop nop nop nop cmp $38223, %rbx mov $63, %rcx rep movsb nop nop nop and $43249, %rax pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r9 push %rax push %rdi // Faulty Load lea addresses_PSE+0x12c8, %r15 nop nop nop nop nop and %rax, %rax mov (%r15), %r9w lea oracles, %r15 and $0xff, %r9 shlq $12, %r9 mov (%r15,%r9,1), %r9 pop %rdi pop %rax pop %r9 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': True}} {'33': 703} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
obj/gnattest/tests/dg_types-test_data-tests.adb
SMerrony/dgemua
2
23579
-- This package has been generated automatically by GNATtest. -- You are allowed to add your code to the bodies of test routines. -- Such changes will be kept during further regeneration of this file. -- All code placed outside of test routine bodies will be lost. The -- code intended to set up and tear down the test environment should be -- placed into DG_Types.Test_Data. with AUnit.Assertions; use AUnit.Assertions; with System.Assertions; -- begin read only -- id:2.2/00/ -- -- This section can be used to add with clauses if necessary. -- -- end read only -- begin read only -- end read only package body DG_Types.Test_Data.Tests is -- begin read only -- id:2.2/01/ -- -- This section can be used to add global variables and other elements. -- -- end read only -- begin read only -- end read only -- begin read only procedure Test_Boolean_To_YN (Gnattest_T : in out Test); procedure Test_Boolean_To_YN_3d5779 (Gnattest_T : in out Test) renames Test_Boolean_To_YN; -- id:2.2/3d577903f73df662/Boolean_To_YN/1/0/ procedure Test_Boolean_To_YN (Gnattest_T : in out Test) is -- dg_types.ads:111:5:Boolean_To_YN -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Boolean_To_YN(false) = 'N', "Oops!"); AUnit.Assertions.Assert (Boolean_To_YN(true) = 'Y', "Oops!"); -- begin read only end Test_Boolean_To_YN; -- end read only -- begin read only procedure Test_Clear_W_Bit (Gnattest_T : in out Test); procedure Test_Clear_W_Bit_3be3ae (Gnattest_T : in out Test) renames Test_Clear_W_Bit; -- id:2.2/3be3aea25085716b/Clear_W_Bit/1/0/ procedure Test_Clear_W_Bit (Gnattest_T : in out Test) is -- dg_types.ads:114:5:Clear_W_Bit -- end read only pragma Unreferenced (Gnattest_T); WD : Word_T := 2#11111111_11111111#; begin Clear_W_Bit(WD, 3); AUnit.Assertions.Assert (WD = 2#11101111_11111111#, "Clear_W_Bit."); Clear_W_Bit(WD, 3); AUnit.Assertions.Assert (WD = 2#11101111_11111111#, "Clear_W_Bit."); -- begin read only end Test_Clear_W_Bit; -- end read only -- begin read only procedure Test_Flip_W_Bit (Gnattest_T : in out Test); procedure Test_Flip_W_Bit_d2d2b6 (Gnattest_T : in out Test) renames Test_Flip_W_Bit; -- id:2.2/d2d2b6e658b2b202/Flip_W_Bit/1/0/ procedure Test_Flip_W_Bit (Gnattest_T : in out Test) is -- dg_types.ads:115:5:Flip_W_Bit -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Flip_W_Bit; -- end read only -- begin read only procedure Test_Set_W_Bit (Gnattest_T : in out Test); procedure Test_Set_W_Bit_f63f6c (Gnattest_T : in out Test) renames Test_Set_W_Bit; -- id:2.2/f63f6c8c25ceb56c/Set_W_Bit/1/0/ procedure Test_Set_W_Bit (Gnattest_T : in out Test) is -- dg_types.ads:116:5:Set_W_Bit -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Set_W_Bit; -- end read only -- begin read only procedure Test_Test_W_Bit (Gnattest_T : in out Test); procedure Test_Test_W_Bit_7a11db (Gnattest_T : in out Test) renames Test_Test_W_Bit; -- id:2.2/7a11dba379068970/Test_W_Bit/1/0/ procedure Test_Test_W_Bit (Gnattest_T : in out Test) is -- dg_types.ads:117:5:Test_W_Bit -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Test_W_Bit; -- end read only -- begin read only procedure Test_Get_W_Bits (Gnattest_T : in out Test); procedure Test_Get_W_Bits_ea9a74 (Gnattest_T : in out Test) renames Test_Get_W_Bits; -- id:2.2/ea9a74be9c46ca89/Get_W_Bits/1/0/ procedure Test_Get_W_Bits (Gnattest_T : in out Test) is -- dg_types.ads:118:5:Get_W_Bits -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Get_W_Bits; -- end read only -- begin read only procedure Test_Get_DW_Bits (Gnattest_T : in out Test); procedure Test_Get_DW_Bits_a2bf67 (Gnattest_T : in out Test) renames Test_Get_DW_Bits; -- id:2.2/a2bf6705dcb2799f/Get_DW_Bits/1/0/ procedure Test_Get_DW_Bits (Gnattest_T : in out Test) is -- dg_types.ads:119:5:Get_DW_Bits -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Get_DW_Bits; -- end read only -- begin read only procedure Test_Test_DW_Bit (Gnattest_T : in out Test); procedure Test_Test_DW_Bit_799079 (Gnattest_T : in out Test) renames Test_Test_DW_Bit; -- id:2.2/79907977bd025bc6/Test_DW_Bit/1/0/ procedure Test_Test_DW_Bit (Gnattest_T : in out Test) is -- dg_types.ads:120:5:Test_DW_Bit -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Test_DW_Bit; -- end read only -- begin read only procedure Test_Clear_QW_Bit (Gnattest_T : in out Test); procedure Test_Clear_QW_Bit_f212ea (Gnattest_T : in out Test) renames Test_Clear_QW_Bit; -- id:2.2/f212ea34daf43e93/Clear_QW_Bit/1/0/ procedure Test_Clear_QW_Bit (Gnattest_T : in out Test) is -- dg_types.ads:121:5:Clear_QW_Bit -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Clear_QW_Bit; -- end read only -- begin read only procedure Test_Set_QW_Bit (Gnattest_T : in out Test); procedure Test_Set_QW_Bit_1b4331 (Gnattest_T : in out Test) renames Test_Set_QW_Bit; -- id:2.2/1b4331029495556d/Set_QW_Bit/1/0/ procedure Test_Set_QW_Bit (Gnattest_T : in out Test) is -- dg_types.ads:122:5:Set_QW_Bit -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Set_QW_Bit; -- end read only -- begin read only procedure Test_Test_QW_Bit (Gnattest_T : in out Test); procedure Test_Test_QW_Bit_2ec078 (Gnattest_T : in out Test) renames Test_Test_QW_Bit; -- id:2.2/2ec07802eaff1dfc/Test_QW_Bit/1/0/ procedure Test_Test_QW_Bit (Gnattest_T : in out Test) is -- dg_types.ads:123:5:Test_QW_Bit -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Test_QW_Bit; -- end read only -- begin read only procedure Test_Get_Lower_Byte (Gnattest_T : in out Test); procedure Test_Get_Lower_Byte_2c7e4b (Gnattest_T : in out Test) renames Test_Get_Lower_Byte; -- id:2.2/2c7e4be0e15951e4/Get_Lower_Byte/1/0/ procedure Test_Get_Lower_Byte (Gnattest_T : in out Test) is -- dg_types.ads:126:5:Get_Lower_Byte -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Get_Lower_Byte; -- end read only -- begin read only procedure Test_Get_Upper_Byte (Gnattest_T : in out Test); procedure Test_Get_Upper_Byte_d89a4b (Gnattest_T : in out Test) renames Test_Get_Upper_Byte; -- id:2.2/d89a4b734d8093ff/Get_Upper_Byte/1/0/ procedure Test_Get_Upper_Byte (Gnattest_T : in out Test) is -- dg_types.ads:127:5:Get_Upper_Byte -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Get_Upper_Byte; -- end read only -- begin read only procedure Test_Swap_Bytes (Gnattest_T : in out Test); procedure Test_Swap_Bytes_7d46a7 (Gnattest_T : in out Test) renames Test_Swap_Bytes; -- id:2.2/7d46a7da5fb7f014/Swap_Bytes/1/0/ procedure Test_Swap_Bytes (Gnattest_T : in out Test) is -- dg_types.ads:128:5:Swap_Bytes -- end read only pragma Unreferenced (Gnattest_T); WD : Word_T := 16#1122#; begin AUnit.Assertions.Assert (Swap_Bytes(WD) = 16#2211#, "Byte swap error."); -- begin read only end Test_Swap_Bytes; -- end read only -- begin read only procedure Test_Get_Bytes_From_Word (Gnattest_T : in out Test); procedure Test_Get_Bytes_From_Word_075975 (Gnattest_T : in out Test) renames Test_Get_Bytes_From_Word; -- id:2.2/075975fd1f9f3187/Get_Bytes_From_Word/1/0/ procedure Test_Get_Bytes_From_Word (Gnattest_T : in out Test) is -- dg_types.ads:129:5:Get_Bytes_From_Word -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Get_Bytes_From_Word; -- end read only -- begin read only procedure Test_Word_From_Bytes (Gnattest_T : in out Test); procedure Test_Word_From_Bytes_ea4510 (Gnattest_T : in out Test) renames Test_Word_From_Bytes; -- id:2.2/ea45105dc52ddee5/Word_From_Bytes/1/0/ procedure Test_Word_From_Bytes (Gnattest_T : in out Test) is -- dg_types.ads:130:5:Word_From_Bytes -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Word_From_Bytes; -- end read only -- begin read only procedure Test_Byte_To_String (Gnattest_T : in out Test); procedure Test_Byte_To_String_d93915 (Gnattest_T : in out Test) renames Test_Byte_To_String; -- id:2.2/d93915cf2befb78d/Byte_To_String/1/0/ procedure Test_Byte_To_String (Gnattest_T : in out Test) is -- dg_types.ads:131:5:Byte_To_String -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Byte_To_String; -- end read only -- begin read only procedure Test_Low_Byte_To_Char (Gnattest_T : in out Test); procedure Test_Low_Byte_To_Char_00e4b2 (Gnattest_T : in out Test) renames Test_Low_Byte_To_Char; -- id:2.2/00e4b210debe9611/Low_Byte_To_Char/1/0/ procedure Test_Low_Byte_To_Char (Gnattest_T : in out Test) is -- dg_types.ads:137:5:Low_Byte_To_Char -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Low_Byte_To_Char; -- end read only -- begin read only procedure Test_Byte_Arr_To_Unbounded (Gnattest_T : in out Test); procedure Test_Byte_Arr_To_Unbounded_8c1bb0 (Gnattest_T : in out Test) renames Test_Byte_Arr_To_Unbounded; -- id:2.2/8c1bb0c360a7942b/Byte_Arr_To_Unbounded/1/0/ procedure Test_Byte_Arr_To_Unbounded (Gnattest_T : in out Test) is -- dg_types.ads:138:5:Byte_Arr_To_Unbounded -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Byte_Arr_To_Unbounded; -- end read only -- begin read only procedure Test_Get_Data_Sensitive_Portion (Gnattest_T : in out Test); procedure Test_Get_Data_Sensitive_Portion_2234ef (Gnattest_T : in out Test) renames Test_Get_Data_Sensitive_Portion; -- id:2.2/2234ef7c745ecf5f/Get_Data_Sensitive_Portion/1/0/ procedure Test_Get_Data_Sensitive_Portion (Gnattest_T : in out Test) is -- dg_types.ads:139:5:Get_Data_Sensitive_Portion -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Get_Data_Sensitive_Portion; -- end read only -- begin read only procedure Test_Word_To_String (Gnattest_T : in out Test); procedure Test_Word_To_String_8605e3 (Gnattest_T : in out Test) renames Test_Word_To_String; -- id:2.2/8605e33cdf6d5df8/Word_To_String/1/0/ procedure Test_Word_To_String (Gnattest_T : in out Test) is -- dg_types.ads:142:5:Word_To_String -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Word_To_String; -- end read only -- begin read only procedure Test_Lower_Word (Gnattest_T : in out Test); procedure Test_Lower_Word_3da74d (Gnattest_T : in out Test) renames Test_Lower_Word; -- id:2.2/3da74da3a565e72e/Lower_Word/1/0/ procedure Test_Lower_Word (Gnattest_T : in out Test) is -- dg_types.ads:149:5:Lower_Word -- end read only pragma Unreferenced (Gnattest_T); DW : Dword_T := 16#11223344#; begin AUnit.Assertions.Assert (Lower_Word(DW) = 16#3344#, "Lower_Word wrong"); -- begin read only end Test_Lower_Word; -- end read only -- begin read only procedure Test_Upper_Word (Gnattest_T : in out Test); procedure Test_Upper_Word_05c493 (Gnattest_T : in out Test) renames Test_Upper_Word; -- id:2.2/05c4935ae3cbbbf7/Upper_Word/1/0/ procedure Test_Upper_Word (Gnattest_T : in out Test) is -- dg_types.ads:150:5:Upper_Word -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Upper_Word(16#11223344#) = 16#1122#, "Upper_Word failed"); -- begin read only end Test_Upper_Word; -- end read only -- begin read only procedure Test_Dword_From_Two_Words (Gnattest_T : in out Test); procedure Test_Dword_From_Two_Words_3c389f (Gnattest_T : in out Test) renames Test_Dword_From_Two_Words; -- id:2.2/3c389fe54f92a263/Dword_From_Two_Words/1/0/ procedure Test_Dword_From_Two_Words (Gnattest_T : in out Test) is -- dg_types.ads:151:5:Dword_From_Two_Words -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Dword_From_Two_Words; -- end read only -- begin read only procedure Test_Dword_To_String (Gnattest_T : in out Test); procedure Test_Dword_To_String_55061d (Gnattest_T : in out Test) renames Test_Dword_To_String; -- id:2.2/55061dad65fd6556/Dword_To_String/1/0/ procedure Test_Dword_To_String (Gnattest_T : in out Test) is -- dg_types.ads:152:5:Dword_To_String -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Dword_To_String; -- end read only -- begin read only procedure Test_String_To_Dword (Gnattest_T : in out Test); procedure Test_String_To_Dword_3c5214 (Gnattest_T : in out Test) renames Test_String_To_Dword; -- id:2.2/3c52147c1eb36d6a/String_To_Dword/1/0/ procedure Test_String_To_Dword (Gnattest_T : in out Test) is -- dg_types.ads:158:5:String_To_Dword -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_String_To_Dword; -- end read only -- begin read only procedure Test_Sext_Word_To_Dword (Gnattest_T : in out Test); procedure Test_Sext_Word_To_Dword_45b429 (Gnattest_T : in out Test) renames Test_Sext_Word_To_Dword; -- id:2.2/45b429bd73d9b9ab/Sext_Word_To_Dword/1/0/ procedure Test_Sext_Word_To_Dword (Gnattest_T : in out Test) is -- dg_types.ads:159:5:Sext_Word_To_Dword -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Sext_Word_To_Dword; -- end read only -- begin read only procedure Test_Lower_Dword (Gnattest_T : in out Test); procedure Test_Lower_Dword_d008b0 (Gnattest_T : in out Test) renames Test_Lower_Dword; -- id:2.2/d008b0b4e18ac86d/Lower_Dword/1/0/ procedure Test_Lower_Dword (Gnattest_T : in out Test) is -- dg_types.ads:162:5:Lower_Dword -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Lower_Dword; -- end read only -- begin read only procedure Test_Upper_Dword (Gnattest_T : in out Test); procedure Test_Upper_Dword_1042da (Gnattest_T : in out Test) renames Test_Upper_Dword; -- id:2.2/1042da3a021bee1e/Upper_Dword/1/0/ procedure Test_Upper_Dword (Gnattest_T : in out Test) is -- dg_types.ads:163:5:Upper_Dword -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Upper_Dword; -- end read only -- begin read only procedure Test_Qword_From_Two_Dwords (Gnattest_T : in out Test); procedure Test_Qword_From_Two_Dwords_e0cb2c (Gnattest_T : in out Test) renames Test_Qword_From_Two_Dwords; -- id:2.2/e0cb2ccaa3d68d7d/Qword_From_Two_Dwords/1/0/ procedure Test_Qword_From_Two_Dwords (Gnattest_T : in out Test) is -- dg_types.ads:164:5:Qword_From_Two_Dwords -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Qword_From_Two_Dwords; -- end read only -- begin read only procedure Test_Int_To_String (Gnattest_T : in out Test); procedure Test_Int_To_String_506364 (Gnattest_T : in out Test) renames Test_Int_To_String; -- id:2.2/506364fd134f9088/Int_To_String/1/0/ procedure Test_Int_To_String (Gnattest_T : in out Test) is -- dg_types.ads:168:5:Int_To_String -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Int_To_String; -- end read only -- begin read only procedure Test_String_To_Integer (Gnattest_T : in out Test); procedure Test_String_To_Integer_fdacf8 (Gnattest_T : in out Test) renames Test_String_To_Integer; -- id:2.2/fdacf80ee5f11633/String_To_Integer/1/0/ procedure Test_String_To_Integer (Gnattest_T : in out Test) is -- dg_types.ads:175:5:String_To_Integer -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_String_To_Integer; -- end read only -- begin read only procedure Test_Decode_Dec_Data_Type (Gnattest_T : in out Test); procedure Test_Decode_Dec_Data_Type_056a82 (Gnattest_T : in out Test) renames Test_Decode_Dec_Data_Type; -- id:2.2/056a821434fb65a9/Decode_Dec_Data_Type/1/0/ procedure Test_Decode_Dec_Data_Type (Gnattest_T : in out Test) is -- dg_types.ads:178:5:Decode_Dec_Data_Type -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Decode_Dec_Data_Type; -- end read only -- begin read only procedure Test_Read_Decimal (Gnattest_T : in out Test); procedure Test_Read_Decimal_385668 (Gnattest_T : in out Test) renames Test_Read_Decimal; -- id:2.2/385668536c3d7938/Read_Decimal/1/0/ procedure Test_Read_Decimal (Gnattest_T : in out Test) is -- dg_types.ads:182:5:Read_Decimal -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Read_Decimal; -- end read only -- begin read only procedure Test_DG_Double_To_Long_Float (Gnattest_T : in out Test); procedure Test_DG_Double_To_Long_Float_2d8c8f (Gnattest_T : in out Test) renames Test_DG_Double_To_Long_Float; -- id:2.2/2d8c8ff77fd9dc46/DG_Double_To_Long_Float/1/0/ procedure Test_DG_Double_To_Long_Float (Gnattest_T : in out Test) is -- dg_types.ads:185:5:DG_Double_To_Long_Float -- end read only pragma Unreferenced (Gnattest_T); DG_Dbl : Double_Overlay; begin DG_Dbl.Double_QW := 0; AUnit.Assertions.Assert (DG_Double_To_Long_Float(DG_Dbl) = 0.0, "DG Dbl to LF - Zero conversion error."); -- Example from https://en.wikipedia.org/wiki/IBM_hexadecimal_floating-point DG_Dbl.Double_QW := 2#1_100_0010_0111_0110_1010_0000_0000_0000_00000000_00000000_00000000_00000000#; AUnit.Assertions.Assert (DG_Double_To_Long_Float(DG_Dbl) = (-118.625), "DG Dbl to LF - Known value conversion error."); -- begin read only end Test_DG_Double_To_Long_Float; -- end read only -- begin read only procedure Test_DG_Single_To_Long_Float (Gnattest_T : in out Test); procedure Test_DG_Single_To_Long_Float_aba5b2 (Gnattest_T : in out Test) renames Test_DG_Single_To_Long_Float; -- id:2.2/aba5b2674e990076/DG_Single_To_Long_Float/1/0/ procedure Test_DG_Single_To_Long_Float (Gnattest_T : in out Test) is -- dg_types.ads:186:5:DG_Single_To_Long_Float -- end read only pragma Unreferenced (Gnattest_T); DW : Dword_T := 0; begin AUnit.Assertions.Assert (DG_Single_To_Long_Float(DW) = 0.0, "DG Single to LF - Zero conversion error."); DW := 2#1_100_0010_0111_0110_1010_0000_0000_0000#; AUnit.Assertions.Assert (DG_Single_To_Long_Float(DW) = (-118.625), "DG Single to LF - Known value conversion error."); -- begin read only end Test_DG_Single_To_Long_Float; -- end read only -- begin read only procedure Test_Long_Float_To_DG_Double (Gnattest_T : in out Test); procedure Test_Long_Float_To_DG_Double_8175dc (Gnattest_T : in out Test) renames Test_Long_Float_To_DG_Double; -- id:2.2/8175dc59a873cf72/Long_Float_To_DG_Double/1/0/ procedure Test_Long_Float_To_DG_Double (Gnattest_T : in out Test) is -- dg_types.ads:187:5:Long_Float_To_DG_Double -- end read only pragma Unreferenced (Gnattest_T); LF : Long_Float := 0.0; QW : Qword_T; begin QW := Long_Float_To_DG_Double(LF); AUnit.Assertions.Assert (QW = 0, "LF to DG - Zero conversion error"); LF := (-118.625); QW := Long_Float_To_DG_Double(LF); AUnit.Assertions.Assert (QW = 2#1_100_0010_0111_0110_1010_0000_0000_0000_00000000_00000000_00000000_00000000#, "LF to DG Dbl - known value conversion error"); -- begin read only end Test_Long_Float_To_DG_Double; -- end read only -- begin read only procedure Test_Long_Float_To_DG_Single (Gnattest_T : in out Test); procedure Test_Long_Float_To_DG_Single_d6dcc8 (Gnattest_T : in out Test) renames Test_Long_Float_To_DG_Single; -- id:2.2/d6dcc823ca3962be/Long_Float_To_DG_Single/1/0/ procedure Test_Long_Float_To_DG_Single (Gnattest_T : in out Test) is -- dg_types.ads:188:5:Long_Float_To_DG_Single -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Long_Float_To_DG_Single; -- end read only -- begin read only procedure Test_Byte_To_Integer_8 (Gnattest_T : in out Test); procedure Test_Byte_To_Integer_8_6ac9f0 (Gnattest_T : in out Test) renames Test_Byte_To_Integer_8; -- id:2.2/6ac9f0ecd0d28fa6/Byte_To_Integer_8/1/0/ procedure Test_Byte_To_Integer_8 (Gnattest_T : in out Test) is -- dg_types.ads:191:5:Byte_To_Integer_8 -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Byte_To_Integer_8; -- end read only -- begin read only procedure Test_Char_To_Byte (Gnattest_T : in out Test); procedure Test_Char_To_Byte_11390e (Gnattest_T : in out Test) renames Test_Char_To_Byte; -- id:2.2/11390e3d9572d1a6/Char_To_Byte/1/0/ procedure Test_Char_To_Byte (Gnattest_T : in out Test) is -- dg_types.ads:192:5:Char_To_Byte -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Char_To_Byte; -- end read only -- begin read only procedure Test_Byte_To_Char (Gnattest_T : in out Test); procedure Test_Byte_To_Char_7742da (Gnattest_T : in out Test) renames Test_Byte_To_Char; -- id:2.2/7742da8507778a8d/Byte_To_Char/1/0/ procedure Test_Byte_To_Char (Gnattest_T : in out Test) is -- dg_types.ads:193:5:Byte_To_Char -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Byte_To_Char; -- end read only -- begin read only procedure Test_Dword_To_Integer_32 (Gnattest_T : in out Test); procedure Test_Dword_To_Integer_32_e9169d (Gnattest_T : in out Test) renames Test_Dword_To_Integer_32; -- id:2.2/e9169d27b9e53e9c/Dword_To_Integer_32/1/0/ procedure Test_Dword_To_Integer_32 (Gnattest_T : in out Test) is -- dg_types.ads:194:5:Dword_To_Integer_32 -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Dword_To_Integer_32; -- end read only -- begin read only procedure Test_Dword_To_Integer (Gnattest_T : in out Test); procedure Test_Dword_To_Integer_bb8284 (Gnattest_T : in out Test) renames Test_Dword_To_Integer; -- id:2.2/bb8284dfb5eecd69/Dword_To_Integer/1/0/ procedure Test_Dword_To_Integer (Gnattest_T : in out Test) is -- dg_types.ads:195:5:Dword_To_Integer -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Dword_To_Integer; -- end read only -- begin read only procedure Test_Integer_32_To_Dword (Gnattest_T : in out Test); procedure Test_Integer_32_To_Dword_67c35b (Gnattest_T : in out Test) renames Test_Integer_32_To_Dword; -- id:2.2/67c35b0907b09678/Integer_32_To_Dword/1/0/ procedure Test_Integer_32_To_Dword (Gnattest_T : in out Test) is -- dg_types.ads:196:5:Integer_32_To_Dword -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Integer_32_To_Dword; -- end read only -- begin read only procedure Test_Integer_32_To_Phys (Gnattest_T : in out Test); procedure Test_Integer_32_To_Phys_0e179b (Gnattest_T : in out Test) renames Test_Integer_32_To_Phys; -- id:2.2/0e179b57ce953892/Integer_32_To_Phys/1/0/ procedure Test_Integer_32_To_Phys (Gnattest_T : in out Test) is -- dg_types.ads:197:5:Integer_32_To_Phys -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Integer_32_To_Phys; -- end read only -- begin read only procedure Test_Word_To_Integer_16 (Gnattest_T : in out Test); procedure Test_Word_To_Integer_16_a3a65b (Gnattest_T : in out Test) renames Test_Word_To_Integer_16; -- id:2.2/a3a65b382bb1e065/Word_To_Integer_16/1/0/ procedure Test_Word_To_Integer_16 (Gnattest_T : in out Test) is -- dg_types.ads:198:5:Word_To_Integer_16 -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Word_To_Integer_16; -- end read only -- begin read only procedure Test_Integer_16_To_Word (Gnattest_T : in out Test); procedure Test_Integer_16_To_Word_40bf8b (Gnattest_T : in out Test) renames Test_Integer_16_To_Word; -- id:2.2/40bf8b3b3af6c36c/Integer_16_To_Word/1/0/ procedure Test_Integer_16_To_Word (Gnattest_T : in out Test) is -- dg_types.ads:199:5:Integer_16_To_Word -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Integer_16_To_Word; -- end read only -- begin read only procedure Test_Word_To_Unsigned_16 (Gnattest_T : in out Test); procedure Test_Word_To_Unsigned_16_d3e005 (Gnattest_T : in out Test) renames Test_Word_To_Unsigned_16; -- id:2.2/d3e00505fea693e8/Word_To_Unsigned_16/1/0/ procedure Test_Word_To_Unsigned_16 (Gnattest_T : in out Test) is -- dg_types.ads:200:5:Word_To_Unsigned_16 -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Word_To_Unsigned_16; -- end read only -- begin read only procedure Test_Integer_64_To_Unsigned_64 (Gnattest_T : in out Test); procedure Test_Integer_64_To_Unsigned_64_f5c627 (Gnattest_T : in out Test) renames Test_Integer_64_To_Unsigned_64; -- id:2.2/f5c627cc3d2eb8ab/Integer_64_To_Unsigned_64/1/0/ procedure Test_Integer_64_To_Unsigned_64 (Gnattest_T : in out Test) is -- dg_types.ads:201:5:Integer_64_To_Unsigned_64 -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Integer_64_To_Unsigned_64; -- end read only -- begin read only procedure Test_Unsigned_32_To_Integer (Gnattest_T : in out Test); procedure Test_Unsigned_32_To_Integer_5e891f (Gnattest_T : in out Test) renames Test_Unsigned_32_To_Integer; -- id:2.2/5e891fba56f59941/Unsigned_32_To_Integer/1/0/ procedure Test_Unsigned_32_To_Integer (Gnattest_T : in out Test) is -- dg_types.ads:202:5:Unsigned_32_To_Integer -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Unsigned_32_To_Integer; -- end read only -- begin read only procedure Test_Integer_To_Unsigned_64 (Gnattest_T : in out Test); procedure Test_Integer_To_Unsigned_64_d5b49e (Gnattest_T : in out Test) renames Test_Integer_To_Unsigned_64; -- id:2.2/d5b49ec53f6693eb/Integer_To_Unsigned_64/1/0/ procedure Test_Integer_To_Unsigned_64 (Gnattest_T : in out Test) is -- dg_types.ads:203:5:Integer_To_Unsigned_64 -- end read only pragma Unreferenced (Gnattest_T); begin AUnit.Assertions.Assert (Gnattest_Generated.Default_Assert_Value, "Test not implemented."); -- begin read only end Test_Integer_To_Unsigned_64; -- end read only -- begin read only -- id:2.2/02/ -- -- This section can be used to add elaboration code for the global state. -- begin -- end read only null; -- begin read only -- end read only end DG_Types.Test_Data.Tests;
programs/oeis/097/A097693.asm
neoneye/loda
22
105511
<reponame>neoneye/loda ; A097693: Largest achievable determinant of a 3 X 3 matrix whose elements are 9 distinct integers chosen from the range -n...n. ; 86,216,438,776,1254,1896,2726,3768,5046,6584,8406,10536,12998,15816,19014,22616,26646,31128,36086,41544,47526,54056,61158,68856,77174,86136,95766,106088,117126,128904,141446,154776,168918,183896,199734 add $0,2 mov $1,$0 mul $0,2 add $0,1 bin $0,2 add $1,2 mul $1,$0 mov $0,$1 add $0,3 mul $0,2
instructions.asm
AleffCorrea/BrickBreaker
4
80310
<reponame>AleffCorrea/BrickBreaker<filename>instructions.asm ;instructions.asm Instruction0_StateMachine: .db OPC_RAMWrite .dw INSTRUCT_SYNC .db 0 .db OPC_DrawSquare, $40, 32, 30 .dw $2000 .db OPC_Delay, 60 .db OPC_ScreenOff .db OPC_DrawRLEBurst .dw $2000, bg_Playfield .db OPC_ScreenOn .db OPC_RAMWrite .dw INSTRUCT_SYNC .db INSTRUCT_AIM1 .db OPC_DrawString .dw $220A, Match_Instructions1 .db OPC_Delay, 150 .db OPC_DrawString .dw $22AE, Match_Instructions2 .db OPC_RAMWrite .dw INSTRUCT_SYNC .db INSTRUCT_AIM2 .db OPC_Delay, 250 .db OPC_DrawString .dw $22A7, Match_Instructions3 .db OPC_RAMWrite .dw INSTRUCT_SYNC .db INSTRUCT_AIM3 .db OPC_Delay, 150 .db OPC_DrawSquare, $20, 28, 2 .dw $22A2 .db OPC_DrawString .dw $22A7, Match_Instructions4 .db OPC_Delay, 150 .db OPC_DrawSquare, $20, 28, 1 .dw $22A2 .db OPC_RAMWrite .dw INSTRUCT_SYNC .db INSTRUCT_FIRE .db OPC_Delay, 45 .db OPC_RAMWrite .dw INSTRUCT_SYNC .db INSTRUCT_KILLBALL .db OPC_Delay, 10 .db OPC_DrawString .dw $22C5, Match_Instructions5 .db OPC_Delay, 225 .db OPC_DrawSquare, $20, 28, 2 .dw $22C2 .db OPC_DrawString .dw $22C5, Text_GoodLuck .db OPC_Delay, 250 .db OPC_RAMWrite .dw INSTRUCT_SYNC .db INSTRUCT_END .db OPC_Halt State_Instructions_Init: LDX #LOW(Instruction0_StateMachine) LDY #HIGH(Instruction0_StateMachine) JSR State_Interpreter_Init JSR CollisionMap_DefaultBorder RTS State_Instructions: .Skip LDA CTRLPORT_1 AND #CTRL_START BEQ .check LDA OLDCTRL_1 AND #CTRL_START BNE .check JMP .gotogame .check JSR State_Interpreter LDA INSTRUCT_SYNC CMP #INSTRUCT_AIM1 BEQ .INSERT1 CMP #INSTRUCT_AIM2 BEQ .INSERT2 CMP #INSTRUCT_AIM3 BEQ .INSERT3 CMP #INSTRUCT_FIRE BEQ .INSERT4 CMP #INSTRUCT_KILLBALL BNE .exit JMP .INSERT5 .exit CMP #INSTRUCT_END BNE .exit2 JMP .gotogame .exit2 .exit3: RTS .INSERT1 LDX #$70 LDY #$C8 LDA #OBJ_STATIC JSR ObjectList_Insert LDA #3 STA OBJ_METASPRITE, x LDX #$78 LDY #$BC LDA #OBJ_STATIC JSR ObjectList_Insert LDA #15 STA OBJ_METASPRITE, x STX INSTRUCT_BALL LDX #$78 LDY #$C0 LDA #OBJ_STATIC JSR ObjectList_Insert LDA #10 STA OBJ_METASPRITE, x LDA #0 STA INSTRUCT_SYNC RTS .INSERT2 LDX #$78 LDY #$BC LDA #OBJ_STATIC JSR ObjectList_Insert LDA #14 STA OBJ_METASPRITE, x STX INSTRUCT_ARROWS LDA #0 STA INSTRUCT_SYNC RTS .INSERT3 LDX INSTRUCT_ARROWS LDA #13 STA OBJ_METASPRITE, x LDA #0 STA INSTRUCT_SYNC RTS .INSERT4 LDX INSTRUCT_BALL JSR ObjectList_Remove LDX INSTRUCT_ARROWS JSR ObjectList_Remove LDX #$78 LDY #$BC LDA #OBJ_BALL JSR ObjectList_Insert STX INSTRUCT_BALL LDA #2 STA BALL_SPEED, x LDA #ANGLE_225 STA BALL_ANGLE, x LDA #0 STA INSTRUCT_SYNC RTS .INSERT5 LDX INSTRUCT_BALL JSR ObjectList_Remove LDA #0 STA INSTRUCT_SYNC RTS .gotogame LDA #1 STA MATCH_LEVEL LDA #STATE_GAME JSR GameState_Change RTS
basic/07_konstant/konstant.asm
bellshade/Assembly
6
25819
SYS_EXIT EQU 1 SYS_WRITE EQU 4 STDIN EQU 0 STDOUT EQU 1 section .text global _start _start: mov eax, SYS_WRITE mov ebx, STDOUT mov ecx, pesan1 mov edx, panjang_pesan1 int 0x80 mov eax, SYS_WRITE mov ebx, STDOUT mov ecx, pesan2 mov edx, panjang_pesan2 int 0x80 mov eax, SYS_WRITE mov ebx, STDOUT mov ecx, pesan3 mov edx, panjang_pesan3 int 0x80 mov eax, SYS_EXIT int 0x80 section .data pesan1 db 'indonesia raya', 0xA, 0xD panjang_pesan1 equ $ - pesan1 pesan2 db 'merdeka merdeka', 0xA, 0xD panjang_pesan2 equ $ - pesan2 pesan3 db 'hiduplah indonesia raya' panjang_pesan3 equ $ - pesan3
oeis/286/A286865.asm
neoneye/loda-programs
11
160352
<filename>oeis/286/A286865.asm ; A286865: Decimal representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 814", based on the 5-celled von Neumann neighborhood. ; 1,1,1,1,3,3,3,3,15,15,15,15,15,15,15,15,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295 pow $0,2 mov $1,4 mov $2,2 lpb $0 div $0,$1 sub $0,3 pow $2,2 lpe mov $0,$2 sub $0,1
libsrc/_DEVELOPMENT/string/z80/asm_memmem.asm
Toysoft/z88dk
8
12481
<filename>libsrc/_DEVELOPMENT/string/z80/asm_memmem.asm ; =============================================================== ; Dec 2013 ; =============================================================== ; ; void *memmem(const void *big, size_t big_len, const void *little, size_t little_len) ; ; Return ptr in big to first occurrence of substring little. ; ; If little_len = 0, returns big (differs from macox but ; consistent with strstr). ; ; If big_len == 0 or big_len < little_len or substring little ; is not found in big, returns NULL. ; ; =============================================================== SECTION code_clib SECTION code_string PUBLIC asm_memmem EXTERN error_zc asm_memmem: ; enter : ix = void *big (search string) ; de = void *little (substring) ; hl = big_len ; bc = little_len ; ; exit : de = void *little (substring) ; ; substring found ; ; carry reset ; hl = ptr in big to matched substring ; ; substring not found ; ; carry set ; hl = 0 ; ; uses : af, bc, hl, ix or a sbc hl,bc jp c, error_zc ; if big_len < little_len, not found inc hl ; hl = num positions in big to check ld a,b or c ; little_len == 0? .... dec bc ; bc = little_len - 1 push ix ; save big push bc pop ix ; ix = little_len - 1 ld c,l ld b,h ; bc = num positions to check pop hl ; hl = big ret z ; .... little_len == 0 means match search_loop: ; hl = big ; de = little ; bc = num positions to check ; ix = little_len - 1 ld a,(de) ; a = first little char cpir ; look for little char in big jp nz, error_zc ; not found push hl push bc push de ; hl = big (2nd char of substring match) ; de = little ; ix = little_len - 1 ; stack = big (2nd char of substring match), num positions to check, little push ix pop bc ld a,b or c jr z, found match_substring: inc de ld a,(de) cpi jr nz, no_match jp pe, match_substring found: pop de pop bc pop hl dec hl ret no_match: pop de pop bc pop hl ; hl = big (next char to examine) ; de = little ; bc = num positions to check ; ix = little_len - 1 ld a,b or c jr nz, search_loop not_found: jp error_zc
demo/tutorial/tutorial.adb
csb6/libtcod-ada
0
9660
with Engines, Libtcod.Console; use Libtcod; procedure Tutorial is screen_width : constant := 80; screen_height : constant := 50; context : Console.Context := Console.make_context(screen_width, screen_height, "Libtcod Ada Tutorial"); screen : Console.Screen := Console.make_screen(screen_width, screen_height); engine : Engines.Engine := Engines.make_engine(screen_width, screen_height); begin while not Console.is_window_closed and engine.status not in Engines.Endgame_Status loop engine.update; engine.render(screen); context.present(screen); end loop; end Tutorial;
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/mak/kart-drive-e.asm
prismotizm/gigaleak
0
25558
<filename>other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/mak/kart-drive-e.asm Name: kart-drive-e.asm Type: file Size: 39067 Last-Modified: '1992-11-18T01:08:32Z' SHA-1: B531055F255B01E0A0756F5CB342506E7BB94CB1 Description: null
mat/src/mat-formats.ads
stcarrez/mat
7
29118
<gh_stars>1-10 ----------------------------------------------------------------------- -- mat-formats - Format various types for the console or GUI interface -- Copyright (C) 2015 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with MAT.Types; with MAT.Memory; with MAT.Events.Tools; package MAT.Formats is type Format_Type is (BRIEF, NORMAL); -- Set the size of a target address to format them. procedure Set_Address_Size (Size : in Positive); -- Format the PID into a string. function Pid (Value : in MAT.Types.Target_Process_Ref) return String; -- Format the address into a string. function Addr (Value : in MAT.Types.Target_Addr) return String; -- Format the size into a string. function Size (Value : in MAT.Types.Target_Size) return String; -- Format the memory growth size into a string. function Size (Alloced : in MAT.Types.Target_Size; Freed : in MAT.Types.Target_Size) return String; -- Format the time relative to the start time. function Time (Value : in MAT.Types.Target_Tick_Ref; Start : in MAT.Types.Target_Tick_Ref) return String; -- Format the duration in seconds, milliseconds or microseconds. function Duration (Value : in MAT.Types.Target_Tick_Ref) return String; -- Format a file, line, function information into a string. function Location (File : in Ada.Strings.Unbounded.Unbounded_String; Line : in Natural; Func : in Ada.Strings.Unbounded.Unbounded_String) return String; -- Format an event range description. function Event (First : in MAT.Events.Target_Event_Type; Last : in MAT.Events.Target_Event_Type) return String; -- Format a short description of the event. function Event (Item : in MAT.Events.Target_Event_Type; Mode : in Format_Type := NORMAL) return String; -- Format a short description of the event. function Event (Item : in MAT.Events.Target_Event_Type; Related : in MAT.Events.Tools.Target_Event_Vector; Start_Time : in MAT.Types.Target_Tick_Ref) return String; -- Format the difference between two event IDs (offset). function Offset (First : in MAT.Events.Event_Id_Type; Second : in MAT.Events.Event_Id_Type) return String; -- Format a short description of the memory allocation slot. function Slot (Value : in MAT.Types.Target_Addr; Item : in MAT.Memory.Allocation; Start_Time : in MAT.Types.Target_Tick_Ref) return String; end MAT.Formats;
4th SEM/MICROPROCESSOR AND MICROCONTROLLER LABORATORY - XXCSL48/LAB5b.asm
AbhishekMali21/VTU-CSE-ISE-LAB-SOLUTIONS
80
7439
<gh_stars>10-100 .MODEL small .STACK 100h .DATA messl DB 10, 13, 'Today is $' ; 1041, 13=CR .CODE Today PROC MOV AX, @data MOV DS, AX MOV DX, OFFSET messl MOV AH, 09h INT 21H MOV AH,2AH INT 21H PUSH CX MOV CX,0 MOV CL, DL PUSH CX MOV CL,DH PUSH CX MOV DH, 0 ;DISPLAY MONTH MOV DX, 0 POP AX MOV CX,0 MOV BX,10 DIVIDEM:DIV BX PUSH DX ADD CX,1 MOV DX, 0 CMP AX, 0 JNE DIVIDEM DIVDISPM:POP DX ADD DL,30h MOV AH, 02h INT 21H LOOP DIVDISPM MOV DL,'/' MOV AH,02h INT 21H ;DISPLAY DAY MOV DX, 0 POP AX MOV CX,0 MOV BX,10 DIVIDED:DIV BX PUSH DX ADD CX,1 MOV DX,0 CMP AX,0 JNE DIVIDED DIVDISPD:POP DX ADD DL,30H MOV AH,02H INT 21H LOOP DIVDISPD MOV DL,'/' MOV AH,02H INT 21H ;DISPLAY YEAR MOV DX,0 POP AX MOV CX,0 MOV BX,10 DIVIDEY:DIV BX PUSH DX ADD CX,1 MOV DX,0 CMP AX,0 JNE DIVIDEY DIVDISPY:POP DX ADD DL,30H MOV AH,02H INT 21H LOOP DIVDISPY MOV AL,0 MOV AH,4CH INT 21H TODAY ENDP END TODAY
oeis/063/A063205.asm
neoneye/loda-programs
11
7066
; A063205: Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 29 ). ; Submitted by <NAME>(s3) ; 2,7,11,17,21,25,31,35,39,45,49,53,59,63,67,73,77,81,87,91,95,101,105,109,115,119,123,129,133,137,143,147,151,157,161,165,171,175,179,185,189,193,199,203,207,213,217,221,227,231,235,241,245,249,255,259,263,269,273,277,283,287,291,297,301,305,311,315,319,325,329,333,339,343,347,353,357,361,367,371,375,381,385,389,395,399,403,409,413,417,423,427,431,437,441,445,451,455,459,465 mul $0,2 mov $2,7 mul $2,$0 sub $0,1 mod $0,3 mul $0,2 add $0,$2 div $0,3 add $0,2
source/RASCAL-WimpWindow.ads
bracke/Meaning
0
24318
-------------------------------------------------------------------------------- -- -- -- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers. -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU Lesser General Public -- -- License as published by the Free Software Foundation; either -- -- version 2.1 of the License, or (at your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- Lesser General Public License for more details. -- -- -- -- You should have received a copy of the GNU Lesser General Public -- -- License along with this library; if not, write to the Free Software -- -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- -------------------------------------------------------------------------------- -- @brief Wimp Window related types and methods. -- $Author$ -- $Date$ -- $Revision$ with Interfaces.C; use Interfaces.C; with RASCAL.OS; use RASCAL.OS; with RASCAL.Memory; use RASCAL.Memory; package RASCAL.WimpWindow is -- -- This message is broadcast by the Wimp when a window's close icon is shift clicked. --If an iconiser is absent nothing will happen. --If one is present it will acknowledge the message, and send Message_WindowInfo to the window. -- type Message_Iconize is record Header : Message_Event_Header; Window : Wimp_Handle_Type; Task_Handle : Integer; Title : Char_Array(1..20); end record; pragma Convention (C, Message_Iconize); type Message_Iconize_Pointer is access Message_Iconize; type AMEL_Message_Iconize is abstract new Message_EventListener(Message_Event_Iconize) with record Event : Message_Iconize_Pointer; end record; -- -- In the absence of this message, Pinboard will just position the window icon beneath the window's close button. -- type Message_IconizeAt is record Header : Message_Event_Header; Window : Wimp_Handle_Type; Task_Handle : Integer; X_Coordinate : Integer; Y_Coordinate : Integer; Flags : Integer; end record; pragma Convention (C, Message_IconizeAt); type Message_IconizeAt_Pointer is access Message_IconizeAt; type AMEL_Message_IconizeAt is abstract new Message_EventListener(Message_Event_IconizeAt) with record Event : Message_IconizeAt_Pointer; end record; -- -- This message is bradcasted when a window is closed, so that the iconiser can remove the icon. -- type Message_WindowClosed is record Header : Message_Event_Header; Window : Wimp_Handle_Type; end record; pragma Convention (C, Message_WindowClosed); type Message_WindowClosed_Pointer is access Message_WindowClosed; type AMEL_Message_WindowClosed is abstract new Message_EventListener(Message_Event_WindowClosed) with record Event : Message_WindowClosed_Pointer; end record; -- -- This message is sent by the iconiser when one of your windows is iconised, to find out which sprite and name to give to the icon. -- type Message_WindowInfo is record Header : Message_Event_Header; Window : Wimp_Handle_Type; Reserved : Integer; Sprite_Name : Char_Array(1..8); Title : Char_Array(1..200); end record; pragma Convention (C, Message_WindowInfo); type Message_WindowInfo_Pointer is access Message_WindowInfo; type AMEL_Message_WindowInfo is abstract new Message_EventListener(Message_Event_WindowInfo) with record Event : Message_WindowInfo_Pointer; end record; type Wimp_Icon_Data is record Min_X : Integer; Min_Y : Integer; Max_X : Integer; Max_Y : Integer; Icon_Flags: Integer; Icon_Data : Char_Array(1..12); end record; pragma Convention (C, Wimp_Icon_Data); type Double_Byte is mod 2**16; type Wimp_Title_Data is record Title_Data : Char_Array(1..12); end record; pragma Convention (C, Wimp_Title_Data); type Wimp_Window_Block_Type is record Visible_Area_Min_X : Integer; Visible_Area_Min_Y : Integer; Visible_Area_Max_X : Integer; Visible_Area_Max_Y : Integer; Scroll_X_Offset : Integer; Scroll_Y_Offset : Integer; Open_Behind : Wimp_Handle_Type := Wimp_Handle_Type(-1); Window_Flags : Integer; Title_Foreground : Byte := 7; Title_Background : Byte := 2; Work_Area_Foreground : Byte; Work_Area_Background : Byte; Scrollbar_Outer_Colour : Byte := 3; Scrollbar_Inner_Colour : Byte := 1; Title_Input_Focus_Colour : Byte := 12; Extra_Flags : Byte; Work_Area_Min_X : Integer; Work_Area_Min_Y : Integer; Work_Area_Max_X : Integer; Work_Area_Max_Y : Integer; Title_Bar_Icon_Flags : Integer; Work_Area_Button_Flags : Integer; Sprite_Area_Pointer : Integer; Minimum_Width : Double_Byte; Minimum_Height : Double_Byte; Title_Data : Wimp_Title_Data; Nr_Of_Icons_Initially : Integer; end record; pragma Convention (C, Wimp_Window_Block_Type); type Wimp_Icon_Block_Type is array(integer range <>) of Wimp_Icon_Data; pragma Convention (C, Wimp_Icon_Block_Type); type Wimp_WindowInfo_Type(Icon_Nr : Integer) is record Window : Wimp_Handle_Type; Visible_Area_Min_X : Integer; Visible_Area_Min_Y : Integer; Visible_Area_Max_X : Integer; Visible_Area_Max_Y : Integer; Scroll_X_Offset : Integer; Scroll_Y_Offset : Integer; Open_Behind : Wimp_Handle_Type := Wimp_Handle_Type(-1); Window_Flags : Integer; Title_Foreground : Byte := 7; Title_Background : Byte := 2; Work_Area_Foreground : Byte; Work_Area_Background : Byte; Scrollbar_Outer_Colour : Byte := 3; Scrollbar_Inner_Colour : Byte := 1; Title_Input_Focus_Colour : Byte := 12; Extra_Flags : Byte; Work_Area_Min_X : Integer; Work_Area_Min_Y : Integer; Work_Area_Max_X : Integer; Work_Area_Max_Y : Integer; Title_Bar_Icon_Flags : Integer; Work_Area_Button_Flags : Integer; Sprite_Area_Pointer : Integer; Minimum_Width : Double_Byte; Minimum_Height : Double_Byte; Title_Data : Wimp_Title_Data; Nr_Of_Icons_Initially : Integer; Icon_Block : Wimp_Icon_Block_Type(0..Icon_Nr); end record; pragma Convention (C, Wimp_WindowInfo_Type); type Wimp_WindowInfo_Pointer is access Wimp_WindowInfo_Type; type Wimp_WindowState_Type is record Window : Wimp_Handle_Type; Visible_Area_Min_X : Integer; Visible_Area_Min_Y : Integer; Visible_Area_Max_X : Integer; Visible_Area_Max_Y : Integer; Scroll_X_Offset : Integer; Scroll_Y_Offset : Integer; Open_Behind : Wimp_Handle_Type := Wimp_Handle_Type(-1); Window_Flags : Integer; end record; pragma Convention (C, Wimp_WindowState_Type); type Wimp_WindowOutline_Type is record Window : Wimp_Handle_Type; Min_X : Integer; Min_Y : Integer; Max_X : Integer; Max_Y : Integer; end record; pragma Convention (C, Wimp_WindowOutline_Type); type Wimp_RedrawInfo_Type is record Window : Wimp_Handle_Type; Visible_Area_Min_X : Integer; Visible_Area_Min_Y : Integer; Visible_Area_Max_X : Integer; Visible_Area_Max_Y : Integer; Scroll_X_Offset : Integer; Scroll_Y_Offset : Integer; Redraw_Min_X : Integer; Redraw_Min_Y : Integer; Redraw_Max_X : Integer; Redraw_Max_Y : Integer; end record; pragma Convention (C, Wimp_RedrawInfo_Type); type Wimp_OpenWindow_Type is record Window : Wimp_Handle_Type; Visible_Area_Min_X : Integer; Visible_Area_Min_Y : Integer; Visible_Area_Max_X : Integer; Visible_Area_Max_Y : Integer; Scroll_X_Offset : Integer; Scroll_Y_Offset : Integer; Open_Behind : Wimp_Handle_Type := Wimp_Handle_Type(-1); end record; pragma Convention (C, Wimp_OpenWindow_Type); type Wimp_WindowExtent_Type is record Work_Area_Min_X : Integer; Work_Area_Min_Y : Integer; Work_Area_Max_X : Integer; Work_Area_Max_Y : Integer; end record; type Wimp_External_WindowInfo_Type is record Window : Wimp_Handle_Type; Left_Border : Integer; Bottom_Border : Integer; Right_Border : Integer; Top_Border : Integer; Back_Width : Integer; Close_Width : Integer; Reserved_1 : Integer; Title_Width : Integer; Reserved_2 : Integer; Iconise_Width : Integer; Toggle_Width : Integer; Toggle_Height : Integer; VUpper_Gap : Integer; UpArrow_Height : Integer; VWell_Height : Integer; DownArrow_Height : Integer; VLower_Gap : Integer; Adjust_Height : Integer; Adjust_Width : Integer; HRight_Gap : Integer; RightArrow_Width : Integer; HWell_Width : Integer; LeftArrow_Width : Integer; HLeft_Gap : Integer; end record; pragma Convention (C, Wimp_External_WindowInfo_Type); type Child_List_Type is array(integer range <>) of Wimp_Handle_Type; -- -- Closes the window. -- procedure Close_Window (Window : in Wimp_Handle_Type); -- -- Open window at maksimum size. -- procedure Open_WindowMax (Window : in Wimp_Handle_Type); -- -- Open the window at the center of the screen. -- procedure Open_WindowCentered (Window : in Wimp_Handle_Type); -- -- Open window at a specific position. -- procedure Open_WindowAt (Window : in Wimp_Handle_Type; X : in Integer; Y : in Integer); -- -- This opens a window. -- procedure Open_Window (Block : in Wimp_OpenWindow_Type); -- -- This is called in response to a RedrawWindow request. -- procedure Redraw_Window (Window : in Wimp_Handle_Type; Block : in out Wimp_RedrawInfo_Type; More : out Boolean); -- -- Updates block with info for the next rectangle to be redrawn. --Returns true until there is no more to be redrawn. -- function Get_Rectangle (Block : in Wimp_RedrawInfo_Type) return Boolean; -- -- Returns the coordinates of a rectangle which completely covers the window, borders and all. -- function Get_WindowOutline (Window : in Wimp_Handle_Type) return Wimp_WindowOutline_Type; -- -- Returns the complete details of the given window's state. -- function Get_WindowInfo (Window : in Wimp_Handle_Type; Icons : in Boolean := true) return Wimp_WindowInfo_Type; -- -- Returns extensive external (toolicons etc.) information about the window. --Requires RISC OS 4. -- function Get_External_WindowInfo (Window : in Wimp_Handle_Type) return Wimp_External_WindowInfo_Type; -- -- Returns extensive external (toolicons etc.) information about windows with line borders enabled. --Requires RISC OS 4. -- function Get_Generic_WindowInfo return Wimp_External_WindowInfo_Type; -- -- Reads a window's visible state. -- function Get_WindowState (Window : in Wimp_Handle_Type) return Wimp_WindowState_Type; -- -- Returns the parent of a child in a nested window. Returns '-1' if the window has no parent. Requires the nested windowmanager. -- function Get_ParentWindow (Window : in Wimp_Handle_Type) return Wimp_Handle_Type; -- -- Returns the Wimp handle of the top level window in a nested window. Requires the nested windowmanager. -- function Get_AncestorWindow (Window : in Wimp_Handle_Type) return Wimp_Handle_Type; -- -- Return Top_left coordinates of window in OS units. -- procedure Get_WindowPosition (Window : in Wimp_Handle_Type; X_Pos : out Integer; Y_Pos : out Integer); -- -- Is the window open ? -- function Is_Open (Window : in Wimp_Handle_Type) return Boolean; -- -- Converts a set of work coordinates of the given window into --screen coordinates. -- procedure Work_To_Screen (Window : in Wimp_Handle_Type; Work_X : in Integer; Work_Y : in Integer; Screen_X : out Integer; Screen_Y : out Integer); -- -- Converts a set of screen coordinates into work coordinates of the --given window. -- procedure Screen_To_Work (Window : in Wimp_Handle_Type; Screen_X : in Integer; Screen_Y : in Integer; Work_X : out Integer; Work_Y : out Integer); -- -- Forces the WIMP to redraw a special set of coordinates. -- procedure Force_Redraw (Window : in Wimp_Handle_Type; Min_X : in Integer; Min_Y : in Integer; Max_X : in Integer; Max_Y : in Integer); -- -- Force a redraw of the entire screen. -- procedure Force_RedrawAll; -- -- Forces the WIMP to do a redraw of the whole visible area of a -- given window. -- procedure Force_WindowRedraw (Window : in Wimp_Handle_Type); -- -- Reads window title. -- function Get_WindowTitle (Window : in Wimp_Handle_Type) return String; -- -- Returns window extent - window workspace size. -- function Get_Extent (Window : in Wimp_Handle_Type) return Wimp_WindowExtent_Type; -- -- Set window extent, visible workarea must be wholly within new workarea extent. -- procedure Set_Extent (Window : in Wimp_Handle_Type; Min_X : in Integer; Min_Y : in Integer; Max_X : in Integer; Max_Y : in Integer); -- -- Closes the window and deletes window definition from memory. -- procedure Delete_Window (Window : in Wimp_Handle_Type); -- -- Return parent window handle. Returns '-1' for none. --Requires the nested WIMP (3.8). -- function Get_Parent (Window : in Wimp_Handle_Type) return Wimp_Handle_Type; -- -- Returns window handle of top child window. Returns '-1' for none. --Requires the nested WIMP (3.8). -- function Get_Top_ChildWindow (Window : in Wimp_Handle_Type) return Wimp_Handle_Type; -- -- Returns window handle of bottom child window. Returns '-1' for none. --Requires the nested WIMP (3.8). -- function Get_Bottom_ChildWindow (Window : in Wimp_Handle_Type) return Wimp_Handle_Type; -- -- Returns window handle of sibling window below. Returns '-1' if none. --Requires the nested WIMP (3.8). -- function Get_Sibling_Below (Window : in Wimp_Handle_Type) return Wimp_Handle_Type; -- -- Returns window handle of sibling window above. Returns '-1' if none. --Requires the nested WIMP (3.8). -- function Get_Sibling_Above (Window : in Wimp_Handle_Type) return Wimp_Handle_Type; -- -- Returns the nr of child windows the window has. -- function Count_Children (Window : in Wimp_Handle_Type) return Natural; -- -- Returns an array of the windows child windows. -- function Get_Children (Window : in Wimp_Handle_Type) return Child_List_Type; procedure Handle (The : in AMEL_Message_Iconize) is abstract; procedure Handle (The : in AMEL_Message_IconizeAt) is abstract; procedure Handle (The : in AMEL_Message_WindowInfo) is abstract; procedure Handle (The : in AMEL_Message_WindowClosed) is abstract; end RASCAL.WimpWindow;
attic/fb_rawshader/etna_gears_ps.asm
ilbers/etna_viv
121
82729
<reponame>ilbers/etna_viv ; etna_gears ps NOP void, void, void, void ; GLSL: ; ; precision mediump float; ; varying vec4 Color; ; ; void main(void) ; { ; gl_FragColor = Color; ; }
thrift_parser/Thrift.g4
alingse/thrift-parser-
0
7773
<reponame>alingse/thrift-parser-<gh_stars>0 grammar Thrift; document : header* definition* EOF ; header : include_ | namespace_ | cpp_include ; include_ : 'include' LITERAL_VALUE ; namespace_ : 'namespace' '*' (IDENTIFIER | LITERAL_VALUE) | 'namespace' IDENTIFIER (IDENTIFIER | LITERAL_VALUE) type_annotations? | 'cpp_namespace' IDENTIFIER | 'php_namespace' IDENTIFIER ; cpp_include : 'cpp_include' LITERAL_VALUE ; definition : const_rule | typedef_ | enum_rule | senum | struct_ | union_ | exception | service ; const_rule : 'const' field_type IDENTIFIER ( '=' const_value )? list_separator? ; typedef_ : 'typedef' field_type IDENTIFIER type_annotations? ; enum_rule : 'enum' IDENTIFIER '{' enum_field* '}' type_annotations? ; enum_field : IDENTIFIER ('=' integer)? type_annotations? list_separator? ; senum : 'senum' IDENTIFIER '{' (LITERAL_VALUE list_separator?)* '}' type_annotations? ; struct_ : 'struct' IDENTIFIER '{' field* '}' type_annotations? ; union_ : 'union' IDENTIFIER '{' field* '}' type_annotations? ; exception : 'exception' IDENTIFIER '{' field* '}' type_annotations? ; service : 'service' IDENTIFIER ('extends' IDENTIFIER)? '{' function_* '}' type_annotations? ; field : field_id? field_req? field_type IDENTIFIER ('=' const_value)? type_annotations? list_separator? ; field_id : integer ':' ; field_req : 'required' | 'optional' ; function_ : oneway? function_type IDENTIFIER '(' field* ')' throws_list? type_annotations? list_separator? ; oneway : ('oneway' | 'async') ; function_type : field_type | 'void' ; throws_list : 'throws' '(' field* ')' ; type_annotations : '(' type_annotation* ')' ; type_annotation : IDENTIFIER ('=' annotation_value)? list_separator? ; annotation_value : integer | LITERAL_VALUE ; field_type : base_type | IDENTIFIER | container_type ; base_type : real_base_type type_annotations? ; container_type : (map_type | set_type | list_type) type_annotations? ; map_type : 'map' cpp_type? '<' field_type COMMA field_type '>' ; set_type : 'set' cpp_type? '<' field_type '>' ; list_type : 'list' '<' field_type '>' cpp_type? ; cpp_type : 'cpp_type' LITERAL_VALUE ; const_value : integer | DOUBLE | LITERAL_VALUE | IDENTIFIER | const_list | const_map ; integer : INTEGER | HEX_INTEGER ; INTEGER : ('+' | '-')? DIGIT+ ; HEX_INTEGER : '-'? '0x' HEX_DIGIT+ ; DOUBLE : ('+' | '-')? ( DIGIT+ ('.' DIGIT+)? | '.' DIGIT+ ) (('E' | 'e') INTEGER)? ; const_list : '[' (const_value list_separator?)* ']' ; const_map_entry : const_value ':' const_value list_separator? ; const_map : '{' const_map_entry* '}' ; list_separator : COMMA | ';' ; real_base_type : TYPE_BOOL | TYPE_BYTE | TYPE_I16 | TYPE_I32 | TYPE_I64 | TYPE_DOUBLE | TYPE_STRING | TYPE_BINARY ; TYPE_BOOL: 'bool'; TYPE_BYTE: 'byte'; TYPE_I16: 'i16'; TYPE_I32: 'i32'; TYPE_I64: 'i64'; TYPE_DOUBLE: 'double'; TYPE_STRING: 'string'; TYPE_BINARY: 'binary'; LITERAL_VALUE : (('"' ~'"'* '"') | ('\'' ~'\''* '\'')) ; IDENTIFIER : (LETTER | '_') (LETTER | DIGIT | '.' | '_')* ; COMMA : ',' ; fragment LETTER : 'A'..'Z' | 'a'..'z' ; fragment DIGIT : '0'..'9' ; fragment HEX_DIGIT : DIGIT | 'A'..'F' | 'a'..'f' ; WS : (' ' | '\t' | '\r' '\n' | '\n')+ -> channel(HIDDEN) ; SL_COMMENT : ('//' | '#') (~'\n')* ('\r')? '\n' -> channel(2) ; ML_COMMENT : '/*' .*? '*/' -> channel(2) ;
programs/oeis/115/A115519.asm
neoneye/loda
22
81086
<reponame>neoneye/loda ; A115519: n*(1+3*n+6*n^2)/2. ; 0,5,31,96,218,415,705,1106,1636,2313,3155,4180,5406,6851,8533,10470,12680,15181,17991,21128,24610,28455,32681,37306,42348,47825,53755,60156,67046,74443,82365,90830,99856,109461,119663,130480,141930,154031,166801,180258 mov $1,6 mul $1,$0 mul $0,$1 add $1,3 mul $0,$1 add $0,$1 div $0,12
programs/oeis/085/A085474.asm
neoneye/loda
22
163160
<gh_stars>10-100 ; A085474: C(2*n+4,4)-C(2*n,4). ; 1,15,69,195,425,791,1325,2059,3025,4255,5781,7635,9849,12455,15485,18971,22945,27439,32485,38115,44361,51255,58829,67115,76145,85951,96565,108019,120345,133575,147741,162875,179009,196175,214405,233731,254185,275799,298605,322635,347921,374495,402389,431635,462265,494311,527805,562779,599265,637295,676901,718115,760969,805495,851725,899691,949425,1000959,1054325,1109555,1166681,1225735,1286749,1349755,1414785,1481871,1551045,1622339,1695785,1771415,1849261,1929355,2011729,2096415,2183445,2272851,2364665,2458919,2555645,2654875,2756641,2860975,2967909,3077475,3189705,3304631,3422285,3542699,3665905,3791935,3920821,4052595,4187289,4324935,4465565,4609211,4755905,4905679,5058565,5214595 mul $0,2 mov $1,$0 lpb $1 add $2,$1 add $0,$2 sub $1,1 lpe mul $0,2 add $0,1
arch/ARM/STM32/driversL1/stm32-crc.adb
morbos/Ada_Drivers_Library
2
2670
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, AdaCore -- -- -- -- 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. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- 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 COPYRIGHT -- -- HOLDER 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. -- -- -- ------------------------------------------------------------------------------ package body STM32.CRC is ---------------------- -- Reset_Calculator -- ---------------------- procedure Reset_Calculator (This : in out CRC_32) is begin This.CR.RESET := True; end Reset_Calculator; ----------- -- Value -- ----------- function Value (This : CRC_32) return UInt32 is (This.DR); ---------------- -- Update_CRC -- ---------------- procedure Update_CRC (This : in out CRC_32; Input : UInt32; Output : out UInt32) is begin This.DR := Input; -- Each write operation into the data register causes the device to -- calculate a new CRC value based on the previous CRC value and Input, -- so although this looks like a useless sequence that would just return -- the Input value, it is necessary. Output := This.DR; end Update_CRC; ---------------- -- Update_CRC -- ---------------- procedure Update_CRC (This : in out CRC_32; Input : Block_32; Output : out UInt32) is begin for K in Input'Range loop This.DR := Input (K); end loop; Output := This.DR; end Update_CRC; ---------------- -- Update_CRC -- ---------------- procedure Update_CRC (This : in out CRC_32; Input : Block_16; Output : out UInt32) is begin for K in Input'Range loop This.DR := UInt32 (Input (K)); end loop; Output := This.DR; end Update_CRC; ---------------- -- Update_CRC -- ---------------- procedure Update_CRC (This : in out CRC_32; Input : Block_8; Output : out UInt32) is begin for K in Input'Range loop This.DR := UInt32 (Input (K)); end loop; Output := This.DR; end Update_CRC; -------------------------- -- Set_Independent_Data -- -------------------------- procedure Set_Independent_Data (This : in out CRC_32; Value : UInt7) is begin This.IDR.Independent_data_register := Value; end Set_Independent_Data; ---------------------- -- Independent_Data -- ---------------------- function Independent_Data (This : CRC_32) return UInt7 is (This.IDR.Independent_data_register); end STM32.CRC;
WEEK-8/1.asm
ShruKin/Microprocessor-and-Microcontroller-Lab
0
86146
LDA 9000 MOV C,A ANI 0F MOV B,A MOV A,C ANI F0 RRC RRC RRC RRC ADD B STA 9050 JNC JUMP INR D MOV A,D STA 9051 JUMP: HLT
examples/stm32f1/bootloader/main.adb
ekoeppen/STM32_Generic_Ada_Drivers
1
4756
<gh_stars>1-10 with Startup; with Bootloader; procedure Main is begin Bootloader.Start; end Main;
src/BubbleSort.asm
Kaybass/CSI-370-Final
0
240978
; ; <NAME> ; ; int * BubbleSort(int * array, int arraylen) ; section .text global BubbleSort BubbleSort: push ebp mov ebp, esp mov ecx, [ebp+12] mov edi, [ebp+8] dec ecx L1: push ecx mov esi, edi L2: mov eax, [esi] cmp eax, [esi+4] jl L3 xchg eax, [esi+4] mov [esi], eax L3: add esi, 4 loop L2 pop ecx loop L1 mov eax, edi mov esp, ebp pop ebp ret
tests/res/jitregress/fifo_llvm.asm
JackWolfard/cash
14
104594
<reponame>JackWolfard/cash .text .file "llvmjit" .globl eval .p2align 4, 0x90 .type eval,@function eval: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 pushq %rbx .cfi_def_cfa_offset 24 .cfi_offset %rbx, -24 .cfi_offset %rbp, -16 movq (%rdi), %r10 movq 8(%rdi), %rdi movl 8(%rdi), %esi movl 16(%rdi), %eax movq 24(%r10), %rcx movl (%rcx), %ecx movl 24(%rdi), %edx notl %edx movl %ecx, 24(%rdi) testl %ecx, %edx je .LBB0_10 movq 32(%r10), %rcx movl (%rcx), %r9d movq 8(%r10), %r11 movq 16(%r10), %rcx xorl %r8d, %r8d cmpl %esi, %eax setne %r8b andl (%rcx), %r8d movl %eax, %ecx andl $1, %ecx movl %esi, %ebx andl $1, %ebx xorl %ecx, %ebx xorl $1, %ebx movl %eax, %edx xorl %esi, %edx shrl %edx andl %ebx, %edx xorl $1, %edx andl (%r11), %edx je .LBB0_3 movq (%r10), %rbx movl (%rbx), %ebx movl (%rdi), %r11d addb %cl, %cl movl $3, %ebp shll %cl, %ebp shll %cl, %ebx xorl %r11d, %ebx andl %ebp, %ebx xorl %r11d, %ebx movl %ebx, (%rdi) .LBB0_3: testl %r9d, %r9d je .LBB0_5 movl $0, 16(%rdi) movl $0, 8(%rdi) xorl %esi, %esi xorl %eax, %eax jmp .LBB0_9 .LBB0_5: testl %edx, %edx je .LBB0_7 incl %eax andl $3, %eax movl %eax, 16(%rdi) .LBB0_7: testl %r8d, %r8d je .LBB0_9 incl %esi andl $3, %esi movl %esi, 8(%rdi) .LBB0_9: movl %esi, %edx andl $1, %edx movl (%rdi), %edi leal (%rdx,%rdx), %ecx shrl %cl, %edi andl $3, %edi movq 40(%r10), %rcx movl %edi, (%rcx) xorl %ecx, %ecx cmpl %esi, %eax sete %cl movq 48(%r10), %rdi movl %ecx, (%rdi) movl %eax, %ecx andl $1, %ecx xorl %edx, %ecx xorl $1, %ecx xorl %esi, %eax shrl %eax andl %ecx, %eax movq 56(%r10), %rcx movl %eax, (%rcx) .LBB0_10: xorl %eax, %eax popq %rbx .cfi_def_cfa_offset 16 popq %rbp .cfi_def_cfa_offset 8 retq .Lfunc_end0: .size eval, .Lfunc_end0-eval .cfi_endproc .section ".note.GNU-stack","",@progbits
Task/Boolean-values/AppleScript/boolean-values-1.applescript
LaudateCorpus1/RosettaCodeData
1
1003
1 > 2 --> false not false --> true {true as integer, false as integer, 1 as boolean, 0 as boolean} --> {1, 0, true, false} true = 1 --> false
Cubical/Data/Sigma/Base.agda
limemloh/cubical
0
5764
{-# OPTIONS --cubical --safe #-} module Cubical.Data.Sigma.Base where open import Cubical.Core.Primitives public -- Σ-types are defined in Core/Primitives as they are needed for Glue types.
oeis/220/A220590.asm
neoneye/loda-programs
11
6215
; A220590: Number of ways to reciprocally link elements of an n X 2 array either to themselves or to exactly two king-move neighbors. ; Submitted by <NAME> ; 1,8,33,155,710,3265,15009,68992,317149,1457879,6701646,30806405,141612197,650968960,2992401777,13755599635,63232324870,290669037689,1336159782873,6142116062912,28234340094485,129788814214207,596618735864094,2742562355154877,12607127164752733,57952977823642112,266400710862777033,1224602106973021595,5629302998276282774,25877019209718269329,118952581409309276529,546806280478562237248,2513582343723735620557,11554542118920324536807,53114410160965628875758,244158577441829505151541 mov $3,2 mov $5,1 lpb $0 sub $0,1 add $1,$3 add $1,$5 add $3,$1 mov $4,$2 mov $2,$3 mul $5,2 mov $3,$5 add $4,$1 sub $4,$5 add $5,$4 add $5,$2 lpe mov $0,$5
programs/oeis/070/A070517.asm
neoneye/loda
22
98166
<filename>programs/oeis/070/A070517.asm ; A070517: a(n) = n^4 mod 13. ; 0,1,3,3,9,1,9,9,1,9,3,3,1,0,1,3,3,9,1,9,9,1,9,3,3,1,0,1,3,3,9,1,9,9,1,9,3,3,1,0,1,3,3,9,1,9,9,1,9,3,3,1,0,1,3,3,9,1,9,9,1,9,3,3,1,0,1,3,3,9,1,9,9,1,9,3,3,1,0,1,3,3,9,1,9,9,1,9,3,3,1,0,1,3,3,9,1,9,9,1 pow $0,4 mod $0,13
src/coordinates.ads
onox/orka-demo
3
22300
<filename>src/coordinates.ads private with Ada.Numerics; with GL.Types; with Orka.Transforms.Doubles.Matrices; with Orka.Transforms.Doubles.Quaternions; with Orka.Transforms.Doubles.Vectors; with Planets.Earth; package Coordinates is package Quaternions renames Orka.Transforms.Doubles.Quaternions; package Vectors renames Orka.Transforms.Doubles.Vectors; package Matrices renames Orka.Transforms.Doubles.Matrices; GL_To_Geo : constant Quaternions.Quaternion; Earth_Tilt : constant Quaternions.Quaternion; Orientation_ECI : constant Quaternions.Quaternion; Rotate_ECI : constant Matrices.Matrix4; Inverse_Rotate_ECI : constant Matrices.Matrix4; function Rotate_ECEF return Matrices.Matrix4; Orientation_ECEF : Quaternions.Quaternion := Quaternions.Identity_Value; private use type GL.Types.Double; GL_To_Geo : constant Quaternions.Quaternion := Quaternions.R (Vectors.Normalize ((1.0, 1.0, 1.0, 0.0)), 0.66667 * Ada.Numerics.Pi); Earth_Tilt : constant Quaternions.Quaternion := Quaternions.R (Vectors.Normalize ((1.0, 0.0, 0.0, 0.0)), Vectors.To_Radians (Planets.Earth.Planet.Axial_Tilt_Deg)); use type Quaternions.Quaternion; Orientation_ECI : constant Quaternions.Quaternion := Earth_Tilt * GL_To_Geo; Rotate_ECI : constant Matrices.Matrix4 := Matrices.R (Matrices.Vector4 (Orientation_ECI)); Inverse_Rotate_ECI : constant Matrices.Matrix4 := Matrices.R (Matrices.Vector4 (Quaternions.Conjugate (Orientation_ECI))); function Rotate_ECEF return Matrices.Matrix4 is (Matrices.R (Matrices.Vector4 (Orientation_ECEF * Orientation_ECI))); -- type Geocentric_Coordinate is record -- X, Y, Z : GL.Types.Double; -- end record; -- Geocentric coordinates or Earth-Centered Earth-Fixed (ECEF) -- -- (0, 0, 0) is the center of mass of the Earth. The z-axis intersects -- the true north (north pole), while the x-axis intersects the Earth -- at 0 deg latitude and 0 deg longitude. -- type Geodetic_Coordinate is record -- Longitude, Latitude, Height : GL.Types.Double; -- end record; -- Subsolar point (point when sun is directly above a position (at zenith): -- -- latitude = declination of the sun -- longitude = -15 * (T_UTC - 12 + E_min / 60) [2] -- -- T_UTC = time UTC -- E_min = equation of time [1] in minutes -- -- [1] https://en.wikipedia.org/wiki/Equation_of_time -- [2] https://doi.org/10.1016/j.renene.2021.03.047 end Coordinates;
test/asm/narg-decreases-after-shift.asm
clach04/rgbds
1
3958
<filename>test/asm/narg-decreases-after-shift.asm testing: MACRO db _NARG shift db _NARG shift db _NARG shift db _NARG shift db _NARG ENDM SECTION "Test output", ROM0 testing 1, 2, 3
Data/ShipModelMetaData2.asm
TinfoilAsteroid/EliteNext
9
27012
<filename>Data/ShipModelMetaData2.asm ShipModelTable2: DW Dragon ;16 $10 DW Escape_Pod ;17 $11 DW Fer_De_Lance ;18 $12 DW Gecko ;19 $13 DW Ghavial ;20 $14 DW Iguana ;21 $15 DW Krait ;22 $16 DW Logo ;23 $17 DW Mamba ;24 $18 DW Missile ;25 $19 DW Monitor ;26 $1A DW Moray ;27 $1B DW Ophidian ;28 $1C DW Plate ;29 $1D DW Python ;30 $1E DW Python_P ;31 $1F ShipVertexTable2: DW DragonVertices ;16 $10 DW Escape_PodVertices ;17 $11 DW Fer_De_LanceVertices ;18 $12 DW GeckoVertices ;19 $13 DW GhavialVertices ;20 $14 DW IguanaVertices ;21 $15 DW KraitVertices ;22 $16 DW LogoVertices ;23 $17 DW MambaVertices ;24 $18 DW MissileVertices ;25 $19 DW MonitorVertices ;26 $1A DW MorayVertices ;27 $1B DW OphidianVertices ;28 $1C DW PlateVertices ;29 $1D DW PythonVertices ;30 $1E DW Python_PVertices ;31 $1F ShipEdgeTable2: DW DragonEdges ;16 $10 DW Escape_PodEdges ;17 $11 DW Fer_De_LanceEdges ;18 $12 DW GeckoEdges ;19 $13 DW GhavialEdges ;20 $14 DW IguanaEdges ;21 $15 DW KraitEdges ;22 $16 DW LogoEdges ;23 $17 DW MambaEdges ;24 $18 DW MissileEdges ;25 $19 DW MonitorEdges ;26 $1A DW MorayEdges ;27 $1B DW OphidianEdges ;28 $1C DW PlateEdges ;29 $1D DW PythonEdges ;30 $1E DW Python_PEdges ;31 $1F ShipNormalTable2: DW DragonNormals ;16 $10 DW Escape_PodNormals ;17 $11 DW Fer_De_LanceNormals ;18 $12 DW GeckoNormals ;19 $13 DW GhavialNormals ;20 $14 DW IguanaNormals ;21 $15 DW KraitNormals ;22 $16 DW LogoNormals ;23 $17 DW MambaNormals ;24 $18 DW MissileNormals ;25 $19 DW MonitorNormals ;26 $1A DW MorayNormals ;27 $1B DW OphidianNormals ;28 $1C DW PlateNormals ;29 $1D DW PythonNormals ;30 $1E DW Python_PNormals ;31 $1F ShipModelSizeTable2: DW DragonLen ;16 $10 DW Escape_PodLen ;17 $11 DW Fer_De_LanceLen ;18 $12 DW GeckoLen ;19 $13 DW GhavialLen ;20 $14 DW IguanaLen ;21 $15 DW KraitLen ;22 $16 DW LogoLen ;23 $17 DW MambaLen ;24 $18 DW MissileLen ;25 $19 DW MonitorLen ;26 $1A DW MorayLen ;27 $1B DW OphidianLen ;28 $1C DW PlateLen ;29 $1D DW PythonLen ;30 $1E DW Python_PLen ;31 $1F include "Data/ships/Dragon.asm" include "Data/ships/Escape_Pod.asm" include "Data/ships/Fer_De_Lance.asm" include "Data/ships/Gecko.asm" include "Data/ships/Ghavial.asm" include "Data/ships/Iguana.asm" include "Data/ships/Krait.asm" include "Data/ships/Logo.asm" include "Data/ships/Mamba.asm" include "Data/ships/Missile.asm" include "Data/ships/Monitor.asm" include "Data/ships/Moray.asm" include "Data/ships/Ophidian.asm" include "Data/ships/Plate.asm" include "Data/ships/Python.asm" include "Data/ships/Python_P.asm"
programs/oeis/097/A097251.asm
karttu/loda
1
171120
<reponame>karttu/loda ; A097251: Numbers whose set of base 5 digits is {0,4}. ; 0,4,20,24,100,104,120,124,500,504,520,524,600,604,620,624,2500,2504,2520,2524,2600,2604,2620,2624,3000,3004,3020,3024,3100,3104,3120,3124,12500,12504,12520,12524,12600,12604,12620,12624,13000,13004,13020,13024,13100,13104,13120,13124,15000,15004,15020,15024,15100,15104,15120,15124,15500,15504,15520,15524,15600,15604,15620,15624,62500,62504,62520,62524,62600,62604,62620,62624,63000,63004,63020,63024,63100,63104,63120,63124,65000,65004,65020,65024,65100,65104,65120,65124,65500,65504,65520,65524,65600,65604,65620,65624,75000,75004,75020,75024,75100,75104,75120,75124,75500,75504,75520,75524,75600,75604,75620,75624,77500,77504,77520,77524,77600,77604,77620,77624,78000,78004,78020,78024,78100,78104,78120,78124,312500,312504,312520,312524,312600,312604,312620,312624,313000,313004,313020,313024,313100,313104,313120,313124,315000,315004,315020,315024,315100,315104,315120,315124,315500,315504,315520,315524,315600,315604,315620,315624,325000,325004,325020,325024,325100,325104,325120,325124,325500,325504,325520,325524,325600,325604,325620,325624,327500,327504,327520,327524,327600,327604,327620,327624,328000,328004,328020,328024,328100,328104,328120,328124,375000,375004,375020,375024,375100,375104,375120,375124,375500,375504,375520,375524,375600,375604,375620,375624,377500,377504,377520,377524,377600,377604,377620,377624,378000,378004,378020,378024,378100,378104,378120,378124,387500,387504,387520,387524,387600,387604,387620,387624,388000,388004,388020,388024,388100,388104,388120,388124,390000,390004,390020,390024,390100,390104,390120,390124,390500,390504 cal $0,191107 ; Increasing sequence generated by these rules: a(1)=1, and if x is in a then 3x-2 and 3x+1 are in a. cal $0,37453 ; Positive numbers n such that the base 5 representation of n contains no 3 or 4. mov $1,$0 div $1,5 mul $1,4
oeis/229/A229324.asm
neoneye/loda-programs
11
179755
; A229324: Composite squarefree numbers n such that p + tau(n) divides n - phi(n), where p are the prime factors of n, tau(n) = A000005(n) and phi(n) = A000010(n). ; Submitted by <NAME> ; 115,205,295,565,655,745,835,1195,1285,1465,1555,1735,1915,2005,2095,2455,2545,2815,2995,3085,3265,3715,3805,3985,4435,4705,4885,5065,5155,5245,5515,5965,6145,6415,6505,6595,6865,7045,7135,7405,7495,7765,7855,8035,8485,8665,8935,9115,9385,9565,9655,9745,10015,10195,10555,10645,11185,11365,11545,11905,11995,12085,12715,12895,13165,13435,13705,13885,14515,14695,14785,15055,15415,15595,15685,15955,16045,16495,16855,16945,17035,17305,17665,18115,18295,18385,18835,19015,19105,19555,19645,19735,20005 mov $2,$0 pow $2,2 mov $4,4 lpb $2 add $4,18 mov $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $1,$0 max $1,0 cmp $1,$0 mul $2,$1 sub $2,1 lpe mov $0,$4 sub $0,4 mul $0,5 add $0,115
alloy4fun_models/trashltl/models/5/LfTgXYhskYLbkio8m.als
Kaixi26/org.alloytools.alloy
0
3740
<gh_stars>0 open main pred idLfTgXYhskYLbkio8m_prop6 { once File in Trash implies always File in Trash } pred __repair { idLfTgXYhskYLbkio8m_prop6 } check __repair { idLfTgXYhskYLbkio8m_prop6 <=> prop6o }
src/spawner/spawner.asm
tomsons26/ts-patches
1
96478
%include "macros/patch.inc" %include "macros/datatypes.inc" %include "TiberianSun.inc" %include "ini.inc" %include "patch.inc" cglobal SpawnerActive cglobal INIClass_SPAWN cglobal SpawnLocationsArray cglobal SpawnLocationsHouses gbool SavesDisabled, true gbool QuickMatch, false gbool IsHost, true cextern Load_Spectators_Spawner cextern PortHack cextern BuildOffAlly cextern TunnelIp cextern TunnelPort cextern TunnelId cextern UsedSpawnsArray cextern IsSpectatorArray cextern RunAutoSS cextern AimableSams cextern IntegrateMumbleSpawn cextern AttackNeutralUnits cextern ScrapMetal cextern AutoDeployMCV cextern SharedControl cextern SkipScoreScreen cextern AutoSurrender @LJMP 0x004E1DE0, _Select_Game_Init_Spawner @LJMP 0x00609470, _Send_Statistics_Packet_Return_If_Skirmish @LJMP 0x005E08E3, _Read_Scenario_INI_Assign_Houses_And_Spawner_House_Settings @LJMP 0x004BDDB1, _HouseClass__Make_Ally_STFU_when_Allying_In_Loading_Screen_Spawner @LJMP 0x004E078C, _Init_Game_Check_Spawn_Arg_No_Intro @LJMP 0x005FFDBF, _WinMain_Read_Check_Spawn_Arg ; Inside HouseClass::Mplayer_Defeated skip some checks which makes game continue ; even if there are only allied AI players left, in skirmish @LJMP 0x004BF7B6, 0x004BF7BF @LJMP 0x004BF7F0, 0x004BF7F9 @LJMP 0x005ED477, _sub_5ED470_Dont_Read_Scenario_Descriptions_When_Spawner_Active @LJMP 0x004C06EF, _HouseClass__AI_Attack_Stuff_Alliance_Check @LJMP 0x005DE3D7, _Assign_Houses_AI_Countries @LJMP 0x004C3630, _HouseClass__Computer_Paranoid_Disable_With_Spawner @LJMP 0x005DDAF1, _Read_Scenario_INI_Dont_Create_Units_Earlier @LJMP 0x005DDEDD, _Read_Scenario_INI_Dont_Create_Units_Earlier_Dont_Create_Twice @LJMP 0x0065860D, _UnitClass__Read_INI_Jump_Out_When_Units_Section_Missing @LJMP 0x005DBCC3, _Read_Scenario_Custom_Load_Screen_Spawner @LJMP 0x005DD523, _Read_Scenario_INI_Fix_Spawner_DifficultyMode_Setting ;always write mp stats @CLEAR 0x0046353C, 0x90, 0x00463542 section .bss SpawnerActive RESD 1 INIClass_SPAWN RESB 256 ; FIXME: make this a local variable inet_addr RESD 1 IsDoingAlliancesSpawner RESB 1 IsSpawnArgPresent RESD 1 AllyBySpawnLocation RESD 1 HouseColorsArray RESD 8 HouseCountriesArray RESD 8 HouseHandicapsArray RESD 8 SpawnLocationsArray RESD 8 SpawnLocationsHouses RESD 8 SaveGameNameBuf RESB 60 DoingAutoSS RESD 1 Anticheat1 RESD 1 AntiCheatArray RESB (StripClass_Size * 2) SpectatorStuffInit RESB 1 OldUnitClassArrayCount RESD 1 CustomLoadScreen RESB 256 SaveGameLoadPathWide RESB 512 SaveGameLoadPath RESB 256 SpawnerTeamName RESB 128 gstring MapHash, "", 256 section .rdata str_NoWindowFrame db "NoWindowFrame",0 str_kernel32dll db "Kernel32.dll",0 str_SetProcessAffinityMask db "SetProcessAffinityMask",0 str_SingleProcAffinity db "SingleProcAffinity",0 str_GameID db "GameID", 0 str_gcanyonmap db "blitz_test.map", 0 str_debugplayer db "debugplayer",0 str_debugplayer2 db "debugplayer2",0 str_wsock32_dll db "wsock32.dll",0 str_inet_addr db "inet_addr",0 str_localhost db "127.0.0.1",0 str_spawn_ini db "SPAWN.INI",0 str_Settings db "Settings",0 str_UnitCount db "UnitCount",0 str_Scenario db "Scenario",0 str_Empty db "",0 str_GameSpeed db "GameSpeed",0 str_Seed db "Seed",0 str_TechLevel db "TechLevel",0 str_AIPlayers db "AIPlayers",0 str_AIDifficulty db "AIDifficulty",0 str_HarvesterTruce db "HarvesterTruce",0 str_BridgeDestroy db "BridgeDestroy",0 str_FogOfWar db "FogOfWar",0 str_EasyShroud db "EasyShroud",0 str_Crates db "Crates",0 str_ShortGame db "ShortGame",0 str_Bases db "Bases",0 str_MCVRedeploy db "MCVRedeploy",0 str_Credits db "Credits",0 str_Name db "Name",0 str_Side db "Side",0 str_Color db "Color",0 str_OtherSectionFmt db "Other%d",0 str_Port db "Port",0 str_Ip db "Ip",0 str_Ignored db "Ignored",0 str_SpawnArg db "-SPAWN",0 str_MultiEngineer db "MultiEngineer",0 str_Firestorm db "Firestorm",0 str_HouseColors db "HouseColors",0 str_HouseCountries db "HouseCountries",0 str_HouseHandicaps db "HouseHandicaps",0 str_Tunnel db "Tunnel",0 str_SpawnLocations db "SpawnLocations",0 str_IsSinglePlayer db "IsSinglePlayer",0 str_LoadSaveGame db "LoadSaveGame",0 str_SaveGameName db "SaveGameName",0 str_MultipleFactory db "MultipleFactory",0 str_AlliesAllowed db "AlliesAllowed",0 str_MapHash db "MapHash",0 str_SharedControl db "SharedControl",0 str_SidebarHack db "SidebarHack",0 str_BuildOffAlly db "BuildOffAlly",0 str_CustomLoadScreen db "CustomLoadScreen",0 str_Host db "Host",0 str_FrameSendRate db "FrameSendRate",0 str_MaxAhead db "MaxAhead",0 str_PreCalcMaxAhead db "PreCalcMaxAhead",0 str_PreCalcFrameRate db "PreCalcFrameRate",0 str_Protocol db "Protocol", 0 str_RunAutoSS db "RunAutoSS",0 str_AutoSaveGame db "AutoSaveGame", 0 str_TeamName db "TeamName",0 str_AimableSams db "AimableSams",0 str_IntegrateMumble db "IntegrateMumble",0 str_AttackNeutralUnits db "AttackNeutralUnits", 0 str_ScrapMetal db "ScrapMetal",0 str_AutoDeployMCV db "AutoDeployMCV",0 str_SkipScoreScreen db "SkipScoreScreen",0 str_QuickMatch db "QuickMatch",0 str_CoachMode db "CoachMode",0 str_AutoSurrender db "AutoSurrender",0 str_GameNameTitle db "<NAME>",0 str_PleaseRunClient db "Please run the game client instead.",0 str_DifficultyModeComputer db "DifficultyModeComputer",0 str_DifficultyModeHuman db "DifficultyModeHuman",0 str_Multi1 db "Multi1",0 str_Multi2 db "Multi2",0 str_Multi3 db "Multi3",0 str_Multi4 db "Multi4",0 str_Multi5 db "Multi5",0 str_Multi6 db "Multi6",0 str_Multi7 db "Multi7",0 str_Multi8 db "Multi8",0 str_HouseAllyOne db "HouseAllyOne",0 str_HouseAllyTwo db "HouseAllyTwo",0 str_HouseAllyThree db "HouseAllyThree",0 str_HouseAllyFour db "HouseAllyFour",0 str_HouseAllyFive db "HouseAllyFive",0 str_HouseAllySix db "HouseAllySix",0 str_HouseAllySeven db "HouseAllySeven",0 str_Multi1_Alliances db "Multi1_Alliances",0 str_Multi2_Alliances db "Multi2_Alliances",0 str_Multi3_Alliances db "Multi3_Alliances",0 str_Multi4_Alliances db "Multi4_Alliances",0 str_Multi5_Alliances db "Multi5_Alliances",0 str_Multi6_Alliances db "Multi6_Alliances",0 str_Multi7_Alliances db "Multi7_Alliances",0 str_Multi8_Alliances db "Multi8_Alliances",0 str_Spawn1 db "Spawn1",0 str_Spawn2 db "Spawn2",0 str_Spawn3 db "Spawn3",0 str_Spawn4 db "Spawn4",0 str_Spawn5 db "Spawn5",0 str_Spawn6 db "Spawn6",0 str_Spawn7 db "Spawn7",0 str_Spawn8 db "Spawn8",0 str_AllyBySpawnLocation db "AllyBySpawnLocation",0 str_message_fmt db "%s: %s",0 str_AutoSSFileNameFormat db"AUTOSS\\AutoSS-%d-%d_%d.PCX",0 str_AutoSSDir db"./AutoSS",0 str_UseGraphicsPatch: db "UseGraphicsPatch",0 str_ForceLowestDetailLevel db"ForceLowestDetailLevel",0 str_InvisibleSouthDisruptorWave db"InvisibleSouthDisruptorWave",0 str_Video_Windowed: db"Video.Windowed",0 str_Video_WindowedScreenHeight db"Video.WindowedScreenHeight",0 str_Video_WindowedScreenWidth db"Video.WindowedScreenWidth",0 str_InternetDisabled db"This version of Tiberian Sun only supports online play on CnCNet 5 (www.cncnet.org)",0 str_NoCD db"NoCD",0 str_SaveGameLoadFolder db"Saved Games\%s",0,0,0,0,0,0,0,0 str_SaveGameFolderFormat db"Saved Games\*.%3s",0 str_SaveGameFolderFormat2 db"Saved Games\SAVE%04lX.%3s",0 str_SaveGamesFolder db"Saved Games",0 str_bue_li24_pcx db"bue_li24.pcx",0 str_bue_mi24_pcx db"bue_mi24.pcx",0 str_bue_ri24_pcx db"bue_ri24.pcx",0 section .text _Read_Scenario_INI_Fix_Spawner_DifficultyMode_Setting: cmp dword [IsSpawnArgPresent], 0 jz .Ret cmp dword [SessionType], 0 jnz .Ret pushad SpawnINI_Get_Bool str_Settings, str_IsSinglePlayer, 0 cmp al, 0 jz .out SpawnINI_Get_Int str_Settings, str_DifficultyModeComputer, 1 push eax SpawnINI_Get_Int str_Settings, str_DifficultyModeHuman, 1 pop edx mov ebx, [ScenarioStuff] mov dword [ebx+0x60C], edx ; DifficultyModeComputer mov dword [ebx+0x608], eax ; DifficultyModeHuman mov dword [SelectedDifficulty], eax .out: popad .Ret: ; The 2 commented-out lines below cause the difficulty level to change to ; Normal after completing a mission from a loaded campaign save ;mov eax, dword [SelectedDifficulty] ;mov dword [0x7a2f0c], eax mov eax, [ScenarioStuff] jmp 0x005DD528 _Read_Scenario_Custom_Load_Screen_Spawner: cmp BYTE [CustomLoadScreen], 0 jz .Ret mov esi, CustomLoadScreen .Ret: push 40590000h jmp 0x005DBCC8 _UnitClass__Read_INI_Jump_Out_When_Units_Section_Missing: cmp eax, ebx jle .Jump_Out jmp 0x00658613 .Jump_Out: jmp 0x00658A10 _Read_Scenario_INI_Dont_Create_Units_Earlier: call 0x0058C980 push eax push ebp call _read_tut_from_map pop eax cmp dword [SessionType], 0 jz .Ret push 0 push 0x0070CAA8 ; offset aOfficial ; "Official" push 0x007020A8 ; offset aBasic ; "Basic" mov ecx, ebp call INIClass__GetBool mov cl, al call 0x005DD290 ; Create_Units(int) push ebp call _ally_by_spawn_location call initMumble .Ret: jmp 0x005DDAF6 _Read_Scenario_INI_Dont_Create_Units_Earlier_Dont_Create_Twice: jmp 0x005DDEF8 _HouseClass__Computer_Paranoid_Disable_With_Spawner: cmp dword [IsSpawnArgPresent], 1 jz .Ret .Normal_Code: mov ecx, [HouseClassArray_Count] jmp 0x004C3636 .Ret: jmp 0x004C3700 ; jump to RETN instruction _Assign_Houses_AI_Countries: mov ebp, [HouseClassArray_Count] cmp dword [HouseCountriesArray+ebp*4], -1 jz .Ret mov ecx, [HouseCountriesArray+ebp*4] mov ecx,[edx+ecx*4] .Ret: push ecx mov ecx, eax call 0x004BA0B0 ; HouseClass::HouseClass(HousesType) jmp 0x005DE3DF _HouseClass__AI_Attack_Stuff_Alliance_Check: cmp esi, edi jz 0x004C0777 push esi mov ecx, edi call 0x004BDA20 ; HouseClass::Is_Ally cmp al, 1 jz 0x004C0777 .Ret: jmp 0x004C06F7 _sub_5ED470_Dont_Read_Scenario_Descriptions_When_Spawner_Active: cmp dword [IsSpawnArgPresent], 1 jz .Ret call SessionClass__Read_Scenario_Descriptions .Ret: call [_imp__timeGetTime] jmp 0x005ED482 _WinMain_Read_Check_Spawn_Arg: pushad call [_imp__GetCommandLineA] push str_SpawnArg push eax call stristr_ add esp, 8 xor ebx, ebx cmp eax, 0 setne bl mov [IsSpawnArgPresent], ebx popad cmp dword [IsSpawnArgPresent], 1 je .Normal_Code ; -SPAWN arg not found, display error message asking to run the client instead push 16 ; uType push str_GameNameTitle ; Title push str_PleaseRunClient ; Text push 0 ; hWnd call [0x006CA458] ; ds:MessageBoxA jmp 0x005FFCB0 .Normal_Code: call 0x00472540 ; Init_Language jmp 0x005FFDC4 Init_Game_Spawner: lea eax, [UsedSpawnsArray] push 32 ; Size push 0xFF ; Val push eax ; Dst call memset add esp, 0Ch retn _Init_Game_Check_Spawn_Arg_No_Intro: pushad call Init_Game_Spawner popad cmp dword [IsSpawnArgPresent], 0 jz .Normal_Code .No_Intro: jmp 0x004E0848 .Normal_Code: and ecx, 4 cmp cl, 4 jmp 0x004E0792 _HouseClass__Make_Ally_STFU_when_Allying_In_Loading_Screen_Spawner: cmp byte [IsDoingAlliancesSpawner], 1 jz 0x004BDE68 test al, al ; hooked by patch jz 0x4BDE68 jmp 0x004BDDB9 _SessionClass__Free_Scenario_Descriptions_RETN_Patch: retn _Send_Statistics_Packet_Return_If_Skirmish: cmp dword [SessionType], 5 jz .ret ; Sending statistics causes loaded multiplayer games to crash when the game ends pushad SpawnINI_Get_Bool str_Settings, str_LoadSaveGame, 0 cmp al, 0 popad jnz .ret sub esp, 374h jmp 0x00609476 .ret: jmp 0x0060A80A ; jump to retn statement ; args <House number>, <ColorType> %macro Set_House_Color 3 mov eax, %2 cmp eax, -1 jz .Dont_Set_Color_%3 mov edi, [HouseClassArray_Vector] ; HouseClassArray mov edi, [edi+%1*4] ; mov dword [edi+0x10DFC], eax mov esi, [edi+0x24] mov dword [esi+0x6C], eax mov dword [edi+10DFCh], eax push eax call Get_MP_Color mov dword [edi+0x10DFC], eax mov ecx, edi call 0x004CBAA0 .Dont_Set_Color_%3: %endmacro ; args <House number>, <HouseType> %macro Set_House_Country 3 mov eax, %2 cmp eax, -1 jz .Dont_Set_Country_%3 mov edi, [HouseClassArray_Vector] mov edi, [edi+%1*4] mov ecx, [HouseTypesArray] mov eax, [ecx+eax*4] mov dword [edi+24h], eax .Dont_Set_Country_%3: %endmacro ; args <House number>, <identifier> %macro Set_Spectator 2 cmp dword [IsSpectatorArray+4*%1], 0 jz .No_Spectator_%2 mov edi, [HouseClassArray_Vector] mov edi, [edi+%1*4] xor eax, eax cmp dword [IsSpectatorArray+4*%1], 1 sete al mov byte [edi+0x0CB], 1 .No_Spectator_%2: %endmacro ; args <House number>, <DifficultyType> %macro Set_House_Handicap 3 mov eax, %2 cmp eax, -1 jz .Dont_Set_Handicap_%3 mov edi, [HouseClassArray_Vector] mov edi, [edi+%1*4] push eax mov ecx, edi call HouseClass__Assign_Handicap ; DiffType HouseClass::Assign_Handicap(DiffType) .Dont_Set_Handicap_%3: %endmacro ; args <House number>, <House number to ally> %macro House_Make_Ally 3 mov eax, %2 cmp eax, -1 jz .Dont_Make_Ally_%3 mov esi, [HouseClassArray_Vector] ; HouseClassArray mov edi, [esi+4*%1] push eax mov ecx, edi call HouseClass__Make_Ally ; mov eax, [esi+4*eax] ; mov esi, [edi+0x578] ; mov ecx, [eax+0x20] ; mov eax, 1 ; shl eax, cl ; or esi, eax ; mov [edi+0x578], esi .Dont_Make_Ally_%3: %endmacro ; args <string of section to load from>, <House number which will ally> %macro House_Make_Allies_Spawner 3 SpawnINI_Get_Int %1, str_HouseAllyOne, -1 cmp al, -1 jz .Dont_Ally_Multi1_%3 House_Make_Ally %2, eax, a%3 .Dont_Ally_Multi1_%3: SpawnINI_Get_Int %1, str_HouseAllyTwo, -1 cmp al, -1 jz .Dont_Ally_Multi2_%3 House_Make_Ally %2, eax, b%3 .Dont_Ally_Multi2_%3: SpawnINI_Get_Int %1, str_HouseAllyThree, -1 cmp al, -1 jz .Dont_Ally_Multi3_%3 House_Make_Ally %2, eax, c%3 .Dont_Ally_Multi3_%3: SpawnINI_Get_Int %1, str_HouseAllyFour, -1 cmp al, -1 jz .Dont_Ally_Multi4_%3 House_Make_Ally %2, eax, d%3 .Dont_Ally_Multi4_%3: SpawnINI_Get_Int %1, str_HouseAllyFive, -1 cmp al, -1 jz .Dont_Ally_Multi5_%3 House_Make_Ally %2, eax, e%3 .Dont_Ally_Multi5_%3: SpawnINI_Get_Int %1, str_HouseAllySix, -1 cmp al, -1 jz .Dont_Ally_Multi6_%3 House_Make_Ally %2, eax, f%3 .Dont_Ally_Multi6_%3: SpawnINI_Get_Int %1, str_HouseAllySeven, -1 cmp al, -1 jz .Dont_Ally_Multi7_%3 House_Make_Ally %2, eax, g%3 .Dont_Ally_Multi7_%3: %endmacro Load_House_Countries_Spawner: SpawnINI_Get_Int str_HouseCountries, str_Multi1, -1 mov dword [HouseCountriesArray+0], eax SpawnINI_Get_Int str_HouseCountries, str_Multi2, -1 mov dword [HouseCountriesArray+4], eax SpawnINI_Get_Int str_HouseCountries, str_Multi3, -1 mov dword [HouseCountriesArray+8], eax SpawnINI_Get_Int str_HouseCountries, str_Multi4, -1 mov dword [HouseCountriesArray+12], eax SpawnINI_Get_Int str_HouseCountries, str_Multi5, -1 mov dword [HouseCountriesArray+16], eax SpawnINI_Get_Int str_HouseCountries, str_Multi6, -1 mov dword [HouseCountriesArray+20], eax SpawnINI_Get_Int str_HouseCountries, str_Multi7, -1 mov dword [HouseCountriesArray+24], eax SpawnINI_Get_Int str_HouseCountries, str_Multi8, -1 mov dword [HouseCountriesArray+28], eax retn Load_House_Colors_Spawner: SpawnINI_Get_Int str_HouseColors, str_Multi1, -1 mov dword [HouseColorsArray+0], eax SpawnINI_Get_Int str_HouseColors, str_Multi2, -1 mov dword [HouseColorsArray+4], eax SpawnINI_Get_Int str_HouseColors, str_Multi3, -1 mov dword [HouseColorsArray+8], eax SpawnINI_Get_Int str_HouseColors, str_Multi4, -1 mov dword [HouseColorsArray+12], eax SpawnINI_Get_Int str_HouseColors, str_Multi5, -1 mov dword [HouseColorsArray+16], eax SpawnINI_Get_Int str_HouseColors, str_Multi6, -1 mov dword [HouseColorsArray+20], eax SpawnINI_Get_Int str_HouseColors, str_Multi7, -1 mov dword [HouseColorsArray+24], eax SpawnINI_Get_Int str_HouseColors, str_Multi8, -1 mov dword [HouseColorsArray+28], eax retn Load_Spawn_Locations_Spawner: SpawnINI_Get_Int str_SpawnLocations, str_Multi1, -1 mov dword [SpawnLocationsArray+0], eax SpawnINI_Get_Int str_SpawnLocations, str_Multi2, -1 mov dword [SpawnLocationsArray+4], eax SpawnINI_Get_Int str_SpawnLocations, str_Multi3, -1 mov dword [SpawnLocationsArray+8], eax SpawnINI_Get_Int str_SpawnLocations, str_Multi4, -1 mov dword [SpawnLocationsArray+12], eax SpawnINI_Get_Int str_SpawnLocations, str_Multi5, -1 mov dword [SpawnLocationsArray+16], eax SpawnINI_Get_Int str_SpawnLocations, str_Multi6, -1 mov dword [SpawnLocationsArray+20], eax SpawnINI_Get_Int str_SpawnLocations, str_Multi7, -1 mov dword [SpawnLocationsArray+24], eax SpawnINI_Get_Int str_SpawnLocations, str_Multi8, -1 mov dword [SpawnLocationsArray+28], eax retn Load_House_Handicaps_Spawner: SpawnINI_Get_Int str_HouseHandicaps, str_Multi1, -1 mov dword [HouseHandicapsArray+0], eax SpawnINI_Get_Int str_HouseHandicaps, str_Multi2, -1 mov dword [HouseHandicapsArray+4], eax SpawnINI_Get_Int str_HouseHandicaps, str_Multi3, -1 mov dword [HouseHandicapsArray+8], eax SpawnINI_Get_Int str_HouseHandicaps, str_Multi4, -1 mov dword [HouseHandicapsArray+12], eax SpawnINI_Get_Int str_HouseHandicaps, str_Multi5, -1 mov dword [HouseHandicapsArray+16], eax SpawnINI_Get_Int str_HouseHandicaps, str_Multi6, -1 mov dword [HouseHandicapsArray+20], eax SpawnINI_Get_Int str_HouseHandicaps, str_Multi7, -1 mov dword [HouseHandicapsArray+24], eax SpawnINI_Get_Int str_HouseHandicaps, str_Multi8, -1 mov dword [HouseHandicapsArray+28], eax retn _Read_Scenario_INI_Assign_Houses_And_Spawner_House_Settings: pushad call Assign_Houses cmp dword [SpawnerActive], 0 jz .Ret ; Set_House_Country 0, dword [HouseCountriesArray+0], a ; Set_House_Country 1, dword [HouseCountriesArray+4], b ; Set_House_Country 2, dword [HouseCountriesArray+8], c ; Set_House_Country 3, dword [HouseCountriesArray+12], d ; Set_House_Country 4, dword [HouseCountriesArray+16], e ; Set_House_Country 5, dword [HouseCountriesArray+20], f ; Set_House_Country 6, dword [HouseCountriesArray+24], g ; Set_House_Country 7, dword [HouseCountriesArray+28], h Set_House_Color 0, dword [HouseColorsArray+0], a Set_House_Color 1, dword [HouseColorsArray+4], b Set_House_Color 2, dword [HouseColorsArray+8], c Set_House_Color 3, dword [HouseColorsArray+12], d Set_House_Color 4, dword [HouseColorsArray+16], e Set_House_Color 5, dword [HouseColorsArray+20], f Set_House_Color 6, dword [HouseColorsArray+24], g Set_House_Color 7, dword [HouseColorsArray+28], h mov byte [IsDoingAlliancesSpawner], 1 House_Make_Allies_Spawner str_Multi1_Alliances, 0, a House_Make_Allies_Spawner str_Multi2_Alliances, 1, b House_Make_Allies_Spawner str_Multi3_Alliances, 2, c House_Make_Allies_Spawner str_Multi4_Alliances, 3, d House_Make_Allies_Spawner str_Multi5_Alliances, 4, e House_Make_Allies_Spawner str_Multi6_Alliances, 5, f House_Make_Allies_Spawner str_Multi7_Alliances, 6, g House_Make_Allies_Spawner str_Multi8_Alliances, 7, h lea eax, [SpawnerTeamName] SpawnINI_Get_String str_Settings, str_TeamName, 0, eax, 128 cmp byte[SpawnerTeamName], 0 je .dont_set_name push SpawnerTeamName call set_team_name .dont_set_name: mov byte [IsDoingAlliancesSpawner], 0 Set_House_Handicap 0, dword [HouseHandicapsArray+0], a Set_House_Handicap 1, dword [HouseHandicapsArray+4], b Set_House_Handicap 2, dword [HouseHandicapsArray+8], c Set_House_Handicap 3, dword [HouseHandicapsArray+12], d Set_House_Handicap 4, dword [HouseHandicapsArray+16], e Set_House_Handicap 5, dword [HouseHandicapsArray+20], f Set_House_Handicap 6, dword [HouseHandicapsArray+24], g Set_House_Handicap 7, dword [HouseHandicapsArray+28], h Set_Spectator 0, a Set_Spectator 1, b Set_Spectator 2, c Set_Spectator 3, d Set_Spectator 4, e Set_Spectator 5, f Set_Spectator 6, g Set_Spectator 7, h .Ret: popad jmp 0x005E08E8 Load_SPAWN_INI: %push push ebp mov ebp,esp sub esp,128 %define TempFileClass ebp-128 ; initialize FileClass push str_spawn_ini lea ecx, [TempFileClass] call FileClass__FileClass ; check ini exists lea ecx, [TempFileClass] xor edx, edx push edx call FileClass__Is_Available test al, al je .error ; initialize INIClass mov ecx, INIClass_SPAWN call INIClass__INIClass ; load FileClass to INIClass push 0 push 0 lea eax, [TempFileClass] push eax Mov ecx, INIClass_SPAWN call INIClass__Load mov eax, 1 jmp .exit .error: mov eax, 0 .exit: mov esp,ebp pop ebp retn %pop Initialize_Spawn: %push push ebp mov ebp,esp sub esp,128 %define TempBuf ebp-128 cmp dword [IsSpawnArgPresent], 0 je .Exit_Error cmp dword [SpawnerActive], 1 jz .Ret_Exit mov dword [SpawnerActive], 1 mov dword [PortHack], 1 ; default enabled call Load_SPAWN_INI cmp eax, 0 jz .Exit_Error ; get pointer to inet_addr push str_wsock32_dll call [_imp__LoadLibraryA] push str_inet_addr push eax call [_imp__GetProcAddress] mov [inet_addr], eax call Load_House_Colors_Spawner call Load_House_Countries_Spawner call Load_House_Handicaps_Spawner call Load_Spawn_Locations_Spawner call Load_Spectators_Spawner mov byte [GameActive], 1 ; needs to be set here or the game gets into an infinite loop trying to create spawning units ; set session mov dword [SessionType], 5 SpawnINI_Get_Int str_Settings, str_GameID, 0 mov dword [WOLGameID], eax SpawnINI_Get_Int str_Settings, str_UnitCount, 1 mov dword [UnitCount], eax SpawnINI_Get_Int str_Settings, str_TechLevel, 10 mov dword [TechLevel], eax SpawnINI_Get_Int str_Settings, str_AIPlayers, 0 mov dword [AIPlayers], eax SpawnINI_Get_Int str_Settings, str_AIDifficulty, 1 mov dword [AIDifficulty], eax SpawnINI_Get_Bool str_Settings, str_HarvesterTruce, 0 mov byte [HarvesterTruce], al SpawnINI_Get_Bool str_Settings, str_BridgeDestroy, 1 mov byte [BridgeDestroy], al SpawnINI_Get_Bool str_Settings, str_FogOfWar, 0 mov byte [FogOfWar], al ;SpawnINI_Get_Bool str_Settings, str_EasyShroud, 0 ;mov byte [EasyShroud], al mov byte [FogOfWar], al ; EasyShroud requires Fog SpawnINI_Get_Bool str_Settings, str_BuildOffAlly, 0 mov byte [BuildOffAlly], al SpawnINI_Get_Bool str_Settings, str_Crates, 0 mov byte [Crates], al SpawnINI_Get_Bool str_Settings, str_ShortGame, 0 mov byte [ShortGame], al SpawnINI_Get_Bool str_Settings, str_Bases, 1 mov byte [Bases], al SpawnINI_Get_Bool str_Settings, str_AlliesAllowed, 1 mov byte [AlliesAllowed], al lea eax, [MapHash] SpawnINI_Get_String str_Settings, str_MapHash, str_Empty, eax, 255 SpawnINI_Get_Bool str_Settings, str_SharedControl, 0 mov byte [SharedControl], al SpawnINI_Get_Bool str_Settings, str_MCVRedeploy, 1 mov byte [MCVRedeploy], al SpawnINI_Get_Int str_Settings, str_Credits, 10000 mov dword [Credits], eax SpawnINI_Get_Int str_Settings, str_GameSpeed, 0 mov dword [GameSpeed], eax SpawnINI_Get_Bool str_Settings, str_MultiEngineer, 0 mov byte [MultiEngineer], al SpawnINI_Get_Bool str_Settings, str_Host, 0 mov byte [IsHost], al SpawnINI_Get_Bool str_Settings, str_AllyBySpawnLocation, 0 mov byte [AllyBySpawnLocation], al lea eax, [CustomLoadScreen] SpawnINI_Get_String str_Settings, str_CustomLoadScreen, str_Empty, eax, 256 SpawnINI_Get_Bool str_Settings, str_RunAutoSS, 0 mov byte [RunAutoSS], al SpawnINI_Get_Int str_Settings, str_AutoSaveGame, -1 mov dword [AutoSaveGame], eax mov dword [NextAutoSave], eax mov byte [SavesDisabled], 0 SpawnINI_Get_Bool str_Settings, str_AimableSams, 0 mov byte [AimableSams], al SpawnINI_Get_Bool str_Settings, str_IntegrateMumble, 0 mov byte [IntegrateMumbleSpawn], al SpawnINI_Get_Bool str_Settings, str_AttackNeutralUnits,0 mov byte [AttackNeutralUnits], al SpawnINI_Get_Bool str_Settings, str_ScrapMetal,0 mov byte [ScrapMetal], al SpawnINI_Get_Bool str_Settings, str_AutoDeployMCV,0 mov byte [AutoDeployMCV], al SpawnINI_Get_Bool str_Settings, str_SkipScoreScreen, dword[SkipScoreScreen] mov byte [SkipScoreScreen], al SpawnINI_Get_Bool str_Settings, str_QuickMatch, 0 mov byte [QuickMatch], al SpawnINI_Get_Bool str_Settings, str_CoachMode, 0 mov byte [CoachMode], al SpawnINI_Get_Bool str_Settings, str_AutoSurrender, 1 mov byte [AutoSurrender], al ; tunnel ip lea eax, [TempBuf] SpawnINI_Get_String str_Tunnel, str_Ip, str_Empty, eax, 32 lea eax, [TempBuf] push eax call [inet_addr] mov [TunnelIp], eax ; tunnel port SpawnINI_Get_Int str_Tunnel, str_Port, 0 and eax, 0xffff push eax call htons mov word [TunnelPort], ax ; tunnel id SpawnINI_Get_Int str_Settings, str_Port, 0 and eax, 0xffff push eax call htons mov word [TunnelId], ax cmp word[TunnelPort],0 jne .nosetport SpawnINI_Get_Int str_Settings, str_Port, 1234 mov word [ListenPort], ax jmp .portset .nosetport: mov word [ListenPort], 0 .portset: SpawnINI_Get_Bool str_Settings, str_Firestorm, 0 cmp al, 0 jz .No_Firestorm ; Firestorm related variables mov dword [0x006F2638], 3 ; FIXME: name this mov dword [0x006F263C], 3 ; FIXME: name this .No_Firestorm: mov ecx, SessionClass_this call SessionClass__Read_Scenario_Descriptions ; scenario lea eax, [ScenarioName] SpawnINI_Get_String str_Settings, str_Scenario, str_Empty, eax, 32 ; push str_gcanyonmap ; push 0x007E28B0 ; map buffer used by something ; call 0x006BE630 ; strcpy ; add esp, 8 call Add_Human_Player call Add_Human_Opponents SpawnINI_Get_Bool str_Settings, str_IsSinglePlayer, 0 cmp al, 0 jz .Not_Single_Player mov dword [SessionType], 0 ; single player .Not_Single_Player: ; Needs to be done after SessionClass is set, or the seed value will be overwritten ; inside the Init_Random() call if sessiontype == SKIRMISH SpawnINI_Get_Int str_Settings, str_Seed, 0 mov dword [Seed], eax call Init_Random ; Initialize networking push 35088h call new add esp, 4 mov ecx, eax call UDPInterfaceClass__UDPInterfaceClass mov [WinsockInterface_this], eax mov ecx, [WinsockInterface_this] call WinsockInterfaceClass__Init push 0 mov ecx, [WinsockInterface_this] call UDPInterfaceClass__Open_Socket mov ecx, [WinsockInterface_this] call WinsockInterfaceClass__Start_Listening mov ecx, [WinsockInterface_this] call WinsockInterfaceClass__Discard_In_Buffers mov ecx, [WinsockInterface_this] call WinsockInterfaceClass__Discard_Out_Buffers mov ecx, IPXManagerClass_this push 1 ; SetGobally? push 258h ; RetryTimeOut push 0FFFFFFFFh push 3Ch ; RetryDelta call IPXManagerClass__Set_Timing SpawnINI_Get_Int str_Settings, str_Protocol, 0 mov dword [ProtocolVersion], eax mov dword [RequestedFPS], 60 cmp dword [ProtocolVersion], 0 jnz .protocol_2 ; ProtocolVersion 0 stuff ; We just hack protocol 2 to act like protocol zero mov dword[ProtocolVersion], 2 mov byte[UseProtocolZero], 1 ; FrameSendRate should not be configurable in proto 0 mov dword [FrameSendRate], 2 ; This initial MaxAhead, it will get overridden by the PreCalcMaxAhead after the first second of the game SpawnINI_Get_Int str_Settings, str_MaxAhead, 12 mov dword [MaxAhead], eax SpawnINI_Get_Int str_Settings, str_PreCalcMaxAhead, 0 mov dword [PreCalcMaxAhead], eax test eax, eax jz .continue_network SpawnINI_Get_Int str_Settings, str_PreCalcFrameRate, { dword [RequestedFPS] } mov dword [PreCalcFrameRate], eax jmp .continue_network .protocol_2: SpawnINI_Get_Int str_Settings, str_FrameSendRate, 5 mov dword [FrameSendRate], eax ; The initial MaxAhead, it will be overriden based on latency after the first second of the game ; In Protocol 2, MaxAhead must be a multiple of the FrameSendRate imul eax, [FrameSendRate] mov dword [MaxAhead], eax SpawnINI_Get_Int str_Settings, str_MaxAhead, { dword [MaxAhead] } mov dword [MaxAhead], eax ;WOL settings ; mov dword [MaxAhead], 40 ; mov dword [FrameSendRate], 10 .continue_network: mov dword [MaxMaxAhead], 0 mov dword [LatencyFudge], 0 call Init_Network mov dword eax, [NameNodes_CurrentSize] mov dword [HumanPlayers], eax SpawnINI_Get_Bool str_Settings, str_LoadSaveGame, 0 cmp al, 0 jz .Dont_Load_Savegame lea eax, [SaveGameNameBuf] SpawnINI_Get_String str_Settings, str_SaveGameName, str_Empty, eax, 60 mov byte [0x7E48FC], 0 mov byte [0x7E4040], 0 push -1 xor edx, edx mov ecx, ScenarioName ; Starting the scenario sets up some connection stuff that is necessary ; for multiplayer saves to work call Start_Scenario lea ecx, [SaveGameNameBuf] call Load_Game jmp .Dont_Load_Scenario .Dont_Load_Savegame: ; need to supply different args to Start_Scenario() for single player cmp dword [SessionType], 0 jnz .Start_Scenario_NOT_Singleplayer ; start scenario for singleplayer push 0 mov edx, 1 mov ecx, ScenarioName call Start_Scenario jmp .Past_Start_Scenario .Start_Scenario_NOT_Singleplayer: ; start scenario for multiplayer push -1 xor edx, edx mov ecx, ScenarioName call Start_Scenario .Past_Start_Scenario: ; modify some RulesClass (RULES.INI stuff) settings mov esi, [0x0074C488] ; RulesClass pointer ; Load MultipleFactory from SPAWN.INI if not missing ; Else use the value already loaded from a RULES.INI file SpawnINI_Get_Fixed str_Settings, str_MultipleFactory, dword [esi+2B0h], dword [esi+2B4h] fstp qword [esi+2B0h] ; THIS ONE DOESN'T SEEM TO WORK ; mov byte [esi+0F48h], 0 ; Disable Paranoid RulesClass setting .Dont_Load_Scenario: ; HACK: If SessonType was set to WOL then set it to LAN now ; We had to set SessionType to WOL to make sure players connect ; while Start_Scenario was being executed cmp dword [SessionType], 4 jnz .Dont_Set_SessionType_To_Lan mov dword [SessionType], 3 .Dont_Set_SessionType_To_Lan: mov ecx, SessionClass_this call SessionClass__Create_Connections mov ecx, IPXManagerClass_this push 1 push 258h push 0FFFFFFFFh push 3Ch call IPXManagerClass__Set_Timing call 0x00462C60 ; FIXME: name this and everything below mov ecx, [WWMouseClas_Mouse] mov edx, [ecx] call dword [edx+0Ch] mov ecx, [0x0074C5DC] push 0 mov eax, [ecx] call dword [eax+18h] push 0 mov cl, 1 mov edx, [0x0074C5DC] call 0x004B96C0 mov ecx, [WWMouseClas_Mouse] mov edx, [ecx] call dword [edx+10h] mov eax, [0x0074C5DC] mov [0x0074C5E4], eax push 0 push 13h mov ecx, MouseClass_Map call 0x00562390 mov ecx, MouseClass_Map call 0x005621F0 push 1 mov ecx, MouseClass_Map call 0x005F3E60 push 0 mov ecx, MouseClass_Map call 0x004B9440 call 0x00462C60 ;; Hide mouse, shouldn't be needed and makes mouse invisible in the match if it's there. ; mov ecx, [0x0074C8F0] ; mov edx, [ecx] ; call dword [edx+0Ch] .Ret: mov eax, 1 jmp .exit .Ret_Exit: mov eax, 0 jmp .exit .Exit_Error: mov eax, -1 jmp .exit .exit: mov esp,ebp pop ebp retn %pop _Select_Game_Init_Spawner: push ebx call Initialize_Spawn cmp eax,-1 pop ebx ; if spawn not initialized, go to main menu je .Normal_Code retn .Normal_Code: mov ecx, [WWMouseClas_Mouse] sub esp, 1ACh mov eax, [ecx] push ebx push ebp push esi push edi jmp 0x004E1DF2 Add_Human_Player: %push push ebp mov ebp,esp sub esp,4 %define TempPtr ebp-4 push 0x4D call new add esp, 4 mov esi, eax lea ecx, [esi+14h] call IPXAddressClass__IPXAddressClass lea eax, [esi] SpawnINI_Get_String str_Settings, str_Name, str_Empty, eax, 0x14 ; lea ecx, ; push str_debugplayer ; push ecx ; call 0x006BE630 ; strcpy ; add esp, 8 ; Player side SpawnINI_Get_Int str_Settings, str_Side, 0 mov dword [esi+0x35], eax ; side push eax ; Sidebar hack for mods which add new sides and new sidebars for them ; this will not fuck invert al which is needed for normal TS sidebar loading ; as GDI needs 1 and Nod 0 for sidebar (which is the opposite of their side index) SpawnINI_Get_Bool str_Settings, str_SidebarHack, 0 cmp al, 1 pop eax jz .Sidebar_Hack ; Invert AL to set byte related to what sidebar and speech graphics to load cmp al, 1 jz .Set_AL_To_Zero mov al, 1 jmp .Past_AL_Invert .Set_AL_To_Zero: mov al, 0 .Past_AL_Invert: .Sidebar_Hack: mov byte [0x7E2500], al ; For side specific mix files loading and stuff, without sidebar and speech hack mov ebx, [ScenarioStuff] mov byte [ebx+1D91h], al SpawnINI_Get_Int str_Settings, str_Color, 0 mov dword [esi+0x39], eax ; color mov dword [PlayerColor], eax mov dword [esi+0x41], -1 mov [TempPtr], esi lea eax, [TempPtr] push eax mov ecx, NameNodeVector call NameNodeVector_Add mov esp,ebp pop ebp retn %pop Add_Human_Opponents: %push push ebp mov ebp,esp sub esp,128+128+4+4 %define TempBuf ebp-128 %define OtherSection ebp-128-128 %define TempPtr ebp-128-128-4 %define CurrentOpponent ebp-128-128-4-4 ; copy opponents xor ecx,ecx mov dword [CurrentOpponent], ecx .next_opp: mov ecx, [CurrentOpponent] add ecx,1 mov dword [CurrentOpponent], ecx push ecx push str_OtherSectionFmt ; Other%d lea eax, [OtherSection] push eax call _sprintf add esp, 0x0C push 0x4D call new add esp, 4 mov esi, eax lea ecx, [esi+14h] call IPXAddressClass__IPXAddressClass lea eax, [esi] lea ecx, [OtherSection] SpawnINI_Get_String ecx, str_Name, str_Empty, eax, 0x14 lea eax, [esi] mov eax, [eax] test eax, eax ; if no name present for this section, this is the last je .Exit lea ecx, [OtherSection] SpawnINI_Get_Int ecx, str_Side, -1 mov dword [esi+0x35], eax ; side cmp eax,-1 je .next_opp lea ecx, [OtherSection] SpawnINI_Get_Int ecx, str_Color, -1 mov dword [esi+0x39], eax ; color cmp eax,-1 je .next_opp ; ignored lea ecx, [OtherSection] SpawnINI_Get_Bool ecx, str_Ignored, 0 cmp al, 1 jnz .notIgnored xor eax, eax mov al, byte[esi+0x39] mov byte[eax+IgnoredColors], 1 .notIgnored: mov eax, 1 mov dword [SessionType], 4 ; HACK: SessonType set to WOL, will be set to LAN later ; set addresses to indexes for send/receive hack mov [esi + 0x14 + SpawnAddress.pad1], word 0 mov ecx, dword [CurrentOpponent] mov [esi + 0x14 + SpawnAddress.id], ecx mov [esi + 0x14 + SpawnAddress.pad2], word 0 lea eax, [TempBuf] lea ecx, [OtherSection] SpawnINI_Get_String ecx, str_Ip, str_Empty, eax, 32 lea eax, [TempBuf] push eax call [inet_addr] mov ecx, dword [CurrentOpponent] dec ecx mov [ecx * ListAddress_size + AddressList + ListAddress.ip], eax lea ecx, [OtherSection] SpawnINI_Get_Int ecx, str_Port, 0 and eax, 0xffff push eax call htons ; disable PortHack if different port than own cmp ax, [ListenPort] je .samePort mov dword [PortHack], 0 .samePort: mov ecx, dword [CurrentOpponent] dec ecx mov [ecx * ListAddress_size + AddressList + ListAddress.port], ax mov dword [esi+0x41], -1 mov byte [esi+0x1E], 1 mov [TempPtr], esi lea eax, [TempPtr] push eax mov ecx, NameNodeVector ; FIXME: name this call NameNodeVector_Add ; FIXME: name this jmp .next_opp .Exit: mov esp,ebp pop ebp retn %pop
libsrc/z80_crt0s/crt0/l_ghtonsint.asm
meesokim/z88dk
0
81184
<filename>libsrc/z80_crt0s/crt0/l_ghtonsint.asm<gh_stars>0 ; Z88 Small C+ Run time Library ; Moved functions over to proper libdefs ; To make startup code smaller and neater! ; ; Quicky to make network progs quicker PUBLIC l_ghtonsint .l_ghtonsint ld a,(hl) inc hl ld l,(hl) ld h,a ret
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_msge2.asm
prismotizm/gigaleak
0
91013
Name: zel_msge2.asm Type: file Size: 198651 Last-Modified: '2016-05-13T04:25:37Z' SHA-1: D34738916A0EACB30BA6EC13A8ECACC93D4A5ED3 Description: null
Task/XML-XPath/AppleScript/xml-xpath-1.applescript
LaudateCorpus1/RosettaCodeData
1
2207
set theXMLdata to "<inventory title=\"OmniCorp Store #45x10^3\"> <section name=\"health\"> <item upc=\"123456789\" stock=\"12\"> <name>Invisibility Cream</name> <price>14.50</price> <description>Makes you invisible</description> </item> <item upc=\"445322344\" stock=\"18\"> <name>Levitation Salve</name> <price>23.99</price> <description>Levitate yourself for up to 3 hours per application</description> </item> </section> <section name=\"food\"> <item upc=\"485672034\" stock=\"653\"> <name>Blork and Freen Instameal</name> <price>4.95</price> <description>A tasty meal in a tablet; just add water</description> </item> <item upc=\"132957764\" stock=\"44\"> <name>Grob winglets</name> <price>3.56</price> <description>Tender winglets of Grob. Just add water</description> </item> </section> </inventory>" on getElementValuesByName(theXML, theNameToFind) set R to {} tell application "System Events" repeat with i in theXML set {theName, theElements} to {i's name, i's XML elements} if (count of theElements) > 0 then set R to R & my getElementValuesByName(theElements, theNameToFind) if theName = theNameToFind then set R to R & i's value end repeat end tell return R end getElementValuesByName on getBlock(theXML, theItem, theInstance) set text item delimiters to "" repeat with i from 1 to theInstance set {R, blockStart, blockEnd} to {{}, "<" & theItem & space, "</" & theItem & ">"} set x to offset of blockStart in theXML if x = 0 then exit repeat set y to offset of blockEnd in (characters x thru -1 of theXML as string) if y = 0 then exit repeat set R to characters x thru (x + y + (length of blockEnd) - 2) of theXML as string set theXML to characters (y + (length of blockEnd)) thru -1 of theXML as string end repeat return R end getBlock tell application "System Events" set xmlData to make new XML data with properties {name:"xmldata", text:theXMLdata} return my getBlock(xmlData's text, "item", 1) -- Solution to part 1 of problem. return my getElementValuesByName(xmlData's contents, "name") -- Solution to part 2 of problem. return my getElementValuesByName(xmlData's contents, "price") -- Solution to part 3 of problem. end tell
Library/Styles/Manip/manipSaveRecall.asm
steakknife/pcgeos
504
246268
COMMENT @---------------------------------------------------------------------- Copyright (c) Berkeley Softworks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: Library/Styles FILE: Manip/manipSaveRecall.asm REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 12/91 Initial version DESCRIPTION: This file contains code for StyleSheetSaveStyle and StyleSheetPrepareForRecallStyle $Id: manipSaveRecall.asm,v 1.1 97/04/07 11:15:28 newdeal Exp $ ------------------------------------------------------------------------------@ SaveRecallBlockHeader struct SRBH_meta ObjLMemBlockHeader SRBH_styleArray lptr SRBH_attrArrays lptr MAX_STYLE_SHEET_ATTRS dup (?) SRBH_attrTokens word MAX_STYLE_SHEET_ATTRS dup (?) SaveRecallBlockHeader ends ManipCode segment resource COMMENT @---------------------------------------------------------------------- FUNCTION: StyleSheetSaveStyle DESCRIPTION: Define a new style CALLED BY: GLOBAL PASS: ss:bp - StyleSheetParams ss:ax - SSCSaveStyleParams RETURN: none DESTROYED: ax, bx, cx, dx, di REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 12/91 Initial version ------------------------------------------------------------------------------@ StyleSheetSaveStyle proc far STYLE_COPY_LOCALS ; if no style array was passed then bail out tst ss:[bp].SSP_styleArray.SCD_chunk jnz 1$ ret 1$: .enter call EnterStyleSheet ; We must allocate a block and put a style array and attribute ; arrays in it. We then copy the elements into this block. We ; set up the block as the "xferArray". ; Since we have already done the EnterStyleSheet, we need to ; manually lock the xfer style. mov ax, LMEM_TYPE_OBJ_BLOCK mov cx, size SaveRecallBlockHeader call MemAllocLMem mov di, ss:[bp] ;ss:di = StyleSheetParams mov ss:[di].SSP_xferStyleArray.SCD_vmFile, 0 mov ss:[di].SSP_xferStyleArray.SCD_vmBlockOrMemHandle, bx mov xferStyleArrayHandle, bx clc pushf pop xferStyleArrayFlags call MemLock ; allocate a style array call Load_dssi_styleArray ;get source data size mov si, ds:[si] mov bx, ds:[si].NAH_dataSize mov cx, ds:[si].CAH_offset ; NOTE: We set the low bit of the chunk handle saved in the ; StyleSheetParams to mark this this is not an object block mov ds, ax clr si clr ax call NameArrayCreate ;*ds:si = xfer style array mov ss:[di].SSP_xferStyleArray.SCD_chunk, si ornf ss:[di].SSP_xferStyleArray.SCD_chunk, STYLE_CHUNK_NOT_IN_OBJ_BLOCK movdw xferStyleArray, dssi mov ds:SRBH_styleArray, si ; allocate attribute arrays createAttrLoop: push di mov ax, CA_NULL_ELEMENT call LockLoopAttrArray ;ds:si = attr array pop di mov si, ds:[si] mov bx, ds:[si].CAH_elementSize mov cx, ds:[si].CAH_offset mov ds, xferStyleArray.segment clr si clr ax call ElementArrayCreate ;*ds:si = element array mov xferStyleArray.segment, ds mov bx, ds:[LMBH_handle] mov ss:[di].SSP_xferAttrArrays.SCD_vmFile, 0 mov ss:[di].SSP_xferAttrArrays.SCD_vmBlockOrMemHandle, bx mov ss:[di].SSP_xferAttrArrays.SCD_chunk, si ornf ss:[di].SSP_xferAttrArrays.SCD_chunk, STYLE_CHUNK_NOT_IN_OBJ_BLOCK add di, size StyleChunkDesc mov bx, attrCounter2 mov ds:[SRBH_attrArrays][bx], si ; unlock attribute array call UnlockLoopAttrArray jnz createAttrLoop clr optBlock clr fromTransfer clr changeDestStyles ; copy the elements copyAttrLoop: mov di, saved_ax ;ss:di = SSCSaveStyleParams add di, attrCounter2 mov ax, ss:[di].SSCSSP_attrTokens ;ax = source token push ax call LockLoopAttrArray ;ds:si = attr array ;ds:di = element mov ax, ds:[di].SSEH_style mov styleToChange, ax ; CopyStyle locks and unlocks attribute arrays, so we can't keep ; this one locked push attrCounter1 call UnlockSpecificAttrArray call CopyStyle ;ax = style in dest mov destStyle, ax mov destCopyFromStyle, ax mov ax, CA_NULL_ELEMENT pop bx call LockSpecificAttrArray pop ax ;ax = element clr dx call CopyElement ;ax = element in dest mov ds, xferStyleArray.segment mov di, attrCounter2 mov ds:[SRBH_attrTokens][di], ax ; unlock attribute array call UnlockLoopAttrArray jnz copyAttrLoop mov di, saved_ax ;ss:di = SSCSaveStyleParams movdw bxsi, ss:[di].SSCSSP_replyObject mov cx, xferStyleArrayHandle mov ax, MSG_STYLE_SHEET_SET_SAVED_STYLE clr di call ObjMessage call FreeOptBlock call LeaveStyleSheet .leave ret StyleSheetSaveStyle endp FreeOptBlock proc near STYLE_COPY_LOCALS .enter inherit far mov bx, optBlock tst bx jz done call MemFree done: .leave ret FreeOptBlock endp COMMENT @---------------------------------------------------------------------- FUNCTION: StyleSheetPrepareForRecallStyle DESCRIPTION: Prepare for recall style by copying saved attributes back into the arrays CALLED BY: GLOBAL PASS: ss:bp - StyleSheetParams cx - block containing saved style RETURN: ss:bp - StyleSheetParams with SSP_attrTokens filled in DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 12/91 Initial version ------------------------------------------------------------------------------@ StyleSheetPrepareForRecallStyle proc far uses bx STYLE_COPY_LOCALS ; if no style array was passed then bail out tst ss:[bp].SSP_styleArray.SCD_chunk jnz 1$ ret 1$: .enter call EnterStyleSheet ; first set up the xferStyleArray mov bx, cx mov xferStyleArrayHandle, bx call MemLock mov ds, ax mov si, ds:SRBH_styleArray ; NOTE: We set the low bit of the chunk handle saved in the ; StyleSheetParams to mark this this is not an object block mov di, ss:[bp] ;ss:di = StyleSheetParams mov ss:[di].SSP_xferStyleArray.SCD_vmFile, 0 mov ss:[di].SSP_xferStyleArray.SCD_vmBlockOrMemHandle, bx mov ss:[di].SSP_xferStyleArray.SCD_chunk, si ornf ss:[di].SSP_xferStyleArray.SCD_chunk, STYLE_CHUNK_NOT_IN_OBJ_BLOCK movdw xferStyleArray, dssi clc pushf pop xferStyleArrayFlags clr optBlock mov fromTransfer, 1 clr changeDestStyles ; fill in the table mov ds, xferStyleArray.segment mov bx, ds:[LMBH_handle] clr di fillLoop: shl di mov ax, ds:[SRBH_attrTokens][di] ;ax = element mov cx, ds:[SRBH_attrArrays][di] ;cx = chunk mov si, di shl si add si, di add si, ss:[bp] mov ss:[si].SSP_xferAttrArrays.SCD_vmFile, 0 mov ss:[si].SSP_xferAttrArrays.SCD_vmBlockOrMemHandle, bx mov ss:[si].SSP_xferAttrArrays.SCD_chunk, cx ornf ss:[si].SSP_xferAttrArrays.SCD_chunk, STYLE_CHUNK_NOT_IN_OBJ_BLOCK shr di inc di cmp di, attrTotal jnz fillLoop ; copy in the attributes copyAttrLoop: mov ds, xferStyleArray.segment mov di, attrCounter2 mov ax, ds:[SRBH_attrTokens][di] ;ax = element push ax mov ax, CA_NULL_ELEMENT call LockLoopAttrArray ;ds:si = attr array ;ds:di = element call Load_dssi_xferAttrArray pop ax push ax call ChunkArrayElementToPtr mov ax, ds:[di].SSEH_style mov styleToChange, ax ; CopyStyle locks and unlocks attribute arrays, so we can't keep ; this one locked push attrCounter1 call UnlockSpecificAttrArray call CopyStyle ;ax = style in dest mov destStyle, ax mov destCopyFromStyle, ax mov ax, CA_NULL_ELEMENT pop bx call LockSpecificAttrArray pop ax ;ax = element clr dx call CopyElement ;ax = element in dest mov di, ss:[bp] add di, attrCounter2 mov ss:[di].SSP_attrTokens, ax call UnlockLoopAttrArray jnz copyAttrLoop call FreeOptBlock push xferStyleArrayHandle call LeaveStyleSheet pop bx call MemDecRefCount .leave ret StyleSheetPrepareForRecallStyle endp ManipCode ends
macros.asm
kosmospredanie/mips-asm-examples
0
244088
<gh_stars>0 # macros.asm # # Terminates the program. # # @param $val Exit status .macro exit (%val) li $a0, %val li $v0, 17 # Code for syscall: exit2 syscall .end_macro # Prints the given integer. # # @param %val May be either an immediate value or register name .macro print_int (%val) add $a0, $zero, %val li $v0, 1 # Code for syscall: print integer syscall .end_macro # Prints the given character. # # @param %val A character literal .macro print_char (%val) li $a0, %val li $v0, 11 # Code for syscall: print character syscall .end_macro # Prints the string of the given address. # # @param %pstr A pointer to a string .macro print_stra (%pstr) la $a0, %pstr li $v0, 4 # Code for syscall: print string syscall .end_macro # Prints the given string. # # @param %str A string literal .macro print_str (%str) .data printstr_label: .asciiz %str .text print_stra(printstr_label) .end_macro # Reads an integer. # # @result $v0 The integer read .macro read_int () li $v0, 5 # Code for syscall: read integer syscall .end_macro # Repeats the given macro with values of the %ireg register from %from to %to # # @param %ireg A register to iterate (Counter) # @param %from Start value # @param %to End value # @param %macro The name of the macro to repeat .macro for (%ireg, %from, %to, %macro) add %ireg, $zero, %from forloop_label: %macro() add %ireg, %ireg, 1 ble %ireg, %to, forloop_label .end_macro # Saves the register on the stack. # # @param %reg A register to save .macro backup (%reg) addi $sp, $sp, -4 sw %reg, 0($sp) .end_macro # Restores saved register from the stack, in opposite order. # # @param %reg A register to save .macro restore (%reg) lw %reg, 0($sp) addi $sp, $sp, 4 .end_macro
oeis/016/A016902.asm
neoneye/loda-programs
11
177699
; A016902: a(n) = (5*n + 4)^6. ; 4096,531441,7529536,47045881,191102976,594823321,1544804416,3518743761,7256313856,13841287201,24794911296,42180533641,68719476736,107918163081,164206490176,243087455521,351298031616,496981290961,689869781056,941480149401,1265319018496,1677100110841,2194972623936,2839760855281,3635215077376,4608273662721,5789336458816,7212549413161,8916100448256,10942526586601,13339032325696,16157819263041,19456426971136,23298085122481,27752076864576,32894113444921,38806720086016,45579633110361,53310208315456 mul $0,5 add $0,4 pow $0,6
src/glfw/v2/glfw-api.ads
Roldak/OpenGLAda
0
8486
<filename>src/glfw/v2/glfw-api.ads -- part of OpenGLAda, (c) 2017 <NAME> -- released under the terms of the MIT license, see the file "COPYING" with Glfw.Enums; with Glfw.Display; with Glfw.Events.Keys; with Glfw.Events.Mouse; with Glfw.Events.Joysticks; with Interfaces.C.Strings; with System; private package Glfw.API is type Raw_Video_Mode is array (1 .. 5) of aliased C.int; pragma Convention (C, Raw_Video_Mode); type Video_Mode_List is array (Positive range <>) of Raw_Video_Mode; pragma Convention (C, Video_Mode_List); type Window_Size_Callback is access procedure (Width, Height : C.int); type Window_Close_Callback is access function return Bool; type Window_Refresh_Callback is access procedure; type Key_Callback is access procedure (Subject : Events.Keys.Key; Action : Events.Button_State); type Character_Callback is access procedure (Unicode_Char : Events.Keys.Unicode_Character; Action : Events.Button_State); type Button_Callback is access procedure (Subject : Events.Mouse.Button; Action : Events.Button_State); type Position_Callback is access procedure (X, Y : Events.Mouse.Coordinate); type Wheel_Callback is access procedure (Pos : Events.Mouse.Wheel_Position); pragma Convention (C, Window_Size_Callback); pragma Convention (C, Window_Close_Callback); pragma Convention (C, Window_Refresh_Callback); pragma Convention (C, Key_Callback); pragma Convention (C, Character_Callback); pragma Convention (C, Button_Callback); pragma Convention (C, Position_Callback); pragma Convention (C, Wheel_Callback); function Init return C.int; pragma Import (Convention => C, Entity => Init, External_Name => "glfwInit"); procedure Glfw_Terminate; pragma Import (Convention => C, Entity => Glfw_Terminate, External_Name => "glfwTerminate"); procedure Get_Version (Major, Minor, Revision : out C.int); pragma Import (Convention => C, Entity => Get_Version, External_Name => "glfwGetVersion"); function Open_Window (Width, Height, Red_Bits, Green_Bits, Blue_Bits, Alpha_Bits, Depth_Bits, Stencil_Bits : C.int; Mode : Display.Display_Mode) return Bool; pragma Import (Convention => C, Entity => Open_Window, External_Name => "glfwOpenWindow"); procedure Open_Window_Hint (Target : Glfw.Enums.Window_Hint; Info : C.int); procedure Open_Window_Hint (Target : Glfw.Enums.Window_Hint; Info : Bool); procedure Open_Window_Hint (Target : Glfw.Enums.Window_Hint; Info : Display.OpenGL_Profile_Kind); pragma Import (Convention => C, Entity => Open_Window_Hint, External_Name => "glfwOpenWindowHint"); procedure Close_Window; pragma Import (Convention => C, Entity => Close_Window, External_Name => "glfwCloseWindow"); procedure Set_Window_Title (Title : C.Strings.chars_ptr); pragma Import (Convention => C, Entity => Set_Window_Title, External_Name => "glfwSetWindowTitle"); procedure Get_Window_Size (Width, Height : out C.int); pragma Import (Convention => C, Entity => Get_Window_Size, External_Name => "glfwGetWindowSize"); procedure Set_Window_Size (Width, Height : C.int); pragma Import (Convention => C, Entity => Set_Window_Size, External_Name => "glfwSetWindowSize"); procedure Set_Window_Pos (X, Y : C.int); pragma Import (Convention => C, Entity => Set_Window_Pos, External_Name => "glfwSetWindowPos"); procedure Iconify_Window; pragma Import (Convention => C, Entity => Iconify_Window, External_Name => "glfwIconifyWindow"); procedure Restore_Window; pragma Import (Convention => C, Entity => Restore_Window, External_Name => "glfwRestoreWindow"); procedure Swap_Buffers; pragma Import (Convention => C, Entity => Swap_Buffers, External_Name => "glfwSwapBuffers"); procedure Swap_Interval (Interval : C.int); pragma Import (Convention => C, Entity => Swap_Interval, External_Name => "glfwSwapInterval"); function Get_Window_Param (Param : Enums.Window_Info) return C.int; function Get_Window_Param (Param : Enums.Window_Info) return Bool; function Get_Window_Param (Param : Enums.Window_Info) return Display.OpenGL_Profile_Kind; pragma Import (Convention => C, Entity => Get_Window_Param, External_Name => "glfwGetWindowParam"); procedure Set_Window_Size_Callback (Cb : Window_Size_Callback); pragma Import (Convention => C, Entity => Set_Window_Size_Callback, External_Name => "glfwSetWindowSizeCallback"); procedure Set_Window_Close_Callback (Cb : Window_Close_Callback); pragma Import (Convention => C, Entity => Set_Window_Close_Callback, External_Name => "glfwSetWindowCloseCallback"); procedure Set_Window_Refresh_Callback (Cb : Window_Refresh_Callback); pragma Import (Convention => C, Entity => Set_Window_Refresh_Callback, External_Name => "glfwSetWindowCloseCallback"); function Get_Video_Modes (List : System.Address; Max_Count : C.int) return C.int; pragma Import (Convention => C, Entity => Get_Video_Modes, External_Name => "glfwGetVideoModes"); procedure Get_Desktop_Mode (Mode : access C.int); pragma Import (Convention => C, Entity => Get_Desktop_Mode, External_Name => "glfwGetDesktopMode"); procedure Poll_Events; pragma Import (Convention => C, Entity => Poll_Events, External_Name => "glfwPollEvents"); procedure Wait_Events; pragma Import (Convention => C, Entity => Wait_Events, External_Name => "glfwWaitEvents"); function Get_Key (Key : Glfw.Events.Keys.Key) return Glfw.Events.Button_State; pragma Import (Convention => C, Entity => Get_Key, External_Name => "glfwGetKey"); function Get_Mouse_Button (Button : Glfw.Events.Mouse.Button) return Glfw.Events.Button_State; pragma Import (Convention => C, Entity => Get_Mouse_Button, External_Name => "glfwGetMouseButton"); procedure Get_Mouse_Pos (XPos, YPos : out C.int); pragma Import (Convention => C, Entity => Get_Mouse_Pos, External_Name => "glfwGetMousePos"); procedure Set_Mouse_Pos (XPos, YPos : C.int); pragma Import (Convention => C, Entity => Set_Mouse_Pos, External_Name => "glfwSetMousePos"); function Get_Mouse_Wheel return Events.Mouse.Wheel_Position; pragma Import (Convention => C, Entity => Get_Mouse_Wheel, External_Name => "glfwGetMouseWheel"); procedure Set_Mouse_Wheel (Position : C.int); pragma Import (Convention => C, Entity => Set_Mouse_Wheel, External_Name => "glfwSetMouseWheel"); procedure Set_Key_Callback (CbFun : Key_Callback); pragma Import (Convention => C, Entity => Set_Key_Callback, External_Name => "glfwSetKeyCallback"); procedure Set_Char_Callback (CbFun : Character_Callback); pragma Import (Convention => C, Entity => Set_Char_Callback, External_Name => "glfwSetCharCallback"); procedure Set_Mouse_Button_Callback (CbFun : Button_Callback); pragma Import (Convention => C, Entity => Set_Mouse_Button_Callback, External_Name => "glfwSetMouseButtonCallback"); procedure Set_Mouse_Pos_Callback (CbFun : Position_Callback); pragma Import (Convention => C, Entity => Set_Mouse_Pos_Callback, External_Name => "glfwSetMousePosCallback"); procedure Set_Mouse_Wheel_Callback (CbFun : Wheel_Callback); pragma Import (Convention => C, Entity => Set_Mouse_Wheel_Callback, External_Name => "glfwSetMouseWheelCallback"); function Get_Joystick_Param (Joy : Enums.Joystick_ID; Param : Enums.Joystick_Param) return Interfaces.C.int; pragma Import (Convention => C, Entity => Get_Joystick_Param, External_Name => "glfwGetJoystickParam"); -- Pos will be modified on the C side. It should be declared -- as 'in out' but Ada 2005 forbids that. Since is works fine this -- way, we don't bother using C pointers instead that wouldn't -- make the API any clearer. function Get_Joystick_Pos (Joy : Enums.Joystick_ID; Pos : Events.Joysticks.Axis_Positions; Num_Axis : Interfaces.C.int) return Interfaces.C.int; pragma Import (Convention => C, Entity => Get_Joystick_Pos, External_Name => "glfwGetJoystickPos"); -- See comment on Get_Joystick_Pos function Get_Joystick_Buttons (Joy : Enums.Joystick_ID; Pos : Events.Button_States; Num_Buttons : Interfaces.C.int) return Interfaces.C.int; pragma Import (Convention => C, Entity => Get_Joystick_Buttons, External_Name => "glfwGetJoystickButtons"); function Get_Time return C.double; pragma Import (Convention => C, Entity => Get_Time, External_Name => "glfwGetTime"); procedure Set_Time (Value : C.double); pragma Import (Convention => C, Entity => Set_Time, External_Name => "glfwSetTime"); procedure Sleep (Time : C.double); pragma Import (Convention => C, Entity => Sleep, External_Name => "glfwSleep"); function Extension_Supported (Name : C.Strings.chars_ptr) return Bool; pragma Import (Convention => C, Entity => Extension_Supported, External_Name => "glfwExtensionSupported"); procedure Get_GL_Version (Major, Minor, Rev : out C.int); pragma Import (Convention => C, Entity => Get_GL_Version, External_Name => "glfwGetGLVersion"); procedure Enable (Target : Enums.Feature); pragma Import (Convention => C, Entity => Enable, External_Name => "glfwEnable"); procedure Disable (Target : Enums.Feature); pragma Import (Convention => C, Entity => Disable, External_Name => "glfwDisable"); end Glfw.API;
Cat.agda
clarkdm/CS410
0
7976
<filename>Cat.agda module Cat where open import Agda.Primitive open import CS410-Prelude open import CS410-Nat open import CS410-Monoid open import CS410-Vec record Cat {k}{l}(O : Set k)(_>>_ : O -> O -> Set l) : Set (lsuc (k ⊔ l)) where field -- OPERATIONS --------------------------------------------------------- iden : {X : O} -> X >> X comp : {R S T : O} -> S >> T -> R >> S -> R >> T -- KLUDGE ------------------------------------------------------------- Eq : {S T : O} -> S >> T -> S >> T -> Set l -- LAWS --------------------------------------------------------------- idenL : {S T : O}(f : S >> T) -> Eq (comp iden f) f idenR : {S T : O}(f : S >> T) -> Eq (comp f iden) f assoc : {Q R S T : O}(f : S >> T)(g : R >> S)(h : Q >> R) -> Eq (comp f (comp g h)) (comp (comp f g) h) SetCat : Cat Set (\ S T -> S -> T) SetCat = record { iden = id ; comp = _o_ ; Eq = \ f g -> forall x -> f x == g x ; idenL = λ {S} {T} f x → refl ; idenR = λ {S} {T} f x → refl ; assoc = λ {Q} {R} {S} {T} f g h x → refl } N>=Cat : Cat Nat _N>=_ N>=Cat = record { iden = \ {n} -> N>=refl n ; comp = \ {l}{m}{n} -> N>=trans l m n ; Eq = \ _ _ -> One ; idenL = λ {S} {T} f → <> ; idenR = λ {S} {T} f → <> ; assoc = λ {Q} {R} {S} {T} f g h → <> } where N>=refl : (n : Nat) -> n N>= n N>=refl zero = <> N>=refl (suc n) = N>=refl n N>=trans : forall l m n -> m N>= n -> l N>= m -> l N>= n N>=trans l m zero mn lm = <> N>=trans l zero (suc n) () lm N>=trans zero (suc m) (suc n) mn () N>=trans (suc l) (suc m) (suc n) mn lm = N>=trans l m n mn lm MonCat : forall {X} -> Monoid X -> Cat One \ _ _ -> X MonCat M = record { iden = e ; comp = op ; Eq = _==_ ; idenL = lunit ; idenR = runit ; assoc = assoc } where open Monoid M record Functor {k l}{ObjS : Set k}{_>S>_ : ObjS -> ObjS -> Set l} {m n}{ObjT : Set m}{_>T>_ : ObjT -> ObjT -> Set n} (CS : Cat ObjS _>S>_)(CT : Cat ObjT _>T>_) : Set (lsuc (k ⊔ l ⊔ m ⊔ n)) where open Cat field -- OPERATIONS --------------------------------------------------------- Map : ObjS -> ObjT map : {A B : ObjS} -> A >S> B -> Map A >T> Map B -- LAWS --------------------------------------------------------------- mapId : {A : ObjS} -> Eq CT (map (iden CS {A})) (iden CT {Map A}) mapComp : {A B C : ObjS}(f : B >S> C)(g : A >S> B) -> Eq CT (map (comp CS f g)) (comp CT (map f) (map g)) mapEq : {A B : ObjS}{f g : A >S> B} -> Eq CS f g -> Eq CT (map f) (map g) data List (X : Set) : Set where -- X scopes over the whole declaration... [] : List X -- ...so you can use it here... _::_ : X -> List X -> List X -- ...and here. infixr 3 _::_ listMap : {A B : Set} → (A → B) → List A → List B listMap f [] = [] listMap f (a :: as) = f a :: listMap f as list : Functor SetCat SetCat list = record { Map = List ; map = listMap ; mapId = {!!} ; mapComp = {!!} ; mapEq = {!!} } {- goo : Functor (MonCat +Mon) SetCat goo = ? -} hoo : (X : Set) -> Functor N>=Cat SetCat hoo X = record { Map = Vec X ; map = {!!} ; mapId = {!!} ; mapComp = {!!} ; mapEq = {!!} }
kernel/krnl/isr_handler.asm
foreverbell/BadAppleOS
52
170027
[extern _isr_dispatcher] %macro isr 1 global _isr_handler%1 _isr_handler%1: cli push 0 ; dummy error code push %1 ; exception index jmp isr_routine %endmacro %macro isr_ec 1 ; with error code global _isr_handler%1 _isr_handler%1: cli push %1 jmp isr_routine %endmacro isr 0 isr 1 isr 2 isr 3 isr 4 isr 5 isr 6 isr 7 isr_ec 8 isr 9 isr_ec 10 isr_ec 11 isr_ec 12 isr_ec 13 isr_ec 14 isr 15 isr 16 isr 17 isr 18 isr_routine: pushad push ds push es push fs push gs push esp ; pointer to all stuffs we have pushed, wraps everything on ; stack into one struct pointer call _isr_dispatcher pop esp pop gs pop fs pop es pop ds popad add esp, 0x8 ; pop error code & exception index iret
programs/oeis/187/A187443.asm
neoneye/loda
22
94710
<filename>programs/oeis/187/A187443.asm ; A187443: A trisection of A001405 (central binomial coefficients): binomial(3n+1,floor((3n+1)/2)), n>=0. ; 1,6,35,252,1716,12870,92378,705432,5200300,40116600,300540195,2333606220,17672631900,137846528820,1052049481860,8233430727600,63205303218876,495918532948104,3824345300380220,30067266499541040,232714176627630544,1832624140942590534,14226520737620288370,112186277816662845432,873065282167813104916 mul $0,3 add $0,1 mov $1,$0 div $1,2 bin $0,$1
examples/life.asm
denizzzka/dcpu16
0
89939
<filename>examples/life.asm<gh_stars>0 ; Conway's Game of Life ; Renders a 64x64 field by writing characters ; on a 16x8 grid ; map screen SET A, 0 SET B, 0x8000 HWI 0 ; map font SET A, 1 SET B, 0x8180 HWI 0 ; border color SET A, 3 SET B, 0x4 HWI 0 ADD PC, 1 :randseed dat 0xACE1 ; change to get different initial states ; Initialize the screen SET [0x8280], 0x4 ; red border color ; Set screen to the appropriate characters SET A, 0xf000 ; white fg | black bg | char # SET I, 0x8000 :loop_init SET X, I AND X, 0xf SET Y, I SHR Y, 1 AND Y, 0x70 BOR X, Y BOR X, A SET [I], X ADD I, 1 IFN I, 0x8180 SET PC, loop_init ; the internal grid is actually 66x66, to not ; have to check if an access is out-of-bounds ; (we set the border to do toroidal wrap-around) :randomize_grid ; set a random initial state SET SP, 0x2105 :randomize_loop JSR rand AND A, 1 SET PUSH, A IFN 0x0fff, SP SET PC, randomize_loop ; The core loop iterates over cells in a block pattern ; it calculates 2x8 groups at a time, since that's ; the dimensions of one word of a character font ; C -- address of current field (since it's double-buffered) ; A, B -- coordinates inside current group ; X, Y -- coordinates of the current cell ; Z -- number of live neighbors ; SP -- address of last half-character we modified ; I -- top-left neighbor index ; J -- current half-character bitmap ; we modify a character by doing SET PUSH, J SET C, 0x1000 ; the live/dead cells are stored at 0x1000 and 0x3000 :loop_main ; copy cells to let us do toroidal wrap-around. ; we have an MxN matrix, and need to copy the ; rows and columns to the opposite edges, and also ; do the corners properly ; Copy the M-1th row to the 1st row. SET SP, C ; source ADD SP, 0x1081 ; 66 * 64 + 1 SET I, C ; target SET X, I ADD X, 65 ; the last element we write :toroid_row_zero ADD I, 1 SET [I], POP IFN I, X SET PC, toroid_row_zero ; Copy the 2nd row to the Mth row. SET SP, C ; source ADD SP, 67 SET I, C ; target ADD I, 0x10c2 ; 66 * 65 SET X, I ADD X, 65 ; the last element we write :toroid_row_last ADD I, 1 SET [I], POP IFN I, X SET PC, toroid_row_last ; Do the columns. SET I, C ; left SET J, C ; right ADD J, 64 SET X, I ADD X, 0x1080 ; end address (X) (66 * 64) SET A, 66 ; increment amount :toroid_columns ADD I, A ADD J, A SET [I], [J] SET [J+1], [I+1] IFN I, X SET PC, toroid_columns ; Do the corners. SET [C], [C+0x10c0] ; (0,0) = (64,64) SET [C+65], [C+0x1081] ; (65, 0) = (1, 64) SET [C+0x10c2], [C+0x82] ; (0, 65) = (64, 1) SET [C+0x1103], [C+67] ; (65, 65) = (1, 1) SET X, 62 ; cell coords SET Y, 56 SET SP, 0x8280 ; half-character address :loop_group SET A, 0 SET J, 0 :loop_a SET B, 8 SET I, Y ; I = (Y+A)*66 + (X+B) + C (index of top-left neighbor) BOR I, 7 ; hoisted out of the inner loop MUL I, 66 ADD I, X ADD I, A ADD I, C :loop_b SUB B, 1 ; count how many neighbors we have SET Z, [I] ; -1, -1 ADD Z, [I+0x1] ; 0, -1 ADD Z, [I+0x2] ; 1, -1 ADD Z, [I+0x42] ; -1, 0 ADD Z, [I+0x44] ; 1, 0 ADD Z, [I+0x84] ; -1, 1 ADD Z, [I+0x85] ; 0, 1 ADD Z, [I+0x86] ; 1, 1 ; trick: cell is alive if (neighbors | alive) == 3 BOR Z, [I+0x43] IFN Z, 3 SET Z, 0 AND Z, 1 SHL J, 1 IFE Z, 1 XOR J, 1 ; set the font display XOR I, 0x4000 ; set the cell in the opposite page SET [I+0x43], Z XOR I, 0x4000 SUB I, 66 IFN B, 0 SET PC, loop_b ADD A, 1 IFN A, 2 SET PC, loop_a SET PUSH, J SUB X, 2 IFN EX, 0 SET X, 62 IFN EX, 0 SUB Y, 8 IFG SP, 0x8180 ; have we written the last character? SET PC, loop_group XOR C, 0x4000 SET PC, loop_main :rand ; simple LFSR RNG -- only use the low bit! SET A, randseed SHR [A], 1 IFN EX, 0 XOR [A], 0xB400 SET A, [A] SET PC, POP
Source Codes Testing/add2.asm
aravindvnair99/emu8086
11
6942
.MODEL small .STACK .DATA .CODE .STARTUP MOV ah, 04h MOV al, 05h MOV bh, 02h MOV bl, 03h add ah,al add ah,bh .EXIT end
impl/src/main/antlr4/imports/ConfigBnf.g4
groupon/monsoon
32
3586
/* * Copyright (c) 2016, Groupon, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 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. * * Neither the name of GROUPON nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * 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 COPYRIGHT * HOLDER 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. */ parser grammar ConfigBnf; /* * NOTE: include the following in your parser extension: * * @parser::header { * package com.groupon.lex.metrics.grammar; * * import com.groupon.lex.metrics.lib.TriFunction; * import com.groupon.lex.metrics.config.*; * import com.groupon.lex.metrics.expression.*; * import com.groupon.lex.metrics.timeseries.*; * import com.groupon.lex.metrics.timeseries.expression.*; * import com.groupon.lex.metrics.MetricValue; * import com.groupon.lex.metrics.GroupName; * import com.groupon.lex.metrics.PathMatcher; * import com.groupon.lex.metrics.MetricMatcher; * import com.groupon.lex.metrics.MetricName; * import com.groupon.lex.metrics.SimpleGroupPath; * import com.groupon.lex.metrics.Histogram; * import com.groupon.lex.metrics.transformers.NameResolver; * import com.groupon.lex.metrics.transformers.LiteralNameResolver; * import com.groupon.lex.metrics.transformers.IdentifierNameResolver; * import com.groupon.lex.metrics.resolver.*; * import com.groupon.lex.metrics.builders.collector.*; * import java.util.Objects; * import java.util.SortedSet; * import java.util.TreeSet; * import java.util.ArrayList; * import java.util.Collection; * import java.util.Collections; * import java.util.Map; * import java.util.HashMap; * import java.util.Deque; * import java.util.ArrayDeque; * import java.io.File; * import javax.management.ObjectName; * import javax.management.MalformedObjectNameException; * import java.util.function.Function; * import java.util.function.BiFunction; * import java.util.function.Consumer; * import java.util.Optional; * import org.joda.time.Duration; * import com.groupon.lex.metrics.lib.Any2; * import com.groupon.lex.metrics.lib.Any3; * } */ import ExprBnf; @members { private File dir_; public File getDir() { return dir_; } public void setDir(File dir) { dir_ = dir; } } configuration returns [ Configuration s ] @after{ $s = new Configuration(Objects.requireNonNull($s1.s), Objects.requireNonNull($s2.s), Objects.requireNonNull($s3.s)); } : s1=import_statements s2=collect_statements s3=rules EOF ; import_statements returns [ Collection<ImportStatement> s = new ArrayList<ImportStatement>() ] : (s1=import_statement{ $s.add($s1.s); })* ; import_statement returns [ ImportStatement s ] @after{ $s = new ImportStatement(getDir(), Objects.requireNonNull($s4.s), Objects.requireNonNull($s2.s)); } : IMPORT_KW s2=import_selectors FROM_KW s4=filename ENDSTATEMENT_KW ; import_selectors returns [ int s ] : ALL_KW { $s = ImportStatement.ALL; } | (s_=import_selector{ $s |= $s_.s; }) (COMMA_LIT s_=import_selector{ $s |= $s_.s; })* ; import_selector returns [ int s ] : COLLECTORS_KW { $s = ImportStatement.MONITORS; } ; collect_statements returns [ Collection<MonitorStatement> s = new ArrayList<MonitorStatement>() ] : (s1=collect_statement{ $s.add($s1.s); })* ; collect_statement returns [ MonitorStatement s ] @init{ String builderName = null; CollectorBuilder builderInst = null; } : COLLECT_KW id=ID { builderName = $id.getText(); try { builderInst = Configuration.COLLECTORS.get(builderName).newInstance(); } catch (InstantiationException | IllegalAccessException ex) { throw new FailedPredicateException(this, "collector " + builderName + " is not instantiable", ex.getMessage()); } } collect_stmt_parse[ builderInst ] { $s = new CollectorBuilderWrapper(builderName, builderInst); } ; collect_stmt_parse [ CollectorBuilder builder ] : collect_stmt_parse_main[ $builder ] collect_stmt_parse_asPath[ $builder ] collect_stmt_parse_tagSet[ $builder ] ; collect_stmt_parse_main [ CollectorBuilder builder ] @init{ List<String> strings; } : ( { $builder instanceof MainNone }? /* SKIP */ | { $builder instanceof MainString }? main_name=QSTRING { ((MainString)$builder).setMain($main_name.text); } | { $builder instanceof MainStringList }? main_name0=QSTRING { strings = new ArrayList<>(); strings.add($main_name0.text); } ( COMMA_LIT main_nameN=QSTRING { strings.add($main_nameN.text); } )* { ((MainStringList)$builder).setMain(strings); } ) ; collect_stmt_parse_asPath [ CollectorBuilder builder ] : ( { $builder instanceof AcceptAsPath }? AS_KW grp=lit_group_name { ((AcceptAsPath)$builder).setAsPath($grp.s); } | { $builder instanceof AcceptOptAsPath }? ( AS_KW grp=lit_group_name { ((AcceptOptAsPath)$builder).setAsPath(Optional.of($grp.s)); } | { ((AcceptOptAsPath)$builder).setAsPath(Optional.empty()); } ) | /* SKIP */ ) ; collect_stmt_parse_tagSet [ CollectorBuilder builder ] : ( { $builder instanceof AcceptTagSet }? tuples=opt_tuple_body { ((AcceptTagSet)$builder).setTagSet($tuples.s); } | ENDSTATEMENT_KW /* SKIP */ ) ; rules returns [ Collection<RuleStatement> s = new ArrayList<>() ] : (s1=monsoon_rule{ $s.add($s1.s); })* ; monsoon_rule returns [ RuleStatement s ] @init{ RuleStatement result = null; } @after{ $s = Objects.requireNonNull(result); } : s_rule=match_rule { result = $s_rule.s; } | s_const=constant_statement { result = $s_const.s; } | s_alert=alert_statement { result = $s_alert.s; } | s_alias=alias_rule { result = $s_alias.s; } | s_derived=derived_metric_rule { result = $s_derived.s; } | s_tag=tag_rule { result = $s_tag.s; } ; constant_statement returns [ RuleStatement s ] @init{ Map<NameResolver, MetricValue> metrics = new HashMap<>(); } @after{ $s = new ResolvedConstantStatement($s2.s, metrics); } : CONSTANT_KW s2=group s3=metric_name s4=metric_constant ENDSTATEMENT_KW { metrics.put($s3.s, $s4.s); } | CONSTANT_KW s2=group CURLYBRACKET_OPEN (s4_map=constant_stmt_metrics{ metrics.putAll($s4_map.s); })+ CURLYBRACKET_CLOSE ; constant_stmt_metrics returns [ Map<NameResolver, MetricValue> s ] @after{ $s = Collections.singletonMap($s2.s, $s3.s); } : s2=metric_name s3=metric_constant ENDSTATEMENT_KW ; match_rule returns [ RuleStatement s ] @init{ Map<String, PathMatcher> g_matchers = new HashMap<>(); Map<MatchStatement.IdentifierPair, MetricMatcher> m_matchers = new HashMap<>(); Optional<TimeSeriesMetricExpression> where_clause = Optional.empty(); MutableScope current_scope = newMutableScope(); } : MATCH_KW match_rule_selector[g_matchers, m_matchers] ( COMMA_LIT match_rule_selector[g_matchers, m_matchers])* { g_matchers.keySet().forEach(ident -> current_scope.put(ident, Scope.Type.GROUP)); m_matchers.keySet().forEach(ident_pair -> { current_scope.put(ident_pair.getGroup(), Scope.Type.GROUP); current_scope.put(ident_pair.getMetric(), Scope.Type.METRIC); }); } ( WHERE_KW s_where=expression{ where_clause = Optional.of($s_where.s); } )? CURLYBRACKET_OPEN s_rules=rules CURLYBRACKET_CLOSE { $s = new MatchStatement(g_matchers, m_matchers, where_clause, $s_rules.s); } ; finally{ popScope(current_scope); } match_rule_selector [ Map<String, PathMatcher> g_matchers, Map<MatchStatement.IdentifierPair, MetricMatcher> m_matchers ] : ( s2_group=path_match AS_KW s4=identifier { $g_matchers.put($s4.s, $s2_group.s); } | s2_metric=metric_match AS_KW s4=identifier COMMA_LIT s6=identifier { $m_matchers.put(new MatchStatement.IdentifierPair($s4.s, $s6.s), $s2_metric.s); } ) ; alias_rule returns [ AliasStatement s ] : ALIAS_KW s2=name AS_KW s4=identifier ENDSTATEMENT_KW { $s = new AliasStatement($s4.s, $s2.s); currentMutableScope().put($s4.s, Scope.Type.GROUP); } ; derived_metric_rule returns [ DerivedMetricStatement s ] @init{ Map<NameResolver, TimeSeriesMetricExpression> metrics = new HashMap<>(); Map<String, TimeSeriesMetricExpression> tags = new HashMap<>(); } : DEFINE_KW s2=name ( TAG_KW BRACE_OPEN_LIT tag_name0=identifier EQ_KW tag_value0=expression { tags.put($tag_name0.s, $tag_value0.s); } ( COMMA_LIT tag_nameN=identifier EQ_KW tag_valueN=expression { tags.put($tag_nameN.s, $tag_valueN.s); } )* BRACE_CLOSE_LIT )? ( s3=metric_name EQ_KW s5=expression ENDSTATEMENT_KW { metrics = Collections.singletonMap($s3.s, $s5.s); } | CURLYBRACKET_OPEN (m=derived_metric_rule_metrics{ metrics.putAll($m.s); })* CURLYBRACKET_CLOSE ) { $s = new DerivedMetricStatement($s2.s, tags, metrics); } ; derived_metric_rule_metrics returns [ Map<NameResolver, TimeSeriesMetricExpression> s ] @after{ $s = Collections.singletonMap($s1.s, $s3.s); } : s1=metric_name EQ_KW s3=expression ENDSTATEMENT_KW ; tag_rule returns [ SetTagStatement s ] @init{ Map<String, TimeSeriesMetricExpression> tag_exprs = new HashMap<>(); } : TAG_KW s2=group ( AS_KW s4=identifier EQ_KW s6=expression ENDSTATEMENT_KW { $s = new SetTagStatement($s2.s, $s4.s, $s6.s); } | CURLYBRACKET_OPEN s4_0=identifier EQ_KW s6_0=expression{ tag_exprs.put($s4_0.s, $s6_0.s); } (COMMA_LIT s4_n=identifier EQ_KW s6_n=expression{ tag_exprs.put($s4_n.s, $s6_n.s); })* CURLYBRACKET_CLOSE { $s = new SetTagStatement($s2.s, tag_exprs); } ) ; filename returns [ String s ] : s1=QSTRING { $s = $s1.text; } ; dotted_identifier returns [ String s ] : s1=raw_dotted_identifier { $s = String.join(".", $s1.s); } ; raw_dotted_identifier returns [ List<String> s = new ArrayList<String>() ] : s1=identifier{ $s.add($s1.s); } (DOT_LIT s_=identifier{ $s.add($s_.s); })* ; lit_group_name returns [ SimpleGroupPath s ] : s1=raw_dotted_identifier { $s = SimpleGroupPath.valueOf($s1.s); } ; metric_name returns [ NameResolver s ] : s1=name { $s = $s1.s; } ; metric_constant returns [ MetricValue s ] : s1_str=QSTRING { $s = MetricValue.fromStrValue($s1_str.text); } | s1_int=int_val { $s = MetricValue.fromIntValue($s1_int.s); } | s1_dbl=fp_val { $s = MetricValue.fromDblValue($s1_dbl.s); } | TRUE_KW { $s = MetricValue.TRUE; } | FALSE_KW { $s = MetricValue.FALSE; } ; alert_statement returns [ AlertStatement s ] @init{ Map<String, Any2<TimeSeriesMetricExpression, List<TimeSeriesMetricExpression>>> attrs = null; } @after{ $s = new AlertStatement($s2.s, $s4.s, $s5.s, $s6.s, attrs); } : ALERT_KW s2=name IF_KW s4=expression s5=alert_statement_opt_duration s6=alert_statement_opt_message ( ENDSTATEMENT_KW { attrs = Collections.EMPTY_MAP; } | s7=alert_statement_attributes { attrs = $s7.s; } ) ; alert_statement_opt_duration returns [ Optional<Duration> s ] : FOR_KW s2=duration { $s = Optional.of($s2.s); } | /* SKIP */ { $s = Optional.empty(); } ; alert_statement_opt_message returns [ Optional<String> s ] @init{ String s = null; } @after{ $s = Optional.ofNullable(s); } : ( MESSAGE_KW s2=QSTRING { s = $s2.text; } )? ; alert_statement_attributes returns [ Map<String, Any2<TimeSeriesMetricExpression, List<TimeSeriesMetricExpression>>> s = new HashMap<>() ] : ATTRIBUTES_KW CURLYBRACKET_OPEN ( sline_0=alert_statement_attributes_line{ $s.put($sline_0.s.getKey(), $sline_0.s.getValue()); } (COMMA_LIT sline=alert_statement_attributes_line{ $s.put($sline.s.getKey(), $sline.s.getValue()); })* )? CURLYBRACKET_CLOSE ; alert_statement_attributes_line returns [ Map.Entry<String, Any2<TimeSeriesMetricExpression, List<TimeSeriesMetricExpression>>> s ] : s1=identifier EQ_KW s3=alert_statement_attributes_line_arg { $s = com.groupon.lex.metrics.lib.SimpleMapEntry.create($s1.s, $s3.s); } ; alert_statement_attributes_line_arg returns [ Any2<TimeSeriesMetricExpression, List<TimeSeriesMetricExpression>> s ] @init{ List<TimeSeriesMetricExpression> exprs = new ArrayList<>(); } : s_expr=expression { $s = Any2.left($s_expr.s); } | SQBRACE_OPEN_LIT ( s_expr=expression{ exprs.add($s_expr.s); } (COMMA_LIT s_expr=expression{ exprs.add($s_expr.s); })* ) SQBRACE_CLOSE_LIT { $s = Any2.right(exprs); } ; opt_tuple_body returns [ NameBoundResolver s ] @init{ final List<NameBoundResolver> resolvers = new ArrayList<>(); } : ENDSTATEMENT_KW { $s = NameBoundResolver.EMPTY; } | CURLYBRACKET_OPEN m0=tuple_line{ resolvers.add($m0.s); } ( COMMA_LIT mN=tuple_line{ resolvers.add($mN.s); } )* CURLYBRACKET_CLOSE { if (resolvers.size() == 1) $s = resolvers.get(0); else $s = new NameBoundResolverSet(resolvers); } ; tuple_line returns [ NameBoundResolver s ] @init{ List<Any2<Integer, String>> keys = new ArrayList<>(); List<ResolverTuple> tuples = new ArrayList<>(); } : ( s_tk=tuple_key { keys = Collections.singletonList($s_tk.s); } EQ_KW SQBRACE_OPEN_LIT s0=tuple_value{ tuples.add(new ResolverTuple($s0.s)); } (COMMA_LIT sN=tuple_value{ tuples.add(new ResolverTuple($sN.s)); })* SQBRACE_CLOSE_LIT | keys=tuple_line_key_tuple { keys = $keys.s; } EQ_KW SQBRACE_OPEN_LIT values=tuple_line_value_tuple { tuples.add(new ResolverTuple($values.s)); } ( COMMA_LIT values=tuple_line_value_tuple { tuples.add(new ResolverTuple($values.s)); } )* SQBRACE_CLOSE_LIT ) { $s = new SimpleBoundNameResolver( new SimpleBoundNameResolver.Names(keys), new ConstResolver(tuples)); } ; tuple_line_key_tuple returns [ List<Any2<Integer, String>> s = new ArrayList<>() ] : BRACE_OPEN_LIT s1=tuple_key { $s.add($s1.s); } ( COMMA_LIT sN=tuple_key { $s.add($sN.s); } )* BRACE_CLOSE_LIT ; tuple_line_value_tuple returns [ List<Any3<Boolean, Integer, String>> s = new ArrayList<>() ] : BRACE_OPEN_LIT s0=tuple_value{ $s.add($s0.s); } ( COMMA_LIT sN=tuple_value{ $s.add($sN.s); } )* BRACE_CLOSE_LIT ; tuple_key returns [ Any2<Integer, String> s ] : s_i=uint_val { $s = Any2.left((int)$s_i.s); } | s_s=identifier { $s = Any2.right($s_s.s); } ; tuple_value returns [ Any3<Boolean, Integer, String> s ] : TRUE_KW { $s = ResolverTuple.newTupleElement(true); } | FALSE_KW { $s = ResolverTuple.newTupleElement(false); } | s_i=int_val { $s = ResolverTuple.newTupleElement((int)$s_i.s); } | s_s=QSTRING { $s = ResolverTuple.newTupleElement($s_s.text); } ;
libsrc/_DEVELOPMENT/target/rc2014/device/lut/z80/l_lut_mulu_32_16x16.asm
Frodevan/z88dk
640
96970
; ; feilipu, 2020 March ; ; This Source Code Form is subject to the terms of the Mozilla Public ; License, v. 2.0. If a copy of the MPL was not distributed with this ; file, You can obtain one at http://mozilla.org/MPL/2.0/. ; ;------------------------------------------------------------------------------ ; ; Using RC2014 LUT Module ; ;------------------------------------------------------------------------------ INCLUDE "config_private.inc" SECTION code_clib SECTION code_math PUBLIC l_lut_mulu_32_16x16 l_lut_mulu_32_16x16: ; multiplication of two 16-bit numbers into a 32-bit product ; ; enter : hl = 16-bit multiplier = y ; de = 16-bit multiplicand = x ; ; exit : dehl = 32-bit product ; carry reset ; ; uses : af, bc, de, hl ld c,d ; 4 c = x1 ld b,h ; 4 b = y1 push bc ; 11 preserve y1*x1 ld c,e ; 4 c = x0 ld b,l ; 4 b = y0 push bc ; 11 preserve y0*x0 ;;; MLT HE (xBC) ;;;;;;;;;;;;;;;; y1*x0 ld c,__IO_LUT_OPERAND_LATCH ; 7 operand latch address ld b,h ; 4 operand Y in B out (c),e ; 12 operand X from E in e,(c) ; 12 result Z LSB to E inc c ; 4 result MSB address in h,(c) ; 12 result Z MSB to H ;;; MLT DL (xBC) ;;;;;;;;;;;;;;;; x1*y0 dec c ; 4 operand latch address ld b,d ; 4 operand Y in B out (c),l ; 12 operand X from L in l,(c) ; 12 result Z LSB to L inc c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D xor a ; 4 zero A add hl,de ; 11 add cross products adc a,a ; 4 capture carry pop de ; 10 restore y0*x0 ;;; MLT DE (xBC) ;;;;;;;;;;;;;;;; y0*x0 dec c ; 4 operand latch address ld b,d ; 4 operand Y in B out (c),e ; 12 operand X from A in e,(c) ; 12 result Z LSB to E inc c ; 4 result MSB address in d,(c) ; 12 result Z MSB to D ld b,a ; 4 carry from cross products ld a,d ; 4 add a,l ; 4 ld d,a ; 4 DE = final LSW ld l,h ; 4 LSB of MSW from cross products ld h,b ; 4 carry from cross products ex (sp),hl ; 19 restore y1*x1, stack interim p3 p2 ;;; MLT HL (xBC) ;;;;;;;;;;;;;;;; x1*y1 dec c ; 4 operand latch address ld b,h ; 4 operand Y in B out (c),l ; 12 operand X from L in l,(c) ; 12 result Z LSB to L inc c ; 4 result MSB address in h,(c) ; 12 result Z MSB to H pop bc ; 10 destack interim p3 p2 adc hl,bc ; 15 hl = final MSW ex de,hl ; 4 DEHL = final product ret
source/numerics/a-nurear.ads
ytomino/drake
33
17383
<gh_stars>10-100 pragma License (Unrestricted); with Ada.Numerics.Generic_Real_Arrays; package Ada.Numerics.Real_Arrays is new Generic_Real_Arrays (Float); pragma Pure (Ada.Numerics.Real_Arrays);
oeis/213/A213327.asm
neoneye/loda-programs
11
99377
<gh_stars>10-100 ; A213327: Analog of Fermat quotients: a(n) = ((round((phi_2)^p)-2)/p, where phi_2 is silver ratio 1+sqrt(2) and p = prime(n). ; Submitted by <NAME> ; 2,4,16,68,1476,7280,189120,986244,27676612,4346071600,23696518916,3930960079760,120508933265760,669708812842692,20814182249890948,3654563002853231440,650000099752136709444,3664265812073801505200,660535426260570501876228 seq $0,6005 ; The odd prime numbers together with 1. mov $1,$0 seq $0,80039 ; a(n) = floor((1+sqrt(2))^n). mov $2,$0 div $2,$1 mov $0,$2
libsrc/_DEVELOPMENT/adt/p_list/z80/asm_p_list_next.asm
jpoikela/z88dk
640
12437
<filename>libsrc/_DEVELOPMENT/adt/p_list/z80/asm_p_list_next.asm<gh_stars>100-1000 ; =============================================================== ; Sep 2014 ; =============================================================== ; ; void *p_list_next(void *item) ; ; Return next item in list. ; ; =============================================================== SECTION code_clib SECTION code_adt_p_list PUBLIC asm_p_list_next EXTERN asm_p_forward_list_next defc asm_p_list_next = asm_p_forward_list_next ; enter : hl = void *item ; ; exit : success ; ; hl = void *item_next ; nz flag set ; ; fail if no next item ; ; hl = 0 ; z flag set ; ; uses : af, hl
modules/incrementCursor.asm
antuniooh/assembly-calculator
2
27148
<reponame>antuniooh/assembly-calculator INCREMENT_CURSOR: mov A, #0Eh INC 70h CALL delay CJNE A, 70h, RETURN mov 70h, #40h RET RETURN: RET
source/numerics/a-ngrear.adb
ytomino/drake
33
30812
with Ada.Numerics.Generic_Arrays; package body Ada.Numerics.Generic_Real_Arrays is package Elementary_Functions is subtype Float_Type is Real; function Sqrt (X : Float_Type'Base) return Float_Type'Base; end Elementary_Functions; package body Elementary_Functions is function Sqrt (X : Float_Type'Base) return Float_Type'Base is begin if not Standard'Fast_Math and then not (X >= 0.0) then raise Argument_Error; -- RM A.5.1(22), CXA5A10 end if; if Float_Type'Digits <= Float'Digits then declare function sqrtf (A1 : Float) return Float with Import, Convention => Intrinsic, External_Name => "__builtin_sqrtf"; begin return Float_Type'Base (sqrtf (Float (X))); end; elsif Float_Type'Digits <= Long_Float'Digits then declare function sqrt (A1 : Long_Float) return Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_sqrt"; begin return Float_Type'Base (sqrt (Long_Float (X))); end; else declare function sqrtl (x : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_sqrtl"; begin return Float_Type'Base (sqrtl (Long_Long_Float (X))); end; end if; end Sqrt; end Elementary_Functions; function Minor is new Generic_Arrays.Minor (Real'Base, Real_Matrix); -- for Inverse and Determinant -- implementation function "+" (Right : Real_Vector) return Real_Vector is begin return Right; end "+"; function "-" (Right : Real_Vector) return Real_Vector is function neg_Body is new Generic_Arrays.Operator_Vector ( Real'Base, Real_Vector, Real'Base, Real_Vector, "-"); pragma Inline_Always (neg_Body); begin return neg_Body (Right); end "-"; function "abs" (Right : Real_Vector) return Real_Vector is function abs_Body is new Generic_Arrays.Operator_Vector ( Real'Base, Real_Vector, Real'Base, Real_Vector, "abs"); pragma Inline_Always (abs_Body); begin return abs_Body (Right); end "abs"; function "+" (Left, Right : Real_Vector) return Real_Vector is function add_Body is new Generic_Arrays.Operator_Vector_Vector ( Real'Base, Real_Vector, Real'Base, Real_Vector, Real'Base, Real_Vector, "+"); pragma Inline_Always (add_Body); begin return add_Body (Left, Right); end "+"; function "-" (Left, Right : Real_Vector) return Real_Vector is function sub_Body is new Generic_Arrays.Operator_Vector_Vector ( Real'Base, Real_Vector, Real'Base, Real_Vector, Real'Base, Real_Vector, "-"); pragma Inline_Always (sub_Body); begin return sub_Body (Left, Right); end "-"; function "*" (Left, Right : Real_Vector) return Real'Base is function mul_Body is new Generic_Arrays.Inner_Production ( Real'Base, Real_Vector, Real'Base, Real_Vector, Real'Base, Zero => 0.0); pragma Inline_Always (mul_Body); begin return mul_Body (Left, Right); end "*"; function "abs" (Right : Real_Vector) return Real'Base is function abs_Body is new Generic_Arrays.Absolute ( Real'Base, Real_Vector, Real'Base, Zero => 0.0, Sqrt => Elementary_Functions.Sqrt); pragma Inline_Always (abs_Body); begin return abs_Body (Right); end "abs"; function "*" (Left : Real'Base; Right : Real_Vector) return Real_Vector is begin return Right * Left; end "*"; function "*" (Left : Real_Vector; Right : Real'Base) return Real_Vector is function mul_Body is new Generic_Arrays.Operator_Vector_Param ( Real'Base, Real_Vector, Real'Base, Real'Base, Real_Vector, "*"); pragma Inline_Always (mul_Body); begin return mul_Body (Left, Right); end "*"; function "/" (Left : Real_Vector; Right : Real'Base) return Real_Vector is begin return Left * (1.0 / Right); end "/"; function Unit_Vector ( Index : Integer; Order : Positive; First : Integer := 1) return Real_Vector is function Unit_Vector_Body is new Generic_Arrays.Unit_Vector ( Real'Base, Real_Vector, Zero => 0.0, One => 1.0); pragma Inline_Always (Unit_Vector_Body); begin return Unit_Vector_Body (Index, Order, First); end Unit_Vector; function "+" (Right : Real_Matrix) return Real_Matrix is begin return Right; end "+"; function "-" (Right : Real_Matrix) return Real_Matrix is function neg_Body is new Generic_Arrays.Operator_Matrix ( Real'Base, Real_Matrix, Real'Base, Real_Matrix, "-"); pragma Inline_Always (neg_Body); begin return neg_Body (Right); end "-"; function "abs" (Right : Real_Matrix) return Real_Matrix is function abs_Body is new Generic_Arrays.Operator_Matrix ( Real'Base, Real_Matrix, Real'Base, Real_Matrix, "abs"); pragma Inline_Always (abs_Body); begin return abs_Body (Right); end "abs"; function Transpose (X : Real_Matrix) return Real_Matrix is function Transpose_Body is new Generic_Arrays.Transpose (Real'Base, Real_Matrix); pragma Inline_Always (Transpose_Body); begin return Transpose_Body (X); end Transpose; function "+" (Left, Right : Real_Matrix) return Real_Matrix is function add_Body is new Generic_Arrays.Operator_Matrix_Matrix ( Real'Base, Real_Matrix, Real'Base, Real_Matrix, Real'Base, Real_Matrix, "+"); pragma Inline_Always (add_Body); begin return add_Body (Left, Right); end "+"; function "-" (Left, Right : Real_Matrix) return Real_Matrix is function sub_Body is new Generic_Arrays.Operator_Matrix_Matrix ( Real'Base, Real_Matrix, Real'Base, Real_Matrix, Real'Base, Real_Matrix, "-"); pragma Inline_Always (sub_Body); begin return sub_Body (Left, Right); end "-"; function "*" (Left, Right : Real_Matrix) return Real_Matrix is function mul_Body is new Generic_Arrays.Multiply_Matrix_Matrix ( Real'Base, Real_Matrix, Real'Base, Real_Matrix, Real'Base, Real_Matrix, Zero => 0.0); pragma Inline_Always (mul_Body); begin return mul_Body (Left, Right); end "*"; function "*" (Left, Right : Real_Vector) return Real_Matrix is function mul_Body is new Generic_Arrays.Multiply_Vector_Vector ( Real'Base, Real_Vector, Real'Base, Real_Vector, Real'Base, Real_Matrix); pragma Inline_Always (mul_Body); begin return mul_Body (Left, Right); end "*"; function "*" (Left : Real_Vector; Right : Real_Matrix) return Real_Vector is function mul_Body is new Generic_Arrays.Multiply_Vector_Matrix ( Real'Base, Real_Vector, Real'Base, Real_Matrix, Real'Base, Real_Vector, Zero => 0.0); pragma Inline_Always (mul_Body); begin return mul_Body (Left, Right); end "*"; function "*" (Left : Real_Matrix; Right : Real_Vector) return Real_Vector is function mul_Body is new Generic_Arrays.Multiply_Matrix_Vector ( Real'Base, Real_Matrix, Real'Base, Real_Vector, Real'Base, Real_Vector, Zero => 0.0); pragma Inline_Always (mul_Body); begin return mul_Body (Left, Right); end "*"; function "*" (Left : Real'Base; Right : Real_Matrix) return Real_Matrix is begin return Right * Left; end "*"; function "*" (Left : Real_Matrix; Right : Real'Base) return Real_Matrix is function mul_Body is new Generic_Arrays.Operator_Matrix_Param ( Real'Base, Real_Matrix, Real'Base, Real'Base, Real_Matrix, "*"); pragma Inline_Always (mul_Body); begin return mul_Body (Left, Right); end "*"; function "/" (Left : Real_Matrix; Right : Real'Base) return Real_Matrix is begin return Left * (1.0 / Right); end "/"; function Solve (A : Real_Matrix; X : Real_Vector) return Real_Vector is begin return Inverse (A) * X; end Solve; function Solve (A, X : Real_Matrix) return Real_Matrix is begin return Inverse (A) * X; end Solve; function Inverse (A : Real_Matrix) return Real_Matrix is function Inverse_Body is new Generic_Arrays.Inverse ( Real'Base, Real_Matrix, One => 1.0); pragma Inline_Always (Inverse_Body); begin return Inverse_Body (A); end Inverse; function Determinant (A : Real_Matrix) return Real'Base is function Determinant_Body is new Generic_Arrays.Determinant ( Real'Base, Real_Matrix, Zero => 0.0, One => 1.0); -- no inline, Determinant uses recursive calling begin return Determinant_Body (A); end Determinant; function Eigenvalues (A : Real_Matrix) return Real_Vector is Vectors : Real_Matrix (A'Range (1), A'Range (2)); begin return Result : Real_Vector (A'Range (2)) do Eigensystem (A, Result, Vectors); end return; end Eigenvalues; procedure Eigensystem ( A : Real_Matrix; Values : out Real_Vector; Vectors : out Real_Matrix) is function Is_Minus (X : Real'Base) return Boolean; function Is_Minus (X : Real'Base) return Boolean is begin return X < 0.0; end Is_Minus; function Is_Small (X : Real'Base) return Boolean; function Is_Small (X : Real'Base) return Boolean is begin return abs X < 1.0e-32; end Is_Small; procedure Eigensystem_Body is new Generic_Arrays.Eigensystem ( Real'Base, Real_Vector, Real'Base, Real_Matrix, Zero => 0.0, One => 1.0, Two => 2.0, Sqrt => Elementary_Functions.Sqrt, Is_Minus => Is_Minus, Is_Small => Is_Small, To_Real => "+"); pragma Inline_Always (Eigensystem_Body); begin Eigensystem_Body (A, Values, Vectors); end Eigensystem; function Unit_Matrix (Order : Positive; First_1, First_2 : Integer := 1) return Real_Matrix is function Unit_Matrix_Body is new Generic_Arrays.Unit_Matrix ( Real'Base, Real_Matrix, Zero => 0.0, One => 1.0); pragma Inline_Always (Unit_Matrix_Body); begin return Unit_Matrix_Body (Order, First_1, First_2); end Unit_Matrix; end Ada.Numerics.Generic_Real_Arrays;
Cubical/DStructures/Structures/Strict2Group.agda
Schippmunk/cubical
0
5011
<reponame>Schippmunk/cubical {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.DStructures.Structures.Strict2Group where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Functions.FunExtEquiv open import Cubical.Homotopy.Base open import Cubical.Data.Sigma open import Cubical.Data.Unit open import Cubical.Relation.Binary open import Cubical.Algebra.Group open import Cubical.Structures.LeftAction open import Cubical.DStructures.Base open import Cubical.DStructures.Meta.Properties open import Cubical.DStructures.Structures.Constant open import Cubical.DStructures.Structures.Type open import Cubical.DStructures.Structures.Group open import Cubical.DStructures.Structures.ReflGraph open import Cubical.DStructures.Structures.VertComp private variable ℓ ℓ' : Level module _ (ℓ ℓ' : Level) where private ℓℓ' = ℓ-max ℓ ℓ' 𝒮ᴰ-Strict2Group : URGStrᴰ (𝒮-ReflGraph ℓ ℓ') VertComp ℓ-zero 𝒮ᴰ-Strict2Group = Subtype→Sub-𝒮ᴰ (λ 𝒢 → VertComp 𝒢 , isPropVertComp 𝒢) (𝒮-ReflGraph ℓ ℓ') Strict2Group : Type (ℓ-suc ℓℓ') Strict2Group = Σ[ 𝒢 ∈ ReflGraph ℓ ℓ' ] VertComp 𝒢 record S2G : Type (ℓ-suc ℓℓ') where no-eta-equality field G₀ : Group {ℓ} G₁ : Group {ℓ'} σ : GroupHom G₁ G₀ τ : GroupHom G₁ G₀ ι : GroupHom G₀ G₁ split-σ : isGroupSplitEpi ι σ split-τ : isGroupSplitEpi ι τ V : VertComp (((((G₀ , G₁) , ι , σ) , split-σ) , τ) , split-τ) {- open S2G make-S2G : {G₀ : Group {ℓ}} {G₁ : Group {ℓ'}} → (σ τ : GroupHom G₁ G₀) → (ι : GroupHom G₀ G₁) → (split-σ : isGroupSplitEpi ι σ) → (split-τ : isGroupSplitEpi ι τ) → VertComp (((((G₀ , G₁) , ι , σ) , split-σ) , τ) , split-τ) → S2G make-S2G = {!!} Group→S2G : Group {ℓ} → S2G ℓ ℓ Group→S2G G .G₀ = G Group→S2G G .G₁ = G Group→S2G G .σ = idGroupHom G Group→S2G G .τ = idGroupHom G Group→S2G G .ι = idGroupHom G Group→S2G G .split-σ = GroupMorphismExt (λ _ → refl) Group→S2G G .split-τ = GroupMorphismExt (λ _ → refl) Group→S2G G .V = {!!} -}
P6/data_P6_2/cal_R_test19.asm
alxzzhou/BUAA_CO_2020
1
85692
lui $1,13373 ori $1,$1,44321 lui $2,54545 ori $2,$2,65140 lui $3,18337 ori $3,$3,26249 lui $4,38023 ori $4,$4,18979 lui $5,58687 ori $5,$5,35925 lui $6,4600 ori $6,$6,8762 mthi $1 mtlo $2 sec0: nop nop nop sltu $5,$6,$2 sec1: nop nop nor $6,$6,$2 sltu $2,$6,$2 sec2: nop nop slti $6,$2,29352 sltu $1,$6,$2 sec3: nop nop mfhi $6 sltu $2,$6,$2 sec4: nop nop lh $6,8($0) sltu $1,$6,$2 sec5: nop xor $2,$4,$4 nop sltu $4,$6,$2 sec6: nop sltu $2,$3,$6 sltu $6,$1,$5 sltu $2,$6,$2 sec7: nop nor $2,$3,$4 slti $6,$0,4571 sltu $1,$6,$2 sec8: nop and $2,$4,$5 mflo $6 sltu $3,$6,$2 sec9: nop nor $2,$2,$3 lbu $6,5($0) sltu $2,$6,$2 sec10: nop sltiu $2,$2,28424 nop sltu $5,$6,$2 sec11: nop sltiu $2,$4,-28968 nor $6,$2,$2 sltu $2,$6,$2 sec12: nop ori $2,$0,22649 xori $6,$5,25824 sltu $5,$6,$2 sec13: nop sltiu $2,$4,-30001 mfhi $6 sltu $4,$6,$2 sec14: nop xori $2,$1,62243 lbu $6,4($0) sltu $5,$6,$2 sec15: nop mfhi $2 nop sltu $1,$6,$2 sec16: nop mfhi $2 or $6,$4,$0 sltu $1,$6,$2 sec17: nop mflo $2 sltiu $6,$4,17500 sltu $4,$6,$2 sec18: nop mflo $2 mflo $6 sltu $2,$6,$2 sec19: nop mflo $2 lw $6,12($0) sltu $3,$6,$2 sec20: nop lhu $2,12($0) nop sltu $3,$6,$2 sec21: nop lw $2,4($0) nor $6,$1,$0 sltu $3,$6,$2 sec22: nop lhu $2,8($0) slti $6,$4,22504 sltu $4,$6,$2 sec23: nop lhu $2,2($0) mfhi $6 sltu $3,$6,$2 sec24: nop lh $2,12($0) lh $6,6($0) sltu $4,$6,$2 sec25: slt $6,$3,$4 nop nop sltu $4,$6,$2 sec26: sltu $6,$6,$1 nop xor $6,$3,$4 sltu $3,$6,$2 sec27: sltu $6,$4,$3 nop sltiu $6,$1,30464 sltu $1,$6,$2 sec28: sltu $6,$4,$3 nop mfhi $6 sltu $2,$6,$2 sec29: subu $6,$3,$6 nop lh $6,10($0) sltu $4,$6,$2 sec30: or $6,$3,$5 subu $2,$3,$4 nop sltu $4,$6,$2 sec31: addu $6,$3,$2 subu $2,$2,$0 slt $6,$5,$2 sltu $1,$6,$2 sec32: slt $6,$3,$2 nor $2,$3,$2 andi $6,$1,3826 sltu $5,$6,$2 sec33: slt $6,$2,$4 or $2,$4,$6 mfhi $6 sltu $3,$6,$2 sec34: slt $6,$2,$4 slt $2,$5,$2 lh $6,2($0) sltu $2,$6,$2 sec35: or $6,$2,$3 addiu $2,$3,-23406 nop sltu $4,$6,$2 sec36: and $6,$0,$1 lui $2,51982 subu $6,$3,$4 sltu $3,$6,$2 sec37: xor $6,$5,$5 ori $2,$3,33006 xori $6,$4,58711 sltu $4,$6,$2 sec38: or $6,$2,$3 andi $2,$1,44676 mfhi $6 sltu $4,$6,$2 sec39: or $6,$4,$3 addiu $2,$2,-17305 lh $6,6($0) sltu $3,$6,$2 sec40: xor $6,$4,$0 mfhi $2 nop sltu $4,$6,$2 sec41: nor $6,$3,$4 mfhi $2 slt $6,$4,$2 sltu $0,$6,$2 sec42: and $6,$4,$6 mflo $2 andi $6,$3,49968 sltu $5,$6,$2 sec43: slt $6,$2,$4 mfhi $2 mfhi $6 sltu $3,$6,$2 sec44: nor $6,$2,$5 mfhi $2 lhu $6,10($0) sltu $1,$6,$2 sec45: xor $6,$1,$0 lh $2,16($0) nop sltu $2,$6,$2 sec46: sltu $6,$3,$2 lb $2,2($0) and $6,$6,$4 sltu $2,$6,$2 sec47: subu $6,$4,$5 lh $2,14($0) addiu $6,$0,29765 sltu $5,$6,$2 sec48: or $6,$3,$5 lb $2,13($0) mfhi $6 sltu $2,$6,$2 sec49: addu $6,$5,$4 lw $2,16($0) lb $6,9($0) sltu $5,$6,$2 sec50: xori $6,$3,24949 nop nop sltu $4,$6,$2 sec51: andi $6,$4,61024 nop xor $6,$4,$3 sltu $6,$6,$2 sec52: addiu $6,$2,-7883 nop xori $6,$3,17197 sltu $3,$6,$2 sec53: andi $6,$1,58644 nop mfhi $6 sltu $6,$6,$2 sec54: addiu $6,$4,-11772 nop lb $6,11($0) sltu $2,$6,$2 sec55: addiu $6,$3,11073 or $2,$3,$3 nop sltu $4,$6,$2 sec56: xori $6,$2,43496 and $2,$4,$3 subu $6,$4,$3 sltu $3,$6,$2 sec57: slti $6,$3,31356 nor $2,$4,$3 sltiu $6,$0,-31084 sltu $5,$6,$2 sec58: lui $6,40941 sltu $2,$5,$6 mflo $6 sltu $1,$6,$2 sec59: slti $6,$4,-5278 nor $2,$1,$2 lh $6,4($0) sltu $3,$6,$2 sec60: slti $6,$3,7435 lui $2,34168 nop sltu $3,$6,$2 sec61: slti $6,$1,17789 xori $2,$2,32556 and $6,$6,$4 sltu $0,$6,$2 sec62: ori $6,$1,28801 lui $2,25220 sltiu $6,$5,5797 sltu $2,$6,$2 sec63: slti $6,$0,25007 sltiu $2,$3,20362 mflo $6 sltu $2,$6,$2 sec64: addiu $6,$6,-25936 xori $2,$3,26248 lhu $6,8($0) sltu $3,$6,$2 sec65: slti $6,$1,-11711 mfhi $2 nop sltu $4,$6,$2 sec66: ori $6,$2,29215 mfhi $2 addu $6,$2,$4 sltu $4,$6,$2 sec67: sltiu $6,$3,17076 mflo $2 andi $6,$1,6783 sltu $1,$6,$2 sec68: slti $6,$2,32647 mfhi $2 mflo $6 sltu $2,$6,$2 sec69: sltiu $6,$2,9792 mfhi $2 lbu $6,6($0) sltu $4,$6,$2 sec70: lui $6,6330 lh $2,16($0) nop sltu $3,$6,$2 sec71: xori $6,$4,25701 lhu $2,6($0) nor $6,$2,$1 sltu $1,$6,$2 sec72: andi $6,$3,51294 lw $2,12($0) ori $6,$3,46787 sltu $2,$6,$2 sec73: addiu $6,$4,-22910 lbu $2,13($0) mfhi $6 sltu $4,$6,$2 sec74: ori $6,$4,23618 lw $2,8($0) lbu $6,5($0) sltu $4,$6,$2 sec75: mflo $6 nop nop sltu $1,$6,$2 sec76: mfhi $6 nop or $6,$1,$3 sltu $5,$6,$2 sec77: mfhi $6 nop andi $6,$4,29251 sltu $4,$6,$2 sec78: mflo $6 nop mfhi $6 sltu $4,$6,$2 sec79: mflo $6 nop lhu $6,14($0) sltu $3,$6,$2 sec80: mfhi $6 or $2,$3,$1 nop sltu $4,$6,$2 sec81: mfhi $6 xor $2,$6,$3 sltu $6,$4,$3 sltu $3,$6,$2 sec82: mflo $6 nor $2,$6,$0 sltiu $6,$3,16057 sltu $3,$6,$2 sec83: mfhi $6 sltu $2,$4,$0 mflo $6 sltu $0,$6,$2 sec84: mflo $6 or $2,$3,$4 lhu $6,4($0) sltu $3,$6,$2 sec85: mflo $6 slti $2,$5,28689 nop sltu $5,$6,$2 sec86: mflo $6 andi $2,$0,10949 slt $6,$1,$0 sltu $2,$6,$2 sec87: mflo $6 ori $2,$5,12732 lui $6,30573 sltu $6,$6,$2 sec88: mfhi $6 slti $2,$6,27128 mflo $6 sltu $5,$6,$2 sec89: mfhi $6 addiu $2,$5,16348 lb $6,4($0) sltu $3,$6,$2 sec90: mflo $6 mflo $2 nop sltu $6,$6,$2 sec91: mfhi $6 mfhi $2 sltu $6,$2,$3 sltu $5,$6,$2 sec92: mfhi $6 mflo $2 sltiu $6,$1,-3462 sltu $3,$6,$2 sec93: mflo $6 mfhi $2 mflo $6 sltu $6,$6,$2 sec94: mflo $6 mfhi $2 lw $6,4($0) sltu $5,$6,$2 sec95: mflo $6 lbu $2,7($0) nop sltu $5,$6,$2 sec96: mflo $6 lhu $2,14($0) or $6,$4,$0 sltu $3,$6,$2 sec97: mflo $6 lb $2,13($0) lui $6,5528 sltu $2,$6,$2 sec98: mfhi $6 lhu $2,8($0) mfhi $6 sltu $0,$6,$2 sec99: mfhi $6 lh $2,12($0) lbu $6,5($0) sltu $2,$6,$2 sec100: lh $6,0($0) nop nop sltu $3,$6,$2 sec101: lh $6,4($0) nop xor $6,$6,$2 sltu $5,$6,$2 sec102: lhu $6,12($0) nop andi $6,$3,19369 sltu $2,$6,$2 sec103: lw $6,12($0) nop mfhi $6 sltu $2,$6,$2 sec104: lb $6,4($0) nop lb $6,12($0) sltu $3,$6,$2 sec105: lw $6,4($0) xor $2,$3,$3 nop sltu $3,$6,$2 sec106: lbu $6,7($0) and $2,$1,$4 or $6,$2,$3 sltu $5,$6,$2 sec107: lh $6,8($0) nor $2,$3,$3 lui $6,33458 sltu $4,$6,$2 sec108: lh $6,10($0) and $2,$1,$5 mflo $6 sltu $4,$6,$2 sec109: lh $6,0($0) addu $2,$1,$2 lw $6,8($0) sltu $3,$6,$2 sec110: lh $6,2($0) lui $2,36653 nop sltu $3,$6,$2 sec111: lhu $6,10($0) ori $2,$2,31084 slt $6,$1,$4 sltu $2,$6,$2 sec112: lw $6,8($0) slti $2,$2,-15980 sltiu $6,$3,-14353 sltu $4,$6,$2 sec113: lh $6,6($0) addiu $2,$6,-14907 mfhi $6 sltu $2,$6,$2 sec114: lbu $6,16($0) xori $2,$4,19387 lhu $6,4($0) sltu $2,$6,$2 sec115: lh $6,12($0) mflo $2 nop sltu $3,$6,$2 sec116: lb $6,15($0) mflo $2 xor $6,$6,$2 sltu $2,$6,$2 sec117: lbu $6,16($0) mflo $2 lui $6,6679 sltu $4,$6,$2 sec118: lw $6,12($0) mfhi $2 mflo $6 sltu $4,$6,$2 sec119: lb $6,6($0) mflo $2 lbu $6,10($0) sltu $4,$6,$2 sec120: lb $6,8($0) lhu $2,16($0) nop sltu $3,$6,$2 sec121: lh $6,12($0) lbu $2,10($0) sltu $6,$3,$1 sltu $0,$6,$2 sec122: lw $6,16($0) lh $2,8($0) lui $6,25659 sltu $4,$6,$2 sec123: lhu $6,16($0) lh $2,4($0) mfhi $6 sltu $3,$6,$2 sec124: lb $6,9($0) lbu $2,2($0) lh $6,4($0) sltu $4,$6,$2
oeis/016/A016856.asm
neoneye/loda-programs
11
241191
; A016856: a(n) = (5*n)^8. ; 0,390625,100000000,2562890625,25600000000,152587890625,656100000000,2251875390625,6553600000000,16815125390625,39062500000000,83733937890625,167961600000000,318644812890625,576480100000000,1001129150390625,1677721600000000,2724905250390625,4304672100000000,6634204312890625,10000000000000000,14774554437890625,21435888100000000,30590228625390625,42998169600000000,59604644775390625,81573072100000000,110324037687890625,147578905600000000,195408755062890625,256289062500000000,333160561500390625 pow $0,8 mul $0,390625
examples/03_paletteBasics/03_paletteBasics.asm
freem/nes_corelib
16
81965
<reponame>freem/nes_corelib ; freemco NES Corelib Example 03: Palette Basics ;==============================================================================; ; This example shows how to set the entire palette, and displays both the ; active background and sprite colors. ;==============================================================================; ; iNES header (still NROM-128) .include "NROM-128.asm" ; defines .include "nes.inc" ; NES hardware defines .include "ram.inc" ; program RAM defines ;==============================================================================; ; Macros ; Let's talk about code duplication, and how to get rid of some of it. ;------------------------------------------------------------------------------; ; drawBgPalBox ; Draws a background palette box. ; Params: ; tile tile index to use ($01,$02,$03) ; addr1 top byte of PPU address (both writes) ; addr2 bottom byte of PPU address (first write) ; addr3 bottom byte of PPU address (second write) .macro drawBgPalBox tile,addr1,addr2,addr3 ; line 1 ldx #addr1 ldy #addr2 stx PPU_ADDR sty PPU_ADDR lda #tile sta PPU_DATA sta PPU_DATA ; line 2 ldy #addr3 stx PPU_ADDR sty PPU_ADDR sta PPU_DATA sta PPU_DATA .endm ;------------------------------------------------------------------------------; ; drawSprPalBox ; Params: ; index starting sprite index ; tile tile index to use ($01,$02,$03) ; pal palette to use ; x x position of top left sprite ; y y position of top left sprite .macro drawSprPalBox index,tile,pal,x,y ; (sprite 1/4) ; y position lda #y sta OAM_BUF+(index*4) ; tile index lda #tile sta OAM_BUF+(index*4)+1 ; attributes lda #pal sta OAM_BUF+(index*4)+2 ; x position lda #x sta OAM_BUF+(index*4)+3 ; (sprite 2/4) ; y position lda #y sta OAM_BUF+(index*4)+4 ; tile index lda #tile sta OAM_BUF+(index*4)+5 ; attributes lda #pal sta OAM_BUF+(index*4)+6 ; x position lda #x+8 sta OAM_BUF+(index*4)+7 ; (sprite 3/4) ; y position lda #y+8 sta OAM_BUF+(index*4)+8 ; tile index lda #tile sta OAM_BUF+(index*4)+9 ; attributes lda #pal sta OAM_BUF+(index*4)+10 ; x position lda #x sta OAM_BUF+(index*4)+11 ; (sprite 4/4) ; y position lda #y+8 sta OAM_BUF+(index*4)+12 ; tile index lda #tile sta OAM_BUF+(index*4)+13 ; attributes lda #pal sta OAM_BUF+(index*4)+14 ; x position lda #x+8 sta OAM_BUF+(index*4)+15 .endm ;==============================================================================; ; program code .org $C000 ; starting point for NROM-128 ; include freemco corelib files here, before any data .include "corelib/palette.asm" ; freem Corelib Palette routines [excerpt] ; [Palette Data] ; We were manually writing the palette data to the PPU in the previous two ; examples. This time, we're going to use the freemco NES Corelib to write ; the background and sprite palettes in one shot. palData: .db $0F,$30,$10,$00 ; [BG1] black, dark gray, light gray, white .db $0F,$31,$21,$11 ; [BG2] black, lightest blue, lighter blue, blue .db $0F,$33,$23,$13 ; [BG3] black, lightest purple, lighter purple, purple .db $0F,$35,$25,$15 ; [BG4] black, lightest pink, lighter pink, pink ;---------------------------; .db $0F,$37,$27,$17 ; [Spr1] black, tan, lighter orange, orange .db $0F,$39,$29,$19 ; [Spr2] black, lightest green/yellow, lighter green/yellow, green/yellow .db $0F,$3A,$2A,$1A ; [Spr3] black, lightest green/blue, lighter green/blue, green/blue .db $0F,$3C,$2C,$1C ; [Spr4] black, lightest cyan, lighter cyan, cyan ; [String data] strPalettes: .db "Palettes" strBackground: .db "Background" strSprites: .db "Sprites" ;==============================================================================; ; NMI NMI: ; save registers pha ; 1) push A txa pha ; 2) push X tya pha ; 3) push Y ; increment framecount inc <frameCount bne @afterFrameCount inc <frameCount+1 @afterFrameCount: ; update the sprites lda #0 sta OAM_ADDR lda #>OAM_BUF sta OAM_DMA ; "proper" NMI code belongs here. NMI_end: lda #0 sta vblanked ; clear vblanked flag ; restore registers pla ; 3) pull Y tay pla ; 2) pull X tax pla ; 1) pull A rti ;==============================================================================; ; IRQ ; The IRQ is rarely used in simple mapper situations (such as NROM), but IRQs ; can be toggled via the NES's APU. The skeleton example does not use it. IRQ: rti ;==============================================================================; ; Reset ; Handles NES initialization Reset: sei ; disable IRQs cld ; clear decimal mode, in case some Famiclone is too smart for its own good ldx #$40 stx APU_FRAMECOUNT ; disable APU frame IRQ ldx #$FF txs ; set up stack inx ; (X is now $00) stx PPU_CTRL ; disable NMIs stx PPU_MASK ; disable rendering stx APU_DMC_FREQ ; disable DMC IRQ ; if you're using a mapper, you should probably initialize it here. bit PPU_STATUS ; wait for 1st vblank @waitVBL1: bit PPU_STATUS bpl @waitVBL1 ; clear all RAM (except page $0200, which is used as OAM/Sprite memory) txa ; (A is now $00) @clearRAM: sta $000,x sta $100,x sta $300,x sta $400,x sta $500,x sta $600,x sta $700,x inx bne @clearRAM ; clear OAM by hiding all sprites at #$FF ldx #0 lda #$FF @clearOAM: sta $200,x inx inx inx inx bne @clearOAM ; wait for the 2nd vblank @waitVBL2: bit PPU_STATUS bpl @waitVBL2 ; at this point, you can start setting up your program. ; set up the base palette using ppu_XferFullPalToPPU lda #<palData sta tmp00 lda #>palData sta tmp01 jsr ppu_XferFullPalToPPU ; reset ppu addresses ldx #$3F ldy #$00 stx PPU_ADDR ; Reset palette PPU address 1/2 sty PPU_ADDR ; Reset palette PPU address 2/2 sty PPU_ADDR ; Reset overall PPU address 1/2 sty PPU_ADDR ; Reset overall PPU address 2/2 ; clear first nametable's data ldx #$20 ldy #$00 stx PPU_ADDR sty PPU_ADDR .rept (32*30)+64 sty PPU_DATA .endr ; set up the nametable data ; 0) labels and crap ; "Palettes" at $204C ldx #$20 ldy #$4C stx PPU_ADDR sty PPU_ADDR ldy #0 @loopPalText: lda strPalettes,y sta PPU_DATA iny cpy #8 bne @loopPalText ; 0x0A,0x0A,0x0A,0x0F at $2080 ldy #$80 stx PPU_ADDR sty PPU_ADDR lda #$0A sta PPU_DATA sta PPU_DATA sta PPU_DATA lda #$0F sta PPU_DATA ; "Background" at $2084 ldy #0 @loopBGText: lda strBackground,y sta PPU_DATA iny cpy #10 bne @loopBGText ; 0x10,0x0A... at $208E lda #$10 sta PPU_DATA lda #$0A ldy #0 @loopTopLineRight: sta PPU_DATA iny cpy #17 bne @loopTopLineRight ; 1 ($20E8), 2 ($20F2), 3 ($21A8), 4 ($21B2) ldx #$20 ldy #$E8 stx PPU_ADDR sty PPU_ADDR lda #"1" sta PPU_DATA ldy #$F2 stx PPU_ADDR sty PPU_ADDR lda #"2" sta PPU_DATA ldx #$21 ldy #$A8 stx PPU_ADDR sty PPU_ADDR lda #"3" sta PPU_DATA ldy #$B2 stx PPU_ADDR sty PPU_ADDR lda #"4" sta PPU_DATA ; 0x0A,0x0A,0x0A,0x0F at $2220 ldx #$22 ldy #$20 stx PPU_ADDR sty PPU_ADDR lda #$0A sta PPU_DATA sta PPU_DATA sta PPU_DATA lda #$0F sta PPU_DATA ; "Sprites" at $2224 ldy #0 @loopSprText: lda strSprites,y sta PPU_DATA iny cpy #7 bne @loopSprText ; 0x10,0x0A... at $222B lda #$10 sta PPU_DATA lda #$0A ldy #0 @loopBotLineRight: sta PPU_DATA iny cpy #20 bne @loopBotLineRight ; 1 ($2288), 2 ($2292), 3 ($2328), 4 ($2332) ldx #$22 ldy #$88 stx PPU_ADDR sty PPU_ADDR lda #"1" sta PPU_DATA ldy #$92 stx PPU_ADDR sty PPU_ADDR lda #"2" sta PPU_DATA ldx #$23 ldy #$28 stx PPU_ADDR sty PPU_ADDR lda #"3" sta PPU_DATA ldy #$32 stx PPU_ADDR sty PPU_ADDR lda #"4" sta PPU_DATA ; 1) BG tiles ($01, $02, $03) ; 1/$01 ($20CC, $20EC) drawBgPalBox $01,$20,$CC,$EC ; 1/$02 ($210A, $212A) drawBgPalBox $02,$21,$0A,$2A ; 1/$03 ($210C, $212C) drawBgPalBox $03,$21,$0C,$2C ; 2/$01 ($20D6, $20F6) drawBgPalBox $01,$20,$D6,$F6 ; 2/$02 ($2114, $2134) drawBgPalBox $02,$21,$14,$34 ; 2/$03 ($2116, $2136) drawBgPalBox $03,$21,$16,$36 ; 3/$01 ($218C) drawBgPalBox $01,$21,$8C,$AC ; 3/$02 ($21CA) drawBgPalBox $02,$21,$CA,$EA ; 3/$03 ($21CC) drawBgPalBox $03,$21,$CC,$EC ; 4/$01 ($2196) drawBgPalBox $01,$21,$96,$B6 ; 4/$02 ($21D4) drawBgPalBox $02,$21,$D4,$F4 ; 4/$03 ($21D6) drawBgPalBox $03,$21,$D6,$F6 ; 2) attribute data ; this stuff is a nightmare to calculate by hand, btw. ; I didn't, but you might have to. ; $23CD: $50 ldx #$23 ldy #$CD stx PPU_ADDR sty PPU_ADDR lda #$50 sta PPU_DATA ; $23D5: $05 ldy #$D5 stx PPU_ADDR sty PPU_ADDR lda #$05 sta PPU_DATA ; $23DA: $88 ldy #$DA stx PPU_ADDR sty PPU_ADDR lda #$88 sta PPU_DATA ; $23DB: $22 ldy #$DB stx PPU_ADDR sty PPU_ADDR lda #$22 sta PPU_DATA ; $23DD: $FF ldy #$DD stx PPU_ADDR sty PPU_ADDR lda #$FF sta PPU_DATA ; set up the sprites ; 1/1 (Sprites 01-04) drawSprPalBox 1,1,0,96,151 ; 1/2 (Sprites 05-08) drawSprPalBox 5,2,0,80,167 ; 1/3 (Sprites 09-12) drawSprPalBox 9,3,0,96,167 ; 2/1 (Sprites 13-16) drawSprPalBox 13,1,1,176,151 ; 2/2 (Sprites 17-20) drawSprPalBox 17,2,1,160,167 ; 2/3 (Sprites 21-24) drawSprPalBox 21,3,1,176,167 ; 3/1 (Sprites 25-28) drawSprPalBox 25,1,2,96,191 ; 3/2 (Sprites 29-32) drawSprPalBox 29,2,2,80,207 ; 3/3 (Sprites 33-36) drawSprPalBox 33,3,2,96,207 ; 4/1 (Sprites 37-40) drawSprPalBox 37,1,3,176,191 ; 4/2 (Sprites 41-44) drawSprPalBox 41,2,3,160,207 ; 4/3 (Sprites 45-48) drawSprPalBox 45,3,3,176,207 ; perform final commands (setting up PPU) ; reset PPU and scroll ldx #$20 ; first nametable lives at PPU address $2000 ldy #$00 stx PPU_ADDR ; write new PPU address 1/2 sty PPU_ADDR ; write new PPU address 2/2 sty PPU_SCROLL ; Reset X scroll to 0 sty PPU_SCROLL ; Reset Y scroll to 0 ; enable NMIs, put sprites on PPU $1000 lda int_ppuCtrl ora #%10001000 sta int_ppuCtrl sta PPU_CTRL ; turn ppu on lda int_ppuMask ora #%00011110 sta int_ppuMask sta PPU_MASK ; and then run your program's main loop. MainLoop: ; things before vblank jsr waitVBlank ; wait for vblank ; things after vblank jmp MainLoop ;==============================================================================; ; waitVBlank: waits for VBlank waitVBlank: inc vblanked @waitLoop: lda vblanked bne @waitLoop rts ;==============================================================================; ; Vectors .org $FFFA .dw NMI .dw Reset .dw IRQ ;==============================================================================; ; CHR-ROM (if needed) .incbin "test.chr"
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/test_unit.adb
ouankou/rose
488
18651
with Ada.Strings.Unbounded; package body Test_Unit is task type Boring_Task_Type is entry Drop_Off_Work (Work_In : in Range_Type); end Boring_Task_Type; task body Boring_Task_Type is Work : Range_Type := 5; Result : Integer := 0; Factor : constant Positive := 2; begin loop accept Drop_Off_Work (Work_In : in Range_Type) do Work := Work_In; end Drop_Off_Work; Result := Integer (Work) * Factor; end loop; end Boring_Task_Type; Boring_Task : Boring_Task_Type; procedure You_Do_It (Using : in Range_Type) is begin if Using = 5 then raise Dont_Like_5; else Boring_Task.Drop_Off_Work (Using); end if; end You_Do_It; procedure Do_It (This : in Range_Type) is begin You_Do_It (Using => This); exception when X : Dont_Like_5 => null; end Do_It; package body Parent_Class is procedure Method_1 (This : in out Object) is begin This.Component_1 := This.Component_1 * 2; end Method_1; end Parent_Class; package body Child_Class is procedure Method_1 (This : in out Object) is begin This.Component_1 := This.Component_1 * 3; This.Component_2 := This.Component_2 * 5; end Method_1; end Child_Class; end Test_Unit;
04/divide/Divide.asm
yairfine/nand-to-tetris
1
3583
// D13 - Dividend // D14 - Divisor // if D == 0 jump to END @R14 D=M @END D; JEQ @R15 M=0 @remainder M=0 @16384 D=A // D=D<< @mask M=D (LOOP) @remainder M=M<< // Set LSB of the remainder to the i'th bit of the dividend. @R13 D=M @mask D=D&M // R[0] = R13[i] @AFTER_REMEINDER_LSB D; JEQ @remainder M=M+1 (AFTER_REMEINDER_LSB) // Compute R - D @R14 D=M @remainder D=M-D // If R < D then continue to next iteration. @AFTER_SUB D; JLT // R = R - D @remainder M=D @R15 D=M @mask D=D|M @R15 M=D (AFTER_SUB) @mask M=M>> D=M @LOOP D; JNE
VenanziosProblem.agda
nad/codata
1
9377
<filename>VenanziosProblem.agda ------------------------------------------------------------------------ -- A solution to a problem posed by <NAME> ------------------------------------------------------------------------ module VenanziosProblem where open import Codata.Musical.Notation open import Codata.Musical.Stream as Stream using (Stream; _⋎_; evens; odds; _≈_) open Stream.Stream; open Stream._≈_ open import Data.Nat open import Relation.Binary import Relation.Binary.PropositionalEquality as P private module S {A : Set} = Setoid (Stream.setoid A) ------------------------------------------------------------------------ -- Problem formulation -- The problem concerns functions satisfying a certain equation: rhs : {A : Set} → (Stream A → Stream A) → Stream A → Stream A rhs φ s = s ⋎ φ (evens (φ s)) SatisfiesEquation : {A : Set} → (Stream A → Stream A) → Set SatisfiesEquation φ = ∀ s → φ s ≈ rhs φ s -- The statement of the problem: Statement : Set₁ Statement = {A : Set} {φ₁ φ₂ : Stream A → Stream A} → SatisfiesEquation φ₁ → SatisfiesEquation φ₂ → ∀ s → φ₁ s ≈ φ₂ s ------------------------------------------------------------------------ -- Solution module Solution {A : Set} where infixr 5 _∷_ infix 4 _∣_∣_≈P_ _∣_∣_≈W_ infix 3 _∎ infixr 2 _≈⟨_⟩_ -- Let us first define a small language of equality proofs. -- -- m ∣ n ∣ xs ≈P ys means that xs and ys, which are streams -- generated in chunks of size 1 + m, where the outer chunk has size -- n, are equal. mutual -- Weak head normal forms of programs. data _∣_∣_≈W_ : ℕ → ℕ → Stream A → Stream A → Set where reset : ∀ {xs₁ xs₂ m} (xs₁≈xs₂ : ∞ (m ∣ suc m ∣ xs₁ ≈P xs₂)) → m ∣ 0 ∣ xs₁ ≈W xs₂ _∷_ : ∀ x {xs₁ xs₂ m n} (xs₁≈xs₂ : m ∣ n ∣ ♭ xs₁ ≈W ♭ xs₂) → m ∣ suc n ∣ x ∷ xs₁ ≈W x ∷ xs₂ -- Programs. data _∣_∣_≈P_ : ℕ → ℕ → Stream A → Stream A → Set where -- WHNFs are programs. ↑ : ∀ {m n xs₁ xs₂} (xs₁≈xs₂ : m ∣ n ∣ xs₁ ≈W xs₂) → m ∣ n ∣ xs₁ ≈P xs₂ -- Various congruences. _∷_ : ∀ x {xs₁ xs₂ m n} (xs₁≈xs₂ : m ∣ n ∣ ♭ xs₁ ≈P ♭ xs₂) → m ∣ suc n ∣ x ∷ xs₁ ≈P x ∷ xs₂ _⋎-cong_ : ∀ {xs₁ xs₂ ys₁ ys₂} (xs₁≈xs₂ : 1 ∣ 1 ∣ xs₁ ≈P xs₂) (ys₁≈ys₂ : 0 ∣ 1 ∣ ys₁ ≈P ys₂) → 1 ∣ 2 ∣ xs₁ ⋎ ys₁ ≈P xs₂ ⋎ ys₂ evens-cong : ∀ {xs₁ xs₂} (xs₁≈xs₂ : 1 ∣ 1 ∣ xs₁ ≈P xs₂) → 0 ∣ 1 ∣ evens xs₁ ≈P evens xs₂ odds-cong : ∀ {xs₁ xs₂} (xs₁≈xs₂ : 1 ∣ 2 ∣ xs₁ ≈P xs₂) → 0 ∣ 1 ∣ odds xs₁ ≈P odds xs₂ -- Equational reasoning. _≈⟨_⟩_ : ∀ xs₁ {xs₂ xs₃ m n} (xs₁≈xs₂ : m ∣ n ∣ xs₁ ≈P xs₂) (xs₂≈xs₃ : m ∣ n ∣ xs₂ ≈P xs₃) → m ∣ n ∣ xs₁ ≈P xs₃ _∎ : ∀ {n m} xs → m ∣ n ∣ xs ≈P xs -- If we have already produced 1 + n elements of the last chunk, -- then it is safe to pretend that we have only produced n -- elements. shift : ∀ {n m xs₁ xs₂} (xs₁≈xs₂ : m ∣ suc n ∣ xs₁ ≈P xs₂) → m ∣ n ∣ xs₁ ≈P xs₂ -- A variation of the statement we want to prove. goal′ : ∀ {φ₁ φ₂ xs₁ xs₂} (s₁ : SatisfiesEquation φ₁) (s₂ : SatisfiesEquation φ₂) (xs₁≈xs₂ : 0 ∣ 1 ∣ xs₁ ≈P xs₂) → 1 ∣ 1 ∣ rhs φ₁ xs₁ ≈P rhs φ₂ xs₂ -- The equality language is complete. completeW : ∀ {n m xs ys} → xs ≈ ys → m ∣ n ∣ xs ≈W ys completeW {zero} xs≈ys = reset (♯ ↑ (completeW xs≈ys)) completeW {suc n} (P.refl ∷ xs≈ys) = _ ∷ completeW (♭ xs≈ys) -- If we can prove that the equality language is sound, then the -- following lemma implies the intended result. goal : ∀ {φ₁ φ₂ xs₁ xs₂} (s₁ : SatisfiesEquation φ₁) (s₂ : SatisfiesEquation φ₂) → 0 ∣ 1 ∣ xs₁ ≈P xs₂ → 1 ∣ 1 ∣ φ₁ xs₁ ≈P φ₂ xs₂ goal {φ₁} {φ₂} {xs₁} {xs₂} s₁ s₂ xs₁≈xs₂ = φ₁ xs₁ ≈⟨ ↑ (completeW (s₁ xs₁)) ⟩ rhs φ₁ xs₁ ≈⟨ goal′ s₁ s₂ xs₁≈xs₂ ⟩ rhs φ₂ xs₂ ≈⟨ ↑ (completeW (S.sym (s₂ xs₂))) ⟩ φ₂ xs₂ ∎ -- Some lemmas about weak head normal forms. evens-congW : {xs₁ xs₂ : Stream A} → 1 ∣ 1 ∣ xs₁ ≈W xs₂ → 0 ∣ 1 ∣ evens xs₁ ≈W evens xs₂ evens-congW (x ∷ reset xs₁≈xs₂) = x ∷ reset (♯ odds-cong (♭ xs₁≈xs₂)) reflW : ∀ xs {m} n → m ∣ n ∣ xs ≈W xs reflW xs zero = reset (♯ (xs ∎)) reflW (x ∷ xs) (suc n) = x ∷ reflW (♭ xs) n transW : ∀ {xs ys zs m n} → m ∣ n ∣ xs ≈W ys → m ∣ n ∣ ys ≈W zs → m ∣ n ∣ xs ≈W zs transW (x ∷ xs≈ys) (.x ∷ ys≈zs) = x ∷ transW xs≈ys ys≈zs transW (reset xs≈ys) (reset ys≈zs) = reset (♯ (_ ≈⟨ ♭ xs≈ys ⟩ ♭ ys≈zs)) shiftW : ∀ n {m xs₁ xs₂} → m ∣ suc n ∣ xs₁ ≈W xs₂ → m ∣ n ∣ xs₁ ≈W xs₂ shiftW zero (x ∷ reset xs₁≈xs₂) = reset (♯ (x ∷ shift (♭ xs₁≈xs₂))) shiftW (suc n) (x ∷ xs₁≈xs₂) = x ∷ shiftW n xs₁≈xs₂ -- Every program can be transformed into WHNF. whnf : ∀ {xs ys m n} → m ∣ n ∣ xs ≈P ys → m ∣ n ∣ xs ≈W ys whnf (↑ xs≈ys) = xs≈ys whnf (x ∷ xs₁≈xs₂) = x ∷ whnf xs₁≈xs₂ whnf (xs₁≈xs₂ ⋎-cong ys₁≈ys₂) with whnf xs₁≈xs₂ | whnf ys₁≈ys₂ ... | x ∷ reset xs₁≈xs₂′ | y ∷ reset ys₁≈ys₂′ = x ∷ y ∷ reset (♯ (shift (♭ xs₁≈xs₂′) ⋎-cong ♭ ys₁≈ys₂′)) whnf (evens-cong xs₁≈xs₂) = evens-congW (whnf xs₁≈xs₂) whnf (odds-cong xs₁≈xs₂) with whnf xs₁≈xs₂ ... | x ∷ xs₁≈xs₂′ = evens-congW xs₁≈xs₂′ whnf (xs₁ ≈⟨ xs₁≈xs₂ ⟩ xs₂≈xs₃) = transW (whnf xs₁≈xs₂) (whnf xs₂≈xs₃) whnf (xs ∎) = reflW xs _ whnf (shift xs₁≈xs₂) = shiftW _ (whnf xs₁≈xs₂) whnf (goal′ s₁ s₂ xs₁≈xs₂) with whnf xs₁≈xs₂ ... | (x ∷ reset xs₁≈xs₂′) = x ∷ reset (♯ (goal s₁ s₂ (evens-cong (goal s₁ s₂ xs₁≈xs₂)) ⋎-cong ♭ xs₁≈xs₂′)) -- Soundness follows by a corecursive repetition of the whnf -- procedure. ⟦_⟧W : ∀ {xs ys m n} → m ∣ n ∣ xs ≈W ys → xs ≈ ys ⟦ reset ys≈zs ⟧W with whnf (♭ ys≈zs) ... | x ∷ ys≈zs′ = P.refl ∷ ♯ ⟦ ys≈zs′ ⟧W ⟦ x ∷ ys≈zs ⟧W = P.refl ∷ ♯ ⟦ ys≈zs ⟧W ⟦_⟧P : ∀ {xs ys m n} → m ∣ n ∣ xs ≈P ys → xs ≈ ys ⟦ xs≈ys ⟧P = ⟦ whnf xs≈ys ⟧W -- Wrapping up. solution : Statement solution s₁ s₂ s = ⟦ goal s₁ s₂ (s ∎) ⟧P where open Solution
.emacs.d/elpa/ada-ref-man-2012.5/progs/arm_rtf.adb
caqg/linux-home
0
15189
<filename>.emacs.d/elpa/ada-ref-man-2012.5/progs/arm_rtf.adb with --ARM_Output, --ARM_Contents, --Ada.Text_IO, Ada.Exceptions, Ada.Streams.Stream_IO, Ada.Strings.Maps, Ada.Strings.Fixed, Ada.Characters.Handling, Ada.Calendar, Ada.Unchecked_Conversion; package body ARM_RTF is -- -- Ada reference manual formatter (ARM_Form). -- -- This package defines the RTF output object. -- Output objects are responsible for implementing the details of -- a particular format. -- -- --------------------------------------- -- Copyright 2000, 2002, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012, -- 2013, 2016 -- AXE Consultants. All rights reserved. -- P.O. Box 1512, Madison WI 53701 -- E-Mail: <EMAIL> -- -- ARM_Form is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License version 3 -- as published by the Free Software Foundation. -- -- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS" -- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, -- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL. -- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL, -- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES, -- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -- DAMAGES. -- -- A copy of the GNU General Public License is available in the file -- gpl-3-0.txt in the standard distribution of the ARM_Form tool. -- Otherwise, see <http://www.gnu.org/licenses/>. -- -- If the GPLv3 license is not satisfactory for your needs, a commercial -- use license is available for this tool. Contact Randy at AXE Consultants -- for more information. -- -- --------------------------------------- -- -- Edit History: -- -- 5/18/00 - RLB - Created package. -- 5/22/00 - RLB - Added Includes_Changes to Create. -- 5/23/00 - RLB - Added Set_Column and New_Column. -- - Added Tab_Info and Tab_Stops. -- 5/24/00 - RLB - Added Location to Text_Format. -- - RLB - Added No_Breaks and Keep_with_Next to Start_Paragraph. -- 5/25/00 - RLB - Added Big_Files to Create. Added Justification. -- - RLB - Added Separator_Lines and TOC routines. -- 5/26/00 - RLB - Added table operations. -- 5/27/00 - RLB - Implemented table operations. -- 5/28/00 - RLB - Added index style. -- 6/ 2/00 - RLB - Added Soft_Line_Break. -- - RLB - Changed back to mostly "after" spacing, so paragraph -- numbers format correctly on tops of pages. -- 8/ 2/00 - RLB - Added Soft_Hyphen_Break and left and right quote -- characters. -- - RLB - Added additional styles. -- - RLB - Fixed bulleted styles to have a right indent as well. -- 8/ 4/00 - RLB - Added additional styles. -- - RLB - Fixed table text size. -- 8/ 7/00 - RLB - Added Leading flag to Start_Paragraph, removed "Leading" -- styles. -- 8/ 8/00 - RLB - Added "Hang_Width" in order to get more accurate -- hang prefix determination. -- 8/10/00 - RLB - Style corrections. -- 8/11/00 - RLB - Fixed footers for clauses with very long titles. -- - RLB - Added Hanging_in_Bulleted styles. -- 8/16/00 - RLB - Adjusted so captial 'I' is not a large character. -- - RLB - Added Code_Indented_Nested_Bulleted and Notes_Nested_Bulleted. -- 8/17/00 - RLB - Replaced "Leading" by "Space_After". -- - RLB - Added Nested_Enumerated. -- 8/21/00 - RLB - Moved paragraph numbers in a bit for AARM. -- 8/22/00 - RLB - Added Revised_Clause_Header. -- 8/23/00 - RLB - Revised widths of AARM text to be more like RM. -- 8/31/00 - RLB - Moved paragraphs in again. -- 9/26/00 - RLB - Added Syntax_Summary style. -- 9/27/00 - RLB - Cut the lower margin for the AARM pages. -- 7/18/02 - RLB - Removed Document parameter, replaced by three -- strings. -- - RLB - Added AI_Reference. -- - RLB - Added Change_Version_Type and uses. -- 9/10/04 - RLB - Added "Both" to possible changes to handle -- replacement of changed text. -- 9/14/04 - RLB - Moved Change_Version_Type to contents. -- 9/15/04 - RLB - Completely rewrote Text_Format to avoid problems -- with ordering of calls. -- 11/03/04 - RLB - Added Nested_X2_Bulleted. -- 11/15/04 - RLB - Added Indented_Nested_Bulleted. -- 11/16/04 - RLB - Experimented with changes to avoid the hot pink -- revision markers. -- 12/15/04 - RLB - Added Pascal's workaround to formatting bugs in -- Word 2000/XP/2003. -- 12/16/04 - RLB - Removed it after it proved not to help. -- 1/24/05 - RLB - Added Inner_Indent. -- 2/ 1/05 - RLB - Added Turkish chars to allow an AARM note. -- 5/27/05 - RLB - Added arbitrary Unicode characters. -- 1/11/06 - RLB - Eliminated dispatching Create in favor of tailored -- versions. -- 1/18/06 - RLB - Added additional styles. -- 2/ 8/06 - RLB - Added additional parameters to the table command. -- 2/10/06 - RLB - Added even more additional parameters to the -- table command. -- - RLB - Added picture command. -- 9/21/06 - RLB - Added Body_Font; revised styles to handle that. -- 9/22/06 - RLB - Added Subsubclause. -- 9/25/06 - RLB - Handled optional renaming of TOC. -- - RLB - Added Last_Column_Width to Start_Table. -- 10/10/06 - RLB - Widened bulleted and enumerated hanging a bit to make -- room for wider numbers for ISO 2004 format. -- 10/13/06 - RLB - Added Local_Link_Start and Local_Link_End to allow -- formatting in the linked text. -- 12/22/06 - RLB - Fixed glitch in number of column units. -- 2/ 9/07 - RLB - Changed comments on AI_Reference. -- 2/14/07 - RLB - Revised to separate style and indent information -- for paragraphs. -- 2/16/07 - RLB - Added example styles for additional nesting levels. -- 2/19/07 - RLB - Added Standard Title style. -- 12/18/07 - RLB - Fixed silly table bug. -- - RLB - Added Plain_Annex. -- 12/19/07 - RLB - Added limited colors to Text_Format. -- 12/21/07 - RLB - Removed extra "not" from "large" character counter -- in Ordinary_Character. -- 5/ 4/09 - RLB - Added the footer information. -- 5/ 6/09 - RLB - Added ISO format footer and version names. -- 10/28/09 - RLB - Added missing with. -- 3/31/10 - RLB - Adjusted picture scaling to be closer to reality. -- 10/18/11 - RLB - Changed to GPLv3 license. -- 10/20/11 - RLB - Updated to handle extra-wide paragraph numbers -- automatically (there are too many to hand-fix now). -- 10/25/11 - RLB - Added old insertion version to Revised_Clause_Header. -- 4/ 3/12 - RLB - Eliminated redundancy. -- 8/31/12 - RLB - Added Output_Path. -- 10/18/12 - RLB - Added additional hanging styles. -- 11/05/12 - RLB - Added various additional styles. -- 11/26/12 - RLB - Added subdivision names to Clause_Header and -- Revised_Clause_Header. -- 12/13/12 - RLB - Added style needed by AARM (only in deleted text). -- 8/16/13 - RLB - Added missing style needed by recent RM change. -- 6/28/16 - RLB - Added missing style needed by recent ACATS -- documentation change. -- 8/19/16 - RLB - Nasty bug in End_Hang_Item: it loses any open styles -- if a line break has to be inserted. -- Note: We assume a lot about the Section_Names passed into -- Section in order to get the proper headers/footers/page numbers. -- Someday, that ought to be changed somehow. LINE_LENGTH : constant := 78; -- Maximum intended line length. LEADING_PERCENT : constant := 70; -- Leading is 70% of normal height. TRAILING_PERCENT : constant := 150; -- Leading is 150% of normal height. type Format_Info_Type is record Defined : Boolean := False; Size : Natural; -- In 1/2 pts. Indent : Natural; -- In Twips (.1 pt = 1/120th pica = 1/1440th inch). Hang_Width : Natural; -- In Twips (.1 pt = 1/120th pica = 1/1440th inch). Before : Natural; -- Vertical space before in Twips. (\sb) After : Natural; -- Vertical space after in Twips. (\sa) Is_Justified : Boolean; -- True if the format is justified. (\qj vs. \qc or \ql) Number : Natural; -- Style number. Format_String : String(1 .. 200); Format_Len : Natural := 0; end record; Paragraph_Info : array (ARM_Output.Paragraph_Style_Type, ARM_Output.Paragraph_Indent_Type) of Format_Info_Type; -- Set by Start_RTF_File. Heading_1_Info : Format_Info_Type; Heading_2_Info : Format_Info_Type; Heading_3_Info : Format_Info_Type; Heading_4_Info : Format_Info_Type; Category_Header_Info : Format_Info_Type; Normal_Paragraph_Number_Info : Format_Info_Type; Wide_Paragraph_Number_Info : Format_Info_Type; Header_Info : Format_Info_Type; Footer_Info : Format_Info_Type; TOC_1_Info : Format_Info_Type; TOC_2_Info : Format_Info_Type; TOC_3_Info : Format_Info_Type; TOC_4_Info : Format_Info_Type; Table_C_Text_Info : Format_Info_Type; Table_L_Text_Info : Format_Info_Type; Table_C_Sml_Text_Info : Format_Info_Type; Table_L_Sml_Text_Info : Format_Info_Type; procedure Set_Style (Into : in out Format_Info_Type; Font : in ARM_Output.Font_Family_Type; -- Default means use Body_Font. Body_Font : in ARM_Output.Font_Family_Type; Font_Size : in Natural; Style_Indent : in Natural; Style_Hang_Width : in Natural := 0; Style_Before : in Natural; Style_After : in Natural; Style_Justified : in Boolean; Style_String_Prefix : in String; Style_String_Suffix : in String) is -- Internal routine. -- Set the indicated style information. -- The two part of the Style String includes all of the information -- except Font (\fn), Font_Size (\fsnn), Indent (\linn), Hang (\fi-nn), -- Before (\sbnn), and After (\sann) -- these are added appropriately -- between the halves of the string. Font_String : String(1..3) := "\f0"; function Make (Code : in String; Value : in Natural) return String is Val : constant String := Natural'Image(Value); begin if Value /= 0 then return '\' & Code & Val(2..Val'Last); else return ""; -- Make nothing. end if; end Make; begin Into.Defined := True; Into.Size := Font_Size; case Font is when ARM_Output.Default => if ARM_Output."=" (Body_Font, ARM_Output.Swiss) then Font_String(3) := '1'; Into.Size := Into.Size - 1; else -- Roman. Font_String(3) := '0'; end if; when ARM_Output.Roman => Font_String(3) := '0'; when ARM_Output.Swiss => Font_String(3) := '1'; when ARM_Output.Fixed => Font_String(3) := '2'; end case; Into.Indent := Style_Indent; Into.Hang_Width := Style_Hang_Width; Into.Before := Style_Before; Into.After := Style_After; Into.Is_Justified := Style_Justified; declare Style : constant String := Style_String_Prefix & " " & Font_String & Make ("fs", Into.Size) & Make ("li", Into.Indent) & Make ("fi-", Into.Hang_Width) & Make ("sb", Into.Before) & Make ("sa", Into.After) & Style_String_Suffix; begin Ada.Strings.Fixed.Move (Source => Style, Target => Into.Format_String); Into.Format_Len := Style'Length; end; end Set_Style; procedure Write_Style (Fyle : in Ada.Text_IO.File_Type; Style : in Format_Info_Type) is -- Internal routine. -- Write a header to start a style definition for Style. begin if not Style.Defined then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Undefined Style in style table"); end if; Ada.Text_IO.Put (Fyle, "{" & Style.Format_String(1 .. Style.Format_Len)); end Write_Style; procedure Write_Style_for_Paragraph (Fyle : in Ada.Text_IO.File_Type; Style : in Format_Info_Type; Count : out Natural) is -- Internal routine. -- Write a header to start a paragraph in Style. Count is set to -- the characters written. begin if not Style.Defined then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Undefined Style in paragraph"); end if; Ada.Text_IO.Put (Fyle, "{\pard\plain " & Style.Format_String(1 .. Style.Format_Len)); Count := Style.Format_Len + 13; end Write_Style_for_Paragraph; procedure Write_Headers (Output_Object : in out RTF_Output_Type) is -- Write the page headers for this object into the current file. Junk : Natural; begin -- Default header/footer: Ada.Text_IO.Put (Output_Object.Output_File, "{\headerl "); Write_Style_for_Paragraph (Output_Object.Output_File, Header_Info, Junk); if Ada.Strings.Unbounded.Length (Output_Object.Header_Prefix) = 0 then Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b\f1 " & Ada.Strings.Unbounded.To_String (Output_Object.Title) & "\par}}}"); elsif Ada.Strings.Unbounded.Length (Output_Object.Title) = 0 then Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b\f1 " & Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) & "\par}}}"); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b\f1 " & Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) & " \emdash " & Ada.Strings.Unbounded.To_String (Output_Object.Title) & "\par}}}"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "{\headerr "); Write_Style_for_Paragraph (Output_Object.Output_File, Header_Info, Junk); if Ada.Strings.Unbounded.Length (Output_Object.Header_Prefix) = 0 then Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\qr\b\f1 " & Ada.Strings.Unbounded.To_String (Output_Object.Title) & "\par}}}"); elsif Ada.Strings.Unbounded.Length (Output_Object.Title) = 0 then Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\qr\b\f1 " & Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) & "\par}}}"); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\qr\b\f1 " & Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) & " \emdash " & Ada.Strings.Unbounded.To_String (Output_Object.Title) & "\par}}}"); end if; -- Note: We don't need the default footers; none probably work better, anyway. -- Ada.Text_IO.Put (Output_Object.Output_File, "{\footerl "); -- Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Junk); -- if Name = "00" or else Name = "TOC" or else Name = "Ttl" then -- -- No section number. -- Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 "); -- else -- Ada.Text_IO.Put (Output_Object.Output_File, "{\b\f1 "); -- if Name(1) = '0' then -- Strip leading zero... -- Ada.Text_IO.Put (Output_Object.Output_File, Name(2..Name'Last)); -- else -- Ada.Text_IO.Put (Output_Object.Output_File, Name); -- end if; -- Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f0 "); -- end if; -- Ada.Text_IO.Put (Output_Object.Output_File, Title); -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\tab \tab{\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\par}}}"); -- Ada.Text_IO.Put (Output_Object.Output_File, "{\footerr "); -- Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Junk); -- Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\tab \tab "); -- Ada.Text_IO.Put (Output_Object.Output_File, Title); -- if Name = "00" or else Name = "TOC" or else Name = "Ttl" then -- null; -- No section number. -- else -- Ada.Text_IO.Put (Output_Object.Output_File, "\~\~\~\b\f1 "); -- if Name(1) = '0' then -- Strip leading zero... -- Ada.Text_IO.Put (Output_Object.Output_File, Name(2..Name'Last)); -- else -- Ada.Text_IO.Put (Output_Object.Output_File, Name); -- end if; -- end if; -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}}"); end Write_Headers; procedure Start_RTF_File (Output_Object : in out RTF_Output_Type; File_Name : in String; Title : in String; Name : in String) is -- Internal routine. -- Create an RTF file, and generate the needed text to start an RTF -- file. The file name is just the name portion, not the path or -- extension. "Name" is a short identifier, typically the clause -- number or letter. INDENT_UNIT : constant := 360; subtype PWidth is String(1..4); function Paper_Width return PWidth is -- Return the paper width in twips: begin case Output_Object.Page_Size is when ARM_RTF.A4 => return "9030"; when ARM_RTF.Letter => return "9360"; when ARM_RTF.Half_Letter => return "5760"; when ARM_RTF.Ada95 => return "7740"; end case; end Paper_Width; function Half_Paper_Width return PWidth is -- Return the center of the paper width in twips: begin case Output_Object.Page_Size is when ARM_RTF.A4 => return "4515"; when ARM_RTF.Letter => return "4680"; when ARM_RTF.Half_Letter => return "2880"; when ARM_RTF.Ada95 => return "3870"; end case; end Half_Paper_Width; begin Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File, Ada.Strings.Unbounded.To_String (Output_Object.Output_Path) & File_Name & ".RTF"); -- Note: This header (simplified) is from a Word 97 created file. -- File introduction: Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033"); -- rtf1=RTF file marker; -- ansi=character set is ansi; -- ansicpg=code page for ansi-Unicode conversion (1252); -- uc1=One character replacement for Unicode characters; -- deff0=Default font to use (Font 0); -- deflang=default language (1033 - American English); -- deflangfe=default language (asian text) (1033 - American English). -- Font table: Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\fonttbl"); case Output_Object.Primary_Serif_Font is when Times_New_Roman => Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f0\froman\fcharset0 Times New Roman;}"); when Souvenir => Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f0\froman\fcharset0 Souvenir{\*\falt Souvienne};}"); end case; case Output_Object.Primary_Sans_Serif_Font is when Helvetica => Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f1\fswiss\fcharset0 Helvetica{\*\falt Arial};}"); -- Usually Arial on most Windows machines. when Arial => Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f1\fswiss\fcharset0 Arial{\*\falt Helvetica};}"); -- Give Arial preference, because otherwise it screwed up <NAME>'s machine. end case; Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f2\fmodern\fcharset0\fprq1 Courier New;}"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f3\ftech\fcharset0 Symbol;}}"); -- f=Font number; -- fswiss,froman,fmodern,gtech=font family; -- fcharset=character set (0=Ansi); -- fprq=pitch (0=anything (default); 1=fixed; 2=variable); -- falt=alternative font name; -- followed by the font name -- File table: (None used.) -- Color table: Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\colortbl;"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green0\blue0;"); -- Color 1 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green0\blue255;"); -- Color 2 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green255\blue255;"); -- Color 3 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green255\blue0;"); -- Color 4 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green0\blue255;"); -- Color 5 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green0\blue0;"); -- Color 6 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green255\blue0;"); -- Color 7 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green255\blue255;"); -- Color 8 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green0\blue128;"); -- Color 9 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green128\blue128;"); -- Color 10 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green128\blue0;"); -- Color 11 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green0\blue128;"); -- Color 12 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green0\blue0;"); -- Color 13 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green128\blue0;"); -- Color 14 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green128\blue128;"); -- Color 15 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red192\green192\blue192;}"); -- Color 16 -- Style sheet: Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\stylesheet"); if Output_Object.Page_Size = ARM_RTF.Ada95 or else Output_Object.Page_Size = ARM_RTF.Half_Letter then -- These are smaller page sizes than the other sizes. -- ** TBD: Consider putting this into a separate parameter (there is -- ** little reason for the font size to depend on the page size). Set_Style (Paragraph_Info(ARM_Output.Normal, 0), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => 0, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s0\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext0 "); Set_Style (Heading_1_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 28, Style_Indent => 0, Style_Before => 0, Style_After => 210, Style_Justified => FALSE, Style_String_Prefix => "\s1\keepn\widctlpar\outlinelevel0\adjustright", Style_String_Suffix => "\b\kerning28\qc\cgrid \sbasedon0 \snext0 "); Set_Style (Heading_2_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 24, Style_Indent => 0, Style_Before => 240, Style_After => 120, Style_Justified => FALSE, Style_String_Prefix => "\s2\keepn\widctlpar\outlinelevel1\adjustright", Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 "); Set_Style (Heading_3_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 23, Style_Indent => 0, Style_Before => 210, Style_After => 90, Style_Justified => FALSE, Style_String_Prefix => "\s3\keepn\widctlpar\outlinelevel2\adjustright", Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 "); Set_Style (Category_Header_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => 0, Style_Before => 100, Style_After => 60, Style_Justified => FALSE, Style_String_Prefix => "\s4\keepn\adjustright", Style_String_Suffix => "\cgrid\qc\i \snext0 "); Set_Style (Normal_Paragraph_Number_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 12, Style_Indent => 0, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s5\keepn\widctlpar\adjustright " & "\pvpara\phpg\posxo\posy0\absw450\dxfrtext100\dfrmtxtx120\dfrmtxty120"& "\cgrid\qc", Style_String_Suffix => "\snext0 "); -- Note: We adjust the space before on use. Set_Style (Wide_Paragraph_Number_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 12, Style_Indent => 0, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s5\keepn\widctlpar\adjustright " & "\pvpara\phpg\posxo\posy0\absw490\dxfrtext100\dfrmtxtx120\dfrmtxty120"& "\cgrid\qc", Style_String_Suffix => "\snext0 "); -- Note: We adjust the space before on use. Set_Style (Paragraph_Info(ARM_Output.Small, 1), -- Notes Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s6\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext6 "); Set_Style (Paragraph_Info(ARM_Output.Small, 2), -- Annotations Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s7\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext7 "); Set_Style (Paragraph_Info(ARM_Output.Examples, 1), Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s8\widctlpar\adjustright", Style_String_Suffix => "\cgrid\sl-160\ql \snext8 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 3), Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s9\widctlpar\adjustright", Style_String_Suffix => "\cgrid\sl-140\ql \snext9 "); Set_Style (Paragraph_Info(ARM_Output.Normal, 1), -- Syntax indent Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s10\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-200 \snext10 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Normal, 3), -- Regular indent Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s11\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext11 "); Set_Style (Paragraph_Info(ARM_Output.Small, 5), -- Regular annotation indent Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*5, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s12\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext12 "); Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 1080, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s13\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext13 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 1), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*1, Style_Hang_Width => 360, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s14\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext14 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 5), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 1080, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s15\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext15 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 360, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s16\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext16 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Bulleted, 1), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*1, Style_Hang_Width => 240, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s17\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext17 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 2), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 220, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s18\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx720 \snext18 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 220, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s19\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext19 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 200, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s20\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1440 \snext20 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Bulleted, 4), -- Indented bullets Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 240, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s21\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1080 \snext21 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Bulleted, 2), -- Syntax indent bullets Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 240, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s22\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx720 \snext22 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Bulleted, 3), -- Code indented bullets Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 240, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s23\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1080 \snext23 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Normal, 2), -- Code indented Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s24\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext24 "); Set_Style (Paragraph_Info(ARM_Output.Small, 4), -- Code indented annotations. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s25\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext25 "); Set_Style (Paragraph_Info(ARM_Output.Examples, 4), -- Indented examples Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s26\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-160 \snext26 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 6), -- Indented annotation examples. Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*6, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s27\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-140 \snext27 "); Set_Style (Header_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 17, Style_Indent => 0, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s28\widctlpar\tqc\tx" & Half_Paper_Width & "\tqr\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\cgrid \sbasedon0 \snext28 "); Set_Style (Footer_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 17, Style_Indent => 0, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s29\widctlpar" & -- "\tqc\tx" & Half_Paper_Width & -- We don't use or define the center tab; it causes problems with very long titles. "\tqr\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\cgrid \sbasedon0 \snext29 "); Set_Style (Paragraph_Info(ARM_Output.Index, 0), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => 225, Style_Hang_Width => 225, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s31\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext31 "); Set_Style (Paragraph_Info(ARM_Output.Wide_Above, 0), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => 0, Style_Before => 120, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s32\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext0 "); Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Above, 2), -- Wide above annotations. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*2, Style_Before => 90, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s33\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext7 "); Set_Style (Paragraph_Info(ARM_Output.Small_Header, 1), -- Notes header Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 0, Style_Justified => TRUE, Style_String_Prefix => "\s34\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext6 "); -- Note: No extra space afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 2), -- Bullets in notes Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 240, Style_Before => 0, Style_After => 60, Style_Justified => TRUE, Style_String_Prefix => "\s35\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx720 \snext35 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 3), -- Nested bullets in notes Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 230, Style_Before => 0, Style_After => 60, Style_Justified => TRUE, Style_String_Prefix => "\s36\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext36 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Hanging_in_Bulleted, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 720, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s37\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0 \snext14 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, 5), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 720, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s38\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0 \snext16 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 4), -- Code indent nested bullets Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 220, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s39\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1440 \snext39 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Syntax_Summary, 1), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 65, Style_Justified => FALSE, Style_String_Prefix => "\s40\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext40 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Enumerated, 1), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*1, Style_Hang_Width => 240, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s41\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext41 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 220, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s42\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext42 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Enumerated, 2), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 260, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s43\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext43 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 240, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s44\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext44 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 3), -- Doubly nested bullets Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 220, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s45\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx720 \snext45 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 5), -- Doubly nested bullets Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 200, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s46\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1440 \snext46 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 5), -- Indented nested bullets. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 240, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s47\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1080 \snext47 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Normal, 4), -- Inner indented Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s48\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext48 "); Set_Style (Paragraph_Info(ARM_Output.Small, 6), -- Inner indented Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*6, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s49\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext49 "); Set_Style (Paragraph_Info(ARM_Output.Small, 3), -- Annotations in syntax indentation Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s50\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext50 "); Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 1), Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s51\widctlpar\adjustright", Style_String_Suffix => "\cgrid\sl-180\ql \snext51 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 3), Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s52\widctlpar\adjustright", Style_String_Suffix => "\cgrid\sl-160\ql \snext52 "); Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 4), -- Indented Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s53\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180 \snext53 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 6), -- Indented Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*6, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s54\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-160 \snext54 "); Set_Style (Paragraph_Info(ARM_Output.Enumerated, 3), -- Doubly nested enumerations Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 260, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s55\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext43 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 5), -- Doubly nested enumerations Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 240, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s56\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext56 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Examples, 2), -- Syntax Indented examples Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s57\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-160 \snext57 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 4), -- Syntax Indented annotation examples. Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s58\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-140 \snext58 "); Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 2), -- Syntax Indented Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s59\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180 \snext59 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 4), -- Syntax Indented Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s60\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-160 \snext60 "); Set_Style (Paragraph_Info(ARM_Output.Examples, 3), -- Code Indented examples Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s61\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-160 \snext61 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 5), -- Code Indented annotation examples. Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*5, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s62\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-140 \snext62 "); Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 3), -- Code Indented Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s63\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180 \snext63 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 5), -- Code Indented Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*5, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s64\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-160 \snext64 "); Set_Style (Paragraph_Info(ARM_Output.Title, 0), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 34, -- Slightly less than double. Style_Indent => 0, Style_Before => 120, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s65\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-360\slmult0 \snext0 "); Set_Style (Paragraph_Info(ARM_Output.Giant_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 1440, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s66\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext66 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 2), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 720, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s67\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext67 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Giant_Hanging, 6), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*6, Style_Hang_Width => 1440, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s68\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext68 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 720, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s69\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext69 "); -- Note: Narrower space between and afterwards. -- The following are indented one extra level: Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 2), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 360, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s70\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext70 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 720, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s71\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext71 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 1080, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s72\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext72 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 360, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s73\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext73 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 5), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 720, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s74\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext74 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 6), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*6, Style_Hang_Width => 1080, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s75\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext75 "); -- Note: Narrower space between and afterwards. -- The following are indented two extra levels: Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 360, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s76\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext76 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 720, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s77\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext77 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 5), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 360, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s78\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext78 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 6), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => INDENT_UNIT*6, Style_Hang_Width => 720, Style_Before => 0, Style_After => 80, Style_Justified => TRUE, Style_String_Prefix => "\s79\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext79 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 2), -- Notes indent Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s80\widctlpar\adjustright", Style_String_Suffix => "\cgrid\sl-140\ql \snext80 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 1), Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s81\widctlpar\adjustright", Style_String_Suffix => "\cgrid\sl-160\ql \snext81 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 2), Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s82\widctlpar\adjustright", Style_String_Suffix => "\cgrid\sl-160\ql \snext82 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 1), Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s83\widctlpar\adjustright", Style_String_Suffix => "\cgrid\sl-140\ql \snext83 "); Set_Style (Paragraph_Info(ARM_Output.Examples, 5), -- Child Indented examples Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*5, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s84\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-160 \snext84 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 7), -- Child Indented annotation examples. Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => INDENT_UNIT*7, Style_Before => 0, Style_After => 70, Style_Justified => FALSE, Style_String_Prefix => "\s85\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-140 \snext85 "); -- The following are indented three extra levels: Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 360, Style_Before => 0, Style_After => 100, Style_Justified => TRUE, Style_String_Prefix => "\s86\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext86 "); -- Note: Narrower space between and afterwards. -- New styles should be added here, following numbers will need adjustments. Set_Style (Heading_4_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => 0, Style_Before => 210, Style_After => 90, Style_Justified => FALSE, Style_String_Prefix => "\s87\keepn\widctlpar\outlinelevel3\adjustright", Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 "); if Output_Object.Big_Files then -- Define the TOC styles: Set_Style (TOC_1_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 20, Style_Indent => 0, Style_Before => 45, Style_After => 45, Style_Justified => FALSE, Style_String_Prefix => "\s88\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 "); Set_Style (TOC_2_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 17, Style_Indent => 200, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s89\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 "); Set_Style (TOC_3_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 17, Style_Indent => 400, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s90\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 "); Set_Style (TOC_4_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 17, Style_Indent => 600, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s91\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 "); end if; Set_Style (Table_C_Text_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => 0, Style_Before => 20, Style_After => 20, Style_Justified => FALSE, Style_String_Prefix => "", Style_String_Suffix => "\qc "); -- We use a bit of space above and below to avoid overrunning -- the borders of the cells. Set_Style (Table_L_Text_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => 0, Style_Before => 20, Style_After => 20, Style_Justified => FALSE, Style_String_Prefix => "", Style_String_Suffix => "\ql "); Set_Style (Table_C_Sml_Text_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => 0, Style_Before => 20, Style_After => 20, Style_Justified => FALSE, Style_String_Prefix => "", Style_String_Suffix => "\qc "); Set_Style (Table_L_Sml_Text_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 15, Style_Indent => 0, Style_Before => 20, Style_After => 20, Style_Justified => FALSE, Style_String_Prefix => "", Style_String_Suffix => "\ql "); else Set_Style (Paragraph_Info(ARM_Output.Normal, 0), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => 0, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s0\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext0 "); Set_Style (Heading_1_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 36, Style_Indent => 0, Style_Before => 0, Style_After => 210, Style_Justified => FALSE, Style_String_Prefix => "\s1\keepn\widctlpar\outlinelevel0\adjustright", Style_String_Suffix => "\b\kerning36\qc\cgrid \sbasedon0 \snext0 "); Set_Style (Heading_2_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 28, Style_Indent => 0, Style_Before => 240, Style_After => 120, Style_Justified => FALSE, Style_String_Prefix => "\s2\keepn\widctlpar\outlinelevel1\adjustright", Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 "); Set_Style (Heading_3_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 28, Style_Indent => 0, Style_Before => 210, Style_After => 100, Style_Justified => FALSE, Style_String_Prefix => "\s3\keepn\widctlpar\outlinelevel2\adjustright", Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 "); Set_Style (Category_Header_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => 0, Style_Before => 120, Style_After => 120, Style_Justified => FALSE, Style_String_Prefix => "\s4\keepn\adjustright", Style_String_Suffix => "\cgrid\qc\i \snext0 "); Set_Style (Normal_Paragraph_Number_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => 0, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s5\keepn\widctlpar\adjustright " & "\pvpara\phpg\posxo\posy0\absw580\dxfrtext100\dfrmtxtx150\dfrmtxty150"& "\cgrid\qc", Style_String_Suffix => "\snext0 "); -- We adjust the space before for each number. -- Frame commands: -- \pvpara - positions the frame vertically with the next paragraph; -- \phpg - positions the frame horizonatally within the page; -- \posxo - positions the paragraph outside of the frame; -- \posy0 - positions the paragraph at the top of the frame; -- \absw - frame width in twips (640); -- \dxfrtext - distance of frame from text in all directions (twips); -- \dfrmtxtx - horizontal distance of text from frame (twips); -- \dfrmtxty - vertical distance of text from frame (twips). Set_Style (Wide_Paragraph_Number_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 14, Style_Indent => 0, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s5\keepn\widctlpar\adjustright " & "\pvpara\phpg\posxo\posy0\absw640\dxfrtext100\dfrmtxtx150\dfrmtxty150"& "\cgrid\qc", Style_String_Suffix => "\snext0 "); -- We adjust the space before for each number. Set_Style (Paragraph_Info(ARM_Output.Small, 1), -- Notes Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s6\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext6 "); Set_Style (Paragraph_Info(ARM_Output.Small, 2), -- Annotations Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s7\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext7 "); Set_Style (Paragraph_Info(ARM_Output.Examples, 1), Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 100, Style_Justified => FALSE, Style_String_Prefix => "\s8\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext8 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 3), Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s9\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext9 "); Set_Style (Paragraph_Info(ARM_Output.Normal, 1), -- Syntax indented Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 100, Style_Justified => FALSE, Style_String_Prefix => "\s10\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-240 \snext10 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Normal, 3), -- Indented Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s11\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext11 "); Set_Style (Paragraph_Info(ARM_Output.Small, 5), -- Indented annotations Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*5, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s12\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext12 "); Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 1080, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s13\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext13 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 1), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*1, Style_Hang_Width => 360, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s14\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext14 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 5), -- Indented two levels for use in indented text. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 1080, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s15\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext15 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 3), -- Indented two levels for use in indented text. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 360, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s16\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext16 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Bulleted, 1), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*1, Style_Hang_Width => 250, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s17\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext17 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 2), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 220, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s18\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx720 \snext18 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 220, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s19\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext19 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 200, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s20\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1440 \snext20 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Bulleted, 4), -- Indented bulleted Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 250, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s21\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1080 \snext21 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Bulleted, 2), -- Bullets in syntax indenting Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 250, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s22\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx720 \snext22 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Bulleted, 3), -- Bullets in syntax indenting Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 250, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s23\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1080 \snext23 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Normal, 2), -- Code indenting Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s24\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext24 "); Set_Style (Paragraph_Info(ARM_Output.Small, 4), -- Annotations in code indenting Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s25\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext25 "); Set_Style (Paragraph_Info(ARM_Output.Examples, 4), -- Indented examples Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 100, Style_Justified => FALSE, Style_String_Prefix => "\s26\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext26 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 6), -- Indented examples in annotations. Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*6, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s27\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext27 "); Set_Style (Header_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 20, Style_Indent => 0, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s28\widctlpar\tqc\tx" & Half_Paper_Width & "\tqr\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\cgrid \sbasedon0 \snext28 "); Set_Style (Footer_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 20, Style_Indent => 0, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s29\widctlpar" & -- "\tqc\tx" & Half_Paper_Width & -- We don't use or define the center tab; it causes problems with very long titles. "\tqr\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\cgrid \sbasedon0 \snext29 "); Set_Style (Paragraph_Info(ARM_Output.Index, 0), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => 270, Style_Hang_Width => 270, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s31\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-200\slmult0 \snext31 "); Set_Style (Paragraph_Info(ARM_Output.Wide_Above, 0), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => 0, Style_Before => 120, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s32\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext0 "); Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Above, 2), -- Wide above annotations. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Before => 90, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s33\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext7 "); Set_Style (Paragraph_Info(ARM_Output.Small_Header, 1), -- Notes header Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 0, Style_Justified => TRUE, Style_String_Prefix => "\s34\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext6 "); -- Note: No space afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 2), -- Bullets in notes Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 250, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s35\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx720 \snext35 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 3), -- Nested bullets in notes Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 220, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s36\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext36 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Hanging_in_Bulleted, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 720, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s37\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0 \snext14 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, 5), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 720, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s38\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0 \snext16 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 4), -- Nested bullets in code indenting Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 220, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s39\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1440 \snext39 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Syntax_Summary, 1), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 90, Style_Justified => FALSE, Style_String_Prefix => "\s40\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-200\slmult0 \snext40 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Enumerated, 1), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*1, Style_Hang_Width => 250, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s41\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext41 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 220, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s42\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext42 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Enumerated, 2), -- Nested enumerations. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 270, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s43\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext43 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 4), -- Small nested enumerations. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 240, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s44\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext44 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 3), -- Doubly nested bullets Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 220, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s45\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx720 \snext45 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 5), -- Doubly nested bullets Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 200, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s46\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1440 \snext46 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 5), -- Indented nested bullets Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 250, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s47\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1080 \snext47 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Normal, 4), -- Inner indented Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s48\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext48 "); Set_Style (Paragraph_Info(ARM_Output.Small, 6), -- Inner indented Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*6, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s49\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext49 "); Set_Style (Paragraph_Info(ARM_Output.Small, 3), -- Annotations in syntax indenting Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s50\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext50 "); Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 1), Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 20, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 110, Style_Justified => FALSE, Style_String_Prefix => "\s51\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext51 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 3), Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s52\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext52 "); Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 4), -- Indented examples Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 20, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 110, Style_Justified => FALSE, Style_String_Prefix => "\s53\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext53 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 6), -- Indented examples Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*6, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s54\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext54 "); Set_Style (Paragraph_Info(ARM_Output.Enumerated, 3), -- Doubly nested enumerations. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 270, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s55\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext55 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 5), -- Small doubly nested enumerations. Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 240, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s56\widctlpar\adjustright", Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext56 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Examples, 2), -- Syntax Indented examples Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 100, Style_Justified => FALSE, Style_String_Prefix => "\s57\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext57 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 4), -- Syntax Indented examples in annotations. Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s58\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext58 "); Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 2), -- Syntax Indented examples Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 20, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 110, Style_Justified => FALSE, Style_String_Prefix => "\s59\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext59 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 4), -- Syntax Indented examples Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*4, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s60\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext60 "); Set_Style (Paragraph_Info(ARM_Output.Examples, 3), -- Code Indented examples Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 100, Style_Justified => FALSE, Style_String_Prefix => "\s61\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext61 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 5), -- Code Indented examples in annotations. Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*5, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s62\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext62 "); Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 3), -- Code Indented examples Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 20, Style_Indent => INDENT_UNIT*3, Style_Before => 0, Style_After => 110, Style_Justified => FALSE, Style_String_Prefix => "\s63\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext63 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 5), -- Code Indented examples Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*5, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s64\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext64 "); Set_Style (Paragraph_Info(ARM_Output.Title, 0), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 42, -- Slight less than double (3 pts larger than Heading_1). Style_Indent => 0, Style_Before => 120, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s65\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-440\slmult0 \snext0 "); Set_Style (Paragraph_Info(ARM_Output.Giant_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 1440, Style_Before => 0, Style_After => 110, Style_Justified => TRUE, Style_String_Prefix => "\s66\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext66 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 2), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 720, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s67\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext67 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Giant_Hanging, 6), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*6, Style_Hang_Width => 1440, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s68\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext68 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 720, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s69\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext69 "); -- Note: Narrower space between. -- The following are indented one extra level: Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 2), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*2, Style_Hang_Width => 360, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s70\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext70 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 720, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s71\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext71 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 1080, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s72\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext72 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 360, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s73\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext73 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 5), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 720, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s74\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext74 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 6), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*6, Style_Hang_Width => 1080, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s75\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext75 "); -- Note: Narrower space between. -- The following are indented two extra levels: Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 3), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*3, Style_Hang_Width => 360, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s76\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext76 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 720, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s77\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext77 "); -- Note: Narrower space between and afterwards. Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 5), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*5, Style_Hang_Width => 360, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s78\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext78 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 6), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*6, Style_Hang_Width => 720, Style_Before => 0, Style_After => 90, Style_Justified => TRUE, Style_String_Prefix => "\s79\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext79 "); -- Note: Narrower space between. Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 2), -- Indented for notes. Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s80\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext80 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 1), Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s81\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext81 "); Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 2), Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*2, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s82\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext82 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 1), Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*1, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s83\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext83 "); Set_Style (Paragraph_Info(ARM_Output.Examples, 5), -- Child Indented examples Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => INDENT_UNIT*5, Style_Before => 0, Style_After => 100, Style_Justified => FALSE, Style_String_Prefix => "\s84\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext84 "); Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 7), -- Child Indented examples in annotations. Font => ARM_Output.Fixed, Body_Font => Output_Object.Body_Font, Font_Size => 16, Style_Indent => INDENT_UNIT*7, Style_Before => 0, Style_After => 80, Style_Justified => FALSE, Style_String_Prefix => "\s85\widctlpar\adjustright", Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext85 "); -- The following are indented three extra levels: Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 4), Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => INDENT_UNIT*4, Style_Hang_Width => 360, Style_Before => 0, Style_After => 120, Style_Justified => TRUE, Style_String_Prefix => "\s86\widctlpar\adjustright", Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext86 "); -- Note: Narrower space between and afterwards. -- New styles should be added here, following numbers will need adjustments. Set_Style (Heading_4_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 27, Style_Indent => 0, Style_Before => 210, Style_After => 100, Style_Justified => FALSE, Style_String_Prefix => "\s87\keepn\widctlpar\outlinelevel3\adjustright", Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 "); if Output_Object.Big_Files then -- Define the TOC styles: Set_Style (TOC_1_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 24, Style_Indent => 0, Style_Before => 60, Style_After => 60, Style_Justified => FALSE, Style_String_Prefix => "\s88\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 "); Set_Style (TOC_2_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => 200, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s89\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 "); Set_Style (TOC_3_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => 400, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s90\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 "); Set_Style (TOC_4_Info, Font => ARM_Output.Swiss, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => 600, Style_Before => 0, Style_After => 0, Style_Justified => FALSE, Style_String_Prefix => "\s91\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright", Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 "); end if; Set_Style (Table_C_Text_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => 0, Style_Before => 10, Style_After => 10, Style_Justified => FALSE, Style_String_Prefix => "", Style_String_Suffix => "\qc "); -- We use a bit of space above and below to avoid overrunning -- the borders of the cells. Set_Style (Table_L_Text_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 22, Style_Indent => 0, Style_Before => 20, Style_After => 20, Style_Justified => FALSE, Style_String_Prefix => "", Style_String_Suffix => "\ql "); Set_Style (Table_C_Sml_Text_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => 0, Style_Before => 20, Style_After => 20, Style_Justified => FALSE, Style_String_Prefix => "", Style_String_Suffix => "\qc "); Set_Style (Table_L_Sml_Text_Info, Font => ARM_Output.Default, Body_Font => Output_Object.Body_Font, Font_Size => 18, Style_Indent => 0, Style_Before => 20, Style_After => 20, Style_Justified => FALSE, Style_String_Prefix => "", Style_String_Suffix => "\ql "); end if; Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 0)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Normal;}"); -- Normal style. Write_Style (Output_Object.Output_File, Heading_1_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 1;}"); Write_Style (Output_Object.Output_File, Heading_2_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 2;}"); Write_Style (Output_Object.Output_File, Heading_3_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 3;}"); Write_Style (Output_Object.Output_File, Category_Header_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Category Header;}"); Write_Style (Output_Object.Output_File, Normal_Paragraph_Number_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Paragraph Number;}"); Write_Style (Output_Object.Output_File, Wide_Paragraph_Number_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Large Paragraph Number;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Annotations;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Indented;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Normal Indented;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Wide_Hanging, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Narrow_Hanging, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Narrow Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Wide_Hanging, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Narrow Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Bulleted, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Indented Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Code Indented;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 6)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Examples;}"); Write_Style (Output_Object.Output_File, Header_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "header;}"); Write_Style (Output_Object.Output_File, Footer_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "footer;}"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\*\cs30 \additive \sbasedon30 page number;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Index, 0)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Index;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Wide_Above, 0)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Wide;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Wide_Above, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Wide Annotations;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Header, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes Header;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Bulleted, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes Nested Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Hanging_in_Bulleted, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Hanging in Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Hanging in Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Syntax_Summary, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Summary;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Enumerated, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Enumerated;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Enumerated, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Enumerated;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Enumerated, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested Enumerated;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Enumerated, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested Enumerated;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested X2 Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested X2 Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Nested Bulleted;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Inner Indented;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 6)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Inner Indented;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Syntax Indented;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 6)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Enumerated, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested X2 Enumerated;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Enumerated, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested X2 Enumerated;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Syntax Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Syntax Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Syntax Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Code Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Code Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Code Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Title, 0)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Standard Title;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Giant_Hanging, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Giant Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Medium_Hanging, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Medium Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Giant_Hanging, 6)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Giant Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Medium_Hanging, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Medium Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Narrow_Hanging, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Narrow Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Medium_Hanging, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Narrow Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Wide_Hanging, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Narrow Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Medium_Hanging, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Medium Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Wide_Hanging, 6)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Narrow_Hanging, 3)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Dbl Indented Narrow Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Medium_Hanging, 4)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Dbl Indented Narrow Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Dbl Indented Narrow Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Medium_Hanging, 6)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Dbl Indented Medium Hanging;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Notes Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Basic Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 2)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Indented Basic Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 1)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Basic Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 5)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Child Indented Examples;}"); Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 6)); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Child Indented Examples;}"); if Output_Object.Big_Files then Write_Style (Output_Object.Output_File, Heading_4_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 4;}"); -- Define the TOC styles: Write_Style (Output_Object.Output_File, TOC_1_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 1;}"); Write_Style (Output_Object.Output_File, TOC_2_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 2;}"); Write_Style (Output_Object.Output_File, TOC_3_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 3;}"); Write_Style (Output_Object.Output_File, TOC_4_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 4;}}"); else Write_Style (Output_Object.Output_File, Heading_4_Info); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 4;}}"); end if; -- \additive means that the style inherits from the previous style. -- \basedon defines the style that the style was inherited from. -- \snext defines the next style to use (if omitted, use same style). -- \shidden - Don't show the style in the drop down menu. -- Formatting properties: -- \widctlpar - Widow/orphan control in this paragraph; -- \adjustright - adjust right indent for document properties; -- \fs - font size in halfpoints (.5 pt); -- \f - font number; -- \q - text alignment (j - justified, c - centered, l - left, r -right); -- \cgrid - set the character grid(?) to the default; -- \li - left indent, in twips (.1 pt); -- \fi - first line indent, in twips (.1 pt); -- \sa - space after paragraph, in twips (.1 pt); -- \sb - space before paragraph, in twips (.1 pt); -- \sl - space between lines, in twips. "Exactly" if negative, "At least" if positive. -- \slmult0 - line space multiple - 0 - Exactly or "At least"/. -- \pard - reset to default paragraph properties; -- \plain - reset to default font/character properties; -- \tx - set tab at location, in twips (.1 pt); -- \tqc - set following tab as a centered tab; -- \tqr - set following tab as a right tab. -- Revision table: Ada.Text_IO.Put (Output_Object.Output_File, "{\*\revtbl "); if Ada.Strings.Unbounded.Length (Output_Object.Version_Names('0')) = 0 then Ada.Text_IO.Put (Output_Object.Output_File, "{Original Text;}"); else Ada.Text_IO.Put (Output_Object.Output_File, "{" & Ada.Strings.Unbounded.To_String(Output_Object.Version_Names('0')) & ";}"); end if; for Version in Character range '1' .. '9' loop if Ada.Strings.Unbounded.Length (Output_Object.Version_Names(Version)) /= 0 then Ada.Text_IO.Put (Output_Object.Output_File, "{" & Ada.Strings.Unbounded.To_String(Output_Object.Version_Names(Version)) & ";}"); else exit; -- No more after the first empty one. end if; end loop; Ada.Text_IO.Put_Line (Output_Object.Output_File, "}"); -- Information (truncated): Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\info{\title " & Ada.Strings.Unbounded.To_String (Output_Object.Title) & "}"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\version2"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\author AXE Consultants}"); -- Working. Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\operator <NAME>, Principle Technician}}"); --Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\author JTC1/SC22/WG9/ARG}"); -- Final. --Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\operator <NAME>, ARG Editor}}"); -- Initial setup (document properties): -- Paper size: -- Note: If changing the page size or margins, be sure to change the -- header and footer tab settings as well. case Output_Object.Page_Size is when ARM_RTF.A4 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw11909\paperh16834"); -- Set paper to A4. when ARM_RTF.Letter => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw12240\paperh15840"); -- Set paper to US Letter. when ARM_RTF.Half_Letter => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw7920\paperh12240"); -- Set paper to 5.5x8.5. when ARM_RTF.Ada95 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw10080\paperh12960"); -- Set paper to 7x9. end case; Ada.Text_IO.Put_Line (Output_Object.Output_File, "\facingp\margmirror"); -- Set to facing pages and mirrored margins. -- Margins. case Output_Object.Page_Size is when ARM_RTF.Ada95 | ARM_RTF.Half_Letter => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\margl1440\margr900\margt1080\margb1080"); when ARM_RTF.Letter | ARM_RTF.A4 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\margl1800\margr1080\margt1440\margb1440"); end case; -- Revisions: if Output_Object.Includes_Changes then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\revisions\revprop3 \revbar0 "); -- \revisions - Revisions marking is on; -- \revprop3 - Show revisions as underlined. -- \revbar0 - No revision bars. -- Alternatively, use \revprop0\revbar3, using the infamous -- vertical bar on the outside, and no other highlighting. -- else not changes, thus no revisions. end if; -- Other properties: Ada.Text_IO.Put_Line (Output_Object.Output_File, "\widowctrl\ftnbj\aenddoc\lytprtmet\formshade\viewkind1\viewscale100"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgbrdrhead\pgbrdrfoot\fet0"); -- \widowctrl - Enable widow and orphan control; -- \ftnbj - Footnotes at bottom of page; -- \aenddoc - Endnotes at end of document; -- \lytprtmet - Layout using printer metrics; -- \formshade - Form field shading is on; -- \viewkind - Default view of the document (1-Page Layout; 4-Normal); -- \viewscale100 - Percentage zoom of the document (100%); -- \pgbrdrhead - Page border surrounds header; -- \pgbrdrfoot - Page border surrounds footer; -- \fet0 - Footnote/endnote control: 0 - Footnotes only (or none); -- Section properties: Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sectd\linex0\endnhere\sectdefaultcl\sbkodd\headery540\footery540"); -- \sectd - Default section properties; -- \linex0 - Line number spacing (0 - none); -- \endnhere- Endnotes included; -- \sectdefaultcl - Default character layout for section. -- \sbkodd - Start at top of odd page. -- \headery - Distance (in twips) of header from top of page. -- \footery - Distance (in twips) of footerr from bottom of page. if Name = "Ttl" or else -- Title page Name = "All" then -- Single giant file -- No page numbers, headers, or footers here. null; else if Name = "00" or else Name = "TOC" then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgnlcrm\pgncont "); -- Lower-case roman numeral, numbers continue. elsif Name = "01" then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgndec\pgnstart1\pgnrestart "); -- Decimal page number; starts at 1 here. else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgndec\pgncont "); -- Decimal page number, numbers continue. end if; -- Write the page headers: Write_Headers (Output_Object); end if; Output_Object.Wrote_into_Section := False; end Start_RTF_File; procedure End_RTF_File (Output_Object : in out RTF_Output_Type) is -- Internal routine. -- Generate the needed text to end an RTF file. Also closes the file. begin Ada.Text_IO.Put_Line (Output_Object.Output_File, "}"); Ada.Text_IO.Close (Output_Object.Output_File); end End_RTF_File; procedure Create (Output_Object : in out RTF_Output_Type; Page_Size : in ARM_RTF.Page_Size; Includes_Changes : in Boolean; Big_Files : in Boolean; File_Prefix : in String; Output_Path : in String; Primary_Sans_Serif_Font : in Sans_Serif_Fonts := Arial; Primary_Serif_Font : in Serif_Fonts := Times_New_Roman; Body_Font : in ARM_Output.Font_Family_Type := ARM_Output.Roman; Header_Prefix : in String := ""; Footer_Use_Date : in Boolean; Footer_Use_Clause_Name : in Boolean; Footer_Use_ISO_Format : in Boolean; Footer_Text : in String := ""; Version_Names : in ARM_Contents.Versioned_String; Title : in String := "") is -- Create an Output_Object for a document with the specified page -- size. Changes from the base document are included if -- Includes_Changes is True (otherwise no revisions are generated). -- Generate a few large output files if -- Big_Files is True; otherwise generate smaller output files. -- The prefix of the output file names is File_Prefix - this -- should be no more then 4 characters allowed in file names. -- The files will be written into Output_Path. -- The title of the document is Title. -- The header prefix appears in the header (if any) before the title, -- separated by a dash. -- The footer consists of the page number, the date if Footer_Use_Date -- is true, and the clause name if Footer_Use_Clase_Name is True, and -- the Footer_Text otherwise. The font and size of the footer is as -- an ISO standard if Footer_Use_ISO_Format is True, and as the -- Ada Reference Manual otherwise. -- The primary font used for the Sans_Serif text, and for the Serif -- text, is as specified. -- Which font is used for the body is specified by Body_Font. -- The author names of the various versions is specified by the -- Version_Names. begin if Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Already valid object"); end if; Output_Object.Is_Valid := True; Output_Object.Page_Size := Page_Size; Output_Object.Includes_Changes := Includes_Changes; Output_Object.Big_Files := Big_Files; Ada.Strings.Fixed.Move (Target => Output_Object.File_Prefix, Source => File_Prefix); Output_Object.Output_Path := Ada.Strings.Unbounded.To_Unbounded_String (Output_Path); Output_Object.Primary_Sans_Serif_Font := Primary_Sans_Serif_Font; Output_Object.Primary_Serif_Font := Primary_Serif_Font; Output_Object.Body_Font := Body_Font; Output_Object.Title := Ada.Strings.Unbounded.To_Unbounded_String (Title); Output_Object.Header_Prefix := Ada.Strings.Unbounded.To_Unbounded_String (Header_Prefix); Output_Object.Footer_Text := Ada.Strings.Unbounded.To_Unbounded_String (Footer_Text); Output_Object.Footer_Use_Date := Footer_Use_Date; Output_Object.Footer_Use_Clause_Name := Footer_Use_Clause_Name; Output_Object.Footer_Use_ISO_Format := Footer_Use_ISO_Format; Output_Object.Version_Names := Version_Names; if Big_Files then -- We're going to generate a single giant file. Open it now. Start_RTF_File (Output_Object, Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right), Ada.Strings.Unbounded.To_String (Output_Object.Title), "All"); Ada.Text_IO.New_Line (Output_Object.Output_File); end if; end Create; procedure Close (Output_Object : in out RTF_Output_Type) is -- Close an Output_Object. No further output to the object is -- allowed after this call. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Ada.Text_IO.Is_Open (Output_Object.Output_File) then End_RTF_File (Output_Object); end if; Output_Object.Is_Valid := False; end Close; procedure Section (Output_Object : in out RTF_Output_Type; Section_Title : in String; Section_Name : in String) is -- Start a new section. The title is Section_Title (this is -- intended for humans). The name is Section_Name (this is -- intended to be suitable to be a portion of a file name). begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Section in paragraph"); end if; if not Output_Object.Big_Files then if Ada.Text_IO.Is_Open (Output_Object.Output_File) then End_RTF_File (Output_Object); end if; -- Create a new file for this section: Start_RTF_File (Output_Object, Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) & "-" & Section_Name, Section_Title, Section_Name); Ada.Text_IO.New_Line (Output_Object.Output_File); else if Output_Object.Wrote_into_Section then -- Just a new section header (odd page break) and page number setup: if Section_Name = "TOC" then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgnlcrm\pgnstart1\pgnrestart "); -- Lower-case roman number page number; reset to 1. elsif Section_Name = "00" then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgnlcrm\pgncont "); -- Lower-case roman numeral, numbers continue. elsif Section_Name = "01" then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgndec\pgnstart1\pgnrestart "); -- Decimal page number; starts at 1 here. else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgndec\pgncont "); -- Decimal page number, numbers continue. end if; -- Write the page headers: Write_Headers (Output_Object); -- else Probably the title page: no headers or footers. end if; Output_Object.Wrote_into_Section := False; end if; end Section; procedure Set_Columns (Output_Object : in out RTF_Output_Type; Number_of_Columns : in ARM_Output.Column_Count) is -- Set the number of columns. -- Raises Not_Valid_Error if in a paragraph. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "In paragraph"); end if; if Number_of_Columns = Output_Object.Column_Count then return; end if; if Output_Object.Wrote_into_Section then Ada.Text_IO.Put (Output_Object.Output_File, "\sect\sbknone"); end if; case Number_of_Columns is when 1 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols1 "); when 2 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols2\colsx0 "); -- Two columns, no space between. (Paragraph formatting -- will take care of that.) when 3 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols3\colsx0 "); when 4 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols4\colsx0 "); when 5 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols5\colsx0 "); when 6 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols6\colsx0 "); when 7 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols7\colsx0 "); when 8 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols8\colsx0 "); end case; Output_Object.Column_Count := Number_of_Columns; end Set_Columns; procedure Set_Tabs (Output_Object : in out RTF_Output_Type; Style : in ARM_Output.Paragraph_Style_Type; Indent : in ARM_Output.Paragraph_Indent_Type) is -- Set tabs in the current (just started) paragraph. begin case Style is when ARM_Output.Normal | ARM_Output.Wide_Above | ARM_Output.Small | ARM_Output.Small_Wide_Above | ARM_Output.Header | ARM_Output.Small_Header | ARM_Output.Index | ARM_Output.Syntax_Summary | ARM_Output.Title | ARM_Output.Examples | ARM_Output.Small_Examples | ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples => if Output_Object.Tab_Stops.Number /= 0 then if (Output_Object.Tab_Stops.Number * 8) + Output_Object.Char_Count > LINE_LENGTH then Ada.Text_IO.New_Line (Output_Object.Output_File); Output_Object.Char_Count := 0; end if; declare function Stop_in_Twips (Stop : ARM_Output.Tab_Stop_Type) return Natural is -- Return the value of a tab stop in Twips: begin if ARM_Output."="(Stop.Kind, ARM_Output.Left_Fixed) then return Stop.Stop*120 + Paragraph_Info(Style, Indent).Indent; -- *120 is to convert picas to Twips. else -- Scale with font size. (Stop assumes 12 pt -- type). -- Raw formula: -- (Stop.Stop * 120) -- Stop in twips. -- * (Paragraph_Info(Format).Size / 24) -- Font scale. -- After rearranging, we get: return Stop.Stop * Paragraph_Info(Style, Indent).Size * 5 + Paragraph_Info(Style, Indent).Indent; end if; end Stop_in_Twips; begin for I in 1 .. Output_Object.Tab_Stops.Number loop -- Define tab stops. declare Num : String := Integer'Image (Stop_in_Twips ( Output_Object.Tab_Stops.Stops(I))); begin Ada.Text_IO.Put (Output_Object.Output_File, "\tx"); Ada.Text_IO.Put (Output_Object.Output_File, Num(2..Num'Length)); Ada.Text_IO.Put (Output_Object.Output_File, " "); Output_Object.Char_Count := Output_Object.Char_Count + 4 + Num'Length-1; end; end loop; end; -- else no tabs defined. end if; when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted | ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted | ARM_Output.Giant_Hanging | ARM_Output.Wide_Hanging | ARM_Output.Medium_Hanging | ARM_Output.Narrow_Hanging | ARM_Output.Hanging_in_Bulleted | ARM_Output.Small_Giant_Hanging | ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Medium_Hanging | ARM_Output.Small_Narrow_Hanging | ARM_Output.Small_Hanging_in_Bulleted | ARM_Output.Enumerated | ARM_Output.Small_Enumerated => if Output_Object.Tab_Stops.Number /= 0 then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Tabs in hanging/bulleted paragraph"); end if; end case; end Set_Tabs; procedure Start_Paragraph (Output_Object : in out RTF_Output_Type; Style : in ARM_Output.Paragraph_Style_Type; Indent : in ARM_Output.Paragraph_Indent_Type; Number : in String; No_Prefix : in Boolean := False; Tab_Stops : in ARM_Output.Tab_Info := ARM_Output.NO_TABS; No_Breaks : in Boolean := False; Keep_with_Next : in Boolean := False; Space_After : in ARM_Output.Space_After_Type := ARM_Output.Normal; Justification : in ARM_Output.Justification_Type := ARM_Output.Default) is -- Start a new paragraph. The style and indent of the paragraph is as -- specified. The (AA)RM paragraph number (which might include update -- and version numbers as well: [12.1/1]) is Number. If the format is -- a type with a prefix (bullets, hangining items), the prefix is -- omitted if No_Prefix is true. Tab_Stops defines the tab stops for -- the paragraph. If No_Breaks is True, we will try to avoid page breaks -- in the paragraph. If Keep_with_Next is true, we will try to avoid -- separating this paragraph and the next one. (These may have no -- effect in formats that don't have page breaks). Space_After -- specifies the amount of space following the paragraph. Justification -- specifies the text justification for the paragraph. Not_Valid_Error -- is raised if Tab_Stops /= NO_TABS for a hanging or bulleted format. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Already in paragraph"); end if; if not Paragraph_Info(Style, Indent).Defined then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Undefined Style " & ARM_Output.Paragraph_Style_Type'Image(Style) & " and Indent:" & ARM_Output.Paragraph_Indent_Type'Image(Indent)); end if; Output_Object.Is_In_Paragraph := True; Output_Object.Had_Prefix := not No_Prefix; Output_Object.Char_Count := 0; Output_Object.Saw_Hang_End := False; Output_Object.Wrote_into_Section := True; -- First, write the paragraph number, if any. This has its own style. if Number /= "" then -- We have a paragraph number. -- Most paragraph numbers are 7 or fewer characters. The box is -- sized for 7 characters. If we have 8 characters (as in 277.10/2), -- we need a wider box. if Number'Length > 7 then Write_Style_for_Paragraph (Output_Object.Output_File, Wide_Paragraph_Number_Info, Output_Object.Char_Count); else Write_Style_for_Paragraph (Output_Object.Output_File, Normal_Paragraph_Number_Info, Output_Object.Char_Count); end if; -- Figure the space above: (We use a variable space above so the -- numbers align with the bottom of the text, not the top). declare Diff : Natural := (Paragraph_Info(Style, Indent).Size - Normal_Paragraph_Number_Info.Size) + (Paragraph_Info(Style, Indent).Before/10); -- This would seem to be double the required adjustment for the -- size, but it works. So why question it? begin if Diff >= 30 then Ada.Text_IO.Put (Output_Object.Output_File, "\sb3" & Character'Val(Diff mod 10 + Character'Pos('0')) & "0 "); elsif Diff >= 20 then Ada.Text_IO.Put (Output_Object.Output_File, "\sb2" & Character'Val(Diff mod 10 + Character'Pos('0')) & "0 "); elsif Diff >= 10 then Ada.Text_IO.Put (Output_Object.Output_File, "\sb1" & Character'Val(Diff mod 10 + Character'Pos('0')) & "0 "); else Ada.Text_IO.Put (Output_Object.Output_File, "\sb" & Character'Val(Diff + Character'Pos('0')) & "0 "); end if; end; --*** Box width?? Ada.Text_IO.Put (Output_Object.Output_File, Number); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}"); Output_Object.Char_Count := 0; -- else no paragraph number. end if; -- Now, write the paragraph header: case Style is when ARM_Output.Normal | ARM_Output.Wide_Above | ARM_Output.Small | ARM_Output.Small_Wide_Above | ARM_Output.Header | ARM_Output.Small_Header | ARM_Output.Index | ARM_Output.Syntax_Summary | ARM_Output.Title | ARM_Output.Examples | ARM_Output.Small_Examples | ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples => Write_Style_for_Paragraph (Output_Object.Output_File, Paragraph_Info(Style, Indent), Output_Object.Char_Count); --Ada.Text_IO.Put_Line ("Start paragraph - full style"); when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted | ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted => Write_Style_for_Paragraph (Output_Object.Output_File, Paragraph_Info(Style, Indent), Output_Object.Char_Count); --Ada.Text_IO.Put_Line ("Start paragraph - full style (bullet)"); if No_Prefix then Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); Output_Object.Char_Count := Output_Object.Char_Count + 5; else if ARM_Output."=" (Style, ARM_Output.Nested_Bulleted) or else ARM_Output."=" (Style, ARM_Output.Small_Nested_Bulleted) then -- Make a smaller bullet. if Paragraph_Info(Style, Indent).Size = 15 then Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs12\'b7}\tab "); elsif Paragraph_Info(Style, Indent).Size = 16 then Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs12\'b7}\tab "); elsif Paragraph_Info(Style, Indent).Size = 18 then Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs14\'b7}\tab "); elsif Paragraph_Info(Style, Indent).Size = 20 then Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs16\'b7}\tab "); else --if Paragraph_Info(Style, Indent).Size = 22 then Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs18\'b7}\tab "); end if; Output_Object.Char_Count := Output_Object.Char_Count + 19; else -- Normal bullet. Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'b7}\tab "); Output_Object.Char_Count := Output_Object.Char_Count + 14; end if; end if; when ARM_Output.Giant_Hanging | ARM_Output.Wide_Hanging | ARM_Output.Medium_Hanging | ARM_Output.Narrow_Hanging | ARM_Output.Hanging_in_Bulleted | ARM_Output.Small_Giant_Hanging | ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Medium_Hanging | ARM_Output.Small_Narrow_Hanging | ARM_Output.Small_Hanging_in_Bulleted | ARM_Output.Enumerated | ARM_Output.Small_Enumerated => Write_Style_for_Paragraph (Output_Object.Output_File, Paragraph_Info(Style, Indent), Output_Object.Char_Count); --Ada.Text_IO.Put_Line ("Start paragraph - full style (hang)"); if No_Prefix then Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); Output_Object.Char_Count := Output_Object.Char_Count + 5; Output_Object.Saw_Hang_End := True; else -- Has prefix. Output_Object.Saw_Hang_End := False; Output_Object.Prefix_Large_Char_Count := 0; end if; end case; Output_Object.Paragraph_Style := Style; Output_Object.Paragraph_Indent := Indent; Output_Object.Font := ARM_Output.Default; Output_Object.Is_Bold := False; Output_Object.Is_Italic := False; Output_Object.Size := 0; Output_Object.Color := ARM_Output.Default; Output_Object.Real_Size := Paragraph_Info(Style,Indent).Size; Output_Object.Tab_Stops := Tab_Stops; Output_Object.Current_Space_After := Space_After; Set_Tabs (Output_Object, Style, Indent); if No_Breaks or Keep_with_Next then if Output_Object.Char_Count + 13 > LINE_LENGTH then Ada.Text_IO.New_Line (Output_Object.Output_File); Output_Object.Char_Count := 0; end if; if No_Breaks then Ada.Text_IO.Put (Output_Object.Output_File, "\keep "); Output_Object.Char_Count := Output_Object.Char_Count + 6; end if; if Keep_with_Next then Ada.Text_IO.Put (Output_Object.Output_File, "\keepn "); Output_Object.Char_Count := Output_Object.Char_Count + 7; end if; end if; if ARM_Output."=" (Space_After, ARM_Output.Narrow) then -- Reduce the following space by 30%: declare SA : constant String := Natural'Image((Paragraph_Info(Style, Indent).After*(LEADING_PERCENT/10))/10); begin if Output_Object.Char_Count + 4 + SA'Length - 1 > LINE_LENGTH then Ada.Text_IO.New_Line (Output_Object.Output_File); Output_Object.Char_Count := 0; end if; Ada.Text_IO.Put (Output_Object.Output_File, "\sa"); Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last)); Ada.Text_IO.Put (Output_Object.Output_File, " "); Output_Object.Char_Count := 4 + SA'Length - 1; end; elsif ARM_Output."=" (Space_After, ARM_Output.Wide) then -- Increase the following space by 50%: declare SA : constant String := Natural'Image((Paragraph_Info(Style, Indent).After*(TRAILING_PERCENT/10))/10); begin if Output_Object.Char_Count + 4 + SA'Length - 1 > LINE_LENGTH then Ada.Text_IO.New_Line (Output_Object.Output_File); Output_Object.Char_Count := 0; end if; Ada.Text_IO.Put (Output_Object.Output_File, "\sa"); Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last)); Ada.Text_IO.Put (Output_Object.Output_File, " "); Output_Object.Char_Count := 4 + SA'Length - 1; end; end if; if ARM_Output."/=" (Justification, ARM_Output.Default) then if Output_Object.Char_Count + 4 > LINE_LENGTH then Ada.Text_IO.New_Line (Output_Object.Output_File); Output_Object.Char_Count := 0; end if; case Justification is when ARM_Output.Default => null; -- Can't get here. when ARM_Output.Left => Ada.Text_IO.Put (Output_Object.Output_File, "\ql "); Output_Object.Char_Count := Output_Object.Char_Count + 4; when ARM_Output.Center => Ada.Text_IO.Put (Output_Object.Output_File, "\qc "); Output_Object.Char_Count := Output_Object.Char_Count + 4; when ARM_Output.Right => Ada.Text_IO.Put (Output_Object.Output_File, "\qr "); Output_Object.Char_Count := Output_Object.Char_Count + 4; when ARM_Output.Justified => Ada.Text_IO.Put (Output_Object.Output_File, "\qj "); Output_Object.Char_Count := Output_Object.Char_Count + 4; end case; end if; -- Start hang (last), so we get a clean count of prefix characters: case Style is when ARM_Output.Giant_Hanging | ARM_Output.Wide_Hanging | ARM_Output.Medium_Hanging | ARM_Output.Narrow_Hanging | ARM_Output.Small_Giant_Hanging | ARM_Output.Small_Wide_Hanging | ARM_Output.Small_Medium_Hanging | ARM_Output.Small_Narrow_Hanging | ARM_Output.Hanging_in_Bulleted | ARM_Output.Small_Hanging_in_Bulleted | ARM_Output.Enumerated | ARM_Output.Small_Enumerated => if not No_Prefix then Ada.Text_IO.New_Line (Output_Object.Output_File); Output_Object.Char_Count := 0; --Ada.Text_Io.Put ("Start Hang:"); -- else no prefix, no need to count. end if; when others => null; end case; end Start_Paragraph; procedure End_Paragraph (Output_Object : in out RTF_Output_Type) is -- End a paragraph. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; Output_Object.Is_In_Paragraph := False; Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}"); Output_Object.Char_Count := 0; --Ada.Text_IO.Put_Line ("End paragraph '}'"); end End_Paragraph; procedure Category_Header (Output_Object : in out RTF_Output_Type; Header_Text : String) is -- Output a Category header (that is, "Legality Rules", -- "Dynamic Semantics", etc.) -- (Note: We did not use a enumeration here to insure that these -- headers are spelled the same in all output versions). -- Raises Not_Valid_Error if in a paragraph. Count : Natural; -- Not used after being set. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Header in paragraph"); end if; Ada.Text_IO.New_Line (Output_Object.Output_File); Write_Style_for_Paragraph (Output_Object.Output_File, Category_Header_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}"); Output_Object.Char_Count := 0; Output_Object.Wrote_into_Section := True; end Category_Header; function Current_Date return String is -- Local routine: Date : Ada.Calendar.Time := Ada.Calendar.Clock; Day : constant String := Ada.Calendar.Day_Number'Image(Ada.Calendar.Day(Date)); Year : constant String := Ada.Calendar.Year_Number'Image(Ada.Calendar.Year(Date)); Month : constant Ada.Calendar.Month_Number := Ada.Calendar.Month(Date); begin case Month is when 1 => return Day(2..Day'Last) & " January" & Year; when 2 => return Day(2..Day'Last) & " February" & Year; when 3 => return Day(2..Day'Last) & " March" & Year; when 4 => return Day(2..Day'Last) & " April" & Year; when 5 => return Day(2..Day'Last) & " May" & Year; when 6 => return Day(2..Day'Last) & " June" & Year; when 7 => return Day(2..Day'Last) & " July" & Year; when 8 => return Day(2..Day'Last) & " August" & Year; when 9 => return Day(2..Day'Last) & " September" & Year; when 10 => return Day(2..Day'Last) & " October" & Year; when 11 => return Day(2..Day'Last) & " November" & Year; when 12 => return Day(2..Day'Last) & " December" & Year; end case; end Current_Date; procedure Clause_Footer (Output_Object : in out RTF_Output_Type; Header_Text : in String; Level : in ARM_Contents.Level_Type; Clause_Number : in String; No_Page_Break : in Boolean := False) is -- Local routine: Set up the footer for the header. Count : Natural; -- Not used after being set. begin -- Adjust footer. if Output_Object.Wrote_into_Section then -- Start a new section: if No_Page_Break or else ARM_Contents."="(Level, ARM_Contents.Clause) or else ARM_Contents."="(Level, ARM_Contents.Subclause) or else ARM_Contents."="(Level, ARM_Contents.Subsubclause) then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbknone\pgncont "); else -- Start sections on a new page. (Should only happen in the -- introduction). Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkpage\pgncont "); end if; -- else just use the existing section. end if; if Clause_Number = "" or else ARM_Contents."="(Level, ARM_Contents.Unnumbered_Section) then Ada.Text_IO.Put (Output_Object.Output_File, "{\footerl "); Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count); if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 "); elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 "); else Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 "); end if; if Output_Object.Footer_Use_Clause_Name then Ada.Text_IO.Put (Output_Object.Output_File, Header_Text); else Ada.Text_IO.Put (Output_Object.Output_File, Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text)); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); if Output_Object.Footer_Use_Date then Ada.Text_IO.Put (Output_Object.Output_File, Current_Date); -- else no date. end if; if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\par}}}"); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\par}}}"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "{\footerr "); Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count); if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~"); elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~"); else Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~"); end if; if Output_Object.Footer_Use_Date then Ada.Text_IO.Put (Output_Object.Output_File, Current_Date); -- else no date. end if; Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 "); end if; if Output_Object.Footer_Use_Clause_Name then Ada.Text_IO.Put (Output_Object.Output_File, Header_Text); else Ada.Text_IO.Put (Output_Object.Output_File, Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text)); end if; if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}}"); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}"); end if; else Ada.Text_IO.Put (Output_Object.Output_File, "{\footerl "); Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count); if Output_Object.Footer_Use_Clause_Name then Ada.Text_IO.Put (Output_Object.Output_File, "{\b\f1 "); if Level in ARM_Contents.Plain_Annex .. ARM_Contents.Normative_Annex then -- Clause Number includes "Annex". Just use the letter. Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number(Clause_Number'Last)); else Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number); end if; if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f1\fs16 "); elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f1 "); else Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f0 "); end if; Ada.Text_IO.Put (Output_Object.Output_File, Header_Text); else if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 "); elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 "); else Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 "); end if; Ada.Text_IO.Put (Output_Object.Output_File, Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text)); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); if Output_Object.Footer_Use_Date then Ada.Text_IO.Put (Output_Object.Output_File, Current_Date); -- else no date. end if; if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\par}}}"); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\par}}}"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "{\footerr "); Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count); if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~"); elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~"); else Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~"); end if; if Output_Object.Footer_Use_Date then Ada.Text_IO.Put (Output_Object.Output_File, Current_Date); -- else no date. end if; Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); if Output_Object.Footer_Use_ISO_Format then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 "); elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 "); else Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 "); end if; if Output_Object.Footer_Use_Clause_Name then Ada.Text_IO.Put (Output_Object.Output_File, Header_Text); Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~\b\f1 "); if Level in ARM_Contents.Plain_Annex .. ARM_Contents.Normative_Annex then -- Clause Number includes "Annex". Just use the letter. Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number(Clause_Number'Last)); else Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number); end if; else Ada.Text_IO.Put (Output_Object.Output_File, Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text)); Ada.Text_IO.Put (Output_Object.Output_File, "}"); end if; Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}"); end if; Output_Object.Wrote_into_Section := True; end Clause_Footer; procedure Clause_Header (Output_Object : in out RTF_Output_Type; Header_Text : in String; Level : in ARM_Contents.Level_Type; Clause_Number : in String; Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind; No_Page_Break : in Boolean := False) is -- Output a Clause header. The level of the header is specified -- in Level. The Clause Number is as specified; the top-level (and -- other) subdivision names are as specified. These should appear in -- the table of contents. -- For hyperlinked formats, this should generate a link target. -- If No_Page_Break is True, suppress any page breaks. -- Raises Not_Valid_Error if in a paragraph. Count : Natural; -- Not used after being set. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Header in paragraph"); end if; Ada.Text_IO.New_Line (Output_Object.Output_File); -- Adjust footer. Clause_Footer (Output_Object, Header_Text, Level, Clause_Number, No_Page_Break); -- Special for table of contents: if Clause_Number = "" and then (Header_Text = "Table of Contents" or else -- Ada 95 format Header_Text = "Contents") then -- ISO 2004 format. if Header_Text = "Table of Contents" then Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs36\kerning36\qc\cgrid Table of Contents\par}"); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs36\kerning36\qc\cgrid Contents\par}"); end if; Output_Object.Char_Count := 0; return; end if; case Level is when ARM_Contents.Plain_Annex => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & ": " & Header_Text & "\par}"); -- Note: Clause_Number includes "Annex" when ARM_Contents.Normative_Annex => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line "); -- Note: Clause_Number includes "Annex" Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (normative)}\line "); Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}"); when ARM_Contents.Informative_Annex => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line "); -- Note: Clause_Number includes "Annex" Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (informative)}\line "); Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}"); when ARM_Contents.Unnumbered_Section => if Header_Text /= "" then Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}"); end if; when ARM_Contents.Section => case Top_Level_Subdivision_Name is when ARM_Output.Chapter => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Chapter " & Clause_Number & ": " & Header_Text & "\par}"); when ARM_Output.Section => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Section " & Clause_Number & ": " & Header_Text & "\par}"); when ARM_Output.Clause => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\~\~\~" & Header_Text & "\par}"); end case; when ARM_Contents.Clause => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_2_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & " " & Header_Text & "\par}"); when ARM_Contents.Subclause => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_3_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & " " & Header_Text & "\par}"); when ARM_Contents.Subsubclause => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_4_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & " " & Header_Text & "\par}"); when ARM_Contents.Dead_Clause => raise Program_Error; -- No headers for dead clauses. end case; Output_Object.Char_Count := 0; end Clause_Header; procedure Revised_Clause_Header (Output_Object : in out RTF_Output_Type; New_Header_Text : in String; Old_Header_Text : in String; Level : in ARM_Contents.Level_Type; Clause_Number : in String; Version : in ARM_Contents.Change_Version_Type; Old_Version : in ARM_Contents.Change_Version_Type; Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind; No_Page_Break : in Boolean := False) is -- Output a revised clause header. Both the original and new text will -- be output. The level of the header is specified in Level. The Clause -- Number is as specified; the top-level (and other) subdivision names -- are as specified. These should appear in the table of contents. -- For hyperlinked formats, this should generate a link target. -- Version is the insertion version of the new text; Old_Version is -- the insertion version of the old text. -- If No_Page_Break is True, suppress any page breaks. -- Raises Not_Valid_Error if in a paragraph. Count : Natural; -- Not used after being set. function Header_Text return String is begin if Old_Version = '0' then -- Old is original text return "{\revised\revauth" & Version & " " & New_Header_Text & "}{\deleted\revauthdel" & Version & " " & Old_Header_Text & "}"; else return "{\revised\revauth" & Version & " " & New_Header_Text & "}{\deleted\revauthdel" & Version & "\revised\revauth" & Old_Version & " " & Old_Header_Text & "}"; end if; end Header_Text; begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Header in paragraph"); end if; Ada.Text_IO.New_Line (Output_Object.Output_File); -- Adjust footer. Clause_Footer (Output_Object, New_Header_Text, Level, Clause_Number, No_Page_Break); case Level is when ARM_Contents.Plain_Annex => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & ": " & Header_Text & "\par}"); -- Note: Clause_Number includes "Annex" when ARM_Contents.Normative_Annex => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line "); -- Note: Clause_Number includes "Annex" Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (normative)}\line "); Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}"); when ARM_Contents.Informative_Annex => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line "); -- Note: Clause_Number includes "Annex" Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (informative)}\line "); Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}"); when ARM_Contents.Unnumbered_Section => if Header_Text /= "" then Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}"); end if; when ARM_Contents.Section => case Top_Level_Subdivision_Name is when ARM_Output.Chapter => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Chapter " & Clause_Number & ": " & Header_Text & "\par}"); when ARM_Output.Section => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, "Section " & Clause_Number & ": " & Header_Text & "\par}"); when ARM_Output.Clause => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_1_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\~\~\~" & Header_Text & "\par}"); end case; when ARM_Contents.Clause => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_2_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & " " & Header_Text & "\par}"); when ARM_Contents.Subclause => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_3_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & " " & Header_Text & "\par}"); when ARM_Contents.Subsubclause => Write_Style_for_Paragraph (Output_Object.Output_File, Heading_4_Info, Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & " " & Header_Text & "\par}"); when ARM_Contents.Dead_Clause => raise Program_Error; -- No headers for dead clauses. end case; Output_Object.Char_Count := 0; end Revised_Clause_Header; procedure TOC_Marker (Output_Object : in out RTF_Output_Type; For_Start : in Boolean) is -- Mark the start (if For_Start is True) or end (if For_Start is -- False) of the table of contents data. Output objects that -- auto-generate the table of contents can use this to do needed -- actions. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "TOC in paragraph"); end if; if Output_Object.Big_Files then if For_Start then -- Create a Table of contents field: Write_Style_for_Paragraph (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 0), Output_Object.Char_Count); Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\field\fldedit{\*\fldinst TOC \\o ""1-3"" }{\fldrslt "); Output_Object.Char_Count := 0; else -- End. -- Close the field: Ada.Text_IO.Put_Line (Output_Object.Output_File, "}}\par}"); end if; else -- Small files: null; -- We're not generating a table of contents. end if; end TOC_Marker; procedure New_Page (Output_Object : in out RTF_Output_Type; Kind : ARM_Output.Page_Kind_Type := ARM_Output.Any_Page) is -- Output a page break. -- Note that this has no effect on non-printing formats. -- Any_Page breaks to the top of the next page (whatever it is); -- Odd_Page_Only breaks to the top of the odd-numbered page; -- Soft_Page allows a page break but does not force one (use in -- "No_Breaks" paragraphs.) -- Raises Not_Valid_Error if in a paragraph if Kind = Any_Page or -- Odd_Page, and if not in a paragraph if Kind = Soft_Page. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; case Kind is when ARM_Output.Any_Page => if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Page in paragraph"); end if; Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkpage\pgncont "); -- A section break and start on a new page, with page numbers continuing. -- All other section properties are inherited. -- We use a section break here, and not -- "\page", because that gives the wrong footers if the next -- item is a clause header (as it usually is). Output_Object.Wrote_into_Section := False; when ARM_Output.Odd_Page_Only => if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Page in paragraph"); end if; Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgncont "); -- A section break and start on an odd page, with page numbers continuing. -- All other section properties are inherited. Output_Object.Wrote_into_Section := False; when ARM_Output.Soft_Page => if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Soft page not in paragraph"); end if; Ada.Text_IO.Put_Line (Output_Object.Output_File, "\softpage "); end case; end New_Page; procedure New_Column (Output_Object : in out RTF_Output_Type) is -- Output a column break. -- Raises Not_Valid_Error if in a paragraph, or if the number of -- columns is 1. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "New Column in paragraph"); end if; if Output_Object.Column_Count <= 1 then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Column break, but no columns"); end if; -- Set the font size to the most recently used one, because -- otherwise this takes a 12 pt. space, much too large in some cases: declare FS : constant String := Natural'Image( Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size); begin Ada.Text_IO.Put (Output_Object.Output_File, "\fs"); Ada.Text_IO.Put (Output_Object.Output_File, FS(2..FS'Last)); end; Ada.Text_IO.Put_Line (Output_Object.Output_File, "\column "); end New_Column; procedure Separator_Line (Output_Object : in out RTF_Output_Type; Is_Thin : Boolean := True) is -- Output a separator line. It is thin if "Is_Thin" is true. -- Raises Not_Valid_Error if in a paragraph. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Separator in paragraph"); end if; Ada.Text_IO.New_Line (Output_Object.Output_File); if Is_Thin then Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard \widctlpar\brdrb\brdrs\brdrw15\brsp20 \adjustright \fs4\par }"); -- \brdrb - Bottom border; \brdrs - Single thickness; -- \brdrw15 - thickness of 15 twips (max 75); -- \brsp20 - spacing between border and text. else Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard \widctlpar\brdrb\brdrs\brdrw30\brsp20 \adjustright \fs4\par }"); end if; Ada.Text_IO.New_Line (Output_Object.Output_File); end Separator_Line; function Format_Value (Value : in Integer) return String is Str : constant String := Natural'Image(Value); begin if Value < 0 then return Str; else return Str(2..Str'Last); end if; end Format_Value; type Table_Info_Kind is (Caption, Header, Header_no_Caption, First_Row, Row, Last_Row); procedure RTF_Table_Info (Output_Object : in out RTF_Output_Type; Kind : in Table_Info_Kind) is -- Output the current table definition (Word needs this on every row): use type ARM_Output.Column_Text_Alignment; begin Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trowd \trgaph108 "); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trrh" & Format_Value(Paragraph_Info(ARM_Output.Normal,0).Size * 16) & "\trleft" & Format_Value(Output_Object.Table_Indent) & " "); if Output_Object.Table_Has_Border then -- Set all of the borders to the normal: Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trbrdrt\brdrs\brdrw10 " & "\trbrdrl\brdrs\brdrw10 " & "\trbrdrb\brdrs\brdrw10 " & "\trbrdrr\brdrs\brdrw10 " & "\trbrdrh\brdrs\brdrw10 " & "\trbrdrv\brdrs\brdrw10 "); -- else nothing. end if; if Output_Object.Table_No_Page_Break then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trkeep\trkeepfollow "); elsif Kind = Header_no_Caption then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trhdr\trkeep "); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trkeep "); end if; case Kind is when Caption => -- Now, define the cell borders: if Output_Object.Table_Has_Border then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\clvertalc \clbrdrt\brdrs\brdrw10 " & "\clbrdrl\brdrs\brdrw10 " & "\clbrdrb\brdrs\brdrw10 " & "\clbrdrr\brdrs\brdrw10 "); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\clvertalc "); end if; Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" & Format_Value(Output_Object.Table_Indent + Output_Object.Table_Width) & " "); -- Caption cell crosses entire line. -- Now, set up text (normal, centered): if Output_Object.Table_Has_Small_Text then Write_Style_for_Paragraph (Output_Object.Output_File, Table_C_Sml_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_C_Sml_Text_Info.Size; Output_Object.Size := 0; else Write_Style_for_Paragraph (Output_Object.Output_File, Table_C_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_C_Text_Info.Size; Output_Object.Size := 0; end if; Ada.Text_IO.Put (Output_Object.Output_File, "\intbl "); Output_Object.Char_Count := Output_Object.Char_Count + 6; when Header | Header_No_Caption => -- Now, define the cell borders for each cell: for I in 1 .. Output_Object.Column_Count loop if Output_Object.Table_Has_Border then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\clvertalc \clbrdrt\brdrs\brdrw10 " & "\clbrdrl\brdrs\brdrw10 " & "\clbrdrb\brdrs\brdrw10 " & "\clbrdrr\brdrs\brdrw10 "); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\clvertalc "); end if; --Ada.Text_IO.Put_Line("Header:"); --Ada.Text_IO.Put_Line("Indent:" & Natural'Image(Output_Object.Table_Indent) & -- " Count:" & Natural'Image(I+Output_Object.Table_First_Column_Mult-1)); if I /= Output_Object.Column_Count then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" & Format_Value(Output_Object.Table_Indent + Output_Object.Table_Column_Width*(Integer(I+Output_Object.Table_First_Column_Mult-1))) & " "); else -- Last cell, full width. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" & Format_Value(Output_Object.Table_Indent + Output_Object.Table_Width) & " "); end if; end loop; -- Now, define text format: if Output_Object.Table_Alignment = ARM_Output.Center_All then if Output_Object.Table_Has_Small_Text then Write_Style_for_Paragraph (Output_Object.Output_File, Table_C_Sml_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_C_Sml_Text_Info.Size; Output_Object.Size := 0; else Write_Style_for_Paragraph (Output_Object.Output_File, Table_C_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_C_Text_Info.Size; Output_Object.Size := 0; end if; else if Output_Object.Table_Has_Small_Text then Write_Style_for_Paragraph (Output_Object.Output_File, Table_L_Sml_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_L_Sml_Text_Info.Size; Output_Object.Size := 0; else Write_Style_for_Paragraph (Output_Object.Output_File, Table_L_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_L_Text_Info.Size; Output_Object.Size := 0; end if; end if; Ada.Text_IO.Put (Output_Object.Output_File, "\intbl "); Output_Object.Char_Count := Output_Object.Char_Count + 6; when First_Row | Row | Last_Row => -- Now, define the cell borders for each cell: for I in 1 .. Output_Object.Column_Count loop if Output_Object.Table_Has_Border then if Kind = First_Row then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\clvertalc \clbrdrt\brdrs\brdrw10 " & "\clbrdrl\brdrs\brdrw10 " & "\clbrdrb\brdrs\brdrw10 " & "\clbrdrr\brdrs\brdrw10 "); elsif Kind = Row then --Ada.Text_IO.Put_Line (Output_Object.Output_File, -- "\clvertalc \clbrdrl\brdrs\brdrw10 " & -- "\clbrdrr\brdrs\brdrw10 "); -- Why no bottom border?? -- No top border! Ada.Text_IO.Put_Line (Output_Object.Output_File, "\clvertalc \clbrdrl\brdrs\brdrw10 " & "\clbrdrb\brdrs\brdrw10 " & "\clbrdrr\brdrs\brdrw10 "); else -- Kind = Last_Row then -- No top border! Ada.Text_IO.Put_Line (Output_Object.Output_File, "\clvertalc \clbrdrl\brdrs\brdrw10 " & "\clbrdrb\brdrs\brdrw10 " & "\clbrdrr\brdrs\brdrw10 "); end if; else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\clvertalc "); end if; if I /= Output_Object.Column_Count then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" & Format_Value(Output_Object.Table_Indent + Output_Object.Table_Column_Width*(Integer(I+Output_Object.Table_First_Column_Mult-1))) & " "); else -- Last cell, full width. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" & Format_Value(Output_Object.Table_Indent + Output_Object.Table_Width) & " "); end if; end loop; -- Now, define text format: if Output_Object.Table_Alignment = ARM_Output.Center_All then if Output_Object.Table_Has_Small_Text then Write_Style_for_Paragraph (Output_Object.Output_File, Table_C_Sml_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_C_Sml_Text_Info.Size; Output_Object.Size := 0; else Write_Style_for_Paragraph (Output_Object.Output_File, Table_C_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_C_Text_Info.Size; Output_Object.Size := 0; end if; else if Output_Object.Table_Has_Small_Text then Write_Style_for_Paragraph (Output_Object.Output_File, Table_L_Sml_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_L_Sml_Text_Info.Size; Output_Object.Size := 0; else Write_Style_for_Paragraph (Output_Object.Output_File, Table_L_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_L_Text_Info.Size; Output_Object.Size := 0; end if; end if; Ada.Text_IO.Put (Output_Object.Output_File, "\intbl "); Output_Object.Char_Count := Output_Object.Char_Count + 6; end case; -- \trowd - Start a table row. -- \row - End a table row. -- \trgaph - Half of of the gap between cells, in twips. -- \trhdr - Repeat line as header on following pages. -- \trkeep - Keep the row together (no page break). -- \trkeepfollow - Keep the row with the following (no page break). -- \trleft - Left edge of table row (in twips). -- \trrh - Row height (minimum if positive, absolute if negative). -- \clveralc - Text is centered vertically in cell. -- \cltxlrtb - Text flows top to bottom and left to right. -- \cellx - Right edge of cell, in Twips. (This is an absolute position). -- \intbl - Required marker for each cell. -- \cell - Ends cell (use instead of \par). -- \trbrdrt - Row Top border -- \trbrdrl - Row Left border -- \trbrdrb - Row Bottom border -- \trbrdrr - Row Right border -- \trbrdrh - Row Horizontal border -- \trbrdrv - Row Vertical border -- \clbrdrt - Cell Top border -- \clbrdrl - Cell Left border -- \clbrdrb - Cell Bottom border -- \clbrdrr - Cell Right border -- \brdrs - Single width border -- \brdrw - Width of the pen (can't be more than 75). end RTF_Table_Info; procedure Start_Table (Output_Object : in out RTF_Output_Type; Columns : in ARM_Output.Column_Count; First_Column_Width : in ARM_Output.Column_Count; Last_Column_Width : in ARM_Output.Column_Count; Alignment : in ARM_Output.Column_Text_Alignment; No_Page_Break : in Boolean; Has_Border : in Boolean; Small_Text_Size : in Boolean; Header_Kind : in ARM_Output.Header_Kind_Type) is -- Starts a table. The number of columns is Columns; the first -- column has First_Column_Width times the normal column width, and -- the last column has Last_Column_Width times the normal column width. -- Alignment is the horizontal text alignment within the columns. -- No_Page_Break should be True to keep the table intact on a single -- page; False to allow it to be split across pages. -- Has_Border should be true if a border is desired, false otherwise. -- Small_Text_Size means that the contents will have the AARM size; -- otherwise it will have the normal size. -- Header_Kind determines whether the table has headers. -- This command starts a paragraph; the entire table is a single -- paragraph. Text will be considered part of the caption until the -- next table marker call. -- Raises Not_Valid_Error if in a paragraph. Page_Width : Natural; Column_Units : constant Natural := Natural(Columns+First_Column_Width+Last_Column_Width-2); -- The number of column units (a unit being a regular width column). begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Table in paragraph"); end if; Output_Object.Is_In_Paragraph := True; Output_Object.Is_In_Table := True; Output_Object.Table_No_Page_Break := No_Page_Break; Output_Object.Table_Alignment := Alignment; Output_Object.Table_First_Column_Mult := First_Column_Width; Output_Object.Table_Last_Column_Mult := Last_Column_Width; Output_Object.Table_Has_Border := Has_Border; Output_Object.Table_Has_Small_Text := Small_Text_Size; case Output_Object.Page_Size is when ARM_RTF.A4 => Page_Width := 9030; when ARM_RTF.Letter => Page_Width := 9360; when ARM_RTF.Half_Letter => Page_Width := 5040; when ARM_RTF.Ada95 => Page_Width := 7740; end case; if Column_Units <= 3 then Output_Object.Table_Indent := Page_Width / 6; elsif Column_Units <= 8 then Output_Object.Table_Indent := Page_Width / 16; else Output_Object.Table_Indent := 0; end if; Output_Object.Table_Width := Page_Width - Output_Object.Table_Indent*2; Output_Object.Table_Column_Width := Output_Object.Table_Width / (Column_Units); Output_Object.Column_Count := Columns; --Ada.Text_IO.Put_Line("Table information"); --Ada.Text_IO.Put_Line("Columns:" & Natural'Image(Columns) & -- " 1st column mult:" & Natural'Image(First_Column_Width) & -- " last column mult:" & Natural'Image(Last_Column_Width)); --Ada.Text_IO.Put_Line("Width (twips):" & Natural'Image(Output_Object.Table_Width) & -- " Column width:" & Natural'Image(Output_Object.Table_Column_Width)); -- Make a blank line before, of the right size: Write_Style_for_Paragraph (Output_Object.Output_File, Table_L_Text_Info, Output_Object.Char_Count); Ada.Text_IO.Put (Output_Object.Output_File, "\par }"); Output_Object.Char_Count := 0; case Header_Kind is when ARM_Output.Both_Caption_and_Header => RTF_Table_Info (Output_Object, Kind => Caption); when ARM_Output.Header_Only => RTF_Table_Info (Output_Object, Kind => Header_no_Caption); when ARM_Output.No_Headers => RTF_Table_Info (Output_Object, Kind => Row); end case; end Start_Table; procedure Table_Marker (Output_Object : in out RTF_Output_Type; Marker : in ARM_Output.Table_Marker_Type) is -- Marks the end of an entity in a table. -- If Marker is End_Caption, the table caption ends and the -- future text is part of the table header. -- If Marker is End_Header, the table header ends and the -- future text is part of the table body. -- If Marker is End_Row, a row in the table is completed, and another -- row started. -- If Marker is End_Row_Next_Is_Last, a row in the table is completed, -- and another row started. That row is the last row in the table. -- If Marker is End_Item, an item in the table header or body is ended, -- and another started. -- If Marker is End_Table, the entire table is finished. -- Raises Not_Valid_Error if not in a table. use type ARM_Output.Column_Text_Alignment; begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if (not Output_Object.Is_In_Paragraph) or (not Output_Object.Is_In_Table) then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Table marker not in table"); end if; case Marker is when ARM_Output.End_Item => if Output_Object.Table_Alignment = ARM_Output.Center_except_First then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }"); Output_Object.Char_Count := 0; -- Now, define text format: if Output_Object.Table_Has_Small_Text then Write_Style_for_Paragraph (Output_Object.Output_File, Table_C_Sml_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_C_Sml_Text_Info.Size; Output_Object.Size := 0; else Write_Style_for_Paragraph (Output_Object.Output_File, Table_C_Text_Info, Output_Object.Char_Count); Output_Object.Real_Size := Table_C_Text_Info.Size; Output_Object.Size := 0; end if; else -- Text format stays the same. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell "); Output_Object.Char_Count := 0; end if; when ARM_Output.End_Caption => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row. -- Start header row: RTF_Table_Info (Output_Object, Kind => Header); -- Repeat table definition. when ARM_Output.End_Header => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row. -- Start 1st body row: RTF_Table_Info (Output_Object, Kind => First_Row); -- Repeat table definition. when ARM_Output.End_Row => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row. -- Start other body rows (no top border!): RTF_Table_Info (Output_Object, Kind => Row); -- Repeat table definition. when ARM_Output.End_Row_Next_Is_Last => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row. -- Start other body rows (no top border!): RTF_Table_Info (Output_Object, Kind => Last_Row); -- Repeat table definition. when ARM_Output.End_Table => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End last row of table. Output_Object.Is_In_Paragraph := False; Output_Object.Is_In_Table := False; Output_Object.Column_Count := 1; -- Make a blank line after, of the right size: Write_Style_for_Paragraph (Output_Object.Output_File, Table_L_Text_Info, Output_Object.Char_Count); Ada.Text_IO.Put (Output_Object.Output_File, "\par }"); Output_Object.Char_Count := 0; Ada.Text_IO.New_Line (Output_Object.Output_File); end case; end Table_Marker; -- Text output: These are only allowed after a Start_Paragraph and -- before any End_Paragraph. Raises Not_Valid_Error if not allowed. Special_Set : constant Ada.Strings.Maps.Character_Set := Ada.Strings.Maps."or" (Ada.Strings.Maps.To_Set ('\'), Ada.Strings.Maps."or" (Ada.Strings.Maps.To_Set ('{'), Ada.Strings.Maps.To_Set ('}'))); procedure Ordinary_Text (Output_Object : in out RTF_Output_Type; Text : in String) is -- Output ordinary text. -- The text must end at a word break, never in the middle of a word. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; if Ada.Strings.Fixed.Count (Text, Special_Set) = 0 and then (Output_Object.Paragraph_Style not in ARM_Output.Text_Prefixed_Style_Subtype or else Output_Object.Saw_Hang_End) then -- The second condition so that prefixes have their -- characters counted properly... if Output_Object.Char_Count + Text'Length > LINE_LENGTH then Ada.Text_IO.New_Line (Output_Object.Output_File); Ada.Text_IO.Put (Output_Object.Output_File, Text); Output_Object.Char_Count := Text'Length; elsif Output_Object.Char_Count + Text'Length >= LINE_LENGTH - 10 then Ada.Text_IO.Put_Line (Output_Object.Output_File, Text); Output_Object.Char_Count := 0; else Ada.Text_IO.Put (Output_Object.Output_File, Text); Output_Object.Char_Count := Output_Object.Char_Count + Text'Length; end if; else for I in Text'range loop Ordinary_Character (Output_Object, Text(I)); end loop; end if; end Ordinary_Text; procedure Ordinary_Character (Output_Object : in out RTF_Output_Type; Char : in Character) is -- Output an ordinary character. -- Spaces will be used to break lines as needed. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; if Char = ' ' and then Output_Object.Char_Count >= LINE_LENGTH - 5 then Ada.Text_IO.Put_Line (Output_Object.Output_File, " "); Output_Object.Char_Count := 0; else if Char = '\' then Ada.Text_IO.Put (Output_Object.Output_File, "\\"); Output_Object.Char_Count := Output_Object.Char_Count + 2; elsif Char = '{' then Ada.Text_IO.Put (Output_Object.Output_File, "\{"); Output_Object.Char_Count := Output_Object.Char_Count + 2; elsif Char = '}' then Ada.Text_IO.Put (Output_Object.Output_File, "\}"); Output_Object.Char_Count := Output_Object.Char_Count + 2; elsif Char >= Character'Val(126) then -- All higher Latin-1 characters. declare Code : constant Natural := Character'Pos(Char); begin if Code mod 16 >= 10 then if Code / 16 >= 10 then Ada.Text_IO.Put (Output_Object.Output_File, "\'" & Character'Val((Code / 16 - 10) + Character'Pos('a')) & Character'Val((Code mod 16 - 10) + Character'Pos('a'))); else Ada.Text_IO.Put (Output_Object.Output_File, "\'" & Character'Val((Code / 16) + Character'Pos('0')) & Character'Val((Code mod 16 - 10) + Character'Pos('a'))); end if; else if Code / 16 >= 10 then Ada.Text_IO.Put (Output_Object.Output_File, "\'" & Character'Val((Code / 16 - 10) + Character'Pos('a')) & Character'Val((Code mod 16) + Character'Pos('0'))); else Ada.Text_IO.Put (Output_Object.Output_File, "\'" & Character'Val((Code / 16) + Character'Pos('0')) & Character'Val((Code mod 16) + Character'Pos('0'))); end if; end if; Output_Object.Char_Count := Output_Object.Char_Count + 5; end; if Output_Object.Paragraph_Style in ARM_Output.Text_Prefixed_Style_Subtype and then (not Output_Object.Saw_Hang_End) then if not Ada.Characters.Handling.Is_Lower (Char) then Output_Object.Prefix_Large_Char_Count := Output_Object.Prefix_Large_Char_Count + 1; -- else small character. (This isn't perfectly accurate, but -- these aren't used much in prefixes.) end if; end if; else Ada.Text_IO.Put (Output_Object.Output_File, Char); Output_Object.Char_Count := Output_Object.Char_Count + 1; if Output_Object.Paragraph_Style in ARM_Output.Text_Prefixed_Style_Subtype and then (not Output_Object.Saw_Hang_End) then --Ada.Text_Io.Put (Char); if Char in 'A' .. 'H' or else Char in 'J' .. 'Z' or else -- Capital 'I' is narrow. Char in '0' .. '9' or else Char = '+' or else Char = '_' or else Char = '@' or else Char = '#' or else Char = '$' or else Char = '%' or else Char = '&' or else Char = '*' or else Char = '<' or else Char = '>' then Output_Object.Prefix_Large_Char_Count := Output_Object.Prefix_Large_Char_Count + 1; elsif Char = '.' then -- '.' is extra narrow; treat it as canceling out a -- a large character. if Output_Object.Prefix_Large_Char_Count > 0 then Output_Object.Prefix_Large_Char_Count := Output_Object.Prefix_Large_Char_Count - 1; end if; -- else small character. end if; end if; end if; end if; end Ordinary_Character; procedure Hard_Space (Output_Object : in out RTF_Output_Type) is -- Output a hard space. No line break should happen at a hard space. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; if Output_Object.Paragraph_Style in ARM_Output.Examples .. ARM_Output.Small_Examples then -- Fixed width fonts; hard spaces seem to be a different width -- than regular ones. So use regular spaces. Ada.Text_IO.Put (Output_Object.Output_File, " "); Output_Object.Char_Count := Output_Object.Char_Count + 1; else Ada.Text_IO.Put (Output_Object.Output_File, "\~"); Output_Object.Char_Count := Output_Object.Char_Count + 2; end if; end Hard_Space; procedure Line_Break (Output_Object : in out RTF_Output_Type) is -- Output a line break. This does not start a new paragraph. -- This corresponds to a "<BR>" in HTML. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; if Output_Object.Is_In_Table then -- We can't use \Par in a table, or Word deadlocks. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\line "); Output_Object.Char_Count := 0; elsif not Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Is_Justified then -- We can't use \Par, as that inserts paragraph spacing. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\line "); Output_Object.Char_Count := 0; else -- We can't use \Line, as that will cause the line to be justified. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sa0\par "); -- We have to turn off the inter-paragraph spacing. -- Now, reset the \sa setting. declare SA_Width : Natural := Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).After; begin if ARM_Output."="(Output_Object.Current_Space_After, ARM_Output.Narrow) then SA_Width := SA_Width*(LEADING_PERCENT/10)/10; elsif ARM_Output."="(Output_Object.Current_Space_After, ARM_Output.Wide) then SA_Width := SA_Width*(TRAILING_PERCENT/10)/10; end if; declare SA : constant String := Natural'Image(SA_Width); begin Ada.Text_IO.Put (Output_Object.Output_File, "\sa"); Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last)); Ada.Text_IO.Put (Output_Object.Output_File, " "); Output_Object.Char_Count := 4 + SA'Length - 1; end; end; if (Output_Object.Paragraph_Style in ARM_Output.Bulleted .. ARM_Output.Small_Hanging_in_Bulleted) then -- Always "NoPrefix" here. Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); Output_Object.Char_Count := Output_Object.Char_Count + 5; end if; end if; end Line_Break; procedure Index_Line_Break (Output_Object : in out RTF_Output_Type; Clear_Keep_with_Next : in Boolean) is -- Output a line break for the index. This does not start a new -- paragraph in terms of spacing. This corresponds to a "<BR>" -- in HTML. If Clear_Keep_with_Next is true, insure that the next -- line does not require the following line to stay with it. -- Raises Not_Valid_Error if the paragraph is not in the index format. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; if ARM_Output."/=" (Output_Object.Paragraph_Style, ARM_Output.Index) or else ARM_Output."/=" (Output_Object.Paragraph_Indent, 0) then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in index paragraph"); end if; -- We have to use /par here, because otherwise we don't get the "undent" -- at the start of the paragraph. if Clear_Keep_with_Next then -- Note: We need this special routine, because ending the paragraph -- would add blank lines to the HTML. End_Paragraph (Output_Object); Start_Paragraph (Output_Object, ARM_Output.Index, Indent => 0, Number => "", No_Breaks => True, Keep_with_Next => False, Tab_Stops => Output_Object.Tab_Stops); else Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par "); -- Inherits the paragraph properties. end if; Output_Object.Char_Count := 0; end Index_Line_Break; procedure Soft_Line_Break (Output_Object : in out RTF_Output_Type) is -- Output a soft line break. This is a place (in the middle of a -- "word") that we allow a line break. It is usually used after -- underscores in long non-terminals. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\softline "); --Ada.Text_IO.Put (Output_Object.Output_File, "\zwbo "); -- -- Zero-width break opportunity. (Word 7.0 [Word 95] or later). -- (Doesn't work). Output_Object.Char_Count := Output_Object.Char_Count + 10; end Soft_Line_Break; procedure Soft_Hyphen_Break (Output_Object : in out RTF_Output_Type) is -- Output a soft line break, with a hyphen. This is a place (in the middle of -- a "word") that we allow a line break. If the line break is used, -- a hyphen will be added to the text. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\-"); Output_Object.Char_Count := Output_Object.Char_Count + 2; end Soft_Hyphen_Break; procedure Tab (Output_Object : in out RTF_Output_Type) is -- Output a tab, inserting space up to the next tab stop. -- Raises Not_Valid_Error if the paragraph was created with -- Tab_Stops = ARM_Output.NO_TABS. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; if ARM_Output."="(Output_Object.Tab_Stops, ARM_Output.NO_TABS) then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Tab, but none set"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); Output_Object.Char_Count := Output_Object.Char_Count + 5; end Tab; procedure Special_Character (Output_Object : in out RTF_Output_Type; Char : in ARM_Output.Special_Character_Type) is -- Output an special character. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; case Char is when ARM_Output.EM_Dash => Ada.Text_IO.Put (Output_Object.Output_File, "\emdash "); Output_Object.Char_Count := Output_Object.Char_Count + 8; when ARM_Output.EN_Dash => Ada.Text_IO.Put (Output_Object.Output_File, "\endash "); Output_Object.Char_Count := Output_Object.Char_Count + 8; when ARM_Output.GEQ => --Unicode: Doesn't work on Windows 98: --Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u8805 >="); --Output_Object.Char_Count := Output_Object.Char_Count + 13; -- Character 179, Symbol font. Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'B3}"); Output_Object.Char_Count := Output_Object.Char_Count + 9; when ARM_Output.LEQ => --Unicode: Doesn't work on Windows 98: --Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u8804 <="); --Output_Object.Char_Count := Output_Object.Char_Count + 13; -- Character 163, Symbol font. Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'A3}"); Output_Object.Char_Count := Output_Object.Char_Count + 9; when ARM_Output.NEQ => --Unicode: Doesn't work on Windows 98: --Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u8800 /="); --Output_Object.Char_Count := Output_Object.Char_Count + 13; -- Character 185, Symbol font. Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'B9}"); Output_Object.Char_Count := Output_Object.Char_Count + 9; when ARM_Output.PI => --Unicode: Doesn't work on Windows 98: --Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u960 PI"); --Output_Object.Char_Count := Output_Object.Char_Count + 12; -- Character 112, Symbol font. Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'70}"); Output_Object.Char_Count := Output_Object.Char_Count + 9; when ARM_Output.Left_Ceiling => --Unicode: Doesn't work on Windows 98: --Ada.Text_IO.Put (Output_Object.Output_File, "\uc8\u8968 Ceiling("); --Output_Object.Char_Count := Output_Object.Char_Count + 19; -- Character 233, Symbol font. Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'E9}"); Output_Object.Char_Count := Output_Object.Char_Count + 9; when ARM_Output.Right_Ceiling => --Unicode: Doesn't work on Windows 98: --Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u8969 )"); --Output_Object.Char_Count := Output_Object.Char_Count + 11; -- Character 249, Symbol font. Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'F9}"); Output_Object.Char_Count := Output_Object.Char_Count + 9; when ARM_Output.Left_Floor => --Unicode: Doesn't work on Windows 98: --Ada.Text_IO.Put (Output_Object.Output_File, "\uc6\u8970 Floor("); --Output_Object.Char_Count := Output_Object.Char_Count + 17; -- Character 235, Symbol font. Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'EB}"); Output_Object.Char_Count := Output_Object.Char_Count + 9; when ARM_Output.Right_Floor => --Unicode: Doesn't work on Windows 98: --Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u8971 )"); --Output_Object.Char_Count := Output_Object.Char_Count + 11; -- Character 251, Symbol font. Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'FB}"); Output_Object.Char_Count := Output_Object.Char_Count + 9; when ARM_Output.Thin_Space => Ada.Text_IO.Put (Output_Object.Output_File, "\qmspace "); Output_Object.Char_Count := Output_Object.Char_Count + 9; when ARM_Output.Left_Quote => Ada.Text_IO.Put (Output_Object.Output_File, "\lquote "); Output_Object.Char_Count := Output_Object.Char_Count + 8; when ARM_Output.Right_Quote => Ada.Text_IO.Put (Output_Object.Output_File, "\rquote "); Output_Object.Char_Count := Output_Object.Char_Count + 8; when ARM_Output.Left_Double_Quote => Ada.Text_IO.Put (Output_Object.Output_File, "\ldblquote "); Output_Object.Char_Count := Output_Object.Char_Count + 11; when ARM_Output.Right_Double_Quote => Ada.Text_IO.Put (Output_Object.Output_File, "\rdblquote "); Output_Object.Char_Count := Output_Object.Char_Count + 11; when ARM_Output.Small_Dotless_I => --Unicode: Doesn't work on Windows 98: but we have no choice here: Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u305 i"); -- Note: \uc1 means ASCII version has one character; -- \u305 means use Unicode character 305. Output_Object.Char_Count := Output_Object.Char_Count + 11; when ARM_Output.Capital_Dotted_I => --Unicode: Doesn't work on Windows 98: but we have no choice here: Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u304 I"); Output_Object.Char_Count := Output_Object.Char_Count + 11; end case; if Output_Object.Paragraph_Style in ARM_Output.Text_Prefixed_Style_Subtype and then (not Output_Object.Saw_Hang_End) then Output_Object.Prefix_Large_Char_Count := Output_Object.Prefix_Large_Char_Count + 1; end if; end Special_Character; procedure Unicode_Character (Output_Object : in out RTF_Output_Type; Char : in ARM_Output.Unicode_Type) is -- Output a Unicode character, with code position Char. Char_Code : constant String := ARM_Output.Unicode_Type'Image(Char); Len : constant String := Natural'Image(Char_Code'Length+2); begin -- We don't check this, we just output it. if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\uc" & Len(2..Len'Last) & "\u" & Char_Code(2..Char_Code'Last) & " <U" & Char_Code(2..Char_Code'Last) & ">"); Output_Object.Char_Count := Output_Object.Char_Count + 9 + Len'Last-1 + (Char_Code'Last-1)*2; if Output_Object.Paragraph_Style in ARM_Output.Text_Prefixed_Style_Subtype and then (not Output_Object.Saw_Hang_End) then Output_Object.Prefix_Large_Char_Count := Output_Object.Prefix_Large_Char_Count + 1; end if; end Unicode_Character; procedure End_Hang_Item (Output_Object : in out RTF_Output_Type) is -- Marks the end of a hanging item. Call only once per paragraph. -- Raises Not_Valid_Error if the paragraph style is not in -- Text_Prefixed_Style_Subtype, or if this has already been -- called for the current paragraph, or if the paragraph was started -- with No_Prefix = True. Current_Format : ARM_Output.Format_Type; begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; if Output_Object.Paragraph_Style not in ARM_Output.Text_Prefixed_Style_Subtype then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not a hanging paragraph"); end if; if Output_Object.Saw_Hang_End then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Already saw the end of the hanging part"); end if; Output_Object.Saw_Hang_End := True; --Ada.Text_Io.Put (": Cnt=" & Natural'Image(Output_Object.Char_Count) & " Lrg=" & -- Natural'Image(Output_Object.Prefix_Large_Char_Count)); --Ada.Text_Io.Put (" Style=" & ARM_Output.Paragraph_Style_Type'Image(Output_Object.Paragraph_Style)); --Ada.Text_Io.Put (" Indent=" & ARM_Output.Paragraph_Indent_Type'Image(Output_Object.Paragraph_Indent)); --Ada.Text_Io.Put (" Count=" & Natural'Image( -- ((Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Width * 6 * 2) / -- (Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size * 5 * 5)) - 1)); --Ada.Text_Io.Put (" Hang_Width=" & Natural'Image(Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Width)); --Ada.Text_Io.Put (" Size=" & Natural'Image(Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size)); if Output_Object.Char_Count*2 + Output_Object.Prefix_Large_Char_Count <= ((Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Width * 6 * 2) / (Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size * 5 * 5)) - 1 then -- No line break needed. (I can't find a way to get Word to do -- this properly, so we have to do it. We assume large characters -- are about 1 1/2 times normal characters, and that normal -- characters are about 5/6 the pt. size in width. Note that "Size" -- is in 1/2 pts., while "Hang_Width" is in .1 pts., so we need -- the "5" to correct the units.) The "- 1" is to allow space -- for the trailing space/tab. (Running into the text looks bad!). Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); Output_Object.Char_Count := Output_Object.Char_Count + 5; --Ada.Text_Io.Put_Line (" No_Break"); else -- Line break needed. -- Just writing a line break clobbers any open styles. -- We have to save the current style, close it properly, -- do the line break stuff, and then reopen it. This showed as -- a bug only in RM-All, 3.3.1(19) [which should be shown as -- deleted, but was not.] -- Note that the HTML version does this save and restore dance, -- why we didn't do it here I'm not sure - RLB - 8/19/16. Current_Format := (Bold => Output_Object.Is_Bold, Italic => Output_Object.Is_Italic, Font => Output_Object.Font, Size => Output_Object.Size, Color => Output_Object.Color, Change => Output_Object.Change, Version => Output_Object.Version, Added_Version => Output_Object.Added_Version, Location=> Output_Object.Location); Text_Format (Output_Object, ARM_Output.NORMAL_FORMAT); -- Clear the existing format. --Ada.Text_IO.Put_Line (Output_Object.Output_File, "\line "); --Output_Object.Char_Count := 0; --This idiot program JUSTIFIES the text fragment, so a line --break cannot be used if the text is justified. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sa0\keepn\par }"); Write_Style_for_Paragraph (Output_Object.Output_File, Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent), Output_Object.Char_Count); Set_Tabs (Output_Object, Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent); -- Reset after spacing: if ARM_Output."="(Output_Object.Current_Space_After, ARM_Output.Narrow) then declare SA_Width : Natural := Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).After*(LEADING_PERCENT/10)/10; SA : constant String := Natural'Image(SA_Width); begin Ada.Text_IO.Put (Output_Object.Output_File, "\sa"); Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last)); Ada.Text_IO.Put (Output_Object.Output_File, " "); Output_Object.Char_Count := 4 + SA'Length - 1; end; elsif ARM_Output."="(Output_Object.Current_Space_After, ARM_Output.Wide) then declare SA_Width : Natural := Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).After*(TRAILING_PERCENT/10)/10; SA : constant String := Natural'Image(SA_Width); begin Ada.Text_IO.Put (Output_Object.Output_File, "\sa"); Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last)); Ada.Text_IO.Put (Output_Object.Output_File, " "); Output_Object.Char_Count := 4 + SA'Length - 1; end; end if; Ada.Text_IO.Put (Output_Object.Output_File, "\tab "); Output_Object.Char_Count := Output_Object.Char_Count + 5; --Ada.Text_Io.Put_Line (" Break"); -- Reset the format: Text_Format (Output_Object, Current_Format); end if; end End_Hang_Item; procedure Text_Format (Output_Object : in out RTF_Output_Type; Format : in ARM_Output.Format_Type) is -- Change the text format so that all of the properties are as specified. -- Note: Changes to these properties ought be stack-like; that is, -- Bold on, Italic on, Italic off, Bold off is OK; Bold on, Italic on, -- Bold off, Italic off should be avoided (as separate commands). TRACE_TF : constant Boolean := FALSE; use type ARM_Output.Change_Type; -- use type ARM_Contents.Change_Version_Type; use type ARM_Output.Location_Type; use type ARM_Output.Size_Type; use type ARM_Output.Color_Type; procedure Make_Size_Command (Size : in Natural) is -- Write a \fs command to the file for Size. -- Max 29.5 pt, min 5 pt. begin if Output_Object.Real_Size >= 50 then Ada.Text_IO.Put (Output_Object.Output_File, "\fs5" & Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0'))); elsif Output_Object.Real_Size >= 40 then Ada.Text_IO.Put (Output_Object.Output_File, "\fs4" & Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0'))); elsif Output_Object.Real_Size >= 30 then Ada.Text_IO.Put (Output_Object.Output_File, "\fs3" & Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0'))); elsif Output_Object.Real_Size >= 20 then Ada.Text_IO.Put (Output_Object.Output_File, "\fs2" & Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0'))); elsif Output_Object.Real_Size >= 10 then Ada.Text_IO.Put (Output_Object.Output_File, "\fs1" & Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0'))); else Ada.Text_IO.Put (Output_Object.Output_File, "\fs10"); end if; Output_Object.Char_Count := Output_Object.Char_Count + 6; end Make_Size_Command; procedure Close_Basic_Format is -- Close any open basic format (Bold/Italic/Size/Font) command. begin if (not Output_Object.Is_Bold) and (not Output_Object.Is_Italic) and ARM_Output."=" (Output_Object.Font, ARM_Output.Default) and Output_Object.Color = ARM_Output.Default and Output_Object.Size = 0 then -- No format previously set, so none to close (default). return; end if; if TRACE_TF then Ada.Text_Io.Put (" Close basic format ["); if Output_Object.Is_Bold then Ada.Text_Io.Put ('B'); end if; if Output_Object.Is_Italic then Ada.Text_Io.Put ('I'); end if; if Output_Object.Size /= 0 then Ada.Text_Io.Put ('S'); end if; if Output_Object.Color /= ARM_Output.Default then Ada.Text_Io.Put ('C'); end if; if ARM_Output."/=" (Output_Object.Font, ARM_Output.Default) then Ada.Text_Io.Put ('F'); end if; Ada.Text_Io.Put (']'); end if; Ada.Text_IO.Put (Output_Object.Output_File, "}"); Output_Object.Char_Count := Output_Object.Char_Count + 1; Output_Object.Real_Size := Output_Object.Real_Size - (Integer(Output_Object.Size)*2); Output_Object.Size := 0; Output_Object.Is_Bold := False; Output_Object.Is_Italic := False; Output_Object.Color := ARM_Output.Default; case Output_Object.Font is when ARM_Output.Default => null; when ARM_Output.Fixed => null; when ARM_Output.Roman => null; when ARM_Output.Swiss => -- Undo the size adjustment, if any. if ARM_Output."/=" (Output_Object.Body_Font, ARM_Output.Swiss) then Output_Object.Real_Size := Output_Object.Real_Size + 1; -- else no adjustment. end if; end case; Output_Object.Font := ARM_Output.Default; end Close_Basic_Format; procedure Make_Basic_Format is -- Make any needed Bold/Italic/Size/Font command. begin if (not Format.Bold) and (not Format.Italic) and ARM_Output."=" (Format.Font, ARM_Output.Default) and Format.Color = ARM_Output.Default and Format.Size = 0 then -- No format needed (default). return; end if; Ada.Text_IO.Put (Output_Object.Output_File, "{"); Output_Object.Char_Count := Output_Object.Char_Count + 1; if TRACE_TF then Ada.Text_Io.Put (" Make basic {"); end if; -- Bold: if Format.Bold then if TRACE_TF then Ada.Text_Io.Put (" Change bold"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\b"); Output_Object.Char_Count := Output_Object.Char_Count + 2; Output_Object.Is_Bold := True; end if; -- Italic: if Format.Italic then if TRACE_TF then Ada.Text_Io.Put (" Change italics"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\i"); Output_Object.Char_Count := Output_Object.Char_Count + 2; Output_Object.Is_Italic := True; end if; -- Size: if Format.Size /= 0 then if TRACE_TF then Ada.Text_Io.Put (" Change size " & ARM_Output.Size_Type'Image(Format.Size)); end if; Output_Object.Real_Size := Output_Object.Real_Size + Integer(Format.Size)*2; if ARM_Output."/=" (Format.Font, ARM_Output.Swiss) or else ARM_Output."=" (Output_Object.Body_Font, ARM_Output.Swiss) then Make_Size_Command (Output_Object.Real_Size); -- else it will be done by the Font, below. end if; end if; Output_Object.Size := Format.Size; -- Color: if Format.Color /= ARM_Output.Default then if TRACE_TF then Ada.Text_Io.Put (" Change color " & ARM_Output.Color_Type'Image(Format.Color)); end if; case Format.Color is when ARM_Output.Default => null; when ARM_Output.Black => -- Color 1 Ada.Text_IO.Put (Output_Object.Output_File, "\cf1"); Output_Object.Char_Count := Output_Object.Char_Count + 4; when ARM_Output.Red => -- Color 13 Ada.Text_IO.Put (Output_Object.Output_File, "\cf13"); Output_Object.Char_Count := Output_Object.Char_Count + 5; when ARM_Output.Green => -- Color 11 Ada.Text_IO.Put (Output_Object.Output_File, "\cf11"); Output_Object.Char_Count := Output_Object.Char_Count + 5; when ARM_Output.Blue => -- Color 9 Ada.Text_IO.Put (Output_Object.Output_File, "\cf9"); Output_Object.Char_Count := Output_Object.Char_Count + 4; end case; end if; Output_Object.Color := Format.Color; -- Font: case Format.Font is when ARM_Output.Default => null; when ARM_Output.Fixed => if TRACE_TF then Ada.Text_Io.Put (" Change font fixed"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\f2"); Output_Object.Char_Count := Output_Object.Char_Count + 4; when ARM_Output.Roman => if TRACE_TF then Ada.Text_Io.Put (" Change font roman"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\f0"); Output_Object.Char_Count := Output_Object.Char_Count + 4; when ARM_Output.Swiss => if TRACE_TF then Ada.Text_Io.Put (" Change font swiss"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "\f1"); Output_Object.Char_Count := Output_Object.Char_Count + 3; -- Swiss fonts always appear too large, so shrink it a bit, -- but not if the main body is a Swiss font. if ARM_Output."/=" (Output_Object.Body_Font, ARM_Output.Swiss) then Output_Object.Real_Size := Output_Object.Real_Size - 1; Make_Size_Command (Output_Object.Real_Size); end if; end case; Ada.Text_IO.Put (Output_Object.Output_File, " "); Output_Object.Char_Count := Output_Object.Char_Count + 1; Output_Object.Font := Format.Font; end Make_Basic_Format; procedure Make_Revision is -- Make any needed revision: begin -- We could "improve" this by keeping similar changes together, -- especially for changes to/from Both, but its a lot more work -- and unnecessary. case Format.Change is when ARM_Output.Insertion => if TRACE_TF then Ada.Text_Io.Put (" Change insertion"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "{\revised\revauth" & Format.Version & ' '); Output_Object.Char_Count := Output_Object.Char_Count + 18; -- Note: \revauthN indicates the author. Each version -- that we'll use needs an entry in the \revtbl. -- We could include a date with \revddtm??, but that's messy. when ARM_Output.Deletion => if TRACE_TF then Ada.Text_Io.Put (" Change deletion"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "{\deleted\revauthdel" & Format.Version & ' '); Output_Object.Char_Count := Output_Object.Char_Count + 21; -- Note: \revauthdelN indicates the author. Each version -- that we'll use needs an entry in the \revtbl. -- We could include a date with \revddtmdel??, but that's messy. when ARM_Output.Both => if TRACE_TF then Ada.Text_Io.Put (" Change both"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "{\revised\revauth" & Format.Added_Version & ' '); Output_Object.Char_Count := Output_Object.Char_Count + 18; Ada.Text_IO.Put (Output_Object.Output_File, "{\deleted\revauthdel" & Format.Version & ' '); Output_Object.Char_Count := Output_Object.Char_Count + 21; -- Note: \revauthdelN indicates the author. Each version -- that we'll use needs an entry in the \revtbl. -- We could include a date with \revddtmdel??, but that's messy. when ARM_Output.None => null; end case; Output_Object.Change := Format.Change; Output_Object.Version := Format.Version; Output_Object.Added_Version := Format.Added_Version; end Make_Revision; procedure Close_Revision is -- Close any open revision: begin -- We could "improve" this by keeping similar changes together, -- especially for changes to/from Both, but its a lot more work -- and unnecessary. case Output_Object.Change is when ARM_Output.Insertion => if TRACE_TF then Ada.Text_Io.Put (" Unchange insertion"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "}"); Output_Object.Char_Count := Output_Object.Char_Count + 1; when ARM_Output.Deletion => if TRACE_TF then Ada.Text_Io.Put (" Unchange deletion"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "}"); Output_Object.Char_Count := Output_Object.Char_Count + 1; when ARM_Output.None => null; when ARM_Output.Both => if TRACE_TF then Ada.Text_Io.Put (" Unchange both"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "}}"); Output_Object.Char_Count := Output_Object.Char_Count + 2; end case; end Close_Revision; procedure Make_Location is -- Make any needed location: begin case Format.Location is when ARM_Output.Subscript => if TRACE_TF then Ada.Text_Io.Put (" Change sub"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "{\sub "); Output_Object.Char_Count := Output_Object.Char_Count + 6; when ARM_Output.Superscript => if TRACE_TF then Ada.Text_Io.Put (" Change sup"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "{\super "); Output_Object.Char_Count := Output_Object.Char_Count + 8; when ARM_Output.Normal => null; end case; Output_Object.Location := Format.Location; end Make_Location; procedure Close_Location is -- Close any open location: begin case Output_Object.Location is when ARM_Output.Subscript => if TRACE_TF then Ada.Text_Io.Put (" Unchange sub"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "}"); Output_Object.Char_Count := Output_Object.Char_Count + 1; when ARM_Output.Superscript => if TRACE_TF then Ada.Text_Io.Put (" Unchange sup"); end if; Ada.Text_IO.Put (Output_Object.Output_File, "}"); Output_Object.Char_Count := Output_Object.Char_Count + 1; when ARM_Output.Normal => null; end case; end Close_Location; begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; if TRACE_TF then Ada.Text_Io.Put ("Text format"); end if; -- We always make changes in the order: -- Revision; -- Location; -- Basic_Format (Bold, Italic, Font, Size, Color). -- Thus, we have to unstack them in the reverse order. And, if we want -- to change an outer one, we have to close and redo any inner -- ones. -- We do these in this order so that the changes are stacked properly. if Format.Change /= Output_Object.Change or else Format.Version /= Output_Object.Version or else Format.Added_Version /= Output_Object.Added_Version then Close_Basic_Format; Close_Location; Close_Revision; Make_Revision; Make_Location; Make_Basic_Format; elsif Format.Location /= Output_Object.Location then -- We don't need to change the revision, leave it alone. Close_Basic_Format; Close_Location; Make_Location; Make_Basic_Format; elsif Format.Color /= Output_Object.Color or else Format.Size /= Output_Object.Size or else ARM_Output."/=" (Format.Font, Output_Object.Font) or else Format.Bold /= Output_Object.Is_Bold or else Format.Italic /= Output_Object.Is_Italic then Close_Basic_Format; Make_Basic_Format; -- else no change at all. end if; if TRACE_TF then Ada.Text_Io.New_Line; end if; end Text_Format; procedure Clause_Reference (Output_Object : in out RTF_Output_Type; Text : in String; Clause_Number : in String) is -- Generate a reference to a clause in the standard. The text of -- the reference is "Text", and the number of the clause is -- Clause_Number. For hyperlinked formats, this should generate -- a link; for other formats, the text alone is generated. begin Ordinary_Text (Output_Object, Text); -- Nothing special in this format. -- Note: We could generate genuine clause references for Word, -- but that wouldn't buy us anything for the RM. end Clause_Reference; procedure Index_Target (Output_Object : in out RTF_Output_Type; Index_Key : in Natural) is -- Generate a index target. This marks the location where an index -- reference occurs. Index_Key names the index item involved. -- For hyperlinked formats, this should generate a link target; -- for other formats, nothing is generated. begin if not Output_Object.Is_Valid then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not valid object"); end if; if not Output_Object.Is_In_Paragraph then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Not in paragraph"); end if; null; -- Nothing to do for RTF. We could have let Word make the -- index, but then we'd still have to build it for HTML, and -- we couldn't get paragraph numbers in the index. end Index_Target; procedure Index_Reference (Output_Object : in out RTF_Output_Type; Text : in String; Index_Key : in Natural; Clause_Number : in String) is -- Generate a reference to an index target in the standard. The text -- of the reference is "Text", and Index_Key and Clause_Number denotes -- the target. For hyperlinked formats, this should generate -- a link; for other formats, the text alone is generated. begin Ordinary_Text (Output_Object, Text); -- Nothing special in this format. end Index_Reference; procedure DR_Reference (Output_Object : in out RTF_Output_Type; Text : in String; DR_Number : in String) is -- Generate a reference to an DR from the standard. The text -- of the reference is "Text", and DR_Number denotes -- the target. For hyperlinked formats, this should generate -- a link; for other formats, the text alone is generated. begin Ordinary_Text (Output_Object, Text); -- Nothing special in this format. end DR_Reference; procedure AI_Reference (Output_Object : in out RTF_Output_Type; Text : in String; AI_Number : in String) is -- Generate a reference to an AI from the standard. The text -- of the reference is "Text", and AI_Number denotes -- the target (in unfolded format). For hyperlinked formats, this should -- generate a link; for other formats, the text alone is generated. begin Ordinary_Text (Output_Object, Text); -- Nothing special in this format. end AI_Reference; procedure Local_Target (Output_Object : in out RTF_Output_Type; Text : in String; Target : in String) is -- Generate a local target. This marks the potential target of local -- links identified by "Target". Text is the text of the target. -- For hyperlinked formats, this should generate a link target; -- for other formats, only the text is generated. begin Ordinary_Text (Output_Object, Text); -- Nothing special in this format. end Local_Target; procedure Local_Link (Output_Object : in out RTF_Output_Type; Text : in String; Target : in String; Clause_Number : in String) is -- Generate a local link to the target and clause given. -- Text is the text of the link. -- For hyperlinked formats, this should generate a link; -- for other formats, only the text is generated. begin Ordinary_Text (Output_Object, Text); -- Nothing special in this format. end Local_Link; procedure Local_Link_Start (Output_Object : in out RTF_Output_Type; Target : in String; Clause_Number : in String) is -- Generate a local link to the target and clause given. -- The link will surround text until Local_Link_End is called. -- Local_Link_End must be called before this routine can be used again. -- For hyperlinked formats, this should generate a link; -- for other formats, only the text is generated. begin null; -- No link, nothing to do. end Local_Link_Start; procedure Local_Link_End (Output_Object : in out RTF_Output_Type; Target : in String; Clause_Number : in String) is -- End a local link for the target and clause given. -- This must be in the same paragraph as the Local_Link_Start. -- For hyperlinked formats, this should generate a link; -- for other formats, only the text is generated. begin null; -- No link, nothing to do. end Local_Link_End; procedure URL_Link (Output_Object : in out RTF_Output_Type; Text : in String; URL : in String) is -- Generate a link to the URL given. -- Text is the text of the link. -- For hyperlinked formats, this should generate a link; -- for other formats, only the text is generated. begin Ordinary_Text (Output_Object, Text); -- Nothing special in this format. end URL_Link; procedure Picture (Output_Object : in out RTF_Output_Type; Name : in String; Descr : in String; Alignment : in ARM_Output.Picture_Alignment; Height, Width : in Natural; Border : in ARM_Output.Border_Kind) is -- Generate a picture. -- Name is the (simple) file name of the picture; Descr is a -- descriptive name for the picture (it will appear in some web -- browsers). -- We assume that it is a .PNG or .JPG and that it will be present -- in the same directory as the output files. -- Alignment specifies the picture alignment. -- Height and Width specify the picture size in pixels. -- Border specifies the kind of border. use type ARM_Output.Picture_Alignment; use type ARM_Output.Border_Kind; HORIZONTAL_TWIPS_PER_PIXEL : constant := 16; -- By experiment. VERTICAL_TWIPS_PER_PIXEL : constant := 16; -- By experiment. -- These values give us Pixels/90 = box size in inches. -- For reasons that I don't understand, the supposed "raw" picture -- size is Pixels/120. So a scaling of 75% gives exact pixels. type Kind is (PNG, JPEG, Unknown); type DWord is mod 2**32; Picture_Width : DWord; Picture_Height : DWord; Picture_Kind : Kind := Unknown; Picture_Scaling : Natural; procedure Get_Picture_Dimensions is -- Get the picture dimensions from the graphic file. use type Ada.Streams.Stream_Element_Offset; Fyle : Ada.Streams.Stream_IO.File_Type; type PNG_Header is record Signature_1 : DWord; -- Fixed value Signature_2 : DWord; -- Fixed value Header_Len : DWord; -- Fixed value (13) Header_Type : DWord; -- Fixed value ("IHDR") Width : DWord; -- In pixels. Height : DWord; -- In pixels. -- Other stuff is not important here. end record; subtype PNG_Stream is Ada.Streams.Stream_Element_Array(1..6*4); function Convert is new Ada.Unchecked_Conversion (Source => PNG_Stream, Target => PNG_Header); Buffer : PNG_Stream; Last : Ada.Streams.Stream_Element_Offset; Temp : Ada.Streams.Stream_Element; begin begin Ada.Streams.Stream_IO.Open (Fyle, Mode => Ada.Streams.Stream_IO.In_File, Name => Ada.Strings.Unbounded.To_String (Output_Object.Output_Path) & Name); exception when Oops:others => Ada.Text_IO.Put_Line ("** Unable to open picture file: " & Ada.Exceptions.Exception_Message(Oops)); Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Unable to open picture file"); end; -- Read a PNG header, to see if it is a PNG: Ada.Streams.Stream_IO.Read (Fyle, Buffer, Last); if Last /= 24 then Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Picture file too short"); end if; if Convert(Buffer).Signature_1 = 16#89_50_4e_47# and then Convert(Buffer).Signature_2 = 16#0d_0a_1a_0a# then -- This is a PNG file: Picture_Kind := PNG; Picture_Width := Convert(Buffer).Width; Picture_Height := Convert(Buffer).Height; Ada.Text_IO.Put_Line ("Forward PNG: Width=" & DWord'Image(Picture_Width) & " Height=" & DWord'Image(Picture_Height)); elsif Convert(Buffer).Signature_1 = 16#47_4e_50_89# and then Convert(Buffer).Signature_2 = 16#0a_1a_0a_0d# then -- This is a byte-swapped PNG file. -- Swap the bytes in the buffer, then get the width and height: Temp := Buffer(17); Buffer(17) := Buffer(20); Buffer(20) := Temp; Temp := Buffer(18); Buffer(18) := Buffer(19); Buffer(19) := Temp; Temp := Buffer(21); Buffer(21) := Buffer(24); Buffer(24) := Temp; Temp := Buffer(22); Buffer(22) := Buffer(23); Buffer(23) := Temp; Picture_Kind := PNG; Picture_Width := Convert(Buffer).Width; Picture_Height := Convert(Buffer).Height; Ada.Text_IO.Put_Line ("Reversed PNG: Width=" & DWord'Image(Picture_Width) & " Height=" & DWord'Image(Picture_Height)); -- elsif Name'Length > 5 and then -- (Name(Name'Last-3..Name'Last) = ".JPG" or else -- Name(Name'Last-3..Name'Last) = ".jpg" or else -- Name(Name'Last-4..Name'Last) = ".JPEG" or else -- Name(Name'Last-4..Name'Last) = ".Jpeg" or else -- Name(Name'Last-4..Name'Last) = ".jpeg") then -- Picture_Kind := JPEG; else Ada.Text_IO.Put_Line ("** Unimplemented picture formatting: File type"); Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Do not recognize picture file"); end if; end Get_Picture_Dimensions; function Format_Twips (Twips : in Natural) return String is Flab : constant String := Natural'Image(Twips); begin return Flab(2..Flab'Last); end Format_Twips; procedure Dump_File_in_Hex is -- Read and output the graphics file to the output file -- in Hexadecimal. Fyle : Ada.Streams.Stream_IO.File_Type; Buffer : Ada.Streams.Stream_Element_Array(1..32); Last : Ada.Streams.Stream_Element_Offset; use type Ada.Streams.Stream_Element; use type Ada.Streams.Stream_Element_Offset; Temp : Ada.Streams.Stream_Element; begin begin Ada.Streams.Stream_IO.Open (Fyle, Mode => Ada.Streams.Stream_IO.In_File, Name => Ada.Strings.Unbounded.To_String (Output_Object.Output_Path) & Name); exception when Oops:others => Ada.Text_IO.Put_Line ("** Unable to open picture file: " & Ada.Exceptions.Exception_Message(Oops)); Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Unable to open picture file"); end; loop Ada.Streams.Stream_IO.Read (Fyle, Buffer, Last); exit when Last = 0; -- Nothing read equals end of file. for I in 1 .. Last loop Temp := Buffer(I) / 16; if Temp > 9 then Ada.Text_IO.Put (Output_Object.Output_File, Character'Val(Character'Pos('A') + (Temp - 10))); else Ada.Text_IO.Put (Output_Object.Output_File, Character'Val(Character'Pos('0') + Temp)); end if; Temp := Buffer(I) mod 16; if Temp > 9 then Ada.Text_IO.Put (Output_Object.Output_File, Character'Val(Character'Pos('A') + (Temp - 10))); else Ada.Text_IO.Put (Output_Object.Output_File, Character'Val(Character'Pos('0') + Temp)); end if; end loop; Ada.Text_IO.New_Line (Output_Object.Output_File); end loop; Ada.Streams.Stream_IO.Close (Fyle); end Dump_File_in_Hex; begin Get_Picture_Dimensions; -- Calculate scaling needed: declare Width_Scale, Height_Scale : Float; Word_Scaling : constant Float := 6.0; -- Scaling so that the HTML pixel and Word pixel -- have the same approximate size. Word's pixels -- seem to be about 6 times smaller than HTML's. -- Word's box size is begin Width_Scale := Float(Width) / Float(Picture_Width) * 100.0 * Word_Scaling; Height_Scale := Float(Height) / Float(Picture_Height) * 100.0 * Word_Scaling; -- Then, use the smaller scale: if Width_Scale < Height_Scale then Picture_Scaling := Natural(Width_Scale); else Picture_Scaling := Natural(Height_Scale); end if; Ada.Text_IO.Put_Line ("Picture scaling (%):" & Natural'Image(Picture_Scaling)); Ada.Text_IO.Put_Line ("Box width=" & Natural'Image(Width) & " Height=" & Natural'Image(Height)); -- Note: Word 2000/2003 seems to ignore this scaling; it seems to -- use the "picwgoal" and "pichgoal" exclusively. -- As noted above, that naturally gives a 75% scaling when the -- picture size and box size are the same. We remove that for this -- information. (Note: The smaller the scaling the better.) Ada.Text_IO.Put_Line ("Word 2003 scaling: Width=" & Natural'Image(Natural(Float(Width) / Float(Picture_Width) * 100.0 / 0.75)) & " Height=" & Natural'Image(Natural(Float(Height) / Float(Picture_Height) * 100.0 / 0.75))); end; -- Wrap the picture in a shape, so we can set the properties: Ada.Text_IO.Put (Output_Object.Output_File, "{\shp{\*\shpinst"); -- Start a shape. Ada.Text_IO.Put (Output_Object.Output_File, "\shpleft0\shptop0"); -- Left and top are the origin. Ada.Text_IO.Put (Output_Object.Output_File, "\shpright" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Right edge in twips. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\shpbottom" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Bottom edge in twips. Ada.Text_IO.Put (Output_Object.Output_File, "\shpfhdr0"); -- Shape is in the main document. Ada.Text_IO.Put (Output_Object.Output_File, "\shpbxcolumn"); -- Shape is positioned relative to the column. Ada.Text_IO.Put (Output_Object.Output_File, "\shpbxignore"); -- But use posrelh instead (column is the default). Ada.Text_IO.Put (Output_Object.Output_File, "\shpbypara"); -- Shape is positioned relative to the paragraph. Ada.Text_IO.Put (Output_Object.Output_File, "\shpbyignore"); -- But use posrelv instead (paragraph is the default). case Alignment is when ARM_Output.Inline => Ada.Text_IO.Put (Output_Object.Output_File, "\shpwr2\shpwrk0"); -- Wrap text around shape (rectangle), on both sides. when ARM_Output.Float_Left => Ada.Text_IO.Put (Output_Object.Output_File, "\shpwr2\shpwrk2"); -- Wrap text around shape (rectangle), on right only. when ARM_Output.Float_Right => Ada.Text_IO.Put (Output_Object.Output_File, "\shpwr2\shpwrk1"); -- Wrap text around shape (rectangle), on left only. when ARM_Output.Alone_Left | ARM_Output.Alone_Center | ARM_Output.Alone_Right => Ada.Text_IO.Put (Output_Object.Output_File, "\shpwr1"); -- Don't allow text alongside shape. end case; Ada.Text_IO.Put (Output_Object.Output_File, "\shpfblwtxt0"); -- Text is below shape. Ada.Text_IO.Put (Output_Object.Output_File, "\shpz0"); -- Z-order for shape (these don't overlap, I hope). Output_Object.Last_Shape_Id := Output_Object.Last_Shape_Id + 1; -- These need to be unique, but the value doesn't matter much. Ada.Text_IO.Put (Output_Object.Output_File, "\shplid" & Format_Twips(Output_Object.Last_Shape_Id)); Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn shapeType}{\sv 75}}"); -- "Picture frame" type. Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}"); -- No flipping. Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\sp{\sn pib}{\sv {\pict"); -- Start the picture data Ada.Text_IO.Put (Output_Object.Output_File, "\picscalex" & Format_Twips(Picture_Scaling)); -- X scaling (%). Ada.Text_IO.Put (Output_Object.Output_File, "\picscaley" & Format_Twips(Picture_Scaling)); -- Y scaling (%). Ada.Text_IO.Put (Output_Object.Output_File, "\piccropl0"); -- Left crop (twips) [Should be zero]. Ada.Text_IO.Put (Output_Object.Output_File, "\piccropr0"); -- Right crop (twips) [Should be zero]. Ada.Text_IO.Put (Output_Object.Output_File, "\piccropt0"); -- Top crop (twips) [Should be zero]. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\piccropb0"); -- Bottom crop (twips) [Should be zero]. Ada.Text_IO.Put (Output_Object.Output_File, "\picw" & Format_Twips(Natural(Picture_Width) * 5)); -- Raw picture width in ??? (doesn't seem to be used). Ada.Text_IO.Put (Output_Object.Output_File, "\pich" & Format_Twips(Natural(Picture_Height) * 5)); -- Raw picture height in ??? (doesn't seem to be used). Ada.Text_IO.Put (Output_Object.Output_File, "\picwgoal" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Picture width goal in twips. Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pichgoal" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Picture height goal in twips. -- Figure out file type, using the correct type here: if Picture_Kind = PNG then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pngblip"); -- Specifies that the file is a PNG. elsif Picture_Kind = JPEG then Ada.Text_IO.Put_Line (Output_Object.Output_File, "\jpegblip"); -- Specifies that the file is a JPEG. else null; -- We should have already bombed. end if; -- Should use: -- \bliptagnnn - Picture ID. -- \blipuid XXXX - Picture Unique ID. -- How these are calculated is unclear (it appears to be a hash of -- some kind). So I left these out. Dump_File_in_Hex; Ada.Text_IO.Put (Output_Object.Output_File, "}}}"); -- End the picture data. Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn pibName}{\sv " & Name & "}}"); -- Picture file name Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn pibFlags}{\sv 2}}"); -- No idea, a flag of "2" is not documented. case Border is when ARM_Output.None => Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn fLine}{\sv 0}}"); -- No line here. when ARM_Output.Thin => -- Default lineType of 0, solid. Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn lineWidth}{\sv 9525}}"); -- Line size (single - 0.75pt). Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn fLine}{\sv 1}}"); -- Show line here. when ARM_Output.Thick => Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn lineWidth}{\sv 19050}}"); -- Line size (double - 1.5pt). Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn fLine}{\sv 1}}"); -- Show line here. end case; case Alignment is when ARM_Output.Inline => Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posh}{\sv 1}}"); -- Position to the left. Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posrelh}{\sv 3}}"); -- Position to the character. Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posh}{\sv 2}}"); -- Position to the top. Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posrelh}{\sv 3}}"); -- Position to the line. when ARM_Output.Float_Left => Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posh}{\sv 1}}"); -- Position to the left. Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posrelh}{\sv 2}}"); -- Position to the column. when ARM_Output.Float_Right => Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posh}{\sv 3}}"); -- Position to the right. Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posrelh}{\sv 2}}"); -- Position to the column. when ARM_Output.Alone_Left => Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posh}{\sv 1}}"); -- Position to the left. when ARM_Output.Alone_Center => Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posh}{\sv 2}}"); -- Position to the center. when ARM_Output.Alone_Right => Ada.Text_IO.Put (Output_Object.Output_File, "{\sp{\sn posh}{\sv 3}}"); -- Position to the right. end case; Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\sp{\sn fLayoutInCell}{\sv 0}}"); -- No nested use. -- Here we find {\shprslt followed by metafile junk. Not doing that. ---- Fake Word 95 output (it shouldn't be used, but...): --Ada.Text_IO.Put_Line (Output_Object.Output_File, -- "{\shprslt\par\pard \ql \pvpara\posxr\dxfrtext180\dfrmtxtx180\dfrmtxty0\nowrap\adjustright\ \par}"); Ada.Text_IO.Put_Line (Output_Object.Output_File, "}}"); -- End the shape. Output_Object.Char_Count := 0; -- Original code: -- -- case Alignment is -- when ARM_Output.Inline => -- null; -- when ARM_Output.Float_Left => -- null; --***?? -- when ARM_Output.Float_Right => -- Ada.Text_IO.Put_Line ("** Unimplemented picture formatting: Float Right"); -- when ARM_Output.Alone_Left => -- Ada.Text_IO.Put (Output_Object.Output_File, -- "{\pard\plain\sb" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL) & " "); -- -- Set up a normal left-justified paragraph that is high enough for this picture. -- when ARM_Output.Alone_Center => -- Ada.Text_IO.Put (Output_Object.Output_File, -- "{\pard\plain\qc\sb" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL) & " "); -- -- Set up a normal centered paragraph that is high enough for this picture. -- when ARM_Output.Alone_Right => -- Ada.Text_IO.Put (Output_Object.Output_File, -- "{\pard\plain\qr\sb" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL) & " "); -- -- Set up a normal right-justified paragraph that is high enough for this picture. -- end case; -- -- -- Picture setup: -- Ada.Text_IO.Put_Line (Output_Object.Output_File, -- "{\*\shppict {\pict "); -- Defines a picture (Word 97 and newer). -- -- -- Shape Properties: -- Output_Object.Last_Shape_Id := Output_Object.Last_Shape_Id + 1; -- -- These need to be unique, but what they are doesn't matter much. -- Ada.Text_IO.Put (Output_Object.Output_File, -- "{\*\picprop\shplid" & Format_Twips(Output_Object.Last_Shape_Id)); -- Ada.Text_IO.Put (Output_Object.Output_File, -- "{\sp{\sn shapeType}{\sv 75}}"); -- "Picture frame" type. -- Ada.Text_IO.Put_Line (Output_Object.Output_File, -- "{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}"); -- No flipping. -- Ada.Text_IO.Put (Output_Object.Output_File, -- "{\sp{\sn pibName}{\sv " & Name & "}}"); -- Picture file name -- Ada.Text_IO.Put (Output_Object.Output_File, -- "{\sp{\sn pibFlags}{\sv 2}}"); -- No idea, a flag of "2" is not documented. -- Ada.Text_IO.Put (Output_Object.Output_File, -- "{\sp{\sn fLine}{\sv 0}}"); -- No line here. -- Ada.Text_IO.Put_Line (Output_Object.Output_File, -- "{\sp{\sn fLayoutInCell}{\sv 1}}}"); -- Allow nested use.. -- -- -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\picscalex" & Format_Twips(Picture_Scaling)); -- X scaling (%). -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\picscaley" & Format_Twips(Picture_Scaling)); -- Y scaling (%). -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\piccropl0"); -- Left crop (twips) [Should be zero]. -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\piccropr0"); -- Right crop (twips) [Should be zero]. -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\piccropt0"); -- Top crop (twips) [Should be zero]. -- Ada.Text_IO.Put_Line (Output_Object.Output_File, -- "\piccropb0"); -- Bottom crop (twips) [Should be zero]. -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\picw" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Raw picture width in twips. -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\pich" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Raw picture height in twips. -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\picwgoal" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Picture width goal in twips. -- Ada.Text_IO.Put_Line (Output_Object.Output_File, -- "\pichgoal" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Picture height goal in twips. -- -- case Border is -- when ARM_Output.None => -- null; -- when ARM_Output.Thin => -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\brdrs\brdrw15 "); -- Single thickness border (value is in twips). -- when ARM_Output.Thick => -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\brdrs\brdrw30 "); -- Double thickness border (value is in twips). -- end case; -- -- -- Figure out file type, using the correct type here: -- if Picture_Kind = PNG then -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\pngblip "); -- Specifies that the file is a PNG. -- elsif Picture_Kind = JPEG then -- Ada.Text_IO.Put (Output_Object.Output_File, -- "\jpegblip "); -- Specifies that the file is a JPEG. -- else -- null; -- We should have already bombed. -- end if; -- -- -- Should use: -- -- \bliptagnnn - Picture ID. -- -- \blipuid XXXX - Picture Unique ID. -- -- How these are calculated is unclear (it appears to be a hash of -- -- some kind). So I left these out. -- -- Dump_File_in_Hex; -- -- Ada.Text_IO.Put_Line (Output_Object.Output_File, -- "}}"); -- End the picture. -- Output_Object.Char_Count := 0; -- -- -- This should be followed by: -- -- {\*\nonshppict {\pict - Defines an old format picture. This has -- -- the graphic in metafile format. I have no idea how to convert that; -- -- forget it. -- -- -- An easy but incredibly crappy implementation follows. But this -- -- needs height information in a dedicated paragraph to work at all -- -- (without it, it ends up one line high). If we have the height -- -- information, why bother with this; just generate it correctly. -- -- Then we can be sure that the height and width are specified. -- --Ada.Text_IO.Put_Line (Output_Object.Output_File, -- -- "{\field\fldedit{\*\fldinst { INCLUDEPICTURE "".\" & Name & """ \\* MERGEFORMAT \\d }}{\fldrslt {}}}"); -- --Output_Object.Char_Count := 0; -- -- -- Close anything opened for alignment: -- case Alignment is -- when ARM_Output.Inline => -- null; -- when ARM_Output.Float_Left => -- null; -- when ARM_Output.Float_Right => -- null; -- when ARM_Output.Alone_Left => -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}"); -- when ARM_Output.Alone_Center => -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}"); -- when ARM_Output.Alone_Right => -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}"); -- end case; end Picture; -- Notes: -- "\_" is a non-breaking hyphen. end ARM_RTF;