text,length,is_long_context,metric_val,label_metric ";============================================================== ; WLA-DX banking setup ;============================================================== .memorymap defaultslot 0 slotsize $8000 slot 0 $0000 .endme .rombankmap bankstotal 1 banksize $8000 banks 1 .endro ;============================================================== ; SDSC tag and SMS rom header ;============================================================== .sdsctag 1.10,""Hello World!"",""SMS programming tutorial program (bugfixed)"",""Maxim"" .bank 0 slot 0 .org $0000 ;============================================================== ; Boot section ;============================================================== di ; disable interrupts im 1 ; Interrupt mode 1 jp main ; jump to main program ; jp testTml2 ; jump to main program .org $0066 ;============================================================== ; Pause button handler ;============================================================== ; Do nothing retn .org $0100 writeText: jp writeTextImpl .org $0200 testTml2: .incbin ""test.com"" ;============================================================== ; Main program ;============================================================== main: ld sp, $dff0 ;============================================================== ; Set up VDP registers ;============================================================== ld hl,VdpData ld b,VdpDataEnd-VdpData ld c,$bf otir ;============================================================== ; Clear VRAM ;============================================================== ; 1. Set VRAM write address to 0 by outputting $4000 ORed with $0000 ld a,$00 out ($bf),a ld a,$40 out ($bf),a ; 2. Output 16KB of zeroes ld bc, $4000 ; Counter for 16KB of VRAM ld a,$00 ; Value to write ClearVRAMLoop: out ($be),a ; Output to VRAM address, which is auto-incremented after each write dec c jp nz,ClearVRAMLoop dec b jp nz,ClearVRAMLoop ;============================================================== ; Load palette ;============================================================== ; 1. Set VRAM write address to CRAM (palette) address 0 (for palette index 0) ; by outputting $c000 ORed with $0000 ld a,$00 out ($bf),a ld a,$c0 out ($bf),a ; 2. Output colour data ld hl,PaletteData ld b,(PaletteDataEnd-PaletteData) ld c,$be otir ;============================================================== ; Load tiles (font) ;============================================================== ; 1. Set VRAM write address to tile index 0 ; by outputting $4000 ORed with $0000 ld a,$00 out ($bf),a ld a,$40 out ($bf),a ; 2. Output tile data ld hl,FontData ; Location of tile data ld bc,FontDataEnd-FontData ; Counter for number of bytes to write WriteTilesLoop: ; Output data byte then three zeroes, because our tile data is 1 bit ; and must be increased to 4 bit ld a,(hl) ; Get data byte out ($be),a ld a,$00 out ($be),a out ($be),a out ($be),a inc hl ; Add one to hl so it points to the next data byte dec c jp nz,WriteTilesLoop dec b jp nz,WriteTilesLoop ; Turn screen on ld a,%11000100 ; |||| |`- Zoomed sprites -> 16x16 pixels ; |||| `-- Doubled sprites -> 2 tiles per sprite, 8x16 ; |||`---- 30 row/240 line mode ; ||`----- 28 row/224 line mode ; |`------ VBlank interrupts ; `------- Enable display out ($bf),a ld a,$81 out ($bf),a jp testTml2 ; Infinite loop to stop program Loop: jp Loop writeTextImpl: ;============================================================== ; Write text to name table ;============================================================== ; 1. Set VRAM write address to name table index 0 ; by outputting $4000 ORed with $3800+0 push iy ld iy,00000H add iy,sp ld a,$00 out ($bf),a ld a,$38|$40 out ($bf),a ; 2. Loop through text data, converting from ASCII ans writing tile indices ; to name table. Stop when a zero byte is found. ; ld hl,Message ld l,(iy+004H) ld h,(iy+005H) ld c, (hl) ; Get size inc hl WriteTextLoop: ld a, c ; Get remaining byte count or a ; Is it zero? jp z,EndWriteTextLoop ; If so, exit loop dec c ld a,(hl) ; Get data byte ; cp $00 ; Is it zero? ; jp z,EndWriteTextLoop ; If so, exit loop sub $20 ; In ASCII, space=$20 and the rest follow on. We want space=$00 so we subtract $20. out ($be),a ld a,$00 out ($be),a inc hl ; Point to next letter jp WriteTextLoop EndWriteTextLoop: pop iy ret ;============================================================== ; Data ;============================================================== PaletteData: .db $00,$3f ; Black, White PaletteDataEnd: ; VDP initialisation data VdpData: .db $04,$80,$84,$81,$ff,$82,$ff,$85,$ff,$86,$ff,$87,$00,$88,$00,$89,$ff,$8a VdpDataEnd: FontData: ; This font data was provided by Mike G and is reproduced here in its entirety: ;------------------------------------------ ; In loving memory of Acorn Computers Ltd. ; Mike G proudly presents the: ; ; BBC Micro Character Set! ; ======================== ; ; This source was created automatically ; from character data stored in the BBC ; Microcomputer operating system ROM. ; ; The BBC set is a nice, clear font which ; (unlike the classic Namco/Sega font) ; includes lower-case letters as well as ; upper-case. ; ; Being a British micro, there's even a ; Pound Sterling currency symbol, which ; should come in handy when I begin to ; write financial apps on the SMS. (Just ; kidding!) ; ; Hopefully by using binary representation ; it will be obvious how the character ; data is stored. ; ;------------------------------------------ ; Character 0x20 (space) .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x21 ! .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x22 "" .DB %01101100 ; Hex 6Ch .DB %01101100 ; Hex 6Ch .DB %01101100 ; Hex 6Ch .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x23 # .DB %00110110 ; Hex 36h .DB %00110110 ; Hex 36h .DB %01111111 ; Hex 7Fh .DB %00110110 ; Hex 36h .DB %01111111 ; Hex 7Fh .DB %00110110 ; Hex 36h .DB %00110110 ; Hex 36h .DB %00000000 ; Hex 00h ; Character 0x24 $ .DB %00001100 ; Hex 0Ch .DB %00111111 ; Hex 3Fh .DB %01101000 ; Hex 68h .DB %00111110 ; Hex 3Eh .DB %00001011 ; Hex 0Bh .DB %01111110 ; Hex 7Eh .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x25 % .DB %01100000 ; Hex 60h .DB %01100110 ; Hex 66h .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %01100110 ; Hex 66h .DB %00000110 ; Hex 06h .DB %00000000 ; Hex 00h ; Character 0x26 & .DB %00111000 ; Hex 38h .DB %01101100 ; Hex 6Ch .DB %01101100 ; Hex 6Ch .DB %00111000 ; Hex 38h .DB %01101101 ; Hex 6Dh .DB %01100110 ; Hex 66h .DB %00111011 ; Hex 3Bh .DB %00000000 ; Hex 00h ; Character 0x27 ' .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x28 ( .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %00011000 ; Hex 18h .DB %00001100 ; Hex 0Ch .DB %00000000 ; Hex 00h ; Character 0x29 ) .DB %00110000 ; Hex 30h .DB %00011000 ; Hex 18h .DB %00001100 ; Hex 0Ch .DB %00001100 ; Hex 0Ch .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %00000000 ; Hex 00h ; Character 0x2A * .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %01111110 ; Hex 7Eh .DB %00111100 ; Hex 3Ch .DB %01111110 ; Hex 7Eh .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x2B + .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %01111110 ; Hex 7Eh .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x2C , .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h ; Character 0x2D - .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x2E . .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x2F / .DB %00000000 ; Hex 00h .DB %00000110 ; Hex 06h .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %01100000 ; Hex 60h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x30 0 .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01101110 ; Hex 6Eh .DB %01111110 ; Hex 7Eh .DB %01110110 ; Hex 76h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x31 1 .DB %00011000 ; Hex 18h .DB %00111000 ; Hex 38h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h ; Character 0x32 2 .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %00000110 ; Hex 06h .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h ; Character 0x33 3 .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %00000110 ; Hex 06h .DB %00011100 ; Hex 1Ch .DB %00000110 ; Hex 06h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x34 4 .DB %00001100 ; Hex 0Ch .DB %00011100 ; Hex 1Ch .DB %00111100 ; Hex 3Ch .DB %01101100 ; Hex 6Ch .DB %01111110 ; Hex 7Eh .DB %00001100 ; Hex 0Ch .DB %00001100 ; Hex 0Ch .DB %00000000 ; Hex 00h ; Character 0x35 5 .DB %01111110 ; Hex 7Eh .DB %01100000 ; Hex 60h .DB %01111100 ; Hex 7Ch .DB %00000110 ; Hex 06h .DB %00000110 ; Hex 06h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x36 6 .DB %00011100 ; Hex 1Ch .DB %00110000 ; Hex 30h .DB %01100000 ; Hex 60h .DB %01111100 ; Hex 7Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x37 7 .DB %01111110 ; Hex 7Eh .DB %00000110 ; Hex 06h .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %00000000 ; Hex 00h ; Character 0x38 8 .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x39 9 .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111110 ; Hex 3Eh .DB %00000110 ; Hex 06h .DB %00001100 ; Hex 0Ch .DB %00111000 ; Hex 38h .DB %00000000 ; Hex 00h ; Character 0x3A : .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x3B ; .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h ; Character 0x3C < .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %01100000 ; Hex 60h .DB %00110000 ; Hex 30h .DB %00011000 ; Hex 18h .DB %00001100 ; Hex 0Ch .DB %00000000 ; Hex 00h ; Character 0x3D = .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x3E > .DB %00110000 ; Hex 30h .DB %00011000 ; Hex 18h .DB %00001100 ; Hex 0Ch .DB %00000110 ; Hex 06h .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %00000000 ; Hex 00h ; Character 0x3F ? .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x40 @ .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01101110 ; Hex 6Eh .DB %01101010 ; Hex 6Ah .DB %01101110 ; Hex 6Eh .DB %01100000 ; Hex 60h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x41 A .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01111110 ; Hex 7Eh .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x42 B .DB %01111100 ; Hex 7Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01111100 ; Hex 7Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01111100 ; Hex 7Ch .DB %00000000 ; Hex 00h ; Character 0x43 C .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x44 D .DB %01111000 ; Hex 78h .DB %01101100 ; Hex 6Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01101100 ; Hex 6Ch .DB %01111000 ; Hex 78h .DB %00000000 ; Hex 00h ; Character 0x45 E .DB %01111110 ; Hex 7Eh .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01111100 ; Hex 7Ch .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h ; Character 0x46 F .DB %01111110 ; Hex 7Eh .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01111100 ; Hex 7Ch .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %00000000 ; Hex 00h ; Character 0x47 G .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100000 ; Hex 60h .DB %01101110 ; Hex 6Eh .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x48 H .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01111110 ; Hex 7Eh .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x49 I .DB %01111110 ; Hex 7Eh .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h ; Character 0x4A J .DB %00111110 ; Hex 3Eh .DB %00001100 ; Hex 0Ch .DB %00001100 ; Hex 0Ch .DB %00001100 ; Hex 0Ch .DB %00001100 ; Hex 0Ch .DB %01101100 ; Hex 6Ch .DB %00111000 ; Hex 38h .DB %00000000 ; Hex 00h ; Character 0x4B K .DB %01100110 ; Hex 66h .DB %01101100 ; Hex 6Ch .DB %01111000 ; Hex 78h .DB %01110000 ; Hex 70h .DB %01111000 ; Hex 78h .DB %01101100 ; Hex 6Ch .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x4C L .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h ; Character 0x4D M .DB %01100011 ; Hex 63h .DB %01110111 ; Hex 77h .DB %01111111 ; Hex 7Fh .DB %01101011 ; Hex 6Bh .DB %01101011 ; Hex 6Bh .DB %01100011 ; Hex 63h .DB %01100011 ; Hex 63h .DB %00000000 ; Hex 00h ; Character 0x4E N .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01110110 ; Hex 76h .DB %01111110 ; Hex 7Eh .DB %01101110 ; Hex 6Eh .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x4F O .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x50 P .DB %01111100 ; Hex 7Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01111100 ; Hex 7Ch .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %00000000 ; Hex 00h ; Character 0x51 Q .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01101010 ; Hex 6Ah .DB %01101100 ; Hex 6Ch .DB %00110110 ; Hex 36h .DB %00000000 ; Hex 00h ; Character 0x52 R .DB %01111100 ; Hex 7Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01111100 ; Hex 7Ch .DB %01101100 ; Hex 6Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x53 S .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100000 ; Hex 60h .DB %00111100 ; Hex 3Ch .DB %00000110 ; Hex 06h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x54 T .DB %01111110 ; Hex 7Eh .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x55 U .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x56 V .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x57 W .DB %01100011 ; Hex 63h .DB %01100011 ; Hex 63h .DB %01101011 ; Hex 6Bh .DB %01101011 ; Hex 6Bh .DB %01111111 ; Hex 7Fh .DB %01110111 ; Hex 77h .DB %01100011 ; Hex 63h .DB %00000000 ; Hex 00h ; Character 0x58 X .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00011000 ; Hex 18h .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x59 Y .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x5A Z .DB %01111110 ; Hex 7Eh .DB %00000110 ; Hex 06h .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %01100000 ; Hex 60h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h ; Character 0x5B [ .DB %01111100 ; Hex 7Ch .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01111100 ; Hex 7Ch .DB %00000000 ; Hex 00h ; Character 0x5C \\ .DB %00000000 ; Hex 00h .DB %01100000 ; Hex 60h .DB %00110000 ; Hex 30h .DB %00011000 ; Hex 18h .DB %00001100 ; Hex 0Ch .DB %00000110 ; Hex 06h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x5D ] .DB %00111110 ; Hex 3Eh .DB %00000110 ; Hex 06h .DB %00000110 ; Hex 06h .DB %00000110 ; Hex 06h .DB %00000110 ; Hex 06h .DB %00000110 ; Hex 06h .DB %00111110 ; Hex 3Eh .DB %00000000 ; Hex 00h ; Character 0x5E ^ .DB %00011000 ; Hex 18h .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01000010 ; Hex 42h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x5F (underscore) .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %11111111 ; Hex FFh ; Character 0x60 (Pound Sterling) .DB %00011100 ; Hex 1Ch .DB %00110110 ; Hex 36h .DB %00110000 ; Hex 30h .DB %01111100 ; Hex 7Ch .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h ; Character 0x61 a .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00111100 ; Hex 3Ch .DB %00000110 ; Hex 06h .DB %00111110 ; Hex 3Eh .DB %01100110 ; Hex 66h .DB %00111110 ; Hex 3Eh .DB %00000000 ; Hex 00h ; Character 0x62 b .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01111100 ; Hex 7Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01111100 ; Hex 7Ch .DB %00000000 ; Hex 00h ; Character 0x63 c .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100000 ; Hex 60h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x64 d .DB %00000110 ; Hex 06h .DB %00000110 ; Hex 06h .DB %00111110 ; Hex 3Eh .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111110 ; Hex 3Eh .DB %00000000 ; Hex 00h ; Character 0x65 e .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01111110 ; Hex 7Eh .DB %01100000 ; Hex 60h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x66 f .DB %00011100 ; Hex 1Ch .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %01111100 ; Hex 7Ch .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %00000000 ; Hex 00h ; Character 0x67 g .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00111110 ; Hex 3Eh .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111110 ; Hex 3Eh .DB %00000110 ; Hex 06h .DB %00111100 ; Hex 3Ch ; Character 0x68 h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01111100 ; Hex 7Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x69 i .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h .DB %00111000 ; Hex 38h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x6A j .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h .DB %00111000 ; Hex 38h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %01110000 ; Hex 70h ; Character 0x6B k .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100110 ; Hex 66h .DB %01101100 ; Hex 6Ch .DB %01111000 ; Hex 78h .DB %01101100 ; Hex 6Ch .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x6C l .DB %00111000 ; Hex 38h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x6D m .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00110110 ; Hex 36h .DB %01111111 ; Hex 7Fh .DB %01101011 ; Hex 6Bh .DB %01101011 ; Hex 6Bh .DB %01100011 ; Hex 63h .DB %00000000 ; Hex 00h ; Character 0x6E n .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01111100 ; Hex 7Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x6F o .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00000000 ; Hex 00h ; Character 0x70 p .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01111100 ; Hex 7Ch .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01111100 ; Hex 7Ch .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h ; Character 0x71 q .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00111110 ; Hex 3Eh .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111110 ; Hex 3Eh .DB %00000110 ; Hex 06h .DB %00000111 ; Hex 07h ; Character 0x72 r .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01101100 ; Hex 6Ch .DB %01110110 ; Hex 76h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %01100000 ; Hex 60h .DB %00000000 ; Hex 00h ; Character 0x73 s .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00111110 ; Hex 3Eh .DB %01100000 ; Hex 60h .DB %00111100 ; Hex 3Ch .DB %00000110 ; Hex 06h .DB %01111100 ; Hex 7Ch .DB %00000000 ; Hex 00h ; Character 0x74 t .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %01111100 ; Hex 7Ch .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %00110000 ; Hex 30h .DB %00011100 ; Hex 1Ch .DB %00000000 ; Hex 00h ; Character 0x75 u .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111110 ; Hex 3Eh .DB %00000000 ; Hex 00h ; Character 0x76 v .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x77 w .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01100011 ; Hex 63h .DB %01101011 ; Hex 6Bh .DB %01101011 ; Hex 6Bh .DB %01111111 ; Hex 7Fh .DB %00110110 ; Hex 36h .DB %00000000 ; Hex 00h ; Character 0x78 x .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01100110 ; Hex 66h .DB %00111100 ; Hex 3Ch .DB %00011000 ; Hex 18h .DB %00111100 ; Hex 3Ch .DB %01100110 ; Hex 66h .DB %00000000 ; Hex 00h ; Character 0x79 y .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %01100110 ; Hex 66h .DB %00111110 ; Hex 3Eh .DB %00000110 ; Hex 06h .DB %00111100 ; Hex 3Ch ; Character 0x7A z .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %01111110 ; Hex 7Eh .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %01111110 ; Hex 7Eh .DB %00000000 ; Hex 00h ; Character 0x7B { .DB %00001100 ; Hex 0Ch .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %01110000 ; Hex 70h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00001100 ; Hex 0Ch .DB %00000000 ; Hex 00h ; Character 0x7C (OR symbol) .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00000000 ; Hex 00h ; Character 0x7D } .DB %00110000 ; Hex 30h .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00001110 ; Hex 0Eh .DB %00011000 ; Hex 18h .DB %00011000 ; Hex 18h .DB %00110000 ; Hex 30h .DB %00000000 ; Hex 00h ; Character 0x7E ~ .DB %00110001 ; Hex 31h .DB %01101011 ; Hex 6Bh .DB %01000110 ; Hex 46h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h .DB %00000000 ; Hex 00h ; Character 0x7F (block) .DB %11111111 ; Hex FFh .DB %11111111 ; Hex FFh .DB %11111111 ; Hex FFh .DB %11111111 ; Hex FFh .DB %11111111 ; Hex FFh .DB %11111111 ; Hex FFh .DB %11111111 ; Hex FFh .DB %11111111 ; Hex FFh ;------------------------------------------ ; ; That's all folks! Now that Acorn is no ; longer with us (RIP), it should be safe ; to use this font in any homebrew ; projects. ; ; Anyone is welcome to distribute and use ; this source file for whatever purpose ; they wish. ; ; ; Best wishes, ; ; Mike G. (mike@mikeg2.freeserve.co.uk) ; ; 4th March 2001 ; ; SMS Power! - www.smspower.org ; SMSReader - www.smspower.org/smsreader/ ; ; My Home Page: www.mikeg2.freeserve.co.uk ; ;------------------------------------------ ; End of Mike G's font. FontDataEnd: ",16337,True,5280.60598356192,median "/* * The MIT License (MIT) * * Copyright (c) 2014 by Bart Kiers * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the ""Software""), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Project : python3-parser; an ANTLR4 grammar for Python 3 * https://github.com/bkiers/python3-parser * Developed by : Bart Kiers, bart@big-o.nl */ grammar Python3; // All comments that start with ""///"" are copy-pasted from // The Python Language Reference tokens { INDENT, DEDENT } @header { package io.github.danielnaczo.python3parser; } @lexer::members { // A queue where extra tokens are pushed on (see the NEWLINE lexer rule). private java.util.LinkedList tokens = new java.util.LinkedList<>(); // The stack that keeps track of the indentation level. private java.util.Stack indents = new java.util.Stack<>(); // The amount of opened braces, brackets and parenthesis. private int opened = 0; // The most recently produced token. private Token lastToken = null; @Override public void emit(Token t) { super.setToken(t); tokens.offer(t); } @Override public Token nextToken() { // Check if the end-of-file is ahead and there are still some DEDENTS expected. if (_input.LA(1) == EOF && !this.indents.isEmpty()) { // Remove any trailing EOF tokens from our buffer. for (int i = tokens.size() - 1; i >= 0; i--) { if (tokens.get(i).getType() == EOF) { tokens.remove(i); } } // First emit an extra line break that serves as the end of the statement. this.emit(commonToken(Python3Parser.NEWLINE, ""\\n"")); // Now emit as much DEDENT tokens as needed. while (!indents.isEmpty()) { this.emit(createDedent()); indents.pop(); } // Put the EOF back on the token stream. this.emit(commonToken(Python3Parser.EOF, """")); } Token next = super.nextToken(); if (next.getChannel() == Token.DEFAULT_CHANNEL) { // Keep track of the last token on the default channel. this.lastToken = next; } return tokens.isEmpty() ? next : tokens.poll(); } private Token createDedent() { CommonToken dedent = commonToken(Python3Parser.DEDENT, """"); dedent.setLine(this.lastToken.getLine()); return dedent; } private CommonToken commonToken(int type, String text) { int stop = this.getCharIndex() - 1; int start = text.isEmpty() ? stop : stop - text.length() + 1; return new CommonToken(this._tokenFactorySourcePair, type, DEFAULT_TOKEN_CHANNEL, start, stop); } // Calculates the indentation of the provided spaces, taking the // following rules into account: // // ""Tabs are replaced (from left to right) by one to eight spaces // such that the total number of characters up to and including // the replacement is a multiple of eight [...]"" // // -- https://docs.python.org/3.1/reference/lexical_analysis.html#indentation static int getIndentationCount(String spaces) { int count = 0; for (char ch : spaces.toCharArray()) { switch (ch) { case '\\t': count += 8 - (count % 8); break; default: // A normal space char. count++; } } return count; } boolean atStartOfInput() { return super.getCharPositionInLine() == 0 && super.getLine() == 1; } } /* * parser rules */ single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE; file_input: (NEWLINE | stmt)* EOF; eval_input: testlist NEWLINE* EOF; decorator: '@' dotted_name ( '(' (arglist)? ')' )? NEWLINE; funcdef: decorator* ASYNC? 'def' NAME parameters ('->' test)? ':' suite; parameters: '(' (typedargslist)? ')'; // CASE 1 CASE 2 CASE 3 typedargslist: completeArgs | justKeywordsArgs | kwOnlyListArgs; tfpdef: NAME (':' test)?; normalOrDefaultTfpDef: tfpdef | defaultTfpdef; defaultTfpdef: tfpdef '=' test; // CASE 1 // a or a=1 a or a=1 completeArgs: (tfpdef | defaultTfpdef) (',' normalOrDefaultTfpDef)* (afterPositionalArgs)? ; // * or *c d or d=4 **e afterPositionalArgs: ',' (positionalList (',' normalOrDefaultTfpDef)* kwlistArgs1 )?; // * or *list positionalList: '*' (tfpdef)?; // **d just ',' is diff **d kwlistArgs1: (',' ('**' tfpdef (',')?)?)? | '**' tfpdef (',')?; // CASE 2 // * or *c d or e=4 justKeywordsArgs: positionalList (',' normalOrDefaultTfpDef)* (kwlistArgs2)?; // **d kwlistArgs2: ',' ('**' tfpdef (',')?)?; // CASE 3 // **d kwOnlyListArgs: '**' tfpdef (',')?; // CASE 1 CASE 2 CASE 3 varargslist: varCompleteArgs | varJustKeywordsArgs | varKwOnlyListArgs; vfpdef: NAME; varNormalOrDefaultTfpDef: vfpdef | varDefaultVfpdef; varDefaultVfpdef: vfpdef '=' test; // CASE 1 // a or a=1 a or a=1 varCompleteArgs: (vfpdef | varDefaultVfpdef) (',' varNormalOrDefaultTfpDef)* (varAfterPositionalArgs)? ; // * or *c d or d=4 **e varAfterPositionalArgs: ',' (varPositionalList (',' varNormalOrDefaultTfpDef)* varKwlistArgs1 )?; // * or *list varPositionalList: '*' (vfpdef)?; // **d just ',' is diff **d varKwlistArgs1: (',' ('**' vfpdef (',')?)?)? | '**' vfpdef (',')?; // CASE 2 // * or *c d or e=4 varJustKeywordsArgs: varPositionalList (',' varNormalOrDefaultTfpDef)* (varKwlistArgs2)?; // **d varKwlistArgs2: ',' ('**' vfpdef (',')?)?; // CASE 3 // **d varKwOnlyListArgs: '**' vfpdef (',')?; //STATEMENTS stmt: simple_stmt | compound_stmt; simple_stmt: small_stmt (';' small_stmt)* (';')? NEWLINE; small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt); expr_stmt: testlist_star_expr | expr_stmtIndividualAssign | expr_stmtNormalAssign; expr_stmtIndividualAssign: testlist_star_expr (annassign | augassign (yield_expr|testlist)); expr_stmtNormalAssign: testlist_star_expr '=' expr_NormalAssignList ('=' expr_NormalAssignList)*; expr_NormalAssignList: yield_expr|testlist_star_expr; annassign: ':' test ('=' test)?; testlist_star_expr: testOrStar_expr (',' testOrStarList_expr)* (',')?; testOrStar_expr: test|star_expr; testOrStarList_expr: test|star_expr; augassign: (ADD_ASSIGN | SUB_ASSIGN | MULT_ASSIGN | AT_ASSIGN | DIV_ASSIGN | MOD_ASSIGN | AND_ASSIGN | OR_ASSIGN | XOR_ASSIGN | LEFT_SHIFT_ASSIGN | RIGHT_SHIFT_ASSIGN | POWER_ASSIGN | IDIV_ASSIGN ); del_stmt: 'del' exprlist; pass_stmt: 'pass'; flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt; break_stmt: 'break'; continue_stmt: 'continue'; return_stmt: 'return' (testlist)?; yield_stmt: yield_expr; raise_stmt: 'raise' (test ('from' test)?)?; import_stmt: import_name | import_from; import_name: 'import' dotted_as_names; import_from: ('from' ( (DOT | ELLIPSIS)* dotted_name | (DOT | ELLIPSIS)+ ) 'import' ( STAR | '(' import_as_names ')' | import_as_names) ); import_as_name: NAME ('as' NAME)?; dotted_as_name: dotted_name ('as' NAME)?; import_as_names: import_as_name (',' import_as_name)* (',')?; dotted_as_names: dotted_as_name (',' dotted_as_name)*; dotted_name: NAME ('.' NAME)*; global_stmt: 'global' NAME (',' NAME)*; nonlocal_stmt: 'nonlocal' NAME (',' NAME)*; assert_stmt: 'assert' test (',' test)?; compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | async_stmt; async_stmt: ASYNC (funcdef | with_stmt | for_stmt); if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ('else' ':' suite)?; while_stmt: 'while' test ':' suite ('else' ':' suite)?; for_stmt: 'for' exprlist 'in' testlist ':' suite ('else' ':' suite)?; try_stmt: ('try' ':' suite ( (except_clause ':' suite)+ (ELSE ':' suite)? (FINALLY ':' suite)? | 'finally' ':' suite) ); with_stmt: 'with' with_item (',' with_item)* ':' suite; with_item: test ('as' expr)?; except_clause: 'except' (test ('as' NAME)?)?; suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT; //EXPRESSIONS test: or_test ('if' or_test 'else' test)? | lambdef; test_nocond: or_test | lambdef_nocond; lambdef: 'lambda' (varargslist)? ':' test; lambdef_nocond: 'lambda' (varargslist)? ':' test_nocond; or_test: and_test ('or' and_test)*; and_test: not_test ('and' not_test)*; not_test: 'not' not_test | comparison; comparison: expr (comp_op expr)*; // <> isn't actually a valid comparison operator in Python. It's here for the // sake of a __future__ import described in PEP 401 (which really works :-) comp_op: LESS_THAN | GREATER_THAN | EQUALS | GT_EQ | LT_EQ | NOT_EQ_1 | NOT_EQ_2 | IN | NOT IN | IS | IS NOT; star_expr: '*' expr; expr: xor_expr ('|' xor_expr)*; xor_expr: and_expr ('^' and_expr)*; and_expr: shift_expr ('&' shift_expr)*; shift_expr: arith_expr (shift_op arith_expr)*; shift_op: LEFT_SHIFT | RIGHT_SHIFT; arith_expr: term (arith_op term)*; arith_op: ADD | MINUS; term: factor (term_op factor)*; term_op: STAR | AT | DIV | MOD | IDIV; factor: factor_op factor | power; factor_op: ADD | MINUS | NOT_OP; power: await ('**' factor)?; await: (AWAIT)? atom_expr; atom_expr: '(' test ')' | atom trailer*; atom: ( tuple | list | dictionaryOrSet | NAME | NUMBER | STRING+ | ELLIPSIS | NONE | TRUE | FALSE); trailer: trailerCall | trailerSubscript | trailerName; trailerCall: '(' (arglist)? ')'; // ArgumentsCall trailerSubscript: '[' subscriptlist ']'; // Subscript trailerName: '.' NAME; // Attribute tuple: '(' (testlist_compTuple)? ')'; testlist_compTuple: yield_expr | testOrStar_expr ( (comp_for)* | (',' testOrStarList_expr)* (',')? ); list: '[' (testlist_compList)? ']'; testlist_compList: testOrStar_expr ( (comp_for)* | (',' testOrStarList_expr)* (',')? ); dictionaryOrSet: '{' (dictorsetmaker)? '}'; //syntax for dictionaries and sets dictorsetmaker: ( ( dictFirst ( (comp_for)* | (',' dicts)* (',')? ) ) | ( setFirst ( (comp_for)* | (',' sets)* (',')? ) ) ); dictFirst: test ':' test | '**' expr ; dicts: test ':' test | '**' expr ; setFirst: test | star_expr ; sets: test | star_expr ; subscriptlist: subscript (',' subscript)* (',')?; subscript: subscriptIndex | subscriptSlice; subscriptIndex: test; subscriptSlice: slicelLower ':' sliceUpper (sliceStep)?; slicelLower: (test)?; sliceUpper: (test)?; sliceStep: ':' (test)?; exprlist: exprOrStarExpr (',' exprOrStarExpr)* (',')?; exprOrStarExpr: expr|star_expr; testlist: test (',' test)* (',')?; classdef: decorator* 'class' NAME ('(' (arglist)? ')')? ':' suite; arglist: argument (',' argument)* (',')?; // The reason that keywords are test nodes instead of NAME is that using NAME // results in an ambiguity. ast.c makes sure it's a NAME. // ""test '=' test"" is really ""keyword '=' test"", but we have no such token. // These need to be in a single rule to avoid grammar that is ambiguous // to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, // we explicitly match '*' here, too, to give it proper precedence. // Illegal combinations and orderings are blocked in ast.c: // multiple (test comp_for) arguments are blocked; keyword unpackings // that precede iterable unpackings are blocked; etc. argument: ( argumentNormal | argumentKeyword | argumentStar | argumentDoubleStar ); argumentNormal: test (comp_for)*; argumentKeyword: test '=' test; argumentStar: '*' test; argumentDoubleStar: '**' test; comp_for: (ASYNC)? 'for' exprlist 'in' or_test (comp_if)*; comp_if: 'if' test_nocond; yield_expr: 'yield' (yield_arg)?; yield_arg: 'from' test | testlist; /* * lexer rules */ STRING : STRING_LITERAL | BYTES_LITERAL ; NUMBER : INTEGER | FLOAT_NUMBER | IMAG_NUMBER ; INTEGER : DECIMAL_INTEGER | OCT_INTEGER | HEX_INTEGER | BIN_INTEGER ; DEF : 'def'; RETURN : 'return'; RAISE : 'raise'; FROM : 'from'; IMPORT : 'import'; AS : 'as'; GLOBAL : 'global'; NONLOCAL : 'nonlocal'; ASSERT : 'assert'; IF : 'if'; ELIF : 'elif'; ELSE : 'else'; WHILE : 'while'; FOR : 'for'; IN : 'in'; TRY : 'try'; FINALLY : 'finally'; WITH : 'with'; EXCEPT : 'except'; LAMBDA : 'lambda'; OR : 'or'; AND : 'and'; NOT : 'not'; IS : 'is'; NONE : 'None'; TRUE : 'True'; FALSE : 'False'; CLASS : 'class'; YIELD : 'yield'; DEL : 'del'; PASS : 'pass'; CONTINUE : 'continue'; BREAK : 'break'; ASYNC : 'async'; AWAIT : 'await'; NEWLINE : ( {atStartOfInput()}? SPACES | ( '\\r'? '\\n' | '\\r' | '\\f' ) SPACES? ) { String newLine = getText().replaceAll(""[^\\r\\n\\f]+"", """"); String spaces = getText().replaceAll(""[\\r\\n\\f]+"", """"); int next = _input.LA(1); if (opened > 0 || next == '\\r' || next == '\\n' || next == '\\f' || next == '#') { // If we're inside a list or on a blank line, ignore all indents, // dedents and line breaks. skip(); } else { emit(commonToken(NEWLINE, newLine)); int indent = getIndentationCount(spaces); int previous = indents.isEmpty() ? 0 : indents.peek(); if (indent == previous) { // skip indents of the same size as the present indent-size skip(); } else if (indent > previous) { indents.push(indent); emit(commonToken(Python3Parser.INDENT, spaces)); } else { // Possibly emit more than 1 DEDENT token. while(!indents.isEmpty() && indents.peek() > indent) { this.emit(createDedent()); indents.pop(); } } } } ; /// identifier ::= id_start id_continue* NAME : ID_START ID_CONTINUE* ; /// stringliteral ::= [stringprefix](shortstring | longstring) /// stringprefix ::= ""r"" | ""u"" | ""R"" | ""U"" | ""f"" | ""F"" /// | ""fr"" | ""Fr"" | ""fR"" | ""FR"" | ""rf"" | ""rF"" | ""Rf"" | ""RF"" STRING_LITERAL : ( [rR] | [uU] | [fF] | ( [fF] [rR] ) | ( [rR] [fF] ) )? ( SHORT_STRING | LONG_STRING ) ; /// bytesliteral ::= bytesprefix(shortbytes | longbytes) /// bytesprefix ::= ""b"" | ""B"" | ""br"" | ""Br"" | ""bR"" | ""BR"" | ""rb"" | ""rB"" | ""Rb"" | ""RB"" BYTES_LITERAL : ( [bB] | ( [bB] [rR] ) | ( [rR] [bB] ) ) ( SHORT_BYTES | LONG_BYTES ) ; /// decimalinteger ::= nonzerodigit digit* | ""0""+ DECIMAL_INTEGER : NON_ZERO_DIGIT DIGIT* | '0'+ ; /// octinteger ::= ""0"" (""o"" | ""O"") octdigit+ OCT_INTEGER : '0' [oO] OCT_DIGIT+ ; /// hexinteger ::= ""0"" (""x"" | ""X"") hexdigit+ HEX_INTEGER : '0' [xX] HEX_DIGIT+ ; /// bininteger ::= ""0"" (""b"" | ""B"") bindigit+ BIN_INTEGER : '0' [bB] BIN_DIGIT+ ; /// floatnumber ::= pointfloat | exponentfloat FLOAT_NUMBER : POINT_FLOAT | EXPONENT_FLOAT ; /// imagnumber ::= (floatnumber | intpart) (""j"" | ""J"") IMAG_NUMBER : ( FLOAT_NUMBER | INT_PART ) [jJ] ; DOT : '.'; ELLIPSIS : '...'; STAR : '*'; OPEN_PAREN : '(' {opened++;}; CLOSE_PAREN : ')' {opened--;}; COMMA : ','; COLON : ':'; SEMI_COLON : ';'; POWER : '**'; ASSIGN : '='; OPEN_BRACK : '[' {opened++;}; CLOSE_BRACK : ']' {opened--;}; OR_OP : '|'; XOR : '^'; AND_OP : '&'; LEFT_SHIFT : '<<'; RIGHT_SHIFT : '>>'; ADD : '+'; MINUS : '-'; DIV : '/'; MOD : '%'; IDIV : '//'; NOT_OP : '~'; OPEN_BRACE : '{' {opened++;}; CLOSE_BRACE : '}' {opened--;}; LESS_THAN : '<'; GREATER_THAN : '>'; EQUALS : '=='; GT_EQ : '>='; LT_EQ : '<='; NOT_EQ_1 : '<>'; NOT_EQ_2 : '!='; AT : '@'; ARROW : '->'; ADD_ASSIGN : '+='; SUB_ASSIGN : '-='; MULT_ASSIGN : '*='; AT_ASSIGN : '@='; DIV_ASSIGN : '/='; MOD_ASSIGN : '%='; AND_ASSIGN : '&='; OR_ASSIGN : '|='; XOR_ASSIGN : '^='; LEFT_SHIFT_ASSIGN : '<<='; RIGHT_SHIFT_ASSIGN : '>>='; POWER_ASSIGN : '**='; IDIV_ASSIGN : '//='; SKIP_ : ( SPACES | COMMENT | LINE_JOINING ) -> skip ; UNKNOWN_CHAR : . ; /* * fragments */ /// shortstring ::= ""'"" shortstringitem* ""'"" | '""' shortstringitem* '""' /// shortstringitem ::= shortstringchar | stringescapeseq /// shortstringchar ::= fragment SHORT_STRING : '\\'' ( STRING_ESCAPE_SEQ | ~[\\\\\\r\\n\\f'] )* '\\'' | '""' ( STRING_ESCAPE_SEQ | ~[\\\\\\r\\n\\f""] )* '""' ; /// longstring ::= ""'''"" longstringitem* ""'''"" | '""""""' longstringitem* '""""""' fragment LONG_STRING : '\\'\\'\\'' LONG_STRING_ITEM*? '\\'\\'\\'' | '""""""' LONG_STRING_ITEM*? '""""""' ; /// longstringitem ::= longstringchar | stringescapeseq fragment LONG_STRING_ITEM : LONG_STRING_CHAR | STRING_ESCAPE_SEQ ; /// longstringchar ::= fragment LONG_STRING_CHAR : ~'\\\\' ; /// stringescapeseq ::= ""\\"" fragment STRING_ESCAPE_SEQ : '\\\\' . | '\\\\' NEWLINE ; /// nonzerodigit ::= ""1""...""9"" fragment NON_ZERO_DIGIT : [1-9] ; /// digit ::= ""0""...""9"" fragment DIGIT : [0-9] ; /// octdigit ::= ""0""...""7"" fragment OCT_DIGIT : [0-7] ; /// hexdigit ::= digit | ""a""...""f"" | ""A""...""F"" fragment HEX_DIGIT : [0-9a-fA-F] ; /// bindigit ::= ""0"" | ""1"" fragment BIN_DIGIT : [01] ; /// pointfloat ::= [intpart] fraction | intpart ""."" fragment POINT_FLOAT : INT_PART? FRACTION | INT_PART '.' ; /// exponentfloat ::= (intpart | pointfloat) exponent fragment EXPONENT_FLOAT : ( INT_PART | POINT_FLOAT ) EXPONENT ; /// intpart ::= digit+ fragment INT_PART : DIGIT+ ; /// fraction ::= ""."" digit+ fragment FRACTION : '.' DIGIT+ ; /// exponent ::= (""e"" | ""E"") [""+"" | ""-""] digit+ fragment EXPONENT : [eE] [+-]? DIGIT+ ; /// shortbytes ::= ""'"" shortbytesitem* ""'"" | '""' shortbytesitem* '""' /// shortbytesitem ::= shortbyteschar | bytesescapeseq fragment SHORT_BYTES : '\\'' ( SHORT_BYTES_CHAR_NO_SINGLE_QUOTE | BYTES_ESCAPE_SEQ )* '\\'' | '""' ( SHORT_BYTES_CHAR_NO_DOUBLE_QUOTE | BYTES_ESCAPE_SEQ )* '""' ; /// longbytes ::= ""'''"" longbytesitem* ""'''"" | '""""""' longbytesitem* '""""""' fragment LONG_BYTES : '\\'\\'\\'' LONG_BYTES_ITEM*? '\\'\\'\\'' | '""""""' LONG_BYTES_ITEM*? '""""""' ; /// longbytesitem ::= longbyteschar | bytesescapeseq fragment LONG_BYTES_ITEM : LONG_BYTES_CHAR | BYTES_ESCAPE_SEQ ; /// shortbyteschar ::= fragment SHORT_BYTES_CHAR_NO_SINGLE_QUOTE : [\\u0000-\\u0009] | [\\u000B-\\u000C] | [\\u000E-\\u0026] | [\\u0028-\\u005B] | [\\u005D-\\u007F] ; fragment SHORT_BYTES_CHAR_NO_DOUBLE_QUOTE : [\\u0000-\\u0009] | [\\u000B-\\u000C] | [\\u000E-\\u0021] | [\\u0023-\\u005B] | [\\u005D-\\u007F] ; /// longbyteschar ::= fragment LONG_BYTES_CHAR : [\\u0000-\\u005B] | [\\u005D-\\u007F] ; /// bytesescapeseq ::= ""\\"" fragment BYTES_ESCAPE_SEQ : '\\\\' [\\u0000-\\u007F] ; fragment SPACES : [ \\t]+ ; fragment COMMENT : '#' ~[\\r\\n\\f]* ; fragment LINE_JOINING : '\\\\' SPACES? ( '\\r'? '\\n' | '\\r' | '\\f') ; /// id_start ::= fragment ID_START : '_' | [A-Z] | [a-z] | '\\u00AA' | '\\u00B5' | '\\u00BA' | [\\u00C0-\\u00D6] | [\\u00D8-\\u00F6] | [\\u00F8-\\u01BA] | '\\u01BB' | [\\u01BC-\\u01BF] | [\\u01C0-\\u01C3] | [\\u01C4-\\u0241] | [\\u0250-\\u02AF] | [\\u02B0-\\u02C1] | [\\u02C6-\\u02D1] | [\\u02E0-\\u02E4] | '\\u02EE' | '\\u037A' | '\\u0386' | [\\u0388-\\u038A] | '\\u038C' | [\\u038E-\\u03A1] | [\\u03A3-\\u03CE] | [\\u03D0-\\u03F5] | [\\u03F7-\\u0481] | [\\u048A-\\u04CE] | [\\u04D0-\\u04F9] | [\\u0500-\\u050F] | [\\u0531-\\u0556] | '\\u0559' | [\\u0561-\\u0587] | [\\u05D0-\\u05EA] | [\\u05F0-\\u05F2] | [\\u0621-\\u063A] | '\\u0640' | [\\u0641-\\u064A] | [\\u066E-\\u066F] | [\\u0671-\\u06D3] | '\\u06D5' | [\\u06E5-\\u06E6] | [\\u06EE-\\u06EF] | [\\u06FA-\\u06FC] | '\\u06FF' | '\\u0710' | [\\u0712-\\u072F] | [\\u074D-\\u076D] | [\\u0780-\\u07A5] | '\\u07B1' | [\\u0904-\\u0939] | '\\u093D' | '\\u0950' | [\\u0958-\\u0961] | '\\u097D' | [\\u0985-\\u098C] | [\\u098F-\\u0990] | [\\u0993-\\u09A8] | [\\u09AA-\\u09B0] | '\\u09B2' | [\\u09B6-\\u09B9] | '\\u09BD' | '\\u09CE' | [\\u09DC-\\u09DD] | [\\u09DF-\\u09E1] | [\\u09F0-\\u09F1] | [\\u0A05-\\u0A0A] | [\\u0A0F-\\u0A10] | [\\u0A13-\\u0A28] | [\\u0A2A-\\u0A30] | [\\u0A32-\\u0A33] | [\\u0A35-\\u0A36] | [\\u0A38-\\u0A39] | [\\u0A59-\\u0A5C] | '\\u0A5E' | [\\u0A72-\\u0A74] | [\\u0A85-\\u0A8D] | [\\u0A8F-\\u0A91] | [\\u0A93-\\u0AA8] | [\\u0AAA-\\u0AB0] | [\\u0AB2-\\u0AB3] | [\\u0AB5-\\u0AB9] | '\\u0ABD' | '\\u0AD0' | [\\u0AE0-\\u0AE1] | [\\u0B05-\\u0B0C] | [\\u0B0F-\\u0B10] | [\\u0B13-\\u0B28] | [\\u0B2A-\\u0B30] | [\\u0B32-\\u0B33] | [\\u0B35-\\u0B39] | '\\u0B3D' | [\\u0B5C-\\u0B5D] | [\\u0B5F-\\u0B61] | '\\u0B71' | '\\u0B83' | [\\u0B85-\\u0B8A] | [\\u0B8E-\\u0B90] | [\\u0B92-\\u0B95] | [\\u0B99-\\u0B9A] | '\\u0B9C' | [\\u0B9E-\\u0B9F] | [\\u0BA3-\\u0BA4] | [\\u0BA8-\\u0BAA] | [\\u0BAE-\\u0BB9] | [\\u0C05-\\u0C0C] | [\\u0C0E-\\u0C10] | [\\u0C12-\\u0C28] | [\\u0C2A-\\u0C33] | [\\u0C35-\\u0C39] | [\\u0C60-\\u0C61] | [\\u0C85-\\u0C8C] | [\\u0C8E-\\u0C90] | [\\u0C92-\\u0CA8] | [\\u0CAA-\\u0CB3] | [\\u0CB5-\\u0CB9] | '\\u0CBD' | '\\u0CDE' | [\\u0CE0-\\u0CE1] | [\\u0D05-\\u0D0C] | [\\u0D0E-\\u0D10] | [\\u0D12-\\u0D28] | [\\u0D2A-\\u0D39] | [\\u0D60-\\u0D61] | [\\u0D85-\\u0D96] | [\\u0D9A-\\u0DB1] | [\\u0DB3-\\u0DBB] | '\\u0DBD' | [\\u0DC0-\\u0DC6] | [\\u0E01-\\u0E30] | [\\u0E32-\\u0E33] | [\\u0E40-\\u0E45] | '\\u0E46' | [\\u0E81-\\u0E82] | '\\u0E84' | [\\u0E87-\\u0E88] | '\\u0E8A' | '\\u0E8D' | [\\u0E94-\\u0E97] | [\\u0E99-\\u0E9F] | [\\u0EA1-\\u0EA3] | '\\u0EA5' | '\\u0EA7' | [\\u0EAA-\\u0EAB] | [\\u0EAD-\\u0EB0] | [\\u0EB2-\\u0EB3] | '\\u0EBD' | [\\u0EC0-\\u0EC4] | '\\u0EC6' | [\\u0EDC-\\u0EDD] | '\\u0F00' | [\\u0F40-\\u0F47] | [\\u0F49-\\u0F6A] | [\\u0F88-\\u0F8B] | [\\u1000-\\u1021] | [\\u1023-\\u1027] | [\\u1029-\\u102A] | [\\u1050-\\u1055] | [\\u10A0-\\u10C5] | [\\u10D0-\\u10FA] | '\\u10FC' | [\\u1100-\\u1159] | [\\u115F-\\u11A2] | [\\u11A8-\\u11F9] | [\\u1200-\\u1248] | [\\u124A-\\u124D] | [\\u1250-\\u1256] | '\\u1258' | [\\u125A-\\u125D] | [\\u1260-\\u1288] | [\\u128A-\\u128D] | [\\u1290-\\u12B0] | [\\u12B2-\\u12B5] | [\\u12B8-\\u12BE] | '\\u12C0' | [\\u12C2-\\u12C5] | [\\u12C8-\\u12D6] | [\\u12D8-\\u1310] | [\\u1312-\\u1315] | [\\u1318-\\u135A] | [\\u1380-\\u138F] | [\\u13A0-\\u13F4] | [\\u1401-\\u166C] | [\\u166F-\\u1676] | [\\u1681-\\u169A] | [\\u16A0-\\u16EA] | [\\u16EE-\\u16F0] | [\\u1700-\\u170C] | [\\u170E-\\u1711] | [\\u1720-\\u1731] | [\\u1740-\\u1751] | [\\u1760-\\u176C] | [\\u176E-\\u1770] | [\\u1780-\\u17B3] | '\\u17D7' | '\\u17DC' | [\\u1820-\\u1842] | '\\u1843' | [\\u1844-\\u1877] | [\\u1880-\\u18A8] | [\\u1900-\\u191C] | [\\u1950-\\u196D] | [\\u1970-\\u1974] | [\\u1980-\\u19A9] | [\\u19C1-\\u19C7] | [\\u1A00-\\u1A16] | [\\u1D00-\\u1D2B] | [\\u1D2C-\\u1D61] | [\\u1D62-\\u1D77] | '\\u1D78' | [\\u1D79-\\u1D9A] | [\\u1D9B-\\u1DBF] | [\\u1E00-\\u1E9B] | [\\u1EA0-\\u1EF9] | [\\u1F00-\\u1F15] | [\\u1F18-\\u1F1D] | [\\u1F20-\\u1F45] | [\\u1F48-\\u1F4D] | [\\u1F50-\\u1F57] | '\\u1F59' | '\\u1F5B' | '\\u1F5D' | [\\u1F5F-\\u1F7D] | [\\u1F80-\\u1FB4] | [\\u1FB6-\\u1FBC] | '\\u1FBE' | [\\u1FC2-\\u1FC4] | [\\u1FC6-\\u1FCC] | [\\u1FD0-\\u1FD3] | [\\u1FD6-\\u1FDB] | [\\u1FE0-\\u1FEC] | [\\u1FF2-\\u1FF4] | [\\u1FF6-\\u1FFC] | '\\u2071' | '\\u207F' | [\\u2090-\\u2094] | '\\u2102' | '\\u2107' | [\\u210A-\\u2113] | '\\u2115' | '\\u2118' | [\\u2119-\\u211D] | '\\u2124' | '\\u2126' | '\\u2128' | [\\u212A-\\u212D] | '\\u212E' | [\\u212F-\\u2131] | [\\u2133-\\u2134] | [\\u2135-\\u2138] | '\\u2139' | [\\u213C-\\u213F] | [\\u2145-\\u2149] | [\\u2160-\\u2183] | [\\u2C00-\\u2C2E] | [\\u2C30-\\u2C5E] | [\\u2C80-\\u2CE4] | [\\u2D00-\\u2D25] | [\\u2D30-\\u2D65] | '\\u2D6F' | [\\u2D80-\\u2D96] | [\\u2DA0-\\u2DA6] | [\\u2DA8-\\u2DAE] | [\\u2DB0-\\u2DB6] | [\\u2DB8-\\u2DBE] | [\\u2DC0-\\u2DC6] | [\\u2DC8-\\u2DCE] | [\\u2DD0-\\u2DD6] | [\\u2DD8-\\u2DDE] | '\\u3005' | '\\u3006' | '\\u3007' | [\\u3021-\\u3029] | [\\u3031-\\u3035] | [\\u3038-\\u303A] | '\\u303B' | '\\u303C' | [\\u3041-\\u3096] | [\\u309B-\\u309C] | [\\u309D-\\u309E] | '\\u309F' | [\\u30A1-\\u30FA] | [\\u30FC-\\u30FE] | '\\u30FF' | [\\u3105-\\u312C] | [\\u3131-\\u318E] | [\\u31A0-\\u31B7] | [\\u31F0-\\u31FF] | [\\u3400-\\u4DB5] | [\\u4E00-\\u9FBB] | [\\uA000-\\uA014] | '\\uA015' | [\\uA016-\\uA48C] | [\\uA800-\\uA801] | [\\uA803-\\uA805] | [\\uA807-\\uA80A] | [\\uA80C-\\uA822] | [\\uAC00-\\uD7A3] | [\\uF900-\\uFA2D] | [\\uFA30-\\uFA6A] | [\\uFA70-\\uFAD9] | [\\uFB00-\\uFB06] | [\\uFB13-\\uFB17] | '\\uFB1D' | [\\uFB1F-\\uFB28] | [\\uFB2A-\\uFB36] | [\\uFB38-\\uFB3C] | '\\uFB3E' | [\\uFB40-\\uFB41] | [\\uFB43-\\uFB44] | [\\uFB46-\\uFBB1] | [\\uFBD3-\\uFD3D] | [\\uFD50-\\uFD8F] | [\\uFD92-\\uFDC7] | [\\uFDF0-\\uFDFB] | [\\uFE70-\\uFE74] | [\\uFE76-\\uFEFC] | [\\uFF21-\\uFF3A] | [\\uFF41-\\uFF5A] | [\\uFF66-\\uFF6F] | '\\uFF70' | [\\uFF71-\\uFF9D] | [\\uFF9E-\\uFF9F] | [\\uFFA0-\\uFFBE] | [\\uFFC2-\\uFFC7] | [\\uFFCA-\\uFFCF] | [\\uFFD2-\\uFFD7] | [\\uFFDA-\\uFFDC] ; /// id_continue ::= fragment ID_CONTINUE : ID_START | [0-9] | [\\u0300-\\u036F] | [\\u0483-\\u0486] | [\\u0591-\\u05B9] | [\\u05BB-\\u05BD] | '\\u05BF' | [\\u05C1-\\u05C2] | [\\u05C4-\\u05C5] | '\\u05C7' | [\\u0610-\\u0615] | [\\u064B-\\u065E] | [\\u0660-\\u0669] | '\\u0670' | [\\u06D6-\\u06DC] | [\\u06DF-\\u06E4] | [\\u06E7-\\u06E8] | [\\u06EA-\\u06ED] | [\\u06F0-\\u06F9] | '\\u0711' | [\\u0730-\\u074A] | [\\u07A6-\\u07B0] | [\\u0901-\\u0902] | '\\u0903' | '\\u093C' | [\\u093E-\\u0940] | [\\u0941-\\u0948] | [\\u0949-\\u094C] | '\\u094D' | [\\u0951-\\u0954] | [\\u0962-\\u0963] | [\\u0966-\\u096F] | '\\u0981' | [\\u0982-\\u0983] | '\\u09BC' | [\\u09BE-\\u09C0] | [\\u09C1-\\u09C4] | [\\u09C7-\\u09C8] | [\\u09CB-\\u09CC] | '\\u09CD' | '\\u09D7' | [\\u09E2-\\u09E3] | [\\u09E6-\\u09EF] | [\\u0A01-\\u0A02] | '\\u0A03' | '\\u0A3C' | [\\u0A3E-\\u0A40] | [\\u0A41-\\u0A42] | [\\u0A47-\\u0A48] | [\\u0A4B-\\u0A4D] | [\\u0A66-\\u0A6F] | [\\u0A70-\\u0A71] | [\\u0A81-\\u0A82] | '\\u0A83' | '\\u0ABC' | [\\u0ABE-\\u0AC0] | [\\u0AC1-\\u0AC5] | [\\u0AC7-\\u0AC8] | '\\u0AC9' | [\\u0ACB-\\u0ACC] | '\\u0ACD' | [\\u0AE2-\\u0AE3] | [\\u0AE6-\\u0AEF] | '\\u0B01' | [\\u0B02-\\u0B03] | '\\u0B3C' | '\\u0B3E' | '\\u0B3F' | '\\u0B40' | [\\u0B41-\\u0B43] | [\\u0B47-\\u0B48] | [\\u0B4B-\\u0B4C] | '\\u0B4D' | '\\u0B56' | '\\u0B57' | [\\u0B66-\\u0B6F] | '\\u0B82' | [\\u0BBE-\\u0BBF] | '\\u0BC0' | [\\u0BC1-\\u0BC2] | [\\u0BC6-\\u0BC8] | [\\u0BCA-\\u0BCC] | '\\u0BCD' | '\\u0BD7' | [\\u0BE6-\\u0BEF] | [\\u0C01-\\u0C03] | [\\u0C3E-\\u0C40] | [\\u0C41-\\u0C44] | [\\u0C46-\\u0C48] | [\\u0C4A-\\u0C4D] | [\\u0C55-\\u0C56] | [\\u0C66-\\u0C6F] | [\\u0C82-\\u0C83] | '\\u0CBC' | '\\u0CBE' | '\\u0CBF' | [\\u0CC0-\\u0CC4] | '\\u0CC6' | [\\u0CC7-\\u0CC8] | [\\u0CCA-\\u0CCB] | [\\u0CCC-\\u0CCD] | [\\u0CD5-\\u0CD6] | [\\u0CE6-\\u0CEF] | [\\u0D02-\\u0D03] | [\\u0D3E-\\u0D40] | [\\u0D41-\\u0D43] | [\\u0D46-\\u0D48] | [\\u0D4A-\\u0D4C] | '\\u0D4D' | '\\u0D57' | [\\u0D66-\\u0D6F] | [\\u0D82-\\u0D83] | '\\u0DCA' | [\\u0DCF-\\u0DD1] | [\\u0DD2-\\u0DD4] | '\\u0DD6' | [\\u0DD8-\\u0DDF] | [\\u0DF2-\\u0DF3] | '\\u0E31' | [\\u0E34-\\u0E3A] | [\\u0E47-\\u0E4E] | [\\u0E50-\\u0E59] | '\\u0EB1' | [\\u0EB4-\\u0EB9] | [\\u0EBB-\\u0EBC] | [\\u0EC8-\\u0ECD] | [\\u0ED0-\\u0ED9] | [\\u0F18-\\u0F19] | [\\u0F20-\\u0F29] | '\\u0F35' | '\\u0F37' | '\\u0F39' | [\\u0F3E-\\u0F3F] | [\\u0F71-\\u0F7E] | '\\u0F7F' | [\\u0F80-\\u0F84] | [\\u0F86-\\u0F87] | [\\u0F90-\\u0F97] | [\\u0F99-\\u0FBC] | '\\u0FC6' | '\\u102C' | [\\u102D-\\u1030] | '\\u1031' | '\\u1032' | [\\u1036-\\u1037] | '\\u1038' | '\\u1039' | [\\u1040-\\u1049] | [\\u1056-\\u1057] | [\\u1058-\\u1059] | '\\u135F' | [\\u1369-\\u1371] | [\\u1712-\\u1714] | [\\u1732-\\u1734] | [\\u1752-\\u1753] | [\\u1772-\\u1773] | '\\u17B6' | [\\u17B7-\\u17BD] | [\\u17BE-\\u17C5] | '\\u17C6' | [\\u17C7-\\u17C8] | [\\u17C9-\\u17D3] | '\\u17DD' | [\\u17E0-\\u17E9] | [\\u180B-\\u180D] | [\\u1810-\\u1819] | '\\u18A9' | [\\u1920-\\u1922] | [\\u1923-\\u1926] | [\\u1927-\\u1928] | [\\u1929-\\u192B] | [\\u1930-\\u1931] | '\\u1932' | [\\u1933-\\u1938] | [\\u1939-\\u193B] | [\\u1946-\\u194F] | [\\u19B0-\\u19C0] | [\\u19C8-\\u19C9] | [\\u19D0-\\u19D9] | [\\u1A17-\\u1A18] | [\\u1A19-\\u1A1B] | [\\u1DC0-\\u1DC3] | [\\u203F-\\u2040] | '\\u2054' | [\\u20D0-\\u20DC] | '\\u20E1' | [\\u20E5-\\u20EB] | [\\u302A-\\u302F] | [\\u3099-\\u309A] | '\\uA802' | '\\uA806' | '\\uA80B' | [\\uA823-\\uA824] | [\\uA825-\\uA826] | '\\uA827' | '\\uFB1E' | [\\uFE00-\\uFE0F] | [\\uFE20-\\uFE23] | [\\uFE33-\\uFE34] | [\\uFE4D-\\uFE4F] | [\\uFF10-\\uFF19] | '\\uFF3F' ;",12101,False,2362.0638301373824,median ";***************************************************************************/ ;* ;* INTEL Corporation Proprietary Information ;* ;* ;* Copyright (c) 1996 Intel Corporation. ;* All rights reserved. ;* ;***************************************************************************/ ; AUTHOR: Kumar Balasubramanian ;***************************************************************************/ ;; MMX version of the ""integer fast mode"" within IJG decompressor code. .nolist include iammx.inc ; IAMMX Emulator Macros MMWORD TEXTEQU .list .586 .model flat _DATA SEGMENT PARA PUBLIC USE32 'DATA' x0005000200010001 DQ 0005000200010001h x0040000000000000 DQ 40000000000000h x5a825a825a825a82 DW 16ah, 0h, 16ah, 0h ; 23170---1.414 x539f539f539f539f DW 0fd63h, 0h, 0fd63h, 0h ; 21407---2.613 x4546454645464546 DW 115h, 0h, 115h, 0h ; 17734---1.082 x61f861f861f861f8 DW 1d9h, 0h, 1d9h, 0h ; 25080---1.847 const_mask DQ 3ff03ff03ff03ffh const_zero DQ 0 scratch1 DQ 0 scratch3 DQ 0 scratch5 DQ 0 scratch7 DQ 0 ; for debug only x0 DQ 0 preSC DW 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384 DW 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384 DW 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384 DW 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384 DW 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384 DW 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384 DW 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384 DW 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384 _DATA ENDS _TEXT SEGMENT PARA PUBLIC USE32 'CODE' PackMulW MACRO movq mm0, mmword ptr scratch1 punpcklwd mm0, mmword ptr const_zero pmaddwd mm0, mmword ptr scratch3 psrad mm0, 8 movq mm1, mmword ptr scratch1 punpckhwd mm1, mmword ptr const_zero pmaddwd mm1, mmword ptr scratch3 psrad mm1, 8 movq mmword ptr scratch1, mm1 movq mm1, mm0 punpcklwd mm0, mmword ptr scratch1 punpckhwd mm1, mmword ptr scratch1 punpcklwd mm0, mm1 movq mmword ptr scratch1, mm0 ENDM COMMENT ^ void idct8x8aan ( int16 *src_result); ^ public _idct8x8aan _idct8x8aan proc USES eax ebx ecx edx esi edi ebp mov ebx, DWORD PTR [esp+32] ; source coeff mov esi, DWORD PTR [esp+36] ; temp results mov edi, DWORD PTR [esp+40] ; quant factors ;slot ; column 0: even part ; use V4, V12, V0, V8 to produce V22..V25 ;slot movq mm0, mmword ptr [ebx+8*12] ; V12 pmullw mm0, mmword ptr [edi+8*12] ;slot movq mm1, mmword ptr [ebx+8*4] ; V4 pmullw mm1, mmword ptr [edi+8*4] ;slot movq mm3, mmword ptr [ebx+8*0] ; V0 pmullw mm3, mmword ptr [edi+8*0] ;slot movq mm2, mm1 ; duplicate V4 movq mm5, mmword ptr [ebx+8*8] ; V8 pmullw mm5, mmword ptr [edi+8*8] psubw mm1, mm0 ; V16 movq mmword ptr scratch1, mm1 movq mm1, mmword ptr x5a825a825a825a82 ; 23170 ->V18 movq mmword ptr scratch3, mm1 movq mmword ptr scratch5, mm0 PackMulW movq mm1, mmword ptr scratch1 movq mm0, mmword ptr scratch5 paddw mm2, mm0 ; V17 movq mm0, mm2 ; duplicate V17 movq mm4, mm3 ; duplicate V0 paddw mm3, mm5 ; V19 psubw mm4, mm5 ; V20 ;mm5 free movq mm6, mm3 ; duplicate t74=t81 psubw mm1, mm0 ; V21 ; mm0 free paddw mm3, mm2 ; V22 movq mm5, mm1 ; duplicate V21 paddw mm1, mm4 ; V23 movq mmword ptr [esi+8*4], mm3 ; V22 psubw mm4, mm5 ; V24; mm5 free movq mmword ptr [esi+8*12], mm1 ; V23 psubw mm6, mm2 ; V25; mm2 free movq mmword ptr [esi+8*0], mm4 ; V24 ;slot movq mm7, mmword ptr [ebx+8*10] ; V10 pmullw mm7, mmword ptr [edi+8*10] ;slot movq mm0, mmword ptr [ebx+8*6] ; V6 pmullw mm0, mmword ptr [edi+8*6] ;slot movq mm3, mm7 ; duplicate V10 movq mm5, mmword ptr [ebx+8*2] ; V2 pmullw mm5, mmword ptr [edi+8*2] ;slot psubw mm7, mm0 ; V26 movq mm4, mmword ptr [ebx+8*14] ; V14 pmullw mm4, mmword ptr [edi+8*14] paddw mm3, mm0 ; V29 ; free mm0 movq mm1, mm7 ; duplicate V26 movq mmword ptr scratch1, mm7 movq mm7, mmword ptr x539f539f539f539f ; 23170 ->V18 movq mmword ptr scratch3, mm7 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm7, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 movq mm0, mm5 ; duplicate V2 paddw mm5, mm4 ; V27 psubw mm0, mm4 ; V28 ; free mm4 movq mm2, mm0 ; duplicate V28 movq mmword ptr scratch1, mm0 movq mm0, mmword ptr x4546454645464546 ; 23170 ->V18 movq mmword ptr scratch3, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm0, mmword ptr scratch1 movq mm1, mmword ptr scratch7 movq mm4, mm5 ; duplicate t90=t93 paddw mm1, mm2 ; V32 ; free mm2 movq mmword ptr scratch1, mm1 movq mm1, mmword ptr x61f861f861f861f8 ; 23170 ->V18 movq mmword ptr scratch3, mm1 movq mmword ptr scratch5, mm0 PackMulW movq mm1, mmword ptr scratch1 movq mm0, mmword ptr scratch5 paddw mm5, mm3 ; V31 psubw mm4, mm3 ; V30 ; free mm3 movq mmword ptr scratch1, mm4 movq mm4, mmword ptr x5a825a825a825a82 ; 23170 ->V18 movq mmword ptr scratch3, mm4 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm4, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 psubw mm0, mm1 ; V38 paddw mm1, mm7 ; V37 ; free mm7 movq mm3, mm6 ; duplicate V25 ;move from the next block movq mm7, mmword ptr [esi+8*4] ; V22 psubw mm1, mm5 ; V39 (mm5 still needed for next block) ;move from the next block movq mm2, mmword ptr [esi+8*12] ; V23 psubw mm4, mm1 ; V40 paddw mm0, mm4 ; V41; free mm0 ; column 0: output butterfly psubw mm6, mm0 ; tm6 paddw mm3, mm0 ; tm8; free mm1 movq mm0, mm1 ; line added by Kumar movq mm1, mm7 ; duplicate V22 paddw mm7, mm5 ; tm0 movq mmword ptr [esi+8*8], mm3 ; tm8; free mm3 psubw mm1, mm5 ; tm14; free mm5 movq mmword ptr [esi+8*6], mm6 ; tm6; free mm6 movq mm3, mm2 ; duplicate t117=t125 movq mm6, mmword ptr [esi+8*0] ; V24 paddw mm2, mm0 ; tm2 movq mmword ptr [esi+8*0], mm7 ; tm0; free mm7 psubw mm3, mm0 ; tm12; free mm0 movq mmword ptr [esi+8*14], mm1 ; tm14; free mm1 movq mmword ptr [esi+8*2], mm2 ; tm2; free mm2 movq mm0, mm6 ; duplicate t119=t123 movq mmword ptr [esi+8*12], mm3 ; tm12; free mm3 paddw mm6, mm4 ; tm4 psubw mm0, mm4 ; tm10; free mm4 movq mm1, mmword ptr [ebx+8*5] ; V5 pmullw mm1, mmword ptr [edi+8*5] movq mmword ptr [esi+8*4], mm6 ; tm4; free mm6 movq mmword ptr [esi+8*10], mm0 ; tm10; free mm0 ; column 1: even part ; use V5, V13, V1, V9 to produce V56..V59 movq mm7, mmword ptr [ebx+8*13] ; V13 pmullw mm7, mmword ptr [edi+8*13] movq mm2, mm1 ; duplicate t128=t130 movq mm3, mmword ptr [ebx+8*1] ; V1 pmullw mm3, mmword ptr [edi+8*1] psubw mm1, mm7 ; V50 movq mm5, mmword ptr [ebx+8*9] ; V9 pmullw mm5, mmword ptr [edi+8*9] paddw mm2, mm7 ; V51 movq mmword ptr scratch1, mm1 movq mm1, mmword ptr x5a825a825a825a82 ; 23170 ->V18 movq mmword ptr scratch3, mm1 movq mmword ptr scratch5, mm0 PackMulW movq mm1, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm6, mm2 ; duplicate V51 movq mm4, mm3 ; duplicate V1 paddw mm3, mm5 ; V53 psubw mm4, mm5 ; V54 ;mm5 free movq mm7, mm3 ; duplicate V53 psubw mm1, mm6 ; V55 ; mm6 free paddw mm3, mm2 ; V56 movq mm5, mm4 ; duplicate t140=t142 paddw mm4, mm1 ; V57 movq mmword ptr [esi+8*5], mm3 ; V56 psubw mm5, mm1 ; V58; mm1 free movq mmword ptr [esi+8*13], mm4 ; V57 psubw mm7, mm2 ; V59; mm2 free movq mmword ptr [esi+8*9], mm5 ; V58 movq mm0, mmword ptr [ebx+8*11] ; V11 pmullw mm0, mmword ptr [edi+8*11] movq mm6, mmword ptr [ebx+8*7] ; V7 pmullw mm6, mmword ptr [edi+8*7] movq mm3, mm0 ; duplicate V11 movq mm4, mmword ptr [ebx+8*15] ; V15 pmullw mm4, mmword ptr [edi+8*15] movq mm5, mmword ptr [ebx+8*3] ; V3 pmullw mm5, mmword ptr [edi+8*3] paddw mm0, mm6 ; V63 ; note that V15 computation has a correction step: ; this is a 'magic' constant that rebiases the results to be closer to the expected result ; this magic constant can be refined to reduce the error even more ; by doing the correction step in a later stage when the number is actually multiplied by 16 psubw mm3, mm6 ; V60 ; free mm6 movq mm1, mm3 ; duplicate V60 movq mmword ptr scratch1, mm1 movq mm1, mmword ptr x539f539f539f539f ; 23170 ->V18 movq mmword ptr scratch3, mm1 movq mmword ptr scratch5, mm0 PackMulW movq mm1, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm6, mm5 ; duplicate V3 paddw mm5, mm4 ; V61 psubw mm6, mm4 ; V62 ; free mm4 movq mm4, mm5 ; duplicate V61 paddw mm5, mm0 ; V65 -> result psubw mm4, mm0 ; V64 ; free mm0 movq mmword ptr scratch1, mm4 movq mm4, mmword ptr x5a825a825a825a82 ; 23170 ->V18 movq mmword ptr scratch3, mm4 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm4, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 paddw mm3, mm6 ; V66 movq mm2, mm5 ; duplicate V65 movq mmword ptr scratch1, mm3 movq mm3, mmword ptr x61f861f861f861f8 ; 23170 ->V18 movq mmword ptr scratch3, mm3 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm3, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 movq mmword ptr scratch1, mm6 movq mm6, mmword ptr x4546454645464546 ; 23170 ->V18 movq mmword ptr scratch3, mm6 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm6, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 movq mm0, mmword ptr [esi+8*5] ; V56 psubw mm6, mm3 ; V72 paddw mm3, mm1 ; V71 ; free mm1 psubw mm3, mm2 ; V73 ; free mm2 psubw mm4, mm3 ; V74 ;moved from next block movq mm1, mm0 ; duplicate t177=t188 paddw mm6, mm4 ; V75 ;moved from next block paddw mm0, mm5 ; tm1 ;location ; 5 - V56 ; 13 - V57 ; 9 - V58 ; X - V59, mm7 ; X - V65, mm5 ; X - V73, mm6 ; X - V74, mm4 ; X - V75, mm3 ; free mm0, mm1 & mm2 ;move above movq mm2, mmword ptr [esi+8*13] ; V57 psubw mm1, mm5 ; tm15; free mm5 movq mmword ptr [esi+8*1], mm0 ; tm1; free mm0 ;save the store as used directly in the transpose ;movq mmword ptr [esi+8*15], mm1 ; tm15; free mm1 movq mm5, mm7 ; duplicate t182=t184 psubw mm7, mm6 ; tm7 paddw mm5, mm6 ; tm9; free mm3 ;slot movq mm6, mm3 movq mm0, mmword ptr [esi+8*9] ; V58 movq mm3, mm2 ; duplicate V57 movq mmword ptr [esi+8*7], mm7 ; tm7; free mm7 psubw mm3, mm6 ; tm13 paddw mm2, mm6 ; tm3 ; free mm6 movq mm6, mm0 ; duplicate V58 movq mmword ptr [esi+8*3], mm2 ; tm3; free mm2 paddw mm0, mm4 ; tm5 psubw mm6, mm4 ; tm11; free mm4 movq mmword ptr [esi+8*5], mm0 ; tm5; free mm0 ; transpose the bottom right quadrant(4X4) of the matrix ; --------- --------- ; | M1 | M2 | | M1'| M3'| ; --------- --> --------- ; | M3 | M4 | | M2'| M4'| ; --------- --------- movq mm0, mm5 ; copy w4---0,1,3,5,6 punpcklwd mm5, mm6 ; punpckhwd mm0, mm6 ;---0,1,3,5,6 movq mm6, mmword ptr [esi+8*0] ;get w0 of top left quadrant movq mm2, mm3 ;---0,1,2,3,5,6 punpcklwd mm3, mm1 ; movq mm7, mmword ptr [esi+8*2] ;get w1 of top left quadrant punpckhwd mm2, mm1 ;---0,2,3,5,6,7 movq mm4, mm5 ;---0,2,3,4,5,6,7 punpckldq mm5, mm3 ; transposed w4 movq mmword ptr [esi+8*9], mm5 ; store w4 punpckhdq mm4, mm3 ; transposed w5---0,2,4,6,7 movq mm3, mm0 ;---0,2,3,4,6,7 punpckldq mm0, mm2 ; transposed w6 movq mmword ptr [esi+8*11], mm4 ; store w5 punpckhdq mm3, mm2 ; transposed w7---0,3,6,7 movq mmword ptr [esi+8*13], mm0 ; store w6---3,5,6,7 movq mm5, mm6 ; copy w0 movq mmword ptr [esi+8*15], mm3 ; store w7---5,6,7 punpcklwd mm6, mm7 ; transpose the top left quadrant(4X4) of the matrix punpckhwd mm5, mm7 ;---5,6,7 movq mm7, mmword ptr [esi+8*4] ; get w2 of TL quadrant movq mm4, mmword ptr [esi+8*6] ; get w3 of TL quadrant movq mm3, mm7 ; copy w2---3,4,5,6,7 movq mm2, mm6 punpcklwd mm7, mm4 ;---2,3,4,5,6,7 punpckhwd mm3, mm4 ;---2,3,4,5,6,7 movq mm4, mm5 ; movq mm1, mm5 punpckldq mm6, mm7 ;---1,2,3,4,5,6,7 movq mmword ptr [esi+8*0], mm6 ; store w0 of TL quadrant punpckhdq mm2, mm7 ;---1,2,3,4,5,6,7 movq mmword ptr [esi+8*2], mm2 ; store w1 of TL quadrant punpckldq mm5, mm3 ;---1,2,3,4,5,6,7 movq mmword ptr [esi+8*4], mm5 ; store w2 of TL quadrant punpckhdq mm1, mm3 ;---1,2,3,4,5,6,7 movq mmword ptr [esi+8*6], mm1 ; store w3 of TL quadrant ; transpose the top right quadrant(4X4) of the matrix movq mm0, mmword ptr [esi+8*1] ;---0 movq mm1, mmword ptr [esi+8*3] ;---0,1,2 movq mm2, mm0 movq mm3, mmword ptr [esi+8*5] punpcklwd mm0, mm1 ;---0,1,2,3 punpckhwd mm2, mm1 movq mm1, mmword ptr [esi+8*7] ;---0,1,2,3 movq mm4, mm3 punpcklwd mm3, mm1 ;---0,1,2,3,4 punpckhwd mm4, mm1 ;---0,1,2,3,4 movq mm1, mm0 movq mm5, mm2 punpckldq mm0, mm3 ;---0,1,2,3,4,5 punpckhdq mm1, mm3 ;---0,1,2,3,4,5 movq mm3, mmword ptr [esi+8*8] movq mmword ptr [esi+8*8], mm0 punpckldq mm2, mm4 ;---1,2,3,4,5 punpckhdq mm5, mm4 ;---1,2,3,4,5 movq mm4, mmword ptr [esi+8*10] ; transpose the bottom left quadrant(4X4) of the matrix ; Also store w1,w2,w3 of top right quadrant into ; w5,w6,w7 of bottom left quadrant. Storing w0 of TR in w4 ; of BL is already done. movq mmword ptr [esi+8*10], mm1 movq mm1, mm3 ;---1,2,3,4,5 movq mm0, mmword ptr [esi+8*12] punpcklwd mm3, mm4 ;---0,1,2,3,4,5 punpckhwd mm1, mm4 ;---0,1,2,3,4,5 movq mm4, mmword ptr [esi+8*14] movq mmword ptr [esi+8*12], mm2 movq mm2, mm0 movq mmword ptr [esi+8*14], mm5 punpcklwd mm0, mm4 ;---0,1,2,3,4 punpckhwd mm2, mm4 ;---0,1,2,3,4 movq mm4, mm3 movq mm5, mm1 punpckldq mm3, mm0 ;---0,1,2,3,4,5 movq mmword ptr [esi+8*1], mm3 punpckhdq mm4, mm0 ;---1,2,4,5 movq mmword ptr [esi+8*3], mm4 punpckldq mm1, mm2 ;---1,2,5 movq mmword ptr [esi+8*5], mm1 punpckhdq mm5, mm2 ;---5 movq mmword ptr [esi+8*7], mm5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;; 1D DCT of the rows ;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mov esi, DWORD PTR [esp+36] ; source ;slot ; column 0: even part ; use V4, V12, V0, V8 to produce V22..V25 movq mm0, mmword ptr [esi+8*12] ; V12 movq mm1, mmword ptr [esi+8*4] ; V4 movq mm3, mmword ptr [esi+8*0] ; V0 movq mm2, mm1 ; duplicate V4 movq mm5, mmword ptr [esi+8*8] ; V8 psubw mm1, mm0 ; V16 movq mmword ptr scratch1, mm1 movq mm1, mmword ptr x5a825a825a825a82 ; 23170 ->V18 movq mmword ptr scratch3, mm1 movq mmword ptr scratch5, mm0 PackMulW movq mm1, mmword ptr scratch1 movq mm0, mmword ptr scratch5 paddw mm2, mm0 ; V17 movq mm0, mm2 ; duplicate V17 movq mm4, mm3 ; duplicate V0 paddw mm3, mm5 ; V19 psubw mm4, mm5 ; V20 ;mm5 free ;moved from the block below movq mm6, mm3 ; duplicate t74=t81 psubw mm1, mm0 ; V21 ; mm0 free paddw mm3, mm2 ; V22 movq mm5, mm1 ; duplicate V21 paddw mm1, mm4 ; V23 movq mmword ptr [esi+8*4], mm3 ; V22 psubw mm4, mm5 ; V24; mm5 free movq mmword ptr [esi+8*12], mm1 ; V23 psubw mm6, mm2 ; V25; mm2 free movq mmword ptr [esi+8*0], mm4 ; V24 ; keep mm6 alive all along the next block ; column 0: odd part ; use V2, V6, V10, V14 to produce V31, V39, V40, V41 movq mm7, mmword ptr [esi+8*10] ; V10 movq mm0, mmword ptr [esi+8*6] ; V6 movq mm3, mm7 ; duplicate V10 movq mm5, mmword ptr [esi+8*2] ; V2 psubw mm7, mm0 ; V26 movq mm4, mmword ptr [esi+8*14] ; V14 paddw mm3, mm0 ; V29 ; free mm0 movq mm1, mm7 ; duplicate V26 movq mmword ptr scratch1, mm7 movq mm7, mmword ptr x539f539f539f539f ; 23170 ->V18 movq mmword ptr scratch3, mm7 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm7, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 movq mm0, mm5 ; duplicate V2 paddw mm5, mm4 ; V27 psubw mm0, mm4 ; V28 ; free mm4 movq mm2, mm0 ; duplicate V28 movq mmword ptr scratch1, mm0 movq mm0, mmword ptr x4546454645464546 ; 23170 ->V18 movq mmword ptr scratch3, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm0, mmword ptr scratch1 movq mm1, mmword ptr scratch7 movq mm4, mm5 ; duplicate t90=t93 paddw mm1, mm2 ; V32 ; free mm2 movq mmword ptr scratch1, mm1 movq mm1, mmword ptr x61f861f861f861f8 ; 23170 ->V18 movq mmword ptr scratch3, mm1 movq mmword ptr scratch5, mm0 PackMulW movq mm1, mmword ptr scratch1 movq mm0, mmword ptr scratch5 paddw mm5, mm3 ; V31 psubw mm4, mm3 ; V30 ; free mm3 movq mmword ptr scratch1, mm4 movq mm4, mmword ptr x5a825a825a825a82 ; 23170 ->V18 movq mmword ptr scratch3, mm4 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm4, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 psubw mm0, mm1 ; V38 paddw mm1, mm7 ; V37 ; free mm7 ;move from the next block movq mm3, mm6 ; duplicate V25 ;move from the next block movq mm7, mmword ptr [esi+8*4] ; V22 psubw mm1, mm5 ; V39 (mm5 still needed for next block) ;move from the next block movq mm2, mmword ptr [esi+8*12] ; V23 psubw mm4, mm1 ; V40 paddw mm0, mm4 ; V41; free mm0 ;move from the next block ; column 0: output butterfly ;move above psubw mm6, mm0 ; tm6 paddw mm3, mm0 ; tm8; free mm1 movq mm0, mm1 ; line added by Kumar movq mm1, mm7 ; duplicate V22 paddw mm7, mm5 ; tm0 movq mmword ptr [esi+8*8], mm3 ; tm8; free mm3 psubw mm1, mm5 ; tm14; free mm5 movq mmword ptr [esi+8*6], mm6 ; tm6; free mm6 movq mm3, mm2 ; duplicate t117=t125 movq mm6, mmword ptr [esi+8*0] ; V24 paddw mm2, mm0 ; tm2 movq mmword ptr [esi+8*0], mm7 ; tm0; free mm7 psubw mm3, mm0 ; tm12; free mm0 movq mmword ptr [esi+8*14], mm1 ; tm14; free mm1 movq mmword ptr [esi+8*2], mm2 ; tm2; free mm2 movq mm0, mm6 ; duplicate t119=t123 movq mmword ptr [esi+8*12], mm3 ; tm12; free mm3 paddw mm6, mm4 ; tm4 ;moved from next block psubw mm0, mm4 ; tm10; free mm4 ;moved from next block movq mm1, mmword ptr [esi+8*5] ; V5 movq mmword ptr [esi+8*4], mm6 ; tm4; free mm6 movq mmword ptr [esi+8*10], mm0 ; tm10; free mm0 ; column 1: even part ; use V5, V13, V1, V9 to produce V56..V59 ;moved to prev block movq mm7, mmword ptr [esi+8*13] ; V13 movq mm2, mm1 ; duplicate t128=t130 movq mm3, mmword ptr [esi+8*1] ; V1 psubw mm1, mm7 ; V50 movq mm5, mmword ptr [esi+8*9] ; V9 paddw mm2, mm7 ; V51 movq mmword ptr scratch1, mm1 movq mm1, mmword ptr x5a825a825a825a82 ; 23170 ->V18 movq mmword ptr scratch3, mm1 movq mmword ptr scratch5, mm0 PackMulW movq mm1, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm6, mm2 ; duplicate V51 movq mm4, mm3 ; duplicate V1 paddw mm3, mm5 ; V53 psubw mm4, mm5 ; V54 ;mm5 free movq mm7, mm3 ; duplicate V53 ;moved from next block psubw mm1, mm6 ; V55 ; mm6 free paddw mm3, mm2 ; V56 movq mm5, mm4 ; duplicate t140=t142 paddw mm4, mm1 ; V57 movq mmword ptr [esi+8*5], mm3 ; V56 psubw mm5, mm1 ; V58; mm1 free movq mmword ptr [esi+8*13], mm4 ; V57 psubw mm7, mm2 ; V59; mm2 free movq mmword ptr [esi+8*9], mm5 ; V58 ; keep mm7 alive all along the next block movq mm0, mmword ptr [esi+8*11] ; V11 movq mm6, mmword ptr [esi+8*7] ; V7 movq mm3, mm0 ; duplicate V11 movq mm4, mmword ptr [esi+8*15] ; V15 movq mm5, mmword ptr [esi+8*3] ; V3 paddw mm0, mm6 ; V63 ; note that V15 computation has a correction step: ; this is a 'magic' constant that rebiases the results to be closer to the expected result ; this magic constant can be refined to reduce the error even more ; by doing the correction step in a later stage when the number is actually multiplied by 16 psubw mm3, mm6 ; V60 ; free mm6 movq mm1, mm3 ; duplicate V60 movq mmword ptr scratch1, mm1 movq mm1, mmword ptr x539f539f539f539f ; 23170 ->V18 movq mmword ptr scratch3, mm1 movq mmword ptr scratch5, mm0 PackMulW movq mm1, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm6, mm5 ; duplicate V3 paddw mm5, mm4 ; V61 psubw mm6, mm4 ; V62 ; free mm4 movq mm4, mm5 ; duplicate V61 paddw mm5, mm0 ; V65 -> result psubw mm4, mm0 ; V64 ; free mm0 movq mmword ptr scratch1, mm4 movq mm4, mmword ptr x5a825a825a825a82 ; 23170 ->V18 movq mmword ptr scratch3, mm4 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm4, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 paddw mm3, mm6 ; V66 movq mm2, mm5 ; duplicate V65 movq mmword ptr scratch1, mm3 movq mm3, mmword ptr x61f861f861f861f8 ; 23170 ->V18 movq mmword ptr scratch3, mm3 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm3, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 movq mmword ptr scratch1, mm6 movq mm6, mmword ptr x4546454645464546 ; 23170 ->V18 movq mmword ptr scratch3, mm6 movq mmword ptr scratch5, mm0 movq mmword ptr scratch7, mm1 PackMulW movq mm6, mmword ptr scratch1 movq mm0, mmword ptr scratch5 movq mm1, mmword ptr scratch7 ;moved from next block movq mm0, mmword ptr [esi+8*5] ; V56 psubw mm6, mm3 ; V72 paddw mm3, mm1 ; V71 ; free mm1 psubw mm3, mm2 ; V73 ; free mm2 psubw mm4, mm3 ; V74 ;moved from next block movq mm1, mm0 ; duplicate t177=t188 paddw mm6, mm4 ; V75 ;moved from next block paddw mm0, mm5 ; tm1 ;location ; 5 - V56 ; 13 - V57 ; 9 - V58 ; X - V59, mm7 ; X - V65, mm5 ; X - V73, mm6 ; X - V74, mm4 ; X - V75, mm3 ; free mm0, mm1 & mm2 ;move above movq mm2, mmword ptr [esi+8*13] ; V57 psubw mm1, mm5 ; tm15; free mm5 movq mmword ptr [esi+8*1], mm0 ; tm1; free mm0 ;save the store as used directly in the transpose movq mm5, mm7 ; duplicate t182=t184 psubw mm7, mm6 ; tm7 paddw mm5, mm6 ; tm9; free mm3 movq mm6, mm3 movq mm0, mmword ptr [esi+8*9] ; V58 movq mm3, mm2 ; duplicate V57 movq mmword ptr [esi+8*7], mm7 ; tm7; free mm7 psubw mm3, mm6 ; tm13 paddw mm2, mm6 ; tm3 ; free mm6 movq mm6, mm0 ; duplicate V58 movq mmword ptr [esi+8*3], mm2 ; tm3; free mm2 paddw mm0, mm4 ; tm5 psubw mm6, mm4 ; tm11; free mm4 movq mmword ptr [esi+8*5], mm0 ; tm5; free mm0 ; Final results to be stored after the transpose ; transpose the bottom right quadrant(4X4) of the matrix ; --------- --------- ; | M1 | M2 | | M1'| M3'| ; --------- --> --------- ; | M3 | M4 | | M2'| M4'| ; --------- --------- ; ; get the pointer to array ""range"" mov edi, [esp+52] ; calculate the destination address mov ebp, [esp+44] ; get output_buf[4] mov ebx, [ebp+20] mov ecx, [ebp+24] mov edx, [ebp+28] mov ebp, [ebp+16] add ebp, [esp+48] ; add to output_col add ebx, [esp+48] ; add to output_col add ecx, [esp+48] ; add to output_col add edx, [esp+48] ; add to output_col movq mm0, mm5 ; copy w4---0,1,3,5,6 punpcklwd mm5, mm6 ; punpckhwd mm0, mm6 ;---0,1,3,5,6 movq mm6, mmword ptr [esi+8*0] ;get w0 of top left quadrant movq mm2, mm3 ;---0,1,2,3,5,6 punpcklwd mm3, mm1 ; movq mm7, mmword ptr [esi+8*2] ;get w1 of top left quadrant punpckhwd mm2, mm1 ;---0,2,3,5,6,7 movq mm4, mm5 ;---0,2,3,4,5,6,7 punpckldq mm5, mm3 ; transposed w4 psrlw mm5, 5 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+4], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+5], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+6], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+7], al punpckhdq mm4, mm3 ; transposed w5---0,2,4,6,7 movq mm3, mm0 ;---0,2,3,4,6,7 punpckldq mm0, mm2 ; transposed w6 psrlw mm4, 5 movd eax, mm4 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+4], al psrlq mm4, 16 movd eax, mm4 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+5], al psrlq mm4, 16 movd eax, mm4 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+6], al psrlq mm4, 16 movd eax, mm4 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+7], al punpckhdq mm3, mm2 ; transposed w7---0,3,6,7 psrlw mm0, 5 movd eax, mm0 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+4], al psrlq mm0, 16 movd eax, mm0 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+5], al psrlq mm0, 16 movd eax, mm0 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+6], al psrlq mm0, 16 movd eax, mm0 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+7], al movq mm5, mm6 ; copy w0 psrlw mm3, 5 movd eax, mm3 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+4], al psrlq mm3, 16 movd eax, mm3 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+5], al psrlq mm3, 16 movd eax, mm3 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+6], al psrlq mm3, 16 movd eax, mm3 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+7], al punpcklwd mm6, mm7 ; transpose the top left quadrant(4X4) of the matrix ; calculate the destination address mov ebp, [esp+44] ; get output_buf[0] mov ebx, [ebp+4] mov ecx, [ebp+8] mov edx, [ebp+12] mov ebp, [ebp+0] add ebp, [esp+48] ; add to output_col add ebx, [esp+48] ; add to output_col add ecx, [esp+48] ; add to output_col add edx, [esp+48] ; add to output_col punpckhwd mm5, mm7 ;---5,6,7 movq mm7, mmword ptr [esi+8*4] ; get w2 of TL quadrant movq mm4, mmword ptr [esi+8*6] ; get w3 of TL quadrant movq mm3, mm7 ; copy w2---3,4,5,6,7 movq mm2, mm6 punpcklwd mm7, mm4 ;---2,3,4,5,6,7 punpckhwd mm3, mm4 ;---2,3,4,5,6,7 movq mm4, mm5 ; movq mm1, mm5 punpckldq mm6, mm7 ;---1,2,3,4,5,6,7 psrlw mm6, 5 movd eax, mm6 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp], al psrlq mm6, 16 movd eax, mm6 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+1], al psrlq mm6, 16 movd eax, mm6 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+2], al psrlq mm6, 16 movd eax, mm6 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+3], al punpckhdq mm2, mm7 ;---1,2,3,4,5,6,7 psrlw mm2, 5 movd eax, mm2 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx], al psrlq mm2, 16 movd eax, mm2 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+1], al psrlq mm2, 16 movd eax, mm2 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+2], al psrlq mm2, 16 movd eax, mm2 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+3], al punpckldq mm5, mm3 ;---1,2,3,4,5,6,7 psrlw mm5, 5 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+1], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+2], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+3], al punpckhdq mm1, mm3 ;---1,2,3,4,5,6,7 psrlw mm1, 5 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx], al psrlq mm1, 16 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+1], al psrlq mm1, 16 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+2], al psrlq mm1, 16 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+3], al ; transpose the top right quadrant(4X4) of the matrix ; calculate the destination address for **bottom left quadrant mov ebp, [esp+44] ; get output_buf[4] mov ebx, [ebp+20] mov ecx, [ebp+24] mov edx, [ebp+28] mov ebp, [ebp+16] add ebp, [esp+48] ; add to output_col add ebx, [esp+48] ; add to output_col add ecx, [esp+48] ; add to output_col add edx, [esp+48] ; add to output_col movq mm0, mmword ptr [esi+8*1] ;---0 movq mm1, mmword ptr [esi+8*3] ;---0,1,2 movq mm2, mm0 movq mm3, mmword ptr [esi+8*5] punpcklwd mm0, mm1 ;---0,1,2,3 punpckhwd mm2, mm1 movq mm1, mmword ptr [esi+8*7] ;---0,1,2,3 movq mm4, mm3 punpcklwd mm3, mm1 ;---0,1,2,3,4 punpckhwd mm4, mm1 ;---0,1,2,3,4 movq mm1, mm0 movq mm5, mm2 punpckldq mm0, mm3 ;---0,1,2,3,4,5 punpckhdq mm1, mm3 ;---0,1,2,3,4,5 movq mm3, mmword ptr [esi+8*8] psrlw mm0, 5 movd eax, mm0 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp], al psrlq mm0, 16 movd eax, mm0 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+1], al psrlq mm0, 16 movd eax, mm0 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+2], al psrlq mm0, 16 movd eax, mm0 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+3], al punpckldq mm2, mm4 ;---1,2,3,4,5 punpckhdq mm5, mm4 ;---1,2,3,4,5 movq mm4, mmword ptr [esi+8*10] ; transpose the bottom left quadrant(4X4) of the matrix ; Also store w1,w2,w3 of top right quadrant into ; w5,w6,w7 of bottom left quadrant. Storing w0 of TR in w4 ; of BL is already done. psrlw mm1, 5 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx], al psrlq mm1, 16 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+1], al psrlq mm1, 16 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+2], al psrlq mm1, 16 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+3], al movq mm1, mm3 ;---1,2,3,4,5 movq mm0, mmword ptr [esi+8*12] punpcklwd mm3, mm4 ;---0,1,2,3,4,5 punpckhwd mm1, mm4 ;---0,1,2,3,4,5 movq mm4, mmword ptr [esi+8*14] psrlw mm2, 5 movd eax, mm2 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx], al psrlq mm2, 16 movd eax, mm2 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+1], al psrlq mm2, 16 movd eax, mm2 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+2], al psrlq mm2, 16 movd eax, mm2 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+3], al movq mm2, mm0 psrlw mm5, 5 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+1], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+2], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+3], al punpcklwd mm0, mm4 ;---0,1,2,3,4 punpckhwd mm2, mm4 ;---0,1,2,3,4 movq mm4, mm3 movq mm5, mm1 punpckldq mm3, mm0 ;---0,1,2,3,4,5 ; calculate the destination address for **top right quadrant mov ebp, [esp+44] ; get output_buf[0] mov ebx, [ebp+4] mov ecx, [ebp+8] mov edx, [ebp+12] mov ebp, [ebp+0] add ebp, [esp+48] ; add to output_col add ebx, [esp+48] ; add to output_col add ecx, [esp+48] ; add to output_col add edx, [esp+48] ; add to output_col psrlw mm3, 5 movd eax, mm3 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+4], al psrlq mm3, 16 movd eax, mm3 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+5], al psrlq mm3, 16 movd eax, mm3 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+6], al psrlq mm3, 16 movd eax, mm3 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebp+7], al punpckhdq mm4, mm0 ;---1,2,4,5 psrlw mm4, 5 movd eax, mm4 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+4], al psrlq mm4, 16 movd eax, mm4 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+5], al psrlq mm4, 16 movd eax, mm4 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+6], al psrlq mm4, 16 movd eax, mm4 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ebx+7], al punpckldq mm1, mm2 ;---1,2,5 psrlw mm1, 5 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+4], al psrlq mm1, 16 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+5], al psrlq mm1, 16 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+6], al psrlq mm1, 16 movd eax, mm1 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [ecx+7], al punpckhdq mm5, mm2 ;---5 psrlw mm5, 5 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+4], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+5], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+6], al psrlq mm5, 16 movd eax, mm5 and eax, 03ffh mov al, byte ptr [edi][eax] mov byte ptr [edx+7], al ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; emms ret _idct8x8aan ENDP _TEXT ENDS END ",16356,True,4267.125432310133,median "/* * 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. * * This file is an adaptation of Presto's presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4 grammar. */ grammar SqlBase; @members { /** * When false, INTERSECT is given the greater precedence over the other set * operations (UNION, EXCEPT and MINUS) as per the SQL standard. */ public boolean legacy_setops_precedence_enbled = false; /** * Verify whether current token is a valid decimal token (which contains dot). * Returns true if the character that follows the token is not a digit or letter or underscore. * * For example: * For char stream ""2.3"", ""2."" is not a valid decimal token, because it is followed by digit '3'. * For char stream ""2.3_"", ""2.3"" is not a valid decimal token, because it is followed by '_'. * For char stream ""2.3W"", ""2.3"" is not a valid decimal token, because it is followed by 'W'. * For char stream ""12.0D 34.E2+0.12 "" 12.0D is a valid decimal token because it is followed * by a space. 34.E2 is a valid decimal token because it is followed by symbol '+' * which is not a digit or letter or underscore. */ public boolean isValidDecimal() { int nextChar = _input.LA(1); if (nextChar >= 'A' && nextChar <= 'Z' || nextChar >= '0' && nextChar <= '9' || nextChar == '_') { return false; } else { return true; } } /** * When true, ANSI SQL parsing mode is enabled. */ public boolean ansi = false; } singleStatement : statement EOF ; singleExpression : namedExpression EOF ; singleTableIdentifier : tableIdentifier EOF ; singleMultipartIdentifier : multipartIdentifier EOF ; singleFunctionIdentifier : functionIdentifier EOF ; singleDataType : dataType EOF ; singleTableSchema : colTypeList EOF ; statement : query #statementDefault | ctes? dmlStatementNoWith #dmlStatement | USE NAMESPACE? multipartIdentifier #use | CREATE database (IF NOT EXISTS)? db=errorCapturingIdentifier ((COMMENT comment=STRING) | locationSpec | (WITH DBPROPERTIES tablePropertyList))* #createDatabase | ALTER database db=errorCapturingIdentifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties | ALTER database db=errorCapturingIdentifier SET locationSpec #setDatabaseLocation | DROP database (IF EXISTS)? db=errorCapturingIdentifier (RESTRICT | CASCADE)? #dropDatabase | SHOW DATABASES (LIKE? pattern=STRING)? #showDatabases | SHOW NAMESPACES ((FROM | IN) multipartIdentifier)? (LIKE? pattern=STRING)? #showNamespaces | createTableHeader ('(' colTypeList ')')? tableProvider ((OPTIONS options=tablePropertyList) | (PARTITIONED BY partitioning=transformList) | bucketSpec | locationSpec | (COMMENT comment=STRING) | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #createTable | createTableHeader ('(' columns=colTypeList ')')? ((COMMENT comment=STRING) | (PARTITIONED BY '(' partitionColumns=colTypeList ')' | PARTITIONED BY partitionColumnNames=identifierList) | bucketSpec | skewSpec | rowFormat | createFileFormat | locationSpec | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #createHiveTable | CREATE TABLE (IF NOT EXISTS)? target=tableIdentifier LIKE source=tableIdentifier locationSpec? #createTableLike | replaceTableHeader ('(' colTypeList ')')? tableProvider ((OPTIONS options=tablePropertyList) | (PARTITIONED BY partitioning=transformList) | bucketSpec | locationSpec | (COMMENT comment=STRING) | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #replaceTable | ANALYZE TABLE tableIdentifier partitionSpec? COMPUTE STATISTICS (identifier | FOR COLUMNS identifierSeq | FOR ALL COLUMNS)? #analyze | ALTER TABLE multipartIdentifier ADD (COLUMN | COLUMNS) columns=qualifiedColTypeWithPositionList #addTableColumns | ALTER TABLE multipartIdentifier ADD (COLUMN | COLUMNS) '(' columns=qualifiedColTypeWithPositionList ')' #addTableColumns | ALTER TABLE multipartIdentifier RENAME COLUMN from=qualifiedName TO to=identifier #renameTableColumn | ALTER TABLE multipartIdentifier DROP (COLUMN | COLUMNS) '(' columns=qualifiedNameList ')' #dropTableColumns | ALTER TABLE multipartIdentifier DROP (COLUMN | COLUMNS) columns=qualifiedNameList #dropTableColumns | ALTER (TABLE | VIEW) from=tableIdentifier RENAME TO to=tableIdentifier #renameTable | ALTER (TABLE | VIEW) multipartIdentifier SET TBLPROPERTIES tablePropertyList #setTableProperties | ALTER (TABLE | VIEW) multipartIdentifier UNSET TBLPROPERTIES (IF EXISTS)? tablePropertyList #unsetTableProperties | ALTER TABLE multipartIdentifier (ALTER | CHANGE) COLUMN? qualifiedName (TYPE dataType)? (COMMENT comment=STRING)? colPosition? #alterTableColumn | ALTER TABLE tableIdentifier partitionSpec? CHANGE COLUMN? colName=errorCapturingIdentifier colType colPosition? #changeColumn | ALTER TABLE tableIdentifier (partitionSpec)? SET SERDE STRING (WITH SERDEPROPERTIES tablePropertyList)? #setTableSerDe | ALTER TABLE tableIdentifier (partitionSpec)? SET SERDEPROPERTIES tablePropertyList #setTableSerDe | ALTER TABLE tableIdentifier ADD (IF NOT EXISTS)? partitionSpecLocation+ #addTablePartition | ALTER VIEW tableIdentifier ADD (IF NOT EXISTS)? partitionSpec+ #addTablePartition | ALTER TABLE tableIdentifier from=partitionSpec RENAME TO to=partitionSpec #renameTablePartition | ALTER TABLE tableIdentifier DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* PURGE? #dropTablePartitions | ALTER VIEW tableIdentifier DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* #dropTablePartitions | ALTER TABLE multipartIdentifier SET locationSpec #setTableLocation | ALTER TABLE tableIdentifier partitionSpec SET locationSpec #setPartitionLocation | ALTER TABLE tableIdentifier RECOVER PARTITIONS #recoverPartitions | DROP TABLE (IF EXISTS)? multipartIdentifier PURGE? #dropTable | DROP VIEW (IF EXISTS)? multipartIdentifier #dropView | CREATE (OR REPLACE)? (GLOBAL? TEMPORARY)? VIEW (IF NOT EXISTS)? tableIdentifier identifierCommentList? ((COMMENT STRING) | (PARTITIONED ON identifierList) | (TBLPROPERTIES tablePropertyList))* AS query #createView | CREATE (OR REPLACE)? GLOBAL? TEMPORARY VIEW tableIdentifier ('(' colTypeList ')')? tableProvider (OPTIONS tablePropertyList)? #createTempViewUsing | ALTER VIEW tableIdentifier AS? query #alterViewQuery | CREATE (OR REPLACE)? TEMPORARY? FUNCTION (IF NOT EXISTS)? qualifiedName AS className=STRING (USING resource (',' resource)*)? #createFunction | DROP TEMPORARY? FUNCTION (IF EXISTS)? qualifiedName #dropFunction | EXPLAIN (LOGICAL | FORMATTED | EXTENDED | CODEGEN | COST)? statement #explain | SHOW TABLES ((FROM | IN) multipartIdentifier)? (LIKE? pattern=STRING)? #showTables | SHOW TABLE EXTENDED ((FROM | IN) db=errorCapturingIdentifier)? LIKE pattern=STRING partitionSpec? #showTable | SHOW TBLPROPERTIES table=tableIdentifier ('(' key=tablePropertyKey ')')? #showTblProperties | SHOW COLUMNS (FROM | IN) tableIdentifier ((FROM | IN) db=errorCapturingIdentifier)? #showColumns | SHOW PARTITIONS tableIdentifier partitionSpec? #showPartitions | SHOW identifier? FUNCTIONS (LIKE? (qualifiedName | pattern=STRING))? #showFunctions | SHOW CREATE TABLE tableIdentifier #showCreateTable | (DESC | DESCRIBE) FUNCTION EXTENDED? describeFuncName #describeFunction | (DESC | DESCRIBE) database EXTENDED? db=errorCapturingIdentifier #describeDatabase | (DESC | DESCRIBE) TABLE? option=(EXTENDED | FORMATTED)? multipartIdentifier partitionSpec? describeColName? #describeTable | (DESC | DESCRIBE) QUERY? query #describeQuery | REFRESH TABLE tableIdentifier #refreshTable | REFRESH (STRING | .*?) #refreshResource | CACHE LAZY? TABLE tableIdentifier (OPTIONS options=tablePropertyList)? (AS? query)? #cacheTable | UNCACHE TABLE (IF EXISTS)? tableIdentifier #uncacheTable | CLEAR CACHE #clearCache | LOAD DATA LOCAL? INPATH path=STRING OVERWRITE? INTO TABLE tableIdentifier partitionSpec? #loadData | TRUNCATE TABLE tableIdentifier partitionSpec? #truncateTable | MSCK REPAIR TABLE tableIdentifier #repairTable | op=(ADD | LIST) identifier .*? #manageResource | SET ROLE .*? #failNativeCommand | SET .*? #setConfiguration | RESET #resetConfiguration | DELETE FROM multipartIdentifier tableAlias whereClause? #deleteFromTable | UPDATE multipartIdentifier tableAlias setClause whereClause? #updateTable | unsupportedHiveNativeCommands .*? #failNativeCommand ; unsupportedHiveNativeCommands : kw1=CREATE kw2=ROLE | kw1=DROP kw2=ROLE | kw1=GRANT kw2=ROLE? | kw1=REVOKE kw2=ROLE? | kw1=SHOW kw2=GRANT | kw1=SHOW kw2=ROLE kw3=GRANT? | kw1=SHOW kw2=PRINCIPALS | kw1=SHOW kw2=ROLES | kw1=SHOW kw2=CURRENT kw3=ROLES | kw1=EXPORT kw2=TABLE | kw1=IMPORT kw2=TABLE | kw1=SHOW kw2=COMPACTIONS | kw1=SHOW kw2=CREATE kw3=TABLE | kw1=SHOW kw2=TRANSACTIONS | kw1=SHOW kw2=INDEXES | kw1=SHOW kw2=LOCKS | kw1=CREATE kw2=INDEX | kw1=DROP kw2=INDEX | kw1=ALTER kw2=INDEX | kw1=LOCK kw2=TABLE | kw1=LOCK kw2=DATABASE | kw1=UNLOCK kw2=TABLE | kw1=UNLOCK kw2=DATABASE | kw1=CREATE kw2=TEMPORARY kw3=MACRO | kw1=DROP kw2=TEMPORARY kw3=MACRO | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=CLUSTERED | kw1=ALTER kw2=TABLE tableIdentifier kw3=CLUSTERED kw4=BY | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SORTED | kw1=ALTER kw2=TABLE tableIdentifier kw3=SKEWED kw4=BY | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SKEWED | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=STORED kw5=AS kw6=DIRECTORIES | kw1=ALTER kw2=TABLE tableIdentifier kw3=SET kw4=SKEWED kw5=LOCATION | kw1=ALTER kw2=TABLE tableIdentifier kw3=EXCHANGE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=ARCHIVE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=UNARCHIVE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=TOUCH | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=COMPACT | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=CONCATENATE | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=SET kw4=FILEFORMAT | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=REPLACE kw4=COLUMNS | kw1=START kw2=TRANSACTION | kw1=COMMIT | kw1=ROLLBACK | kw1=DFS | kw1=DELETE kw2=FROM ; createTableHeader : CREATE TEMPORARY? EXTERNAL? TABLE (IF NOT EXISTS)? multipartIdentifier ; replaceTableHeader : (CREATE OR)? REPLACE TABLE multipartIdentifier ; bucketSpec : CLUSTERED BY identifierList (SORTED BY orderedIdentifierList)? INTO INTEGER_VALUE BUCKETS ; skewSpec : SKEWED BY identifierList ON (constantList | nestedConstantList) (STORED AS DIRECTORIES)? ; locationSpec : LOCATION STRING ; query : ctes? queryTerm queryOrganization ; insertInto : INSERT OVERWRITE TABLE? multipartIdentifier (partitionSpec (IF NOT EXISTS)?)? #insertOverwriteTable | INSERT INTO TABLE? multipartIdentifier partitionSpec? (IF NOT EXISTS)? #insertIntoTable | INSERT OVERWRITE LOCAL? DIRECTORY path=STRING rowFormat? createFileFormat? #insertOverwriteHiveDir | INSERT OVERWRITE LOCAL? DIRECTORY (path=STRING)? tableProvider (OPTIONS options=tablePropertyList)? #insertOverwriteDir ; partitionSpecLocation : partitionSpec locationSpec? ; partitionSpec : PARTITION '(' partitionVal (',' partitionVal)* ')' ; partitionVal : identifier (EQ constant)? ; database : DATABASE | SCHEMA ; describeFuncName : qualifiedName | STRING | comparisonOperator | arithmeticOperator | predicateOperator ; describeColName : nameParts+=identifier ('.' nameParts+=identifier)* ; ctes : WITH namedQuery (',' namedQuery)* ; namedQuery : name=errorCapturingIdentifier (columnAliases=identifierList)? AS? '(' query ')' ; tableProvider : USING qualifiedName ; tablePropertyList : '(' tableProperty (',' tableProperty)* ')' ; tableProperty : key=tablePropertyKey (EQ? value=tablePropertyValue)? ; tablePropertyKey : identifier ('.' identifier)* | STRING ; tablePropertyValue : INTEGER_VALUE | DECIMAL_VALUE | booleanValue | STRING ; constantList : '(' constant (',' constant)* ')' ; nestedConstantList : '(' constantList (',' constantList)* ')' ; createFileFormat : STORED AS fileFormat | STORED BY storageHandler ; fileFormat : INPUTFORMAT inFmt=STRING OUTPUTFORMAT outFmt=STRING #tableFileFormat | identifier #genericFileFormat ; storageHandler : STRING (WITH SERDEPROPERTIES tablePropertyList)? ; resource : identifier STRING ; dmlStatementNoWith : insertInto queryTerm queryOrganization #singleInsertQuery | fromClause multiInsertQueryBody+ #multiInsertQuery ; queryOrganization : (ORDER BY order+=sortItem (',' order+=sortItem)*)? (CLUSTER BY clusterBy+=expression (',' clusterBy+=expression)*)? (DISTRIBUTE BY distributeBy+=expression (',' distributeBy+=expression)*)? (SORT BY sort+=sortItem (',' sort+=sortItem)*)? windowClause? (LIMIT (ALL | limit=expression))? ; multiInsertQueryBody : insertInto fromStatementBody ; queryTerm : queryPrimary #queryTermDefault | left=queryTerm {legacy_setops_precedence_enbled}? operator=(INTERSECT | UNION | EXCEPT | SETMINUS) setQuantifier? right=queryTerm #setOperation | left=queryTerm {!legacy_setops_precedence_enbled}? operator=INTERSECT setQuantifier? right=queryTerm #setOperation | left=queryTerm {!legacy_setops_precedence_enbled}? operator=(UNION | EXCEPT | SETMINUS) setQuantifier? right=queryTerm #setOperation ; queryPrimary : querySpecification #queryPrimaryDefault | fromStatement #fromStmt | TABLE multipartIdentifier #table | inlineTable #inlineTableDefault1 | '(' query ')' #subquery ; sortItem : expression ordering=(ASC | DESC)? (NULLS nullOrder=(LAST | FIRST))? ; fromStatement : fromClause fromStatementBody+ ; fromStatementBody : transformClause whereClause? queryOrganization | selectClause lateralView* whereClause? aggregationClause? havingClause? windowClause? queryOrganization ; querySpecification : transformClause fromClause? whereClause? #transformQuerySpecification | selectClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause? #regularQuerySpecification ; transformClause : (SELECT kind=TRANSFORM '(' namedExpressionSeq ')' | kind=MAP namedExpressionSeq | kind=REDUCE namedExpressionSeq) inRowFormat=rowFormat? (RECORDWRITER recordWriter=STRING)? USING script=STRING (AS (identifierSeq | colTypeList | ('(' (identifierSeq | colTypeList) ')')))? outRowFormat=rowFormat? (RECORDREADER recordReader=STRING)? ; selectClause : SELECT (hints+=hint)* setQuantifier? namedExpressionSeq ; setClause : SET assign (',' assign)* ; assign : key=multipartIdentifier EQ value=expression ; whereClause : WHERE booleanExpression ; havingClause : HAVING booleanExpression ; hint : '/*+' hintStatements+=hintStatement (','? hintStatements+=hintStatement)* '*/' ; hintStatement : hintName=identifier | hintName=identifier '(' parameters+=primaryExpression (',' parameters+=primaryExpression)* ')' ; fromClause : FROM relation (',' relation)* lateralView* pivotClause? ; aggregationClause : GROUP BY groupingExpressions+=expression (',' groupingExpressions+=expression)* ( WITH kind=ROLLUP | WITH kind=CUBE | kind=GROUPING SETS '(' groupingSet (',' groupingSet)* ')')? | GROUP BY kind=GROUPING SETS '(' groupingSet (',' groupingSet)* ')' ; groupingSet : '(' (expression (',' expression)*)? ')' | expression ; pivotClause : PIVOT '(' aggregates=namedExpressionSeq FOR pivotColumn IN '(' pivotValues+=pivotValue (',' pivotValues+=pivotValue)* ')' ')' ; pivotColumn : identifiers+=identifier | '(' identifiers+=identifier (',' identifiers+=identifier)* ')' ; pivotValue : expression (AS? identifier)? ; lateralView : LATERAL VIEW (OUTER)? qualifiedName '(' (expression (',' expression)*)? ')' tblName=identifier (AS? colName+=identifier (',' colName+=identifier)*)? ; setQuantifier : DISTINCT | ALL ; relation : relationPrimary joinRelation* ; joinRelation : (joinType) JOIN right=relationPrimary joinCriteria? | NATURAL joinType JOIN right=relationPrimary ; joinType : INNER? | CROSS | LEFT OUTER? | LEFT? SEMI | RIGHT OUTER? | FULL OUTER? | LEFT? ANTI ; joinCriteria : ON booleanExpression | USING identifierList ; sample : TABLESAMPLE '(' sampleMethod? ')' ; sampleMethod : negativeSign=MINUS? percentage=(INTEGER_VALUE | DECIMAL_VALUE) PERCENTLIT #sampleByPercentile | expression ROWS #sampleByRows | sampleType=BUCKET numerator=INTEGER_VALUE OUT OF denominator=INTEGER_VALUE (ON (identifier | qualifiedName '(' ')'))? #sampleByBucket | bytes=expression #sampleByBytes ; identifierList : '(' identifierSeq ')' ; identifierSeq : ident+=errorCapturingIdentifier (',' ident+=errorCapturingIdentifier)* ; orderedIdentifierList : '(' orderedIdentifier (',' orderedIdentifier)* ')' ; orderedIdentifier : ident=errorCapturingIdentifier ordering=(ASC | DESC)? ; identifierCommentList : '(' identifierComment (',' identifierComment)* ')' ; identifierComment : identifier (COMMENT STRING)? ; relationPrimary : multipartIdentifier sample? tableAlias #tableName | '(' query ')' sample? tableAlias #aliasedQuery | '(' relation ')' sample? tableAlias #aliasedRelation | inlineTable #inlineTableDefault2 | functionTable #tableValuedFunction ; inlineTable : VALUES expression (',' expression)* tableAlias ; functionTable : funcName=errorCapturingIdentifier '(' (expression (',' expression)*)? ')' tableAlias ; tableAlias : (AS? strictIdentifier identifierList?)? ; rowFormat : ROW FORMAT SERDE name=STRING (WITH SERDEPROPERTIES props=tablePropertyList)? #rowFormatSerde | ROW FORMAT DELIMITED (FIELDS TERMINATED BY fieldsTerminatedBy=STRING (ESCAPED BY escapedBy=STRING)?)? (COLLECTION ITEMS TERMINATED BY collectionItemsTerminatedBy=STRING)? (MAP KEYS TERMINATED BY keysTerminatedBy=STRING)? (LINES TERMINATED BY linesSeparatedBy=STRING)? (NULL DEFINED AS nullDefinedAs=STRING)? #rowFormatDelimited ; multipartIdentifier : parts+=errorCapturingIdentifier ('.' parts+=errorCapturingIdentifier)* ; tableIdentifier : (db=errorCapturingIdentifier '.')? table=errorCapturingIdentifier ; functionIdentifier : (db=errorCapturingIdentifier '.')? function=errorCapturingIdentifier ; namedExpression : expression (AS? (name=errorCapturingIdentifier | identifierList))? ; namedExpressionSeq : namedExpression (',' namedExpression)* ; transformList : '(' transforms+=transform (',' transforms+=transform)* ')' ; transform : qualifiedName #identityTransform | transformName=identifier '(' argument+=transformArgument (',' argument+=transformArgument)* ')' #applyTransform ; transformArgument : qualifiedName | constant ; expression : booleanExpression ; booleanExpression : NOT booleanExpression #logicalNot | EXISTS '(' query ')' #exists | valueExpression predicate? #predicated | left=booleanExpression operator=AND right=booleanExpression #logicalBinary | left=booleanExpression operator=OR right=booleanExpression #logicalBinary ; predicate : NOT? kind=BETWEEN lower=valueExpression AND upper=valueExpression | NOT? kind=IN '(' expression (',' expression)* ')' | NOT? kind=IN '(' query ')' | NOT? kind=(RLIKE | LIKE) pattern=valueExpression | IS NOT? kind=NULL | IS NOT? kind=(TRUE | FALSE | UNKNOWN) | IS NOT? kind=DISTINCT FROM right=valueExpression ; valueExpression : primaryExpression #valueExpressionDefault | operator=(MINUS | PLUS | TILDE) valueExpression #arithmeticUnary | left=valueExpression operator=(ASTERISK | SLASH | PERCENT | DIV) right=valueExpression #arithmeticBinary | left=valueExpression operator=(PLUS | MINUS | CONCAT_PIPE) right=valueExpression #arithmeticBinary | left=valueExpression operator=AMPERSAND right=valueExpression #arithmeticBinary | left=valueExpression operator=HAT right=valueExpression #arithmeticBinary | left=valueExpression operator=PIPE right=valueExpression #arithmeticBinary | left=valueExpression comparisonOperator right=valueExpression #comparison ; primaryExpression : name=(CURRENT_DATE | CURRENT_TIMESTAMP) #currentDatetime | CASE whenClause+ (ELSE elseExpression=expression)? END #searchedCase | CASE value=expression whenClause+ (ELSE elseExpression=expression)? END #simpleCase | CAST '(' expression AS dataType ')' #cast | STRUCT '(' (argument+=namedExpression (',' argument+=namedExpression)*)? ')' #struct | (FIRST | FIRST_VALUE) '(' expression ((IGNORE | RESPECT) NULLS)? ')' #first | (LAST | LAST_VALUE) '(' expression ((IGNORE | RESPECT) NULLS)? ')' #last | POSITION '(' substr=valueExpression IN str=valueExpression ')' #position | constant #constantDefault | ASTERISK #star | qualifiedName '.' ASTERISK #star | '(' namedExpression (',' namedExpression)+ ')' #rowConstructor | '(' query ')' #subqueryExpression | qualifiedName '(' (setQuantifier? argument+=expression (',' argument+=expression)*)? ')' (OVER windowSpec)? #functionCall | IDENTIFIER '->' expression #lambda | '(' IDENTIFIER (',' IDENTIFIER)+ ')' '->' expression #lambda | value=primaryExpression '[' index=valueExpression ']' #subscript | identifier #columnReference | base=primaryExpression '.' fieldName=identifier #dereference | '(' expression ')' #parenthesizedExpression | EXTRACT '(' field=identifier FROM source=valueExpression ')' #extract | (SUBSTR | SUBSTRING) '(' str=valueExpression (FROM | ',') pos=valueExpression ((FOR | ',') len=valueExpression)? ')' #substring | TRIM '(' trimOption=(BOTH | LEADING | TRAILING)? (trimStr=valueExpression)? FROM srcStr=valueExpression ')' #trim | OVERLAY '(' input=valueExpression PLACING replace=valueExpression FROM position=valueExpression (FOR length=valueExpression)? ')' #overlay ; constant : NULL #nullLiteral | interval #intervalLiteral | identifier STRING #typeConstructor | number #numericLiteral | booleanValue #booleanLiteral | STRING+ #stringLiteral ; comparisonOperator : EQ | NEQ | NEQJ | LT | LTE | GT | GTE | NSEQ ; arithmeticOperator : PLUS | MINUS | ASTERISK | SLASH | PERCENT | DIV | TILDE | AMPERSAND | PIPE | CONCAT_PIPE | HAT ; predicateOperator : OR | AND | IN | NOT ; booleanValue : TRUE | FALSE ; interval : {ansi}? INTERVAL? intervalField+ | {!ansi}? INTERVAL intervalField* ; intervalField : value=intervalValue unit=intervalUnit (TO to=intervalUnit)? ; intervalValue : (PLUS | MINUS)? (INTEGER_VALUE | DECIMAL_VALUE) | STRING ; intervalUnit : DAY | DAYS | HOUR | HOURS | MICROSECOND | MICROSECONDS | MILLISECOND | MILLISECONDS | MINUTE | MINUTES | MONTH | MONTHS | SECOND | SECONDS | WEEK | WEEKS | YEAR | YEARS ; colPosition : FIRST | AFTER qualifiedName ; dataType : complex=ARRAY '<' dataType '>' #complexDataType | complex=MAP '<' dataType ',' dataType '>' #complexDataType | complex=STRUCT ('<' complexColTypeList? '>' | NEQ) #complexDataType | identifier ('(' INTEGER_VALUE (',' INTEGER_VALUE)* ')')? #primitiveDataType ; qualifiedColTypeWithPositionList : qualifiedColTypeWithPosition (',' qualifiedColTypeWithPosition)* ; qualifiedColTypeWithPosition : name=qualifiedName dataType (COMMENT comment=STRING)? colPosition? ; colTypeList : colType (',' colType)* ; colType : colName=errorCapturingIdentifier dataType (COMMENT STRING)? ; complexColTypeList : complexColType (',' complexColType)* ; complexColType : identifier ':' dataType (COMMENT STRING)? ; whenClause : WHEN condition=expression THEN result=expression ; windowClause : WINDOW namedWindow (',' namedWindow)* ; namedWindow : name=errorCapturingIdentifier AS windowSpec ; windowSpec : name=errorCapturingIdentifier #windowRef | '('name=errorCapturingIdentifier')' #windowRef | '(' ( CLUSTER BY partition+=expression (',' partition+=expression)* | ((PARTITION | DISTRIBUTE) BY partition+=expression (',' partition+=expression)*)? ((ORDER | SORT) BY sortItem (',' sortItem)*)?) windowFrame? ')' #windowDef ; windowFrame : frameType=RANGE start=frameBound | frameType=ROWS start=frameBound | frameType=RANGE BETWEEN start=frameBound AND end=frameBound | frameType=ROWS BETWEEN start=frameBound AND end=frameBound ; frameBound : UNBOUNDED boundType=(PRECEDING | FOLLOWING) | boundType=CURRENT ROW | expression boundType=(PRECEDING | FOLLOWING) ; qualifiedNameList : qualifiedName (',' qualifiedName)* ; qualifiedName : identifier ('.' identifier)* ; // this rule is used for explicitly capturing wrong identifiers such as test-table, which should actually be `test-table` // replace identifier with errorCapturingIdentifier where the immediate follow symbol is not an expression, otherwise // valid expressions such as ""a-b"" can be recognized as an identifier errorCapturingIdentifier : identifier errorCapturingIdentifierExtra ; // extra left-factoring grammar errorCapturingIdentifierExtra : (MINUS identifier)+ #errorIdent | #realIdent ; identifier : strictIdentifier | {!ansi}? strictNonReserved ; strictIdentifier : IDENTIFIER #unquotedIdentifier | quotedIdentifier #quotedIdentifierAlternative | {ansi}? ansiNonReserved #unquotedIdentifier | {!ansi}? nonReserved #unquotedIdentifier ; quotedIdentifier : BACKQUOTED_IDENTIFIER ; number : MINUS? DECIMAL_VALUE #decimalLiteral | MINUS? INTEGER_VALUE #integerLiteral | MINUS? BIGINT_LITERAL #bigIntLiteral | MINUS? SMALLINT_LITERAL #smallIntLiteral | MINUS? TINYINT_LITERAL #tinyIntLiteral | MINUS? DOUBLE_LITERAL #doubleLiteral | MINUS? BIGDECIMAL_LITERAL #bigDecimalLiteral ; // When `spark.sql.parser.ansi.enabled=true`, there are 2 kinds of keywords in Spark SQL. // - Reserved keywords: // Keywords that are reserved and can't be used as identifiers for table, view, column, // function, alias, etc. // - Non-reserved keywords: // Keywords that have a special meaning only in particular contexts and can be used as // identifiers in other contexts. For example, `SELECT 1 WEEK` is an interval literal, but WEEK // can be used as identifiers in other places. // You can find the full keywords list by searching ""Start of the keywords list"" in this file. // The non-reserved keywords are listed below. Keywords not in this list are reserved keywords. ansiNonReserved : ADD | AFTER | ALTER | ANALYZE | ARCHIVE | ARRAY | ASC | AT | BETWEEN | BUCKET | BUCKETS | BY | CACHE | CASCADE | CHANGE | CLEAR | CLUSTER | CLUSTERED | CODEGEN | COLLECTION | COLUMNS | COMMENT | COMMIT | COMPACT | COMPACTIONS | COMPUTE | CONCATENATE | COST | CUBE | CURRENT | DATA | DATABASE | DATABASES | DAYS | DBPROPERTIES | DEFINED | DELETE | DELIMITED | DESC | DESCRIBE | DFS | DIRECTORIES | DIRECTORY | DISTRIBUTE | DIV | DROP | ESCAPED | EXCHANGE | EXISTS | EXPLAIN | EXPORT | EXTENDED | EXTERNAL | EXTRACT | FIELDS | FILEFORMAT | FIRST | FOLLOWING | FORMAT | FORMATTED | FUNCTION | FUNCTIONS | GLOBAL | GROUPING | HOURS | IF | IGNORE | IMPORT | INDEX | INDEXES | INPATH | INPUTFORMAT | INSERT | INTERVAL | ITEMS | KEYS | LAST | LATERAL | LAZY | LIKE | LIMIT | LINES | LIST | LOAD | LOCAL | LOCATION | LOCK | LOCKS | LOGICAL | MACRO | MAP | MICROSECOND | MICROSECONDS | MILLISECOND | MILLISECONDS | MINUTES | MONTHS | MSCK | NAMESPACE | NAMESPACES | NO | NULLS | OF | OPTION | OPTIONS | OUT | OUTPUTFORMAT | OVER | OVERLAY | OVERWRITE | PARTITION | PARTITIONED | PARTITIONS | PERCENTLIT | PIVOT | PLACING | POSITION | PRECEDING | PRINCIPALS | PURGE | QUERY | RANGE | RECORDREADER | RECORDWRITER | RECOVER | REDUCE | REFRESH | RENAME | REPAIR | REPLACE | RESET | RESPECT | RESTRICT | REVOKE | RLIKE | ROLE | ROLES | ROLLBACK | ROLLUP | ROW | ROWS | SCHEMA | SECONDS | SEPARATED | SERDE | SERDEPROPERTIES | SET | SETS | SHOW | SKEWED | SORT | SORTED | START | STATISTICS | STORED | STRATIFY | STRUCT | SUBSTR | SUBSTRING | TABLES | TABLESAMPLE | TBLPROPERTIES | TEMPORARY | TERMINATED | TOUCH | TRANSACTION | TRANSACTIONS | TRANSFORM | TRIM | TRUE | TRUNCATE | UNARCHIVE | UNBOUNDED | UNCACHE | UNLOCK | UNSET | UPDATE | USE | VALUES | VIEW | WEEK | WEEKS | WINDOW | YEARS ; // When `spark.sql.parser.ansi.enabled=false`, there are 2 kinds of keywords in Spark SQL. // - Non-reserved keywords: // Same definition as the one when `spark.sql.parser.ansi.enabled=true`. // - Strict-non-reserved keywords: // A strict version of non-reserved keywords, which can not be used as table alias. // You can find the full keywords list by searching ""Start of the keywords list"" in this file. // The strict-non-reserved keywords are listed in `strictNonReserved`. // The non-reserved keywords are listed in `nonReserved`. // These 2 together contain all the keywords. strictNonReserved : ANTI | CROSS | EXCEPT | FULL | INNER | INTERSECT | JOIN | LEFT | NATURAL | ON | RIGHT | SEMI | SETMINUS | UNION | USING ; nonReserved : ADD | AFTER | ALL | ALTER | ANALYZE | AND | ANY | ARCHIVE | ARRAY | AS | ASC | AT | AUTHORIZATION | BETWEEN | BOTH | BUCKET | BUCKETS | BY | CACHE | CASCADE | CASE | CAST | CHANGE | CHECK | CLEAR | CLUSTER | CLUSTERED | CODEGEN | COLLATE | COLLECTION | COLUMN | COLUMNS | COMMENT | COMMIT | COMPACT | COMPACTIONS | COMPUTE | CONCATENATE | CONSTRAINT | COST | CREATE | CUBE | CURRENT | CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP | CURRENT_USER | DATA | DATABASE | DATABASES | DAY | DAYS | DBPROPERTIES | DEFINED | DELETE | DELIMITED | DESC | DESCRIBE | DFS | DIRECTORIES | DIRECTORY | DISTINCT | DISTRIBUTE | DIV | DROP | ELSE | END | ESCAPED | EXCHANGE | EXISTS | EXPLAIN | EXPORT | EXTENDED | EXTERNAL | EXTRACT | FALSE | FETCH | FIELDS | FILEFORMAT | FIRST | FIRST_VALUE | FOLLOWING | FOR | FOREIGN | FORMAT | FORMATTED | FROM | FUNCTION | FUNCTIONS | GLOBAL | GRANT | GROUP | GROUPING | HAVING | HOUR | HOURS | IF | IGNORE | IMPORT | IN | INDEX | INDEXES | INPATH | INPUTFORMAT | INSERT | INTERVAL | INTO | IS | ITEMS | KEYS | LAST | LAST_VALUE | LATERAL | LAZY | LEADING | LIKE | LIMIT | LINES | LIST | LOAD | LOCAL | LOCATION | LOCK | LOCKS | LOGICAL | MACRO | MAP | MICROSECOND | MICROSECONDS | MILLISECOND | MILLISECONDS | MINUTE | MINUTES | MONTH | MONTHS | MSCK | NAMESPACE | NAMESPACES | NO | NOT | NULL | NULLS | OF | ONLY | OPTION | OPTIONS | OR | ORDER | OUT | OUTER | OUTPUTFORMAT | OVER | OVERLAPS | OVERLAY | OVERWRITE | PARTITION | PARTITIONED | PARTITIONS | PERCENTLIT | PIVOT | PLACING | POSITION | PRECEDING | PRIMARY | PRINCIPALS | PURGE | QUERY | RANGE | RECORDREADER | RECORDWRITER | RECOVER | REDUCE | REFERENCES | REFRESH | RENAME | REPAIR | REPLACE | RESET | RESPECT | RESTRICT | REVOKE | RLIKE | ROLE | ROLES | ROLLBACK | ROLLUP | ROW | ROWS | SCHEMA | SECOND | SECONDS | SELECT | SEPARATED | SERDE | SERDEPROPERTIES | SESSION_USER | SET | SETS | SHOW | SKEWED | SOME | SORT | SORTED | START | STATISTICS | STORED | STRATIFY | STRUCT | SUBSTR | SUBSTRING | TABLE | TABLES | TABLESAMPLE | TBLPROPERTIES | TEMPORARY | TERMINATED | THEN | TO | TOUCH | TRAILING | TRANSACTION | TRANSACTIONS | TRANSFORM | TRIM | TRUE | TRUNCATE | TYPE | UNARCHIVE | UNBOUNDED | UNCACHE | UNIQUE | UNKNOWN | UNLOCK | UNSET | UPDATE | USE | USER | VALUES | VIEW | WEEK | WEEKS | WHEN | WHERE | WINDOW | WITH | YEAR | YEARS ; // NOTE: If you add a new token in the list below, you should update the list of keywords // in `docs/sql-keywords.md`. If the token is a non-reserved keyword, // please update `ansiNonReserved` and `nonReserved` as well. //============================ // Start of the keywords list //============================ ADD: 'ADD'; AFTER: 'AFTER'; ALL: 'ALL'; ALTER: 'ALTER'; ANALYZE: 'ANALYZE'; AND: 'AND'; ANTI: 'ANTI'; ANY: 'ANY'; ARCHIVE: 'ARCHIVE'; ARRAY: 'ARRAY'; AS: 'AS'; ASC: 'ASC'; AT: 'AT'; AUTHORIZATION: 'AUTHORIZATION'; BETWEEN: 'BETWEEN'; BOTH: 'BOTH'; BUCKET: 'BUCKET'; BUCKETS: 'BUCKETS'; BY: 'BY'; CACHE: 'CACHE'; CASCADE: 'CASCADE'; CASE: 'CASE'; CAST: 'CAST'; CHANGE: 'CHANGE'; CHECK: 'CHECK'; CLEAR: 'CLEAR'; CLUSTER: 'CLUSTER'; CLUSTERED: 'CLUSTERED'; CODEGEN: 'CODEGEN'; COLLATE: 'COLLATE'; COLLECTION: 'COLLECTION'; COLUMN: 'COLUMN'; COLUMNS: 'COLUMNS'; COMMENT: 'COMMENT'; COMMIT: 'COMMIT'; COMPACT: 'COMPACT'; COMPACTIONS: 'COMPACTIONS'; COMPUTE: 'COMPUTE'; CONCATENATE: 'CONCATENATE'; CONSTRAINT: 'CONSTRAINT'; COST: 'COST'; CREATE: 'CREATE'; CROSS: 'CROSS'; CUBE: 'CUBE'; CURRENT: 'CURRENT'; CURRENT_DATE: 'CURRENT_DATE'; CURRENT_TIME: 'CURRENT_TIME'; CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; CURRENT_USER: 'CURRENT_USER'; DATA: 'DATA'; DATABASE: 'DATABASE'; DATABASES: 'DATABASES' | 'SCHEMAS'; DAY: 'DAY'; DAYS: 'DAYS'; DBPROPERTIES: 'DBPROPERTIES'; DEFINED: 'DEFINED'; DELETE: 'DELETE'; DELIMITED: 'DELIMITED'; DESC: 'DESC'; DESCRIBE: 'DESCRIBE'; DFS: 'DFS'; DIRECTORIES: 'DIRECTORIES'; DIRECTORY: 'DIRECTORY'; DISTINCT: 'DISTINCT'; DISTRIBUTE: 'DISTRIBUTE'; DROP: 'DROP'; ELSE: 'ELSE'; END: 'END'; ESCAPED: 'ESCAPED'; EXCEPT: 'EXCEPT'; EXCHANGE: 'EXCHANGE'; EXISTS: 'EXISTS'; EXPLAIN: 'EXPLAIN'; EXPORT: 'EXPORT'; EXTENDED: 'EXTENDED'; EXTERNAL: 'EXTERNAL'; EXTRACT: 'EXTRACT'; FALSE: 'FALSE'; FETCH: 'FETCH'; FIELDS: 'FIELDS'; FILEFORMAT: 'FILEFORMAT'; FIRST: 'FIRST'; FIRST_VALUE: 'FIRST_VALUE'; FOLLOWING: 'FOLLOWING'; FOR: 'FOR'; FOREIGN: 'FOREIGN'; FORMAT: 'FORMAT'; FORMATTED: 'FORMATTED'; FROM: 'FROM'; FULL: 'FULL'; FUNCTION: 'FUNCTION'; FUNCTIONS: 'FUNCTIONS'; GLOBAL: 'GLOBAL'; GRANT: 'GRANT'; GROUP: 'GROUP'; GROUPING: 'GROUPING'; HAVING: 'HAVING'; HOUR: 'HOUR'; HOURS: 'HOURS'; IF: 'IF'; IGNORE: 'IGNORE'; IMPORT: 'IMPORT'; IN: 'IN'; INDEX: 'INDEX'; INDEXES: 'INDEXES'; INNER: 'INNER'; INPATH: 'INPATH'; INPUTFORMAT: 'INPUTFORMAT'; INSERT: 'INSERT'; INTERSECT: 'INTERSECT'; INTERVAL: 'INTERVAL'; INTO: 'INTO'; IS: 'IS'; ITEMS: 'ITEMS'; JOIN: 'JOIN'; KEYS: 'KEYS'; LAST: 'LAST'; LAST_VALUE: 'LAST_VALUE'; LATERAL: 'LATERAL'; LAZY: 'LAZY'; LEADING: 'LEADING'; LEFT: 'LEFT'; LIKE: 'LIKE'; LIMIT: 'LIMIT'; LINES: 'LINES'; LIST: 'LIST'; LOAD: 'LOAD'; LOCAL: 'LOCAL'; LOCATION: 'LOCATION'; LOCK: 'LOCK'; LOCKS: 'LOCKS'; LOGICAL: 'LOGICAL'; MACRO: 'MACRO'; MAP: 'MAP'; MICROSECOND: 'MICROSECOND'; MICROSECONDS: 'MICROSECONDS'; MILLISECOND: 'MILLISECOND'; MILLISECONDS: 'MILLISECONDS'; MINUTE: 'MINUTE'; MINUTES: 'MINUTES'; MONTH: 'MONTH'; MONTHS: 'MONTHS'; MSCK: 'MSCK'; NAMESPACE: 'NAMESPACE'; NAMESPACES: 'NAMESPACES'; NATURAL: 'NATURAL'; NO: 'NO'; NOT: 'NOT' | '!'; NULL: 'NULL'; NULLS: 'NULLS'; OF: 'OF'; ON: 'ON'; ONLY: 'ONLY'; OPTION: 'OPTION'; OPTIONS: 'OPTIONS'; OR: 'OR'; ORDER: 'ORDER'; OUT: 'OUT'; OUTER: 'OUTER'; OUTPUTFORMAT: 'OUTPUTFORMAT'; OVER: 'OVER'; OVERLAPS: 'OVERLAPS'; OVERLAY: 'OVERLAY'; OVERWRITE: 'OVERWRITE'; PARTITION: 'PARTITION'; PARTITIONED: 'PARTITIONED'; PARTITIONS: 'PARTITIONS'; PERCENTLIT: 'PERCENT'; PIVOT: 'PIVOT'; PLACING: 'PLACING'; POSITION: 'POSITION'; PRECEDING: 'PRECEDING'; PRIMARY: 'PRIMARY'; PRINCIPALS: 'PRINCIPALS'; PURGE: 'PURGE'; QUERY: 'QUERY'; RANGE: 'RANGE'; RECORDREADER: 'RECORDREADER'; RECORDWRITER: 'RECORDWRITER'; RECOVER: 'RECOVER'; REDUCE: 'REDUCE'; REFERENCES: 'REFERENCES'; REFRESH: 'REFRESH'; RENAME: 'RENAME'; REPAIR: 'REPAIR'; REPLACE: 'REPLACE'; RESET: 'RESET'; RESPECT: 'RESPECT'; RESTRICT: 'RESTRICT'; REVOKE: 'REVOKE'; RIGHT: 'RIGHT'; RLIKE: 'RLIKE' | 'REGEXP'; ROLE: 'ROLE'; ROLES: 'ROLES'; ROLLBACK: 'ROLLBACK'; ROLLUP: 'ROLLUP'; ROW: 'ROW'; ROWS: 'ROWS'; SCHEMA: 'SCHEMA'; SECOND: 'SECOND'; SECONDS: 'SECONDS'; SELECT: 'SELECT'; SEMI: 'SEMI'; SEPARATED: 'SEPARATED'; SERDE: 'SERDE'; SERDEPROPERTIES: 'SERDEPROPERTIES'; SESSION_USER: 'SESSION_USER'; SET: 'SET'; SETMINUS: 'MINUS'; SETS: 'SETS'; SHOW: 'SHOW'; SKEWED: 'SKEWED'; SOME: 'SOME'; SORT: 'SORT'; SORTED: 'SORTED'; START: 'START'; STATISTICS: 'STATISTICS'; STORED: 'STORED'; STRATIFY: 'STRATIFY'; STRUCT: 'STRUCT'; SUBSTR: 'SUBSTR'; SUBSTRING: 'SUBSTRING'; TABLE: 'TABLE'; TABLES: 'TABLES'; TABLESAMPLE: 'TABLESAMPLE'; TBLPROPERTIES: 'TBLPROPERTIES'; TEMPORARY: 'TEMPORARY' | 'TEMP'; TERMINATED: 'TERMINATED'; THEN: 'THEN'; TO: 'TO'; TOUCH: 'TOUCH'; TRAILING: 'TRAILING'; TRANSACTION: 'TRANSACTION'; TRANSACTIONS: 'TRANSACTIONS'; TRANSFORM: 'TRANSFORM'; TRIM: 'TRIM'; TRUE: 'TRUE'; TRUNCATE: 'TRUNCATE'; TYPE: 'TYPE'; UNARCHIVE: 'UNARCHIVE'; UNBOUNDED: 'UNBOUNDED'; UNCACHE: 'UNCACHE'; UNION: 'UNION'; UNIQUE: 'UNIQUE'; UNKNOWN: 'UNKNOWN'; UNLOCK: 'UNLOCK'; UNSET: 'UNSET'; UPDATE: 'UPDATE'; USE: 'USE'; USER: 'USER'; USING: 'USING'; VALUES: 'VALUES'; VIEW: 'VIEW'; WEEK: 'WEEK'; WEEKS: 'WEEKS'; WHEN: 'WHEN'; WHERE: 'WHERE'; WINDOW: 'WINDOW'; WITH: 'WITH'; YEAR: 'YEAR'; YEARS: 'YEARS'; //============================ // End of the keywords list //============================ EQ : '=' | '=='; NSEQ: '<=>'; NEQ : '<>'; NEQJ: '!='; LT : '<'; LTE : '<=' | '!>'; GT : '>'; GTE : '>=' | '!<'; PLUS: '+'; MINUS: '-'; ASTERISK: '*'; SLASH: '/'; PERCENT: '%'; DIV: 'DIV'; TILDE: '~'; AMPERSAND: '&'; PIPE: '|'; CONCAT_PIPE: '||'; HAT: '^'; STRING : '\\'' ( ~('\\''|'\\\\') | ('\\\\' .) )* '\\'' | '""' ( ~('""'|'\\\\') | ('\\\\' .) )* '""' ; BIGINT_LITERAL : DIGIT+ 'L' ; SMALLINT_LITERAL : DIGIT+ 'S' ; TINYINT_LITERAL : DIGIT+ 'Y' ; INTEGER_VALUE : DIGIT+ ; DECIMAL_VALUE : DIGIT+ EXPONENT | DECIMAL_DIGITS EXPONENT? {isValidDecimal()}? ; DOUBLE_LITERAL : DIGIT+ EXPONENT? 'D' | DECIMAL_DIGITS EXPONENT? 'D' {isValidDecimal()}? ; BIGDECIMAL_LITERAL : DIGIT+ EXPONENT? 'BD' | DECIMAL_DIGITS EXPONENT? 'BD' {isValidDecimal()}? ; IDENTIFIER : (LETTER | DIGIT | '_')+ ; BACKQUOTED_IDENTIFIER : '`' ( ~'`' | '``' )* '`' ; fragment DECIMAL_DIGITS : DIGIT+ '.' DIGIT* | '.' DIGIT+ ; fragment EXPONENT : 'E' [+-]? DIGIT+ ; fragment DIGIT : [0-9] ; fragment LETTER : [A-Z] ; SIMPLE_COMMENT : '--' ~[\\r\\n]* '\\r'? '\\n'? -> channel(HIDDEN) ; BRACKETED_EMPTY_COMMENT : '/**/' -> channel(HIDDEN) ; BRACKETED_COMMENT : '/*' ~[+] .*? '*/' -> channel(HIDDEN) ; WS : [ \\r\\n\\t]+ -> channel(HIDDEN) ; // Catch-all for anything we can't recognize. // We use this to be able to ignore and recover all the text // when splitting statements with DelimiterLexer UNRECOGNIZED : . ; ",12057,False,2239.8859712161725,median "/* * 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. * * This file is an adaptation of Presto's presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4 grammar. */ grammar SqlBase; @members { /** * When false, INTERSECT is given the greater precedence over the other set * operations (UNION, EXCEPT and MINUS) as per the SQL standard. */ public boolean legacy_setops_precedence_enbled = false; /** * Verify whether current token is a valid decimal token (which contains dot). * Returns true if the character that follows the token is not a digit or letter or underscore. * * For example: * For char stream ""2.3"", ""2."" is not a valid decimal token, because it is followed by digit '3'. * For char stream ""2.3_"", ""2.3"" is not a valid decimal token, because it is followed by '_'. * For char stream ""2.3W"", ""2.3"" is not a valid decimal token, because it is followed by 'W'. * For char stream ""12.0D 34.E2+0.12 "" 12.0D is a valid decimal token because it is followed * by a space. 34.E2 is a valid decimal token because it is followed by symbol '+' * which is not a digit or letter or underscore. */ public boolean isValidDecimal() { int nextChar = _input.LA(1); if (nextChar >= 'A' && nextChar <= 'Z' || nextChar >= '0' && nextChar <= '9' || nextChar == '_') { return false; } else { return true; } } /** * When true, ANSI SQL parsing mode is enabled. */ public boolean ansi = false; } singleStatement : statement EOF ; singleExpression : namedExpression EOF ; singleTableIdentifier : tableIdentifier EOF ; singleMultipartIdentifier : multipartIdentifier EOF ; singleFunctionIdentifier : functionIdentifier EOF ; singleDataType : dataType EOF ; singleTableSchema : colTypeList EOF ; singleInterval : INTERVAL? (intervalValue intervalUnit)+ EOF ; statement : query #statementDefault | ctes? dmlStatementNoWith #dmlStatement | USE NAMESPACE? multipartIdentifier #use | CREATE (database | NAMESPACE) (IF NOT EXISTS)? multipartIdentifier ((COMMENT comment=STRING) | locationSpec | (WITH (DBPROPERTIES | PROPERTIES) tablePropertyList))* #createNamespace | ALTER database db=errorCapturingIdentifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties | ALTER database db=errorCapturingIdentifier SET locationSpec #setDatabaseLocation | DROP database (IF EXISTS)? db=errorCapturingIdentifier (RESTRICT | CASCADE)? #dropDatabase | SHOW (DATABASES | NAMESPACES) ((FROM | IN) multipartIdentifier)? (LIKE? pattern=STRING)? #showNamespaces | createTableHeader ('(' colTypeList ')')? tableProvider ((OPTIONS options=tablePropertyList) | (PARTITIONED BY partitioning=transformList) | bucketSpec | locationSpec | (COMMENT comment=STRING) | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #createTable | createTableHeader ('(' columns=colTypeList ')')? ((COMMENT comment=STRING) | (PARTITIONED BY '(' partitionColumns=colTypeList ')' | PARTITIONED BY partitionColumnNames=identifierList) | bucketSpec | skewSpec | rowFormat | createFileFormat | locationSpec | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #createHiveTable | CREATE TABLE (IF NOT EXISTS)? target=tableIdentifier LIKE source=tableIdentifier locationSpec? #createTableLike | replaceTableHeader ('(' colTypeList ')')? tableProvider ((OPTIONS options=tablePropertyList) | (PARTITIONED BY partitioning=transformList) | bucketSpec | locationSpec | (COMMENT comment=STRING) | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #replaceTable | ANALYZE TABLE multipartIdentifier partitionSpec? COMPUTE STATISTICS (identifier | FOR COLUMNS identifierSeq | FOR ALL COLUMNS)? #analyze | ALTER TABLE multipartIdentifier ADD (COLUMN | COLUMNS) columns=qualifiedColTypeWithPositionList #addTableColumns | ALTER TABLE multipartIdentifier ADD (COLUMN | COLUMNS) '(' columns=qualifiedColTypeWithPositionList ')' #addTableColumns | ALTER TABLE multipartIdentifier RENAME COLUMN from=qualifiedName TO to=identifier #renameTableColumn | ALTER TABLE multipartIdentifier DROP (COLUMN | COLUMNS) '(' columns=qualifiedNameList ')' #dropTableColumns | ALTER TABLE multipartIdentifier DROP (COLUMN | COLUMNS) columns=qualifiedNameList #dropTableColumns | ALTER (TABLE | VIEW) from=tableIdentifier RENAME TO to=tableIdentifier #renameTable | ALTER (TABLE | VIEW) multipartIdentifier SET TBLPROPERTIES tablePropertyList #setTableProperties | ALTER (TABLE | VIEW) multipartIdentifier UNSET TBLPROPERTIES (IF EXISTS)? tablePropertyList #unsetTableProperties | ALTER TABLE multipartIdentifier (ALTER | CHANGE) COLUMN? qualifiedName (TYPE dataType)? (COMMENT comment=STRING)? colPosition? #alterTableColumn | ALTER TABLE tableIdentifier partitionSpec? CHANGE COLUMN? colName=errorCapturingIdentifier colType colPosition? #changeColumn | ALTER TABLE tableIdentifier (partitionSpec)? SET SERDE STRING (WITH SERDEPROPERTIES tablePropertyList)? #setTableSerDe | ALTER TABLE tableIdentifier (partitionSpec)? SET SERDEPROPERTIES tablePropertyList #setTableSerDe | ALTER TABLE tableIdentifier ADD (IF NOT EXISTS)? partitionSpecLocation+ #addTablePartition | ALTER VIEW tableIdentifier ADD (IF NOT EXISTS)? partitionSpec+ #addTablePartition | ALTER TABLE tableIdentifier from=partitionSpec RENAME TO to=partitionSpec #renameTablePartition | ALTER TABLE tableIdentifier DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* PURGE? #dropTablePartitions | ALTER VIEW tableIdentifier DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* #dropTablePartitions | ALTER TABLE multipartIdentifier SET locationSpec #setTableLocation | ALTER TABLE tableIdentifier partitionSpec SET locationSpec #setPartitionLocation | ALTER TABLE tableIdentifier RECOVER PARTITIONS #recoverPartitions | DROP TABLE (IF EXISTS)? multipartIdentifier PURGE? #dropTable | DROP VIEW (IF EXISTS)? multipartIdentifier #dropView | CREATE (OR REPLACE)? (GLOBAL? TEMPORARY)? VIEW (IF NOT EXISTS)? tableIdentifier identifierCommentList? ((COMMENT STRING) | (PARTITIONED ON identifierList) | (TBLPROPERTIES tablePropertyList))* AS query #createView | CREATE (OR REPLACE)? GLOBAL? TEMPORARY VIEW tableIdentifier ('(' colTypeList ')')? tableProvider (OPTIONS tablePropertyList)? #createTempViewUsing | ALTER VIEW tableIdentifier AS? query #alterViewQuery | CREATE (OR REPLACE)? TEMPORARY? FUNCTION (IF NOT EXISTS)? qualifiedName AS className=STRING (USING resource (',' resource)*)? #createFunction | DROP TEMPORARY? FUNCTION (IF EXISTS)? qualifiedName #dropFunction | EXPLAIN (LOGICAL | FORMATTED | EXTENDED | CODEGEN | COST)? statement #explain | SHOW TABLES ((FROM | IN) multipartIdentifier)? (LIKE? pattern=STRING)? #showTables | SHOW TABLE EXTENDED ((FROM | IN) db=errorCapturingIdentifier)? LIKE pattern=STRING partitionSpec? #showTable | SHOW TBLPROPERTIES table=tableIdentifier ('(' key=tablePropertyKey ')')? #showTblProperties | SHOW COLUMNS (FROM | IN) tableIdentifier ((FROM | IN) db=errorCapturingIdentifier)? #showColumns | SHOW PARTITIONS multipartIdentifier partitionSpec? #showPartitions | SHOW identifier? FUNCTIONS (LIKE? (qualifiedName | pattern=STRING))? #showFunctions | SHOW CREATE TABLE multipartIdentifier #showCreateTable | (DESC | DESCRIBE) FUNCTION EXTENDED? describeFuncName #describeFunction | (DESC | DESCRIBE) database EXTENDED? db=errorCapturingIdentifier #describeDatabase | (DESC | DESCRIBE) TABLE? option=(EXTENDED | FORMATTED)? multipartIdentifier partitionSpec? describeColName? #describeTable | (DESC | DESCRIBE) QUERY? query #describeQuery | REFRESH TABLE multipartIdentifier #refreshTable | REFRESH (STRING | .*?) #refreshResource | CACHE LAZY? TABLE multipartIdentifier (OPTIONS options=tablePropertyList)? (AS? query)? #cacheTable | UNCACHE TABLE (IF EXISTS)? multipartIdentifier #uncacheTable | CLEAR CACHE #clearCache | LOAD DATA LOCAL? INPATH path=STRING OVERWRITE? INTO TABLE tableIdentifier partitionSpec? #loadData | TRUNCATE TABLE multipartIdentifier partitionSpec? #truncateTable | MSCK REPAIR TABLE multipartIdentifier #repairTable | op=(ADD | LIST) identifier .*? #manageResource | SET ROLE .*? #failNativeCommand | SET .*? #setConfiguration | RESET #resetConfiguration | DELETE FROM multipartIdentifier tableAlias whereClause? #deleteFromTable | UPDATE multipartIdentifier tableAlias setClause whereClause? #updateTable | unsupportedHiveNativeCommands .*? #failNativeCommand ; unsupportedHiveNativeCommands : kw1=CREATE kw2=ROLE | kw1=DROP kw2=ROLE | kw1=GRANT kw2=ROLE? | kw1=REVOKE kw2=ROLE? | kw1=SHOW kw2=GRANT | kw1=SHOW kw2=ROLE kw3=GRANT? | kw1=SHOW kw2=PRINCIPALS | kw1=SHOW kw2=ROLES | kw1=SHOW kw2=CURRENT kw3=ROLES | kw1=EXPORT kw2=TABLE | kw1=IMPORT kw2=TABLE | kw1=SHOW kw2=COMPACTIONS | kw1=SHOW kw2=CREATE kw3=TABLE | kw1=SHOW kw2=TRANSACTIONS | kw1=SHOW kw2=INDEXES | kw1=SHOW kw2=LOCKS | kw1=CREATE kw2=INDEX | kw1=DROP kw2=INDEX | kw1=ALTER kw2=INDEX | kw1=LOCK kw2=TABLE | kw1=LOCK kw2=DATABASE | kw1=UNLOCK kw2=TABLE | kw1=UNLOCK kw2=DATABASE | kw1=CREATE kw2=TEMPORARY kw3=MACRO | kw1=DROP kw2=TEMPORARY kw3=MACRO | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=CLUSTERED | kw1=ALTER kw2=TABLE tableIdentifier kw3=CLUSTERED kw4=BY | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SORTED | kw1=ALTER kw2=TABLE tableIdentifier kw3=SKEWED kw4=BY | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SKEWED | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=STORED kw5=AS kw6=DIRECTORIES | kw1=ALTER kw2=TABLE tableIdentifier kw3=SET kw4=SKEWED kw5=LOCATION | kw1=ALTER kw2=TABLE tableIdentifier kw3=EXCHANGE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=ARCHIVE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=UNARCHIVE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=TOUCH | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=COMPACT | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=CONCATENATE | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=SET kw4=FILEFORMAT | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=REPLACE kw4=COLUMNS | kw1=START kw2=TRANSACTION | kw1=COMMIT | kw1=ROLLBACK | kw1=DFS | kw1=DELETE kw2=FROM ; createTableHeader : CREATE TEMPORARY? EXTERNAL? TABLE (IF NOT EXISTS)? multipartIdentifier ; replaceTableHeader : (CREATE OR)? REPLACE TABLE multipartIdentifier ; bucketSpec : CLUSTERED BY identifierList (SORTED BY orderedIdentifierList)? INTO INTEGER_VALUE BUCKETS ; skewSpec : SKEWED BY identifierList ON (constantList | nestedConstantList) (STORED AS DIRECTORIES)? ; locationSpec : LOCATION STRING ; query : ctes? queryTerm queryOrganization ; insertInto : INSERT OVERWRITE TABLE? multipartIdentifier (partitionSpec (IF NOT EXISTS)?)? #insertOverwriteTable | INSERT INTO TABLE? multipartIdentifier partitionSpec? (IF NOT EXISTS)? #insertIntoTable | INSERT OVERWRITE LOCAL? DIRECTORY path=STRING rowFormat? createFileFormat? #insertOverwriteHiveDir | INSERT OVERWRITE LOCAL? DIRECTORY (path=STRING)? tableProvider (OPTIONS options=tablePropertyList)? #insertOverwriteDir ; partitionSpecLocation : partitionSpec locationSpec? ; partitionSpec : PARTITION '(' partitionVal (',' partitionVal)* ')' ; partitionVal : identifier (EQ constant)? ; database : DATABASE | SCHEMA ; describeFuncName : qualifiedName | STRING | comparisonOperator | arithmeticOperator | predicateOperator ; describeColName : nameParts+=identifier ('.' nameParts+=identifier)* ; ctes : WITH namedQuery (',' namedQuery)* ; namedQuery : name=errorCapturingIdentifier (columnAliases=identifierList)? AS? '(' query ')' ; tableProvider : USING qualifiedName ; tablePropertyList : '(' tableProperty (',' tableProperty)* ')' ; tableProperty : key=tablePropertyKey (EQ? value=tablePropertyValue)? ; tablePropertyKey : identifier ('.' identifier)* | STRING ; tablePropertyValue : INTEGER_VALUE | DECIMAL_VALUE | booleanValue | STRING ; constantList : '(' constant (',' constant)* ')' ; nestedConstantList : '(' constantList (',' constantList)* ')' ; createFileFormat : STORED AS fileFormat | STORED BY storageHandler ; fileFormat : INPUTFORMAT inFmt=STRING OUTPUTFORMAT outFmt=STRING #tableFileFormat | identifier #genericFileFormat ; storageHandler : STRING (WITH SERDEPROPERTIES tablePropertyList)? ; resource : identifier STRING ; dmlStatementNoWith : insertInto queryTerm queryOrganization #singleInsertQuery | fromClause multiInsertQueryBody+ #multiInsertQuery ; queryOrganization : (ORDER BY order+=sortItem (',' order+=sortItem)*)? (CLUSTER BY clusterBy+=expression (',' clusterBy+=expression)*)? (DISTRIBUTE BY distributeBy+=expression (',' distributeBy+=expression)*)? (SORT BY sort+=sortItem (',' sort+=sortItem)*)? windowClause? (LIMIT (ALL | limit=expression))? ; multiInsertQueryBody : insertInto fromStatementBody ; queryTerm : queryPrimary #queryTermDefault | left=queryTerm {legacy_setops_precedence_enbled}? operator=(INTERSECT | UNION | EXCEPT | SETMINUS) setQuantifier? right=queryTerm #setOperation | left=queryTerm {!legacy_setops_precedence_enbled}? operator=INTERSECT setQuantifier? right=queryTerm #setOperation | left=queryTerm {!legacy_setops_precedence_enbled}? operator=(UNION | EXCEPT | SETMINUS) setQuantifier? right=queryTerm #setOperation ; queryPrimary : querySpecification #queryPrimaryDefault | fromStatement #fromStmt | TABLE multipartIdentifier #table | inlineTable #inlineTableDefault1 | '(' query ')' #subquery ; sortItem : expression ordering=(ASC | DESC)? (NULLS nullOrder=(LAST | FIRST))? ; fromStatement : fromClause fromStatementBody+ ; fromStatementBody : transformClause whereClause? queryOrganization | selectClause lateralView* whereClause? aggregationClause? havingClause? windowClause? queryOrganization ; querySpecification : transformClause fromClause? whereClause? #transformQuerySpecification | selectClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause? #regularQuerySpecification ; transformClause : (SELECT kind=TRANSFORM '(' namedExpressionSeq ')' | kind=MAP namedExpressionSeq | kind=REDUCE namedExpressionSeq) inRowFormat=rowFormat? (RECORDWRITER recordWriter=STRING)? USING script=STRING (AS (identifierSeq | colTypeList | ('(' (identifierSeq | colTypeList) ')')))? outRowFormat=rowFormat? (RECORDREADER recordReader=STRING)? ; selectClause : SELECT (hints+=hint)* setQuantifier? namedExpressionSeq ; setClause : SET assign (',' assign)* ; assign : key=multipartIdentifier EQ value=expression ; whereClause : WHERE booleanExpression ; havingClause : HAVING booleanExpression ; hint : '/*+' hintStatements+=hintStatement (','? hintStatements+=hintStatement)* '*/' ; hintStatement : hintName=identifier | hintName=identifier '(' parameters+=primaryExpression (',' parameters+=primaryExpression)* ')' ; fromClause : FROM relation (',' relation)* lateralView* pivotClause? ; aggregationClause : GROUP BY groupingExpressions+=expression (',' groupingExpressions+=expression)* ( WITH kind=ROLLUP | WITH kind=CUBE | kind=GROUPING SETS '(' groupingSet (',' groupingSet)* ')')? | GROUP BY kind=GROUPING SETS '(' groupingSet (',' groupingSet)* ')' ; groupingSet : '(' (expression (',' expression)*)? ')' | expression ; pivotClause : PIVOT '(' aggregates=namedExpressionSeq FOR pivotColumn IN '(' pivotValues+=pivotValue (',' pivotValues+=pivotValue)* ')' ')' ; pivotColumn : identifiers+=identifier | '(' identifiers+=identifier (',' identifiers+=identifier)* ')' ; pivotValue : expression (AS? identifier)? ; lateralView : LATERAL VIEW (OUTER)? qualifiedName '(' (expression (',' expression)*)? ')' tblName=identifier (AS? colName+=identifier (',' colName+=identifier)*)? ; setQuantifier : DISTINCT | ALL ; relation : relationPrimary joinRelation* ; joinRelation : (joinType) JOIN right=relationPrimary joinCriteria? | NATURAL joinType JOIN right=relationPrimary ; joinType : INNER? | CROSS | LEFT OUTER? | LEFT? SEMI | RIGHT OUTER? | FULL OUTER? | LEFT? ANTI ; joinCriteria : ON booleanExpression | USING identifierList ; sample : TABLESAMPLE '(' sampleMethod? ')' ; sampleMethod : negativeSign=MINUS? percentage=(INTEGER_VALUE | DECIMAL_VALUE) PERCENTLIT #sampleByPercentile | expression ROWS #sampleByRows | sampleType=BUCKET numerator=INTEGER_VALUE OUT OF denominator=INTEGER_VALUE (ON (identifier | qualifiedName '(' ')'))? #sampleByBucket | bytes=expression #sampleByBytes ; identifierList : '(' identifierSeq ')' ; identifierSeq : ident+=errorCapturingIdentifier (',' ident+=errorCapturingIdentifier)* ; orderedIdentifierList : '(' orderedIdentifier (',' orderedIdentifier)* ')' ; orderedIdentifier : ident=errorCapturingIdentifier ordering=(ASC | DESC)? ; identifierCommentList : '(' identifierComment (',' identifierComment)* ')' ; identifierComment : identifier (COMMENT STRING)? ; relationPrimary : multipartIdentifier sample? tableAlias #tableName | '(' query ')' sample? tableAlias #aliasedQuery | '(' relation ')' sample? tableAlias #aliasedRelation | inlineTable #inlineTableDefault2 | functionTable #tableValuedFunction ; inlineTable : VALUES expression (',' expression)* tableAlias ; functionTable : funcName=errorCapturingIdentifier '(' (expression (',' expression)*)? ')' tableAlias ; tableAlias : (AS? strictIdentifier identifierList?)? ; rowFormat : ROW FORMAT SERDE name=STRING (WITH SERDEPROPERTIES props=tablePropertyList)? #rowFormatSerde | ROW FORMAT DELIMITED (FIELDS TERMINATED BY fieldsTerminatedBy=STRING (ESCAPED BY escapedBy=STRING)?)? (COLLECTION ITEMS TERMINATED BY collectionItemsTerminatedBy=STRING)? (MAP KEYS TERMINATED BY keysTerminatedBy=STRING)? (LINES TERMINATED BY linesSeparatedBy=STRING)? (NULL DEFINED AS nullDefinedAs=STRING)? #rowFormatDelimited ; multipartIdentifier : parts+=errorCapturingIdentifier ('.' parts+=errorCapturingIdentifier)* ; tableIdentifier : (db=errorCapturingIdentifier '.')? table=errorCapturingIdentifier ; functionIdentifier : (db=errorCapturingIdentifier '.')? function=errorCapturingIdentifier ; namedExpression : expression (AS? (name=errorCapturingIdentifier | identifierList))? ; namedExpressionSeq : namedExpression (',' namedExpression)* ; transformList : '(' transforms+=transform (',' transforms+=transform)* ')' ; transform : qualifiedName #identityTransform | transformName=identifier '(' argument+=transformArgument (',' argument+=transformArgument)* ')' #applyTransform ; transformArgument : qualifiedName | constant ; expression : booleanExpression ; booleanExpression : NOT booleanExpression #logicalNot | EXISTS '(' query ')' #exists | valueExpression predicate? #predicated | left=booleanExpression operator=AND right=booleanExpression #logicalBinary | left=booleanExpression operator=OR right=booleanExpression #logicalBinary ; predicate : NOT? kind=BETWEEN lower=valueExpression AND upper=valueExpression | NOT? kind=IN '(' expression (',' expression)* ')' | NOT? kind=IN '(' query ')' | NOT? kind=(RLIKE | LIKE) pattern=valueExpression | IS NOT? kind=NULL | IS NOT? kind=(TRUE | FALSE | UNKNOWN) | IS NOT? kind=DISTINCT FROM right=valueExpression ; valueExpression : primaryExpression #valueExpressionDefault | operator=(MINUS | PLUS | TILDE) valueExpression #arithmeticUnary | left=valueExpression operator=(ASTERISK | SLASH | PERCENT | DIV) right=valueExpression #arithmeticBinary | left=valueExpression operator=(PLUS | MINUS | CONCAT_PIPE) right=valueExpression #arithmeticBinary | left=valueExpression operator=AMPERSAND right=valueExpression #arithmeticBinary | left=valueExpression operator=HAT right=valueExpression #arithmeticBinary | left=valueExpression operator=PIPE right=valueExpression #arithmeticBinary | left=valueExpression comparisonOperator right=valueExpression #comparison ; primaryExpression : name=(CURRENT_DATE | CURRENT_TIMESTAMP) #currentDatetime | CASE whenClause+ (ELSE elseExpression=expression)? END #searchedCase | CASE value=expression whenClause+ (ELSE elseExpression=expression)? END #simpleCase | CAST '(' expression AS dataType ')' #cast | STRUCT '(' (argument+=namedExpression (',' argument+=namedExpression)*)? ')' #struct | (FIRST | FIRST_VALUE) '(' expression ((IGNORE | RESPECT) NULLS)? ')' #first | (LAST | LAST_VALUE) '(' expression ((IGNORE | RESPECT) NULLS)? ')' #last | POSITION '(' substr=valueExpression IN str=valueExpression ')' #position | constant #constantDefault | ASTERISK #star | qualifiedName '.' ASTERISK #star | '(' namedExpression (',' namedExpression)+ ')' #rowConstructor | '(' query ')' #subqueryExpression | qualifiedName '(' (setQuantifier? argument+=expression (',' argument+=expression)*)? ')' (OVER windowSpec)? #functionCall | IDENTIFIER '->' expression #lambda | '(' IDENTIFIER (',' IDENTIFIER)+ ')' '->' expression #lambda | value=primaryExpression '[' index=valueExpression ']' #subscript | identifier #columnReference | base=primaryExpression '.' fieldName=identifier #dereference | '(' expression ')' #parenthesizedExpression | EXTRACT '(' field=identifier FROM source=valueExpression ')' #extract | (SUBSTR | SUBSTRING) '(' str=valueExpression (FROM | ',') pos=valueExpression ((FOR | ',') len=valueExpression)? ')' #substring | TRIM '(' trimOption=(BOTH | LEADING | TRAILING)? (trimStr=valueExpression)? FROM srcStr=valueExpression ')' #trim | OVERLAY '(' input=valueExpression PLACING replace=valueExpression FROM position=valueExpression (FOR length=valueExpression)? ')' #overlay ; constant : NULL #nullLiteral | interval #intervalLiteral | identifier STRING #typeConstructor | number #numericLiteral | booleanValue #booleanLiteral | STRING+ #stringLiteral ; comparisonOperator : EQ | NEQ | NEQJ | LT | LTE | GT | GTE | NSEQ ; arithmeticOperator : PLUS | MINUS | ASTERISK | SLASH | PERCENT | DIV | TILDE | AMPERSAND | PIPE | CONCAT_PIPE | HAT ; predicateOperator : OR | AND | IN | NOT ; booleanValue : TRUE | FALSE ; interval : {ansi}? INTERVAL? intervalField+ | {!ansi}? INTERVAL intervalField* ; intervalField : value=intervalValue unit=intervalUnit (TO to=intervalUnit)? ; intervalValue : (PLUS | MINUS)? (INTEGER_VALUE | DECIMAL_VALUE) | STRING ; intervalUnit : DAY | DAYS | HOUR | HOURS | MICROSECOND | MICROSECONDS | MILLISECOND | MILLISECONDS | MINUTE | MINUTES | MONTH | MONTHS | SECOND | SECONDS | WEEK | WEEKS | YEAR | YEARS ; colPosition : FIRST | AFTER qualifiedName ; dataType : complex=ARRAY '<' dataType '>' #complexDataType | complex=MAP '<' dataType ',' dataType '>' #complexDataType | complex=STRUCT ('<' complexColTypeList? '>' | NEQ) #complexDataType | identifier ('(' INTEGER_VALUE (',' INTEGER_VALUE)* ')')? #primitiveDataType ; qualifiedColTypeWithPositionList : qualifiedColTypeWithPosition (',' qualifiedColTypeWithPosition)* ; qualifiedColTypeWithPosition : name=qualifiedName dataType (COMMENT comment=STRING)? colPosition? ; colTypeList : colType (',' colType)* ; colType : colName=errorCapturingIdentifier dataType (COMMENT STRING)? ; complexColTypeList : complexColType (',' complexColType)* ; complexColType : identifier ':' dataType (COMMENT STRING)? ; whenClause : WHEN condition=expression THEN result=expression ; windowClause : WINDOW namedWindow (',' namedWindow)* ; namedWindow : name=errorCapturingIdentifier AS windowSpec ; windowSpec : name=errorCapturingIdentifier #windowRef | '('name=errorCapturingIdentifier')' #windowRef | '(' ( CLUSTER BY partition+=expression (',' partition+=expression)* | ((PARTITION | DISTRIBUTE) BY partition+=expression (',' partition+=expression)*)? ((ORDER | SORT) BY sortItem (',' sortItem)*)?) windowFrame? ')' #windowDef ; windowFrame : frameType=RANGE start=frameBound | frameType=ROWS start=frameBound | frameType=RANGE BETWEEN start=frameBound AND end=frameBound | frameType=ROWS BETWEEN start=frameBound AND end=frameBound ; frameBound : UNBOUNDED boundType=(PRECEDING | FOLLOWING) | boundType=CURRENT ROW | expression boundType=(PRECEDING | FOLLOWING) ; qualifiedNameList : qualifiedName (',' qualifiedName)* ; qualifiedName : identifier ('.' identifier)* ; // this rule is used for explicitly capturing wrong identifiers such as test-table, which should actually be `test-table` // replace identifier with errorCapturingIdentifier where the immediate follow symbol is not an expression, otherwise // valid expressions such as ""a-b"" can be recognized as an identifier errorCapturingIdentifier : identifier errorCapturingIdentifierExtra ; // extra left-factoring grammar errorCapturingIdentifierExtra : (MINUS identifier)+ #errorIdent | #realIdent ; identifier : strictIdentifier | {!ansi}? strictNonReserved ; strictIdentifier : IDENTIFIER #unquotedIdentifier | quotedIdentifier #quotedIdentifierAlternative | {ansi}? ansiNonReserved #unquotedIdentifier | {!ansi}? nonReserved #unquotedIdentifier ; quotedIdentifier : BACKQUOTED_IDENTIFIER ; number : MINUS? DECIMAL_VALUE #decimalLiteral | MINUS? INTEGER_VALUE #integerLiteral | MINUS? BIGINT_LITERAL #bigIntLiteral | MINUS? SMALLINT_LITERAL #smallIntLiteral | MINUS? TINYINT_LITERAL #tinyIntLiteral | MINUS? DOUBLE_LITERAL #doubleLiteral | MINUS? BIGDECIMAL_LITERAL #bigDecimalLiteral ; // When `spark.sql.ansi.enabled=true`, there are 2 kinds of keywords in Spark SQL. // - Reserved keywords: // Keywords that are reserved and can't be used as identifiers for table, view, column, // function, alias, etc. // - Non-reserved keywords: // Keywords that have a special meaning only in particular contexts and can be used as // identifiers in other contexts. For example, `SELECT 1 WEEK` is an interval literal, but WEEK // can be used as identifiers in other places. // You can find the full keywords list by searching ""Start of the keywords list"" in this file. // The non-reserved keywords are listed below. Keywords not in this list are reserved keywords. ansiNonReserved : ADD | AFTER | ALTER | ANALYZE | ARCHIVE | ARRAY | ASC | AT | BETWEEN | BUCKET | BUCKETS | BY | CACHE | CASCADE | CHANGE | CLEAR | CLUSTER | CLUSTERED | CODEGEN | COLLECTION | COLUMNS | COMMENT | COMMIT | COMPACT | COMPACTIONS | COMPUTE | CONCATENATE | COST | CUBE | CURRENT | DATA | DATABASE | DATABASES | DAYS | DBPROPERTIES | DEFINED | DELETE | DELIMITED | DESC | DESCRIBE | DFS | DIRECTORIES | DIRECTORY | DISTRIBUTE | DIV | DROP | ESCAPED | EXCHANGE | EXISTS | EXPLAIN | EXPORT | EXTENDED | EXTERNAL | EXTRACT | FIELDS | FILEFORMAT | FIRST | FOLLOWING | FORMAT | FORMATTED | FUNCTION | FUNCTIONS | GLOBAL | GROUPING | HOURS | IF | IGNORE | IMPORT | INDEX | INDEXES | INPATH | INPUTFORMAT | INSERT | INTERVAL | ITEMS | KEYS | LAST | LATERAL | LAZY | LIKE | LIMIT | LINES | LIST | LOAD | LOCAL | LOCATION | LOCK | LOCKS | LOGICAL | MACRO | MAP | MICROSECOND | MICROSECONDS | MILLISECOND | MILLISECONDS | MINUTES | MONTHS | MSCK | NAMESPACE | NAMESPACES | NO | NULLS | OF | OPTION | OPTIONS | OUT | OUTPUTFORMAT | OVER | OVERLAY | OVERWRITE | PARTITION | PARTITIONED | PARTITIONS | PERCENTLIT | PIVOT | PLACING | POSITION | PRECEDING | PRINCIPALS | PROPERTIES | PURGE | QUERY | RANGE | RECORDREADER | RECORDWRITER | RECOVER | REDUCE | REFRESH | RENAME | REPAIR | REPLACE | RESET | RESPECT | RESTRICT | REVOKE | RLIKE | ROLE | ROLES | ROLLBACK | ROLLUP | ROW | ROWS | SCHEMA | SECONDS | SEPARATED | SERDE | SERDEPROPERTIES | SET | SETS | SHOW | SKEWED | SORT | SORTED | START | STATISTICS | STORED | STRATIFY | STRUCT | SUBSTR | SUBSTRING | TABLES | TABLESAMPLE | TBLPROPERTIES | TEMPORARY | TERMINATED | TOUCH | TRANSACTION | TRANSACTIONS | TRANSFORM | TRIM | TRUE | TRUNCATE | UNARCHIVE | UNBOUNDED | UNCACHE | UNLOCK | UNSET | UPDATE | USE | VALUES | VIEW | WEEK | WEEKS | WINDOW | YEARS ; // When `spark.sql.ansi.enabled=false`, there are 2 kinds of keywords in Spark SQL. // - Non-reserved keywords: // Same definition as the one when `spark.sql.ansi.enabled=true`. // - Strict-non-reserved keywords: // A strict version of non-reserved keywords, which can not be used as table alias. // You can find the full keywords list by searching ""Start of the keywords list"" in this file. // The strict-non-reserved keywords are listed in `strictNonReserved`. // The non-reserved keywords are listed in `nonReserved`. // These 2 together contain all the keywords. strictNonReserved : ANTI | CROSS | EXCEPT | FULL | INNER | INTERSECT | JOIN | LEFT | NATURAL | ON | RIGHT | SEMI | SETMINUS | UNION | USING ; nonReserved : ADD | AFTER | ALL | ALTER | ANALYZE | AND | ANY | ARCHIVE | ARRAY | AS | ASC | AT | AUTHORIZATION | BETWEEN | BOTH | BUCKET | BUCKETS | BY | CACHE | CASCADE | CASE | CAST | CHANGE | CHECK | CLEAR | CLUSTER | CLUSTERED | CODEGEN | COLLATE | COLLECTION | COLUMN | COLUMNS | COMMENT | COMMIT | COMPACT | COMPACTIONS | COMPUTE | CONCATENATE | CONSTRAINT | COST | CREATE | CUBE | CURRENT | CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP | CURRENT_USER | DATA | DATABASE | DATABASES | DAY | DAYS | DBPROPERTIES | DEFINED | DELETE | DELIMITED | DESC | DESCRIBE | DFS | DIRECTORIES | DIRECTORY | DISTINCT | DISTRIBUTE | DIV | DROP | ELSE | END | ESCAPED | EXCHANGE | EXISTS | EXPLAIN | EXPORT | EXTENDED | EXTERNAL | EXTRACT | FALSE | FETCH | FIELDS | FILEFORMAT | FIRST | FIRST_VALUE | FOLLOWING | FOR | FOREIGN | FORMAT | FORMATTED | FROM | FUNCTION | FUNCTIONS | GLOBAL | GRANT | GROUP | GROUPING | HAVING | HOUR | HOURS | IF | IGNORE | IMPORT | IN | INDEX | INDEXES | INPATH | INPUTFORMAT | INSERT | INTERVAL | INTO | IS | ITEMS | KEYS | LAST | LAST_VALUE | LATERAL | LAZY | LEADING | LIKE | LIMIT | LINES | LIST | LOAD | LOCAL | LOCATION | LOCK | LOCKS | LOGICAL | MACRO | MAP | MICROSECOND | MICROSECONDS | MILLISECOND | MILLISECONDS | MINUTE | MINUTES | MONTH | MONTHS | MSCK | NAMESPACE | NAMESPACES | NO | NOT | NULL | NULLS | OF | ONLY | OPTION | OPTIONS | OR | ORDER | OUT | OUTER | OUTPUTFORMAT | OVER | OVERLAPS | OVERLAY | OVERWRITE | PARTITION | PARTITIONED | PARTITIONS | PERCENTLIT | PIVOT | PLACING | POSITION | PRECEDING | PRIMARY | PRINCIPALS | PROPERTIES | PURGE | QUERY | RANGE | RECORDREADER | RECORDWRITER | RECOVER | REDUCE | REFERENCES | REFRESH | RENAME | REPAIR | REPLACE | RESET | RESPECT | RESTRICT | REVOKE | RLIKE | ROLE | ROLES | ROLLBACK | ROLLUP | ROW | ROWS | SCHEMA | SECOND | SECONDS | SELECT | SEPARATED | SERDE | SERDEPROPERTIES | SESSION_USER | SET | SETS | SHOW | SKEWED | SOME | SORT | SORTED | START | STATISTICS | STORED | STRATIFY | STRUCT | SUBSTR | SUBSTRING | TABLE | TABLES | TABLESAMPLE | TBLPROPERTIES | TEMPORARY | TERMINATED | THEN | TO | TOUCH | TRAILING | TRANSACTION | TRANSACTIONS | TRANSFORM | TRIM | TRUE | TRUNCATE | TYPE | UNARCHIVE | UNBOUNDED | UNCACHE | UNIQUE | UNKNOWN | UNLOCK | UNSET | UPDATE | USE | USER | VALUES | VIEW | WEEK | WEEKS | WHEN | WHERE | WINDOW | WITH | YEAR | YEARS ; // NOTE: If you add a new token in the list below, you should update the list of keywords // in `docs/sql-keywords.md`. If the token is a non-reserved keyword, // please update `ansiNonReserved` and `nonReserved` as well. //============================ // Start of the keywords list //============================ ADD: 'ADD'; AFTER: 'AFTER'; ALL: 'ALL'; ALTER: 'ALTER'; ANALYZE: 'ANALYZE'; AND: 'AND'; ANTI: 'ANTI'; ANY: 'ANY'; ARCHIVE: 'ARCHIVE'; ARRAY: 'ARRAY'; AS: 'AS'; ASC: 'ASC'; AT: 'AT'; AUTHORIZATION: 'AUTHORIZATION'; BETWEEN: 'BETWEEN'; BOTH: 'BOTH'; BUCKET: 'BUCKET'; BUCKETS: 'BUCKETS'; BY: 'BY'; CACHE: 'CACHE'; CASCADE: 'CASCADE'; CASE: 'CASE'; CAST: 'CAST'; CHANGE: 'CHANGE'; CHECK: 'CHECK'; CLEAR: 'CLEAR'; CLUSTER: 'CLUSTER'; CLUSTERED: 'CLUSTERED'; CODEGEN: 'CODEGEN'; COLLATE: 'COLLATE'; COLLECTION: 'COLLECTION'; COLUMN: 'COLUMN'; COLUMNS: 'COLUMNS'; COMMENT: 'COMMENT'; COMMIT: 'COMMIT'; COMPACT: 'COMPACT'; COMPACTIONS: 'COMPACTIONS'; COMPUTE: 'COMPUTE'; CONCATENATE: 'CONCATENATE'; CONSTRAINT: 'CONSTRAINT'; COST: 'COST'; CREATE: 'CREATE'; CROSS: 'CROSS'; CUBE: 'CUBE'; CURRENT: 'CURRENT'; CURRENT_DATE: 'CURRENT_DATE'; CURRENT_TIME: 'CURRENT_TIME'; CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; CURRENT_USER: 'CURRENT_USER'; DATA: 'DATA'; DATABASE: 'DATABASE'; DATABASES: 'DATABASES' | 'SCHEMAS'; DAY: 'DAY'; DAYS: 'DAYS'; DBPROPERTIES: 'DBPROPERTIES'; DEFINED: 'DEFINED'; DELETE: 'DELETE'; DELIMITED: 'DELIMITED'; DESC: 'DESC'; DESCRIBE: 'DESCRIBE'; DFS: 'DFS'; DIRECTORIES: 'DIRECTORIES'; DIRECTORY: 'DIRECTORY'; DISTINCT: 'DISTINCT'; DISTRIBUTE: 'DISTRIBUTE'; DROP: 'DROP'; ELSE: 'ELSE'; END: 'END'; ESCAPED: 'ESCAPED'; EXCEPT: 'EXCEPT'; EXCHANGE: 'EXCHANGE'; EXISTS: 'EXISTS'; EXPLAIN: 'EXPLAIN'; EXPORT: 'EXPORT'; EXTENDED: 'EXTENDED'; EXTERNAL: 'EXTERNAL'; EXTRACT: 'EXTRACT'; FALSE: 'FALSE'; FETCH: 'FETCH'; FIELDS: 'FIELDS'; FILEFORMAT: 'FILEFORMAT'; FIRST: 'FIRST'; FIRST_VALUE: 'FIRST_VALUE'; FOLLOWING: 'FOLLOWING'; FOR: 'FOR'; FOREIGN: 'FOREIGN'; FORMAT: 'FORMAT'; FORMATTED: 'FORMATTED'; FROM: 'FROM'; FULL: 'FULL'; FUNCTION: 'FUNCTION'; FUNCTIONS: 'FUNCTIONS'; GLOBAL: 'GLOBAL'; GRANT: 'GRANT'; GROUP: 'GROUP'; GROUPING: 'GROUPING'; HAVING: 'HAVING'; HOUR: 'HOUR'; HOURS: 'HOURS'; IF: 'IF'; IGNORE: 'IGNORE'; IMPORT: 'IMPORT'; IN: 'IN'; INDEX: 'INDEX'; INDEXES: 'INDEXES'; INNER: 'INNER'; INPATH: 'INPATH'; INPUTFORMAT: 'INPUTFORMAT'; INSERT: 'INSERT'; INTERSECT: 'INTERSECT'; INTERVAL: 'INTERVAL'; INTO: 'INTO'; IS: 'IS'; ITEMS: 'ITEMS'; JOIN: 'JOIN'; KEYS: 'KEYS'; LAST: 'LAST'; LAST_VALUE: 'LAST_VALUE'; LATERAL: 'LATERAL'; LAZY: 'LAZY'; LEADING: 'LEADING'; LEFT: 'LEFT'; LIKE: 'LIKE'; LIMIT: 'LIMIT'; LINES: 'LINES'; LIST: 'LIST'; LOAD: 'LOAD'; LOCAL: 'LOCAL'; LOCATION: 'LOCATION'; LOCK: 'LOCK'; LOCKS: 'LOCKS'; LOGICAL: 'LOGICAL'; MACRO: 'MACRO'; MAP: 'MAP'; MICROSECOND: 'MICROSECOND'; MICROSECONDS: 'MICROSECONDS'; MILLISECOND: 'MILLISECOND'; MILLISECONDS: 'MILLISECONDS'; MINUTE: 'MINUTE'; MINUTES: 'MINUTES'; MONTH: 'MONTH'; MONTHS: 'MONTHS'; MSCK: 'MSCK'; NAMESPACE: 'NAMESPACE'; NAMESPACES: 'NAMESPACES'; NATURAL: 'NATURAL'; NO: 'NO'; NOT: 'NOT' | '!'; NULL: 'NULL'; NULLS: 'NULLS'; OF: 'OF'; ON: 'ON'; ONLY: 'ONLY'; OPTION: 'OPTION'; OPTIONS: 'OPTIONS'; OR: 'OR'; ORDER: 'ORDER'; OUT: 'OUT'; OUTER: 'OUTER'; OUTPUTFORMAT: 'OUTPUTFORMAT'; OVER: 'OVER'; OVERLAPS: 'OVERLAPS'; OVERLAY: 'OVERLAY'; OVERWRITE: 'OVERWRITE'; PARTITION: 'PARTITION'; PARTITIONED: 'PARTITIONED'; PARTITIONS: 'PARTITIONS'; PERCENTLIT: 'PERCENT'; PIVOT: 'PIVOT'; PLACING: 'PLACING'; POSITION: 'POSITION'; PRECEDING: 'PRECEDING'; PRIMARY: 'PRIMARY'; PRINCIPALS: 'PRINCIPALS'; PROPERTIES: 'PROPERTIES'; PURGE: 'PURGE'; QUERY: 'QUERY'; RANGE: 'RANGE'; RECORDREADER: 'RECORDREADER'; RECORDWRITER: 'RECORDWRITER'; RECOVER: 'RECOVER'; REDUCE: 'REDUCE'; REFERENCES: 'REFERENCES'; REFRESH: 'REFRESH'; RENAME: 'RENAME'; REPAIR: 'REPAIR'; REPLACE: 'REPLACE'; RESET: 'RESET'; RESPECT: 'RESPECT'; RESTRICT: 'RESTRICT'; REVOKE: 'REVOKE'; RIGHT: 'RIGHT'; RLIKE: 'RLIKE' | 'REGEXP'; ROLE: 'ROLE'; ROLES: 'ROLES'; ROLLBACK: 'ROLLBACK'; ROLLUP: 'ROLLUP'; ROW: 'ROW'; ROWS: 'ROWS'; SCHEMA: 'SCHEMA'; SECOND: 'SECOND'; SECONDS: 'SECONDS'; SELECT: 'SELECT'; SEMI: 'SEMI'; SEPARATED: 'SEPARATED'; SERDE: 'SERDE'; SERDEPROPERTIES: 'SERDEPROPERTIES'; SESSION_USER: 'SESSION_USER'; SET: 'SET'; SETMINUS: 'MINUS'; SETS: 'SETS'; SHOW: 'SHOW'; SKEWED: 'SKEWED'; SOME: 'SOME'; SORT: 'SORT'; SORTED: 'SORTED'; START: 'START'; STATISTICS: 'STATISTICS'; STORED: 'STORED'; STRATIFY: 'STRATIFY'; STRUCT: 'STRUCT'; SUBSTR: 'SUBSTR'; SUBSTRING: 'SUBSTRING'; TABLE: 'TABLE'; TABLES: 'TABLES'; TABLESAMPLE: 'TABLESAMPLE'; TBLPROPERTIES: 'TBLPROPERTIES'; TEMPORARY: 'TEMPORARY' | 'TEMP'; TERMINATED: 'TERMINATED'; THEN: 'THEN'; TO: 'TO'; TOUCH: 'TOUCH'; TRAILING: 'TRAILING'; TRANSACTION: 'TRANSACTION'; TRANSACTIONS: 'TRANSACTIONS'; TRANSFORM: 'TRANSFORM'; TRIM: 'TRIM'; TRUE: 'TRUE'; TRUNCATE: 'TRUNCATE'; TYPE: 'TYPE'; UNARCHIVE: 'UNARCHIVE'; UNBOUNDED: 'UNBOUNDED'; UNCACHE: 'UNCACHE'; UNION: 'UNION'; UNIQUE: 'UNIQUE'; UNKNOWN: 'UNKNOWN'; UNLOCK: 'UNLOCK'; UNSET: 'UNSET'; UPDATE: 'UPDATE'; USE: 'USE'; USER: 'USER'; USING: 'USING'; VALUES: 'VALUES'; VIEW: 'VIEW'; WEEK: 'WEEK'; WEEKS: 'WEEKS'; WHEN: 'WHEN'; WHERE: 'WHERE'; WINDOW: 'WINDOW'; WITH: 'WITH'; YEAR: 'YEAR'; YEARS: 'YEARS'; //============================ // End of the keywords list //============================ EQ : '=' | '=='; NSEQ: '<=>'; NEQ : '<>'; NEQJ: '!='; LT : '<'; LTE : '<=' | '!>'; GT : '>'; GTE : '>=' | '!<'; PLUS: '+'; MINUS: '-'; ASTERISK: '*'; SLASH: '/'; PERCENT: '%'; DIV: 'DIV'; TILDE: '~'; AMPERSAND: '&'; PIPE: '|'; CONCAT_PIPE: '||'; HAT: '^'; STRING : '\\'' ( ~('\\''|'\\\\') | ('\\\\' .) )* '\\'' | '""' ( ~('""'|'\\\\') | ('\\\\' .) )* '""' ; BIGINT_LITERAL : DIGIT+ 'L' ; SMALLINT_LITERAL : DIGIT+ 'S' ; TINYINT_LITERAL : DIGIT+ 'Y' ; INTEGER_VALUE : DIGIT+ ; DECIMAL_VALUE : DIGIT+ EXPONENT | DECIMAL_DIGITS EXPONENT? {isValidDecimal()}? ; DOUBLE_LITERAL : DIGIT+ EXPONENT? 'D' | DECIMAL_DIGITS EXPONENT? 'D' {isValidDecimal()}? ; BIGDECIMAL_LITERAL : DIGIT+ EXPONENT? 'BD' | DECIMAL_DIGITS EXPONENT? 'BD' {isValidDecimal()}? ; IDENTIFIER : (LETTER | DIGIT | '_')+ ; BACKQUOTED_IDENTIFIER : '`' ( ~'`' | '``' )* '`' ; fragment DECIMAL_DIGITS : DIGIT+ '.' DIGIT* | '.' DIGIT+ ; fragment EXPONENT : 'E' [+-]? DIGIT+ ; fragment DIGIT : [0-9] ; fragment LETTER : [A-Z] ; SIMPLE_COMMENT : '--' ~[\\r\\n]* '\\r'? '\\n'? -> channel(HIDDEN) ; BRACKETED_EMPTY_COMMENT : '/**/' -> channel(HIDDEN) ; BRACKETED_COMMENT : '/*' ~[+] .*? '*/' -> channel(HIDDEN) ; WS : [ \\r\\n\\t]+ -> channel(HIDDEN) ; // Catch-all for anything we can't recognize. // We use this to be able to ignore and recover all the text // when splitting statements with DelimiterLexer UNRECOGNIZED : . ; ",12081,False,2258.196743398097,median "/* * 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. * * This file is an adaptation of Presto's presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4 grammar. */ grammar SqlBase; @members { /** * When false, INTERSECT is given the greater precedence over the other set * operations (UNION, EXCEPT and MINUS) as per the SQL standard. */ public boolean legacy_setops_precedence_enbled = false; /** * Verify whether current token is a valid decimal token (which contains dot). * Returns true if the character that follows the token is not a digit or letter or underscore. * * For example: * For char stream ""2.3"", ""2."" is not a valid decimal token, because it is followed by digit '3'. * For char stream ""2.3_"", ""2.3"" is not a valid decimal token, because it is followed by '_'. * For char stream ""2.3W"", ""2.3"" is not a valid decimal token, because it is followed by 'W'. * For char stream ""12.0D 34.E2+0.12 "" 12.0D is a valid decimal token because it is followed * by a space. 34.E2 is a valid decimal token because it is followed by symbol '+' * which is not a digit or letter or underscore. */ public boolean isValidDecimal() { int nextChar = _input.LA(1); if (nextChar >= 'A' && nextChar <= 'Z' || nextChar >= '0' && nextChar <= '9' || nextChar == '_') { return false; } else { return true; } } /** * When true, ANSI SQL parsing mode is enabled. */ public boolean ansi = false; } singleStatement : statement EOF ; singleExpression : namedExpression EOF ; singleTableIdentifier : tableIdentifier EOF ; singleMultipartIdentifier : multipartIdentifier EOF ; singleFunctionIdentifier : functionIdentifier EOF ; singleDataType : dataType EOF ; singleTableSchema : colTypeList EOF ; singleInterval : INTERVAL? multiUnitsInterval EOF ; statement : query #statementDefault | ctes? dmlStatementNoWith #dmlStatement | USE NAMESPACE? multipartIdentifier #use | CREATE (database | NAMESPACE) (IF NOT EXISTS)? multipartIdentifier ((COMMENT comment=STRING) | locationSpec | (WITH (DBPROPERTIES | PROPERTIES) tablePropertyList))* #createNamespace | ALTER database db=errorCapturingIdentifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties | ALTER database db=errorCapturingIdentifier SET locationSpec #setDatabaseLocation | DROP (database | NAMESPACE) (IF EXISTS)? multipartIdentifier (RESTRICT | CASCADE)? #dropNamespace | SHOW (DATABASES | NAMESPACES) ((FROM | IN) multipartIdentifier)? (LIKE? pattern=STRING)? #showNamespaces | createTableHeader ('(' colTypeList ')')? tableProvider ((OPTIONS options=tablePropertyList) | (PARTITIONED BY partitioning=transformList) | bucketSpec | locationSpec | (COMMENT comment=STRING) | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #createTable | createTableHeader ('(' columns=colTypeList ')')? ((COMMENT comment=STRING) | (PARTITIONED BY '(' partitionColumns=colTypeList ')' | PARTITIONED BY partitionColumnNames=identifierList) | bucketSpec | skewSpec | rowFormat | createFileFormat | locationSpec | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #createHiveTable | CREATE TABLE (IF NOT EXISTS)? target=tableIdentifier LIKE source=tableIdentifier locationSpec? #createTableLike | replaceTableHeader ('(' colTypeList ')')? tableProvider ((OPTIONS options=tablePropertyList) | (PARTITIONED BY partitioning=transformList) | bucketSpec | locationSpec | (COMMENT comment=STRING) | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #replaceTable | ANALYZE TABLE multipartIdentifier partitionSpec? COMPUTE STATISTICS (identifier | FOR COLUMNS identifierSeq | FOR ALL COLUMNS)? #analyze | ALTER TABLE multipartIdentifier ADD (COLUMN | COLUMNS) columns=qualifiedColTypeWithPositionList #addTableColumns | ALTER TABLE multipartIdentifier ADD (COLUMN | COLUMNS) '(' columns=qualifiedColTypeWithPositionList ')' #addTableColumns | ALTER TABLE table=multipartIdentifier RENAME COLUMN from=multipartIdentifier TO to=errorCapturingIdentifier #renameTableColumn | ALTER TABLE multipartIdentifier DROP (COLUMN | COLUMNS) '(' columns=multipartIdentifierList ')' #dropTableColumns | ALTER TABLE multipartIdentifier DROP (COLUMN | COLUMNS) columns=multipartIdentifierList #dropTableColumns | ALTER (TABLE | VIEW) from=tableIdentifier RENAME TO to=tableIdentifier #renameTable | ALTER (TABLE | VIEW) multipartIdentifier SET TBLPROPERTIES tablePropertyList #setTableProperties | ALTER (TABLE | VIEW) multipartIdentifier UNSET TBLPROPERTIES (IF EXISTS)? tablePropertyList #unsetTableProperties | ALTER TABLE table=multipartIdentifier (ALTER | CHANGE) COLUMN? column=multipartIdentifier (TYPE dataType)? (COMMENT comment=STRING)? colPosition? #alterTableColumn | ALTER TABLE multipartIdentifier (partitionSpec)? SET SERDE STRING (WITH SERDEPROPERTIES tablePropertyList)? #setTableSerDe | ALTER TABLE multipartIdentifier (partitionSpec)? SET SERDEPROPERTIES tablePropertyList #setTableSerDe | ALTER (TABLE | VIEW) multipartIdentifier ADD (IF NOT EXISTS)? partitionSpecLocation+ #addTablePartition | ALTER TABLE multipartIdentifier from=partitionSpec RENAME TO to=partitionSpec #renameTablePartition | ALTER (TABLE | VIEW) multipartIdentifier DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* PURGE? #dropTablePartitions | ALTER TABLE multipartIdentifier (partitionSpec)? SET locationSpec #setTableLocation | ALTER TABLE multipartIdentifier RECOVER PARTITIONS #recoverPartitions | DROP TABLE (IF EXISTS)? multipartIdentifier PURGE? #dropTable | DROP VIEW (IF EXISTS)? multipartIdentifier #dropView | CREATE (OR REPLACE)? (GLOBAL? TEMPORARY)? VIEW (IF NOT EXISTS)? tableIdentifier identifierCommentList? ((COMMENT STRING) | (PARTITIONED ON identifierList) | (TBLPROPERTIES tablePropertyList))* AS query #createView | CREATE (OR REPLACE)? GLOBAL? TEMPORARY VIEW tableIdentifier ('(' colTypeList ')')? tableProvider (OPTIONS tablePropertyList)? #createTempViewUsing | ALTER VIEW tableIdentifier AS? query #alterViewQuery | CREATE (OR REPLACE)? TEMPORARY? FUNCTION (IF NOT EXISTS)? multipartIdentifier AS className=STRING (USING resource (',' resource)*)? #createFunction | DROP TEMPORARY? FUNCTION (IF EXISTS)? multipartIdentifier #dropFunction | EXPLAIN (LOGICAL | FORMATTED | EXTENDED | CODEGEN | COST)? statement #explain | SHOW TABLES ((FROM | IN) multipartIdentifier)? (LIKE? pattern=STRING)? #showTables | SHOW TABLE EXTENDED ((FROM | IN) db=errorCapturingIdentifier)? LIKE pattern=STRING partitionSpec? #showTable | SHOW TBLPROPERTIES table=tableIdentifier ('(' key=tablePropertyKey ')')? #showTblProperties | SHOW COLUMNS (FROM | IN) table=multipartIdentifier ((FROM | IN) namespace=multipartIdentifier)? #showColumns | SHOW PARTITIONS multipartIdentifier partitionSpec? #showPartitions | SHOW identifier? FUNCTIONS (LIKE? (multipartIdentifier | pattern=STRING))? #showFunctions | SHOW CREATE TABLE multipartIdentifier #showCreateTable | SHOW CURRENT NAMESPACE #showCurrentNamespace | (DESC | DESCRIBE) FUNCTION EXTENDED? describeFuncName #describeFunction | (DESC | DESCRIBE) database EXTENDED? db=errorCapturingIdentifier #describeDatabase | (DESC | DESCRIBE) TABLE? option=(EXTENDED | FORMATTED)? multipartIdentifier partitionSpec? describeColName? #describeTable | (DESC | DESCRIBE) QUERY? query #describeQuery | REFRESH TABLE multipartIdentifier #refreshTable | REFRESH (STRING | .*?) #refreshResource | CACHE LAZY? TABLE multipartIdentifier (OPTIONS options=tablePropertyList)? (AS? query)? #cacheTable | UNCACHE TABLE (IF EXISTS)? multipartIdentifier #uncacheTable | CLEAR CACHE #clearCache | LOAD DATA LOCAL? INPATH path=STRING OVERWRITE? INTO TABLE multipartIdentifier partitionSpec? #loadData | TRUNCATE TABLE multipartIdentifier partitionSpec? #truncateTable | MSCK REPAIR TABLE multipartIdentifier #repairTable | op=(ADD | LIST) identifier .*? #manageResource | SET ROLE .*? #failNativeCommand | SET .*? #setConfiguration | RESET #resetConfiguration | DELETE FROM multipartIdentifier tableAlias whereClause? #deleteFromTable | UPDATE multipartIdentifier tableAlias setClause whereClause? #updateTable | MERGE INTO target=multipartIdentifier targetAlias=tableAlias USING (source=multipartIdentifier | '(' sourceQuery=query')') sourceAlias=tableAlias ON mergeCondition=booleanExpression matchedClause* notMatchedClause* #mergeIntoTable | unsupportedHiveNativeCommands .*? #failNativeCommand ; unsupportedHiveNativeCommands : kw1=CREATE kw2=ROLE | kw1=DROP kw2=ROLE | kw1=GRANT kw2=ROLE? | kw1=REVOKE kw2=ROLE? | kw1=SHOW kw2=GRANT | kw1=SHOW kw2=ROLE kw3=GRANT? | kw1=SHOW kw2=PRINCIPALS | kw1=SHOW kw2=ROLES | kw1=SHOW kw2=CURRENT kw3=ROLES | kw1=EXPORT kw2=TABLE | kw1=IMPORT kw2=TABLE | kw1=SHOW kw2=COMPACTIONS | kw1=SHOW kw2=CREATE kw3=TABLE | kw1=SHOW kw2=TRANSACTIONS | kw1=SHOW kw2=INDEXES | kw1=SHOW kw2=LOCKS | kw1=CREATE kw2=INDEX | kw1=DROP kw2=INDEX | kw1=ALTER kw2=INDEX | kw1=LOCK kw2=TABLE | kw1=LOCK kw2=DATABASE | kw1=UNLOCK kw2=TABLE | kw1=UNLOCK kw2=DATABASE | kw1=CREATE kw2=TEMPORARY kw3=MACRO | kw1=DROP kw2=TEMPORARY kw3=MACRO | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=CLUSTERED | kw1=ALTER kw2=TABLE tableIdentifier kw3=CLUSTERED kw4=BY | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SORTED | kw1=ALTER kw2=TABLE tableIdentifier kw3=SKEWED kw4=BY | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SKEWED | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=STORED kw5=AS kw6=DIRECTORIES | kw1=ALTER kw2=TABLE tableIdentifier kw3=SET kw4=SKEWED kw5=LOCATION | kw1=ALTER kw2=TABLE tableIdentifier kw3=EXCHANGE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=ARCHIVE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=UNARCHIVE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=TOUCH | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=COMPACT | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=CONCATENATE | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=SET kw4=FILEFORMAT | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=REPLACE kw4=COLUMNS | kw1=START kw2=TRANSACTION | kw1=COMMIT | kw1=ROLLBACK | kw1=DFS | kw1=DELETE kw2=FROM ; createTableHeader : CREATE TEMPORARY? EXTERNAL? TABLE (IF NOT EXISTS)? multipartIdentifier ; replaceTableHeader : (CREATE OR)? REPLACE TABLE multipartIdentifier ; bucketSpec : CLUSTERED BY identifierList (SORTED BY orderedIdentifierList)? INTO INTEGER_VALUE BUCKETS ; skewSpec : SKEWED BY identifierList ON (constantList | nestedConstantList) (STORED AS DIRECTORIES)? ; locationSpec : LOCATION STRING ; query : ctes? queryTerm queryOrganization ; insertInto : INSERT OVERWRITE TABLE? multipartIdentifier (partitionSpec (IF NOT EXISTS)?)? #insertOverwriteTable | INSERT INTO TABLE? multipartIdentifier partitionSpec? (IF NOT EXISTS)? #insertIntoTable | INSERT OVERWRITE LOCAL? DIRECTORY path=STRING rowFormat? createFileFormat? #insertOverwriteHiveDir | INSERT OVERWRITE LOCAL? DIRECTORY (path=STRING)? tableProvider (OPTIONS options=tablePropertyList)? #insertOverwriteDir ; partitionSpecLocation : partitionSpec locationSpec? ; partitionSpec : PARTITION '(' partitionVal (',' partitionVal)* ')' ; partitionVal : identifier (EQ constant)? ; database : DATABASE | SCHEMA ; describeFuncName : qualifiedName | STRING | comparisonOperator | arithmeticOperator | predicateOperator ; describeColName : nameParts+=identifier ('.' nameParts+=identifier)* ; ctes : WITH namedQuery (',' namedQuery)* ; namedQuery : name=errorCapturingIdentifier (columnAliases=identifierList)? AS? '(' query ')' ; tableProvider : USING multipartIdentifier ; tablePropertyList : '(' tableProperty (',' tableProperty)* ')' ; tableProperty : key=tablePropertyKey (EQ? value=tablePropertyValue)? ; tablePropertyKey : identifier ('.' identifier)* | STRING ; tablePropertyValue : INTEGER_VALUE | DECIMAL_VALUE | booleanValue | STRING ; constantList : '(' constant (',' constant)* ')' ; nestedConstantList : '(' constantList (',' constantList)* ')' ; createFileFormat : STORED AS fileFormat | STORED BY storageHandler ; fileFormat : INPUTFORMAT inFmt=STRING OUTPUTFORMAT outFmt=STRING #tableFileFormat | identifier #genericFileFormat ; storageHandler : STRING (WITH SERDEPROPERTIES tablePropertyList)? ; resource : identifier STRING ; dmlStatementNoWith : insertInto queryTerm queryOrganization #singleInsertQuery | fromClause multiInsertQueryBody+ #multiInsertQuery ; queryOrganization : (ORDER BY order+=sortItem (',' order+=sortItem)*)? (CLUSTER BY clusterBy+=expression (',' clusterBy+=expression)*)? (DISTRIBUTE BY distributeBy+=expression (',' distributeBy+=expression)*)? (SORT BY sort+=sortItem (',' sort+=sortItem)*)? windowClause? (LIMIT (ALL | limit=expression))? ; multiInsertQueryBody : insertInto fromStatementBody ; queryTerm : queryPrimary #queryTermDefault | left=queryTerm {legacy_setops_precedence_enbled}? operator=(INTERSECT | UNION | EXCEPT | SETMINUS) setQuantifier? right=queryTerm #setOperation | left=queryTerm {!legacy_setops_precedence_enbled}? operator=INTERSECT setQuantifier? right=queryTerm #setOperation | left=queryTerm {!legacy_setops_precedence_enbled}? operator=(UNION | EXCEPT | SETMINUS) setQuantifier? right=queryTerm #setOperation ; queryPrimary : querySpecification #queryPrimaryDefault | fromStatement #fromStmt | TABLE multipartIdentifier #table | inlineTable #inlineTableDefault1 | '(' query ')' #subquery ; sortItem : expression ordering=(ASC | DESC)? (NULLS nullOrder=(LAST | FIRST))? ; fromStatement : fromClause fromStatementBody+ ; fromStatementBody : transformClause whereClause? queryOrganization | selectClause lateralView* whereClause? aggregationClause? havingClause? windowClause? queryOrganization ; querySpecification : transformClause fromClause? whereClause? #transformQuerySpecification | selectClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause? #regularQuerySpecification ; transformClause : (SELECT kind=TRANSFORM '(' namedExpressionSeq ')' | kind=MAP namedExpressionSeq | kind=REDUCE namedExpressionSeq) inRowFormat=rowFormat? (RECORDWRITER recordWriter=STRING)? USING script=STRING (AS (identifierSeq | colTypeList | ('(' (identifierSeq | colTypeList) ')')))? outRowFormat=rowFormat? (RECORDREADER recordReader=STRING)? ; selectClause : SELECT (hints+=hint)* setQuantifier? namedExpressionSeq ; setClause : SET assignmentList ; matchedClause : WHEN MATCHED (AND matchedCond=booleanExpression)? THEN matchedAction ; notMatchedClause : WHEN NOT MATCHED (AND notMatchedCond=booleanExpression)? THEN notMatchedAction ; matchedAction : DELETE | UPDATE SET ASTERISK | UPDATE SET assignmentList ; notMatchedAction : INSERT ASTERISK | INSERT '(' columns=multipartIdentifierList ')' VALUES '(' expression (',' expression)* ')' ; assignmentList : assignment (',' assignment)* ; assignment : key=multipartIdentifier EQ value=expression ; whereClause : WHERE booleanExpression ; havingClause : HAVING booleanExpression ; hint : '/*+' hintStatements+=hintStatement (','? hintStatements+=hintStatement)* '*/' ; hintStatement : hintName=identifier | hintName=identifier '(' parameters+=primaryExpression (',' parameters+=primaryExpression)* ')' ; fromClause : FROM relation (',' relation)* lateralView* pivotClause? ; aggregationClause : GROUP BY groupingExpressions+=expression (',' groupingExpressions+=expression)* ( WITH kind=ROLLUP | WITH kind=CUBE | kind=GROUPING SETS '(' groupingSet (',' groupingSet)* ')')? | GROUP BY kind=GROUPING SETS '(' groupingSet (',' groupingSet)* ')' ; groupingSet : '(' (expression (',' expression)*)? ')' | expression ; pivotClause : PIVOT '(' aggregates=namedExpressionSeq FOR pivotColumn IN '(' pivotValues+=pivotValue (',' pivotValues+=pivotValue)* ')' ')' ; pivotColumn : identifiers+=identifier | '(' identifiers+=identifier (',' identifiers+=identifier)* ')' ; pivotValue : expression (AS? identifier)? ; lateralView : LATERAL VIEW (OUTER)? qualifiedName '(' (expression (',' expression)*)? ')' tblName=identifier (AS? colName+=identifier (',' colName+=identifier)*)? ; setQuantifier : DISTINCT | ALL ; relation : relationPrimary joinRelation* ; joinRelation : (joinType) JOIN right=relationPrimary joinCriteria? | NATURAL joinType JOIN right=relationPrimary ; joinType : INNER? | CROSS | LEFT OUTER? | LEFT? SEMI | RIGHT OUTER? | FULL OUTER? | LEFT? ANTI ; joinCriteria : ON booleanExpression | USING identifierList ; sample : TABLESAMPLE '(' sampleMethod? ')' ; sampleMethod : negativeSign=MINUS? percentage=(INTEGER_VALUE | DECIMAL_VALUE) PERCENTLIT #sampleByPercentile | expression ROWS #sampleByRows | sampleType=BUCKET numerator=INTEGER_VALUE OUT OF denominator=INTEGER_VALUE (ON (identifier | qualifiedName '(' ')'))? #sampleByBucket | bytes=expression #sampleByBytes ; identifierList : '(' identifierSeq ')' ; identifierSeq : ident+=errorCapturingIdentifier (',' ident+=errorCapturingIdentifier)* ; orderedIdentifierList : '(' orderedIdentifier (',' orderedIdentifier)* ')' ; orderedIdentifier : ident=errorCapturingIdentifier ordering=(ASC | DESC)? ; identifierCommentList : '(' identifierComment (',' identifierComment)* ')' ; identifierComment : identifier (COMMENT STRING)? ; relationPrimary : multipartIdentifier sample? tableAlias #tableName | '(' query ')' sample? tableAlias #aliasedQuery | '(' relation ')' sample? tableAlias #aliasedRelation | inlineTable #inlineTableDefault2 | functionTable #tableValuedFunction ; inlineTable : VALUES expression (',' expression)* tableAlias ; functionTable : funcName=errorCapturingIdentifier '(' (expression (',' expression)*)? ')' tableAlias ; tableAlias : (AS? strictIdentifier identifierList?)? ; rowFormat : ROW FORMAT SERDE name=STRING (WITH SERDEPROPERTIES props=tablePropertyList)? #rowFormatSerde | ROW FORMAT DELIMITED (FIELDS TERMINATED BY fieldsTerminatedBy=STRING (ESCAPED BY escapedBy=STRING)?)? (COLLECTION ITEMS TERMINATED BY collectionItemsTerminatedBy=STRING)? (MAP KEYS TERMINATED BY keysTerminatedBy=STRING)? (LINES TERMINATED BY linesSeparatedBy=STRING)? (NULL DEFINED AS nullDefinedAs=STRING)? #rowFormatDelimited ; multipartIdentifierList : multipartIdentifier (',' multipartIdentifier)* ; multipartIdentifier : parts+=errorCapturingIdentifier ('.' parts+=errorCapturingIdentifier)* ; tableIdentifier : (db=errorCapturingIdentifier '.')? table=errorCapturingIdentifier ; functionIdentifier : (db=errorCapturingIdentifier '.')? function=errorCapturingIdentifier ; namedExpression : expression (AS? (name=errorCapturingIdentifier | identifierList))? ; namedExpressionSeq : namedExpression (',' namedExpression)* ; transformList : '(' transforms+=transform (',' transforms+=transform)* ')' ; transform : qualifiedName #identityTransform | transformName=identifier '(' argument+=transformArgument (',' argument+=transformArgument)* ')' #applyTransform ; transformArgument : qualifiedName | constant ; expression : booleanExpression ; booleanExpression : NOT booleanExpression #logicalNot | EXISTS '(' query ')' #exists | valueExpression predicate? #predicated | left=booleanExpression operator=AND right=booleanExpression #logicalBinary | left=booleanExpression operator=OR right=booleanExpression #logicalBinary ; predicate : NOT? kind=BETWEEN lower=valueExpression AND upper=valueExpression | NOT? kind=IN '(' expression (',' expression)* ')' | NOT? kind=IN '(' query ')' | NOT? kind=(RLIKE | LIKE) pattern=valueExpression | IS NOT? kind=NULL | IS NOT? kind=(TRUE | FALSE | UNKNOWN) | IS NOT? kind=DISTINCT FROM right=valueExpression ; valueExpression : primaryExpression #valueExpressionDefault | operator=(MINUS | PLUS | TILDE) valueExpression #arithmeticUnary | left=valueExpression operator=(ASTERISK | SLASH | PERCENT | DIV) right=valueExpression #arithmeticBinary | left=valueExpression operator=(PLUS | MINUS | CONCAT_PIPE) right=valueExpression #arithmeticBinary | left=valueExpression operator=AMPERSAND right=valueExpression #arithmeticBinary | left=valueExpression operator=HAT right=valueExpression #arithmeticBinary | left=valueExpression operator=PIPE right=valueExpression #arithmeticBinary | left=valueExpression comparisonOperator right=valueExpression #comparison ; primaryExpression : name=(CURRENT_DATE | CURRENT_TIMESTAMP) #currentDatetime | CASE whenClause+ (ELSE elseExpression=expression)? END #searchedCase | CASE value=expression whenClause+ (ELSE elseExpression=expression)? END #simpleCase | CAST '(' expression AS dataType ')' #cast | STRUCT '(' (argument+=namedExpression (',' argument+=namedExpression)*)? ')' #struct | (FIRST | FIRST_VALUE) '(' expression ((IGNORE | RESPECT) NULLS)? ')' #first | (LAST | LAST_VALUE) '(' expression ((IGNORE | RESPECT) NULLS)? ')' #last | POSITION '(' substr=valueExpression IN str=valueExpression ')' #position | constant #constantDefault | ASTERISK #star | qualifiedName '.' ASTERISK #star | '(' namedExpression (',' namedExpression)+ ')' #rowConstructor | '(' query ')' #subqueryExpression | qualifiedName '(' (setQuantifier? argument+=expression (',' argument+=expression)*)? ')' (OVER windowSpec)? #functionCall | identifier '->' expression #lambda | '(' identifier (',' identifier)+ ')' '->' expression #lambda | value=primaryExpression '[' index=valueExpression ']' #subscript | identifier #columnReference | base=primaryExpression '.' fieldName=identifier #dereference | '(' expression ')' #parenthesizedExpression | EXTRACT '(' field=identifier FROM source=valueExpression ')' #extract | (SUBSTR | SUBSTRING) '(' str=valueExpression (FROM | ',') pos=valueExpression ((FOR | ',') len=valueExpression)? ')' #substring | TRIM '(' trimOption=(BOTH | LEADING | TRAILING)? (trimStr=valueExpression)? FROM srcStr=valueExpression ')' #trim | OVERLAY '(' input=valueExpression PLACING replace=valueExpression FROM position=valueExpression (FOR length=valueExpression)? ')' #overlay ; constant : NULL #nullLiteral | interval #intervalLiteral | identifier STRING #typeConstructor | number #numericLiteral | booleanValue #booleanLiteral | STRING+ #stringLiteral ; comparisonOperator : EQ | NEQ | NEQJ | LT | LTE | GT | GTE | NSEQ ; arithmeticOperator : PLUS | MINUS | ASTERISK | SLASH | PERCENT | DIV | TILDE | AMPERSAND | PIPE | CONCAT_PIPE | HAT ; predicateOperator : OR | AND | IN | NOT ; booleanValue : TRUE | FALSE ; interval : INTERVAL (errorCapturingMultiUnitsInterval | errorCapturingUnitToUnitInterval)? | {ansi}? (errorCapturingMultiUnitsInterval | errorCapturingUnitToUnitInterval) ; errorCapturingMultiUnitsInterval : multiUnitsInterval unitToUnitInterval? ; multiUnitsInterval : (intervalValue intervalUnit)+ ; errorCapturingUnitToUnitInterval : body=unitToUnitInterval (error1=multiUnitsInterval | error2=unitToUnitInterval)? ; unitToUnitInterval : value=intervalValue from=intervalUnit TO to=intervalUnit ; intervalValue : (PLUS | MINUS)? (INTEGER_VALUE | DECIMAL_VALUE) | STRING ; intervalUnit : DAY | DAYS | HOUR | HOURS | MICROSECOND | MICROSECONDS | MILLISECOND | MILLISECONDS | MINUTE | MINUTES | MONTH | MONTHS | SECOND | SECONDS | WEEK | WEEKS | YEAR | YEARS ; colPosition : FIRST | AFTER multipartIdentifier ; dataType : complex=ARRAY '<' dataType '>' #complexDataType | complex=MAP '<' dataType ',' dataType '>' #complexDataType | complex=STRUCT ('<' complexColTypeList? '>' | NEQ) #complexDataType | identifier ('(' INTEGER_VALUE (',' INTEGER_VALUE)* ')')? #primitiveDataType ; qualifiedColTypeWithPositionList : qualifiedColTypeWithPosition (',' qualifiedColTypeWithPosition)* ; qualifiedColTypeWithPosition : name=multipartIdentifier dataType (COMMENT comment=STRING)? colPosition? ; colTypeList : colType (',' colType)* ; colType : colName=errorCapturingIdentifier dataType (COMMENT STRING)? ; complexColTypeList : complexColType (',' complexColType)* ; complexColType : identifier ':' dataType (COMMENT STRING)? ; whenClause : WHEN condition=expression THEN result=expression ; windowClause : WINDOW namedWindow (',' namedWindow)* ; namedWindow : name=errorCapturingIdentifier AS windowSpec ; windowSpec : name=errorCapturingIdentifier #windowRef | '('name=errorCapturingIdentifier')' #windowRef | '(' ( CLUSTER BY partition+=expression (',' partition+=expression)* | ((PARTITION | DISTRIBUTE) BY partition+=expression (',' partition+=expression)*)? ((ORDER | SORT) BY sortItem (',' sortItem)*)?) windowFrame? ')' #windowDef ; windowFrame : frameType=RANGE start=frameBound | frameType=ROWS start=frameBound | frameType=RANGE BETWEEN start=frameBound AND end=frameBound | frameType=ROWS BETWEEN start=frameBound AND end=frameBound ; frameBound : UNBOUNDED boundType=(PRECEDING | FOLLOWING) | boundType=CURRENT ROW | expression boundType=(PRECEDING | FOLLOWING) ; qualifiedNameList : qualifiedName (',' qualifiedName)* ; qualifiedName : identifier ('.' identifier)* ; // this rule is used for explicitly capturing wrong identifiers such as test-table, which should actually be `test-table` // replace identifier with errorCapturingIdentifier where the immediate follow symbol is not an expression, otherwise // valid expressions such as ""a-b"" can be recognized as an identifier errorCapturingIdentifier : identifier errorCapturingIdentifierExtra ; // extra left-factoring grammar errorCapturingIdentifierExtra : (MINUS identifier)+ #errorIdent | #realIdent ; identifier : strictIdentifier | {!ansi}? strictNonReserved ; strictIdentifier : IDENTIFIER #unquotedIdentifier | quotedIdentifier #quotedIdentifierAlternative | {ansi}? ansiNonReserved #unquotedIdentifier | {!ansi}? nonReserved #unquotedIdentifier ; quotedIdentifier : BACKQUOTED_IDENTIFIER ; number : MINUS? DECIMAL_VALUE #decimalLiteral | MINUS? INTEGER_VALUE #integerLiteral | MINUS? BIGINT_LITERAL #bigIntLiteral | MINUS? SMALLINT_LITERAL #smallIntLiteral | MINUS? TINYINT_LITERAL #tinyIntLiteral | MINUS? DOUBLE_LITERAL #doubleLiteral | MINUS? BIGDECIMAL_LITERAL #bigDecimalLiteral ; // When `spark.sql.ansi.enabled=true`, there are 2 kinds of keywords in Spark SQL. // - Reserved keywords: // Keywords that are reserved and can't be used as identifiers for table, view, column, // function, alias, etc. // - Non-reserved keywords: // Keywords that have a special meaning only in particular contexts and can be used as // identifiers in other contexts. For example, `SELECT 1 WEEK` is an interval literal, but WEEK // can be used as identifiers in other places. // You can find the full keywords list by searching ""Start of the keywords list"" in this file. // The non-reserved keywords are listed below. Keywords not in this list are reserved keywords. ansiNonReserved : ADD | AFTER | ALTER | ANALYZE | ARCHIVE | ARRAY | ASC | AT | BETWEEN | BUCKET | BUCKETS | BY | CACHE | CASCADE | CHANGE | CLEAR | CLUSTER | CLUSTERED | CODEGEN | COLLECTION | COLUMNS | COMMENT | COMMIT | COMPACT | COMPACTIONS | COMPUTE | CONCATENATE | COST | CUBE | CURRENT | DATA | DATABASE | DATABASES | DAYS | DBPROPERTIES | DEFINED | DELETE | DELIMITED | DESC | DESCRIBE | DFS | DIRECTORIES | DIRECTORY | DISTRIBUTE | DIV | DROP | ESCAPED | EXCHANGE | EXISTS | EXPLAIN | EXPORT | EXTENDED | EXTERNAL | EXTRACT | FIELDS | FILEFORMAT | FIRST | FOLLOWING | FORMAT | FORMATTED | FUNCTION | FUNCTIONS | GLOBAL | GROUPING | HOURS | IF | IGNORE | IMPORT | INDEX | INDEXES | INPATH | INPUTFORMAT | INSERT | INTERVAL | ITEMS | KEYS | LAST | LATERAL | LAZY | LIKE | LIMIT | LINES | LIST | LOAD | LOCAL | LOCATION | LOCK | LOCKS | LOGICAL | MACRO | MAP | MATCHED | MERGE | MICROSECOND | MICROSECONDS | MILLISECOND | MILLISECONDS | MINUTES | MONTHS | MSCK | NAMESPACE | NAMESPACES | NO | NULLS | OF | OPTION | OPTIONS | OUT | OUTPUTFORMAT | OVER | OVERLAY | OVERWRITE | PARTITION | PARTITIONED | PARTITIONS | PERCENTLIT | PIVOT | PLACING | POSITION | PRECEDING | PRINCIPALS | PROPERTIES | PURGE | QUERY | RANGE | RECORDREADER | RECORDWRITER | RECOVER | REDUCE | REFRESH | RENAME | REPAIR | REPLACE | RESET | RESPECT | RESTRICT | REVOKE | RLIKE | ROLE | ROLES | ROLLBACK | ROLLUP | ROW | ROWS | SCHEMA | SECONDS | SEPARATED | SERDE | SERDEPROPERTIES | SET | SETS | SHOW | SKEWED | SORT | SORTED | START | STATISTICS | STORED | STRATIFY | STRUCT | SUBSTR | SUBSTRING | TABLES | TABLESAMPLE | TBLPROPERTIES | TEMPORARY | TERMINATED | TOUCH | TRANSACTION | TRANSACTIONS | TRANSFORM | TRIM | TRUE | TRUNCATE | UNARCHIVE | UNBOUNDED | UNCACHE | UNLOCK | UNSET | UPDATE | USE | VALUES | VIEW | WEEK | WEEKS | WINDOW | YEARS ; // When `spark.sql.ansi.enabled=false`, there are 2 kinds of keywords in Spark SQL. // - Non-reserved keywords: // Same definition as the one when `spark.sql.ansi.enabled=true`. // - Strict-non-reserved keywords: // A strict version of non-reserved keywords, which can not be used as table alias. // You can find the full keywords list by searching ""Start of the keywords list"" in this file. // The strict-non-reserved keywords are listed in `strictNonReserved`. // The non-reserved keywords are listed in `nonReserved`. // These 2 together contain all the keywords. strictNonReserved : ANTI | CROSS | EXCEPT | FULL | INNER | INTERSECT | JOIN | LEFT | NATURAL | ON | RIGHT | SEMI | SETMINUS | UNION | USING ; nonReserved : ADD | AFTER | ALL | ALTER | ANALYZE | AND | ANY | ARCHIVE | ARRAY | AS | ASC | AT | AUTHORIZATION | BETWEEN | BOTH | BUCKET | BUCKETS | BY | CACHE | CASCADE | CASE | CAST | CHANGE | CHECK | CLEAR | CLUSTER | CLUSTERED | CODEGEN | COLLATE | COLLECTION | COLUMN | COLUMNS | COMMENT | COMMIT | COMPACT | COMPACTIONS | COMPUTE | CONCATENATE | CONSTRAINT | COST | CREATE | CUBE | CURRENT | CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP | CURRENT_USER | DATA | DATABASE | DATABASES | DAY | DAYS | DBPROPERTIES | DEFINED | DELETE | DELIMITED | DESC | DESCRIBE | DFS | DIRECTORIES | DIRECTORY | DISTINCT | DISTRIBUTE | DIV | DROP | ELSE | END | ESCAPED | EXCHANGE | EXISTS | EXPLAIN | EXPORT | EXTENDED | EXTERNAL | EXTRACT | FALSE | FETCH | FIELDS | FILEFORMAT | FIRST | FIRST_VALUE | FOLLOWING | FOR | FOREIGN | FORMAT | FORMATTED | FROM | FUNCTION | FUNCTIONS | GLOBAL | GRANT | GROUP | GROUPING | HAVING | HOUR | HOURS | IF | IGNORE | IMPORT | IN | INDEX | INDEXES | INPATH | INPUTFORMAT | INSERT | INTERVAL | INTO | IS | ITEMS | KEYS | LAST | LAST_VALUE | LATERAL | LAZY | LEADING | LIKE | LIMIT | LINES | LIST | LOAD | LOCAL | LOCATION | LOCK | LOCKS | LOGICAL | MACRO | MAP | MATCHED | MERGE | MICROSECOND | MICROSECONDS | MILLISECOND | MILLISECONDS | MINUTE | MINUTES | MONTH | MONTHS | MSCK | NAMESPACE | NAMESPACES | NO | NOT | NULL | NULLS | OF | ONLY | OPTION | OPTIONS | OR | ORDER | OUT | OUTER | OUTPUTFORMAT | OVER | OVERLAPS | OVERLAY | OVERWRITE | PARTITION | PARTITIONED | PARTITIONS | PERCENTLIT | PIVOT | PLACING | POSITION | PRECEDING | PRIMARY | PRINCIPALS | PROPERTIES | PURGE | QUERY | RANGE | RECORDREADER | RECORDWRITER | RECOVER | REDUCE | REFERENCES | REFRESH | RENAME | REPAIR | REPLACE | RESET | RESPECT | RESTRICT | REVOKE | RLIKE | ROLE | ROLES | ROLLBACK | ROLLUP | ROW | ROWS | SCHEMA | SECOND | SECONDS | SELECT | SEPARATED | SERDE | SERDEPROPERTIES | SESSION_USER | SET | SETS | SHOW | SKEWED | SOME | SORT | SORTED | START | STATISTICS | STORED | STRATIFY | STRUCT | SUBSTR | SUBSTRING | TABLE | TABLES | TABLESAMPLE | TBLPROPERTIES | TEMPORARY | TERMINATED | THEN | TO | TOUCH | TRAILING | TRANSACTION | TRANSACTIONS | TRANSFORM | TRIM | TRUE | TRUNCATE | TYPE | UNARCHIVE | UNBOUNDED | UNCACHE | UNIQUE | UNKNOWN | UNLOCK | UNSET | UPDATE | USE | USER | VALUES | VIEW | WEEK | WEEKS | WHEN | WHERE | WINDOW | WITH | YEAR | YEARS ; // NOTE: If you add a new token in the list below, you should update the list of keywords // in `docs/sql-keywords.md`. If the token is a non-reserved keyword, // please update `ansiNonReserved` and `nonReserved` as well. //============================ // Start of the keywords list //============================ ADD: 'ADD'; AFTER: 'AFTER'; ALL: 'ALL'; ALTER: 'ALTER'; ANALYZE: 'ANALYZE'; AND: 'AND'; ANTI: 'ANTI'; ANY: 'ANY'; ARCHIVE: 'ARCHIVE'; ARRAY: 'ARRAY'; AS: 'AS'; ASC: 'ASC'; AT: 'AT'; AUTHORIZATION: 'AUTHORIZATION'; BETWEEN: 'BETWEEN'; BOTH: 'BOTH'; BUCKET: 'BUCKET'; BUCKETS: 'BUCKETS'; BY: 'BY'; CACHE: 'CACHE'; CASCADE: 'CASCADE'; CASE: 'CASE'; CAST: 'CAST'; CHANGE: 'CHANGE'; CHECK: 'CHECK'; CLEAR: 'CLEAR'; CLUSTER: 'CLUSTER'; CLUSTERED: 'CLUSTERED'; CODEGEN: 'CODEGEN'; COLLATE: 'COLLATE'; COLLECTION: 'COLLECTION'; COLUMN: 'COLUMN'; COLUMNS: 'COLUMNS'; COMMENT: 'COMMENT'; COMMIT: 'COMMIT'; COMPACT: 'COMPACT'; COMPACTIONS: 'COMPACTIONS'; COMPUTE: 'COMPUTE'; CONCATENATE: 'CONCATENATE'; CONSTRAINT: 'CONSTRAINT'; COST: 'COST'; CREATE: 'CREATE'; CROSS: 'CROSS'; CUBE: 'CUBE'; CURRENT: 'CURRENT'; CURRENT_DATE: 'CURRENT_DATE'; CURRENT_TIME: 'CURRENT_TIME'; CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; CURRENT_USER: 'CURRENT_USER'; DATA: 'DATA'; DATABASE: 'DATABASE'; DATABASES: 'DATABASES' | 'SCHEMAS'; DAY: 'DAY'; DAYS: 'DAYS'; DBPROPERTIES: 'DBPROPERTIES'; DEFINED: 'DEFINED'; DELETE: 'DELETE'; DELIMITED: 'DELIMITED'; DESC: 'DESC'; DESCRIBE: 'DESCRIBE'; DFS: 'DFS'; DIRECTORIES: 'DIRECTORIES'; DIRECTORY: 'DIRECTORY'; DISTINCT: 'DISTINCT'; DISTRIBUTE: 'DISTRIBUTE'; DROP: 'DROP'; ELSE: 'ELSE'; END: 'END'; ESCAPED: 'ESCAPED'; EXCEPT: 'EXCEPT'; EXCHANGE: 'EXCHANGE'; EXISTS: 'EXISTS'; EXPLAIN: 'EXPLAIN'; EXPORT: 'EXPORT'; EXTENDED: 'EXTENDED'; EXTERNAL: 'EXTERNAL'; EXTRACT: 'EXTRACT'; FALSE: 'FALSE'; FETCH: 'FETCH'; FIELDS: 'FIELDS'; FILEFORMAT: 'FILEFORMAT'; FIRST: 'FIRST'; FIRST_VALUE: 'FIRST_VALUE'; FOLLOWING: 'FOLLOWING'; FOR: 'FOR'; FOREIGN: 'FOREIGN'; FORMAT: 'FORMAT'; FORMATTED: 'FORMATTED'; FROM: 'FROM'; FULL: 'FULL'; FUNCTION: 'FUNCTION'; FUNCTIONS: 'FUNCTIONS'; GLOBAL: 'GLOBAL'; GRANT: 'GRANT'; GROUP: 'GROUP'; GROUPING: 'GROUPING'; HAVING: 'HAVING'; HOUR: 'HOUR'; HOURS: 'HOURS'; IF: 'IF'; IGNORE: 'IGNORE'; IMPORT: 'IMPORT'; IN: 'IN'; INDEX: 'INDEX'; INDEXES: 'INDEXES'; INNER: 'INNER'; INPATH: 'INPATH'; INPUTFORMAT: 'INPUTFORMAT'; INSERT: 'INSERT'; INTERSECT: 'INTERSECT'; INTERVAL: 'INTERVAL'; INTO: 'INTO'; IS: 'IS'; ITEMS: 'ITEMS'; JOIN: 'JOIN'; KEYS: 'KEYS'; LAST: 'LAST'; LAST_VALUE: 'LAST_VALUE'; LATERAL: 'LATERAL'; LAZY: 'LAZY'; LEADING: 'LEADING'; LEFT: 'LEFT'; LIKE: 'LIKE'; LIMIT: 'LIMIT'; LINES: 'LINES'; LIST: 'LIST'; LOAD: 'LOAD'; LOCAL: 'LOCAL'; LOCATION: 'LOCATION'; LOCK: 'LOCK'; LOCKS: 'LOCKS'; LOGICAL: 'LOGICAL'; MACRO: 'MACRO'; MAP: 'MAP'; MATCHED: 'MATCHED'; MERGE: 'MERGE'; MICROSECOND: 'MICROSECOND'; MICROSECONDS: 'MICROSECONDS'; MILLISECOND: 'MILLISECOND'; MILLISECONDS: 'MILLISECONDS'; MINUTE: 'MINUTE'; MINUTES: 'MINUTES'; MONTH: 'MONTH'; MONTHS: 'MONTHS'; MSCK: 'MSCK'; NAMESPACE: 'NAMESPACE'; NAMESPACES: 'NAMESPACES'; NATURAL: 'NATURAL'; NO: 'NO'; NOT: 'NOT' | '!'; NULL: 'NULL'; NULLS: 'NULLS'; OF: 'OF'; ON: 'ON'; ONLY: 'ONLY'; OPTION: 'OPTION'; OPTIONS: 'OPTIONS'; OR: 'OR'; ORDER: 'ORDER'; OUT: 'OUT'; OUTER: 'OUTER'; OUTPUTFORMAT: 'OUTPUTFORMAT'; OVER: 'OVER'; OVERLAPS: 'OVERLAPS'; OVERLAY: 'OVERLAY'; OVERWRITE: 'OVERWRITE'; PARTITION: 'PARTITION'; PARTITIONED: 'PARTITIONED'; PARTITIONS: 'PARTITIONS'; PERCENTLIT: 'PERCENT'; PIVOT: 'PIVOT'; PLACING: 'PLACING'; POSITION: 'POSITION'; PRECEDING: 'PRECEDING'; PRIMARY: 'PRIMARY'; PRINCIPALS: 'PRINCIPALS'; PROPERTIES: 'PROPERTIES'; PURGE: 'PURGE'; QUERY: 'QUERY'; RANGE: 'RANGE'; RECORDREADER: 'RECORDREADER'; RECORDWRITER: 'RECORDWRITER'; RECOVER: 'RECOVER'; REDUCE: 'REDUCE'; REFERENCES: 'REFERENCES'; REFRESH: 'REFRESH'; RENAME: 'RENAME'; REPAIR: 'REPAIR'; REPLACE: 'REPLACE'; RESET: 'RESET'; RESPECT: 'RESPECT'; RESTRICT: 'RESTRICT'; REVOKE: 'REVOKE'; RIGHT: 'RIGHT'; RLIKE: 'RLIKE' | 'REGEXP'; ROLE: 'ROLE'; ROLES: 'ROLES'; ROLLBACK: 'ROLLBACK'; ROLLUP: 'ROLLUP'; ROW: 'ROW'; ROWS: 'ROWS'; SCHEMA: 'SCHEMA'; SECOND: 'SECOND'; SECONDS: 'SECONDS'; SELECT: 'SELECT'; SEMI: 'SEMI'; SEPARATED: 'SEPARATED'; SERDE: 'SERDE'; SERDEPROPERTIES: 'SERDEPROPERTIES'; SESSION_USER: 'SESSION_USER'; SET: 'SET'; SETMINUS: 'MINUS'; SETS: 'SETS'; SHOW: 'SHOW'; SKEWED: 'SKEWED'; SOME: 'SOME'; SORT: 'SORT'; SORTED: 'SORTED'; START: 'START'; STATISTICS: 'STATISTICS'; STORED: 'STORED'; STRATIFY: 'STRATIFY'; STRUCT: 'STRUCT'; SUBSTR: 'SUBSTR'; SUBSTRING: 'SUBSTRING'; TABLE: 'TABLE'; TABLES: 'TABLES'; TABLESAMPLE: 'TABLESAMPLE'; TBLPROPERTIES: 'TBLPROPERTIES'; TEMPORARY: 'TEMPORARY' | 'TEMP'; TERMINATED: 'TERMINATED'; THEN: 'THEN'; TO: 'TO'; TOUCH: 'TOUCH'; TRAILING: 'TRAILING'; TRANSACTION: 'TRANSACTION'; TRANSACTIONS: 'TRANSACTIONS'; TRANSFORM: 'TRANSFORM'; TRIM: 'TRIM'; TRUE: 'TRUE'; TRUNCATE: 'TRUNCATE'; TYPE: 'TYPE'; UNARCHIVE: 'UNARCHIVE'; UNBOUNDED: 'UNBOUNDED'; UNCACHE: 'UNCACHE'; UNION: 'UNION'; UNIQUE: 'UNIQUE'; UNKNOWN: 'UNKNOWN'; UNLOCK: 'UNLOCK'; UNSET: 'UNSET'; UPDATE: 'UPDATE'; USE: 'USE'; USER: 'USER'; USING: 'USING'; VALUES: 'VALUES'; VIEW: 'VIEW'; WEEK: 'WEEK'; WEEKS: 'WEEKS'; WHEN: 'WHEN'; WHERE: 'WHERE'; WINDOW: 'WINDOW'; WITH: 'WITH'; YEAR: 'YEAR'; YEARS: 'YEARS'; //============================ // End of the keywords list //============================ EQ : '=' | '=='; NSEQ: '<=>'; NEQ : '<>'; NEQJ: '!='; LT : '<'; LTE : '<=' | '!>'; GT : '>'; GTE : '>=' | '!<'; PLUS: '+'; MINUS: '-'; ASTERISK: '*'; SLASH: '/'; PERCENT: '%'; DIV: 'DIV'; TILDE: '~'; AMPERSAND: '&'; PIPE: '|'; CONCAT_PIPE: '||'; HAT: '^'; STRING : '\\'' ( ~('\\''|'\\\\') | ('\\\\' .) )* '\\'' | '""' ( ~('""'|'\\\\') | ('\\\\' .) )* '""' ; BIGINT_LITERAL : DIGIT+ 'L' ; SMALLINT_LITERAL : DIGIT+ 'S' ; TINYINT_LITERAL : DIGIT+ 'Y' ; INTEGER_VALUE : DIGIT+ ; DECIMAL_VALUE : DIGIT+ EXPONENT | DECIMAL_DIGITS EXPONENT? {isValidDecimal()}? ; DOUBLE_LITERAL : DIGIT+ EXPONENT? 'D' | DECIMAL_DIGITS EXPONENT? 'D' {isValidDecimal()}? ; BIGDECIMAL_LITERAL : DIGIT+ EXPONENT? 'BD' | DECIMAL_DIGITS EXPONENT? 'BD' {isValidDecimal()}? ; IDENTIFIER : (LETTER | DIGIT | '_')+ ; BACKQUOTED_IDENTIFIER : '`' ( ~'`' | '``' )* '`' ; fragment DECIMAL_DIGITS : DIGIT+ '.' DIGIT* | '.' DIGIT+ ; fragment EXPONENT : 'E' [+-]? DIGIT+ ; fragment DIGIT : [0-9] ; fragment LETTER : [A-Z] ; SIMPLE_COMMENT : '--' ~[\\r\\n]* '\\r'? '\\n'? -> channel(HIDDEN) ; BRACKETED_EMPTY_COMMENT : '/**/' -> channel(HIDDEN) ; BRACKETED_COMMENT : '/*' ~[+] .*? '*/' -> channel(HIDDEN) ; WS : [ \\r\\n\\t]+ -> channel(HIDDEN) ; // Catch-all for anything we can't recognize. // We use this to be able to ignore and recover all the text // when splitting statements with DelimiterLexer UNRECOGNIZED : . ; ",12336,False,2308.7071041419217,median "############################################################################### # Copyright 2018 Intel Corporation # All Rights Reserved. # # If this software was obtained under the Intel Simplified Software License, # the following terms apply: # # The source code, information and material (""Material"") contained herein is # owned by Intel Corporation or its suppliers or licensors, and title to such # Material remains with Intel Corporation or its suppliers or licensors. The # Material contains proprietary information of Intel or its suppliers and # licensors. The Material is protected by worldwide copyright laws and treaty # provisions. No part of the Material may be used, copied, reproduced, # modified, published, uploaded, posted, transmitted, distributed or disclosed # in any way without Intel's prior express written permission. No license under # any patent, copyright or other intellectual property rights in the Material # is granted to or conferred upon you, either expressly, by implication, # inducement, estoppel or otherwise. Any license under such intellectual # property rights must be express and approved by Intel in writing. # # Unless otherwise agreed by Intel in writing, you may not remove or alter this # notice or any other notice embedded in Materials by Intel or Intel's # suppliers or licensors in any way. # # # If this software was obtained under the Apache License, Version 2.0 (the # ""License""), the following terms apply: # # 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. ############################################################################### .text .p2align 6, 0x90 POLY: .quad 0x1, 0xC200000000000000 TWOONE: .quad 0x1, 0x100000000 SHUF_CONST: .quad 0x8090a0b0c0d0e0f, 0x1020304050607 MASK1: .quad 0xffffffffffffffff, 0x0 MASK2: .quad 0x0, 0xffffffffffffffff INC_1: .quad 1,0 .p2align 6, 0x90 .globl _AesGcmPrecompute_avx _AesGcmPrecompute_avx: movdqu (%rsi), %xmm0 pshufb SHUF_CONST(%rip), %xmm0 movdqa %xmm0, %xmm4 psllq $(1), %xmm0 psrlq $(63), %xmm4 movdqa %xmm4, %xmm3 pslldq $(8), %xmm4 psrldq $(8), %xmm3 por %xmm4, %xmm0 pshufd $(36), %xmm3, %xmm4 pcmpeqd TWOONE(%rip), %xmm4 pand POLY(%rip), %xmm4 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm1 pshufd $(78), %xmm1, %xmm5 pshufd $(78), %xmm0, %xmm3 pxor %xmm1, %xmm5 pxor %xmm0, %xmm3 pclmulqdq $(0), %xmm3, %xmm5 movdqa %xmm1, %xmm4 pclmulqdq $(0), %xmm0, %xmm1 pxor %xmm3, %xmm3 pclmulqdq $(17), %xmm0, %xmm4 pxor %xmm1, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm3 pslldq $(8), %xmm5 pxor %xmm3, %xmm4 pxor %xmm5, %xmm1 movdqa %xmm1, %xmm3 movdqa %xmm1, %xmm5 movdqa %xmm1, %xmm15 psllq $(63), %xmm3 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm3 pxor %xmm15, %xmm3 movdqa %xmm3, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm3 pxor %xmm5, %xmm1 pxor %xmm3, %xmm4 movdqa %xmm1, %xmm5 psrlq $(5), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm1 pxor %xmm4, %xmm1 movdqa %xmm1, %xmm2 pshufd $(78), %xmm2, %xmm5 pshufd $(78), %xmm1, %xmm3 pxor %xmm2, %xmm5 pxor %xmm1, %xmm3 pclmulqdq $(0), %xmm3, %xmm5 movdqa %xmm2, %xmm4 pclmulqdq $(0), %xmm1, %xmm2 pxor %xmm3, %xmm3 pclmulqdq $(17), %xmm1, %xmm4 pxor %xmm2, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm3 pslldq $(8), %xmm5 pxor %xmm3, %xmm4 pxor %xmm5, %xmm2 movdqa %xmm2, %xmm3 movdqa %xmm2, %xmm5 movdqa %xmm2, %xmm15 psllq $(63), %xmm3 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm3 pxor %xmm15, %xmm3 movdqa %xmm3, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm3 pxor %xmm5, %xmm2 pxor %xmm3, %xmm4 movdqa %xmm2, %xmm5 psrlq $(5), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm2 pxor %xmm4, %xmm2 movdqu %xmm0, (%rdi) movdqu %xmm1, (16)(%rdi) movdqu %xmm2, (32)(%rdi) vzeroupper ret .p2align 6, 0x90 .globl _AesGcmMulGcm_avx _AesGcmMulGcm_avx: movdqa (%rdi), %xmm0 pshufb SHUF_CONST(%rip), %xmm0 movdqa (%rsi), %xmm1 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 movdqa %xmm0, %xmm4 movdqa %xmm0, %xmm15 psllq $(63), %xmm2 psllq $(62), %xmm4 psllq $(57), %xmm15 pxor %xmm4, %xmm2 pxor %xmm15, %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 pshufb SHUF_CONST(%rip), %xmm0 movdqa %xmm0, (%rdi) vzeroupper ret .p2align 6, 0x90 .globl _AesGcmAuth_avx _AesGcmAuth_avx: movdqa (%rdi), %xmm0 pshufb SHUF_CONST(%rip), %xmm0 movdqa (%rcx), %xmm1 movslq %edx, %rdx .p2align 6, 0x90 .Lauth_loopgas_3: movdqu (%rsi), %xmm2 pshufb SHUF_CONST(%rip), %xmm2 add $(16), %rsi pxor %xmm2, %xmm0 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 movdqa %xmm0, %xmm4 movdqa %xmm0, %xmm15 psllq $(63), %xmm2 psllq $(62), %xmm4 psllq $(57), %xmm15 pxor %xmm4, %xmm2 pxor %xmm15, %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 sub $(16), %rdx jnz .Lauth_loopgas_3 pshufb SHUF_CONST(%rip), %xmm0 movdqa %xmm0, (%rdi) vzeroupper ret .p2align 6, 0x90 .globl _AesGcmEnc_avx _AesGcmEnc_avx: push %rbx sub $(128), %rsp mov (152)(%rsp), %rax mov (160)(%rsp), %rbx mov (144)(%rsp), %rcx movdqa SHUF_CONST(%rip), %xmm4 movdqu (%rax), %xmm0 movdqu (%rbx), %xmm1 movdqu (%rcx), %xmm2 pshufb %xmm4, %xmm0 movdqa %xmm0, (%rsp) movdqa %xmm1, (16)(%rsp) pshufb %xmm4, %xmm2 pxor %xmm1, %xmm1 movdqa %xmm2, (32)(%rsp) movdqa %xmm1, (48)(%rsp) movdqa %xmm1, (64)(%rsp) movdqa %xmm1, (80)(%rsp) mov (168)(%rsp), %rbx movdqa (32)(%rbx), %xmm10 pshufd $(78), %xmm10, %xmm9 pxor %xmm10, %xmm9 movdqa %xmm9, (96)(%rsp) movslq %edx, %rdx mov %r9, %rcx mov %rdx, %rax and $(63), %rax and $(-64), %rdx jz .Lsingle_block_procgas_4 .p2align 6, 0x90 .Lblks4_loopgas_4: movdqa INC_1(%rip), %xmm6 movdqa SHUF_CONST(%rip), %xmm5 movdqa %xmm0, %xmm1 paddd %xmm6, %xmm1 movdqa %xmm1, %xmm2 paddd %xmm6, %xmm2 movdqa %xmm2, %xmm3 paddd %xmm6, %xmm3 movdqa %xmm3, %xmm4 paddd %xmm6, %xmm4 movdqa %xmm4, (%rsp) movdqa (%rcx), %xmm0 mov %rcx, %r10 pshufb %xmm5, %xmm1 pshufb %xmm5, %xmm2 pshufb %xmm5, %xmm3 pshufb %xmm5, %xmm4 pxor %xmm0, %xmm1 pxor %xmm0, %xmm2 pxor %xmm0, %xmm3 pxor %xmm0, %xmm4 movdqa (16)(%r10), %xmm0 add $(16), %r10 mov %r8d, %r11d sub $(1), %r11 .p2align 6, 0x90 .Lcipher4_loopgas_4: aesenc %xmm0, %xmm1 aesenc %xmm0, %xmm2 aesenc %xmm0, %xmm3 aesenc %xmm0, %xmm4 movdqa (16)(%r10), %xmm0 add $(16), %r10 dec %r11 jnz .Lcipher4_loopgas_4 aesenclast %xmm0, %xmm1 aesenclast %xmm0, %xmm2 aesenclast %xmm0, %xmm3 aesenclast %xmm0, %xmm4 movdqa (16)(%rsp), %xmm0 movdqa %xmm4, (16)(%rsp) movdqu (%rsi), %xmm4 movdqu (16)(%rsi), %xmm5 movdqu (32)(%rsi), %xmm6 movdqu (48)(%rsi), %xmm7 add $(64), %rsi pxor %xmm4, %xmm0 movdqu %xmm0, (%rdi) pshufb SHUF_CONST(%rip), %xmm0 pxor (32)(%rsp), %xmm0 pxor %xmm5, %xmm1 movdqu %xmm1, (16)(%rdi) pshufb SHUF_CONST(%rip), %xmm1 pxor (48)(%rsp), %xmm1 pxor %xmm6, %xmm2 movdqu %xmm2, (32)(%rdi) pshufb SHUF_CONST(%rip), %xmm2 pxor (64)(%rsp), %xmm2 pxor %xmm7, %xmm3 movdqu %xmm3, (48)(%rdi) pshufb SHUF_CONST(%rip), %xmm3 pxor (80)(%rsp), %xmm3 add $(64), %rdi cmp $(64), %rdx je .Lcombine_hashgas_4 movdqa MASK1(%rip), %xmm14 pshufd $(78), %xmm0, %xmm6 movdqa %xmm0, %xmm5 pxor %xmm0, %xmm6 pclmulqdq $(0), %xmm10, %xmm0 pshufd $(78), %xmm1, %xmm13 movdqa %xmm1, %xmm12 pxor %xmm1, %xmm13 pclmulqdq $(17), %xmm10, %xmm5 pclmulqdq $(0), %xmm9, %xmm6 pxor %xmm0, %xmm6 pxor %xmm5, %xmm6 pshufd $(78), %xmm6, %xmm4 movdqa %xmm4, %xmm6 pand MASK2(%rip), %xmm4 pand %xmm14, %xmm6 pxor %xmm4, %xmm0 pxor %xmm6, %xmm5 movdqa %xmm0, %xmm4 psllq $(1), %xmm0 pclmulqdq $(0), %xmm10, %xmm1 pxor %xmm4, %xmm0 psllq $(5), %xmm0 pxor %xmm4, %xmm0 psllq $(57), %xmm0 pshufd $(78), %xmm0, %xmm6 movdqa %xmm6, %xmm0 pclmulqdq $(17), %xmm10, %xmm12 pand %xmm14, %xmm6 pand MASK2(%rip), %xmm0 pxor %xmm4, %xmm0 pxor %xmm6, %xmm5 movdqa %xmm0, %xmm6 psrlq $(5), %xmm0 pclmulqdq $(0), %xmm9, %xmm13 pxor %xmm6, %xmm0 psrlq $(1), %xmm0 pxor %xmm6, %xmm0 psrlq $(1), %xmm0 pxor %xmm6, %xmm0 pxor %xmm5, %xmm0 pxor %xmm1, %xmm13 pxor %xmm12, %xmm13 pshufd $(78), %xmm13, %xmm11 movdqa %xmm11, %xmm13 pand MASK2(%rip), %xmm11 pand %xmm14, %xmm13 pxor %xmm11, %xmm1 pxor %xmm13, %xmm12 movdqa %xmm1, %xmm11 movdqa %xmm1, %xmm13 movdqa %xmm1, %xmm15 psllq $(63), %xmm11 psllq $(62), %xmm13 psllq $(57), %xmm15 pxor %xmm13, %xmm11 pxor %xmm15, %xmm11 movdqa %xmm11, %xmm13 pslldq $(8), %xmm13 psrldq $(8), %xmm11 pxor %xmm13, %xmm1 pxor %xmm11, %xmm12 movdqa %xmm1, %xmm13 psrlq $(5), %xmm13 pxor %xmm1, %xmm13 psrlq $(1), %xmm13 pxor %xmm1, %xmm13 psrlq $(1), %xmm13 pxor %xmm13, %xmm1 pxor %xmm12, %xmm1 pshufd $(78), %xmm2, %xmm6 movdqa %xmm2, %xmm5 pxor %xmm2, %xmm6 pclmulqdq $(0), %xmm10, %xmm2 pshufd $(78), %xmm3, %xmm13 movdqa %xmm3, %xmm12 pxor %xmm3, %xmm13 pclmulqdq $(17), %xmm10, %xmm5 pclmulqdq $(0), %xmm9, %xmm6 pxor %xmm2, %xmm6 pxor %xmm5, %xmm6 pshufd $(78), %xmm6, %xmm4 movdqa %xmm4, %xmm6 pand MASK2(%rip), %xmm4 pand %xmm14, %xmm6 pxor %xmm4, %xmm2 pxor %xmm6, %xmm5 movdqa %xmm2, %xmm4 psllq $(1), %xmm2 pclmulqdq $(0), %xmm10, %xmm3 pxor %xmm4, %xmm2 psllq $(5), %xmm2 pxor %xmm4, %xmm2 psllq $(57), %xmm2 pshufd $(78), %xmm2, %xmm6 movdqa %xmm6, %xmm2 pclmulqdq $(17), %xmm10, %xmm12 pand %xmm14, %xmm6 pand MASK2(%rip), %xmm2 pxor %xmm4, %xmm2 pxor %xmm6, %xmm5 movdqa %xmm2, %xmm6 psrlq $(5), %xmm2 pclmulqdq $(0), %xmm9, %xmm13 pxor %xmm6, %xmm2 psrlq $(1), %xmm2 pxor %xmm6, %xmm2 psrlq $(1), %xmm2 pxor %xmm6, %xmm2 pxor %xmm5, %xmm2 pxor %xmm3, %xmm13 pxor %xmm12, %xmm13 pshufd $(78), %xmm13, %xmm11 movdqa %xmm11, %xmm13 pand MASK2(%rip), %xmm11 pand %xmm14, %xmm13 pxor %xmm11, %xmm3 pxor %xmm13, %xmm12 movdqa %xmm3, %xmm11 movdqa %xmm3, %xmm13 movdqa %xmm3, %xmm15 psllq $(63), %xmm11 psllq $(62), %xmm13 psllq $(57), %xmm15 pxor %xmm13, %xmm11 pxor %xmm15, %xmm11 movdqa %xmm11, %xmm13 pslldq $(8), %xmm13 psrldq $(8), %xmm11 pxor %xmm13, %xmm3 pxor %xmm11, %xmm12 movdqa %xmm3, %xmm13 psrlq $(5), %xmm13 pxor %xmm3, %xmm13 psrlq $(1), %xmm13 pxor %xmm3, %xmm13 psrlq $(1), %xmm13 pxor %xmm13, %xmm3 pxor %xmm12, %xmm3 movdqa %xmm0, (32)(%rsp) movdqa %xmm1, (48)(%rsp) movdqa %xmm2, (64)(%rsp) movdqa %xmm3, (80)(%rsp) sub $(64), %rdx movdqa (%rsp), %xmm0 cmp $(64), %rdx jge .Lblks4_loopgas_4 .Lcombine_hashgas_4: movdqa (%rbx), %xmm8 movdqa (16)(%rbx), %xmm9 pshufd $(78), %xmm0, %xmm5 pshufd $(78), %xmm10, %xmm6 pxor %xmm0, %xmm5 pxor %xmm10, %xmm6 pclmulqdq $(0), %xmm6, %xmm5 movdqa %xmm0, %xmm4 pclmulqdq $(0), %xmm10, %xmm0 pxor %xmm6, %xmm6 pclmulqdq $(17), %xmm10, %xmm4 pxor %xmm0, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm6 pslldq $(8), %xmm5 pxor %xmm6, %xmm4 pxor %xmm5, %xmm0 movdqa %xmm0, %xmm6 movdqa %xmm0, %xmm5 movdqa %xmm0, %xmm15 psllq $(63), %xmm6 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm6 pxor %xmm15, %xmm6 movdqa %xmm6, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm6 pxor %xmm5, %xmm0 pxor %xmm6, %xmm4 movdqa %xmm0, %xmm5 psrlq $(5), %xmm5 pxor %xmm0, %xmm5 psrlq $(1), %xmm5 pxor %xmm0, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm0 pxor %xmm4, %xmm0 pshufd $(78), %xmm1, %xmm5 pshufd $(78), %xmm9, %xmm6 pxor %xmm1, %xmm5 pxor %xmm9, %xmm6 pclmulqdq $(0), %xmm6, %xmm5 movdqa %xmm1, %xmm4 pclmulqdq $(0), %xmm9, %xmm1 pxor %xmm6, %xmm6 pclmulqdq $(17), %xmm9, %xmm4 pxor %xmm1, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm6 pslldq $(8), %xmm5 pxor %xmm6, %xmm4 pxor %xmm5, %xmm1 movdqa %xmm1, %xmm6 movdqa %xmm1, %xmm5 movdqa %xmm1, %xmm15 psllq $(63), %xmm6 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm6 pxor %xmm15, %xmm6 movdqa %xmm6, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm6 pxor %xmm5, %xmm1 pxor %xmm6, %xmm4 movdqa %xmm1, %xmm5 psrlq $(5), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm1 pxor %xmm4, %xmm1 pshufd $(78), %xmm2, %xmm5 pshufd $(78), %xmm8, %xmm6 pxor %xmm2, %xmm5 pxor %xmm8, %xmm6 pclmulqdq $(0), %xmm6, %xmm5 movdqa %xmm2, %xmm4 pclmulqdq $(0), %xmm8, %xmm2 pxor %xmm6, %xmm6 pclmulqdq $(17), %xmm8, %xmm4 pxor %xmm2, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm6 pslldq $(8), %xmm5 pxor %xmm6, %xmm4 pxor %xmm5, %xmm2 movdqa %xmm2, %xmm6 movdqa %xmm2, %xmm5 movdqa %xmm2, %xmm15 psllq $(63), %xmm6 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm6 pxor %xmm15, %xmm6 movdqa %xmm6, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm6 pxor %xmm5, %xmm2 pxor %xmm6, %xmm4 movdqa %xmm2, %xmm5 psrlq $(5), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm2 pxor %xmm4, %xmm2 pxor %xmm1, %xmm3 pxor %xmm2, %xmm3 pshufd $(78), %xmm3, %xmm5 pshufd $(78), %xmm8, %xmm6 pxor %xmm3, %xmm5 pxor %xmm8, %xmm6 pclmulqdq $(0), %xmm6, %xmm5 movdqa %xmm3, %xmm4 pclmulqdq $(0), %xmm8, %xmm3 pxor %xmm6, %xmm6 pclmulqdq $(17), %xmm8, %xmm4 pxor %xmm3, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm6 pslldq $(8), %xmm5 pxor %xmm6, %xmm4 pxor %xmm5, %xmm3 movdqa %xmm3, %xmm6 movdqa %xmm3, %xmm5 movdqa %xmm3, %xmm15 psllq $(63), %xmm6 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm6 pxor %xmm15, %xmm6 movdqa %xmm6, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm6 pxor %xmm5, %xmm3 pxor %xmm6, %xmm4 movdqa %xmm3, %xmm5 psrlq $(5), %xmm5 pxor %xmm3, %xmm5 psrlq $(1), %xmm5 pxor %xmm3, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm3 pxor %xmm4, %xmm3 pxor %xmm0, %xmm3 movdqa %xmm3, (32)(%rsp) .Lsingle_block_procgas_4: test %rax, %rax jz .Lquitgas_4 .p2align 6, 0x90 .Lblk_loopgas_4: movdqa (%rsp), %xmm0 movdqa %xmm0, %xmm1 paddd INC_1(%rip), %xmm1 movdqa %xmm1, (%rsp) movdqa (%rcx), %xmm0 mov %rcx, %r10 pshufb SHUF_CONST(%rip), %xmm1 pxor %xmm0, %xmm1 movdqa (16)(%r10), %xmm0 add $(16), %r10 mov %r8d, %r11d sub $(1), %r11 .p2align 6, 0x90 .Lcipher_loopgas_4: aesenc %xmm0, %xmm1 movdqa (16)(%r10), %xmm0 add $(16), %r10 dec %r11 jnz .Lcipher_loopgas_4 aesenclast %xmm0, %xmm1 movdqa (16)(%rsp), %xmm0 movdqa %xmm1, (16)(%rsp) movdqu (%rsi), %xmm1 add $(16), %rsi pxor %xmm1, %xmm0 movdqu %xmm0, (%rdi) add $(16), %rdi pshufb SHUF_CONST(%rip), %xmm0 pxor (32)(%rsp), %xmm0 movdqa (%rbx), %xmm1 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 movdqa %xmm0, %xmm4 movdqa %xmm0, %xmm15 psllq $(63), %xmm2 psllq $(62), %xmm4 psllq $(57), %xmm15 pxor %xmm4, %xmm2 pxor %xmm15, %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 movdqa %xmm0, (32)(%rsp) sub $(16), %rax jg .Lblk_loopgas_4 .Lquitgas_4: movdqa (%rsp), %xmm0 movdqa (16)(%rsp), %xmm1 movdqa (32)(%rsp), %xmm2 mov (152)(%rsp), %rax mov (160)(%rsp), %rbx mov (144)(%rsp), %rcx pshufb SHUF_CONST(%rip), %xmm0 movdqu %xmm0, (%rax) movdqu %xmm1, (%rbx) pshufb SHUF_CONST(%rip), %xmm2 movdqu %xmm2, (%rcx) add $(128), %rsp vzeroupper pop %rbx ret .p2align 6, 0x90 .globl _AesGcmDec_avx _AesGcmDec_avx: push %rbx sub $(128), %rsp mov (152)(%rsp), %rax mov (160)(%rsp), %rbx mov (144)(%rsp), %rcx movdqa SHUF_CONST(%rip), %xmm4 movdqu (%rax), %xmm0 movdqu (%rbx), %xmm1 movdqu (%rcx), %xmm2 pshufb %xmm4, %xmm0 movdqa %xmm0, (%rsp) movdqa %xmm1, (16)(%rsp) pshufb %xmm4, %xmm2 pxor %xmm1, %xmm1 movdqa %xmm2, (32)(%rsp) movdqa %xmm1, (48)(%rsp) movdqa %xmm1, (64)(%rsp) movdqa %xmm1, (80)(%rsp) mov (168)(%rsp), %rbx movdqa (32)(%rbx), %xmm10 pshufd $(78), %xmm10, %xmm9 pxor %xmm10, %xmm9 movdqa %xmm9, (96)(%rsp) movslq %edx, %rdx mov %r9, %rcx mov %rdx, %rax and $(63), %rax and $(-64), %rdx jz .Lsingle_block_procgas_5 .p2align 6, 0x90 .Lblks4_loopgas_5: movdqa INC_1(%rip), %xmm6 movdqa SHUF_CONST(%rip), %xmm5 movdqa %xmm0, %xmm1 paddd INC_1(%rip), %xmm1 movdqa %xmm1, %xmm2 paddd INC_1(%rip), %xmm2 movdqa %xmm2, %xmm3 paddd INC_1(%rip), %xmm3 movdqa %xmm3, %xmm4 paddd INC_1(%rip), %xmm4 movdqa %xmm4, (%rsp) movdqa (%rcx), %xmm0 mov %rcx, %r10 pshufb %xmm5, %xmm1 pshufb %xmm5, %xmm2 pshufb %xmm5, %xmm3 pshufb %xmm5, %xmm4 pxor %xmm0, %xmm1 pxor %xmm0, %xmm2 pxor %xmm0, %xmm3 pxor %xmm0, %xmm4 movdqa (16)(%r10), %xmm0 add $(16), %r10 mov %r8d, %r11d sub $(1), %r11 .p2align 6, 0x90 .Lcipher4_loopgas_5: aesenc %xmm0, %xmm1 aesenc %xmm0, %xmm2 aesenc %xmm0, %xmm3 aesenc %xmm0, %xmm4 movdqa (16)(%r10), %xmm0 add $(16), %r10 dec %r11 jnz .Lcipher4_loopgas_5 aesenclast %xmm0, %xmm1 aesenclast %xmm0, %xmm2 aesenclast %xmm0, %xmm3 aesenclast %xmm0, %xmm4 movdqa (16)(%rsp), %xmm0 movdqa %xmm4, (16)(%rsp) movdqu (%rsi), %xmm4 movdqu (16)(%rsi), %xmm5 movdqu (32)(%rsi), %xmm6 movdqu (48)(%rsi), %xmm7 add $(64), %rsi pxor %xmm4, %xmm0 movdqu %xmm0, (%rdi) pshufb SHUF_CONST(%rip), %xmm4 pxor (32)(%rsp), %xmm4 pxor %xmm5, %xmm1 movdqu %xmm1, (16)(%rdi) pshufb SHUF_CONST(%rip), %xmm5 pxor (48)(%rsp), %xmm5 pxor %xmm6, %xmm2 movdqu %xmm2, (32)(%rdi) pshufb SHUF_CONST(%rip), %xmm6 pxor (64)(%rsp), %xmm6 pxor %xmm7, %xmm3 movdqu %xmm3, (48)(%rdi) pshufb SHUF_CONST(%rip), %xmm7 pxor (80)(%rsp), %xmm7 add $(64), %rdi cmp $(64), %rdx je .Lcombine_hashgas_5 movdqa MASK1(%rip), %xmm14 pshufd $(78), %xmm4, %xmm2 movdqa %xmm4, %xmm1 pxor %xmm4, %xmm2 pclmulqdq $(0), %xmm10, %xmm4 pshufd $(78), %xmm5, %xmm13 movdqa %xmm5, %xmm12 pxor %xmm5, %xmm13 pclmulqdq $(17), %xmm10, %xmm1 pclmulqdq $(0), %xmm9, %xmm2 pxor %xmm4, %xmm2 pxor %xmm1, %xmm2 pshufd $(78), %xmm2, %xmm0 movdqa %xmm0, %xmm2 pand MASK2(%rip), %xmm0 pand %xmm14, %xmm2 pxor %xmm0, %xmm4 pxor %xmm2, %xmm1 movdqa %xmm4, %xmm0 psllq $(1), %xmm4 pclmulqdq $(0), %xmm10, %xmm5 pxor %xmm0, %xmm4 psllq $(5), %xmm4 pxor %xmm0, %xmm4 psllq $(57), %xmm4 pshufd $(78), %xmm4, %xmm2 movdqa %xmm2, %xmm4 pclmulqdq $(17), %xmm10, %xmm12 pand %xmm14, %xmm2 pand MASK2(%rip), %xmm4 pxor %xmm0, %xmm4 pxor %xmm2, %xmm1 movdqa %xmm4, %xmm2 psrlq $(5), %xmm4 pclmulqdq $(0), %xmm9, %xmm13 pxor %xmm2, %xmm4 psrlq $(1), %xmm4 pxor %xmm2, %xmm4 psrlq $(1), %xmm4 pxor %xmm2, %xmm4 pxor %xmm1, %xmm4 pxor %xmm5, %xmm13 pxor %xmm12, %xmm13 pshufd $(78), %xmm13, %xmm11 movdqa %xmm11, %xmm13 pand MASK2(%rip), %xmm11 pand %xmm14, %xmm13 pxor %xmm11, %xmm5 pxor %xmm13, %xmm12 movdqa %xmm5, %xmm11 movdqa %xmm5, %xmm13 movdqa %xmm5, %xmm15 psllq $(63), %xmm11 psllq $(62), %xmm13 psllq $(57), %xmm15 pxor %xmm13, %xmm11 pxor %xmm15, %xmm11 movdqa %xmm11, %xmm13 pslldq $(8), %xmm13 psrldq $(8), %xmm11 pxor %xmm13, %xmm5 pxor %xmm11, %xmm12 movdqa %xmm5, %xmm13 psrlq $(5), %xmm13 pxor %xmm5, %xmm13 psrlq $(1), %xmm13 pxor %xmm5, %xmm13 psrlq $(1), %xmm13 pxor %xmm13, %xmm5 pxor %xmm12, %xmm5 pshufd $(78), %xmm6, %xmm2 movdqa %xmm6, %xmm1 pxor %xmm6, %xmm2 pclmulqdq $(0), %xmm10, %xmm6 pshufd $(78), %xmm7, %xmm13 movdqa %xmm7, %xmm12 pxor %xmm7, %xmm13 pclmulqdq $(17), %xmm10, %xmm1 pclmulqdq $(0), %xmm9, %xmm2 pxor %xmm6, %xmm2 pxor %xmm1, %xmm2 pshufd $(78), %xmm2, %xmm0 movdqa %xmm0, %xmm2 pand MASK2(%rip), %xmm0 pand %xmm14, %xmm2 pxor %xmm0, %xmm6 pxor %xmm2, %xmm1 movdqa %xmm6, %xmm0 psllq $(1), %xmm6 pclmulqdq $(0), %xmm10, %xmm7 pxor %xmm0, %xmm6 psllq $(5), %xmm6 pxor %xmm0, %xmm6 psllq $(57), %xmm6 pshufd $(78), %xmm6, %xmm2 movdqa %xmm2, %xmm6 pclmulqdq $(17), %xmm10, %xmm12 pand %xmm14, %xmm2 pand MASK2(%rip), %xmm6 pxor %xmm0, %xmm6 pxor %xmm2, %xmm1 movdqa %xmm6, %xmm2 psrlq $(5), %xmm6 pclmulqdq $(0), %xmm9, %xmm13 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm2, %xmm6 pxor %xmm1, %xmm6 pxor %xmm7, %xmm13 pxor %xmm12, %xmm13 pshufd $(78), %xmm13, %xmm11 movdqa %xmm11, %xmm13 pand MASK2(%rip), %xmm11 pand %xmm14, %xmm13 pxor %xmm11, %xmm7 pxor %xmm13, %xmm12 movdqa %xmm7, %xmm11 movdqa %xmm7, %xmm13 movdqa %xmm7, %xmm15 psllq $(63), %xmm11 psllq $(62), %xmm13 psllq $(57), %xmm15 pxor %xmm13, %xmm11 pxor %xmm15, %xmm11 movdqa %xmm11, %xmm13 pslldq $(8), %xmm13 psrldq $(8), %xmm11 pxor %xmm13, %xmm7 pxor %xmm11, %xmm12 movdqa %xmm7, %xmm13 psrlq $(5), %xmm13 pxor %xmm7, %xmm13 psrlq $(1), %xmm13 pxor %xmm7, %xmm13 psrlq $(1), %xmm13 pxor %xmm13, %xmm7 pxor %xmm12, %xmm7 movdqa %xmm4, (32)(%rsp) movdqa %xmm5, (48)(%rsp) movdqa %xmm6, (64)(%rsp) movdqa %xmm7, (80)(%rsp) sub $(64), %rdx movdqa (%rsp), %xmm0 cmp $(64), %rdx jge .Lblks4_loopgas_5 .Lcombine_hashgas_5: movdqa (%rbx), %xmm8 movdqa (16)(%rbx), %xmm9 pshufd $(78), %xmm4, %xmm2 pshufd $(78), %xmm10, %xmm0 pxor %xmm4, %xmm2 pxor %xmm10, %xmm0 pclmulqdq $(0), %xmm0, %xmm2 movdqa %xmm4, %xmm1 pclmulqdq $(0), %xmm10, %xmm4 pxor %xmm0, %xmm0 pclmulqdq $(17), %xmm10, %xmm1 pxor %xmm4, %xmm2 pxor %xmm1, %xmm2 palignr $(8), %xmm2, %xmm0 pslldq $(8), %xmm2 pxor %xmm0, %xmm1 pxor %xmm2, %xmm4 movdqa %xmm4, %xmm0 movdqa %xmm4, %xmm2 movdqa %xmm4, %xmm15 psllq $(63), %xmm0 psllq $(62), %xmm2 psllq $(57), %xmm15 pxor %xmm2, %xmm0 pxor %xmm15, %xmm0 movdqa %xmm0, %xmm2 pslldq $(8), %xmm2 psrldq $(8), %xmm0 pxor %xmm2, %xmm4 pxor %xmm0, %xmm1 movdqa %xmm4, %xmm2 psrlq $(5), %xmm2 pxor %xmm4, %xmm2 psrlq $(1), %xmm2 pxor %xmm4, %xmm2 psrlq $(1), %xmm2 pxor %xmm2, %xmm4 pxor %xmm1, %xmm4 pshufd $(78), %xmm5, %xmm2 pshufd $(78), %xmm9, %xmm0 pxor %xmm5, %xmm2 pxor %xmm9, %xmm0 pclmulqdq $(0), %xmm0, %xmm2 movdqa %xmm5, %xmm1 pclmulqdq $(0), %xmm9, %xmm5 pxor %xmm0, %xmm0 pclmulqdq $(17), %xmm9, %xmm1 pxor %xmm5, %xmm2 pxor %xmm1, %xmm2 palignr $(8), %xmm2, %xmm0 pslldq $(8), %xmm2 pxor %xmm0, %xmm1 pxor %xmm2, %xmm5 movdqa %xmm5, %xmm0 movdqa %xmm5, %xmm2 movdqa %xmm5, %xmm15 psllq $(63), %xmm0 psllq $(62), %xmm2 psllq $(57), %xmm15 pxor %xmm2, %xmm0 pxor %xmm15, %xmm0 movdqa %xmm0, %xmm2 pslldq $(8), %xmm2 psrldq $(8), %xmm0 pxor %xmm2, %xmm5 pxor %xmm0, %xmm1 movdqa %xmm5, %xmm2 psrlq $(5), %xmm2 pxor %xmm5, %xmm2 psrlq $(1), %xmm2 pxor %xmm5, %xmm2 psrlq $(1), %xmm2 pxor %xmm2, %xmm5 pxor %xmm1, %xmm5 pshufd $(78), %xmm6, %xmm2 pshufd $(78), %xmm8, %xmm0 pxor %xmm6, %xmm2 pxor %xmm8, %xmm0 pclmulqdq $(0), %xmm0, %xmm2 movdqa %xmm6, %xmm1 pclmulqdq $(0), %xmm8, %xmm6 pxor %xmm0, %xmm0 pclmulqdq $(17), %xmm8, %xmm1 pxor %xmm6, %xmm2 pxor %xmm1, %xmm2 palignr $(8), %xmm2, %xmm0 pslldq $(8), %xmm2 pxor %xmm0, %xmm1 pxor %xmm2, %xmm6 movdqa %xmm6, %xmm0 movdqa %xmm6, %xmm2 movdqa %xmm6, %xmm15 psllq $(63), %xmm0 psllq $(62), %xmm2 psllq $(57), %xmm15 pxor %xmm2, %xmm0 pxor %xmm15, %xmm0 movdqa %xmm0, %xmm2 pslldq $(8), %xmm2 psrldq $(8), %xmm0 pxor %xmm2, %xmm6 pxor %xmm0, %xmm1 movdqa %xmm6, %xmm2 psrlq $(5), %xmm2 pxor %xmm6, %xmm2 psrlq $(1), %xmm2 pxor %xmm6, %xmm2 psrlq $(1), %xmm2 pxor %xmm2, %xmm6 pxor %xmm1, %xmm6 pxor %xmm5, %xmm7 pxor %xmm6, %xmm7 pshufd $(78), %xmm7, %xmm2 pshufd $(78), %xmm8, %xmm0 pxor %xmm7, %xmm2 pxor %xmm8, %xmm0 pclmulqdq $(0), %xmm0, %xmm2 movdqa %xmm7, %xmm1 pclmulqdq $(0), %xmm8, %xmm7 pxor %xmm0, %xmm0 pclmulqdq $(17), %xmm8, %xmm1 pxor %xmm7, %xmm2 pxor %xmm1, %xmm2 palignr $(8), %xmm2, %xmm0 pslldq $(8), %xmm2 pxor %xmm0, %xmm1 pxor %xmm2, %xmm7 movdqa %xmm7, %xmm0 movdqa %xmm7, %xmm2 movdqa %xmm7, %xmm15 psllq $(63), %xmm0 psllq $(62), %xmm2 psllq $(57), %xmm15 pxor %xmm2, %xmm0 pxor %xmm15, %xmm0 movdqa %xmm0, %xmm2 pslldq $(8), %xmm2 psrldq $(8), %xmm0 pxor %xmm2, %xmm7 pxor %xmm0, %xmm1 movdqa %xmm7, %xmm2 psrlq $(5), %xmm2 pxor %xmm7, %xmm2 psrlq $(1), %xmm2 pxor %xmm7, %xmm2 psrlq $(1), %xmm2 pxor %xmm2, %xmm7 pxor %xmm1, %xmm7 pxor %xmm4, %xmm7 movdqa %xmm7, (32)(%rsp) .Lsingle_block_procgas_5: test %rax, %rax jz .Lquitgas_5 .p2align 6, 0x90 .Lblk_loopgas_5: movdqa (%rsp), %xmm0 movdqa %xmm0, %xmm1 paddd INC_1(%rip), %xmm1 movdqa %xmm1, (%rsp) movdqa (%rcx), %xmm0 mov %rcx, %r10 pshufb SHUF_CONST(%rip), %xmm1 pxor %xmm0, %xmm1 movdqa (16)(%r10), %xmm0 add $(16), %r10 mov %r8d, %r11d sub $(1), %r11 .p2align 6, 0x90 .Lcipher_loopgas_5: aesenc %xmm0, %xmm1 movdqa (16)(%r10), %xmm0 add $(16), %r10 dec %r11 jnz .Lcipher_loopgas_5 aesenclast %xmm0, %xmm1 movdqa (16)(%rsp), %xmm0 movdqa %xmm1, (16)(%rsp) movdqu (%rsi), %xmm1 add $(16), %rsi pxor %xmm1, %xmm0 movdqu %xmm0, (%rdi) add $(16), %rdi pshufb SHUF_CONST(%rip), %xmm1 pxor (32)(%rsp), %xmm1 movdqa (%rbx), %xmm0 pshufd $(78), %xmm1, %xmm4 pshufd $(78), %xmm0, %xmm2 pxor %xmm1, %xmm4 pxor %xmm0, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm1, %xmm3 pclmulqdq $(0), %xmm0, %xmm1 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm0, %xmm3 pxor %xmm1, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm1 movdqa %xmm1, %xmm2 movdqa %xmm1, %xmm4 movdqa %xmm1, %xmm15 psllq $(63), %xmm2 psllq $(62), %xmm4 psllq $(57), %xmm15 pxor %xmm4, %xmm2 pxor %xmm15, %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm1 pxor %xmm2, %xmm3 movdqa %xmm1, %xmm4 psrlq $(5), %xmm4 pxor %xmm1, %xmm4 psrlq $(1), %xmm4 pxor %xmm1, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm1 pxor %xmm3, %xmm1 movdqa %xmm1, (32)(%rsp) sub $(16), %rax jg .Lblk_loopgas_5 .Lquitgas_5: movdqa (%rsp), %xmm0 movdqa (16)(%rsp), %xmm1 movdqa (32)(%rsp), %xmm2 mov (152)(%rsp), %rax mov (160)(%rsp), %rbx mov (144)(%rsp), %rcx pshufb SHUF_CONST(%rip), %xmm0 movdqu %xmm0, (%rax) movdqu %xmm1, (%rbx) pshufb SHUF_CONST(%rip), %xmm2 movdqu %xmm2, (%rcx) add $(128), %rsp vzeroupper pop %rbx ret ",16233,True,4889.209899046591,median "/* * 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. * * This file is an adaptation of Presto's presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4 grammar. */ grammar SqlBase; @members { /** * When false, INTERSECT is given the greater precedence over the other set * operations (UNION, EXCEPT and MINUS) as per the SQL standard. */ public boolean legacy_setops_precedence_enbled = false; /** * When false, a literal with an exponent would be converted into * double type rather than decimal type. */ public boolean legacy_exponent_literal_as_decimal_enabled = false; /** * When false, CREATE TABLE syntax without a provider will use * the value of spark.sql.sources.default as its provider. */ public boolean legacy_create_hive_table_by_default_enabled = false; /** * Verify whether current token is a valid decimal token (which contains dot). * Returns true if the character that follows the token is not a digit or letter or underscore. * * For example: * For char stream ""2.3"", ""2."" is not a valid decimal token, because it is followed by digit '3'. * For char stream ""2.3_"", ""2.3"" is not a valid decimal token, because it is followed by '_'. * For char stream ""2.3W"", ""2.3"" is not a valid decimal token, because it is followed by 'W'. * For char stream ""12.0D 34.E2+0.12 "" 12.0D is a valid decimal token because it is followed * by a space. 34.E2 is a valid decimal token because it is followed by symbol '+' * which is not a digit or letter or underscore. */ public boolean isValidDecimal() { int nextChar = _input.LA(1); if (nextChar >= 'A' && nextChar <= 'Z' || nextChar >= '0' && nextChar <= '9' || nextChar == '_') { return false; } else { return true; } } /** * When true, the behavior of keywords follows ANSI SQL standard. */ public boolean SQL_standard_keyword_behavior = false; } singleStatement : statement EOF ; singleExpression : namedExpression EOF ; singleTableIdentifier : tableIdentifier EOF ; singleMultipartIdentifier : multipartIdentifier EOF ; singleFunctionIdentifier : functionIdentifier EOF ; singleDataType : dataType EOF ; singleTableSchema : colTypeList EOF ; statement : query #statementDefault | ctes? dmlStatementNoWith #dmlStatement | USE NAMESPACE? multipartIdentifier #use | CREATE namespace (IF NOT EXISTS)? multipartIdentifier (commentSpec | locationSpec | (WITH (DBPROPERTIES | PROPERTIES) tablePropertyList))* #createNamespace | ALTER namespace multipartIdentifier SET (DBPROPERTIES | PROPERTIES) tablePropertyList #setNamespaceProperties | ALTER namespace multipartIdentifier SET locationSpec #setNamespaceLocation | DROP namespace (IF EXISTS)? multipartIdentifier (RESTRICT | CASCADE)? #dropNamespace | SHOW (DATABASES | NAMESPACES) ((FROM | IN) multipartIdentifier)? (LIKE? pattern=STRING)? #showNamespaces | {!legacy_create_hive_table_by_default_enabled}? createTableHeader ('(' colTypeList ')')? tableProvider? createTableClauses (AS? query)? #createTable | {legacy_create_hive_table_by_default_enabled}? createTableHeader ('(' colTypeList ')')? tableProvider createTableClauses (AS? query)? #createTable | createTableHeader ('(' columns=colTypeList ')')? (commentSpec | (PARTITIONED BY '(' partitionColumns=colTypeList ')' | PARTITIONED BY partitionColumnNames=identifierList) | bucketSpec | skewSpec | rowFormat | createFileFormat | locationSpec | (TBLPROPERTIES tableProps=tablePropertyList))* (AS? query)? #createHiveTable | CREATE TABLE (IF NOT EXISTS)? target=tableIdentifier LIKE source=tableIdentifier (tableProvider | rowFormat | createFileFormat | locationSpec | (TBLPROPERTIES tableProps=tablePropertyList))* #createTableLike | replaceTableHeader ('(' colTypeList ')')? tableProvider createTableClauses (AS? query)? #replaceTable | ANALYZE TABLE multipartIdentifier partitionSpec? COMPUTE STATISTICS (identifier | FOR COLUMNS identifierSeq | FOR ALL COLUMNS)? #analyze | ALTER TABLE multipartIdentifier ADD (COLUMN | COLUMNS) columns=qualifiedColTypeWithPositionList #addTableColumns | ALTER TABLE multipartIdentifier ADD (COLUMN | COLUMNS) '(' columns=qualifiedColTypeWithPositionList ')' #addTableColumns | ALTER TABLE table=multipartIdentifier RENAME COLUMN from=multipartIdentifier TO to=errorCapturingIdentifier #renameTableColumn | ALTER TABLE multipartIdentifier DROP (COLUMN | COLUMNS) '(' columns=multipartIdentifierList ')' #dropTableColumns | ALTER TABLE multipartIdentifier DROP (COLUMN | COLUMNS) columns=multipartIdentifierList #dropTableColumns | ALTER (TABLE | VIEW) from=multipartIdentifier RENAME TO to=multipartIdentifier #renameTable | ALTER (TABLE | VIEW) multipartIdentifier SET TBLPROPERTIES tablePropertyList #setTableProperties | ALTER (TABLE | VIEW) multipartIdentifier UNSET TBLPROPERTIES (IF EXISTS)? tablePropertyList #unsetTableProperties | ALTER TABLE table=multipartIdentifier (ALTER | CHANGE) COLUMN? column=multipartIdentifier (TYPE dataType)? commentSpec? colPosition? #alterTableColumn | ALTER TABLE table=multipartIdentifier ALTER COLUMN? column=multipartIdentifier setOrDrop=(SET | DROP) NOT NULL #alterColumnNullability | ALTER TABLE table=multipartIdentifier partitionSpec? CHANGE COLUMN? colName=multipartIdentifier colType colPosition? #hiveChangeColumn | ALTER TABLE multipartIdentifier (partitionSpec)? SET SERDE STRING (WITH SERDEPROPERTIES tablePropertyList)? #setTableSerDe | ALTER TABLE multipartIdentifier (partitionSpec)? SET SERDEPROPERTIES tablePropertyList #setTableSerDe | ALTER (TABLE | VIEW) multipartIdentifier ADD (IF NOT EXISTS)? partitionSpecLocation+ #addTablePartition | ALTER TABLE multipartIdentifier from=partitionSpec RENAME TO to=partitionSpec #renameTablePartition | ALTER (TABLE | VIEW) multipartIdentifier DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* PURGE? #dropTablePartitions | ALTER TABLE multipartIdentifier (partitionSpec)? SET locationSpec #setTableLocation | ALTER TABLE multipartIdentifier RECOVER PARTITIONS #recoverPartitions | DROP TABLE (IF EXISTS)? multipartIdentifier PURGE? #dropTable | DROP VIEW (IF EXISTS)? multipartIdentifier #dropView | CREATE (OR REPLACE)? (GLOBAL? TEMPORARY)? VIEW (IF NOT EXISTS)? multipartIdentifier identifierCommentList? (commentSpec | (PARTITIONED ON identifierList) | (TBLPROPERTIES tablePropertyList))* AS query #createView | CREATE (OR REPLACE)? GLOBAL? TEMPORARY VIEW tableIdentifier ('(' colTypeList ')')? tableProvider (OPTIONS tablePropertyList)? #createTempViewUsing | ALTER VIEW multipartIdentifier AS? query #alterViewQuery | CREATE (OR REPLACE)? TEMPORARY? FUNCTION (IF NOT EXISTS)? multipartIdentifier AS className=STRING (USING resource (',' resource)*)? #createFunction | DROP TEMPORARY? FUNCTION (IF EXISTS)? multipartIdentifier #dropFunction | EXPLAIN (LOGICAL | FORMATTED | EXTENDED | CODEGEN | COST)? statement #explain | SHOW TABLES ((FROM | IN) multipartIdentifier)? (LIKE? pattern=STRING)? #showTables | SHOW TABLE EXTENDED ((FROM | IN) ns=multipartIdentifier)? LIKE pattern=STRING partitionSpec? #showTable | SHOW TBLPROPERTIES table=multipartIdentifier ('(' key=tablePropertyKey ')')? #showTblProperties | SHOW COLUMNS (FROM | IN) table=multipartIdentifier ((FROM | IN) ns=multipartIdentifier)? #showColumns | SHOW PARTITIONS multipartIdentifier partitionSpec? #showPartitions | SHOW identifier? FUNCTIONS (LIKE? (multipartIdentifier | pattern=STRING))? #showFunctions | SHOW CREATE TABLE multipartIdentifier (AS SERDE)? #showCreateTable | SHOW CURRENT NAMESPACE #showCurrentNamespace | (DESC | DESCRIBE) FUNCTION EXTENDED? describeFuncName #describeFunction | (DESC | DESCRIBE) namespace EXTENDED? multipartIdentifier #describeNamespace | (DESC | DESCRIBE) TABLE? option=(EXTENDED | FORMATTED)? multipartIdentifier partitionSpec? describeColName? #describeRelation | (DESC | DESCRIBE) QUERY? query #describeQuery | COMMENT ON namespace multipartIdentifier IS comment=(STRING | NULL) #commentNamespace | COMMENT ON TABLE multipartIdentifier IS comment=(STRING | NULL) #commentTable | REFRESH TABLE multipartIdentifier #refreshTable | REFRESH (STRING | .*?) #refreshResource | CACHE LAZY? TABLE multipartIdentifier (OPTIONS options=tablePropertyList)? (AS? query)? #cacheTable | UNCACHE TABLE (IF EXISTS)? multipartIdentifier #uncacheTable | CLEAR CACHE #clearCache | LOAD DATA LOCAL? INPATH path=STRING OVERWRITE? INTO TABLE multipartIdentifier partitionSpec? #loadData | TRUNCATE TABLE multipartIdentifier partitionSpec? #truncateTable | MSCK REPAIR TABLE multipartIdentifier #repairTable | op=(ADD | LIST) identifier (STRING | .*?) #manageResource | SET ROLE .*? #failNativeCommand | SET .*? #setConfiguration | RESET #resetConfiguration | unsupportedHiveNativeCommands .*? #failNativeCommand ; unsupportedHiveNativeCommands : kw1=CREATE kw2=ROLE | kw1=DROP kw2=ROLE | kw1=GRANT kw2=ROLE? | kw1=REVOKE kw2=ROLE? | kw1=SHOW kw2=GRANT | kw1=SHOW kw2=ROLE kw3=GRANT? | kw1=SHOW kw2=PRINCIPALS | kw1=SHOW kw2=ROLES | kw1=SHOW kw2=CURRENT kw3=ROLES | kw1=EXPORT kw2=TABLE | kw1=IMPORT kw2=TABLE | kw1=SHOW kw2=COMPACTIONS | kw1=SHOW kw2=CREATE kw3=TABLE | kw1=SHOW kw2=TRANSACTIONS | kw1=SHOW kw2=INDEXES | kw1=SHOW kw2=LOCKS | kw1=CREATE kw2=INDEX | kw1=DROP kw2=INDEX | kw1=ALTER kw2=INDEX | kw1=LOCK kw2=TABLE | kw1=LOCK kw2=DATABASE | kw1=UNLOCK kw2=TABLE | kw1=UNLOCK kw2=DATABASE | kw1=CREATE kw2=TEMPORARY kw3=MACRO | kw1=DROP kw2=TEMPORARY kw3=MACRO | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=CLUSTERED | kw1=ALTER kw2=TABLE tableIdentifier kw3=CLUSTERED kw4=BY | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SORTED | kw1=ALTER kw2=TABLE tableIdentifier kw3=SKEWED kw4=BY | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SKEWED | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=STORED kw5=AS kw6=DIRECTORIES | kw1=ALTER kw2=TABLE tableIdentifier kw3=SET kw4=SKEWED kw5=LOCATION | kw1=ALTER kw2=TABLE tableIdentifier kw3=EXCHANGE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=ARCHIVE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=UNARCHIVE kw4=PARTITION | kw1=ALTER kw2=TABLE tableIdentifier kw3=TOUCH | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=COMPACT | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=CONCATENATE | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=SET kw4=FILEFORMAT | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=REPLACE kw4=COLUMNS | kw1=START kw2=TRANSACTION | kw1=COMMIT | kw1=ROLLBACK | kw1=DFS ; createTableHeader : CREATE TEMPORARY? EXTERNAL? TABLE (IF NOT EXISTS)? multipartIdentifier ; replaceTableHeader : (CREATE OR)? REPLACE TABLE multipartIdentifier ; bucketSpec : CLUSTERED BY identifierList (SORTED BY orderedIdentifierList)? INTO INTEGER_VALUE BUCKETS ; skewSpec : SKEWED BY identifierList ON (constantList | nestedConstantList) (STORED AS DIRECTORIES)? ; locationSpec : LOCATION STRING ; commentSpec : COMMENT STRING ; query : ctes? queryTerm queryOrganization ; insertInto : INSERT OVERWRITE TABLE? multipartIdentifier (partitionSpec (IF NOT EXISTS)?)? #insertOverwriteTable | INSERT INTO TABLE? multipartIdentifier partitionSpec? (IF NOT EXISTS)? #insertIntoTable | INSERT OVERWRITE LOCAL? DIRECTORY path=STRING rowFormat? createFileFormat? #insertOverwriteHiveDir | INSERT OVERWRITE LOCAL? DIRECTORY (path=STRING)? tableProvider (OPTIONS options=tablePropertyList)? #insertOverwriteDir ; partitionSpecLocation : partitionSpec locationSpec? ; partitionSpec : PARTITION '(' partitionVal (',' partitionVal)* ')' ; partitionVal : identifier (EQ constant)? ; namespace : NAMESPACE | DATABASE | SCHEMA ; describeFuncName : qualifiedName | STRING | comparisonOperator | arithmeticOperator | predicateOperator ; describeColName : nameParts+=identifier ('.' nameParts+=identifier)* ; ctes : WITH namedQuery (',' namedQuery)* ; namedQuery : name=errorCapturingIdentifier (columnAliases=identifierList)? AS? '(' query ')' ; tableProvider : USING multipartIdentifier ; createTableClauses :((OPTIONS options=tablePropertyList) | (PARTITIONED BY partitioning=transformList) | bucketSpec | locationSpec | commentSpec | (TBLPROPERTIES tableProps=tablePropertyList))* ; tablePropertyList : '(' tableProperty (',' tableProperty)* ')' ; tableProperty : key=tablePropertyKey (EQ? value=tablePropertyValue)? ; tablePropertyKey : identifier ('.' identifier)* | STRING ; tablePropertyValue : INTEGER_VALUE | DECIMAL_VALUE | booleanValue | STRING ; constantList : '(' constant (',' constant)* ')' ; nestedConstantList : '(' constantList (',' constantList)* ')' ; createFileFormat : STORED AS fileFormat | STORED BY storageHandler ; fileFormat : INPUTFORMAT inFmt=STRING OUTPUTFORMAT outFmt=STRING #tableFileFormat | identifier #genericFileFormat ; storageHandler : STRING (WITH SERDEPROPERTIES tablePropertyList)? ; resource : identifier STRING ; dmlStatementNoWith : insertInto queryTerm queryOrganization #singleInsertQuery | fromClause multiInsertQueryBody+ #multiInsertQuery | DELETE FROM multipartIdentifier tableAlias whereClause? #deleteFromTable | UPDATE multipartIdentifier tableAlias setClause whereClause? #updateTable | MERGE INTO target=multipartIdentifier targetAlias=tableAlias USING (source=multipartIdentifier | '(' sourceQuery=query')') sourceAlias=tableAlias ON mergeCondition=booleanExpression matchedClause* notMatchedClause* #mergeIntoTable ; queryOrganization : (ORDER BY order+=sortItem (',' order+=sortItem)*)? (CLUSTER BY clusterBy+=expression (',' clusterBy+=expression)*)? (DISTRIBUTE BY distributeBy+=expression (',' distributeBy+=expression)*)? (SORT BY sort+=sortItem (',' sort+=sortItem)*)? windowClause? (LIMIT (ALL | limit=expression))? ; multiInsertQueryBody : insertInto fromStatementBody ; queryTerm : queryPrimary #queryTermDefault | left=queryTerm {legacy_setops_precedence_enbled}? operator=(INTERSECT | UNION | EXCEPT | SETMINUS) setQuantifier? right=queryTerm #setOperation | left=queryTerm {!legacy_setops_precedence_enbled}? operator=INTERSECT setQuantifier? right=queryTerm #setOperation | left=queryTerm {!legacy_setops_precedence_enbled}? operator=(UNION | EXCEPT | SETMINUS) setQuantifier? right=queryTerm #setOperation ; queryPrimary : querySpecification #queryPrimaryDefault | fromStatement #fromStmt | TABLE multipartIdentifier #table | inlineTable #inlineTableDefault1 | '(' query ')' #subquery ; sortItem : expression ordering=(ASC | DESC)? (NULLS nullOrder=(LAST | FIRST))? ; fromStatement : fromClause fromStatementBody+ ; fromStatementBody : transformClause whereClause? queryOrganization | selectClause lateralView* whereClause? aggregationClause? havingClause? windowClause? queryOrganization ; querySpecification : transformClause fromClause? whereClause? #transformQuerySpecification | selectClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause? #regularQuerySpecification ; transformClause : (SELECT kind=TRANSFORM '(' namedExpressionSeq ')' | kind=MAP namedExpressionSeq | kind=REDUCE namedExpressionSeq) inRowFormat=rowFormat? (RECORDWRITER recordWriter=STRING)? USING script=STRING (AS (identifierSeq | colTypeList | ('(' (identifierSeq | colTypeList) ')')))? outRowFormat=rowFormat? (RECORDREADER recordReader=STRING)? ; selectClause : SELECT (hints+=hint)* setQuantifier? namedExpressionSeq ; setClause : SET assignmentList ; matchedClause : WHEN MATCHED (AND matchedCond=booleanExpression)? THEN matchedAction ; notMatchedClause : WHEN NOT MATCHED (AND notMatchedCond=booleanExpression)? THEN notMatchedAction ; matchedAction : DELETE | UPDATE SET ASTERISK | UPDATE SET assignmentList ; notMatchedAction : INSERT ASTERISK | INSERT '(' columns=multipartIdentifierList ')' VALUES '(' expression (',' expression)* ')' ; assignmentList : assignment (',' assignment)* ; assignment : key=multipartIdentifier EQ value=expression ; whereClause : WHERE booleanExpression ; havingClause : HAVING booleanExpression ; hint : '/*+' hintStatements+=hintStatement (','? hintStatements+=hintStatement)* '*/' ; hintStatement : hintName=identifier | hintName=identifier '(' parameters+=primaryExpression (',' parameters+=primaryExpression)* ')' ; fromClause : FROM relation (',' relation)* lateralView* pivotClause? ; aggregationClause : GROUP BY groupingExpressions+=expression (',' groupingExpressions+=expression)* ( WITH kind=ROLLUP | WITH kind=CUBE | kind=GROUPING SETS '(' groupingSet (',' groupingSet)* ')')? | GROUP BY kind=GROUPING SETS '(' groupingSet (',' groupingSet)* ')' ; groupingSet : '(' (expression (',' expression)*)? ')' | expression ; pivotClause : PIVOT '(' aggregates=namedExpressionSeq FOR pivotColumn IN '(' pivotValues+=pivotValue (',' pivotValues+=pivotValue)* ')' ')' ; pivotColumn : identifiers+=identifier | '(' identifiers+=identifier (',' identifiers+=identifier)* ')' ; pivotValue : expression (AS? identifier)? ; lateralView : LATERAL VIEW (OUTER)? qualifiedName '(' (expression (',' expression)*)? ')' tblName=identifier (AS? colName+=identifier (',' colName+=identifier)*)? ; setQuantifier : DISTINCT | ALL ; relation : relationPrimary joinRelation* ; joinRelation : (joinType) JOIN right=relationPrimary joinCriteria? | NATURAL joinType JOIN right=relationPrimary ; joinType : INNER? | CROSS | LEFT OUTER? | LEFT? SEMI | RIGHT OUTER? | FULL OUTER? | LEFT? ANTI ; joinCriteria : ON booleanExpression | USING identifierList ; sample : TABLESAMPLE '(' sampleMethod? ')' ; sampleMethod : negativeSign=MINUS? percentage=(INTEGER_VALUE | DECIMAL_VALUE) PERCENTLIT #sampleByPercentile | expression ROWS #sampleByRows | sampleType=BUCKET numerator=INTEGER_VALUE OUT OF denominator=INTEGER_VALUE (ON (identifier | qualifiedName '(' ')'))? #sampleByBucket | bytes=expression #sampleByBytes ; identifierList : '(' identifierSeq ')' ; identifierSeq : ident+=errorCapturingIdentifier (',' ident+=errorCapturingIdentifier)* ; orderedIdentifierList : '(' orderedIdentifier (',' orderedIdentifier)* ')' ; orderedIdentifier : ident=errorCapturingIdentifier ordering=(ASC | DESC)? ; identifierCommentList : '(' identifierComment (',' identifierComment)* ')' ; identifierComment : identifier commentSpec? ; relationPrimary : multipartIdentifier sample? tableAlias #tableName | '(' query ')' sample? tableAlias #aliasedQuery | '(' relation ')' sample? tableAlias #aliasedRelation | inlineTable #inlineTableDefault2 | functionTable #tableValuedFunction ; inlineTable : VALUES expression (',' expression)* tableAlias ; functionTable : funcName=errorCapturingIdentifier '(' (expression (',' expression)*)? ')' tableAlias ; tableAlias : (AS? strictIdentifier identifierList?)? ; rowFormat : ROW FORMAT SERDE name=STRING (WITH SERDEPROPERTIES props=tablePropertyList)? #rowFormatSerde | ROW FORMAT DELIMITED (FIELDS TERMINATED BY fieldsTerminatedBy=STRING (ESCAPED BY escapedBy=STRING)?)? (COLLECTION ITEMS TERMINATED BY collectionItemsTerminatedBy=STRING)? (MAP KEYS TERMINATED BY keysTerminatedBy=STRING)? (LINES TERMINATED BY linesSeparatedBy=STRING)? (NULL DEFINED AS nullDefinedAs=STRING)? #rowFormatDelimited ; multipartIdentifierList : multipartIdentifier (',' multipartIdentifier)* ; multipartIdentifier : parts+=errorCapturingIdentifier ('.' parts+=errorCapturingIdentifier)* ; tableIdentifier : (db=errorCapturingIdentifier '.')? table=errorCapturingIdentifier ; functionIdentifier : (db=errorCapturingIdentifier '.')? function=errorCapturingIdentifier ; namedExpression : expression (AS? (name=errorCapturingIdentifier | identifierList))? ; namedExpressionSeq : namedExpression (',' namedExpression)* ; transformList : '(' transforms+=transform (',' transforms+=transform)* ')' ; transform : qualifiedName #identityTransform | transformName=identifier '(' argument+=transformArgument (',' argument+=transformArgument)* ')' #applyTransform ; transformArgument : qualifiedName | constant ; expression : booleanExpression ; booleanExpression : NOT booleanExpression #logicalNot | EXISTS '(' query ')' #exists | valueExpression predicate? #predicated | left=booleanExpression operator=AND right=booleanExpression #logicalBinary | left=booleanExpression operator=OR right=booleanExpression #logicalBinary ; predicate : NOT? kind=BETWEEN lower=valueExpression AND upper=valueExpression | NOT? kind=IN '(' expression (',' expression)* ')' | NOT? kind=IN '(' query ')' | NOT? kind=RLIKE pattern=valueExpression | NOT? kind=LIKE pattern=valueExpression (ESCAPE escapeChar=STRING)? | IS NOT? kind=NULL | IS NOT? kind=(TRUE | FALSE | UNKNOWN) | IS NOT? kind=DISTINCT FROM right=valueExpression ; valueExpression : primaryExpression #valueExpressionDefault | operator=(MINUS | PLUS | TILDE) valueExpression #arithmeticUnary | left=valueExpression operator=(ASTERISK | SLASH | PERCENT | DIV) right=valueExpression #arithmeticBinary | left=valueExpression operator=(PLUS | MINUS | CONCAT_PIPE) right=valueExpression #arithmeticBinary | left=valueExpression operator=AMPERSAND right=valueExpression #arithmeticBinary | left=valueExpression operator=HAT right=valueExpression #arithmeticBinary | left=valueExpression operator=PIPE right=valueExpression #arithmeticBinary | left=valueExpression comparisonOperator right=valueExpression #comparison ; primaryExpression : name=(CURRENT_DATE | CURRENT_TIMESTAMP) #currentDatetime | CASE whenClause+ (ELSE elseExpression=expression)? END #searchedCase | CASE value=expression whenClause+ (ELSE elseExpression=expression)? END #simpleCase | CAST '(' expression AS dataType ')' #cast | STRUCT '(' (argument+=namedExpression (',' argument+=namedExpression)*)? ')' #struct | (FIRST | FIRST_VALUE) '(' expression ((IGNORE | RESPECT) NULLS)? ')' #first | (LAST | LAST_VALUE) '(' expression ((IGNORE | RESPECT) NULLS)? ')' #last | POSITION '(' substr=valueExpression IN str=valueExpression ')' #position | constant #constantDefault | ASTERISK #star | qualifiedName '.' ASTERISK #star | '(' namedExpression (',' namedExpression)+ ')' #rowConstructor | '(' query ')' #subqueryExpression | functionName '(' (setQuantifier? argument+=expression (',' argument+=expression)*)? ')' (FILTER '(' WHERE where=booleanExpression ')')? (OVER windowSpec)? #functionCall | identifier '->' expression #lambda | '(' identifier (',' identifier)+ ')' '->' expression #lambda | value=primaryExpression '[' index=valueExpression ']' #subscript | identifier #columnReference | base=primaryExpression '.' fieldName=identifier #dereference | '(' expression ')' #parenthesizedExpression | EXTRACT '(' field=identifier FROM source=valueExpression ')' #extract | (SUBSTR | SUBSTRING) '(' str=valueExpression (FROM | ',') pos=valueExpression ((FOR | ',') len=valueExpression)? ')' #substring | TRIM '(' trimOption=(BOTH | LEADING | TRAILING)? (trimStr=valueExpression)? FROM srcStr=valueExpression ')' #trim | OVERLAY '(' input=valueExpression PLACING replace=valueExpression FROM position=valueExpression (FOR length=valueExpression)? ')' #overlay ; constant : NULL #nullLiteral | interval #intervalLiteral | identifier STRING #typeConstructor | number #numericLiteral | booleanValue #booleanLiteral | STRING+ #stringLiteral ; comparisonOperator : EQ | NEQ | NEQJ | LT | LTE | GT | GTE | NSEQ ; arithmeticOperator : PLUS | MINUS | ASTERISK | SLASH | PERCENT | DIV | TILDE | AMPERSAND | PIPE | CONCAT_PIPE | HAT ; predicateOperator : OR | AND | IN | NOT ; booleanValue : TRUE | FALSE ; interval : INTERVAL (errorCapturingMultiUnitsInterval | errorCapturingUnitToUnitInterval)? ; errorCapturingMultiUnitsInterval : multiUnitsInterval unitToUnitInterval? ; multiUnitsInterval : (intervalValue intervalUnit)+ ; errorCapturingUnitToUnitInterval : body=unitToUnitInterval (error1=multiUnitsInterval | error2=unitToUnitInterval)? ; unitToUnitInterval : value=intervalValue from=intervalUnit TO to=intervalUnit ; intervalValue : (PLUS | MINUS)? (INTEGER_VALUE | DECIMAL_VALUE) | STRING ; intervalUnit : DAY | HOUR | MINUTE | MONTH | SECOND | YEAR | identifier ; colPosition : position=FIRST | position=AFTER afterCol=errorCapturingIdentifier ; dataType : complex=ARRAY '<' dataType '>' #complexDataType | complex=MAP '<' dataType ',' dataType '>' #complexDataType | complex=STRUCT ('<' complexColTypeList? '>' | NEQ) #complexDataType | identifier ('(' INTEGER_VALUE (',' INTEGER_VALUE)* ')')? #primitiveDataType ; qualifiedColTypeWithPositionList : qualifiedColTypeWithPosition (',' qualifiedColTypeWithPosition)* ; qualifiedColTypeWithPosition : name=multipartIdentifier dataType (NOT NULL)? commentSpec? colPosition? ; colTypeList : colType (',' colType)* ; colType : colName=errorCapturingIdentifier dataType (NOT NULL)? commentSpec? ; complexColTypeList : complexColType (',' complexColType)* ; complexColType : identifier ':' dataType (NOT NULL)? commentSpec? ; whenClause : WHEN condition=expression THEN result=expression ; windowClause : WINDOW namedWindow (',' namedWindow)* ; namedWindow : name=errorCapturingIdentifier AS windowSpec ; windowSpec : name=errorCapturingIdentifier #windowRef | '('name=errorCapturingIdentifier')' #windowRef | '(' ( CLUSTER BY partition+=expression (',' partition+=expression)* | ((PARTITION | DISTRIBUTE) BY partition+=expression (',' partition+=expression)*)? ((ORDER | SORT) BY sortItem (',' sortItem)*)?) windowFrame? ')' #windowDef ; windowFrame : frameType=RANGE start=frameBound | frameType=ROWS start=frameBound | frameType=RANGE BETWEEN start=frameBound AND end=frameBound | frameType=ROWS BETWEEN start=frameBound AND end=frameBound ; frameBound : UNBOUNDED boundType=(PRECEDING | FOLLOWING) | boundType=CURRENT ROW | expression boundType=(PRECEDING | FOLLOWING) ; qualifiedNameList : qualifiedName (',' qualifiedName)* ; functionName : qualifiedName | FILTER | LEFT | RIGHT ; qualifiedName : identifier ('.' identifier)* ; // this rule is used for explicitly capturing wrong identifiers such as test-table, which should actually be `test-table` // replace identifier with errorCapturingIdentifier where the immediate follow symbol is not an expression, otherwise // valid expressions such as ""a-b"" can be recognized as an identifier errorCapturingIdentifier : identifier errorCapturingIdentifierExtra ; // extra left-factoring grammar errorCapturingIdentifierExtra : (MINUS identifier)+ #errorIdent | #realIdent ; identifier : strictIdentifier | {!SQL_standard_keyword_behavior}? strictNonReserved ; strictIdentifier : IDENTIFIER #unquotedIdentifier | quotedIdentifier #quotedIdentifierAlternative | {SQL_standard_keyword_behavior}? ansiNonReserved #unquotedIdentifier | {!SQL_standard_keyword_behavior}? nonReserved #unquotedIdentifier ; quotedIdentifier : BACKQUOTED_IDENTIFIER ; number : {!legacy_exponent_literal_as_decimal_enabled}? MINUS? EXPONENT_VALUE #exponentLiteral | {!legacy_exponent_literal_as_decimal_enabled}? MINUS? DECIMAL_VALUE #decimalLiteral | {legacy_exponent_literal_as_decimal_enabled}? MINUS? (EXPONENT_VALUE | DECIMAL_VALUE) #legacyDecimalLiteral | MINUS? INTEGER_VALUE #integerLiteral | MINUS? BIGINT_LITERAL #bigIntLiteral | MINUS? SMALLINT_LITERAL #smallIntLiteral | MINUS? TINYINT_LITERAL #tinyIntLiteral | MINUS? DOUBLE_LITERAL #doubleLiteral | MINUS? BIGDECIMAL_LITERAL #bigDecimalLiteral ; // When `SQL_standard_keyword_behavior=true`, there are 2 kinds of keywords in Spark SQL. // - Reserved keywords: // Keywords that are reserved and can't be used as identifiers for table, view, column, // function, alias, etc. // - Non-reserved keywords: // Keywords that have a special meaning only in particular contexts and can be used as // identifiers in other contexts. For example, `EXPLAIN SELECT ...` is a command, but EXPLAIN // can be used as identifiers in other places. // You can find the full keywords list by searching ""Start of the keywords list"" in this file. // The non-reserved keywords are listed below. Keywords not in this list are reserved keywords. ansiNonReserved : ADD | AFTER | ALTER | ANALYZE | ARCHIVE | ARRAY | ASC | AT | BETWEEN | BUCKET | BUCKETS | BY | CACHE | CASCADE | CHANGE | CLEAR | CLUSTER | CLUSTERED | CODEGEN | COLLECTION | COLUMNS | COMMENT | COMMIT | COMPACT | COMPACTIONS | COMPUTE | CONCATENATE | COST | CUBE | CURRENT | DATA | DATABASE | DATABASES | DBPROPERTIES | DEFINED | DELETE | DELIMITED | DESC | DESCRIBE | DFS | DIRECTORIES | DIRECTORY | DISTRIBUTE | DIV | DROP | ESCAPED | EXCHANGE | EXISTS | EXPLAIN | EXPORT | EXTENDED | EXTERNAL | EXTRACT | FIELDS | FILEFORMAT | FIRST | FOLLOWING | FORMAT | FORMATTED | FUNCTION | FUNCTIONS | GLOBAL | GROUPING | IF | IGNORE | IMPORT | INDEX | INDEXES | INPATH | INPUTFORMAT | INSERT | INTERVAL | ITEMS | KEYS | LAST | LATERAL | LAZY | LIKE | LIMIT | LINES | LIST | LOAD | LOCAL | LOCATION | LOCK | LOCKS | LOGICAL | MACRO | MAP | MATCHED | MERGE | MSCK | NAMESPACE | NAMESPACES | NO | NULLS | OF | OPTION | OPTIONS | OUT | OUTPUTFORMAT | OVER | OVERLAY | OVERWRITE | PARTITION | PARTITIONED | PARTITIONS | PERCENTLIT | PIVOT | PLACING | POSITION | PRECEDING | PRINCIPALS | PROPERTIES | PURGE | QUERY | RANGE | RECORDREADER | RECORDWRITER | RECOVER | REDUCE | REFRESH | RENAME | REPAIR | REPLACE | RESET | RESPECT | RESTRICT | REVOKE | RLIKE | ROLE | ROLES | ROLLBACK | ROLLUP | ROW | ROWS | SCHEMA | SEPARATED | SERDE | SERDEPROPERTIES | SET | SETS | SHOW | SKEWED | SORT | SORTED | START | STATISTICS | STORED | STRATIFY | STRUCT | SUBSTR | SUBSTRING | TABLES | TABLESAMPLE | TBLPROPERTIES | TEMPORARY | TERMINATED | TOUCH | TRANSACTION | TRANSACTIONS | TRANSFORM | TRIM | TRUE | TRUNCATE | UNARCHIVE | UNBOUNDED | UNCACHE | UNLOCK | UNSET | UPDATE | USE | VALUES | VIEW | WINDOW ; // When `SQL_standard_keyword_behavior=false`, there are 2 kinds of keywords in Spark SQL. // - Non-reserved keywords: // Same definition as the one when `SQL_standard_keyword_behavior=true`. // - Strict-non-reserved keywords: // A strict version of non-reserved keywords, which can not be used as table alias. // You can find the full keywords list by searching ""Start of the keywords list"" in this file. // The strict-non-reserved keywords are listed in `strictNonReserved`. // The non-reserved keywords are listed in `nonReserved`. // These 2 together contain all the keywords. strictNonReserved : ANTI | CROSS | EXCEPT | FULL | INNER | INTERSECT | JOIN | LEFT | NATURAL | ON | RIGHT | SEMI | SETMINUS | UNION | USING ; nonReserved : ADD | AFTER | ALL | ALTER | ANALYZE | AND | ANY | ARCHIVE | ARRAY | AS | ASC | AT | AUTHORIZATION | BETWEEN | BOTH | BUCKET | BUCKETS | BY | CACHE | CASCADE | CASE | CAST | CHANGE | CHECK | CLEAR | CLUSTER | CLUSTERED | CODEGEN | COLLATE | COLLECTION | COLUMN | COLUMNS | COMMENT | COMMIT | COMPACT | COMPACTIONS | COMPUTE | CONCATENATE | CONSTRAINT | COST | CREATE | CUBE | CURRENT | CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP | CURRENT_USER | DATA | DATABASE | DATABASES | DAY | DBPROPERTIES | DEFINED | DELETE | DELIMITED | DESC | DESCRIBE | DFS | DIRECTORIES | DIRECTORY | DISTINCT | DISTRIBUTE | DIV | DROP | ELSE | END | ESCAPE | ESCAPED | EXCHANGE | EXISTS | EXPLAIN | EXPORT | EXTENDED | EXTERNAL | EXTRACT | FALSE | FETCH | FILTER | FIELDS | FILEFORMAT | FIRST | FIRST_VALUE | FOLLOWING | FOR | FOREIGN | FORMAT | FORMATTED | FROM | FUNCTION | FUNCTIONS | GLOBAL | GRANT | GROUP | GROUPING | HAVING | HOUR | IF | IGNORE | IMPORT | IN | INDEX | INDEXES | INPATH | INPUTFORMAT | INSERT | INTERVAL | INTO | IS | ITEMS | KEYS | LAST | LAST_VALUE | LATERAL | LAZY | LEADING | LIKE | LIMIT | LINES | LIST | LOAD | LOCAL | LOCATION | LOCK | LOCKS | LOGICAL | MACRO | MAP | MATCHED | MERGE | MINUTE | MONTH | MSCK | NAMESPACE | NAMESPACES | NO | NOT | NULL | NULLS | OF | ONLY | OPTION | OPTIONS | OR | ORDER | OUT | OUTER | OUTPUTFORMAT | OVER | OVERLAPS | OVERLAY | OVERWRITE | PARTITION | PARTITIONED | PARTITIONS | PERCENTLIT | PIVOT | PLACING | POSITION | PRECEDING | PRIMARY | PRINCIPALS | PROPERTIES | PURGE | QUERY | RANGE | RECORDREADER | RECORDWRITER | RECOVER | REDUCE | REFERENCES | REFRESH | RENAME | REPAIR | REPLACE | RESET | RESPECT | RESTRICT | REVOKE | RLIKE | ROLE | ROLES | ROLLBACK | ROLLUP | ROW | ROWS | SCHEMA | SECOND | SELECT | SEPARATED | SERDE | SERDEPROPERTIES | SESSION_USER | SET | SETS | SHOW | SKEWED | SOME | SORT | SORTED | START | STATISTICS | STORED | STRATIFY | STRUCT | SUBSTR | SUBSTRING | TABLE | TABLES | TABLESAMPLE | TBLPROPERTIES | TEMPORARY | TERMINATED | THEN | TO | TOUCH | TRAILING | TRANSACTION | TRANSACTIONS | TRANSFORM | TRIM | TRUE | TRUNCATE | TYPE | UNARCHIVE | UNBOUNDED | UNCACHE | UNIQUE | UNKNOWN | UNLOCK | UNSET | UPDATE | USE | USER | VALUES | VIEW | WHEN | WHERE | WINDOW | WITH | YEAR ; // NOTE: If you add a new token in the list below, you should update the list of keywords // in `docs/sql-keywords.md`. If the token is a non-reserved keyword, // please update `ansiNonReserved` and `nonReserved` as well. //============================ // Start of the keywords list //============================ ADD: 'ADD'; AFTER: 'AFTER'; ALL: 'ALL'; ALTER: 'ALTER'; ANALYZE: 'ANALYZE'; AND: 'AND'; ANTI: 'ANTI'; ANY: 'ANY'; ARCHIVE: 'ARCHIVE'; ARRAY: 'ARRAY'; AS: 'AS'; ASC: 'ASC'; AT: 'AT'; AUTHORIZATION: 'AUTHORIZATION'; BETWEEN: 'BETWEEN'; BOTH: 'BOTH'; BUCKET: 'BUCKET'; BUCKETS: 'BUCKETS'; BY: 'BY'; CACHE: 'CACHE'; CASCADE: 'CASCADE'; CASE: 'CASE'; CAST: 'CAST'; CHANGE: 'CHANGE'; CHECK: 'CHECK'; CLEAR: 'CLEAR'; CLUSTER: 'CLUSTER'; CLUSTERED: 'CLUSTERED'; CODEGEN: 'CODEGEN'; COLLATE: 'COLLATE'; COLLECTION: 'COLLECTION'; COLUMN: 'COLUMN'; COLUMNS: 'COLUMNS'; COMMENT: 'COMMENT'; COMMIT: 'COMMIT'; COMPACT: 'COMPACT'; COMPACTIONS: 'COMPACTIONS'; COMPUTE: 'COMPUTE'; CONCATENATE: 'CONCATENATE'; CONSTRAINT: 'CONSTRAINT'; COST: 'COST'; CREATE: 'CREATE'; CROSS: 'CROSS'; CUBE: 'CUBE'; CURRENT: 'CURRENT'; CURRENT_DATE: 'CURRENT_DATE'; CURRENT_TIME: 'CURRENT_TIME'; CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; CURRENT_USER: 'CURRENT_USER'; DATA: 'DATA'; DATABASE: 'DATABASE'; DATABASES: 'DATABASES' | 'SCHEMAS'; DAY: 'DAY'; DBPROPERTIES: 'DBPROPERTIES'; DEFINED: 'DEFINED'; DELETE: 'DELETE'; DELIMITED: 'DELIMITED'; DESC: 'DESC'; DESCRIBE: 'DESCRIBE'; DFS: 'DFS'; DIRECTORIES: 'DIRECTORIES'; DIRECTORY: 'DIRECTORY'; DISTINCT: 'DISTINCT'; DISTRIBUTE: 'DISTRIBUTE'; DROP: 'DROP'; ELSE: 'ELSE'; END: 'END'; ESCAPE: 'ESCAPE'; ESCAPED: 'ESCAPED'; EXCEPT: 'EXCEPT'; EXCHANGE: 'EXCHANGE'; EXISTS: 'EXISTS'; EXPLAIN: 'EXPLAIN'; EXPORT: 'EXPORT'; EXTENDED: 'EXTENDED'; EXTERNAL: 'EXTERNAL'; EXTRACT: 'EXTRACT'; FALSE: 'FALSE'; FETCH: 'FETCH'; FIELDS: 'FIELDS'; FILTER: 'FILTER'; FILEFORMAT: 'FILEFORMAT'; FIRST: 'FIRST'; FIRST_VALUE: 'FIRST_VALUE'; FOLLOWING: 'FOLLOWING'; FOR: 'FOR'; FOREIGN: 'FOREIGN'; FORMAT: 'FORMAT'; FORMATTED: 'FORMATTED'; FROM: 'FROM'; FULL: 'FULL'; FUNCTION: 'FUNCTION'; FUNCTIONS: 'FUNCTIONS'; GLOBAL: 'GLOBAL'; GRANT: 'GRANT'; GROUP: 'GROUP'; GROUPING: 'GROUPING'; HAVING: 'HAVING'; HOUR: 'HOUR'; IF: 'IF'; IGNORE: 'IGNORE'; IMPORT: 'IMPORT'; IN: 'IN'; INDEX: 'INDEX'; INDEXES: 'INDEXES'; INNER: 'INNER'; INPATH: 'INPATH'; INPUTFORMAT: 'INPUTFORMAT'; INSERT: 'INSERT'; INTERSECT: 'INTERSECT'; INTERVAL: 'INTERVAL'; INTO: 'INTO'; IS: 'IS'; ITEMS: 'ITEMS'; JOIN: 'JOIN'; KEYS: 'KEYS'; LAST: 'LAST'; LAST_VALUE: 'LAST_VALUE'; LATERAL: 'LATERAL'; LAZY: 'LAZY'; LEADING: 'LEADING'; LEFT: 'LEFT'; LIKE: 'LIKE'; LIMIT: 'LIMIT'; LINES: 'LINES'; LIST: 'LIST'; LOAD: 'LOAD'; LOCAL: 'LOCAL'; LOCATION: 'LOCATION'; LOCK: 'LOCK'; LOCKS: 'LOCKS'; LOGICAL: 'LOGICAL'; MACRO: 'MACRO'; MAP: 'MAP'; MATCHED: 'MATCHED'; MERGE: 'MERGE'; MINUTE: 'MINUTE'; MONTH: 'MONTH'; MSCK: 'MSCK'; NAMESPACE: 'NAMESPACE'; NAMESPACES: 'NAMESPACES'; NATURAL: 'NATURAL'; NO: 'NO'; NOT: 'NOT' | '!'; NULL: 'NULL'; NULLS: 'NULLS'; OF: 'OF'; ON: 'ON'; ONLY: 'ONLY'; OPTION: 'OPTION'; OPTIONS: 'OPTIONS'; OR: 'OR'; ORDER: 'ORDER'; OUT: 'OUT'; OUTER: 'OUTER'; OUTPUTFORMAT: 'OUTPUTFORMAT'; OVER: 'OVER'; OVERLAPS: 'OVERLAPS'; OVERLAY: 'OVERLAY'; OVERWRITE: 'OVERWRITE'; PARTITION: 'PARTITION'; PARTITIONED: 'PARTITIONED'; PARTITIONS: 'PARTITIONS'; PERCENTLIT: 'PERCENT'; PIVOT: 'PIVOT'; PLACING: 'PLACING'; POSITION: 'POSITION'; PRECEDING: 'PRECEDING'; PRIMARY: 'PRIMARY'; PRINCIPALS: 'PRINCIPALS'; PROPERTIES: 'PROPERTIES'; PURGE: 'PURGE'; QUERY: 'QUERY'; RANGE: 'RANGE'; RECORDREADER: 'RECORDREADER'; RECORDWRITER: 'RECORDWRITER'; RECOVER: 'RECOVER'; REDUCE: 'REDUCE'; REFERENCES: 'REFERENCES'; REFRESH: 'REFRESH'; RENAME: 'RENAME'; REPAIR: 'REPAIR'; REPLACE: 'REPLACE'; RESET: 'RESET'; RESPECT: 'RESPECT'; RESTRICT: 'RESTRICT'; REVOKE: 'REVOKE'; RIGHT: 'RIGHT'; RLIKE: 'RLIKE' | 'REGEXP'; ROLE: 'ROLE'; ROLES: 'ROLES'; ROLLBACK: 'ROLLBACK'; ROLLUP: 'ROLLUP'; ROW: 'ROW'; ROWS: 'ROWS'; SCHEMA: 'SCHEMA'; SECOND: 'SECOND'; SELECT: 'SELECT'; SEMI: 'SEMI'; SEPARATED: 'SEPARATED'; SERDE: 'SERDE'; SERDEPROPERTIES: 'SERDEPROPERTIES'; SESSION_USER: 'SESSION_USER'; SET: 'SET'; SETMINUS: 'MINUS'; SETS: 'SETS'; SHOW: 'SHOW'; SKEWED: 'SKEWED'; SOME: 'SOME'; SORT: 'SORT'; SORTED: 'SORTED'; START: 'START'; STATISTICS: 'STATISTICS'; STORED: 'STORED'; STRATIFY: 'STRATIFY'; STRUCT: 'STRUCT'; SUBSTR: 'SUBSTR'; SUBSTRING: 'SUBSTRING'; TABLE: 'TABLE'; TABLES: 'TABLES'; TABLESAMPLE: 'TABLESAMPLE'; TBLPROPERTIES: 'TBLPROPERTIES'; TEMPORARY: 'TEMPORARY' | 'TEMP'; TERMINATED: 'TERMINATED'; THEN: 'THEN'; TO: 'TO'; TOUCH: 'TOUCH'; TRAILING: 'TRAILING'; TRANSACTION: 'TRANSACTION'; TRANSACTIONS: 'TRANSACTIONS'; TRANSFORM: 'TRANSFORM'; TRIM: 'TRIM'; TRUE: 'TRUE'; TRUNCATE: 'TRUNCATE'; TYPE: 'TYPE'; UNARCHIVE: 'UNARCHIVE'; UNBOUNDED: 'UNBOUNDED'; UNCACHE: 'UNCACHE'; UNION: 'UNION'; UNIQUE: 'UNIQUE'; UNKNOWN: 'UNKNOWN'; UNLOCK: 'UNLOCK'; UNSET: 'UNSET'; UPDATE: 'UPDATE'; USE: 'USE'; USER: 'USER'; USING: 'USING'; VALUES: 'VALUES'; VIEW: 'VIEW'; WHEN: 'WHEN'; WHERE: 'WHERE'; WINDOW: 'WINDOW'; WITH: 'WITH'; YEAR: 'YEAR'; //============================ // End of the keywords list //============================ EQ : '=' | '=='; NSEQ: '<=>'; NEQ : '<>'; NEQJ: '!='; LT : '<'; LTE : '<=' | '!>'; GT : '>'; GTE : '>=' | '!<'; PLUS: '+'; MINUS: '-'; ASTERISK: '*'; SLASH: '/'; PERCENT: '%'; DIV: 'DIV'; TILDE: '~'; AMPERSAND: '&'; PIPE: '|'; CONCAT_PIPE: '||'; HAT: '^'; STRING : '\\'' ( ~('\\''|'\\\\') | ('\\\\' .) )* '\\'' | '""' ( ~('""'|'\\\\') | ('\\\\' .) )* '""' ; BIGINT_LITERAL : DIGIT+ 'L' ; SMALLINT_LITERAL : DIGIT+ 'S' ; TINYINT_LITERAL : DIGIT+ 'Y' ; INTEGER_VALUE : DIGIT+ ; EXPONENT_VALUE : DIGIT+ EXPONENT | DECIMAL_DIGITS EXPONENT {isValidDecimal()}? ; DECIMAL_VALUE : DECIMAL_DIGITS {isValidDecimal()}? ; DOUBLE_LITERAL : DIGIT+ EXPONENT? 'D' | DECIMAL_DIGITS EXPONENT? 'D' {isValidDecimal()}? ; BIGDECIMAL_LITERAL : DIGIT+ EXPONENT? 'BD' | DECIMAL_DIGITS EXPONENT? 'BD' {isValidDecimal()}? ; IDENTIFIER : (LETTER | DIGIT | '_')+ ; BACKQUOTED_IDENTIFIER : '`' ( ~'`' | '``' )* '`' ; fragment DECIMAL_DIGITS : DIGIT+ '.' DIGIT* | '.' DIGIT+ ; fragment EXPONENT : 'E' [+-]? DIGIT+ ; fragment DIGIT : [0-9] ; fragment LETTER : [A-Z] ; SIMPLE_COMMENT : '--' ~[\\r\\n]* '\\r'? '\\n'? -> channel(HIDDEN) ; BRACKETED_EMPTY_COMMENT : '/**/' -> channel(HIDDEN) ; BRACKETED_COMMENT : '/*' ~[+] .*? '*/' -> channel(HIDDEN) ; WS : [ \\r\\n\\t]+ -> channel(HIDDEN) ; // Catch-all for anything we can't recognize. // We use this to be able to ignore and recover all the text // when splitting statements with DelimiterLexer UNRECOGNIZED : . ; ",12430,False,2331.2023899961864,median "*&---------------------------------------------------------------------* *& Report z_ct3 *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT z_ct3. data: int type i value 0, sum type i value 0, counter type i value 0. data: begin of wa, num type i, end of wa. data: begin of wa2, num type i, partsum type i value 0, end of wa2. DATA itab LIKE TABLE OF wa with header line. DATA itab2 like table of wa2 with header line. wa-num = '13'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '21'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-20'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '-20'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-24'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-20'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-27'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '24'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '23'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-31'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '29'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '40'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '29'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '32'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '29'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-20'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '24'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-23'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-20'. Append wa to itab. wa-num = '34'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '21'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '22'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '22'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '25'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '34'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-34'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-28'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '30'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '-25'. Append wa to itab. wa-num = '28'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '29'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '22'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-20'. Append wa to itab. wa-num = '-36'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '183'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-108'. Append wa to itab. wa-num = '34'. Append wa to itab. wa-num = '-138'. Append wa to itab. wa-num = '-65'. Append wa to itab. wa-num = '-42'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '410'. Append wa to itab. wa-num = '75921'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-22'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-20'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-20'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '24'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '24'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-26'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '21'. Append wa to itab. wa-num = '22'. Append wa to itab. wa-num = '26'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '34'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '28'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '34'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '25'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-13'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-23'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '9'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-21'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '26'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '22'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '-5'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-15'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '22'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-1'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-12'. Append wa to itab. wa-num = '-10'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '-2'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '17'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '-18'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '6'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '27'. Append wa to itab. wa-num = '5'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '15'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '8'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '2'. Append wa to itab. wa-num = '25'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-6'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '23'. Append wa to itab. wa-num = '-4'. Append wa to itab. wa-num = '20'. Append wa to itab. wa-num = '18'. Append wa to itab. wa-num = '4'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '3'. Append wa to itab. wa-num = '-20'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '40'. Append wa to itab. wa-num = '-35'. Append wa to itab. wa-num = '-39'. Append wa to itab. wa-num = '-42'. Append wa to itab. wa-num = '13'. Append wa to itab. wa-num = '-48'. Append wa to itab. wa-num = '-14'. Append wa to itab. wa-num = '7'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-21'. Append wa to itab. wa-num = '10'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '-11'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '-25'. Append wa to itab. wa-num = '-9'. Append wa to itab. wa-num = '-19'. Append wa to itab. wa-num = '23'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '22'. Append wa to itab. wa-num = '-3'. Append wa to itab. wa-num = '22'. Append wa to itab. wa-num = '-7'. Append wa to itab. wa-num = '14'. Append wa to itab. wa-num = '-25'. Append wa to itab. wa-num = '66'. Append wa to itab. wa-num = '-8'. Append wa to itab. wa-num = '104'. Append wa to itab. wa-num = '41'. Append wa to itab. wa-num = '35'. Append wa to itab. wa-num = '1'. Append wa to itab. wa-num = '11'. Append wa to itab. wa-num = '-48'. Append wa to itab. wa-num = '-38'. Append wa to itab. wa-num = '44'. Append wa to itab. wa-num = '-64'. Append wa to itab. wa-num = '259'. Append wa to itab. wa-num = '-17'. Append wa to itab. wa-num = '19'. Append wa to itab. wa-num = '-16'. Append wa to itab. wa-num = '12'. Append wa to itab. wa-num = '16'. Append wa to itab. wa-num = '-77039'. Append wa to itab. loop at itab into data(wa1). write:/ wa1-num. sum = sum + wa1-num. endloop. uline. Write:/ 'Az összeg: ', sum. clear sum. loop at itab into data(l_itab). wa2-num = l_itab-num. sum = sum + l_itab-num. wa2-partsum = sum. wa-num = l_itab-num. READ TABLE itab2 INTO data(l2) WITH KEY partsum = wa2-partsum . if sy-subrc eq '0'. append wa2 to itab2. Write: 'Bingo: ', wa2-partsum. exit. endif. append wa to itab. append wa2 to itab2. endloop. ",13342,True,5552.275249477473,median "/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ grammar DDLStatement; import Symbol, Keyword, OracleKeyword, Literals, BaseRule; createTable : CREATE createTableSpecification TABLE tableName createSharingClause createDefinitionClause createMemOptimizeClause createParentClause ; createIndex : CREATE createIndexSpecification INDEX indexName ON createIndexDefinitionClause usableSpecification? invalidationSpecification? ; alterTable : ALTER TABLE tableName memOptimizeClause alterDefinitionClause enableDisableClauses ; alterIndex : ALTER INDEX indexName alterIndexInformationClause ; dropTable : DROP TABLE tableName (CASCADE CONSTRAINTS)? (PURGE)? ; dropIndex : DROP INDEX indexName ONLINE? FORCE? ((DEFERRED|IMMEDIATE) INVALIDATION)? ; truncateTable : TRUNCATE TABLE tableName materializedViewLogClause? dropReuseClause? CASCADE? ; createTableSpecification : ((GLOBAL | PRIVATE) TEMPORARY | SHARDED | DUPLICATED)? ; tablespaceClauseWithParen : LP_ tablespaceClause RP_ ; tablespaceClause : TABLESPACE ignoredIdentifier ; createSharingClause : (SHARING EQ_ (METADATA | DATA | EXTENDED DATA | NONE))? ; createDefinitionClause : createRelationalTableClause | createObjectTableClause | createXMLTypeTableClause ; createXMLTypeTableClause : OF? XMLTYPE (LP_ (objectProperties) RP_)? (XMLTYPE xmlTypeStorageClause)? (xmlSchemaSpecClause)? (xmlTypeVirtualColumnsClause)? (ON COMMIT (DELETE | PRESERVE) ROWS)? (oidClause)? (oidIndexClause)? (physicalProperties)? (tableProperties)? ; xmlTypeStorageClause : STORE (AS ( OBJECT RELATIONAL | ((SECUREFILE | BASICFILE)? (CLOB | BINARY XML) (lobSegname (LP_ lobParameters RP_)? | (LP_ lobParameters RP_))?))) | (ALL VARRAYS AS (LOBS | TABLES )) ; xmlSchemaSpecClause : (XMLSCHEMA xmlSchemaURLName)? ELEMENT (elementName | xmlSchemaURLName POUND_ elementName)? (STORE ALL VARRAYS AS (LOBS | TABLES))? ((ALLOW | DISALLOW) NONSCHEMA)? ((ALLOW | DISALLOW) ANYSCHEMA)? ; xmlTypeVirtualColumnsClause : VIRTUAL COLUMNS LP_ (columnName AS LP_ expr RP_ (COMMA_ columnName AS LP_ expr RP_)+) RP_ ; oidClause : OBJECT IDENTIFIER IS (SYSTEM GENERATED | PRIMARY KEY) ; oidIndexClause : OIDINDEX indexName? LP_ (physicalAttributesClause | TABLESPACE tablespaceName)* RP_ ; createRelationalTableClause : (LP_ relationalProperties RP_)? collationClause? commitClause? physicalProperties? tableProperties? ; createMemOptimizeClause : (MEMOPTIMIZE FOR READ)? (MEMOPTIMIZE FOR WRITE)? ; createParentClause : (PARENT tableName)? ; createObjectTableClause : OF objectName objectTableSubstitution? (LP_ objectProperties RP_)? (ON COMMIT (DELETE | PRESERVE) ROWS)? oidClause? oidIndexClause? physicalProperties? tableProperties? ; relationalProperties : relationalProperty (COMMA_ relationalProperty)* ; relationalProperty : columnDefinition | virtualColumnDefinition | outOfLineConstraint | outOfLineRefConstraint ; columnDefinition : columnName dataType SORT? visibleClause (defaultNullClause expr | identityClause)? (ENCRYPT encryptionSpecification)? (inlineConstraint+ | inlineRefConstraint)? ; visibleClause : (VISIBLE | INVISIBLE)? ; defaultNullClause : DEFAULT (ON NULL)? ; identityClause : GENERATED (ALWAYS | BY DEFAULT (ON NULL)?) AS IDENTITY identifyOptions ; identifyOptions : LP_? (identityOption+)? RP_? ; identityOption : START WITH (INTEGER_ | LIMIT VALUE) | INCREMENT BY INTEGER_ | MAXVALUE INTEGER_ | NOMAXVALUE | MINVALUE INTEGER_ | NOMINVALUE | CYCLE | NOCYCLE | CACHE INTEGER_ | NOCACHE | ORDER | NOORDER ; encryptionSpecification : (USING STRING_)? (IDENTIFIED BY STRING_)? STRING_? (NO? SALT)? ; inlineConstraint : (CONSTRAINT ignoredIdentifier)? (NOT? NULL | UNIQUE | primaryKey | referencesClause | CHECK LP_ expr RP_) constraintState? ; referencesClause : REFERENCES tableName columnNames? (ON DELETE (CASCADE | SET NULL))? ; constraintState : notDeferrable | initiallyClause | RELY | NORELY | usingIndexClause | ENABLE | DISABLE | VALIDATE | NOVALIDATE | exceptionsClause ; notDeferrable : NOT? DEFERRABLE ; initiallyClause : INITIALLY (IMMEDIATE | DEFERRED) ; exceptionsClause : EXCEPTIONS INTO tableName ; usingIndexClause : USING INDEX (indexName | createIndexClause)? ; createIndexClause : LP_ createIndex RP_ ; inlineRefConstraint : SCOPE IS tableName | WITH ROWID | (CONSTRAINT ignoredIdentifier)? referencesClause constraintState? ; virtualColumnDefinition : columnName dataType? (GENERATED ALWAYS)? AS LP_ expr RP_ VIRTUAL? inlineConstraint* ; outOfLineConstraint : (CONSTRAINT constraintName)? (UNIQUE columnNames | primaryKey columnNames | FOREIGN KEY columnNames referencesClause | CHECK LP_ expr RP_ ) constraintState? ; outOfLineRefConstraint : SCOPE FOR LP_ lobItem RP_ IS tableName | REF LP_ lobItem RP_ WITH ROWID | (CONSTRAINT constraintName)? FOREIGN KEY lobItemList referencesClause constraintState? ; createIndexSpecification : (UNIQUE | BITMAP)? ; clusterIndexClause : CLUSTER clusterName indexAttributes? ; indexAttributes : (ONLINE | (SORT|NOSORT) | REVERSE | (VISIBLE | INVISIBLE)) ; tableIndexClause : tableName alias? indexExpressions ; indexExpressions : LP_? indexExpression (COMMA_ indexExpression)* RP_? ; indexExpression : (columnName | expr) (ASC | DESC)? ; bitmapJoinIndexClause : tableName columnSortsClause_ FROM tableAlias WHERE expr ; columnSortsClause_ : LP_? columnSortClause_ (COMMA_ columnSortClause_)* RP_? ; columnSortClause_ : (tableName | alias)? columnName (ASC | DESC)? ; createIndexDefinitionClause : clusterIndexClause | tableIndexClause | bitmapJoinIndexClause ; tableAlias : tableName alias? (COMMA_ tableName alias?)* ; alterDefinitionClause : (alterTableProperties | columnClauses | constraintClauses | alterTablePartitioning ((DEFERRED| IMMEDIATE) INVALIDATION)? | alterExternalTable)? ; alterTableProperties : renameTableSpecification | REKEY encryptionSpecification ; renameTableSpecification : RENAME TO identifier ; columnClauses : operateColumnClause+ | renameColumnClause ; operateColumnClause : addColumnSpecification | modifyColumnSpecification | dropColumnClause ; addColumnSpecification : ADD LP_ columnOrVirtualDefinitions RP_ columnProperties? ; columnOrVirtualDefinitions : columnOrVirtualDefinition (COMMA_ columnOrVirtualDefinition)* ; columnOrVirtualDefinition : columnDefinition | virtualColumnDefinition ; columnProperties : columnProperty+ ; columnProperty : objectTypeColProperties ; objectTypeColProperties : COLUMN columnName substitutableColumnClause ; substitutableColumnClause : ELEMENT? IS OF TYPE? LP_ ONLY? dataTypeName RP_ | NOT? SUBSTITUTABLE AT ALL LEVELS ; modifyColumnSpecification : MODIFY (LP_? modifyColProperties (COMMA_ modifyColProperties)* RP_? | modifyColSubstitutable) ; modifyColProperties : columnName dataType? (DEFAULT expr)? (ENCRYPT encryptionSpecification | DECRYPT)? inlineConstraint* ; modifyColSubstitutable : COLUMN columnName NOT? SUBSTITUTABLE AT ALL LEVELS FORCE? ; dropColumnClause : SET UNUSED columnOrColumnList cascadeOrInvalidate* | dropColumnSpecification ; dropColumnSpecification : DROP columnOrColumnList cascadeOrInvalidate* checkpointNumber? ; columnOrColumnList : (COLUMN columnName) | columnNames ; cascadeOrInvalidate : CASCADE CONSTRAINTS | INVALIDATE ; checkpointNumber : CHECKPOINT NUMBER_ ; renameColumnClause : RENAME COLUMN columnName TO columnName ; constraintClauses : addConstraintSpecification | modifyConstraintClause | renameConstraintClause | dropConstraintClause+ ; addConstraintSpecification : ADD (outOfLineConstraint+ | outOfLineRefConstraint) ; modifyConstraintClause : MODIFY constraintOption constraintState+ CASCADE? ; constraintWithName : CONSTRAINT constraintName ; constraintOption : constraintWithName | constraintPrimaryOrUnique ; constraintPrimaryOrUnique : primaryKey | UNIQUE columnNames ; renameConstraintClause : RENAME constraintWithName TO ignoredIdentifier ; dropConstraintClause : DROP ( constraintPrimaryOrUnique CASCADE? ((KEEP | DROP) INDEX)? | (CONSTRAINT constraintName CASCADE?) ) ; alterExternalTable : (addColumnSpecification | modifyColumnSpecification | dropColumnSpecification)+ ; objectProperties : ((columnName | attributeName) (DEFAULT expr)? (inlineConstraint* | inlineRefConstraint)?) | outOfLineConstraint | outOfLineRefConstraint | supplementalLoggingProps ; alterIndexInformationClause : rebuildClause ((DEFERRED|IMMEDIATE) | INVALIDATION)? | parallelClause | COMPILE | (ENABLE | DISABLE) | UNUSABLE ONLINE? ((DEFERRED|IMMEDIATE)|INVALIDATION)? | (VISIBLE | INVISIBLE) | renameIndexClause | COALESCE CLEANUP? ONLY? parallelClause? | ((MONITORING | NOMONITORING) USAGE) | UPDATE BLOCK REFERENCES ; renameIndexClause : (RENAME TO indexName)? ; objectTableSubstitution : NOT? SUBSTITUTABLE AT ALL LEVELS ; memOptimizeClause : memOptimizeReadClause? memOptimizeWriteClause? ; memOptimizeReadClause : (MEMOPTIMIZE FOR READ | NO MEMOPTIMIZE FOR READ) ; memOptimizeWriteClause : (MEMOPTIMIZE FOR WRITE | NO MEMOPTIMIZE FOR WRITE) ; enableDisableClauses : (enableDisableClause | enableDisableOthers)? ; enableDisableClause : (ENABLE | DISABLE) (VALIDATE |NO VALIDATE)? ((UNIQUE columnName (COMMA_ columnName)*) | PRIMARY KEY | constraintWithName) usingIndexClause? exceptionsClause? CASCADE? ((KEEP | DROP) INDEX)? ; enableDisableOthers : (ENABLE | DISABLE) (TABLE LOCK | ALL TRIGGERS | CONTAINER_MAP | CONTAINERS_DEFAULT) ; rebuildClause : REBUILD parallelClause? ; parallelClause : NOPARALLEL | PARALLEL NUMBER_? ; usableSpecification : (USABLE | UNUSABLE) ; invalidationSpecification : (DEFERRED | IMMEDIATE) INVALIDATION ; materializedViewLogClause : (PRESERVE | PURGE) MATERIALIZED VIEW LOG ; dropReuseClause : (DROP (ALL)? | REUSE) STORAGE ; collationClause : DEFAULT COLLATION collationName ; commitClause : (ON COMMIT (DROP | PRESERVE) ROWS)? (ON COMMIT (DELETE | PRESERVE) ROWS)? ; physicalProperties : deferredSegmentCreation? segmentAttributesClause? tableCompression? inmemoryTableClause? ilmClause? | deferredSegmentCreation? (organizationClause?|externalPartitionClause?) | clusterClause ; deferredSegmentCreation : SEGMENT CREATION (IMMEDIATE|DEFERRED) ; segmentAttributesClause : ( physicalAttributesClause | (TABLESPACE tablespaceName | TABLESPACE SET tablespaceSetName) | loggingClause)+ ; physicalAttributesClause : (PCTFREE NUMBER_ | PCTUSED NUMBER_ | INITRANS NUMBER_ | storageClause)+ ; loggingClause : LOGGING | NOLOGGING | FILESYSTEM_LIKE_LOGGING ; storageClause : STORAGE LP_ (INITIAL sizeClause | NEXT sizeClause | MINEXTENTS NUMBER_ | MAXEXTENTS (NUMBER_ | UNLIMITED) | maxsizeClause | PCTINCREASE NUMBER_ | FREELISTS NUMBER_ | FREELIST GROUPS NUMBER_ | OPTIMAL (sizeClause | NULL)? | BUFFER_POOL (KEEP | RECYCLE | DEFAULT) | FLASH_CACHE (KEEP | NONE | DEFAULT) | CELL_FLASH_CACHE (KEEP | NONE | DEFAULT) | ENCRYPT )+ RP_ ; sizeClause : NUMBER_ ('K' | 'M' | 'G' | 'T' | 'P' | 'E')? ; maxsizeClause : MAXSIZE (UNLIMITED | sizeClause) ; tableCompression : COMPRESS | ROW STORE COMPRESS (BASIC | ADVANCED)? | COLUMN STORE COMPRESS (FOR (QUERY | ARCHIVE) (LOW | HIGH)?)? (NO? ROW LEVEL LOCKING)? | NOCOMPRESS ; inmemoryTableClause : ((INMEMORY inmemoryAttributes?) | NO INMEMORY)? (inmemoryColumnClause)? ; inmemoryAttributes : inmemoryMemcompress? inmemoryPriority? inmemoryDistribute? inmemoryDuplicate? ; inmemoryColumnClause : (INMEMORY inmemoryMemcompress? | NO INMEMORY) columnNames ; inmemoryMemcompress : MEMCOMPRESS FOR ( DML | (QUERY | CAPACITY) (LOW | HIGH)? ) | NO MEMCOMPRESS ; inmemoryPriority : PRIORITY (NONE | LOW | MEDIUM | HIGH | CRITICAL) ; inmemoryDistribute : DISTRIBUTE (AUTO | BY (ROWID RANGE | PARTITION | SUBPARTITION))? (FOR SERVICE (DEFAULT | ALL | serviceName | NONE))? ; inmemoryDuplicate : DUPLICATE | DUPLICATE ALL | NO DUPLICATE ; ilmClause : ILM (ADD POLICY ilmPolicyClause | (DELETE | ENABLE | DISABLE) POLICY ilmPolicyName | (DELETE_ALL | ENABLE_ALL | DISABLE_ALL)) ; ilmPolicyClause : ilmCompressionPolicy | ilmTieringPolicy | ilmInmemoryPolicy ; ilmCompressionPolicy : tableCompression (SEGMENT | GROUP) ( AFTER ilmTimePeriod OF ( NO ACCESS | NO MODIFICATION | CREATION ) | ON functionName) | (ROW STORE COMPRESS ADVANCED | COLUMN STORE COMPRESS FOR QUERY) ROW AFTER ilmTimePeriod OF NO MODIFICATION ; ilmTimePeriod : NUMBER_ ((DAY | DAYS) | (MONTH | MONTHS) | (YEAR | YEARS)) ; ilmTieringPolicy : TIER TO tablespaceName (SEGMENT | GROUP)? (ON functionName)? | TIER TO tablespaceName READ ONLY (SEGMENT | GROUP)? (AFTER ilmTimePeriod OF (NO ACCESS | NO MODIFICATION | CREATION) | ON functionName) ; ilmInmemoryPolicy : (SET INMEMORY inmemoryAttributes | MODIFY INMEMORY inmemoryMemcompress | NO INMEMORY) SEGMENT (AFTER ilmTimePeriod OF (NO ACCESS | NO MODIFICATION | CREATION) | ON functionName) ; organizationClause : ORGANIZATION ( HEAP segmentAttributesClause? heapOrgTableClause | INDEX segmentAttributesClause? indexOrgTableClause | EXTERNAL externalTableClause) ; heapOrgTableClause : tableCompression? inmemoryTableClause? ilmClause? ; indexOrgTableClause : (mappingTableClause | PCTTHRESHOLD NUMBER_ | prefixCompression)* indexOrgOverflowClause? ; externalTableClause : LP_ (TYPE accessDriverType)? (externalTableDataProps)? RP_ (REJECT LIMIT (NUMBER_ | UNLIMITED))? inmemoryTableClause? ; externalTableDataProps : (DEFAULT DIRECTORY directoryName)? (ACCESS PARAMETERS ((opaqueFormatSpec) | USING CLOB subquery))? (LOCATION LP_ (directoryName COLON_)? locationSpecifier (COMMA_ (directoryName COLON_)? locationSpecifier)+ RP_)? ; mappingTableClause : MAPPING TABLE | NOMAPPING ; prefixCompression : COMPRESS NUMBER_? | NOCOMPRESS ; indexOrgOverflowClause : (INCLUDING columnName)? OVERFLOW segmentAttributesClause? ; externalPartitionClause : EXTERNAL PARTITION ATTRIBUTES externalTableClause (REJECT LIMIT)? ; clusterRelatedClause : CLUSTER clusterName columnNames ; tableProperties :columnProperties? readOnlyClause? indexingClause? tablePartitioningClauses? attributeClusteringClause? (CACHE | NOCACHE)? ( RESULT_CACHE ( MODE (DEFAULT | FORCE) ) )? parallelClause? (ROWDEPENDENCIES | NOROWDEPENDENCIES)? enableDisableClause* rowMovementClause? flashbackArchiveClause? (ROW ARCHIVAL)? (AS subquery | FOR EXCHANGE WITH TABLE tableName)? ; readOnlyClause : READ ONLY | READ WRITE ; indexingClause : INDEXING (ON | OFF) ; tablePartitioningClauses : rangePartitions | listPartitions | hashPartitions | compositeRangePartitions | compositeListPartitions | compositeHashPartitions | referencePartitioning | systemPartitioning | consistentHashPartitions | consistentHashWithSubpartitions | partitionsetClauses ; rangePartitions : PARTITION BY RANGE columnNames (INTERVAL LP_ expr RP_ (STORE IN LP_ tablespaceName (COMMA_ tablespaceName)* RP_)?)? LP_ PARTITION partitionName? rangeValuesClause tablePartitionDescription (COMMA_ PARTITION partitionName? rangeValuesClause tablePartitionDescription externalPartSubpartDataProps?)* RP_ ; rangeValuesClause : VALUES LESS THAN LP_? (numberLiterals | MAXVALUE) (COMMA_ (numberLiterals | MAXVALUE))* RP_? ; tablePartitionDescription : (INTERNAL | EXTERNAL)? deferredSegmentCreation? readOnlyClause? indexingClause? segmentAttributesClause? (tableCompression | prefixCompression)? inmemoryClause? ilmClause? (OVERFLOW segmentAttributesClause?)? (lobStorageClause | varrayColProperties | nestedTableColProperties)* ; inmemoryClause : INMEMORY inmemoryAttributes? | NO INMEMORY ; varrayColProperties : VARRAY varrayItem (substitutableColumnClause? varrayStorageClause | substitutableColumnClause) ; nestedTableColProperties : NESTED TABLE (nestedItem | COLUMN_VALUE) substitutableColumnClause? (LOCAL | GLOBAL)? STORE AS storageTable LP_ (LP_ objectProperties RP_ | physicalProperties | columnProperties) RP_ (RETURN AS? (LOCATOR | VALUE))? ; lobStorageClause : LOB ( LP_ lobItem (COMMA_ lobItem)* RP_ STORE AS ((SECUREFILE | BASICFILE) | LP_ lobStorageParameters RP_)+ | LP_ lobItem RP_ STORE AS ((SECUREFILE | BASICFILE) | lobSegname | LP_ lobStorageParameters RP_)+ ) ; varrayStorageClause : STORE AS (SECUREFILE | BASICFILE)? LOB (lobSegname? LP_ lobStorageParameters RP_ | lobSegname) ; lobStorageParameters : ((TABLESPACE tablespaceName | TABLESPACE SET tablespaceSetName) | lobParameters storageClause?)+ | storageClause ; lobParameters : ( (ENABLE | DISABLE) STORAGE IN ROW | CHUNK NUMBER_ | PCTVERSION NUMBER_ | FREEPOOLS NUMBER_ | lobRetentionClause | lobDeduplicateClause | lobCompressionClause | (ENCRYPT encryptionSpecification | DECRYPT) | (CACHE | NOCACHE | CACHE READS) loggingClause? )+ ; lobRetentionClause : RETENTION (MAX | MIN NUMBER_ | AUTO | NONE)? ; lobDeduplicateClause : DEDUPLICATE | KEEP_DUPLICATES ; lobCompressionClause : (COMPRESS (HIGH | MEDIUM | LOW)? | NOCOMPRESS) ; externalPartSubpartDataProps : (DEFAULT DIRECTORY directoryName) (LOCATION LP_ (directoryName COLON_)? locationSpecifier (COMMA_ (directoryName COLON_)? locationSpecifier)* RP_)? ; listPartitions : PARTITION BY LIST columnNames (AUTOMATIC (STORE IN LP_? tablespaceName (COMMA_ tablespaceName)* RP_?))? LP_ PARTITION partitionName? listValuesClause tablePartitionDescription (COMMA_ PARTITION partitionName? listValuesClause tablePartitionDescription externalPartSubpartDataProps?)* RP_ ; listValuesClause : VALUES ( listValues | DEFAULT ) ; listValues : (literals | NULL) (COMMA_ (literals | NULL))* | (LP_? ( (literals | NULL) (COMMA_ (literals | NULL))* ) RP_?) (COMMA_ LP_? ( (literals | NULL) (COMMA_ (literals | NULL))* ) RP_?)* ; hashPartitions : PARTITION BY HASH columnNames (individualHashPartitions | hashPartitionsByQuantity) ; hashPartitionsByQuantity : PARTITIONS INTEGER_ (STORE IN (tablespaceName (COMMA_ tablespaceName)*))? (tableCompression | indexCompression)? (OVERFLOW STORE IN (tablespaceName (COMMA_ tablespaceName)*))? ; indexCompression : prefixCompression | advancedIndexCompression ; advancedIndexCompression : COMPRESS ADVANCED (LOW | HIGH)? | NOCOMPRESS ; individualHashPartitions : LP_? (PARTITION partitionName? readOnlyClause? indexingClause? partitioningStorageClause?) (COMMA_ PARTITION partitionName? readOnlyClause? indexingClause? partitioningStorageClause?)* RP_? ; partitioningStorageClause : ((TABLESPACE tablespaceName | TABLESPACE SET tablespaceSetName) | OVERFLOW (TABLESPACE tablespaceName | TABLESPACE SET tablespaceSetName)? | tableCompression | indexCompression | inmemoryClause | ilmClause | lobPartitioningStorage | VARRAY varrayItem STORE AS (SECUREFILE | BASICFILE)? LOB lobSegname )* ; lobPartitioningStorage :LOB LP_ lobItem RP_ STORE AS (BASICFILE | SECUREFILE)? (lobSegname (LP_ TABLESPACE tablespaceName | TABLESPACE SET tablespaceSetName RP_)? | LP_ TABLESPACE tablespaceName | TABLESPACE SET tablespaceSetName RP_ )? ; compositeRangePartitions : PARTITION BY RANGE columnNames (INTERVAL LP_ expr RP_ (STORE IN LP_? tablespaceName (COMMA_ tablespaceName)* RP_?)?)? (subpartitionByRange | subpartitionByList | subpartitionByHash) LP_? rangePartitionDesc (COMMA_ rangePartitionDesc)* RP_? ; subpartitionByRange : SUBPARTITION BY RANGE columnNames subpartitionTemplate? ; subpartitionByList : SUBPARTITION BY LIST columnNames subpartitionTemplate? ; subpartitionByHash : SUBPARTITION BY HASH columnNames (SUBPARTITIONS NUMBER_ (STORE IN LP_ tablespaceName (COMMA_ tablespaceName)? RP_)? | subpartitionTemplate)? ; subpartitionTemplate : SUBPARTITION TEMPLATE (LP_? rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)* RP_?) | hashSubpartitionQuantity ; rangeSubpartitionDesc : SUBPARTITION subpartitionName? rangeValuesClause readOnlyClause? indexingClause? partitioningStorageClause? externalPartSubpartDataProps? ; listSubpartitionDesc : SUBPARTITION subpartitionName? listValuesClause readOnlyClause? indexingClause? partitioningStorageClause? externalPartSubpartDataProps? ; individualHashSubparts : SUBPARTITION subpartitionName? readOnlyClause? indexingClause? partitioningStorageClause? ; rangePartitionDesc : PARTITION partitionName? rangeValuesClause tablePartitionDescription ((LP_? rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)* RP_?) | hashSubpartitionQuantity)? ; compositeListPartitions : PARTITION BY LIST columnNames (AUTOMATIC (STORE IN LP_? tablespaceName (COMMA_ tablespaceName)* RP_?)?)? (subpartitionByRange | subpartitionByList | subpartitionByHash) LP_? listPartitionDesc (COMMA_ listPartitionDesc)* RP_? ; listPartitionDesc : PARTITIONSET partitionSetName listValuesClause (TABLESPACE SET tablespaceSetName)? lobStorageClause? (SUBPARTITIONS STORE IN LP_? tablespaceSetName (COMMA_ tablespaceSetName)* RP_?)? ; compositeHashPartitions : PARTITION BY HASH columnNames (subpartitionByRange | subpartitionByList | subpartitionByHash) (individualHashPartitions | hashPartitionsByQuantity) ; referencePartitioning :PARTITION BY REFERENCE LP_ constraint RP_ (LP_? referencePartitionDesc (COMMA_ referencePartitionDesc)* RP_?)? ; referencePartitionDesc : PARTITION partitionName? tablePartitionDescription? ; constraint : inlineConstraint | outOfLineConstraint | inlineRefConstraint | outOfLineRefConstraint ; systemPartitioning : PARTITION BY SYSTEM (PARTITIONS NUMBER_ | referencePartitionDesc (COMMA_ referencePartitionDesc)*)? ; consistentHashPartitions : PARTITION BY CONSISTENT HASH columnNames (PARTITIONS AUTO)? TABLESPACE SET tablespaceSetName ; consistentHashWithSubpartitions : PARTITION BY CONSISTENT HASH columnNames (subpartitionByRange | subpartitionByList | subpartitionByHash) (PARTITIONS AUTO)? ; partitionsetClauses : rangePartitionsetClause | listPartitionsetClause ; rangePartitionsetClause : PARTITIONSET BY RANGE columnNames PARTITION BY CONSISTENT HASH columnNames (SUBPARTITION BY ((RANGE | HASH) columnNames | LIST LP_ columnName LP_) subpartitionTemplate?)? PARTITIONS AUTO LP_ rangePartitionsetDesc (COMMA_ rangePartitionsetDesc)* RP_ ; rangePartitionsetDesc : PARTITIONSET partitionSetName rangeValuesClause (TABLESPACE SET tablespaceSetName)? (lobStorageClause)? (SUBPARTITIONS STORE IN tablespaceSetName?)? ; listPartitionsetClause : PARTITIONSET BY RANGE LP_ columnName RP_ PARTITION BY CONSISTENT HASH columnNames (SUBPARTITION BY ((RANGE | HASH) columnNames | LIST LP_ columnName LP_) subpartitionTemplate?)? PARTITIONS AUTO LP_ rangePartitionsetDesc (COMMA_ rangePartitionsetDesc)* RP_ ; attributeClusteringClause : CLUSTERING clusteringJoin? clusterClause clusteringWhen? zonemapClause? ; clusteringJoin : tableName (JOIN tableName ON LP_ expr RP_)+ ; clusterClause : BY (LINEAR | INTERLEAVED)? ORDER clusteringColumns ; clusteringColumns : LP_? clusteringColumnGroup (COMMA_ clusteringColumnGroup)* RP_? ; clusteringColumnGroup : columnNames ; clusteringWhen : ((YES | NO) ON LOAD)? ((YES | NO) ON DATA MOVEMENT)? ; zonemapClause : (WITH MATERIALIZED ZONEMAP (LP_ zonemapName RP_)?) | (WITHOUT MATERIALIZED ZONEMAP) ; rowMovementClause : (ENABLE | DISABLE) ROW MOVEMENT ; flashbackArchiveClause : FLASHBACK ARCHIVE flashbackArchiveName? | NO FLASHBACK ARCHIVE ; alterSynonym : ALTER PUBLIC? SYNONYM (schemaName DOT_)? synonymName (COMPILE | EDITIONABLE | NONEDITIONABLE) ; alterTablePartitioning : modifyTablePartition | moveTablePartition | addTablePartition | coalesceTablePartition | dropTablePartition ; modifyTablePartition : modifyRangePartition | modifyHashPartition | modifyListPartition ; modifyRangePartition : MODIFY partitionExtendedName (partitionAttributes | (addRangeSubpartition | addHashSubpartition | addListSubpartition) | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause) ; modifyHashPartition : MODIFY partitionExtendedName (partitionAttributes | coalesceTableSubpartition | alterMappingTableClauses | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause) ; modifyListPartition : MODIFY partitionExtendedName (partitionAttributes | (ADD | DROP) VALUES LP_ listValues RP_ | (addRangeSubpartition | addHashSubpartition | addListSubpartition) | coalesceTableSubpartition | REBUILD? UNUSABLE LOCAL INDEXES | readOnlyClause | indexingClause) ; partitionExtendedName : PARTITION partitionName | PARTITION FOR LR_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_ ; addRangeSubpartition : ADD rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* dependentTablesClause? updateIndexClauses? ; dependentTablesClause : DEPENDENT TABLES LP_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_ (COMMA_ tableName LP_ partitionSpec (COMMA_ partitionSpec)* RP_)* RP_ ; addHashSubpartition : ADD individualHashSubparts dependentTablesClause? updateIndexClauses? parallelClause? ; addListSubpartition : ADD listSubpartitionDesc (COMMA_ listSubpartitionDesc)* dependentTablesClause? updateIndexClauses? ; coalesceTableSubpartition : COALESCE SUBPARTITION subpartitionName updateIndexClauses? parallelClause? allowDisallowClustering? ; allowDisallowClustering : (ALLOW | DISALLOW) CLUSTERING ; alterMappingTableClauses : MAPPING TABLE (allocateExtentClause | deallocateUnusedClause) ; deallocateUnusedClause : DEALLOCATE UNUSED (KEEP sizeClause)? ; allocateExtentClause : ALLOCATE EXTENT (LP_ (SIZE sizeClause | DATAFILE SQ_ fileName SQ_ | INSTANCE NUMBER_)* RP_)? ; partitionSpec : PARTITION partitionName? tablePartitionDescription? ; partitionAttributes : (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause | shrinkClause)* (OVERFLOW (physicalAttributesClause | loggingClause | allocateExtentClause | deallocateUnusedClause)*)? tableCompression? inmemoryClause? ; shrinkClause : SHRINK SPACE COMPACT? CASCADE? ; moveTablePartition : MOVE partitionExtendedName (MAPPING TABLE)? tablePartitionDescription? filterCondition? updateAllIndexesClause? parallelClause? allowDisallowClustering? ONLINE? ; filterCondition : INCLUDING ROWS whereClause ; whereClause : WHERE expr ; coalesceTablePartition : COALESCE PARTITION updateIndexClauses? parallelClause? allowDisallowClustering? ; addTablePartition : ADD ((PARTITION partitionName? addRangePartitionClause (COMMA_ PARTITION partitionName? addRangePartitionClause)*) | (PARTITION partitionName? addListPartitionClause (COMMA_ PARTITION partitionName? addListPartitionClause)*) | (PARTITION partitionName? addSystemPartitionClause (COMMA_ PARTITION partitionName? addSystemPartitionClause)*) (BEFORE (partitionName | NUMBER_))? | (PARTITION partitionName? addHashPartitionClause) ) dependentTablesClause? ; addRangePartitionClause : rangeValuesClause tablePartitionDescription? externalPartSubpartDataProps? ((LP_? (rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)*) RP_?) | hashSubpartsByQuantity)? updateIndexClauses? ; addListPartitionClause : listValuesClause tablePartitionDescription? externalPartSubpartDataProps? ((LP_? (rangeSubpartitionDesc (COMMA_ rangeSubpartitionDesc)* | listSubpartitionDesc (COMMA_ listSubpartitionDesc)* | individualHashSubparts (COMMA_ individualHashSubparts)*) RP_?) | hashSubpartsByQuantity)? updateIndexClauses? ; hashSubpartsByQuantity : SUBPARTITIONS NUMBER_ (STORE IN LP_ tablespaceName (COMMA_ tablespaceName)* RP_)? ; addSystemPartitionClause : tablePartitionDescription? updateIndexClauses? ; addHashPartitionClause : partitioningStorageClause updateIndexClauses? parallelClause? readOnlyClause? indexingClause? ; dropTablePartition : DROP partitionExtendedNames (updateIndexClauses parallelClause?)? ; partitionExtendedNames : (PARTITION | PARTITIONS) (partitionName | partitionForClauses) (COMMA_ (partitionName | partitionForClauses))* ; partitionForClauses : FOR LP_ partitionKeyValue (COMMA_ partitionKeyValue)* RP_ ; updateIndexClauses : updateGlobalIndexClause | updateAllIndexesClause ; updateGlobalIndexClause : (UPDATE | INVALIDATE) GLOBAL INDEXES ; updateAllIndexesClause : UPDATE INDEXES (LP_ indexName LP_ (updateIndexPartition | updateIndexSubpartition) RP_ (COMMA_ indexName LP_ (updateIndexPartition | updateIndexSubpartition) RP_)* RP_)? ; updateIndexPartition : indexPartitionDesc indexSubpartitionClause? (COMMA_ indexPartitionDesc indexSubpartitionClause?)* ; indexPartitionDesc : PARTITION (partitionName ((segmentAttributesClause | indexCompression)+ | PARAMETERS LP_ SQ_ odciParameters SQ_ RP_ )? usableSpecification? )? ; indexSubpartitionClause : STORE IN LP_ tablespaceName (COMMA_ tablespaceName)* RP_ | LP_ SUBPARTITION subpartitionName? (TABLESPACE tablespaceName)? indexCompression? usableSpecification? (COMMA_ SUBPARTITION subpartitionName? (TABLESPACE tablespaceName)? indexCompression? usableSpecification?)* RP_ ; updateIndexSubpartition : SUBPARTITION subpartitionName? (TABLESPACE tablespaceName)? (COMMA_ SUBPARTITION subpartitionName? (TABLESPACE tablespaceName)?)* ; supplementalLoggingProps : SUPPLEMENTAL LOG supplementalLogGrpClause|supplementalIdKeyClause ; supplementalLogGrpClause : GROUP logGroupName LP_ columnName (NO LOG)? (COMMA_ columnName (NO LOG)?)* RP_ ALWAYS? ; supplementalIdKeyClause : DATA LP_ (ALL | PRIMARY KEY | UNIQUE | FOREIGN KEY) (COMMA_ (ALL | PRIMARY KEY | UNIQUE | FOREIGN KEY))* RP_ COLUMNS ; alterSession : ALTER SESSION alterSessionOption ; alterSessionOption : adviseClause | closeDatabaseLinkClause | commitInProcedureClause | securiyClause | parallelExecutionClause | resumableClause | shardDdlClause | syncWithPrimaryClause | alterSessionSetClause ; adviseClause : ADVISE (COMMIT | ROLLBACK | NOTHING) ; closeDatabaseLinkClause : CLOSE DATABASE LINK dbLink ; commitInProcedureClause : (ENABLE | DISABLE) COMMIT IN PROCEDURE ; securiyClause : (ENABLE | DISABLE) GUARD ; parallelExecutionClause : (ENABLE | DISABLE | FORCE) PARALLEL (DML | DDL | QUERY) (PARALLEL numberLiterals)? ; resumableClause : enableResumableClause | disableResumableClause ; enableResumableClause : ENABLE RESUMABLE (TIMEOUT numberLiterals)? (NAME stringLiterals)? ; disableResumableClause : DISABLE RESUMABLE ; shardDdlClause : (ENABLE | DISABLE) SHARD DDL ; syncWithPrimaryClause : SYNC WITH PRIMARY ; alterSessionSetClause : SET alterSessionSetClauseOption ; alterSessionSetClauseOption : parameterClause | editionClause | containerClause | rowArchivalVisibilityClause | defaultCollationClause ; parameterClause : (parameterName EQ_ parameterValue)+ ; editionClause : EDITION EQ_ editionName ; containerClause : CONTAINER EQ_ containerName (SERVICE EQ_ serviceName)? ; rowArchivalVisibilityClause : ROW ARCHIVAL VISIBILITY EQ_ (ACTIVE | ALL) ; defaultCollationClause : DEFAULT_COLLATION EQ_ (collationName | NONE) ; alterDatabase : ALTER databaseClauses ( startupClauses | recoveryClauses | databaseFileClauses | logfileClauses | controlfileClauses | standbyDatabaseClauses | defaultSettingsClauses | instanceClauses | securityClause | prepareClause | dropMirrorCopy | lostWriteProtection | cdbFleetClauses | propertyClause ) ; databaseClauses : DATABASE databaseName | PLUGGABLE DATABASE pdbName ; startupClauses : MOUNT ((STANDBY | CLONE) DATABASE)? | OPEN ((READ WRITE)? (RESETLOGS | NORESETLOGS)? (UPGRADE | DOWNGRADE)? | READ ONLY) ; recoveryClauses : generalRecovery | managedStandbyRecovery | BEGIN BACKUP | END BACKUP ; generalRecovery : RECOVER (AUTOMATIC)? (FROM locationName)? ( (fullDatabaseRecovery | partialDatabaseRecovery | LOGFILE fileName) ((TEST | ALLOW NUMBER_ CORRUPTION | parallelClause)+)? | CONTINUE DEFAULT? | CANCEL ) ; fullDatabaseRecovery : STANDBY? DATABASE ((UNTIL (CANCEL | TIME dateValue | CHANGE NUMBER_ | CONSISTENT) | USING BACKUP CONTROLFILE | SNAPSHOT TIME dateValue )+)? ; partialDatabaseRecovery : TABLESPACE tablespaceName (COMMA_ tablespaceName)* | DATAFILE (fileName | fileNumber) (COMMA_ (fileName | fileNumber))* ; managedStandbyRecovery : RECOVER (MANAGED STANDBY DATABASE ((USING ARCHIVED LOGFILE | DISCONNECT (FROM SESSION)? | NODELAY | UNTIL CHANGE NUMBER_ | UNTIL CONSISTENT | USING INSTANCES (ALL | NUMBER_) | parallelClause)+ | FINISH | CANCEL)? | TO LOGICAL STANDBY (databaseName | KEEP IDENTITY)) ; databaseFileClauses : RENAME FILE fileName (COMMA_ fileName)* TO fileName | createDatafileClause | alterDatafileClause | alterTempfileClause | moveDatafileClause ; createDatafileClause : CREATE DATAFILE (fileName | fileNumber) (COMMA_ (fileName | fileNumber))* ( AS (fileSpecification (COMMA_ fileSpecification)* | NEW))? ; fileSpecification : datafileTempfileSpec | redoLogFileSpec ; datafileTempfileSpec : (fileName | asmFileName )? (SIZE sizeClause)? REUSE? autoextendClause? ; autoextendClause : AUTOEXTEND (OFF | ON (NEXT sizeClause)? maxsizeClause?) ; redoLogFileSpec : ((fileName | asmFileName) | LP_ (fileName | asmFileName) (COMMA_ (fileName | asmFileName))* RP_)? (SIZE sizeClause)? (BLOCKSIZE sizeClause)? REUSE? ; alterDatafileClause : DATAFILE (fileName | NUMBER_) (COMMA_ (fileName | NUMBER_))* (ONLINE | OFFLINE (FOR DROP)? | RESIZE sizeClause | autoextendClause | END BACKUP | ENCRYPT | DECRYPT) ; alterTempfileClause : TEMPFILE (fileName | NUMBER_) (COMMA_ (fileName | NUMBER_))* (RESIZE sizeClause | autoextendClause | DROP (INCLUDING DATAFILES)? | ONLINE | OFFLINE) ; logfileClauses : ((ARCHIVELOG MANUAL? | NOARCHIVELOG ) | NO? FORCE LOGGING | SET STANDBY NOLOGGING FOR (DATA AVAILABILITY | LOAD PERFORMANCE) | RENAME FILE fileName (COMMA_ fileName)* TO fileName | CLEAR UNARCHIVED? LOGFILE logfileDescriptor (COMMA_ logfileDescriptor)* (UNRECOVERABLE DATAFILE)? | addLogfileClauses | dropLogfileClauses | switchLogfileClause | supplementalDbLogging) ; logfileDescriptor : GROUP NUMBER_ | LP_ fileName (COMMA_ fileName)* RP_ | fileName ; addLogfileClauses : ADD STANDBY? LOGFILE (((INSTANCE instanceName)? | (THREAD SQ_ NUMBER_ SQ_)?) (GROUP NUMBER_)? redoLogFileSpec (COMMA_ (GROUP NUMBER_)? redoLogFileSpec)* | MEMBER fileName REUSE? (COMMA_ fileName REUSE?)* TO logfileDescriptor (COMMA_ logfileDescriptor)*) ; controlfileClauses : CREATE ((LOGICAL | PHYSICAL)? STANDBY | FAR SYNC INSTANCE) CONTROLFILE AS fileName REUSE? | BACKUP CONTROLFILE TO (fileName REUSE? | traceFileClause) ; traceFileClause : TRACE (AS fileName REUSE?)? (RESETLOGS | NORESETLOGS)? ; dropLogfileClauses : DROP STANDBY? LOGFILE (logfileDescriptor (COMMA_ logfileDescriptor)* | MEMBER fileName (COMMA_ fileName)*) ; switchLogfileClause : SWITCH ALL LOGFILES TO BLOCKSIZE NUMBER_ ; supplementalDbLogging : (ADD | DROP) SUPPLEMENTAL LOG ( DATA | supplementalIdKeyClause | supplementalPlsqlClause | supplementalSubsetReplicationClause) ; supplementalPlsqlClause : DATA FOR PROCEDURAL REPLICATION ; supplementalSubsetReplicationClause : DATA SUBSET DATABASE REPLICATION ; standbyDatabaseClauses : ((activateStandbyDbClause | maximizeStandbyDbClause | registerLogfileClause | commitSwitchoverClause | startStandbyClause | stopStandbyClause | convertDatabaseClause) parallelClause?) | (switchoverClause | failoverClause) ; activateStandbyDbClause : ACTIVATE (PHYSICAL | LOGICAL)? STANDBY DATABASE (FINISH APPLY)? ; maximizeStandbyDbClause : SET STANDBY DATABASE TO MAXIMIZE (PROTECTION | AVAILABILITY | PERFORMANCE) ; registerLogfileClause : REGISTER (OR REPLACE)? (PHYSICAL | LOGICAL)? LOGFILE fileSpecification (COMMA_ fileSpecification)* (FOR logminerSessionName)? ; commitSwitchoverClause : (PREPARE | COMMIT) TO SWITCHOVER ( TO (((PHYSICAL | LOGICAL)? PRIMARY | PHYSICAL? STANDBY) ((WITH | WITHOUT) SESSION SHUTDOWN (WAIT | NOWAIT))? | LOGICAL STANDBY) | CANCEL )? ; startStandbyClause : START LOGICAL STANDBY APPLY IMMEDIATE? NODELAY? (NEW PRIMARY dbLink | INITIAL scnValue? | (SKIP_SYMBOL FAILED TRANSACTION | FINISH))? ; scnValue : literals ; stopStandbyClause : (STOP | ABORT) LOGICAL STANDBY APPLY ; switchoverClause : SWITCHOVER TO databaseName (VERIFY | FORCE)? ; convertDatabaseClause : CONVERT TO (PHYSICAL | SNAPSHOT) STANDBY ; failoverClause : FAILOVER TO databaseName FORCE? ; defaultSettingsClauses : DEFAULT EDITION EQ_ editionName | SET DEFAULT (BIGFILE | SMALLFILE) TABLESPACE | DEFAULT TABLESPACE tablespaceName | DEFAULT LOCAL? TEMPORARY TABLESPACE (tablespaceName | tablespaceGroupName) | RENAME GLOBAL_NAME TO databaseName DOT_ domain (DOT_ domain)* | ENABLE BLOCK CHANGE TRACKING (USING FILE fileName REUSE?)? | DISABLE BLOCK CHANGE TRACKING | NO? FORCE FULL DATABASE CACHING | CONTAINERS DEFAULT TARGET EQ_ (LP_ containerName RP_ | NONE) | flashbackModeClause | undoModeClause | setTimeZoneClause ; setTimeZoneClause : SET TIME_ZONE EQ_ SQ_ ( (PLUS_ | MINUS_) dateValue | timeZoneRegion ) SQ_ ; timeZoneRegion : STRING_ ; flashbackModeClause : FLASHBACK (ON | OFF) ; undoModeClause : LOCAL UNDO (ON | OFF) ; moveDatafileClause : MOVE DATAFILE LP_ (fileName | asmFileName | fileNumber) RP_ (TO LP_ (fileName | asmFileName) RP_ )? REUSE? KEEP? ; instanceClauses : (ENABLE | DISABLE) INSTANCE instanceName ; securityClause : GUARD (ALL | STANDBY | NONE) ; prepareClause : PREPARE MIRROR COPY copyName (WITH (UNPROTECTED | MIRROR | HIGH) REDUNDANCY)? ; dropMirrorCopy : DROP MIRROR COPY mirrorName ; lostWriteProtection : (ENABLE | DISABLE | REMOVE | SUSPEND)? LOST WRITE PROTECTION ; cdbFleetClauses : leadCdbClause | leadCdbUriClause ; leadCdbClause : SET LEAD_CDB EQ_ (TRUE | FALSE) ; leadCdbUriClause : SET LEAD_CDB_URI EQ_ uriString ; propertyClause : PROPERTY (SET | REMOVE) DEFAULT_CREDENTIAL EQ_ qualifiedCredentialName ; alterSystem : ALTER SYSTEM alterSystemOption ; alterSystemOption : archiveLogClause | checkpointClause | checkDatafilesClause | distributedRecovClauses | flushClause | endSessionClauses | alterSystemSwitchLogfileClause | suspendResumeClause | quiesceClauses | rollingMigrationClauses | rollingPatchClauses | alterSystemSecurityClauses | affinityClauses | shutdownDispatcherClause | registerClause | setClause | resetClause | relocateClientClause | cancelSqlClause | flushPasswordfileMetadataCacheClause ; archiveLogClause : ARCHIVE LOG instanceClause? (sequenceClause | changeClause | currentClause | groupClause | logfileClause | nextClause | allClause) toLocationClause? ; checkpointClause : CHECKPOINT (GLOBAL | LOCAL)? ; checkDatafilesClause : CHECK DATAFILES (GLOBAL | LOCAL)? ; distributedRecovClauses : (ENABLE | DISABLE) DISTRIBUTED RECOVERY ; flushClause : FLUSH flushClauseOption ; endSessionClauses : (disconnectSessionClause | killSessionClause) (IMMEDIATE | NOREPLY)? ; alterSystemSwitchLogfileClause : SWITCH LOGFILE ; suspendResumeClause : SUSPEND | RESUME ; quiesceClauses : QUIESCE RESTRICTED | UNQUIESCE ; rollingMigrationClauses : startRollingMigrationClause | stopRollingMigrationClause ; rollingPatchClauses : startRollingPatchClause | stopRollingPatchClause ; alterSystemSecurityClauses : restrictedSessionClause | setEncryptionWalletOpenClause | setEncryptionWalletCloseClause | setEncryptionKeyClause ; affinityClauses : enableAffinityClause | disableAffinityClause ; shutdownDispatcherClause : SHUTDOWN IMMEDIATE? dispatcherName ; registerClause : REGISTER ; setClause : SET alterSystemSetClause+ ; resetClause : RESET alterSystemResetClause+ ; relocateClientClause : RELOCATE CLIENT clientId ; cancelSqlClause : CANCEL SQL SQ_ sessionId serialNumber (AT_ instanceId)? sqlId? SQ_ ; flushPasswordfileMetadataCacheClause : FLUSH PASSWORDFILE_METADATA_CACHE ; instanceClause : INSTANCE instanceName ; sequenceClause : SEQUENCE INTEGER_ ; changeClause : CHANGE INTEGER_ ; currentClause : CURRENT NOSWITCH? ; groupClause : GROUP INTEGER_ ; logfileClause : LOGFILE logFileName (USING BACKUP CONTROLFILE)? ; nextClause : NEXT ; allClause : ALL ; toLocationClause : TO logFileGroupsArchivedLocationName ; flushClauseOption : sharedPoolClause | globalContextClause | bufferCacheClause | flashCacheClause | redoToClause ; disconnectSessionClause : DISCONNECT SESSION SQ_ INTEGER_ COMMA_ INTEGER_ SQ_ POST_TRANSACTION? ; killSessionClause : KILL SESSION SQ_ INTEGER_ COMMA_ INTEGER_ (COMMA_ AT_ INTEGER_)? SQ_ ; startRollingMigrationClause : START ROLLING MIGRATION TO asmVersion ; stopRollingMigrationClause : STOP ROLLING MIGRATION ; startRollingPatchClause : START ROLLING PATCH ; stopRollingPatchClause : STOP ROLLING PATCH ; restrictedSessionClause : (ENABLE | DISABLE) RESTRICTED SESSION ; setEncryptionWalletOpenClause : SET ENCRYPTION WALLET OPEN IDENTIFIED BY (walletPassword | hsmAuthString) ; setEncryptionWalletCloseClause : SET ENCRYPTION WALLET CLOSE (IDENTIFIED BY (walletPassword | hsmAuthString))? ; setEncryptionKeyClause : SET ENCRYPTION KEY (identifiedByWalletPassword | identifiedByHsmAuthString) ; enableAffinityClause : ENABLE AFFINITY tableName (SERVICE serviceName)? ; disableAffinityClause : DISABLE AFFINITY tableName ; alterSystemSetClause : setParameterClause | useStoredOutlinesClause | globalTopicEnabledClause ; alterSystemResetClause : parameterName scopeClause* ; sharedPoolClause : SHARED_POOL ; globalContextClause : GLOBAL CONTEXT ; bufferCacheClause : BUFFER_CACHE ; flashCacheClause : FLASH_CACHE ; redoToClause : REDO TO targetDbName (NO? CONFIRM APPLY)? ; identifiedByWalletPassword : certificateId? IDENTIFIED BY walletPassword ; identifiedByHsmAuthString : IDENTIFIED BY hsmAuthString (MIGRATE USING walletPassword)? ; setParameterClause : parameterName EQ_ parameterValue (COMMA_ parameterValue)* alterSystemCommentClause? DEFERRED? containerCurrentAllClause? scopeClause* ; useStoredOutlinesClause : USE_STORED_OUTLINES EQ_ (TRUE | FALSE | categoryName) ; globalTopicEnabledClause : GLOBAL_TOPIC_ENABLED EQ_ (TRUE | FALSE) ; alterSystemCommentClause : COMMENT EQ_ stringLiterals ; containerCurrentAllClause : CONTAINER EQ_ (CURRENT | ALL) ; scopeClause : SCOPE EQ_ (MEMORY | SPFILE | BOTH) | SID EQ_ (SQ_ sessionId SQ_ | SQ_ ASTERISK_ SQ_) ; analyze : (ANALYZE ((TABLE tableName| INDEX indexName) partitionExtensionClause? | CLUSTER clusterName)) (validationClauses | LIST CHAINED ROWS intoClause? | DELETE SYSTEM? STATISTICS) ; partitionExtensionClause : PARTITION (LP_ partitionName RP_ | FOR LP_ partitionKeyValue (COMMA_ partitionKeyValue) RP_) | SUBPARTITION (LP_ subpartitionName RP_ | FOR LP_ subpartitionKeyValue (COMMA_ subpartitionKeyValue) RP_) ; validationClauses : VALIDATE REF UPDATE (SET DANGLING TO NULL)? | VALIDATE STRUCTURE (CASCADE (FAST | COMPLETE (OFFLINE | ONLINE) intoClause?))? ; intoClause : INTO tableName ; associateStatistics : ASSOCIATE STATISTICS WITH (columnAssociation | functionAssociation) storageTableClause? ; columnAssociation : COLUMNS tableName DOT_ columnName (COMMA_ tableName DOT_ columnName)* usingStatisticsType ; functionAssociation : (FUNCTIONS function (COMMA_ function)* | PACKAGES packageName (COMMA_ packageName)* | TYPES typeName (COMMA_ typeName)* | INDEXES indexName (COMMA_ indexName)* | INDEXTYPES indexTypeName (COMMA_ indexTypeName)*) (usingStatisticsType | defaultCostClause (COMMA_ defaultSelectivityClause)? | defaultSelectivityClause (COMMA_ defaultCostClause)?) ; storageTableClause : WITH (SYSTEM | USER) MANAGED STORAGE TABLES ; usingStatisticsType : USING (statisticsTypeName | NULL) ; defaultCostClause : DEFAULT COST LP_ cpuCost COMMA_ ioCost COMMA_ networkCost RP_ ; defaultSelectivityClause : DEFAULT SELECTIVITY defaultSelectivity ; ",12332,False,2469.3663050479477,median "TITLE ../openssl/crypto/ripemd/asm/rmd-586.asm IF @Version LT 800 ECHO MASM version 8.00 or later is strongly recommended. ENDIF .686 .MODEL FLAT OPTION DOTNAME IF @Version LT 800 .text$ SEGMENT PAGE 'CODE' ELSE .text$ SEGMENT ALIGN(64) 'CODE' ENDIF ALIGN 16 _ripemd160_block_asm_data_order PROC PUBLIC $L_ripemd160_block_asm_data_order_begin:: mov edx,DWORD PTR 4[esp] mov eax,DWORD PTR 8[esp] push esi mov ecx,DWORD PTR [edx] push edi mov esi,DWORD PTR 4[edx] push ebp mov edi,DWORD PTR 8[edx] push ebx sub esp,108 $L000start: ; mov ebx,DWORD PTR [eax] mov ebp,DWORD PTR 4[eax] mov DWORD PTR [esp],ebx mov DWORD PTR 4[esp],ebp mov ebx,DWORD PTR 8[eax] mov ebp,DWORD PTR 12[eax] mov DWORD PTR 8[esp],ebx mov DWORD PTR 12[esp],ebp mov ebx,DWORD PTR 16[eax] mov ebp,DWORD PTR 20[eax] mov DWORD PTR 16[esp],ebx mov DWORD PTR 20[esp],ebp mov ebx,DWORD PTR 24[eax] mov ebp,DWORD PTR 28[eax] mov DWORD PTR 24[esp],ebx mov DWORD PTR 28[esp],ebp mov ebx,DWORD PTR 32[eax] mov ebp,DWORD PTR 36[eax] mov DWORD PTR 32[esp],ebx mov DWORD PTR 36[esp],ebp mov ebx,DWORD PTR 40[eax] mov ebp,DWORD PTR 44[eax] mov DWORD PTR 40[esp],ebx mov DWORD PTR 44[esp],ebp mov ebx,DWORD PTR 48[eax] mov ebp,DWORD PTR 52[eax] mov DWORD PTR 48[esp],ebx mov DWORD PTR 52[esp],ebp mov ebx,DWORD PTR 56[eax] mov ebp,DWORD PTR 60[eax] mov DWORD PTR 56[esp],ebx mov DWORD PTR 60[esp],ebp mov eax,edi mov ebx,DWORD PTR 12[edx] mov ebp,DWORD PTR 16[edx] ; 0 xor eax,ebx mov edx,DWORD PTR [esp] xor eax,esi add ecx,edx rol edi,10 add ecx,eax mov eax,esi rol ecx,11 add ecx,ebp ; 1 xor eax,edi mov edx,DWORD PTR 4[esp] xor eax,ecx add ebp,eax mov eax,ecx rol esi,10 add ebp,edx xor eax,esi rol ebp,14 add ebp,ebx ; 2 mov edx,DWORD PTR 8[esp] xor eax,ebp add ebx,edx rol ecx,10 add ebx,eax mov eax,ebp rol ebx,15 add ebx,edi ; 3 xor eax,ecx mov edx,DWORD PTR 12[esp] xor eax,ebx add edi,eax mov eax,ebx rol ebp,10 add edi,edx xor eax,ebp rol edi,12 add edi,esi ; 4 mov edx,DWORD PTR 16[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,5 add esi,ecx ; 5 xor eax,ebx mov edx,DWORD PTR 20[esp] xor eax,esi add ecx,eax mov eax,esi rol edi,10 add ecx,edx xor eax,edi rol ecx,8 add ecx,ebp ; 6 mov edx,DWORD PTR 24[esp] xor eax,ecx add ebp,edx rol esi,10 add ebp,eax mov eax,ecx rol ebp,7 add ebp,ebx ; 7 xor eax,esi mov edx,DWORD PTR 28[esp] xor eax,ebp add ebx,eax mov eax,ebp rol ecx,10 add ebx,edx xor eax,ecx rol ebx,9 add ebx,edi ; 8 mov edx,DWORD PTR 32[esp] xor eax,ebx add edi,edx rol ebp,10 add edi,eax mov eax,ebx rol edi,11 add edi,esi ; 9 xor eax,ebp mov edx,DWORD PTR 36[esp] xor eax,edi add esi,eax mov eax,edi rol ebx,10 add esi,edx xor eax,ebx rol esi,13 add esi,ecx ; 10 mov edx,DWORD PTR 40[esp] xor eax,esi add ecx,edx rol edi,10 add ecx,eax mov eax,esi rol ecx,14 add ecx,ebp ; 11 xor eax,edi mov edx,DWORD PTR 44[esp] xor eax,ecx add ebp,eax mov eax,ecx rol esi,10 add ebp,edx xor eax,esi rol ebp,15 add ebp,ebx ; 12 mov edx,DWORD PTR 48[esp] xor eax,ebp add ebx,edx rol ecx,10 add ebx,eax mov eax,ebp rol ebx,6 add ebx,edi ; 13 xor eax,ecx mov edx,DWORD PTR 52[esp] xor eax,ebx add edi,eax mov eax,ebx rol ebp,10 add edi,edx xor eax,ebp rol edi,7 add edi,esi ; 14 mov edx,DWORD PTR 56[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,9 add esi,ecx ; 15 xor eax,ebx mov edx,DWORD PTR 60[esp] xor eax,esi add ecx,eax mov eax,-1 rol edi,10 add ecx,edx mov edx,DWORD PTR 28[esp] rol ecx,8 add ecx,ebp ; 16 add ebp,edx mov edx,esi sub eax,ecx and edx,ecx and eax,edi or edx,eax mov eax,DWORD PTR 16[esp] rol esi,10 lea ebp,DWORD PTR 1518500249[edx*1+ebp] mov edx,-1 rol ebp,7 add ebp,ebx ; 17 add ebx,eax mov eax,ecx sub edx,ebp and eax,ebp and edx,esi or eax,edx mov edx,DWORD PTR 52[esp] rol ecx,10 lea ebx,DWORD PTR 1518500249[eax*1+ebx] mov eax,-1 rol ebx,6 add ebx,edi ; 18 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 4[esp] rol ebp,10 lea edi,DWORD PTR 1518500249[edx*1+edi] mov edx,-1 rol edi,8 add edi,esi ; 19 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 40[esp] rol ebx,10 lea esi,DWORD PTR 1518500249[eax*1+esi] mov eax,-1 rol esi,13 add esi,ecx ; 20 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 24[esp] rol edi,10 lea ecx,DWORD PTR 1518500249[edx*1+ecx] mov edx,-1 rol ecx,11 add ecx,ebp ; 21 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,DWORD PTR 60[esp] rol esi,10 lea ebp,DWORD PTR 1518500249[eax*1+ebp] mov eax,-1 rol ebp,9 add ebp,ebx ; 22 add ebx,edx mov edx,ecx sub eax,ebp and edx,ebp and eax,esi or edx,eax mov eax,DWORD PTR 12[esp] rol ecx,10 lea ebx,DWORD PTR 1518500249[edx*1+ebx] mov edx,-1 rol ebx,7 add ebx,edi ; 23 add edi,eax mov eax,ebp sub edx,ebx and eax,ebx and edx,ecx or eax,edx mov edx,DWORD PTR 48[esp] rol ebp,10 lea edi,DWORD PTR 1518500249[eax*1+edi] mov eax,-1 rol edi,15 add edi,esi ; 24 add esi,edx mov edx,ebx sub eax,edi and edx,edi and eax,ebp or edx,eax mov eax,DWORD PTR [esp] rol ebx,10 lea esi,DWORD PTR 1518500249[edx*1+esi] mov edx,-1 rol esi,7 add esi,ecx ; 25 add ecx,eax mov eax,edi sub edx,esi and eax,esi and edx,ebx or eax,edx mov edx,DWORD PTR 36[esp] rol edi,10 lea ecx,DWORD PTR 1518500249[eax*1+ecx] mov eax,-1 rol ecx,12 add ecx,ebp ; 26 add ebp,edx mov edx,esi sub eax,ecx and edx,ecx and eax,edi or edx,eax mov eax,DWORD PTR 20[esp] rol esi,10 lea ebp,DWORD PTR 1518500249[edx*1+ebp] mov edx,-1 rol ebp,15 add ebp,ebx ; 27 add ebx,eax mov eax,ecx sub edx,ebp and eax,ebp and edx,esi or eax,edx mov edx,DWORD PTR 8[esp] rol ecx,10 lea ebx,DWORD PTR 1518500249[eax*1+ebx] mov eax,-1 rol ebx,9 add ebx,edi ; 28 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 56[esp] rol ebp,10 lea edi,DWORD PTR 1518500249[edx*1+edi] mov edx,-1 rol edi,11 add edi,esi ; 29 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 44[esp] rol ebx,10 lea esi,DWORD PTR 1518500249[eax*1+esi] mov eax,-1 rol esi,7 add esi,ecx ; 30 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 32[esp] rol edi,10 lea ecx,DWORD PTR 1518500249[edx*1+ecx] mov edx,-1 rol ecx,13 add ecx,ebp ; 31 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1518500249[eax*1+ebp] sub edx,ecx rol ebp,12 add ebp,ebx ; 32 mov eax,DWORD PTR 12[esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[edx*1+ebx] sub eax,ebp rol ebx,11 add ebx,edi ; 33 mov edx,DWORD PTR 40[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1859775393[eax*1+edi] sub edx,ebx rol edi,13 add edi,esi ; 34 mov eax,DWORD PTR 56[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1859775393[edx*1+esi] sub eax,edi rol esi,6 add esi,ecx ; 35 mov edx,DWORD PTR 16[esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1859775393[eax*1+ecx] sub edx,esi rol ecx,7 add ecx,ebp ; 36 mov eax,DWORD PTR 36[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1859775393[edx*1+ebp] sub eax,ecx rol ebp,14 add ebp,ebx ; 37 mov edx,DWORD PTR 60[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[eax*1+ebx] sub edx,ebp rol ebx,9 add ebx,edi ; 38 mov eax,DWORD PTR 32[esp] or edx,ebx add edi,eax xor edx,ecx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 1859775393[edx*1+edi] sub eax,ebx rol edi,13 add edi,esi ; 39 mov edx,DWORD PTR 4[esp] or eax,edi add esi,edx xor eax,ebp mov edx,-1 rol ebx,10 lea esi,DWORD PTR 1859775393[eax*1+esi] sub edx,edi rol esi,15 add esi,ecx ; 40 mov eax,DWORD PTR 8[esp] or edx,esi add ecx,eax xor edx,ebx mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1859775393[edx*1+ecx] sub eax,esi rol ecx,14 add ecx,ebp ; 41 mov edx,DWORD PTR 28[esp] or eax,ecx add ebp,edx xor eax,edi mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1859775393[eax*1+ebp] sub edx,ecx rol ebp,8 add ebp,ebx ; 42 mov eax,DWORD PTR [esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[edx*1+ebx] sub eax,ebp rol ebx,13 add ebx,edi ; 43 mov edx,DWORD PTR 24[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1859775393[eax*1+edi] sub edx,ebx rol edi,6 add edi,esi ; 44 mov eax,DWORD PTR 52[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1859775393[edx*1+esi] sub eax,edi rol esi,5 add esi,ecx ; 45 mov edx,DWORD PTR 44[esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1859775393[eax*1+ecx] sub edx,esi rol ecx,12 add ecx,ebp ; 46 mov eax,DWORD PTR 20[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1859775393[edx*1+ebp] sub eax,ecx rol ebp,7 add ebp,ebx ; 47 mov edx,DWORD PTR 48[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[eax*1+ebx] mov eax,ecx rol ebx,5 add ebx,edi ; 48 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 4[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,11 add edi,esi ; 49 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 36[esp] rol ebx,10 lea esi,DWORD PTR 2400959708[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,12 add esi,ecx ; 50 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 44[esp] rol edi,10 lea ecx,DWORD PTR 2400959708[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,14 add ecx,ebp ; 51 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 40[esp] rol esi,10 lea ebp,DWORD PTR 2400959708[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,15 add ebp,ebx ; 52 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR [esp] rol ecx,10 lea ebx,DWORD PTR 2400959708[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,14 add ebx,edi ; 53 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 32[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,15 add edi,esi ; 54 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 48[esp] rol ebx,10 lea esi,DWORD PTR 2400959708[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,9 add esi,ecx ; 55 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 16[esp] rol edi,10 lea ecx,DWORD PTR 2400959708[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,8 add ecx,ebp ; 56 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 52[esp] rol esi,10 lea ebp,DWORD PTR 2400959708[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,9 add ebp,ebx ; 57 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 12[esp] rol ecx,10 lea ebx,DWORD PTR 2400959708[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,14 add ebx,edi ; 58 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 28[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,5 add edi,esi ; 59 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 60[esp] rol ebx,10 lea esi,DWORD PTR 2400959708[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,6 add esi,ecx ; 60 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 56[esp] rol edi,10 lea ecx,DWORD PTR 2400959708[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,8 add ecx,ebp ; 61 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 20[esp] rol esi,10 lea ebp,DWORD PTR 2400959708[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,6 add ebp,ebx ; 62 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 24[esp] rol ecx,10 lea ebx,DWORD PTR 2400959708[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,5 add ebx,edi ; 63 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 8[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax sub edx,ebp rol edi,12 add edi,esi ; 64 mov eax,DWORD PTR 16[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 2840853838[edx*1+esi] sub eax,ebx rol esi,9 add esi,ecx ; 65 mov edx,DWORD PTR [esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 2840853838[eax*1+ecx] sub edx,edi rol ecx,15 add ecx,ebp ; 66 mov eax,DWORD PTR 20[esp] or edx,esi add ebp,eax xor edx,ecx mov eax,-1 rol esi,10 lea ebp,DWORD PTR 2840853838[edx*1+ebp] sub eax,esi rol ebp,5 add ebp,ebx ; 67 mov edx,DWORD PTR 36[esp] or eax,ecx add ebx,edx xor eax,ebp mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 2840853838[eax*1+ebx] sub edx,ecx rol ebx,11 add ebx,edi ; 68 mov eax,DWORD PTR 28[esp] or edx,ebp add edi,eax xor edx,ebx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 2840853838[edx*1+edi] sub eax,ebp rol edi,6 add edi,esi ; 69 mov edx,DWORD PTR 48[esp] or eax,ebx add esi,edx xor eax,edi mov edx,-1 rol ebx,10 lea esi,DWORD PTR 2840853838[eax*1+esi] sub edx,ebx rol esi,8 add esi,ecx ; 70 mov eax,DWORD PTR 8[esp] or edx,edi add ecx,eax xor edx,esi mov eax,-1 rol edi,10 lea ecx,DWORD PTR 2840853838[edx*1+ecx] sub eax,edi rol ecx,13 add ecx,ebp ; 71 mov edx,DWORD PTR 40[esp] or eax,esi add ebp,edx xor eax,ecx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 2840853838[eax*1+ebp] sub edx,esi rol ebp,12 add ebp,ebx ; 72 mov eax,DWORD PTR 56[esp] or edx,ecx add ebx,eax xor edx,ebp mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 2840853838[edx*1+ebx] sub eax,ecx rol ebx,5 add ebx,edi ; 73 mov edx,DWORD PTR 4[esp] or eax,ebp add edi,edx xor eax,ebx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 2840853838[eax*1+edi] sub edx,ebp rol edi,12 add edi,esi ; 74 mov eax,DWORD PTR 12[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 2840853838[edx*1+esi] sub eax,ebx rol esi,13 add esi,ecx ; 75 mov edx,DWORD PTR 32[esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 2840853838[eax*1+ecx] sub edx,edi rol ecx,14 add ecx,ebp ; 76 mov eax,DWORD PTR 44[esp] or edx,esi add ebp,eax xor edx,ecx mov eax,-1 rol esi,10 lea ebp,DWORD PTR 2840853838[edx*1+ebp] sub eax,esi rol ebp,11 add ebp,ebx ; 77 mov edx,DWORD PTR 24[esp] or eax,ecx add ebx,edx xor eax,ebp mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 2840853838[eax*1+ebx] sub edx,ecx rol ebx,8 add ebx,edi ; 78 mov eax,DWORD PTR 60[esp] or edx,ebp add edi,eax xor edx,ebx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 2840853838[edx*1+edi] sub eax,ebp rol edi,5 add edi,esi ; 79 mov edx,DWORD PTR 52[esp] or eax,ebx add esi,edx xor eax,edi mov edx,DWORD PTR 128[esp] rol ebx,10 lea esi,DWORD PTR 2840853838[eax*1+esi] mov DWORD PTR 64[esp],ecx rol esi,6 add esi,ecx mov ecx,DWORD PTR [edx] mov DWORD PTR 68[esp],esi mov DWORD PTR 72[esp],edi mov esi,DWORD PTR 4[edx] mov DWORD PTR 76[esp],ebx mov edi,DWORD PTR 8[edx] mov DWORD PTR 80[esp],ebp mov ebx,DWORD PTR 12[edx] mov ebp,DWORD PTR 16[edx] ; 80 mov edx,-1 sub edx,ebx mov eax,DWORD PTR 20[esp] or edx,edi add ecx,eax xor edx,esi mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[edx*1+ecx] sub eax,edi rol ecx,8 add ecx,ebp ; 81 mov edx,DWORD PTR 56[esp] or eax,esi add ebp,edx xor eax,ecx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1352829926[eax*1+ebp] sub edx,esi rol ebp,9 add ebp,ebx ; 82 mov eax,DWORD PTR 28[esp] or edx,ecx add ebx,eax xor edx,ebp mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1352829926[edx*1+ebx] sub eax,ecx rol ebx,9 add ebx,edi ; 83 mov edx,DWORD PTR [esp] or eax,ebp add edi,edx xor eax,ebx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1352829926[eax*1+edi] sub edx,ebp rol edi,11 add edi,esi ; 84 mov eax,DWORD PTR 36[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1352829926[edx*1+esi] sub eax,ebx rol esi,13 add esi,ecx ; 85 mov edx,DWORD PTR 8[esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[eax*1+ecx] sub edx,edi rol ecx,15 add ecx,ebp ; 86 mov eax,DWORD PTR 44[esp] or edx,esi add ebp,eax xor edx,ecx mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1352829926[edx*1+ebp] sub eax,esi rol ebp,15 add ebp,ebx ; 87 mov edx,DWORD PTR 16[esp] or eax,ecx add ebx,edx xor eax,ebp mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1352829926[eax*1+ebx] sub edx,ecx rol ebx,5 add ebx,edi ; 88 mov eax,DWORD PTR 52[esp] or edx,ebp add edi,eax xor edx,ebx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 1352829926[edx*1+edi] sub eax,ebp rol edi,7 add edi,esi ; 89 mov edx,DWORD PTR 24[esp] or eax,ebx add esi,edx xor eax,edi mov edx,-1 rol ebx,10 lea esi,DWORD PTR 1352829926[eax*1+esi] sub edx,ebx rol esi,7 add esi,ecx ; 90 mov eax,DWORD PTR 60[esp] or edx,edi add ecx,eax xor edx,esi mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[edx*1+ecx] sub eax,edi rol ecx,8 add ecx,ebp ; 91 mov edx,DWORD PTR 32[esp] or eax,esi add ebp,edx xor eax,ecx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1352829926[eax*1+ebp] sub edx,esi rol ebp,11 add ebp,ebx ; 92 mov eax,DWORD PTR 4[esp] or edx,ecx add ebx,eax xor edx,ebp mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1352829926[edx*1+ebx] sub eax,ecx rol ebx,14 add ebx,edi ; 93 mov edx,DWORD PTR 40[esp] or eax,ebp add edi,edx xor eax,ebx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1352829926[eax*1+edi] sub edx,ebp rol edi,14 add edi,esi ; 94 mov eax,DWORD PTR 12[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1352829926[edx*1+esi] sub eax,ebx rol esi,12 add esi,ecx ; 95 mov edx,DWORD PTR 48[esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[eax*1+ecx] mov eax,edi rol ecx,6 add ecx,ebp ; 96 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 24[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,9 add ebp,ebx ; 97 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 44[esp] rol ecx,10 lea ebx,DWORD PTR 1548603684[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,13 add ebx,edi ; 98 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 12[esp] rol ebp,10 lea edi,DWORD PTR 1548603684[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,15 add edi,esi ; 99 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 28[esp] rol ebx,10 lea esi,DWORD PTR 1548603684[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,7 add esi,ecx ; 100 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR [esp] rol edi,10 lea ecx,DWORD PTR 1548603684[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,12 add ecx,ebp ; 101 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 52[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,8 add ebp,ebx ; 102 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 20[esp] rol ecx,10 lea ebx,DWORD PTR 1548603684[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,9 add ebx,edi ; 103 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 40[esp] rol ebp,10 lea edi,DWORD PTR 1548603684[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,11 add edi,esi ; 104 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 56[esp] rol ebx,10 lea esi,DWORD PTR 1548603684[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,7 add esi,ecx ; 105 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 60[esp] rol edi,10 lea ecx,DWORD PTR 1548603684[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,7 add ecx,ebp ; 106 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 32[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,12 add ebp,ebx ; 107 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 48[esp] rol ecx,10 lea ebx,DWORD PTR 1548603684[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,7 add ebx,edi ; 108 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 16[esp] rol ebp,10 lea edi,DWORD PTR 1548603684[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,6 add edi,esi ; 109 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 36[esp] rol ebx,10 lea esi,DWORD PTR 1548603684[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,15 add esi,ecx ; 110 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 4[esp] rol edi,10 lea ecx,DWORD PTR 1548603684[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,13 add ecx,ebp ; 111 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 8[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax sub edx,ecx rol ebp,11 add ebp,ebx ; 112 mov eax,DWORD PTR 60[esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1836072691[edx*1+ebx] sub eax,ebp rol ebx,9 add ebx,edi ; 113 mov edx,DWORD PTR 20[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1836072691[eax*1+edi] sub edx,ebx rol edi,7 add edi,esi ; 114 mov eax,DWORD PTR 4[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1836072691[edx*1+esi] sub eax,edi rol esi,15 add esi,ecx ; 115 mov edx,DWORD PTR 12[esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1836072691[eax*1+ecx] sub edx,esi rol ecx,11 add ecx,ebp ; 116 mov eax,DWORD PTR 28[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1836072691[edx*1+ebp] sub eax,ecx rol ebp,8 add ebp,ebx ; 117 mov edx,DWORD PTR 56[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1836072691[eax*1+ebx] sub edx,ebp rol ebx,6 add ebx,edi ; 118 mov eax,DWORD PTR 24[esp] or edx,ebx add edi,eax xor edx,ecx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 1836072691[edx*1+edi] sub eax,ebx rol edi,6 add edi,esi ; 119 mov edx,DWORD PTR 36[esp] or eax,edi add esi,edx xor eax,ebp mov edx,-1 rol ebx,10 lea esi,DWORD PTR 1836072691[eax*1+esi] sub edx,edi rol esi,14 add esi,ecx ; 120 mov eax,DWORD PTR 44[esp] or edx,esi add ecx,eax xor edx,ebx mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1836072691[edx*1+ecx] sub eax,esi rol ecx,12 add ecx,ebp ; 121 mov edx,DWORD PTR 32[esp] or eax,ecx add ebp,edx xor eax,edi mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1836072691[eax*1+ebp] sub edx,ecx rol ebp,13 add ebp,ebx ; 122 mov eax,DWORD PTR 48[esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1836072691[edx*1+ebx] sub eax,ebp rol ebx,5 add ebx,edi ; 123 mov edx,DWORD PTR 8[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1836072691[eax*1+edi] sub edx,ebx rol edi,14 add edi,esi ; 124 mov eax,DWORD PTR 40[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1836072691[edx*1+esi] sub eax,edi rol esi,13 add esi,ecx ; 125 mov edx,DWORD PTR [esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1836072691[eax*1+ecx] sub edx,esi rol ecx,13 add ecx,ebp ; 126 mov eax,DWORD PTR 16[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1836072691[edx*1+ebp] sub eax,ecx rol ebp,7 add ebp,ebx ; 127 mov edx,DWORD PTR 52[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,DWORD PTR 32[esp] rol ecx,10 lea ebx,DWORD PTR 1836072691[eax*1+ebx] mov eax,-1 rol ebx,5 add ebx,edi ; 128 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 24[esp] rol ebp,10 lea edi,DWORD PTR 2053994217[edx*1+edi] mov edx,-1 rol edi,15 add edi,esi ; 129 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 16[esp] rol ebx,10 lea esi,DWORD PTR 2053994217[eax*1+esi] mov eax,-1 rol esi,5 add esi,ecx ; 130 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 4[esp] rol edi,10 lea ecx,DWORD PTR 2053994217[edx*1+ecx] mov edx,-1 rol ecx,8 add ecx,ebp ; 131 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,DWORD PTR 12[esp] rol esi,10 lea ebp,DWORD PTR 2053994217[eax*1+ebp] mov eax,-1 rol ebp,11 add ebp,ebx ; 132 add ebx,edx mov edx,ecx sub eax,ebp and edx,ebp and eax,esi or edx,eax mov eax,DWORD PTR 44[esp] rol ecx,10 lea ebx,DWORD PTR 2053994217[edx*1+ebx] mov edx,-1 rol ebx,14 add ebx,edi ; 133 add edi,eax mov eax,ebp sub edx,ebx and eax,ebx and edx,ecx or eax,edx mov edx,DWORD PTR 60[esp] rol ebp,10 lea edi,DWORD PTR 2053994217[eax*1+edi] mov eax,-1 rol edi,14 add edi,esi ; 134 add esi,edx mov edx,ebx sub eax,edi and edx,edi and eax,ebp or edx,eax mov eax,DWORD PTR [esp] rol ebx,10 lea esi,DWORD PTR 2053994217[edx*1+esi] mov edx,-1 rol esi,6 add esi,ecx ; 135 add ecx,eax mov eax,edi sub edx,esi and eax,esi and edx,ebx or eax,edx mov edx,DWORD PTR 20[esp] rol edi,10 lea ecx,DWORD PTR 2053994217[eax*1+ecx] mov eax,-1 rol ecx,14 add ecx,ebp ; 136 add ebp,edx mov edx,esi sub eax,ecx and edx,ecx and eax,edi or edx,eax mov eax,DWORD PTR 48[esp] rol esi,10 lea ebp,DWORD PTR 2053994217[edx*1+ebp] mov edx,-1 rol ebp,6 add ebp,ebx ; 137 add ebx,eax mov eax,ecx sub edx,ebp and eax,ebp and edx,esi or eax,edx mov edx,DWORD PTR 8[esp] rol ecx,10 lea ebx,DWORD PTR 2053994217[eax*1+ebx] mov eax,-1 rol ebx,9 add ebx,edi ; 138 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 52[esp] rol ebp,10 lea edi,DWORD PTR 2053994217[edx*1+edi] mov edx,-1 rol edi,12 add edi,esi ; 139 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 36[esp] rol ebx,10 lea esi,DWORD PTR 2053994217[eax*1+esi] mov eax,-1 rol esi,9 add esi,ecx ; 140 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 28[esp] rol edi,10 lea ecx,DWORD PTR 2053994217[edx*1+ecx] mov edx,-1 rol ecx,12 add ecx,ebp ; 141 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,DWORD PTR 40[esp] rol esi,10 lea ebp,DWORD PTR 2053994217[eax*1+ebp] mov eax,-1 rol ebp,5 add ebp,ebx ; 142 add ebx,edx mov edx,ecx sub eax,ebp and edx,ebp and eax,esi or edx,eax mov eax,DWORD PTR 56[esp] rol ecx,10 lea ebx,DWORD PTR 2053994217[edx*1+ebx] mov edx,-1 rol ebx,15 add ebx,edi ; 143 add edi,eax mov eax,ebp sub edx,ebx and eax,ebx and edx,ecx or edx,eax mov eax,ebx rol ebp,10 lea edi,DWORD PTR 2053994217[edx*1+edi] xor eax,ebp rol edi,8 add edi,esi ; 144 mov edx,DWORD PTR 48[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,8 add esi,ecx ; 145 xor eax,ebx mov edx,DWORD PTR 60[esp] xor eax,esi add ecx,eax mov eax,esi rol edi,10 add ecx,edx xor eax,edi rol ecx,5 add ecx,ebp ; 146 mov edx,DWORD PTR 40[esp] xor eax,ecx add ebp,edx rol esi,10 add ebp,eax mov eax,ecx rol ebp,12 add ebp,ebx ; 147 xor eax,esi mov edx,DWORD PTR 16[esp] xor eax,ebp add ebx,eax mov eax,ebp rol ecx,10 add ebx,edx xor eax,ecx rol ebx,9 add ebx,edi ; 148 mov edx,DWORD PTR 4[esp] xor eax,ebx add edi,edx rol ebp,10 add edi,eax mov eax,ebx rol edi,12 add edi,esi ; 149 xor eax,ebp mov edx,DWORD PTR 20[esp] xor eax,edi add esi,eax mov eax,edi rol ebx,10 add esi,edx xor eax,ebx rol esi,5 add esi,ecx ; 150 mov edx,DWORD PTR 32[esp] xor eax,esi add ecx,edx rol edi,10 add ecx,eax mov eax,esi rol ecx,14 add ecx,ebp ; 151 xor eax,edi mov edx,DWORD PTR 28[esp] xor eax,ecx add ebp,eax mov eax,ecx rol esi,10 add ebp,edx xor eax,esi rol ebp,6 add ebp,ebx ; 152 mov edx,DWORD PTR 24[esp] xor eax,ebp add ebx,edx rol ecx,10 add ebx,eax mov eax,ebp rol ebx,8 add ebx,edi ; 153 xor eax,ecx mov edx,DWORD PTR 8[esp] xor eax,ebx add edi,eax mov eax,ebx rol ebp,10 add edi,edx xor eax,ebp rol edi,13 add edi,esi ; 154 mov edx,DWORD PTR 52[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,6 add esi,ecx ; 155 xor eax,ebx mov edx,DWORD PTR 56[esp] xor eax,esi add ecx,eax mov eax,esi rol edi,10 add ecx,edx xor eax,edi rol ecx,5 add ecx,ebp ; 156 mov edx,DWORD PTR [esp] xor eax,ecx add ebp,edx rol esi,10 add ebp,eax mov eax,ecx rol ebp,15 add ebp,ebx ; 157 xor eax,esi mov edx,DWORD PTR 12[esp] xor eax,ebp add ebx,eax mov eax,ebp rol ecx,10 add ebx,edx xor eax,ecx rol ebx,13 add ebx,edi ; 158 mov edx,DWORD PTR 36[esp] xor eax,ebx add edi,edx rol ebp,10 add edi,eax mov eax,ebx rol edi,11 add edi,esi ; 159 xor eax,ebp mov edx,DWORD PTR 44[esp] xor eax,edi add esi,eax rol ebx,10 add esi,edx mov edx,DWORD PTR 128[esp] rol esi,11 add esi,ecx mov eax,DWORD PTR 4[edx] add ebx,eax mov eax,DWORD PTR 72[esp] add ebx,eax mov eax,DWORD PTR 8[edx] add ebp,eax mov eax,DWORD PTR 76[esp] add ebp,eax mov eax,DWORD PTR 12[edx] add ecx,eax mov eax,DWORD PTR 80[esp] add ecx,eax mov eax,DWORD PTR 16[edx] add esi,eax mov eax,DWORD PTR 64[esp] add esi,eax mov eax,DWORD PTR [edx] add edi,eax mov eax,DWORD PTR 68[esp] add edi,eax mov eax,DWORD PTR 136[esp] mov DWORD PTR [edx],ebx mov DWORD PTR 4[edx],ebp mov DWORD PTR 8[edx],ecx sub eax,1 mov DWORD PTR 12[edx],esi mov DWORD PTR 16[edx],edi jle $L001get_out mov DWORD PTR 136[esp],eax mov edi,ecx mov eax,DWORD PTR 132[esp] mov ecx,ebx add eax,64 mov esi,ebp mov DWORD PTR 132[esp],eax jmp $L000start $L001get_out: add esp,108 pop ebx pop ebp pop edi pop esi ret _ripemd160_block_asm_data_order ENDP .text$ ENDS END ",16325,True,5940.973597026529,median "*&---------------------------------------------------------------------* *& Include ZABAPGIT_PAGE_BRANCH_OVERVIEW *&---------------------------------------------------------------------* CLASS lcl_branch_overview DEFINITION FINAL. PUBLIC SECTION. TYPES: BEGIN OF ty_create, name TYPE string, parent TYPE string, END OF ty_create. TYPES: BEGIN OF ty_commit, sha1 TYPE ty_sha1, parent1 TYPE ty_sha1, parent2 TYPE ty_sha1, author TYPE string, email TYPE string, time TYPE string, message TYPE string, branch TYPE string, merge TYPE string, create TYPE STANDARD TABLE OF ty_create WITH DEFAULT KEY, compressed TYPE abap_bool, END OF ty_commit. TYPES: ty_commit_tt TYPE STANDARD TABLE OF ty_commit WITH DEFAULT KEY. CLASS-METHODS: run IMPORTING io_repo TYPE REF TO lcl_repo_online RETURNING VALUE(rt_commits) TYPE ty_commit_tt RAISING lcx_exception. CLASS-METHODS: compress IMPORTING it_commits TYPE ty_commit_tt RETURNING VALUE(rt_commits) TYPE ty_commit_tt RAISING lcx_exception. CLASS-METHODS: get_branches RETURNING VALUE(rt_branches) TYPE lcl_git_branch_list=>ty_git_branch_list_tt. PRIVATE SECTION. CLASS-METHODS: parse_commits IMPORTING it_objects TYPE ty_objects_tt RAISING lcx_exception, determine_branch RAISING lcx_exception, determine_merges RAISING lcx_exception, fixes RAISING lcx_exception, get_git_objects IMPORTING io_repo TYPE REF TO lcl_repo_online RETURNING VALUE(rt_objects) TYPE ty_objects_tt RAISING lcx_exception. CLASS-DATA: gt_branches TYPE lcl_git_branch_list=>ty_git_branch_list_tt, gt_commits TYPE TABLE OF ty_commit. ENDCLASS. CLASS lcl_branch_overview IMPLEMENTATION. METHOD get_branches. rt_branches = gt_branches. ENDMETHOD. METHOD compress. DEFINE _compress. IF lines( lt_temp ) >= 10. READ TABLE lt_temp ASSIGNING INDEX 1. ASSERT sy-subrc = 0. APPEND INITIAL LINE TO rt_commits ASSIGNING . -time = -time. -message = |Compressed, { lines( lt_temp ) } commits|. -branch = lv_name. -compressed = abap_true. ELSE. APPEND LINES OF lt_temp TO rt_commits. ENDIF. END-OF-DEFINITION. DATA: lv_previous TYPE i, lv_index TYPE i, lv_name TYPE string, lt_temp LIKE it_commits. FIELD-SYMBOLS: LIKE LINE OF gt_branches, LIKE LINE OF rt_commits, LIKE LINE OF lt_temp, LIKE LINE OF it_commits. LOOP AT gt_branches ASSIGNING . CLEAR lt_temp. lv_name = -name+11. LOOP AT it_commits ASSIGNING WHERE branch = lv_name. lv_index = sy-tabix. IF NOT -merge IS INITIAL OR NOT -create IS INITIAL. * always show these vertices lv_previous = -1. ENDIF. IF lv_previous + 1 <> sy-tabix. _compress. CLEAR lt_temp. ENDIF. lv_previous = lv_index. APPEND TO lt_temp. ENDLOOP. _compress. ENDLOOP. SORT rt_commits BY time ASCENDING. ENDMETHOD. METHOD run. DATA: lt_objects TYPE ty_objects_tt. CLEAR gt_branches. CLEAR gt_commits. lt_objects = get_git_objects( io_repo ). parse_commits( lt_objects ). CLEAR lt_objects. determine_branch( ). determine_merges( ). fixes( ). SORT gt_commits BY time ASCENDING. rt_commits = gt_commits. ENDMETHOD. METHOD get_git_objects. lcl_progress=>show( iv_key = 'Get git objects' iv_current = 1 iv_total = 1 iv_text = io_repo->get_name( ) ) ##NO_TEXT. * get objects directly from git, mo_repo only contains a shallow clone of only * the selected branch ""TODO refactor gt_branches = lcl_git_transport=>branches( io_repo->get_url( ) )->get_branches_only( ). lcl_git_transport=>upload_pack( EXPORTING io_repo = io_repo iv_deepen = abap_false it_branches = gt_branches IMPORTING et_objects = rt_objects ). DELETE rt_objects WHERE type = gc_type-blob. ENDMETHOD. METHOD parse_commits. DATA: ls_commit LIKE LINE OF gt_commits, lv_trash TYPE string ##NEEDED, ls_raw TYPE lcl_git_pack=>ty_commit. FIELD-SYMBOLS: LIKE LINE OF it_objects. LOOP AT it_objects ASSIGNING WHERE type = gc_type-commit. ls_raw = lcl_git_pack=>decode_commit( -data ). CLEAR ls_commit. ls_commit-sha1 = -sha1. ls_commit-parent1 = ls_raw-parent. ls_commit-parent2 = ls_raw-parent2. SPLIT ls_raw-body AT gc_newline INTO ls_commit-message lv_trash. * unix time stamps are in same time zone, so ignore the zone, FIND REGEX gc_author_regex IN ls_raw-author SUBMATCHES ls_commit-author ls_commit-email ls_commit-time ##NO_TEXT. ASSERT sy-subrc = 0. APPEND ls_commit TO gt_commits. ENDLOOP. ENDMETHOD. METHOD fixes. FIELD-SYMBOLS: LIKE LINE OF gt_commits. LOOP AT gt_commits ASSIGNING WHERE NOT merge IS INITIAL. * commits from old branches IF -branch = -merge. CLEAR -merge. ENDIF. ENDLOOP. ENDMETHOD. METHOD determine_merges. FIELD-SYMBOLS: LIKE LINE OF gt_commits, LIKE LINE OF gt_commits. * important: start with the newest first and propagate branches SORT gt_commits BY time DESCENDING. LOOP AT gt_commits ASSIGNING WHERE NOT parent2 IS INITIAL. ASSERT NOT -branch IS INITIAL. READ TABLE gt_commits ASSIGNING WITH KEY sha1 = -parent2. IF sy-subrc = 0. -merge = -branch. * orphaned, branch has been deleted after merge WHILE -branch IS INITIAL. -branch = -branch. READ TABLE gt_commits ASSIGNING WITH KEY sha1 = -parent1. IF sy-subrc <> 0. EXIT. ENDIF. ENDWHILE. ENDIF. ENDLOOP. ENDMETHOD. METHOD determine_branch. CONSTANTS: lc_head TYPE string VALUE 'HEAD'. DATA: lv_name TYPE string. FIELD-SYMBOLS: LIKE LINE OF gt_branches, LIKE LINE OF gt_branches, LIKE LINE OF gt_commits, LIKE LINE OF -create. * exchange HEAD, and make sure the branch determination starts with the HEAD branch READ TABLE gt_branches ASSIGNING WITH KEY name = lc_head. ASSERT sy-subrc = 0. LOOP AT gt_branches ASSIGNING WHERE sha1 = -sha1 AND name <> lc_head. -name = -name. DELETE gt_branches INDEX sy-tabix. EXIT. ENDLOOP. LOOP AT gt_branches ASSIGNING . lv_name = -name+11. READ TABLE gt_commits ASSIGNING WITH KEY sha1 = -sha1. ASSERT sy-subrc = 0. DO. IF -branch IS INITIAL. -branch = lv_name. ELSE. APPEND INITIAL LINE TO -create ASSIGNING . -name = lv_name. -parent = -branch. EXIT. ENDIF. IF -parent1 IS INITIAL. EXIT. ELSE. READ TABLE gt_commits ASSIGNING WITH KEY sha1 = -parent1. ASSERT sy-subrc = 0. ENDIF. ENDDO. ENDLOOP. ENDMETHOD. ENDCLASS. *********************** CLASS lcl_gui_page_branch_overview DEFINITION FINAL INHERITING FROM lcl_gui_page. PUBLIC SECTION. METHODS: constructor IMPORTING io_repo TYPE REF TO lcl_repo_online RAISING lcx_exception, lif_gui_page~on_event REDEFINITION. PROTECTED SECTION. METHODS render_content REDEFINITION. PRIVATE SECTION. DATA: mo_repo TYPE REF TO lcl_repo_online, mv_compress TYPE abap_bool VALUE abap_false, mt_commits TYPE lcl_branch_overview=>ty_commit_tt. CONSTANTS: BEGIN OF c_actions, uncompress TYPE string VALUE 'uncompress' ##NO_TEXT, compress TYPE string VALUE 'compress' ##NO_TEXT, refresh TYPE string VALUE 'refresh' ##NO_TEXT, merge TYPE string VALUE 'merge' ##NO_TEXT, END OF c_actions. TYPES: BEGIN OF ty_merge, source TYPE string, target TYPE string, END OF ty_merge. METHODS: refresh RAISING lcx_exception, body RETURNING VALUE(ro_html) TYPE REF TO lcl_html RAISING lcx_exception, form_select IMPORTING iv_name TYPE string RETURNING VALUE(ro_html) TYPE REF TO lcl_html, render_merge RETURNING VALUE(ro_html) TYPE REF TO lcl_html RAISING lcx_exception, decode_merge IMPORTING it_postdata TYPE cnht_post_data_tab RETURNING VALUE(rs_merge) TYPE ty_merge RAISING lcx_exception, build_menu RETURNING VALUE(ro_menu) TYPE REF TO lcl_html_toolbar, escape_branch IMPORTING iv_string TYPE string RETURNING VALUE(rv_string) TYPE string, escape_message IMPORTING iv_string TYPE string RETURNING VALUE(rv_string) TYPE string. ENDCLASS. ""lcl_gui_page_explore DEFINITION CLASS lcl_gui_page_branch_overview IMPLEMENTATION. METHOD constructor. super->constructor( ). ms_control-page_title = 'BRANCH_OVERVIEW'. mo_repo = io_repo. refresh( ). ENDMETHOD. METHOD refresh. mt_commits = lcl_branch_overview=>run( mo_repo ). IF mv_compress = abap_true. mt_commits = lcl_branch_overview=>compress( mt_commits ). ENDIF. ENDMETHOD. METHOD form_select. DATA: lv_name TYPE string, lt_branches TYPE lcl_git_branch_list=>ty_git_branch_list_tt. FIELD-SYMBOLS: LIKE LINE OF lt_branches. CREATE OBJECT ro_html. lt_branches = lcl_branch_overview=>get_branches( ). ro_html->add( |' ). ENDMETHOD. METHOD render_merge. CREATE OBJECT ro_html. ro_html->add( '
' ). ro_html->add( 'Merge' ) ##NO_TEXT. ro_html->add( form_select( 'source' ) ) ##NO_TEXT. ro_html->add( 'into' ) ##NO_TEXT. ro_html->add( form_select( 'target' ) ) ##NO_TEXT. ro_html->add( '' ). ro_html->add( '
' ). ENDMETHOD. METHOD body. FIELD-SYMBOLS: LIKE LINE OF mt_commits, LIKE LINE OF -create. CREATE OBJECT ro_html. ro_html->add( lcl_gui_chunk_lib=>render_repo_top( io_repo = mo_repo iv_show_package = abap_false iv_show_branch = abap_false ) ). ro_html->add( '
' ). ro_html->add( '
' ). ro_html->add( render_merge( ) ). ro_html->add( '
' ). ro_html->add( build_menu( )->render( ) ). * see http://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element _add ''. ro_html->add( '' ) ##NO_TEXT. _add ''. ENDMETHOD. METHOD escape_message. rv_string = iv_string. REPLACE ALL OCCURRENCES OF '""' IN rv_string WITH '\\""'. ENDMETHOD. METHOD escape_branch. rv_string = iv_string. TRANSLATE rv_string USING '-_._'. rv_string = |branch_{ rv_string }|. ENDMETHOD. METHOD build_menu. CREATE OBJECT ro_menu. IF mv_compress = abap_true. ro_menu->add( iv_txt = 'Uncompress Graph' iv_act = c_actions-uncompress ) ##NO_TEXT. ELSE. ro_menu->add( iv_txt = 'Compress Graph' iv_act = c_actions-compress ) ##NO_TEXT. ENDIF. ro_menu->add( iv_txt = 'Refresh' iv_act = c_actions-refresh ) ##NO_TEXT. ENDMETHOD. METHOD decode_merge. DATA: lv_string TYPE string, lt_fields TYPE tihttpnvp. FIELD-SYMBOLS: LIKE LINE OF lt_fields. CONCATENATE LINES OF it_postdata INTO lv_string. lt_fields = cl_http_utility=>if_http_utility~string_to_fields( lv_string ). READ TABLE lt_fields ASSIGNING WITH KEY name = 'source' ##NO_TEXT. ASSERT sy-subrc = 0. rs_merge-source = -value. READ TABLE lt_fields ASSIGNING WITH KEY name = 'target' ##NO_TEXT. ASSERT sy-subrc = 0. rs_merge-target = -value. ENDMETHOD. METHOD lif_gui_page~on_event. DATA: ls_merge TYPE ty_merge, lo_merge TYPE REF TO lcl_gui_page_merge. CASE iv_action. WHEN c_actions-refresh. refresh( ). ev_state = gc_event_state-re_render. WHEN c_actions-uncompress. mv_compress = abap_false. refresh( ). ev_state = gc_event_state-re_render. WHEN c_actions-compress. mv_compress = abap_true. refresh( ). ev_state = gc_event_state-re_render. WHEN c_actions-merge. ls_merge = decode_merge( it_postdata ). CREATE OBJECT lo_merge EXPORTING io_repo = mo_repo iv_source = ls_merge-source iv_target = ls_merge-target. ei_page = lo_merge. ev_state = gc_event_state-new_page. ENDCASE. ENDMETHOD. METHOD render_content. CREATE OBJECT ro_html. ro_html->add( '
' ). ro_html->add( body( ) ). ro_html->add( '
' ). ENDMETHOD. ""render_content ENDCLASS. ",4312,False,808.3612728284425,median "; Copyright © 2020, VideoLAN and dav1d authors ; Copyright © 2020, Two Orioles, LLC ; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions are met: ; ; 1. Redistributions of source code must retain the above copyright notice, this ; list of conditions and the following disclaimer. ; ; 2. Redistributions in binary form must reproduce the above copyright notice, ; this list of conditions and the following disclaimer in the documentation ; and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS"" AND ; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. %include ""config.asm"" %include ""ext/x86/x86inc.asm"" %if ARCH_X86_64 %macro DUP4 1-* %rep %0 times 4 db %1 %rotate 1 %endrep %endmacro %macro DIRS 16 ; cdef_directions[] %rep 4 + 16 + 4 ; 6 7 0 1 2 3 4 5 6 7 0 1 ; masking away unused bits allows us to use a single vpaddd {1to16} ; instruction instead of having to do vpbroadcastd + paddb db %13 & 0x3f, -%13 & 0x3f %rotate 1 %endrep %endmacro SECTION_RODATA 64 lut_perm_4x4: db 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 db 16, 17, 0, 1, 2, 3, 4, 5, 18, 19, 8, 9, 10, 11, 12, 13 db 20, 21, 80, 81, 82, 83, 84, 85, 22, 23, 32, 33, 34, 35, 36, 37 db 98, 99,100,101,102,103,104,105, 50, 51, 52, 53, 54, 55, 56, 57 lut_perm_4x8a: db 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 db 96, 97, 0, 1, 2, 3, 4, 5, 98, 99, 8, 9, 10, 11, 12, 13 lut_perm_4x8b:db 100,101, 16, 17, 18, 19, 20, 21,102,103, 24, 25, 26, 27, 28, 29 db 104,105, 32, 33, 34, 35, 36, 37,106,107, 40, 41, 42, 43, 44, 45 db 108,109, 48, 49, 50, 51, 52, 53,110,111, 56, 57, 58, 59, 60, 61 db 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 pd_01234567: dd 0, 1, 2, 3, 4, 5, 6, 7 lut_perm_8x8a: db 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23 db -1, -1, 34, 35, 36, 37, 38, 39, -1, -1, 50, 51, 52, 53, 54, 55 db -1, -1, 66, 67, 68, 69, 70, 71, -1, -1, 82, 83, 84, 85, 86, 87 db 96, 97, 98, 99,100,101,102,103,112,113,114,115,116,117,118,119 lut_perm_8x8b: db 4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 22, 23, 24, 25, 26, 27 db 36, 37, 38, 39, 40, 41, 42, 43, 52, 53, 54, 55, 56, 57, 58, 59 db 68, 69, 70, 71, 72, 73, 74, 75, 84, 85, 86, 87, 88, 89, 90, 91 db 100,101,102,103,104,105,106,107,116,117,118,119,120,121,122,123 edge_mask: dq 0x00003c3c3c3c0000, 0x00003f3f3f3f0000 ; 0000, 0001 dq 0x0000fcfcfcfc0000, 0x0000ffffffff0000 ; 0010, 0011 dq 0x00003c3c3c3c3c3c, 0x00003f3f3f3f3f3f ; 0100, 0101 dq 0x0000fcfcfcfcfcfc, 0x0000ffffffffffff ; 0110, 0111 dq 0x3c3c3c3c3c3c0000, 0x3f3f3f3f3f3f0000 ; 1000, 1001 dq 0xfcfcfcfcfcfc0000, 0xffffffffffff0000 ; 1010, 1011 dq 0x3c3c3c3c3c3c3c3c, 0x3f3f3f3f3f3f3f3f ; 1100, 1101 dq 0xfcfcfcfcfcfcfcfc, 0xffffffffffffffff ; 1110, 1111 px_idx: DUP4 18, 19, 20, 21, 26, 27, 28, 29, 34, 35, 36, 37, 42, 43, 44, 45 cdef_dirs: DIRS -7,-14, 1, -6, 1, 2, 1, 10, 9, 18, 8, 17, 8, 16, 8, 15 gf_shr: dq 0x0102040810204080, 0x0102040810204080 ; >> 0, >> 0 dq 0x0204081020408000, 0x0408102040800000 ; >> 1, >> 2 dq 0x0810204080000000, 0x1020408000000000 ; >> 3, >> 4 dq 0x2040800000000000, 0x4080000000000000 ; >> 5, >> 6 times 16 db 0 ; realign (introduced by cdef_dirs) end_perm_w8clip:db 0, 4, 8, 12, 2, 6, 10, 14, 16, 20, 24, 28, 18, 22, 26, 30 db 32, 36, 40, 44, 34, 38, 42, 46, 48, 52, 56, 60, 50, 54, 58, 62 db 1, 5, 9, 13, 3, 7, 11, 15, 17, 21, 25, 29, 19, 23, 27, 31 db 33, 37, 41, 45, 35, 39, 43, 47, 49, 53, 57, 61, 51, 55, 59, 63 end_perm: db 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61 db 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63 pri_tap: db 64, 64, 32, 32, 48, 48, 48, 48 ; left-shifted by 4 sec_tap: db 32, 32, 16, 16 pd_268435568: dd 268435568 SECTION .text %if WIN64 DECLARE_REG_TMP 4 %else DECLARE_REG_TMP 8 %endif ; lut: ; t0 t1 t2 t3 t4 t5 t6 t7 ; T0 T1 T2 T3 T4 T5 T6 T7 ; L0 L1 00 01 02 03 04 05 ; L2 L3 10 11 12 13 14 15 ; L4 L5 20 21 22 23 24 25 ; L6 L7 30 31 32 33 34 35 ; 4e 4f 40 41 42 43 44 45 ; 5e 5f 50 51 52 53 54 55 INIT_ZMM avx512icl cglobal cdef_filter_4x4_8bpc, 5, 8, 13, dst, stride, left, top, bot, \\ pri, sec, dir, damping, edge %define base r7-edge_mask movq xmm0, [dstq+strideq*0] movhps xmm0, [dstq+strideq*1] lea r7, [edge_mask] movq xmm1, [topq+strideq*0-2] movhps xmm1, [topq+strideq*1-2] mov r6d, edgem vinserti32x4 ym0, ymm0, [leftq], 1 lea r2, [strideq*3] vinserti32x4 ym1, ymm1, [dstq+strideq*2], 1 mova m5, [base+lut_perm_4x4] vinserti32x4 m0, [dstq+r2], 2 test r6b, 0x08 ; avoid buffer overread jz .main vinserti32x4 m1, [botq+strideq*0-4], 2 vinserti32x4 m0, [botq+strideq*1-4], 3 .main: movifnidn prid, prim mov t0d, dirm mova m3, [base+px_idx] mov r3d, dampingm vpermi2b m5, m0, m1 ; lut vpbroadcastd m0, [base+pd_268435568] ; (1 << 28) + (7 << 4) pxor m7, m7 lea r3, [r7+r3*8] ; gf_shr + (damping - 30) * 8 vpermb m6, m3, m5 ; px cmp r6d, 0x0f jne .mask_edges ; mask edges only if required test prid, prid jz .sec_only vpaddd m1, m3, [base+cdef_dirs+(t0+2)*4] {1to16} ; dir vpermb m1, m1, m5 ; k0p0 k0p1 k1p0 k1p1 %macro CDEF_FILTER_4x4_PRI 0 vpcmpub k1, m6, m1, 6 ; px > pN psubb m2, m1, m6 lzcnt r6d, prid vpsubb m2{k1}, m6, m1 ; abs(diff) vpbroadcastb m4, prid and prid, 1 vgf2p8affineqb m9, m2, [r3+r6*8] {1to8}, 0 ; abs(diff) >> shift movifnidn secd, secm vpbroadcastd m10, [base+pri_tap+priq*4] vpsubb m10{k1}, m7, m10 ; apply_sign(pri_tap) psubusb m4, m9 ; imax(0, pri_strength - (abs(diff) >> shift))) pminub m2, m4 vpdpbusd m0, m2, m10 ; sum %endmacro CDEF_FILTER_4x4_PRI test secd, secd jz .end_no_clip call .sec .end_clip: pminub m4, m6, m1 pmaxub m1, m6 pminub m5, m2, m3 pmaxub m2, m3 pminub m4, m5 pmaxub m2, m1 psrldq m1, m4, 2 psrldq m3, m2, 2 pminub m1, m4 vpcmpw k1, m0, m7, 1 vpshldd m6, m0, 8 pmaxub m2, m3 pslldq m3, m1, 1 psubw m7, m0 paddusw m0, m6 ; clip >0xff vpsubusw m0{k1}, m6, m7 ; clip <0x00 pslldq m4, m2, 1 pminub m1, m3 pmaxub m2, m4 pmaxub m0, m1 pminub m0, m2 jmp .end .sec_only: movifnidn secd, secm call .sec .end_no_clip: vpshldd m6, m0, 8 ; (px << 8) + ((sum > -8) << 4) paddw m0, m6 ; (px << 8) + ((sum + (sum > -8) + 7) << 4) .end: mova xm1, [base+end_perm] vpermb m0, m1, m0 ; output in bits 8-15 of each dword movd [dstq+strideq*0], xm0 pextrd [dstq+strideq*1], xm0, 1 pextrd [dstq+strideq*2], xm0, 2 pextrd [dstq+r2 ], xm0, 3 RET .mask_edges_sec_only: movifnidn secd, secm call .mask_edges_sec jmp .end_no_clip ALIGN function_align .mask_edges: vpbroadcastq m8, [base+edge_mask+r6*8] test prid, prid jz .mask_edges_sec_only vpaddd m2, m3, [base+cdef_dirs+(t0+2)*4] {1to16} vpshufbitqmb k1, m8, m2 ; index in-range mova m1, m6 vpermb m1{k1}, m2, m5 CDEF_FILTER_4x4_PRI test secd, secd jz .end_no_clip call .mask_edges_sec jmp .end_clip .mask_edges_sec: vpaddd m4, m3, [base+cdef_dirs+(t0+4)*4] {1to16} vpaddd m9, m3, [base+cdef_dirs+(t0+0)*4] {1to16} vpshufbitqmb k1, m8, m4 mova m2, m6 vpermb m2{k1}, m4, m5 vpshufbitqmb k1, m8, m9 mova m3, m6 vpermb m3{k1}, m9, m5 jmp .sec_main ALIGN function_align .sec: vpaddd m2, m3, [base+cdef_dirs+(t0+4)*4] {1to16} ; dir + 2 vpaddd m3, [base+cdef_dirs+(t0+0)*4] {1to16} ; dir - 2 vpermb m2, m2, m5 ; k0s0 k0s1 k1s0 k1s1 vpermb m3, m3, m5 ; k0s2 k0s3 k1s2 k1s3 .sec_main: vpbroadcastd m8, [base+sec_tap] vpcmpub k1, m6, m2, 6 psubb m4, m2, m6 vpbroadcastb m12, secd lzcnt secd, secd vpsubb m4{k1}, m6, m2 vpcmpub k2, m6, m3, 6 vpbroadcastq m11, [r3+secq*8] gf2p8affineqb m10, m4, m11, 0 psubb m5, m3, m6 mova m9, m8 vpsubb m8{k1}, m7, m8 psubusb m10, m12, m10 vpsubb m5{k2}, m6, m3 pminub m4, m10 vpdpbusd m0, m4, m8 gf2p8affineqb m11, m5, m11, 0 vpsubb m9{k2}, m7, m9 psubusb m12, m11 pminub m5, m12 vpdpbusd m0, m5, m9 ret DECLARE_REG_TMP 2, 7 ; lut top lut bottom ; t0 t1 t2 t3 t4 t5 t6 t7 L4 L5 20 21 22 23 24 25 ; T0 T1 T2 T3 T4 T5 T6 T7 L6 L7 30 31 32 33 34 35 ; L0 L1 00 01 02 03 04 05 L8 L9 40 41 42 43 44 45 ; L2 L3 10 11 12 13 14 15 La Lb 50 51 52 53 54 55 ; L4 L5 20 21 22 23 24 25 Lc Ld 60 61 62 63 64 65 ; L6 L7 30 31 32 33 34 35 Le Lf 70 71 72 73 74 75 ; L8 L9 40 41 42 43 44 45 8e 8f 80 81 82 83 84 85 ; La Lb 50 51 52 53 54 55 9e 9f 90 91 92 93 94 95 cglobal cdef_filter_4x8_8bpc, 5, 9, 22, dst, stride, left, top, bot, \\ pri, sec, dir, damping, edge %define base r8-edge_mask vpbroadcastd ym21, strided mov r6d, edgem lea r8, [edge_mask] movq xm1, [topq+strideq*0-2] pmulld ym21, [base+pd_01234567] kxnorb k1, k1, k1 movq xm2, [topq+strideq*1-2] vpgatherdq m0{k1}, [dstq+ym21] ; +0+1 +2+3 +4+5 +6+7 mova m14, [base+lut_perm_4x8a] movu m15, [base+lut_perm_4x8b] test r6b, 0x08 ; avoid buffer overread jz .main vinserti32x4 ym1, [botq+strideq*0-2], 1 vinserti32x4 ym2, [botq+strideq*1-2], 1 .main: punpcklqdq ym1, ym2 vinserti32x4 m1, [leftq], 2 ; -2-1 +8+9 left ____ movifnidn prid, prim mov t0d, dirm mova m16, [base+px_idx] mov r3d, dampingm vpermi2b m14, m0, m1 ; lut top vpermi2b m15, m0, m1 ; lut bottom vpbroadcastd m0, [base+pd_268435568] ; (1 << 28) + (7 << 4) pxor m20, m20 lea r3, [r8+r3*8] ; gf_shr + (damping - 30) * 8 vpermb m2, m16, m14 ; pxt vpermb m3, m16, m15 ; pxb mova m1, m0 cmp r6b, 0x0f jne .mask_edges ; mask edges only if required test prid, prid jz .sec_only vpaddd m6, m16, [base+cdef_dirs+(t0+2)*4] {1to16} ; dir vpermb m4, m6, m14 ; pNt k0p0 k0p1 k1p0 k1p1 vpermb m5, m6, m15 ; pNb %macro CDEF_FILTER_4x8_PRI 0 vpcmpub k1, m2, m4, 6 ; pxt > pNt vpcmpub k2, m3, m5, 6 ; pxb > pNb psubb m6, m4, m2 psubb m7, m5, m3 lzcnt r6d, prid vpsubb m6{k1}, m2, m4 ; abs(diff_top) vpsubb m7{k2}, m3, m5 ; abs(diff_bottom) vpbroadcastb m13, prid vpbroadcastq m9, [r3+r6*8] and prid, 1 vpbroadcastd m11, [base+pri_tap+priq*4] vgf2p8affineqb m8, m6, m9, 0 ; abs(dt) >> shift vgf2p8affineqb m9, m7, m9, 0 ; abs(db) >> shift mova m10, m11 movifnidn t1d, secm vpsubb m10{k1}, m20, m11 ; apply_sign(pri_tap_top) vpsubb m11{k2}, m20, m11 ; apply_sign(pri_tap_bottom) psubusb m12, m13, m8 ; imax(0, pri_strength - (abs(dt) >> shift))) psubusb m13, m13, m9 ; imax(0, pri_strength - (abs(db) >> shift))) pminub m6, m12 pminub m7, m13 vpdpbusd m0, m6, m10 ; sum top vpdpbusd m1, m7, m11 ; sum bottom %endmacro CDEF_FILTER_4x8_PRI test t1d, t1d ; sec jz .end_no_clip call .sec .end_clip: pminub m10, m4, m2 pminub m12, m6, m8 pminub m11, m5, m3 pminub m13, m7, m9 pmaxub m4, m2 pmaxub m6, m8 pmaxub m5, m3 pmaxub m7, m9 pminub m10, m12 pminub m11, m13 pmaxub m4, m6 pmaxub m5, m7 mov r2d, 0xAAAAAAAA kmovd k1, r2d kxnorb k2, k2, k2 ; hw lw vpshrdd m12, m0, m1, 16 ; m1lw m0hw vpshrdd m6, m10, m11, 16 ; m11lw m10hw vpshrdd m8, m4, m5, 16 ; m5lw m4hw vpblendmw m7{k1}, m10, m11 ; m11hw m10lw vpblendmw m9{k1}, m4, m5 ; m5hw m4lw vpblendmw m4{k1}, m0, m12 ; m1lw m0lw vpblendmw m5{k1}, m12, m1 ; m1hw m0hw vpshrdd m2, m3, 16 pminub m6, m7 pmaxub m8, m9 mova ym14, [base+end_perm] vpcmpw k1, m4, m20, 1 vpshldw m2, m5, 8 pslldq m7, m6, 1 pslldq m9, m8, 1 psubw m5, m20, m4 paddusw m0, m4, m2 ; clip >0xff pminub m6, m7 pmaxub m8, m9 psubusw m0{k1}, m2, m5 ; clip <0x00 pmaxub m0, m6 pminub m0, m8 vpermb m0, m14, m0 vpscatterdd [dstq+ym21]{k2}, ym0 RET .sec_only: movifnidn t1d, secm call .sec .end_no_clip: mova ym4, [base+end_perm] kxnorb k1, k1, k1 vpshldd m2, m0, 8 ; (px << 8) + ((sum > -8) << 4) vpshldd m3, m1, 8 paddw m0, m2 ; (px << 8) + ((sum + (sum > -8) + 7) << 4) paddw m1, m3 pslld m0, 16 vpshrdd m0, m1, 16 vpermb m0, m4, m0 ; output in bits 8-15 of each word vpscatterdd [dstq+ym21]{k1}, ym0 RET .mask_edges_sec_only: movifnidn t1d, secm call .mask_edges_sec jmp .end_no_clip ALIGN function_align .mask_edges: mov t1d, r6d or r6d, 8 ; top 4x4 has bottom or t1d, 4 ; bottom 4x4 has top vpbroadcastq m17, [base+edge_mask+r6*8] vpbroadcastq m18, [base+edge_mask+t1*8] test prid, prid jz .mask_edges_sec_only vpaddd m6, m16, [base+cdef_dirs+(t0+2)*4] {1to16} vpshufbitqmb k1, m17, m6 ; index in-range vpshufbitqmb k2, m18, m6 mova m4, m2 mova m5, m3 vpermb m4{k1}, m6, m14 vpermb m5{k2}, m6, m15 CDEF_FILTER_4x8_PRI test t1d, t1d jz .end_no_clip call .mask_edges_sec jmp .end_clip .mask_edges_sec: vpaddd m10, m16, [base+cdef_dirs+(t0+4)*4] {1to16} vpaddd m11, m16, [base+cdef_dirs+(t0+0)*4] {1to16} vpshufbitqmb k1, m17, m10 vpshufbitqmb k2, m18, m10 vpshufbitqmb k3, m17, m11 vpshufbitqmb k4, m18, m11 mova m6, m2 mova m7, m3 mova m8, m2 mova m9, m3 vpermb m6{k1}, m10, m14 vpermb m7{k2}, m10, m15 vpermb m8{k3}, m11, m14 vpermb m9{k4}, m11, m15 jmp .sec_main ALIGN function_align .sec: vpaddd m8, m16, [base+cdef_dirs+(t0+4)*4] {1to16} ; dir + 2 vpaddd m9, m16, [base+cdef_dirs+(t0+0)*4] {1to16} ; dir - 2 vpermb m6, m8, m14 ; pNt k0s0 k0s1 k1s0 k1s1 vpermb m7, m8, m15 ; pNb vpermb m8, m9, m14 ; pNt k0s2 k0s3 k1s2 k1s3 vpermb m9, m9, m15 ; pNb .sec_main: vpbroadcastb m18, t1d lzcnt t1d, t1d vpcmpub k1, m2, m6, 6 vpcmpub k2, m3, m7, 6 vpcmpub k3, m2, m8, 6 vpcmpub k4, m3, m9, 6 vpbroadcastq m17, [r3+t1*8] psubb m10, m6, m2 psubb m11, m7, m3 psubb m12, m8, m2 psubb m13, m9, m3 vpsubb m10{k1}, m2, m6 ; abs(dt0) vpsubb m11{k2}, m3, m7 ; abs(db0) vpsubb m12{k3}, m2, m8 ; abs(dt1) vpsubb m13{k4}, m3, m9 ; abs(db1) vpbroadcastd m19, [base+sec_tap] gf2p8affineqb m14, m10, m17, 0 ; abs(dt0) >> shift gf2p8affineqb m15, m11, m17, 0 ; abs(db0) >> shift gf2p8affineqb m16, m12, m17, 0 ; abs(dt1) >> shift gf2p8affineqb m17, m13, m17, 0 ; abs(db1) >> shift psubusb m14, m18, m14 ; imax(0, sec_strength - (abs(dt0) >> shift))) psubusb m15, m18, m15 ; imax(0, sec_strength - (abs(db0) >> shift))) psubusb m16, m18, m16 ; imax(0, sec_strength - (abs(dt1) >> shift))) psubusb m17, m18, m17 ; imax(0, sec_strength - (abs(db1) >> shift))) pminub m10, m14 pminub m11, m15 pminub m12, m16 pminub m13, m17 mova m14, m19 mova m15, m19 mova m16, m19 vpsubb m14{k1}, m20, m19 ; apply_sign(sec_tap_top_0) vpsubb m15{k2}, m20, m19 ; apply_sign(sec_tap_bottom_0) vpsubb m16{k3}, m20, m19 ; apply_sign(sec_tap_top_1) vpsubb m19{k4}, m20, m19 ; apply_sign(sec_tap_bottom_1) vpdpbusd m0, m10, m14 vpdpbusd m1, m11, m15 vpdpbusd m0, m12, m16 vpdpbusd m1, m13, m19 ret ; lut tl lut tr ; t0 t1 t2 t3 t4 t5 t6 t7 t6 t7 t8 t9 ta tb tc td ; T0 T1 T2 T3 T4 T5 T6 T7 T6 T7 T8 T9 TA TB TC TD ; L0 L1 00 01 02 03 04 05 04 05 06 07 08 09 0a 0b ; L2 L3 10 11 12 13 14 15 14 15 16 17 18 19 1a 1b ; L4 L5 20 21 22 23 24 25 24 25 26 27 28 29 2a 2b ; L6 L7 30 31 32 33 34 35 34 35 36 37 38 39 3a 3b ; L8 L9 40 41 42 43 44 45 44 45 46 47 48 49 4a 4b ; La Lb 50 51 52 53 54 55 54 55 56 57 58 59 5a 5b ; lut bl lut br ; L4 L5 20 21 22 23 24 25 24 25 26 27 28 29 2a 2b ; L6 L7 30 31 32 33 34 35 34 35 36 37 38 39 3a 3b ; L8 L9 40 41 42 43 44 45 44 45 46 47 48 49 4a 4b ; La Lb 50 51 52 53 54 55 54 55 56 57 58 59 5a 5b ; Lc Ld 60 61 62 63 64 65 64 65 66 67 68 69 6a 6b ; Le Lf 70 71 72 73 74 75 74 75 76 77 78 79 7a 7b ; 8e 8f 80 81 82 83 84 85 84 85 86 87 88 89 8a 8b ; 9e 9f 90 91 92 93 94 95 94 95 96 97 98 99 9a 9b cglobal cdef_filter_8x8_8bpc, 5, 11, 32, 4*64, dst, stride, left, top, bot, \\ pri, sec, dir, damping, edge %define base r8-edge_mask mov r6d, edgem lea r10, [dstq+strideq*4-2] movu xmm0, [topq+strideq*0-2] movu xmm1, [dstq+strideq*2-2] movu xmm2, [r10 +strideq*2 ] lea r8, [edge_mask] lea r9, [strideq*3] pmovzxwq m10, [leftq-4] vinserti32x4 ym0, ymm0, [topq+strideq*1-2], 1 vinserti32x4 ym1, ymm1, [dstq+r9 -2], 1 vinserti32x4 ym2, ymm2, [r10 +r9 ], 1 pmovzxwq m11, [leftq+4] vinserti32x4 m0, [dstq+strideq*0-2], 2 vinserti32x4 m1, [r10 +strideq*0 ], 2 mova m12, [base+lut_perm_8x8a] movu m13, [base+lut_perm_8x8b] vinserti32x4 m0, [dstq+strideq*1-2], 3 vinserti32x4 m1, [r10 +strideq*1 ], 3 test r6b, 0x08 ; avoid buffer overread jz .main vinserti32x4 m2, [botq+strideq*0-2], 2 vinserti32x4 m2, [botq+strideq*1-2], 3 .main: mov t1d, 0x11111100 mova m14, m12 mova m15, m13 kmovd k1, t1d kshiftrd k2, k1, 8 movifnidn prid, prim mov t0d, dirm mova m30, [base+px_idx] mov r3d, dampingm vpermi2b m12, m0, m1 ; lut tl vpermi2b m14, m1, m2 ; lut bl vpermi2b m13, m0, m1 ; lut tr vpermi2b m15, m1, m2 ; lut br vpblendmw m12{k1}, m12, m10 vpblendmw m14{k2}, m14, m11 vpbroadcastd m0, [base+pd_268435568] ; (1 << 28) + (7 << 4) pxor m31, m31 lea r3, [r8+r3*8] ; gf_shr + (damping - 30) * 8 vpermb m4, m30, m12 ; pxtl vpermb m5, m30, m13 ; pxtr vpermb m6, m30, m14 ; pxbl vpermb m7, m30, m15 ; pxbr mova m1, m0 mova m2, m0 mova m3, m0 cmp r6b, 0x0f jne .mask_edges ; mask edges only if required test prid, prid jz .sec_only vpaddd m11, m30, [base+cdef_dirs+(t0+2)*4] {1to16} ; dir vpermb m8, m11, m12 ; pNtl k0p0 k0p1 k1p0 k1p1 vpermb m9, m11, m13 ; pNtr vpermb m10, m11, m14 ; pNbl vpermb m11, m11, m15 ; pNbr %macro CDEF_FILTER_8x8_PRI 0 vpcmpub k1, m4, m8, 6 ; pxtl > pNtl vpcmpub k2, m5, m9, 6 ; pxtr > pNtr vpcmpub k3, m6, m10, 6 ; pxbl > pNbl vpcmpub k4, m7, m11, 6 ; pxbr > pNbr psubb m16, m8, m4 psubb m17, m9, m5 psubb m18, m10, m6 psubb m19, m11, m7 lzcnt r6d, prid vpsubb m16{k1}, m4, m8 ; abs(diff_tl) vpsubb m17{k2}, m5, m9 ; abs(diff_tr) vpsubb m18{k3}, m6, m10 ; abs(diff_bl) vpsubb m19{k4}, m7, m11 ; abs(diff_br) vpbroadcastq m28, [r3+r6*8] vpbroadcastb m29, prid and prid, 1 vpbroadcastd m27, [base+pri_tap+priq*4] vgf2p8affineqb m20, m16, m28, 0 ; abs(dtl) >> shift vgf2p8affineqb m21, m17, m28, 0 ; abs(dtr) >> shift vgf2p8affineqb m22, m18, m28, 0 ; abs(dbl) >> shift vgf2p8affineqb m23, m19, m28, 0 ; abs(dbl) >> shift mova m24, m27 mova m25, m27 mova m26, m27 movifnidn t1d, secm vpsubb m24{k1}, m31, m27 ; apply_sign(pri_tap_tl) vpsubb m25{k2}, m31, m27 ; apply_sign(pri_tap_tr) vpsubb m26{k3}, m31, m27 ; apply_sign(pri_tap_tl) vpsubb m27{k4}, m31, m27 ; apply_sign(pri_tap_tr) psubusb m20, m29, m20 ; imax(0, pri_strength - (abs(dtl) >> shift))) psubusb m21, m29, m21 ; imax(0, pri_strength - (abs(dtr) >> shift))) psubusb m22, m29, m22 ; imax(0, pri_strength - (abs(dbl) >> shift))) psubusb m23, m29, m23 ; imax(0, pri_strength - (abs(dbr) >> shift))) pminub m16, m20 pminub m17, m21 pminub m18, m22 pminub m19, m23 vpdpbusd m0, m16, m24 ; sum tl vpdpbusd m1, m17, m25 ; sum tr vpdpbusd m2, m18, m26 ; sum bl vpdpbusd m3, m19, m27 ; sum br %endmacro CDEF_FILTER_8x8_PRI test t1d, t1d ; sec jz .end_no_clip call .sec .end_clip: pminub m20, m8, m4 pminub m24, m12, m16 pminub m21, m9, m5 pminub m25, m13, m17 pminub m22, m10, m6 pminub m26, m14, m18 pminub m23, m11, m7 pminub m27, m15, m19 pmaxub m8, m4 pmaxub m12, m16 pmaxub m9, m5 pmaxub m13, m17 pmaxub m10, m6 pmaxub m14, m18 pmaxub m11, m7 pmaxub m15, m19 pminub m20, m24 pminub m21, m25 pminub m22, m26 pminub m23, m27 pmaxub m8, m12 pmaxub m9, m13 pmaxub m10, m14 pmaxub m11, m15 mov r2d, 0xAAAAAAAA kmovd k1, r2d vpshrdd m24, m0, m1, 16 vpshrdd m25, m2, m3, 16 vpshrdd m12, m20, m21, 16 vpshrdd m14, m22, m23, 16 vpshrdd m16, m8, m9, 16 vpshrdd m18, m10, m11, 16 vpblendmw m13{k1}, m20, m21 vpblendmw m15{k1}, m22, m23 vpblendmw m17{k1}, m8, m9 vpblendmw m19{k1}, m10, m11 vpblendmw m20{k1}, m0, m24 vpblendmw m21{k1}, m24, m1 vpblendmw m22{k1}, m2, m25 vpblendmw m23{k1}, m25, m3 vpshrdd m4, m5, 16 vpshrdd m6, m7, 16 pminub m12, m13 pminub m14, m15 pmaxub m16, m17 pmaxub m18, m19 mova m8, [base+end_perm_w8clip] vpcmpw k2, m20, m31, 1 vpcmpw k3, m22, m31, 1 vpshldw m4, m21, 8 vpshldw m6, m23, 8 kunpckdq k1, k1, k1 kxnorb k4, k4, k4 vpshrdw m11, m12, m14, 8 vpshrdw m15, m16, m18, 8 vpblendmb m13{k1}, m12, m14 vpblendmb m17{k1}, m16, m18 psubw m21, m31, m20 psubw m23, m31, m22 paddusw m0, m20, m4 ; clip >0xff paddusw m1, m22, m6 pminub m11, m13 pmaxub m15, m17 psubusw m0{k2}, m4, m21 ; clip <0x00 psubusw m1{k3}, m6, m23 psrlw m0, 8 vmovdqu8 m0{k1}, m1 pmaxub m0, m11 pminub m0, m15 vpermb m0, m8, m0 add r10, 2 vextracti32x4 xm1, m0, 1 vextracti32x4 xm2, m0, 2 vextracti32x4 xm3, m0, 3 movq [dstq+strideq*0], xm0 movq [dstq+strideq*2], xm1 movq [r10 +strideq*0], xm2 movq [r10 +strideq*2], xm3 movhps [dstq+strideq*1], xm0 movhps [dstq+r9 ], xm1 movhps [r10 +strideq*1], xm2 movhps [r10 +r9 ], xm3 RET .sec_only: movifnidn t1d, secm call .sec .end_no_clip: mova xm8, [base+end_perm] kxnorb k1, k1, k1 vpshldd m4, m0, 8 ; (px << 8) + ((sum > -8) << 4) vpshldd m5, m1, 8 vpshldd m6, m2, 8 vpshldd m7, m3, 8 paddw m0, m4 ; (px << 8) + ((sum + (sum > -8) + 7) << 4) paddw m1, m5 paddw m2, m6 paddw m3, m7 vpermb m0, m8, m0 vpermb m1, m8, m1 vpermb m2, m8, m2 vpermb m3, m8, m3 add r10, 2 punpckldq m4, m0, m1 punpckhdq m0, m1 punpckldq m5, m2, m3 punpckhdq m2, m3 movq [dstq+strideq*0], xm4 movq [dstq+strideq*2], xm0 movq [r10 +strideq*0], xm5 movq [r10 +strideq*2], xm2 movhps [dstq+strideq*1], xm4 movhps [dstq+r9 ], xm0 movhps [r10 +strideq*1], xm5 movhps [r10 +r9 ], xm2 RET .mask_edges_sec_only: movifnidn t1d, secm call .mask_edges_sec jmp .end_no_clip ALIGN function_align .mask_edges: mov t0d, r6d mov t1d, r6d or t0d, 0xA ; top-left 4x4 has bottom and right or t1d, 0x9 ; top-right 4x4 has bottom and left vpbroadcastq m26, [base+edge_mask+t0*8] vpbroadcastq m27, [base+edge_mask+t1*8] mov t1d, r6d or r6d, 0x6 ; bottom-left 4x4 has top and right or t1d, 0x5 ; bottom-right 4x4 has top and left vpbroadcastq m28, [base+edge_mask+r6*8] vpbroadcastq m29, [base+edge_mask+t1*8] mov t0d, dirm test prid, prid jz .mask_edges_sec_only vpaddd m20, m30, [base+cdef_dirs+(t0+2)*4] {1to16} vpshufbitqmb k1, m26, m20 ; index in-range vpshufbitqmb k2, m27, m20 vpshufbitqmb k3, m28, m20 vpshufbitqmb k4, m29, m20 mova m8, m4 mova m9, m5 mova m10, m6 mova m11, m7 vpermb m8{k1}, m20, m12 vpermb m9{k2}, m20, m13 vpermb m10{k3}, m20, m14 vpermb m11{k4}, m20, m15 mova [rsp+0x00], m26 mova [rsp+0x40], m27 mova [rsp+0x80], m28 mova [rsp+0xC0], m29 CDEF_FILTER_8x8_PRI test t1d, t1d jz .end_no_clip mova m26, [rsp+0x00] mova m27, [rsp+0x40] mova m28, [rsp+0x80] mova m29, [rsp+0xC0] call .mask_edges_sec jmp .end_clip .mask_edges_sec: vpaddd m20, m30, [base+cdef_dirs+(t0+4)*4] {1to16} vpaddd m21, m30, [base+cdef_dirs+(t0+0)*4] {1to16} vpshufbitqmb k1, m26, m20 vpshufbitqmb k2, m27, m20 vpshufbitqmb k3, m28, m20 vpshufbitqmb k4, m29, m20 mova m16, m4 mova m17, m5 mova m18, m6 mova m19, m7 vpermb m16{k1}, m20, m12 vpermb m17{k2}, m20, m13 vpermb m18{k3}, m20, m14 vpermb m19{k4}, m20, m15 vpshufbitqmb k1, m26, m21 vpshufbitqmb k2, m27, m21 vpshufbitqmb k3, m28, m21 vpshufbitqmb k4, m29, m21 vpermb m12, m21, m12 vpermb m13, m21, m13 vpermb m14, m21, m14 vpermb m15, m21, m15 vpblendmb m12{k1}, m4, m12 vpblendmb m13{k2}, m5, m13 vpblendmb m14{k3}, m6, m14 vpblendmb m15{k4}, m7, m15 jmp .sec_main ALIGN function_align .sec: vpaddd m20, m30, [base+cdef_dirs+(t0+4)*4] {1to16} ; dir + 2 vpaddd m21, m30, [base+cdef_dirs+(t0+0)*4] {1to16} ; dir - 2 vpermb m16, m20, m12 ; pNtl k0s0 k0s1 k1s0 k1s1 vpermb m17, m20, m13 ; pNtr vpermb m18, m20, m14 ; pNbl vpermb m19, m20, m15 ; pNbr vpermb m12, m21, m12 ; pNtl k0s2 k0s3 k1s2 k1s3 vpermb m13, m21, m13 ; pNtr vpermb m14, m21, m14 ; pNbl vpermb m15, m21, m15 ; pNbr .sec_main: %macro CDEF_FILTER_8x8_SEC 4-5 0 ; load constants vpcmpub k1, m4, %1, 6 vpcmpub k2, m5, %2, 6 vpcmpub k3, m6, %3, 6 vpcmpub k4, m7, %4, 6 psubb m20, %1, m4 psubb m21, %2, m5 psubb m22, %3, m6 psubb m23, %4, m7 %if %5 vpbroadcastb m28, t1d lzcnt t1d, t1d vpbroadcastq m29, [r3+t1*8] %endif vpsubb m20{k1}, m4, %1 vpsubb m21{k2}, m5, %2 vpsubb m22{k3}, m6, %3 vpsubb m23{k4}, m7, %4 gf2p8affineqb m24, m20, m29, 0 gf2p8affineqb m25, m21, m29, 0 gf2p8affineqb m26, m22, m29, 0 gf2p8affineqb m27, m23, m29, 0 %if %5 vpbroadcastd m30, [base+sec_tap] %endif psubusb m24, m28, m24 psubusb m25, m28, m25 psubusb m26, m28, m26 psubusb m27, m28, m27 pminub m20, m24 pminub m21, m25 pminub m22, m26 pminub m23, m27 mova m24, m30 mova m25, m30 mova m26, m30 mova m27, m30 vpsubb m24{k1}, m31, m30 vpsubb m25{k2}, m31, m30 vpsubb m26{k3}, m31, m30 vpsubb m27{k4}, m31, m30 vpdpbusd m0, m20, m24 vpdpbusd m1, m21, m25 vpdpbusd m2, m22, m26 vpdpbusd m3, m23, m27 %endmacro CDEF_FILTER_8x8_SEC m16, m17, m18, m19, 1 CDEF_FILTER_8x8_SEC m12, m13, m14, m15 ret %endif ; ARCH_X86_64 ",16243,True,3533.9199930800146,median "FORMAT: 1A # THORChain API This documentation outlines the API for THORChain. Add `?height={blockheight}` to the end of a query to return data for a specific block height (only works from current height to hardfork height). NOTE: This document is a **work in progress**. # Group Health Check ## Ping [GET /thorchain/ping] + Response 200 (plain/text) + Attributes + ping: ""pong"" (string) + Body {""ping"":""pong""} # Group Pools This section documents the pools API resources. ## Pool [/thorchain/pool/{asset}] A pool contains all the information of THORChain liquidity pool + Parameters + asset: `BNB.BNB` (required, string) - The asset of the pool + Attributes + balance_rune (string) - amount of rune the pool has + balance_asset (string) - amount of asset the pool has + asset (string) - pool asset + pool_units (string) - total number of units within the pool + status (string) - status of the pool + synth_units (string) - total number of synth units within the pool + pending_inbound_rune (string) - amount of pending rune within the pool + pending_inbound_asset (string) - amount of pending asset within the pool ### Get a pool [GET] Retrieve a liquidity pool with the given asset + Response 200 (application/json) + Attributes (Pool) + Body { ""balance_rune"": ""13460619152985"", ""balance_asset"": ""3197744873"", ""asset"": ""BTC.BTC"", ""pool_units"": ""14694928607473"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""464993836"", ""pending_inbound_asset"": ""101713319"" } ### Get all the liquidity pools [GET /thorchain/pools] Retrieve all the liquidity pools from THORChain + Response 200 (application/json) + Attributes (array[Pool]) + Body [ { ""balance_rune"": ""990304018943"", ""balance_asset"": ""14902274220"", ""asset"": ""BCH.BCH"", ""pool_units"": ""944477442283"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""257058484"" }, { ""balance_rune"": ""5227668587847"", ""balance_asset"": ""117072844569"", ""asset"": ""BNB.BNB"", ""pool_units"": ""4919785756191"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""1589030575"" }, { ""balance_rune"": ""2906260051490"", ""balance_asset"": ""643467346"", ""asset"": ""BNB.BTCB-1DE"", ""pool_units"": ""2816600000000"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""230000"" }, { ""balance_rune"": ""2414614240711"", ""balance_asset"": ""26650266002988"", ""asset"": ""BNB.BUSD-BD1"", ""pool_units"": ""2348364113912"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""82718240853"" }, { ""balance_rune"": ""9019619987525"", ""balance_asset"": ""45893334588"", ""asset"": ""ETH.ETH"", ""pool_units"": ""8549256862314"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""14500000000"", ""pending_inbound_asset"": ""64193305"" }, { ""balance_rune"": ""90000000000"", ""balance_asset"": ""33000000000"", ""asset"": ""ETH.LINK-0X514910771AF9CA656AF840DFF83E8264ECF986CA"", ""pool_units"": ""101000000000"", ""status"": ""Staged"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""0"" }, { ""balance_rune"": ""1028041431770"", ""balance_asset"": ""52175862117"", ""asset"": ""LTC.LTC"", ""pool_units"": ""1076474234756"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""6313867419"", ""pending_inbound_asset"": ""3910921839"" } ] ### Get a liquidity provider of a pool [GET /thorchain/pool/{asset}/liquidity_provider/{address}] + Parameters + asset: `BNB.BNB` (required, string) - The asset of the pool + address: `thorxxxxxxxxxxxxxxxxxxxxxxx` (required, string) - The address of the liquidity provider + Response 200 (application/json) + Attributes (LiquidityProvider) + Body { ""asset"": ""BNB.BNB"", ""rune_address"": ""thor1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"", ""asset_address"": ""bnb1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"", ""last_add_height"": 82745, ""units"": ""0"", ""pending_rune"": ""0"", ""pending_asset"": ""242000000"", ""pending_tx_Id"": ""C4C876802xxxxxxxxxxBC408829878446A37011EBBA0C5CAA3DD64A548879CB228"", ""rune_deposit_value"": ""0"", ""asset_deposit_value"": ""0"" } ### Get all liquidity providers of a pool [GET /thorchain/pool/{asset}/liquidity_providers] + Parameters + asset: `BNB.BNB` (required, string) - The asset of the pool + Response 200 (application/json) + Attributes (array[LiquidityProvider]) # Group Tx This section document Tx API resource ## Tx [/thorchain/tx/{hash}] + Parameters + hash: `E17A0906E015F0C343691C18E475C8CB5F3F6C63F5BCDE0F3A341909763CC92B` (required, string) - Tx hash of an inbound transaction or outbound transaction + Attributes + tx (ObservedTx) - observed tx information + status (enum) + done + incomplete + out_hashes (array[string]) - a list of outbound hashes + block_height (string) - the block hight this tx get observed + signers (array[string]) - a list of signer address that has sign this tx off + observed_pub_key (string) - public key of the vault which observe this tx ### Get a tx with given hash [GET] Retrieve a tx with the given hash from THORChain + Response 200 (application/json) + Body { ""tx"": { ""id"": ""CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7"", ""chain"": ""BTC"", ""from_address"": ""bcrt1q0s4mg25tu6termrk8egltfyme4q7sg3h8kkydt"", ""to_address"": ""bcrt1qf3s7q037eancht7sg0aj995dht25rwrnqsf45e"", ""coins"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""150000000"" }], ""gas"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""100000"" }], ""memo"": ""ADD:BTC.BTC:tthor1zupk5lmc84r2dh738a9g3zscavannjy3nzplwt"" }, ""status"": ""incomplete"", ""out_hashes"": null, ""block_height"": ""162"", ""signers"": [ ""tthor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5"" ], ""observed_pub_key"": ""tthorpub1addwnpepq27ck6u44zl8qqdnmzjjc8rg72amrxrsp42p9vd7kt6marhy6ww76z8shwe"" } ## TxSigners [/thorchain/tx/{hash}/signers] + Parameters + hash: `E17A0906E015F0C343691C18E475C8CB5F3F6C63F5BCDE0F3A341909763CC92B` (required, string) - Tx hash of an inbound transaction or outbound transaction + Attributes + tx_id (string) - tx hash + tx (ObservedTx) - observed tx , the tx that reach 2/3 majority consensus + height (string) - block height that this tx reach super majority consensus + in_tx (array[ObservedTx]) - all observed tx + action - potential outbound tx + out_txs (array[string]) - outbound tx hashes ### Get tx signers [GET] Get tx signers that match the request hash + Response 200 (application/json) + Body { ""tx_id"": ""CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7"", ""tx"": { ""tx"": { ""id"": ""CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7"", ""chain"": ""BTC"", ""from_address"": ""bcrt1q0s4mg25tu6termrk8egltfyme4q7sg3h8kkydt"", ""to_address"": ""bcrt1qf3s7q037eancht7sg0aj995dht25rwrnqsf45e"", ""coins"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""150000000"" } ], ""gas"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""100000"" } ], ""memo"": ""ADD:BTC.BTC:tthor1zupk5lmc84r2dh738a9g3zscavannjy3nzplwt"" }, ""status"": ""incomplete"", ""out_hashes"": null, ""block_height"": ""162"", ""signers"": [ ""tthor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5"" ], ""observed_pub_key"": ""tthorpub1addwnpepq27ck6u44zl8qqdnmzjjc8rg72amrxrsp42p9vd7kt6marhy6ww76z8shwe"" }, ""height"": ""15"", ""in_tx"": [ { ""tx"": { ""id"": ""CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7"", ""chain"": ""BTC"", ""from_address"": ""bcrt1q0s4mg25tu6termrk8egltfyme4q7sg3h8kkydt"", ""to_address"": ""bcrt1qf3s7q037eancht7sg0aj995dht25rwrnqsf45e"", ""coins"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""150000000"" } ], ""gas"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""100000"" } ], ""memo"": ""ADD:BTC.BTC:tthor1zupk5lmc84r2dh738a9g3zscavannjy3nzplwt"" }, ""status"": ""incomplete"", ""out_hashes"": null, ""block_height"": ""162"", ""signers"": [ ""tthor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5"" ], ""observed_pub_key"": ""tthorpub1addwnpepq27ck6u44zl8qqdnmzjjc8rg72amrxrsp42p9vd7kt6marhy6ww76z8shwe"" } ], ""actions"": null, ""out_txs"": null } # Group Nodes This section document all the API for Node resource ## Node [/thorchain/node/{node_address}] + Parameters + node_address: `thor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5` (string,required) - node address + Attributes + node_address (string) - node address + status (string) - status , values can be active,disabled,standby + pub_key_set + secp256k1 (string) - secp256k1 public key + ed25519 (string) - ed25519 public key + validator_cons_pub_key (string) - the consensus pubkey used by the node + bond (string) - current bond + active_block_height (string) - block height this node become active + bond_address (string) - bond address + status_since (string) - block height this node become current status + signer_membership (array[string]) - a list of vault public key that this node is a member of + requested_to_leave (boolean) - indicate whether this node had requested to leave_height + forced_to_leave (boolean) - indicate whether this node had been forced to leave by the network or not, if this field is true , usually means this node had been banned + ip_address (string) - node ip address + version (string) - the version of thornode software this node is running + slash_points (string) - the slash points the node accumulated when they are active , slash points will be reset next time when node become active + jail + node_address (string) - node address + release_height (string) - on which block height , this node will be released from jail, if it is 0 , means the node is not in jail + reason (string) - why the node has been jailed + current_award (string) - node current award + observe_chains - chain and block heights this node is observing , this is useful to know whether a node is falling behind in regards to observing + preflight_status + status (string) - what status the node will be in next + reason (string) - why the node will be in the status above + code (string) - error code ### Get a node [GET] Retrieve the node with given node address from THORChain + Response 200 (application/json) + Attributes (Node) + Body { ""node_address"": ""tthor1257g60tcxvu4dvflpszgkwq34d5vw6pgz0wkdu"", ""status"": ""active"", ""pub_key_set"": { ""secp256k1"": ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"", ""ed25519"": ""tthorpub1zcjduepqcuwkyr4d0lfrftdla7f6nnkxuxu9p7grpfmy36jktv9wcqal5w3qgds2ch"" }, ""validator_cons_pub_key"": ""tthorcpub1zcjduepq44vy0erpdcmekppgknu2u05znl8vmqs2nl0f92ezp4uj3zn695rqqdhta0"", ""bond"": ""0"", ""active_block_height"": ""1"", ""bond_address"": ""tbnb1ftdj7ttfa4chaf6xl04elnh30shhg4qvy4mw3r"", ""status_since"": ""0"", ""signer_membership"": null, ""requested_to_leave"": false, ""forced_to_leave"": false, ""leave_height"": ""0"", ""ip_address"": ""119.18.3.176"", ""version"": ""0.17.0"", ""slash_points"": ""1"", ""jail"": { ""node_address"": ""tthor1257g60tcxvu4dvflpszgkwq34d5vw6pgz0wkdu"", ""release_height"": ""0"", ""reason"": """" }, ""current_award"": ""0"", ""observe_chains"": [ { ""chain"": ""BTC"", ""height"": ""632"" }, { ""chain"": ""ETH"", ""height"": ""6"" }, { ""chain"": ""BNB"", ""height"": ""1883"" } ], ""preflight_status"": { ""status"": ""standby"", ""reason"": ""node account does not have minimum bond requirement: 0/100000000"", ""code"": ""1"" } } ### Get all nodes [GET /thorchain/nodes] Retrieve all nodes that have bond + Response 200 (application/json) + Attributes (array[Node]) # Group Vaults ## AsgardVault [/thorchain/vaults/asgard] + Attributes + block_height (string) - block height when the vault get created + pub_key (string) - vault's public key + coins (array[Coin]) - coins in this asgard vault + type (string) - vault type , it could be asgard or yggdrasil + status (string) - status , it could be active , retiring , inactive + status_since (string) - block height this vault get to current status + membership (array[string]) - a list of node public key , represent which nodes created this vault + chains (array[string]) - a list of chains this vault support + inbound_tx_count (string) - number of inbound tx to this vault , across all chain + outbound_tx_count (string) - number of outbound tx from this vault + pending_tx_heights (array[string]) - pending txes for migration + routers (array[ChainRouter]) - chain router + addresses (array[ChainAddress]) - chain addresses ### Get Asgard vaults [GET] Retrieve all current active Asgard vaults from thorchain + Response 200 (application/json) + Attributes (array[AsgardVault]) + Body [ { ""block_height"": 30, ""pub_key"": ""tthorpub1addwnpepqfha5sms6cyxgmr9y6j3lg5pxzyc3x9g4hkanlwu2j5jgkva4ncaurn5zmd"", ""coins"": [ { ""asset"": ""BNB.RUNE-67C"", ""amount"": ""3000000000000000"" }, { ""asset"": ""BNB.BNB"", ""amount"": ""100000000000"" }, { ""asset"": ""BNB.LOK-3C0"", ""amount"": ""40000000000"" }, { ""asset"": ""BNB.BTCB-101"", ""amount"": ""40000000000"" }, { ""asset"": ""BTC.BTC"", ""amount"": ""100000000"" }, { ""asset"": ""LTC.LTC"", ""amount"": ""500000000"" }, { ""asset"": ""BCH.BCH"", ""amount"": ""500000000"" }, { ""asset"": ""ETH.TKN-0X3B7FA4DD21C6F9BA3CA375217EAD7CAB9D6BF483"", ""amount"": ""500000000"" }, { ""asset"": ""ETH.ETH"", ""amount"": ""1000000000"" } ], ""type"": ""AsgardVault"", ""status"": ""ActiveVault"", ""membership"": [ ""tthorpub1addwnpepqfha5sms6cyxgmr9y6j3lg5pxzyc3x9g4hkanlwu2j5jgkva4ncaurn5zmd"" ], ""chains"": [ ""THOR"", ""BTC"", ""LTC"", ""BCH"", ""BNB"", ""ETH"" ], ""inbound_tx_count"": 11, ""routers"": [ { ""chain"": ""ETH"", ""router"": ""0xE65e9d372F8cAcc7b6dfcd4af6507851Ed31bb44"" } ], ""addresses"": [ { ""chain"": ""THOR"", ""address"": ""tthor1syneecwgwvn6zkv47k3cq65fuzrp24yzxyk279"" }, { ""chain"": ""BTC"", ""address"": ""bcrt1qsyneecwgwvn6zkv47k3cq65fuzrp24yz6pz56g"" }, { ""chain"": ""LTC"", ""address"": ""rltc1qsyneecwgwvn6zkv47k3cq65fuzrp24yzyvcadk"" }, { ""chain"": ""BCH"", ""address"": ""qzqj088pepej0g2ejh668qr238sgv925sg4g5hp57p"" }, { ""chain"": ""BNB"", ""address"": ""tbnb1syneecwgwvn6zkv47k3cq65fuzrp24yzg9gfnq"" }, { ""chain"": ""ETH"", ""address"": ""0x61666aa597b4344f855d25b92385b5eb0c650074"" } ] } ] ## YggdrasilVault [/thorchain/vaults/yggdrasil] + Attributes + block_height (string) - block height when the vault get created + pub_key (string) - vault's public key + coins (array[Coin]) - coins in this asgard vault + type (string) - vault type, it could be asgard or yggdrasil + status_since (string) - block height this vault get to current status + membership (array[string]) - a list of node public key, represent which nodes created this vault + chains (array[string]) - a list of chains this vault support + inbound_tx_count (string) - number of inbound tx to this vault, across all chain + outbound_tx_count (string) - number of outbound tx from this vault + pending_tx_heights (array[string]) - pending txes for migration + routers (array[ChainRouter]) - chain router + status (string) - node status, it could be active, standby etc + bond (string) - bond + total_value (string) - total value in this yggdrasil vault + addresses (array[ChainAddress]) - chain addresses ### Get Yggdrasil vaults [GET /thorchain/vaults/yggdrasil] Retrieve all Yggdrasil vaults from THORChain + Response 200 (application/json) + Attributes (array[YggdrasilVault]) + Body [ { ""block_height"": ""0"", ""pub_key"": ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"", ""coins"": [ { ""asset"": ""BNB.BNB"", ""amount"": ""0"" }, { ""asset"": ""BTC.BTC"", ""amount"": ""0"" }, { ""asset"": ""ETH.ETH"", ""amount"": ""3604472318"" }, { ""asset"": ""BNB.LOK-3C0"", ""amount"": ""0"" }, { ""asset"": ""BNB.TCAN-014"", ""amount"": ""1000000"" } ], ""type"": ""yggdrasil"", ""status"": ""active"", ""status_since"": ""0"", ""membership"": [ ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"" ], ""chains"": [ ""THOR"", ""BTC"", ""BNB"", ""ETH"" ], ""inbound_tx_count"": ""21"", ""outbound_tx_count"": ""23"", ""pending_tx_heights"": null, ""routers"": [ { ""chain"": ""ETH"", ""router"": ""0xE65e9d372F8cAcc7b6dfcd4af6507851Ed31bb44"" } ], ""addresses"": [ { ""chain"": ""THOR"", ""address"": ""tthor1syneecwgwvn6zkv47k3cq65fuzrp24yzxyk279"" }, { ""chain"": ""BTC"", ""address"": ""bcrt1qsyneecwgwvn6zkv47k3cq65fuzrp24yz6pz56g"" }, { ""chain"": ""LTC"", ""address"": ""rltc1qsyneecwgwvn6zkv47k3cq65fuzrp24yzyvcadk"" }, { ""chain"": ""BCH"", ""address"": ""qzqj088pepej0g2ejh668qr238sgv925sg4g5hp57p"" }, { ""chain"": ""BNB"", ""address"": ""tbnb1syneecwgwvn6zkv47k3cq65fuzrp24yzg9gfnq"" }, { ""chain"": ""ETH"", ""address"": ""0x61666aa597b4344f855d25b92385b5eb0c650074"" } ] } ] ### Get a vault by pubkey [GET /thorchain/vault/{pubkey}] + Parameters + pubkey (string,required) - pubkey of the vault + Response 200 (application/json) + Attributes (AsgardVault) + Body { ""block_height"": 30, ""pub_key"": ""tthorpub1addwnpepqfha5sms6cyxgmr9y6j3lg5pxzyc3x9g4hkanlwu2j5jgkva4ncaurn5zmd"", ""coins"": [ { ""asset"": ""BNB.RUNE-67C"", ""amount"": ""3000000000000000"" }, { ""asset"": ""BNB.BNB"", ""amount"": ""100000000000"" }, { ""asset"": ""BNB.LOK-3C0"", ""amount"": ""40000000000"" }, { ""asset"": ""BNB.BTCB-101"", ""amount"": ""40000000000"" }, { ""asset"": ""BTC.BTC"", ""amount"": ""100000000"" }, { ""asset"": ""LTC.LTC"", ""amount"": ""500000000"" }, { ""asset"": ""BCH.BCH"", ""amount"": ""500000000"" }, { ""asset"": ""ETH.TKN-0X3B7FA4DD21C6F9BA3CA375217EAD7CAB9D6BF483"", ""amount"": ""500000000"" }, { ""asset"": ""ETH.ETH"", ""amount"": ""1000000000"" } ], ""type"": ""AsgardVault"", ""status"": ""ActiveVault"", ""membership"": [ ""tthorpub1addwnpepqfha5sms6cyxgmr9y6j3lg5pxzyc3x9g4hkanlwu2j5jgkva4ncaurn5zmd"" ], ""chains"": [ ""THOR"", ""BTC"", ""LTC"", ""BCH"", ""BNB"", ""ETH"" ], ""inbound_tx_count"": 11, ""routers"": [ { ""chain"": ""ETH"", ""router"": ""0xE65e9d372F8cAcc7b6dfcd4af6507851Ed31bb44"" } ], ""addresses"": [ { ""chain"": ""THOR"", ""address"": ""tthor1syneecwgwvn6zkv47k3cq65fuzrp24yzxyk279"" }, { ""chain"": ""BTC"", ""address"": ""bcrt1qsyneecwgwvn6zkv47k3cq65fuzrp24yz6pz56g"" }, { ""chain"": ""LTC"", ""address"": ""rltc1qsyneecwgwvn6zkv47k3cq65fuzrp24yzyvcadk"" }, { ""chain"": ""BCH"", ""address"": ""qzqj088pepej0g2ejh668qr238sgv925sg4g5hp57p"" }, { ""chain"": ""BNB"", ""address"": ""tbnb1syneecwgwvn6zkv47k3cq65fuzrp24yzg9gfnq"" }, { ""chain"": ""ETH"", ""address"": ""0x61666aa597b4344f855d25b92385b5eb0c650074"" } ] } ### Get vault pubkeys [GET /thorchain/vaults/pubkeys] Retrieve all vaults public keys + Response 200 (application/json) + Attributes + asgard (array[string]) - all Asgard vaults public key + yggdrasil (array[string]) - all Yggdrasil vaults publikc keys + Body { ""asgard"": [ ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"" ], ""yggdrasil"": [] } # Group Network This section document all API related to THORChain network ## Network [/thorchain/network] + Attributes + bond_reward_rune (string) - total amount of awarded rune for node operators + total_bond_units (string) - total amount of bond units + total_reserve (string) - total amount of reserve in rune + burned_bep_2_rune (string) - total amount of burned BEP2 rune to native rune + burned_erc_20_rune (string) - total amount of burned ERC20 rune to native rune ### Get network data [GET] Retrieve network data from THORChain + Response 200 (applicaton/json) + Attributes (Network) + Body { ""bond_reward_rune"": ""857134475040"", ""total_bond_units"": ""0"", ""total_reserve"": ""21999180112172346"", ""burned_bep_2_rune"": ""674699077345087"", ""burned_erc_20_rune"": ""66369401654835"" } ## InboundAddresses [/thorchain/inbound_addresses] Inbound addresses will return a list of addresses, one per chain. The address might change frequently if THORChain has multiple Asgards. + Attributes + chain (string) - chain + pub_key (string) - public key + address (string) - address + halted (boolean) - indicate whether this chain has halted + gas_rate (string) - gas rate, for ETH, it is in Gwei, for BTC/BCH/LTC it is gas_rate per vbyte ### Get inbound addresses [GET] Retrieve all the inbound addresses from THORChain + Response 200 (application/json) + Attributes (array[InboundAddresses]) + Body [ { ""chain"": ""BCH"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""qzvhxqm3clrhewqllfmt2ekuaa7puhwpns3kl5nj7a"", ""gas_rate"": ""6"" }, { ""chain"": ""BNB"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""bnb1n9esxuw8ca7ts8l6w66kdh800s09msvul6vlse"", ""halted"": true, ""gas_rate"": ""11250"" }, { ""chain"": ""BTC"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""bc1qn9esxuw8ca7ts8l6w66kdh800s09msvutydc46"", ""gas_rate"": ""214"" }, { ""chain"": ""ETH"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""0x1091c4de6a3cf09cda00abdaed42c7c3b69c83ec"", ""router"": ""0x42A5Ed456650a09Dc10EBc6361A7480fDd61f27B"", ""gas_rate"": ""40"" }, { ""chain"": ""LTC"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""ltc1qn9esxuw8ca7ts8l6w66kdh800s09msvu0chud2"", ""gas_rate"": ""147"" } ] ## LastBlockHeight [/thorchain/lastblock/{chain}] Last block height per chain + Parameters + chain: `BNB` (string,required) - chain + Attributes + chain (string) - chain + last_observed_in (number) - last observed in block height + last_sign_out (number) - last sign out block height + thorchain (number) - current thorchain block height ### Get last block height per chain [GET] Retrieve the last block height information about the request chain + Response 200 (application/json) + Attributes (array[LastBlockHeight]) + Body [ { ""chain"": ""BNB"", ""last_observed_in"": 159097122, ""last_signed_out"": 233726, ""thorchain"": 233735 } ] ### Get all last block height [GET /thorchain/lastblock] Retrieve lastest block infomation across all chains + Response 200 (application/json) + Attributes (array[LastBlockHeight]) + Body [ { ""chain"": ""BCH"", ""last_observed_in"": 684829, ""last_signed_out"": 233674, ""thorchain"": 233727 }, { ""chain"": ""BNB"", ""last_observed_in"": 159097122, ""last_signed_out"": 233674, ""thorchain"": 233727 }, { ""chain"": ""BTC"", ""last_observed_in"": 680532, ""last_signed_out"": 233674, ""thorchain"": 233727 }, { ""chain"": ""ETH"", ""last_observed_in"": 12308554, ""last_signed_out"": 233674, ""thorchain"": 233727 }, { ""chain"": ""LTC"", ""last_observed_in"": 2040853, ""last_signed_out"": 233674, ""thorchain"": 233727 } ] ## Version [/thorchain/version] Network version using semantic version + Attributes + current (string) - current version + next (string) - next version ### Get current network version [GET] Retrieve current network version from THORChain + Response 200 (application/json) + Attributes (Version) + Body { ""current"": ""0.17.0"", ""next"": ""0.17.0"" } ## Constants [/thorchain/constants] Constant values used by THORChain, some of the values can be overrided by mimir ### Get constant values from THORChain [GET] Retrieve constant values from THORChain + Response 200 (application/json) + Body { ""int_64_values"": { ""AsgardSize"": 40, ""BadValidatorRate"": 43200, ""BadValidatorRedline"": 3, ""BlocksPerYear"": 5256000, ""ChurnInterval"": 43200, ""ChurnRetryInterval"": 720, ""DesiredValidatorSet"": 100, ""DoubleSignMaxAge"": 24, ""EmissionCurve"": 6, ""FailKeygenSlashPoints"": 720, ""FailKeysignSlashPoints"": 2, ""FullImpLossProtectionBlocks"": 1440000, ""FundMigrationInterval"": 360, ""IncentiveCurve"": 100, ""JailTimeKeygen"": 4320, ""JailTimeKeysign"": 60, ""LackOfObservationPenalty"": 2, ""LiquidityLockUpBlocks"": 0, ""MaxAvailablePools"": 100, ""MaxSwapsPerBlock"": 100, ""MinRunePoolDepth"": 1000000000000, ""MinSlashPointsForBadValidator"": 100, ""MinSwapsPerBlock"": 10, ""MinimumBondInRune"": 100000000000000, ""MinimumNodesForBFT"": 4, ""MinimumNodesForYggdrasil"": 6, ""NativeTransactionFee"": 2000000, ""ObservationDelayFlexibility"": 10, ""ObserveSlashPoints"": 1, ""OldValidatorRate"": 43200, ""OutboundTransactionFee"": 2000000, ""PoolCycle"": 43200, ""SigningTransactionPeriod"": 300, ""StagedPoolCost"": 1000000000, ""VirtualMultSynths"": 2, ""YggFundLimit"": 50, ""YggFundRetry"": 1000 }, ""bool_values"": { ""StrictBondLiquidityRatio"": true }, ""string_values"": { ""DefaultPoolStatus"": ""Staged"" } } ## Ragnarok [/thorchain/ragnarok] This is just a true/false indicate whether THORChain is in Ragnarok or not ### Get Ragnarok status [GET] + Response 200 (application/json) + Attributes (boolean) + Body false # Group Queue ## OutboundQueue [/thorchain/queue] + Attributes + swap (number) - number of swaps in the queue + outbound (number) - number of outbound tx in the queue for customer + internal (number) - number of internal tx in the queue. internal tx include migration,yggdrasil+ ### Get outbound queue [GET] Retrieve the outbound queue information from THORChain + Response 200 (application/json) + Attributes (OutboundQueue) + Body { ""swap"": 0, ""outbound"": 0, ""internal"": 0 } ### Get outbound queue detail [GET /thorchain/queue/outbound] Get the list of tx out items in the queue + Response 200 (application/json) + Attributes (array[TxOutItem]) + Body [ { ""chain"": ""ETH"", ""to_address"": ""0xf42d7db7fde6060349d61ad29636df23cf03e4b1"", ""vault_pub_key"": ""tthorpub1addwnpepqtg7cdttvvy5wvchvwaytsklst483gmrf7cv42qkq392aa29h6cyv4p83ug"", ""coin"": { ""asset"": ""ETH.ETH"", ""amount"": ""158037"" }, ""memo"": ""MIGRATE:14701"", ""max_gas"": [ { ""asset"": ""ETH.ETH"", ""amount"": ""120000"" } ], ""gas_rate"": 1, ""in_hash"": ""0000000000000000000000000000000000000000000000000000000000000000"" } ] # Group Keygen / Keysign ## Keygen [/thorchain/keygen/{height}/{pubkey}] + Parameters + height: 1024 (int,required) - block height + pubkey (string,required) - node public key + Attributes + keygen_block + height (string) - block height + keygens (array[string]) - a list node public keys , indicate who should be part of this keygen + signature (string) - base64 encoded signaure of the keygen block ### Get Keygen [GET] Retrieve Keygen block from THORChain + Response 200 (application/json) + Attributes (Keygen) + Body { ""keygen_block"": { ""height"": ""1024"", ""keygens"": null }, ""signature"": ""NhKsZqRHNIMZ1Dw45/KQqFVcNBkl9B9/2MQrs5EinO4R5XlPSryW6SvRMe1f3//NLJ6yExqjmSBObR5+CClsqw=="" } ## Keysign [/thorchain/keysign/{height}/{pubkey}] + Parameters + height: 1024 (int,required) - block height + pubkey (string,required) - node public key + Attributes + keysign + height (string) - block height + tx_array (array[TxOutItem]) - list of tx out items + signature (string) - base64 encoded signature of keysign ### Get Keysign [GET] Retrieve Keysign information from THORChain + Response 200 (application/json) + Attributes (Keysign) + Body { ""keysign"": { ""height"": ""18"", ""tx_array"": [ { ""chain"": ""BNB"", ""to"": ""tbnb189az9plcke2c00vns0zfmllfpfdw67dtv25kgx"", ""vault_pubkey"": ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"", ""coin"": { ""asset"": ""BNB.BNB"", ""amount"": ""149887500"" }, ""memo"": ""REFUND:50B303717A650F5D93B28CF34C8971E06382003AFFDB92E5935F3540D187490B"", ""max_gas"": [ { ""asset"": ""BNB.BNB"", ""amount"": ""56250"" } ], ""gas_rate"": ""56250"", ""in_hash"": ""50B303717A650F5D93B28CF34C8971E06382003AFFDB92E5935F3540D187490B"", ""out_hash"": ""601FB5AD52259BB023BC93996F40640CCC088B04528EB829E8FE9E9AC82F81C4"" } ] }, ""signature"": ""0cJZ7kFoe6h3VA9yC/D+joTtfq7pJibxTK6GsjpHayNjapNCig20cqqSUerscKTwRPxB2D9DJaYVJ1C41wM9Bw=="" } # Group THORNames ## THORName [/thorchain/thorname/{name}] + Parameters + name (string,required) - THORName name ### Get Keygen [GET] Retrieve THORName from THORChain + Response 200 (application/json) + Attributes (array[THORName]) + Body [ { ""name"": ""my-thorname"", ""chain"": ""THOR"", ""address"": ""thor1xxxxx"", ""expire_block_height"": 4000 } ] # Data Structures ## LiquidityProvider (object) + asset (string) - the asset of the non-rune asset + rune_address (string) - the rune address of the liquidity provider + asset_address (string) - the non-rune asset address of the liquidity provider + last_add (string) - block height of the last add + last_withdraw (string) - block height of the last withdraw + units (string) - the total number of units of the pool + pending_rune (string) - rune that has been provided, but not committed yet. Awaiting a provision of the non-rune asset + pending_asset (string) - asset + pending_tx_id (string) - pending tx id ## Coin (object) + asset (string) - asset + amount (string) = amount ## ObservedTx (object) + id (string) - transaction hash + chain (string) - chain + from_address (string) - from address + to_address (string) - to address + coins (array[Coin]) - coins + gas (array[Coin]) - amount of gas paid by the tx + memo (string) - memo ## TxOutItem (object) + chain (string) - chain + to (string) - to address + vault_pubkey (string) - vault public key + coin (Coin) - coin + memo (string) - memo + max_gas (Coin) - maxmum gas allowed to spend + gas_rate (string) - gas rate , signer has to use this gas rate to sign an outbound tx + in_hash (string) - inbound tx hash + out_hash (string) - outbound tx hash , this will be available after the txout item had been signed and observed back by bifrost ## ChainRouter (object) + chain (string) - chain + router (string) - router address ## ChainAddress (object) + chain (string) - chain + address (string) - address ",12267,True,2538.445179848154,median "TITLE crypto\\ripemd\\asm\\rmd-586.asm IF @Version LT 800 ECHO MASM version 8.00 or later is strongly recommended. ENDIF .486 .MODEL FLAT OPTION DOTNAME IF @Version LT 800 .text$ SEGMENT PAGE 'CODE' ELSE .text$ SEGMENT ALIGN(64) 'CODE' ENDIF ALIGN 16 _ripemd160_block_asm_data_order PROC PUBLIC $L_ripemd160_block_asm_data_order_begin:: mov edx,DWORD PTR 4[esp] mov eax,DWORD PTR 8[esp] push esi mov ecx,DWORD PTR [edx] push edi mov esi,DWORD PTR 4[edx] push ebp mov edi,DWORD PTR 8[edx] push ebx sub esp,108 $L000start: ; mov ebx,DWORD PTR [eax] mov ebp,DWORD PTR 4[eax] mov DWORD PTR [esp],ebx mov DWORD PTR 4[esp],ebp mov ebx,DWORD PTR 8[eax] mov ebp,DWORD PTR 12[eax] mov DWORD PTR 8[esp],ebx mov DWORD PTR 12[esp],ebp mov ebx,DWORD PTR 16[eax] mov ebp,DWORD PTR 20[eax] mov DWORD PTR 16[esp],ebx mov DWORD PTR 20[esp],ebp mov ebx,DWORD PTR 24[eax] mov ebp,DWORD PTR 28[eax] mov DWORD PTR 24[esp],ebx mov DWORD PTR 28[esp],ebp mov ebx,DWORD PTR 32[eax] mov ebp,DWORD PTR 36[eax] mov DWORD PTR 32[esp],ebx mov DWORD PTR 36[esp],ebp mov ebx,DWORD PTR 40[eax] mov ebp,DWORD PTR 44[eax] mov DWORD PTR 40[esp],ebx mov DWORD PTR 44[esp],ebp mov ebx,DWORD PTR 48[eax] mov ebp,DWORD PTR 52[eax] mov DWORD PTR 48[esp],ebx mov DWORD PTR 52[esp],ebp mov ebx,DWORD PTR 56[eax] mov ebp,DWORD PTR 60[eax] mov DWORD PTR 56[esp],ebx mov DWORD PTR 60[esp],ebp mov eax,edi mov ebx,DWORD PTR 12[edx] mov ebp,DWORD PTR 16[edx] ; 0 xor eax,ebx mov edx,DWORD PTR [esp] xor eax,esi add ecx,edx rol edi,10 add ecx,eax mov eax,esi rol ecx,11 add ecx,ebp ; 1 xor eax,edi mov edx,DWORD PTR 4[esp] xor eax,ecx add ebp,eax mov eax,ecx rol esi,10 add ebp,edx xor eax,esi rol ebp,14 add ebp,ebx ; 2 mov edx,DWORD PTR 8[esp] xor eax,ebp add ebx,edx rol ecx,10 add ebx,eax mov eax,ebp rol ebx,15 add ebx,edi ; 3 xor eax,ecx mov edx,DWORD PTR 12[esp] xor eax,ebx add edi,eax mov eax,ebx rol ebp,10 add edi,edx xor eax,ebp rol edi,12 add edi,esi ; 4 mov edx,DWORD PTR 16[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,5 add esi,ecx ; 5 xor eax,ebx mov edx,DWORD PTR 20[esp] xor eax,esi add ecx,eax mov eax,esi rol edi,10 add ecx,edx xor eax,edi rol ecx,8 add ecx,ebp ; 6 mov edx,DWORD PTR 24[esp] xor eax,ecx add ebp,edx rol esi,10 add ebp,eax mov eax,ecx rol ebp,7 add ebp,ebx ; 7 xor eax,esi mov edx,DWORD PTR 28[esp] xor eax,ebp add ebx,eax mov eax,ebp rol ecx,10 add ebx,edx xor eax,ecx rol ebx,9 add ebx,edi ; 8 mov edx,DWORD PTR 32[esp] xor eax,ebx add edi,edx rol ebp,10 add edi,eax mov eax,ebx rol edi,11 add edi,esi ; 9 xor eax,ebp mov edx,DWORD PTR 36[esp] xor eax,edi add esi,eax mov eax,edi rol ebx,10 add esi,edx xor eax,ebx rol esi,13 add esi,ecx ; 10 mov edx,DWORD PTR 40[esp] xor eax,esi add ecx,edx rol edi,10 add ecx,eax mov eax,esi rol ecx,14 add ecx,ebp ; 11 xor eax,edi mov edx,DWORD PTR 44[esp] xor eax,ecx add ebp,eax mov eax,ecx rol esi,10 add ebp,edx xor eax,esi rol ebp,15 add ebp,ebx ; 12 mov edx,DWORD PTR 48[esp] xor eax,ebp add ebx,edx rol ecx,10 add ebx,eax mov eax,ebp rol ebx,6 add ebx,edi ; 13 xor eax,ecx mov edx,DWORD PTR 52[esp] xor eax,ebx add edi,eax mov eax,ebx rol ebp,10 add edi,edx xor eax,ebp rol edi,7 add edi,esi ; 14 mov edx,DWORD PTR 56[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,9 add esi,ecx ; 15 xor eax,ebx mov edx,DWORD PTR 60[esp] xor eax,esi add ecx,eax mov eax,-1 rol edi,10 add ecx,edx mov edx,DWORD PTR 28[esp] rol ecx,8 add ecx,ebp ; 16 add ebp,edx mov edx,esi sub eax,ecx and edx,ecx and eax,edi or edx,eax mov eax,DWORD PTR 16[esp] rol esi,10 lea ebp,DWORD PTR 1518500249[edx*1+ebp] mov edx,-1 rol ebp,7 add ebp,ebx ; 17 add ebx,eax mov eax,ecx sub edx,ebp and eax,ebp and edx,esi or eax,edx mov edx,DWORD PTR 52[esp] rol ecx,10 lea ebx,DWORD PTR 1518500249[eax*1+ebx] mov eax,-1 rol ebx,6 add ebx,edi ; 18 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 4[esp] rol ebp,10 lea edi,DWORD PTR 1518500249[edx*1+edi] mov edx,-1 rol edi,8 add edi,esi ; 19 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 40[esp] rol ebx,10 lea esi,DWORD PTR 1518500249[eax*1+esi] mov eax,-1 rol esi,13 add esi,ecx ; 20 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 24[esp] rol edi,10 lea ecx,DWORD PTR 1518500249[edx*1+ecx] mov edx,-1 rol ecx,11 add ecx,ebp ; 21 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,DWORD PTR 60[esp] rol esi,10 lea ebp,DWORD PTR 1518500249[eax*1+ebp] mov eax,-1 rol ebp,9 add ebp,ebx ; 22 add ebx,edx mov edx,ecx sub eax,ebp and edx,ebp and eax,esi or edx,eax mov eax,DWORD PTR 12[esp] rol ecx,10 lea ebx,DWORD PTR 1518500249[edx*1+ebx] mov edx,-1 rol ebx,7 add ebx,edi ; 23 add edi,eax mov eax,ebp sub edx,ebx and eax,ebx and edx,ecx or eax,edx mov edx,DWORD PTR 48[esp] rol ebp,10 lea edi,DWORD PTR 1518500249[eax*1+edi] mov eax,-1 rol edi,15 add edi,esi ; 24 add esi,edx mov edx,ebx sub eax,edi and edx,edi and eax,ebp or edx,eax mov eax,DWORD PTR [esp] rol ebx,10 lea esi,DWORD PTR 1518500249[edx*1+esi] mov edx,-1 rol esi,7 add esi,ecx ; 25 add ecx,eax mov eax,edi sub edx,esi and eax,esi and edx,ebx or eax,edx mov edx,DWORD PTR 36[esp] rol edi,10 lea ecx,DWORD PTR 1518500249[eax*1+ecx] mov eax,-1 rol ecx,12 add ecx,ebp ; 26 add ebp,edx mov edx,esi sub eax,ecx and edx,ecx and eax,edi or edx,eax mov eax,DWORD PTR 20[esp] rol esi,10 lea ebp,DWORD PTR 1518500249[edx*1+ebp] mov edx,-1 rol ebp,15 add ebp,ebx ; 27 add ebx,eax mov eax,ecx sub edx,ebp and eax,ebp and edx,esi or eax,edx mov edx,DWORD PTR 8[esp] rol ecx,10 lea ebx,DWORD PTR 1518500249[eax*1+ebx] mov eax,-1 rol ebx,9 add ebx,edi ; 28 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 56[esp] rol ebp,10 lea edi,DWORD PTR 1518500249[edx*1+edi] mov edx,-1 rol edi,11 add edi,esi ; 29 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 44[esp] rol ebx,10 lea esi,DWORD PTR 1518500249[eax*1+esi] mov eax,-1 rol esi,7 add esi,ecx ; 30 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 32[esp] rol edi,10 lea ecx,DWORD PTR 1518500249[edx*1+ecx] mov edx,-1 rol ecx,13 add ecx,ebp ; 31 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1518500249[eax*1+ebp] sub edx,ecx rol ebp,12 add ebp,ebx ; 32 mov eax,DWORD PTR 12[esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[edx*1+ebx] sub eax,ebp rol ebx,11 add ebx,edi ; 33 mov edx,DWORD PTR 40[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1859775393[eax*1+edi] sub edx,ebx rol edi,13 add edi,esi ; 34 mov eax,DWORD PTR 56[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1859775393[edx*1+esi] sub eax,edi rol esi,6 add esi,ecx ; 35 mov edx,DWORD PTR 16[esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1859775393[eax*1+ecx] sub edx,esi rol ecx,7 add ecx,ebp ; 36 mov eax,DWORD PTR 36[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1859775393[edx*1+ebp] sub eax,ecx rol ebp,14 add ebp,ebx ; 37 mov edx,DWORD PTR 60[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[eax*1+ebx] sub edx,ebp rol ebx,9 add ebx,edi ; 38 mov eax,DWORD PTR 32[esp] or edx,ebx add edi,eax xor edx,ecx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 1859775393[edx*1+edi] sub eax,ebx rol edi,13 add edi,esi ; 39 mov edx,DWORD PTR 4[esp] or eax,edi add esi,edx xor eax,ebp mov edx,-1 rol ebx,10 lea esi,DWORD PTR 1859775393[eax*1+esi] sub edx,edi rol esi,15 add esi,ecx ; 40 mov eax,DWORD PTR 8[esp] or edx,esi add ecx,eax xor edx,ebx mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1859775393[edx*1+ecx] sub eax,esi rol ecx,14 add ecx,ebp ; 41 mov edx,DWORD PTR 28[esp] or eax,ecx add ebp,edx xor eax,edi mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1859775393[eax*1+ebp] sub edx,ecx rol ebp,8 add ebp,ebx ; 42 mov eax,DWORD PTR [esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[edx*1+ebx] sub eax,ebp rol ebx,13 add ebx,edi ; 43 mov edx,DWORD PTR 24[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1859775393[eax*1+edi] sub edx,ebx rol edi,6 add edi,esi ; 44 mov eax,DWORD PTR 52[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1859775393[edx*1+esi] sub eax,edi rol esi,5 add esi,ecx ; 45 mov edx,DWORD PTR 44[esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1859775393[eax*1+ecx] sub edx,esi rol ecx,12 add ecx,ebp ; 46 mov eax,DWORD PTR 20[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1859775393[edx*1+ebp] sub eax,ecx rol ebp,7 add ebp,ebx ; 47 mov edx,DWORD PTR 48[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[eax*1+ebx] mov eax,ecx rol ebx,5 add ebx,edi ; 48 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 4[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,11 add edi,esi ; 49 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 36[esp] rol ebx,10 lea esi,DWORD PTR 2400959708[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,12 add esi,ecx ; 50 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 44[esp] rol edi,10 lea ecx,DWORD PTR 2400959708[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,14 add ecx,ebp ; 51 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 40[esp] rol esi,10 lea ebp,DWORD PTR 2400959708[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,15 add ebp,ebx ; 52 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR [esp] rol ecx,10 lea ebx,DWORD PTR 2400959708[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,14 add ebx,edi ; 53 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 32[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,15 add edi,esi ; 54 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 48[esp] rol ebx,10 lea esi,DWORD PTR 2400959708[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,9 add esi,ecx ; 55 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 16[esp] rol edi,10 lea ecx,DWORD PTR 2400959708[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,8 add ecx,ebp ; 56 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 52[esp] rol esi,10 lea ebp,DWORD PTR 2400959708[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,9 add ebp,ebx ; 57 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 12[esp] rol ecx,10 lea ebx,DWORD PTR 2400959708[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,14 add ebx,edi ; 58 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 28[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,5 add edi,esi ; 59 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 60[esp] rol ebx,10 lea esi,DWORD PTR 2400959708[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,6 add esi,ecx ; 60 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 56[esp] rol edi,10 lea ecx,DWORD PTR 2400959708[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,8 add ecx,ebp ; 61 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 20[esp] rol esi,10 lea ebp,DWORD PTR 2400959708[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,6 add ebp,ebx ; 62 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 24[esp] rol ecx,10 lea ebx,DWORD PTR 2400959708[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,5 add ebx,edi ; 63 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 8[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax sub edx,ebp rol edi,12 add edi,esi ; 64 mov eax,DWORD PTR 16[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 2840853838[edx*1+esi] sub eax,ebx rol esi,9 add esi,ecx ; 65 mov edx,DWORD PTR [esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 2840853838[eax*1+ecx] sub edx,edi rol ecx,15 add ecx,ebp ; 66 mov eax,DWORD PTR 20[esp] or edx,esi add ebp,eax xor edx,ecx mov eax,-1 rol esi,10 lea ebp,DWORD PTR 2840853838[edx*1+ebp] sub eax,esi rol ebp,5 add ebp,ebx ; 67 mov edx,DWORD PTR 36[esp] or eax,ecx add ebx,edx xor eax,ebp mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 2840853838[eax*1+ebx] sub edx,ecx rol ebx,11 add ebx,edi ; 68 mov eax,DWORD PTR 28[esp] or edx,ebp add edi,eax xor edx,ebx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 2840853838[edx*1+edi] sub eax,ebp rol edi,6 add edi,esi ; 69 mov edx,DWORD PTR 48[esp] or eax,ebx add esi,edx xor eax,edi mov edx,-1 rol ebx,10 lea esi,DWORD PTR 2840853838[eax*1+esi] sub edx,ebx rol esi,8 add esi,ecx ; 70 mov eax,DWORD PTR 8[esp] or edx,edi add ecx,eax xor edx,esi mov eax,-1 rol edi,10 lea ecx,DWORD PTR 2840853838[edx*1+ecx] sub eax,edi rol ecx,13 add ecx,ebp ; 71 mov edx,DWORD PTR 40[esp] or eax,esi add ebp,edx xor eax,ecx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 2840853838[eax*1+ebp] sub edx,esi rol ebp,12 add ebp,ebx ; 72 mov eax,DWORD PTR 56[esp] or edx,ecx add ebx,eax xor edx,ebp mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 2840853838[edx*1+ebx] sub eax,ecx rol ebx,5 add ebx,edi ; 73 mov edx,DWORD PTR 4[esp] or eax,ebp add edi,edx xor eax,ebx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 2840853838[eax*1+edi] sub edx,ebp rol edi,12 add edi,esi ; 74 mov eax,DWORD PTR 12[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 2840853838[edx*1+esi] sub eax,ebx rol esi,13 add esi,ecx ; 75 mov edx,DWORD PTR 32[esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 2840853838[eax*1+ecx] sub edx,edi rol ecx,14 add ecx,ebp ; 76 mov eax,DWORD PTR 44[esp] or edx,esi add ebp,eax xor edx,ecx mov eax,-1 rol esi,10 lea ebp,DWORD PTR 2840853838[edx*1+ebp] sub eax,esi rol ebp,11 add ebp,ebx ; 77 mov edx,DWORD PTR 24[esp] or eax,ecx add ebx,edx xor eax,ebp mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 2840853838[eax*1+ebx] sub edx,ecx rol ebx,8 add ebx,edi ; 78 mov eax,DWORD PTR 60[esp] or edx,ebp add edi,eax xor edx,ebx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 2840853838[edx*1+edi] sub eax,ebp rol edi,5 add edi,esi ; 79 mov edx,DWORD PTR 52[esp] or eax,ebx add esi,edx xor eax,edi mov edx,DWORD PTR 128[esp] rol ebx,10 lea esi,DWORD PTR 2840853838[eax*1+esi] mov DWORD PTR 64[esp],ecx rol esi,6 add esi,ecx mov ecx,DWORD PTR [edx] mov DWORD PTR 68[esp],esi mov DWORD PTR 72[esp],edi mov esi,DWORD PTR 4[edx] mov DWORD PTR 76[esp],ebx mov edi,DWORD PTR 8[edx] mov DWORD PTR 80[esp],ebp mov ebx,DWORD PTR 12[edx] mov ebp,DWORD PTR 16[edx] ; 80 mov edx,-1 sub edx,ebx mov eax,DWORD PTR 20[esp] or edx,edi add ecx,eax xor edx,esi mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[edx*1+ecx] sub eax,edi rol ecx,8 add ecx,ebp ; 81 mov edx,DWORD PTR 56[esp] or eax,esi add ebp,edx xor eax,ecx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1352829926[eax*1+ebp] sub edx,esi rol ebp,9 add ebp,ebx ; 82 mov eax,DWORD PTR 28[esp] or edx,ecx add ebx,eax xor edx,ebp mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1352829926[edx*1+ebx] sub eax,ecx rol ebx,9 add ebx,edi ; 83 mov edx,DWORD PTR [esp] or eax,ebp add edi,edx xor eax,ebx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1352829926[eax*1+edi] sub edx,ebp rol edi,11 add edi,esi ; 84 mov eax,DWORD PTR 36[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1352829926[edx*1+esi] sub eax,ebx rol esi,13 add esi,ecx ; 85 mov edx,DWORD PTR 8[esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[eax*1+ecx] sub edx,edi rol ecx,15 add ecx,ebp ; 86 mov eax,DWORD PTR 44[esp] or edx,esi add ebp,eax xor edx,ecx mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1352829926[edx*1+ebp] sub eax,esi rol ebp,15 add ebp,ebx ; 87 mov edx,DWORD PTR 16[esp] or eax,ecx add ebx,edx xor eax,ebp mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1352829926[eax*1+ebx] sub edx,ecx rol ebx,5 add ebx,edi ; 88 mov eax,DWORD PTR 52[esp] or edx,ebp add edi,eax xor edx,ebx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 1352829926[edx*1+edi] sub eax,ebp rol edi,7 add edi,esi ; 89 mov edx,DWORD PTR 24[esp] or eax,ebx add esi,edx xor eax,edi mov edx,-1 rol ebx,10 lea esi,DWORD PTR 1352829926[eax*1+esi] sub edx,ebx rol esi,7 add esi,ecx ; 90 mov eax,DWORD PTR 60[esp] or edx,edi add ecx,eax xor edx,esi mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[edx*1+ecx] sub eax,edi rol ecx,8 add ecx,ebp ; 91 mov edx,DWORD PTR 32[esp] or eax,esi add ebp,edx xor eax,ecx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1352829926[eax*1+ebp] sub edx,esi rol ebp,11 add ebp,ebx ; 92 mov eax,DWORD PTR 4[esp] or edx,ecx add ebx,eax xor edx,ebp mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1352829926[edx*1+ebx] sub eax,ecx rol ebx,14 add ebx,edi ; 93 mov edx,DWORD PTR 40[esp] or eax,ebp add edi,edx xor eax,ebx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1352829926[eax*1+edi] sub edx,ebp rol edi,14 add edi,esi ; 94 mov eax,DWORD PTR 12[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1352829926[edx*1+esi] sub eax,ebx rol esi,12 add esi,ecx ; 95 mov edx,DWORD PTR 48[esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[eax*1+ecx] mov eax,edi rol ecx,6 add ecx,ebp ; 96 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 24[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,9 add ebp,ebx ; 97 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 44[esp] rol ecx,10 lea ebx,DWORD PTR 1548603684[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,13 add ebx,edi ; 98 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 12[esp] rol ebp,10 lea edi,DWORD PTR 1548603684[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,15 add edi,esi ; 99 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 28[esp] rol ebx,10 lea esi,DWORD PTR 1548603684[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,7 add esi,ecx ; 100 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR [esp] rol edi,10 lea ecx,DWORD PTR 1548603684[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,12 add ecx,ebp ; 101 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 52[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,8 add ebp,ebx ; 102 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 20[esp] rol ecx,10 lea ebx,DWORD PTR 1548603684[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,9 add ebx,edi ; 103 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 40[esp] rol ebp,10 lea edi,DWORD PTR 1548603684[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,11 add edi,esi ; 104 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 56[esp] rol ebx,10 lea esi,DWORD PTR 1548603684[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,7 add esi,ecx ; 105 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 60[esp] rol edi,10 lea ecx,DWORD PTR 1548603684[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,7 add ecx,ebp ; 106 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 32[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,12 add ebp,ebx ; 107 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 48[esp] rol ecx,10 lea ebx,DWORD PTR 1548603684[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,7 add ebx,edi ; 108 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 16[esp] rol ebp,10 lea edi,DWORD PTR 1548603684[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,6 add edi,esi ; 109 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 36[esp] rol ebx,10 lea esi,DWORD PTR 1548603684[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,15 add esi,ecx ; 110 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 4[esp] rol edi,10 lea ecx,DWORD PTR 1548603684[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,13 add ecx,ebp ; 111 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 8[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax sub edx,ecx rol ebp,11 add ebp,ebx ; 112 mov eax,DWORD PTR 60[esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1836072691[edx*1+ebx] sub eax,ebp rol ebx,9 add ebx,edi ; 113 mov edx,DWORD PTR 20[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1836072691[eax*1+edi] sub edx,ebx rol edi,7 add edi,esi ; 114 mov eax,DWORD PTR 4[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1836072691[edx*1+esi] sub eax,edi rol esi,15 add esi,ecx ; 115 mov edx,DWORD PTR 12[esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1836072691[eax*1+ecx] sub edx,esi rol ecx,11 add ecx,ebp ; 116 mov eax,DWORD PTR 28[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1836072691[edx*1+ebp] sub eax,ecx rol ebp,8 add ebp,ebx ; 117 mov edx,DWORD PTR 56[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1836072691[eax*1+ebx] sub edx,ebp rol ebx,6 add ebx,edi ; 118 mov eax,DWORD PTR 24[esp] or edx,ebx add edi,eax xor edx,ecx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 1836072691[edx*1+edi] sub eax,ebx rol edi,6 add edi,esi ; 119 mov edx,DWORD PTR 36[esp] or eax,edi add esi,edx xor eax,ebp mov edx,-1 rol ebx,10 lea esi,DWORD PTR 1836072691[eax*1+esi] sub edx,edi rol esi,14 add esi,ecx ; 120 mov eax,DWORD PTR 44[esp] or edx,esi add ecx,eax xor edx,ebx mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1836072691[edx*1+ecx] sub eax,esi rol ecx,12 add ecx,ebp ; 121 mov edx,DWORD PTR 32[esp] or eax,ecx add ebp,edx xor eax,edi mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1836072691[eax*1+ebp] sub edx,ecx rol ebp,13 add ebp,ebx ; 122 mov eax,DWORD PTR 48[esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1836072691[edx*1+ebx] sub eax,ebp rol ebx,5 add ebx,edi ; 123 mov edx,DWORD PTR 8[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1836072691[eax*1+edi] sub edx,ebx rol edi,14 add edi,esi ; 124 mov eax,DWORD PTR 40[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1836072691[edx*1+esi] sub eax,edi rol esi,13 add esi,ecx ; 125 mov edx,DWORD PTR [esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1836072691[eax*1+ecx] sub edx,esi rol ecx,13 add ecx,ebp ; 126 mov eax,DWORD PTR 16[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1836072691[edx*1+ebp] sub eax,ecx rol ebp,7 add ebp,ebx ; 127 mov edx,DWORD PTR 52[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,DWORD PTR 32[esp] rol ecx,10 lea ebx,DWORD PTR 1836072691[eax*1+ebx] mov eax,-1 rol ebx,5 add ebx,edi ; 128 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 24[esp] rol ebp,10 lea edi,DWORD PTR 2053994217[edx*1+edi] mov edx,-1 rol edi,15 add edi,esi ; 129 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 16[esp] rol ebx,10 lea esi,DWORD PTR 2053994217[eax*1+esi] mov eax,-1 rol esi,5 add esi,ecx ; 130 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 4[esp] rol edi,10 lea ecx,DWORD PTR 2053994217[edx*1+ecx] mov edx,-1 rol ecx,8 add ecx,ebp ; 131 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,DWORD PTR 12[esp] rol esi,10 lea ebp,DWORD PTR 2053994217[eax*1+ebp] mov eax,-1 rol ebp,11 add ebp,ebx ; 132 add ebx,edx mov edx,ecx sub eax,ebp and edx,ebp and eax,esi or edx,eax mov eax,DWORD PTR 44[esp] rol ecx,10 lea ebx,DWORD PTR 2053994217[edx*1+ebx] mov edx,-1 rol ebx,14 add ebx,edi ; 133 add edi,eax mov eax,ebp sub edx,ebx and eax,ebx and edx,ecx or eax,edx mov edx,DWORD PTR 60[esp] rol ebp,10 lea edi,DWORD PTR 2053994217[eax*1+edi] mov eax,-1 rol edi,14 add edi,esi ; 134 add esi,edx mov edx,ebx sub eax,edi and edx,edi and eax,ebp or edx,eax mov eax,DWORD PTR [esp] rol ebx,10 lea esi,DWORD PTR 2053994217[edx*1+esi] mov edx,-1 rol esi,6 add esi,ecx ; 135 add ecx,eax mov eax,edi sub edx,esi and eax,esi and edx,ebx or eax,edx mov edx,DWORD PTR 20[esp] rol edi,10 lea ecx,DWORD PTR 2053994217[eax*1+ecx] mov eax,-1 rol ecx,14 add ecx,ebp ; 136 add ebp,edx mov edx,esi sub eax,ecx and edx,ecx and eax,edi or edx,eax mov eax,DWORD PTR 48[esp] rol esi,10 lea ebp,DWORD PTR 2053994217[edx*1+ebp] mov edx,-1 rol ebp,6 add ebp,ebx ; 137 add ebx,eax mov eax,ecx sub edx,ebp and eax,ebp and edx,esi or eax,edx mov edx,DWORD PTR 8[esp] rol ecx,10 lea ebx,DWORD PTR 2053994217[eax*1+ebx] mov eax,-1 rol ebx,9 add ebx,edi ; 138 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 52[esp] rol ebp,10 lea edi,DWORD PTR 2053994217[edx*1+edi] mov edx,-1 rol edi,12 add edi,esi ; 139 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 36[esp] rol ebx,10 lea esi,DWORD PTR 2053994217[eax*1+esi] mov eax,-1 rol esi,9 add esi,ecx ; 140 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 28[esp] rol edi,10 lea ecx,DWORD PTR 2053994217[edx*1+ecx] mov edx,-1 rol ecx,12 add ecx,ebp ; 141 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,DWORD PTR 40[esp] rol esi,10 lea ebp,DWORD PTR 2053994217[eax*1+ebp] mov eax,-1 rol ebp,5 add ebp,ebx ; 142 add ebx,edx mov edx,ecx sub eax,ebp and edx,ebp and eax,esi or edx,eax mov eax,DWORD PTR 56[esp] rol ecx,10 lea ebx,DWORD PTR 2053994217[edx*1+ebx] mov edx,-1 rol ebx,15 add ebx,edi ; 143 add edi,eax mov eax,ebp sub edx,ebx and eax,ebx and edx,ecx or edx,eax mov eax,ebx rol ebp,10 lea edi,DWORD PTR 2053994217[edx*1+edi] xor eax,ebp rol edi,8 add edi,esi ; 144 mov edx,DWORD PTR 48[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,8 add esi,ecx ; 145 xor eax,ebx mov edx,DWORD PTR 60[esp] xor eax,esi add ecx,eax mov eax,esi rol edi,10 add ecx,edx xor eax,edi rol ecx,5 add ecx,ebp ; 146 mov edx,DWORD PTR 40[esp] xor eax,ecx add ebp,edx rol esi,10 add ebp,eax mov eax,ecx rol ebp,12 add ebp,ebx ; 147 xor eax,esi mov edx,DWORD PTR 16[esp] xor eax,ebp add ebx,eax mov eax,ebp rol ecx,10 add ebx,edx xor eax,ecx rol ebx,9 add ebx,edi ; 148 mov edx,DWORD PTR 4[esp] xor eax,ebx add edi,edx rol ebp,10 add edi,eax mov eax,ebx rol edi,12 add edi,esi ; 149 xor eax,ebp mov edx,DWORD PTR 20[esp] xor eax,edi add esi,eax mov eax,edi rol ebx,10 add esi,edx xor eax,ebx rol esi,5 add esi,ecx ; 150 mov edx,DWORD PTR 32[esp] xor eax,esi add ecx,edx rol edi,10 add ecx,eax mov eax,esi rol ecx,14 add ecx,ebp ; 151 xor eax,edi mov edx,DWORD PTR 28[esp] xor eax,ecx add ebp,eax mov eax,ecx rol esi,10 add ebp,edx xor eax,esi rol ebp,6 add ebp,ebx ; 152 mov edx,DWORD PTR 24[esp] xor eax,ebp add ebx,edx rol ecx,10 add ebx,eax mov eax,ebp rol ebx,8 add ebx,edi ; 153 xor eax,ecx mov edx,DWORD PTR 8[esp] xor eax,ebx add edi,eax mov eax,ebx rol ebp,10 add edi,edx xor eax,ebp rol edi,13 add edi,esi ; 154 mov edx,DWORD PTR 52[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,6 add esi,ecx ; 155 xor eax,ebx mov edx,DWORD PTR 56[esp] xor eax,esi add ecx,eax mov eax,esi rol edi,10 add ecx,edx xor eax,edi rol ecx,5 add ecx,ebp ; 156 mov edx,DWORD PTR [esp] xor eax,ecx add ebp,edx rol esi,10 add ebp,eax mov eax,ecx rol ebp,15 add ebp,ebx ; 157 xor eax,esi mov edx,DWORD PTR 12[esp] xor eax,ebp add ebx,eax mov eax,ebp rol ecx,10 add ebx,edx xor eax,ecx rol ebx,13 add ebx,edi ; 158 mov edx,DWORD PTR 36[esp] xor eax,ebx add edi,edx rol ebp,10 add edi,eax mov eax,ebx rol edi,11 add edi,esi ; 159 xor eax,ebp mov edx,DWORD PTR 44[esp] xor eax,edi add esi,eax rol ebx,10 add esi,edx mov edx,DWORD PTR 128[esp] rol esi,11 add esi,ecx mov eax,DWORD PTR 4[edx] add ebx,eax mov eax,DWORD PTR 72[esp] add ebx,eax mov eax,DWORD PTR 8[edx] add ebp,eax mov eax,DWORD PTR 76[esp] add ebp,eax mov eax,DWORD PTR 12[edx] add ecx,eax mov eax,DWORD PTR 80[esp] add ecx,eax mov eax,DWORD PTR 16[edx] add esi,eax mov eax,DWORD PTR 64[esp] add esi,eax mov eax,DWORD PTR [edx] add edi,eax mov eax,DWORD PTR 68[esp] add edi,eax mov eax,DWORD PTR 136[esp] mov DWORD PTR [edx],ebx mov DWORD PTR 4[edx],ebp mov DWORD PTR 8[edx],ecx sub eax,1 mov DWORD PTR 12[edx],esi mov DWORD PTR 16[edx],edi jle $L001get_out mov DWORD PTR 136[esp],eax mov edi,ecx mov eax,DWORD PTR 132[esp] mov ecx,ebx add eax,64 mov esi,ebp mov DWORD PTR 132[esp],eax jmp $L000start $L001get_out: add esp,108 pop ebx pop ebp pop edi pop esi ret _ripemd160_block_asm_data_order ENDP .text$ ENDS END ",16325,True,5946.0657727966245,median "############################################################################### # Copyright 2018 Intel Corporation # All Rights Reserved. # # If this software was obtained under the Intel Simplified Software License, # the following terms apply: # # The source code, information and material (""Material"") contained herein is # owned by Intel Corporation or its suppliers or licensors, and title to such # Material remains with Intel Corporation or its suppliers or licensors. The # Material contains proprietary information of Intel or its suppliers and # licensors. The Material is protected by worldwide copyright laws and treaty # provisions. No part of the Material may be used, copied, reproduced, # modified, published, uploaded, posted, transmitted, distributed or disclosed # in any way without Intel's prior express written permission. No license under # any patent, copyright or other intellectual property rights in the Material # is granted to or conferred upon you, either expressly, by implication, # inducement, estoppel or otherwise. Any license under such intellectual # property rights must be express and approved by Intel in writing. # # Unless otherwise agreed by Intel in writing, you may not remove or alter this # notice or any other notice embedded in Materials by Intel or Intel's # suppliers or licensors in any way. # # # If this software was obtained under the Apache License, Version 2.0 (the # ""License""), the following terms apply: # # 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. ############################################################################### .text .p2align 4, 0x90 CONST_TABLE: _poly: .quad 0x1, 0xC200000000000000 _twoone: .quad 0x1, 0x100000000 _u128_str: .byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 _mask1: .quad 0xffffffffffffffff, 0x0 _mask2: .quad 0x0, 0xffffffffffffffff _inc1: .quad 1,0 .p2align 4, 0x90 .globl _AesGcmPrecompute_avx _AesGcmPrecompute_avx: push %ebp mov %esp, %ebp push %esi call .L__0000gas_1 .L__0000gas_1: pop %esi sub $(.L__0000gas_1-CONST_TABLE), %esi movl (8)(%ebp), %eax movdqu (%eax), %xmm0 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movdqa %xmm0, %xmm4 psllq $(1), %xmm0 psrlq $(63), %xmm4 movdqa %xmm4, %xmm3 pslldq $(8), %xmm4 psrldq $(8), %xmm3 por %xmm4, %xmm0 pshufd $(36), %xmm3, %xmm4 pcmpeqd ((_twoone-CONST_TABLE))(%esi), %xmm4 pand ((_poly-CONST_TABLE))(%esi), %xmm4 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm1 pshufd $(78), %xmm1, %xmm5 pshufd $(78), %xmm0, %xmm3 pxor %xmm1, %xmm5 pxor %xmm0, %xmm3 pclmulqdq $(0), %xmm3, %xmm5 movdqa %xmm1, %xmm4 pclmulqdq $(0), %xmm0, %xmm1 pxor %xmm3, %xmm3 pclmulqdq $(17), %xmm0, %xmm4 pxor %xmm1, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm3 pslldq $(8), %xmm5 pxor %xmm3, %xmm4 pxor %xmm5, %xmm1 movdqa %xmm1, %xmm3 psllq $(1), %xmm3 pxor %xmm1, %xmm3 psllq $(5), %xmm3 pxor %xmm1, %xmm3 psllq $(57), %xmm3 movdqa %xmm3, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm3 pxor %xmm5, %xmm1 pxor %xmm3, %xmm4 movdqa %xmm1, %xmm5 psrlq $(5), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm1 pxor %xmm4, %xmm1 movdqa %xmm1, %xmm2 pshufd $(78), %xmm2, %xmm5 pshufd $(78), %xmm1, %xmm3 pxor %xmm2, %xmm5 pxor %xmm1, %xmm3 pclmulqdq $(0), %xmm3, %xmm5 movdqa %xmm2, %xmm4 pclmulqdq $(0), %xmm1, %xmm2 pxor %xmm3, %xmm3 pclmulqdq $(17), %xmm1, %xmm4 pxor %xmm2, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm3 pslldq $(8), %xmm5 pxor %xmm3, %xmm4 pxor %xmm5, %xmm2 movdqa %xmm2, %xmm3 psllq $(1), %xmm3 pxor %xmm2, %xmm3 psllq $(5), %xmm3 pxor %xmm2, %xmm3 psllq $(57), %xmm3 movdqa %xmm3, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm3 pxor %xmm5, %xmm2 pxor %xmm3, %xmm4 movdqa %xmm2, %xmm5 psrlq $(5), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm2 pxor %xmm4, %xmm2 movl (12)(%ebp), %eax movdqu %xmm0, (%eax) movdqu %xmm1, (16)(%eax) movdqu %xmm2, (32)(%eax) pop %esi pop %ebp ret .p2align 4, 0x90 .globl _AesGcmMulGcm_avx _AesGcmMulGcm_avx: push %ebp mov %esp, %ebp push %esi push %edi call .L__0001gas_2 .L__0001gas_2: pop %esi sub $(.L__0001gas_2-CONST_TABLE), %esi movl (8)(%ebp), %edi movl (12)(%ebp), %eax movdqa (%edi), %xmm0 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movdqa (%eax), %xmm1 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 psllq $(1), %xmm2 pxor %xmm0, %xmm2 psllq $(5), %xmm2 pxor %xmm0, %xmm2 psllq $(57), %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movdqa %xmm0, (%edi) pop %edi pop %esi pop %ebp ret .p2align 4, 0x90 .globl _AesGcmAuth_avx _AesGcmAuth_avx: push %ebp mov %esp, %ebp push %esi push %edi call .L__0002gas_3 .L__0002gas_3: pop %esi sub $(.L__0002gas_3-CONST_TABLE), %esi movl (8)(%ebp), %edi movdqa (%edi), %xmm0 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movl (20)(%ebp), %eax movdqa (%eax), %xmm1 movl (12)(%ebp), %ecx movl (16)(%ebp), %edx .p2align 4, 0x90 .Lauth_loopgas_3: movdqu (%ecx), %xmm2 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm2 add $(16), %ecx pxor %xmm2, %xmm0 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 psllq $(1), %xmm2 pxor %xmm0, %xmm2 psllq $(5), %xmm2 pxor %xmm0, %xmm2 psllq $(57), %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 sub $(16), %edx jnz .Lauth_loopgas_3 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movdqa %xmm0, (%edi) pop %edi pop %esi pop %ebp ret .p2align 4, 0x90 .globl _AesGcmEnc_avx _AesGcmEnc_avx: push %ebp mov %esp, %ebp push %ebx push %esi push %edi sub $(152), %esp lea (16)(%esp), %ebx and $(-16), %ebx movl (20)(%ebp), %eax call .L__0003gas_4 .L__0003gas_4: pop %esi sub $(.L__0003gas_4-CONST_TABLE), %esi movdqa ((_u128_str-CONST_TABLE))(%esi), %xmm4 movdqa ((_inc1-CONST_TABLE))(%esi), %xmm5 movl (36)(%ebp), %eax movl (40)(%ebp), %ecx movl (32)(%ebp), %edx movdqu (%eax), %xmm0 movdqu (%ecx), %xmm1 movdqu (%edx), %xmm2 pshufb %xmm4, %xmm0 movdqa %xmm0, (%ebx) movdqa %xmm1, (16)(%ebx) pshufb %xmm4, %xmm2 pxor %xmm1, %xmm1 movdqa %xmm2, (32)(%ebx) movdqa %xmm1, (48)(%ebx) movdqa %xmm1, (64)(%ebx) movdqa %xmm1, (80)(%ebx) movdqa %xmm4, (96)(%ebx) movdqa %xmm5, (112)(%ebx) movl (28)(%ebp), %ecx movl (12)(%ebp), %esi movl (8)(%ebp), %edi movl (16)(%ebp), %eax mov $(63), %edx and %eax, %edx and $(-64), %eax movl %eax, (128)(%ebx) movl %edx, (132)(%ebx) jz .Lsingle_block_procgas_4 .p2align 4, 0x90 .Lblks4_loopgas_4: movdqa (112)(%ebx), %xmm5 movdqa %xmm0, %xmm1 paddd %xmm5, %xmm1 movdqa %xmm1, %xmm2 paddd %xmm5, %xmm2 movdqa %xmm2, %xmm3 paddd %xmm5, %xmm3 movdqa %xmm3, %xmm4 paddd %xmm5, %xmm4 movdqa %xmm4, (%ebx) movdqa (96)(%ebx), %xmm5 movdqa (%ecx), %xmm0 lea (16)(%ecx), %eax pshufb %xmm5, %xmm1 pshufb %xmm5, %xmm2 pshufb %xmm5, %xmm3 pshufb %xmm5, %xmm4 pxor %xmm0, %xmm1 pxor %xmm0, %xmm2 pxor %xmm0, %xmm3 pxor %xmm0, %xmm4 movdqa (%eax), %xmm0 add $(16), %eax movl (24)(%ebp), %edx sub $(1), %edx .p2align 4, 0x90 .Lcipher4_loopgas_4: aesenc %xmm0, %xmm1 aesenc %xmm0, %xmm2 aesenc %xmm0, %xmm3 aesenc %xmm0, %xmm4 movdqa (%eax), %xmm0 add $(16), %eax dec %edx jnz .Lcipher4_loopgas_4 aesenclast %xmm0, %xmm1 aesenclast %xmm0, %xmm2 aesenclast %xmm0, %xmm3 aesenclast %xmm0, %xmm4 movdqa (16)(%ebx), %xmm0 movdqa %xmm4, (16)(%ebx) movdqu (%esi), %xmm4 movdqu (16)(%esi), %xmm5 movdqu (32)(%esi), %xmm6 movdqu (48)(%esi), %xmm7 add $(64), %esi pxor %xmm4, %xmm0 movdqu %xmm0, (%edi) pshufb (96)(%ebx), %xmm0 pxor (32)(%ebx), %xmm0 pxor %xmm5, %xmm1 movdqu %xmm1, (16)(%edi) pshufb (96)(%ebx), %xmm1 pxor (48)(%ebx), %xmm1 pxor %xmm6, %xmm2 movdqu %xmm2, (32)(%edi) pshufb (96)(%ebx), %xmm2 pxor (64)(%ebx), %xmm2 pxor %xmm7, %xmm3 movdqu %xmm3, (48)(%edi) pshufb (96)(%ebx), %xmm3 pxor (80)(%ebx), %xmm3 add $(64), %edi movl (44)(%ebp), %eax movdqa (32)(%eax), %xmm7 cmpl $(64), (128)(%ebx) je .Lcombine_hashgas_4 pshufd $(78), %xmm0, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm0, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm0, %xmm5 pclmulqdq $(0), %xmm7, %xmm0 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm0, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm0 movdqa %xmm0, %xmm4 psllq $(1), %xmm4 pxor %xmm0, %xmm4 psllq $(5), %xmm4 pxor %xmm0, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm0 pxor %xmm4, %xmm5 movdqa %xmm0, %xmm6 psrlq $(5), %xmm6 pxor %xmm0, %xmm6 psrlq $(1), %xmm6 pxor %xmm0, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm0 pxor %xmm5, %xmm0 pshufd $(78), %xmm1, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm1, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm1, %xmm5 pclmulqdq $(0), %xmm7, %xmm1 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm1, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm1 movdqa %xmm1, %xmm4 psllq $(1), %xmm4 pxor %xmm1, %xmm4 psllq $(5), %xmm4 pxor %xmm1, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm1 pxor %xmm4, %xmm5 movdqa %xmm1, %xmm6 psrlq $(5), %xmm6 pxor %xmm1, %xmm6 psrlq $(1), %xmm6 pxor %xmm1, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm1 pxor %xmm5, %xmm1 pshufd $(78), %xmm2, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm2, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm2, %xmm5 pclmulqdq $(0), %xmm7, %xmm2 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm2, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm2 movdqa %xmm2, %xmm4 psllq $(1), %xmm4 pxor %xmm2, %xmm4 psllq $(5), %xmm4 pxor %xmm2, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm2 pxor %xmm4, %xmm5 movdqa %xmm2, %xmm6 psrlq $(5), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm2 pxor %xmm5, %xmm2 pshufd $(78), %xmm3, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm3, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm3, %xmm5 pclmulqdq $(0), %xmm7, %xmm3 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm3, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm3 movdqa %xmm3, %xmm4 psllq $(1), %xmm4 pxor %xmm3, %xmm4 psllq $(5), %xmm4 pxor %xmm3, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm3 pxor %xmm4, %xmm5 movdqa %xmm3, %xmm6 psrlq $(5), %xmm6 pxor %xmm3, %xmm6 psrlq $(1), %xmm6 pxor %xmm3, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm3 pxor %xmm5, %xmm3 movdqa %xmm0, (32)(%ebx) movdqa %xmm1, (48)(%ebx) movdqa %xmm2, (64)(%ebx) movdqa %xmm3, (80)(%ebx) movdqa (%ebx), %xmm0 subl $(64), (128)(%ebx) jge .Lblks4_loopgas_4 .Lcombine_hashgas_4: pshufd $(78), %xmm0, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm0, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm0, %xmm5 pclmulqdq $(0), %xmm7, %xmm0 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm0, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm0 movdqa %xmm0, %xmm4 psllq $(1), %xmm4 pxor %xmm0, %xmm4 psllq $(5), %xmm4 pxor %xmm0, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm0 pxor %xmm4, %xmm5 movdqa %xmm0, %xmm6 psrlq $(5), %xmm6 pxor %xmm0, %xmm6 psrlq $(1), %xmm6 pxor %xmm0, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm0 pxor %xmm5, %xmm0 movdqa (16)(%eax), %xmm7 pshufd $(78), %xmm1, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm1, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm1, %xmm5 pclmulqdq $(0), %xmm7, %xmm1 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm1, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm1 movdqa %xmm1, %xmm4 psllq $(1), %xmm4 pxor %xmm1, %xmm4 psllq $(5), %xmm4 pxor %xmm1, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm1 pxor %xmm4, %xmm5 movdqa %xmm1, %xmm6 psrlq $(5), %xmm6 pxor %xmm1, %xmm6 psrlq $(1), %xmm6 pxor %xmm1, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm1 pxor %xmm5, %xmm1 movdqa (%eax), %xmm7 pshufd $(78), %xmm2, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm2, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm2, %xmm5 pclmulqdq $(0), %xmm7, %xmm2 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm2, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm2 movdqa %xmm2, %xmm4 psllq $(1), %xmm4 pxor %xmm2, %xmm4 psllq $(5), %xmm4 pxor %xmm2, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm2 pxor %xmm4, %xmm5 movdqa %xmm2, %xmm6 psrlq $(5), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm2 pxor %xmm5, %xmm2 pxor %xmm1, %xmm3 pxor %xmm2, %xmm3 pshufd $(78), %xmm3, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm3, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm3, %xmm5 pclmulqdq $(0), %xmm7, %xmm3 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm3, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm3 movdqa %xmm3, %xmm4 psllq $(1), %xmm4 pxor %xmm3, %xmm4 psllq $(5), %xmm4 pxor %xmm3, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm3 pxor %xmm4, %xmm5 movdqa %xmm3, %xmm6 psrlq $(5), %xmm6 pxor %xmm3, %xmm6 psrlq $(1), %xmm6 pxor %xmm3, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm3 pxor %xmm5, %xmm3 pxor %xmm0, %xmm3 movdqa %xmm3, (32)(%ebx) .Lsingle_block_procgas_4: cmpl $(0), (132)(%ebx) jz .Lquitgas_4 .p2align 4, 0x90 .Lblk_loopgas_4: movdqa (%ebx), %xmm0 movdqa %xmm0, %xmm1 paddd (112)(%ebx), %xmm1 movdqa %xmm1, (%ebx) movdqa (%ecx), %xmm0 lea (16)(%ecx), %eax pshufb (96)(%ebx), %xmm1 pxor %xmm0, %xmm1 movdqa (%eax), %xmm0 add $(16), %eax movl (24)(%ebp), %edx sub $(1), %edx .p2align 4, 0x90 .Lcipher_loopgas_4: aesenc %xmm0, %xmm1 movdqa (%eax), %xmm0 add $(16), %eax dec %edx jnz .Lcipher_loopgas_4 aesenclast %xmm0, %xmm1 movdqa (16)(%ebx), %xmm0 movdqa %xmm1, (16)(%ebx) movdqu (%esi), %xmm1 add $(16), %esi pxor %xmm1, %xmm0 movdqu %xmm0, (%edi) add $(16), %edi movl (44)(%ebp), %eax pshufb (96)(%ebx), %xmm0 pxor (32)(%ebx), %xmm0 movdqa (%eax), %xmm1 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 psllq $(1), %xmm2 pxor %xmm0, %xmm2 psllq $(5), %xmm2 pxor %xmm0, %xmm2 psllq $(57), %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 movdqa %xmm0, (32)(%ebx) subl $(16), (132)(%ebx) jg .Lblk_loopgas_4 .Lquitgas_4: movdqa (96)(%ebx), %xmm4 movdqa (%ebx), %xmm0 movdqa (16)(%ebx), %xmm1 movdqa (32)(%ebx), %xmm2 movl (36)(%ebp), %eax movl (40)(%ebp), %ecx movl (32)(%ebp), %edx pshufb %xmm4, %xmm0 movdqu %xmm0, (%eax) movdqu %xmm1, (%ecx) pshufb %xmm4, %xmm2 movdqu %xmm2, (%edx) add $(152), %esp pop %edi pop %esi pop %ebx pop %ebp ret .p2align 4, 0x90 .globl _AesGcmDec_avx _AesGcmDec_avx: push %ebp mov %esp, %ebp push %ebx push %esi push %edi sub $(152), %esp lea (16)(%esp), %ebx and $(-16), %ebx movl (20)(%ebp), %eax call .L__0004gas_5 .L__0004gas_5: pop %esi sub $(.L__0004gas_5-CONST_TABLE), %esi movdqa ((_u128_str-CONST_TABLE))(%esi), %xmm4 movdqa ((_inc1-CONST_TABLE))(%esi), %xmm5 movl (36)(%ebp), %eax movl (40)(%ebp), %ecx movl (32)(%ebp), %edx movdqu (%eax), %xmm0 movdqu (%ecx), %xmm1 movdqu (%edx), %xmm2 pshufb %xmm4, %xmm0 movdqa %xmm0, (%ebx) movdqa %xmm1, (16)(%ebx) pshufb %xmm4, %xmm2 pxor %xmm1, %xmm1 movdqa %xmm2, (32)(%ebx) movdqa %xmm1, (48)(%ebx) movdqa %xmm1, (64)(%ebx) movdqa %xmm1, (80)(%ebx) movdqa %xmm4, (96)(%ebx) movdqa %xmm5, (112)(%ebx) movl (28)(%ebp), %ecx movl (12)(%ebp), %esi movl (8)(%ebp), %edi movl (16)(%ebp), %eax mov $(63), %edx and %eax, %edx and $(-64), %eax movl %eax, (128)(%ebx) movl %edx, (132)(%ebx) jz .Lsingle_block_procgas_5 .p2align 4, 0x90 .Lblks4_loopgas_5: movdqa (112)(%ebx), %xmm5 movdqa %xmm0, %xmm1 paddd %xmm5, %xmm1 movdqa %xmm1, %xmm2 paddd %xmm5, %xmm2 movdqa %xmm2, %xmm3 paddd %xmm5, %xmm3 movdqa %xmm3, %xmm4 paddd %xmm5, %xmm4 movdqa %xmm4, (%ebx) movdqa (96)(%ebx), %xmm5 movdqa (%ecx), %xmm0 lea (16)(%ecx), %eax pshufb %xmm5, %xmm1 pshufb %xmm5, %xmm2 pshufb %xmm5, %xmm3 pshufb %xmm5, %xmm4 pxor %xmm0, %xmm1 pxor %xmm0, %xmm2 pxor %xmm0, %xmm3 pxor %xmm0, %xmm4 movdqa (%eax), %xmm0 add $(16), %eax movl (24)(%ebp), %edx sub $(1), %edx .p2align 4, 0x90 .Lcipher4_loopgas_5: aesenc %xmm0, %xmm1 aesenc %xmm0, %xmm2 aesenc %xmm0, %xmm3 aesenc %xmm0, %xmm4 movdqa (%eax), %xmm0 add $(16), %eax dec %edx jnz .Lcipher4_loopgas_5 aesenclast %xmm0, %xmm1 aesenclast %xmm0, %xmm2 aesenclast %xmm0, %xmm3 aesenclast %xmm0, %xmm4 movdqa (16)(%ebx), %xmm0 movdqa %xmm4, (16)(%ebx) movdqu (%esi), %xmm4 movdqu (16)(%esi), %xmm5 movdqu (32)(%esi), %xmm6 movdqu (48)(%esi), %xmm7 add $(64), %esi pxor %xmm4, %xmm0 movdqu %xmm0, (%edi) pshufb (96)(%ebx), %xmm4 pxor (32)(%ebx), %xmm4 pxor %xmm5, %xmm1 movdqu %xmm1, (16)(%edi) pshufb (96)(%ebx), %xmm5 pxor (48)(%ebx), %xmm5 pxor %xmm6, %xmm2 movdqu %xmm2, (32)(%edi) pshufb (96)(%ebx), %xmm6 pxor (64)(%ebx), %xmm6 pxor %xmm7, %xmm3 movdqu %xmm3, (48)(%edi) pshufb (96)(%ebx), %xmm7 pxor (80)(%ebx), %xmm7 add $(64), %edi movl (44)(%ebp), %eax movdqa (32)(%eax), %xmm0 cmpl $(64), (128)(%ebx) je .Lcombine_hashgas_5 pshufd $(78), %xmm4, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm4, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm4, %xmm2 pclmulqdq $(0), %xmm0, %xmm4 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm4, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm4 movdqa %xmm4, %xmm1 psllq $(1), %xmm1 pxor %xmm4, %xmm1 psllq $(5), %xmm1 pxor %xmm4, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm4 pxor %xmm1, %xmm2 movdqa %xmm4, %xmm3 psrlq $(5), %xmm3 pxor %xmm4, %xmm3 psrlq $(1), %xmm3 pxor %xmm4, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm4 pxor %xmm2, %xmm4 pshufd $(78), %xmm5, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm5, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm5, %xmm2 pclmulqdq $(0), %xmm0, %xmm5 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm5, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm5 movdqa %xmm5, %xmm1 psllq $(1), %xmm1 pxor %xmm5, %xmm1 psllq $(5), %xmm1 pxor %xmm5, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm5 pxor %xmm1, %xmm2 movdqa %xmm5, %xmm3 psrlq $(5), %xmm3 pxor %xmm5, %xmm3 psrlq $(1), %xmm3 pxor %xmm5, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm5 pxor %xmm2, %xmm5 pshufd $(78), %xmm6, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm6, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm6, %xmm2 pclmulqdq $(0), %xmm0, %xmm6 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm6, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm6 movdqa %xmm6, %xmm1 psllq $(1), %xmm1 pxor %xmm6, %xmm1 psllq $(5), %xmm1 pxor %xmm6, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm6 pxor %xmm1, %xmm2 movdqa %xmm6, %xmm3 psrlq $(5), %xmm3 pxor %xmm6, %xmm3 psrlq $(1), %xmm3 pxor %xmm6, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm6 pxor %xmm2, %xmm6 pshufd $(78), %xmm7, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm7, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm7, %xmm2 pclmulqdq $(0), %xmm0, %xmm7 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm7, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm7 movdqa %xmm7, %xmm1 psllq $(1), %xmm1 pxor %xmm7, %xmm1 psllq $(5), %xmm1 pxor %xmm7, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm7 pxor %xmm1, %xmm2 movdqa %xmm7, %xmm3 psrlq $(5), %xmm3 pxor %xmm7, %xmm3 psrlq $(1), %xmm3 pxor %xmm7, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm7 pxor %xmm2, %xmm7 movdqa %xmm4, (32)(%ebx) movdqa %xmm5, (48)(%ebx) movdqa %xmm6, (64)(%ebx) movdqa %xmm7, (80)(%ebx) movdqa (%ebx), %xmm0 subl $(64), (128)(%ebx) jge .Lblks4_loopgas_5 .Lcombine_hashgas_5: pshufd $(78), %xmm4, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm4, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm4, %xmm2 pclmulqdq $(0), %xmm0, %xmm4 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm4, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm4 movdqa %xmm4, %xmm1 psllq $(1), %xmm1 pxor %xmm4, %xmm1 psllq $(5), %xmm1 pxor %xmm4, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm4 pxor %xmm1, %xmm2 movdqa %xmm4, %xmm3 psrlq $(5), %xmm3 pxor %xmm4, %xmm3 psrlq $(1), %xmm3 pxor %xmm4, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm4 pxor %xmm2, %xmm4 movdqa (16)(%eax), %xmm0 pshufd $(78), %xmm5, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm5, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm5, %xmm2 pclmulqdq $(0), %xmm0, %xmm5 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm5, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm5 movdqa %xmm5, %xmm1 psllq $(1), %xmm1 pxor %xmm5, %xmm1 psllq $(5), %xmm1 pxor %xmm5, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm5 pxor %xmm1, %xmm2 movdqa %xmm5, %xmm3 psrlq $(5), %xmm3 pxor %xmm5, %xmm3 psrlq $(1), %xmm3 pxor %xmm5, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm5 pxor %xmm2, %xmm5 movdqa (%eax), %xmm0 pshufd $(78), %xmm6, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm6, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm6, %xmm2 pclmulqdq $(0), %xmm0, %xmm6 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm6, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm6 movdqa %xmm6, %xmm1 psllq $(1), %xmm1 pxor %xmm6, %xmm1 psllq $(5), %xmm1 pxor %xmm6, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm6 pxor %xmm1, %xmm2 movdqa %xmm6, %xmm3 psrlq $(5), %xmm3 pxor %xmm6, %xmm3 psrlq $(1), %xmm3 pxor %xmm6, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm6 pxor %xmm2, %xmm6 pxor %xmm5, %xmm7 pxor %xmm6, %xmm7 pshufd $(78), %xmm7, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm7, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm7, %xmm2 pclmulqdq $(0), %xmm0, %xmm7 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm7, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm7 movdqa %xmm7, %xmm1 psllq $(1), %xmm1 pxor %xmm7, %xmm1 psllq $(5), %xmm1 pxor %xmm7, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm7 pxor %xmm1, %xmm2 movdqa %xmm7, %xmm3 psrlq $(5), %xmm3 pxor %xmm7, %xmm3 psrlq $(1), %xmm3 pxor %xmm7, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm7 pxor %xmm2, %xmm7 pxor %xmm4, %xmm7 movdqa %xmm7, (32)(%ebx) .Lsingle_block_procgas_5: cmpl $(0), (132)(%ebx) jz .Lquitgas_5 .p2align 4, 0x90 .Lblk_loopgas_5: movdqa (%ebx), %xmm0 movdqa %xmm0, %xmm1 paddd (112)(%ebx), %xmm1 movdqa %xmm1, (%ebx) movdqa (%ecx), %xmm0 lea (16)(%ecx), %eax pshufb (96)(%ebx), %xmm1 pxor %xmm0, %xmm1 movdqa (%eax), %xmm0 add $(16), %eax movl (24)(%ebp), %edx sub $(1), %edx .p2align 4, 0x90 .Lcipher_loopgas_5: aesenc %xmm0, %xmm1 movdqa (%eax), %xmm0 add $(16), %eax dec %edx jnz .Lcipher_loopgas_5 aesenclast %xmm0, %xmm1 movdqa (16)(%ebx), %xmm0 movdqa %xmm1, (16)(%ebx) movdqu (%esi), %xmm1 add $(16), %esi pxor %xmm1, %xmm0 movdqu %xmm0, (%edi) add $(16), %edi movl (44)(%ebp), %eax pshufb (96)(%ebx), %xmm1 pxor (32)(%ebx), %xmm1 movdqa (%eax), %xmm0 pshufd $(78), %xmm1, %xmm4 pshufd $(78), %xmm0, %xmm2 pxor %xmm1, %xmm4 pxor %xmm0, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm1, %xmm3 pclmulqdq $(0), %xmm0, %xmm1 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm0, %xmm3 pxor %xmm1, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm1 movdqa %xmm1, %xmm2 psllq $(1), %xmm2 pxor %xmm1, %xmm2 psllq $(5), %xmm2 pxor %xmm1, %xmm2 psllq $(57), %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm1 pxor %xmm2, %xmm3 movdqa %xmm1, %xmm4 psrlq $(5), %xmm4 pxor %xmm1, %xmm4 psrlq $(1), %xmm4 pxor %xmm1, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm1 pxor %xmm3, %xmm1 movdqa %xmm1, (32)(%ebx) subl $(16), (132)(%ebx) jg .Lblk_loopgas_5 .Lquitgas_5: movdqa (96)(%ebx), %xmm4 movdqa (%ebx), %xmm0 movdqa (16)(%ebx), %xmm1 movdqa (32)(%ebx), %xmm2 movl (36)(%ebp), %eax movl (40)(%ebp), %ecx movl (32)(%ebp), %edx pshufb %xmm4, %xmm0 movdqu %xmm0, (%eax) movdqu %xmm1, (%ecx) pshufb %xmm4, %xmm2 movdqu %xmm2, (%edx) add $(152), %esp pop %edi pop %esi pop %ebx pop %ebp ret ",16283,True,4908.494785291305,median ";***************************************************************************** ;* x86inc.asm: x264asm abstraction layer ;***************************************************************************** ;* Copyright (C) 2005-2013 x264 project ;* ;* Authors: Loren Merritt ;* Anton Mitrofanov ;* Fiona Glaser ;* Henrik Gramner ;* ;* Permission to use, copy, modify, and/or distribute this software for any ;* purpose with or without fee is hereby granted, provided that the above ;* copyright notice and this permission notice appear in all copies. ;* ;* THE SOFTWARE IS PROVIDED ""AS IS"" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ;* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ;* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ;* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ;* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ;* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;***************************************************************************** ; This is a header file for the x264ASM assembly language, which uses ; NASM/YASM syntax combined with a large number of macros to provide easy ; abstraction between different calling conventions (x86_32, win64, linux64). ; It also has various other useful features to simplify writing the kind of ; DSP functions that are most often used in x264. ; Unlike the rest of x264, this file is available under an ISC license, as it ; has significant usefulness outside of x264 and we want it to be available ; to the largest audience possible. Of course, if you modify it for your own ; purposes to add a new feature, we strongly encourage contributing a patch ; as this feature might be useful for others as well. Send patches or ideas ; to x264-devel@videolan.org . %ifndef private_prefix %define private_prefix x264 %endif %ifndef public_prefix %define public_prefix private_prefix %endif %define WIN64 0 %define UNIX64 0 %if ARCH_X86_64 %ifidn __OUTPUT_FORMAT__,win32 %define WIN64 1 %elifidn __OUTPUT_FORMAT__,win64 %define WIN64 1 %elifidn __OUTPUT_FORMAT__,x64 %define WIN64 1 %else %define UNIX64 1 %endif %endif %ifdef PREFIX %define mangle(x) _ %+ x %else %define mangle(x) x %endif ; aout does not support align= ; NOTE: This section is out of sync with x264, in order to ; keep supporting OS/2. %macro SECTION_RODATA 0-1 16 %ifidn __OUTPUT_FORMAT__,aout section .text %else SECTION .rodata align=%1 %endif %endmacro %macro SECTION_TEXT 0-1 16 %ifidn __OUTPUT_FORMAT__,aout SECTION .text %else SECTION .text align=%1 %endif %endmacro %if WIN64 %define PIC %elif ARCH_X86_64 == 0 ; x86_32 doesn't require PIC. ; Some distros prefer shared objects to be PIC, but nothing breaks if ; the code contains a few textrels, so we'll skip that complexity. %undef PIC %endif %ifdef PIC default rel %endif %macro CPUNOP 1 %if HAVE_CPUNOP CPU %1 %endif %endmacro ; Macros to eliminate most code duplication between x86_32 and x86_64: ; Currently this works only for leaf functions which load all their arguments ; into registers at the start, and make no other use of the stack. Luckily that ; covers most of x264's asm. ; PROLOGUE: ; %1 = number of arguments. loads them from stack if needed. ; %2 = number of registers used. pushes callee-saved regs if needed. ; %3 = number of xmm registers used. pushes callee-saved xmm regs if needed. ; %4 = (optional) stack size to be allocated. If not aligned (x86-32 ICC 10.x, ; MSVC or YMM), the stack will be manually aligned (to 16 or 32 bytes), ; and an extra register will be allocated to hold the original stack ; pointer (to not invalidate r0m etc.). To prevent the use of an extra ; register as stack pointer, request a negative stack size. ; %4+/%5+ = list of names to define to registers ; PROLOGUE can also be invoked by adding the same options to cglobal ; e.g. ; cglobal foo, 2,3,0, dst, src, tmp ; declares a function (foo), taking two args (dst and src) and one local variable (tmp) ; TODO Some functions can use some args directly from the stack. If they're the ; last args then you can just not declare them, but if they're in the middle ; we need more flexible macro. ; RET: ; Pops anything that was pushed by PROLOGUE, and returns. ; REP_RET: ; Use this instead of RET if it's a branch target. ; registers: ; rN and rNq are the native-size register holding function argument N ; rNd, rNw, rNb are dword, word, and byte size ; rNh is the high 8 bits of the word size ; rNm is the original location of arg N (a register or on the stack), dword ; rNmp is native size %macro DECLARE_REG 2-3 %define r%1q %2 %define r%1d %2d %define r%1w %2w %define r%1b %2b %define r%1h %2h %define %2q %2 %if %0 == 2 %define r%1m %2d %define r%1mp %2 %elif ARCH_X86_64 ; memory %define r%1m [rstk + stack_offset + %3] %define r%1mp qword r %+ %1 %+ m %else %define r%1m [rstk + stack_offset + %3] %define r%1mp dword r %+ %1 %+ m %endif %define r%1 %2 %endmacro %macro DECLARE_REG_SIZE 3 %define r%1q r%1 %define e%1q r%1 %define r%1d e%1 %define e%1d e%1 %define r%1w %1 %define e%1w %1 %define r%1h %3 %define e%1h %3 %define r%1b %2 %define e%1b %2 %if ARCH_X86_64 == 0 %define r%1 e%1 %endif %endmacro DECLARE_REG_SIZE ax, al, ah DECLARE_REG_SIZE bx, bl, bh DECLARE_REG_SIZE cx, cl, ch DECLARE_REG_SIZE dx, dl, dh DECLARE_REG_SIZE si, sil, null DECLARE_REG_SIZE di, dil, null DECLARE_REG_SIZE bp, bpl, null ; t# defines for when per-arch register allocation is more complex than just function arguments %macro DECLARE_REG_TMP 1-* %assign %%i 0 %rep %0 CAT_XDEFINE t, %%i, r%1 %assign %%i %%i+1 %rotate 1 %endrep %endmacro %macro DECLARE_REG_TMP_SIZE 0-* %rep %0 %define t%1q t%1 %+ q %define t%1d t%1 %+ d %define t%1w t%1 %+ w %define t%1h t%1 %+ h %define t%1b t%1 %+ b %rotate 1 %endrep %endmacro DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 %if ARCH_X86_64 %define gprsize 8 %else %define gprsize 4 %endif %macro PUSH 1 push %1 %ifidn rstk, rsp %assign stack_offset stack_offset+gprsize %endif %endmacro %macro POP 1 pop %1 %ifidn rstk, rsp %assign stack_offset stack_offset-gprsize %endif %endmacro %macro PUSH_IF_USED 1-* %rep %0 %if %1 < regs_used PUSH r%1 %endif %rotate 1 %endrep %endmacro %macro POP_IF_USED 1-* %rep %0 %if %1 < regs_used pop r%1 %endif %rotate 1 %endrep %endmacro %macro LOAD_IF_USED 1-* %rep %0 %if %1 < num_args mov r%1, r %+ %1 %+ mp %endif %rotate 1 %endrep %endmacro %macro SUB 2 sub %1, %2 %ifidn %1, rstk %assign stack_offset stack_offset+(%2) %endif %endmacro %macro ADD 2 add %1, %2 %ifidn %1, rstk %assign stack_offset stack_offset-(%2) %endif %endmacro %macro movifnidn 2 %ifnidn %1, %2 mov %1, %2 %endif %endmacro %macro movsxdifnidn 2 %ifnidn %1, %2 movsxd %1, %2 %endif %endmacro %macro ASSERT 1 %if (%1) == 0 %error assert failed %endif %endmacro %macro DEFINE_ARGS 0-* %ifdef n_arg_names %assign %%i 0 %rep n_arg_names CAT_UNDEF arg_name %+ %%i, q CAT_UNDEF arg_name %+ %%i, d CAT_UNDEF arg_name %+ %%i, w CAT_UNDEF arg_name %+ %%i, h CAT_UNDEF arg_name %+ %%i, b CAT_UNDEF arg_name %+ %%i, m CAT_UNDEF arg_name %+ %%i, mp CAT_UNDEF arg_name, %%i %assign %%i %%i+1 %endrep %endif %xdefine %%stack_offset stack_offset %undef stack_offset ; so that the current value of stack_offset doesn't get baked in by xdefine %assign %%i 0 %rep %0 %xdefine %1q r %+ %%i %+ q %xdefine %1d r %+ %%i %+ d %xdefine %1w r %+ %%i %+ w %xdefine %1h r %+ %%i %+ h %xdefine %1b r %+ %%i %+ b %xdefine %1m r %+ %%i %+ m %xdefine %1mp r %+ %%i %+ mp CAT_XDEFINE arg_name, %%i, %1 %assign %%i %%i+1 %rotate 1 %endrep %xdefine stack_offset %%stack_offset %assign n_arg_names %0 %endmacro %macro ALLOC_STACK 1-2 0 ; stack_size, n_xmm_regs (for win64 only) %ifnum %1 %if %1 != 0 %assign %%stack_alignment ((mmsize + 15) & ~15) %assign stack_size %1 %if stack_size < 0 %assign stack_size -stack_size %endif %assign stack_size_padded stack_size %if WIN64 %assign stack_size_padded stack_size_padded + 32 ; reserve 32 bytes for shadow space %if mmsize != 8 %assign xmm_regs_used %2 %if xmm_regs_used > 8 %assign stack_size_padded stack_size_padded + (xmm_regs_used-8)*16 %endif %endif %endif %if mmsize <= 16 && HAVE_ALIGNED_STACK %assign stack_size_padded stack_size_padded + %%stack_alignment - gprsize - (stack_offset & (%%stack_alignment - 1)) SUB rsp, stack_size_padded %else %assign %%reg_num (regs_used - 1) %xdefine rstk r %+ %%reg_num ; align stack, and save original stack location directly above ; it, i.e. in [rsp+stack_size_padded], so we can restore the ; stack in a single instruction (i.e. mov rsp, rstk or mov ; rsp, [rsp+stack_size_padded]) mov rstk, rsp %if %1 < 0 ; need to store rsp on stack sub rsp, gprsize+stack_size_padded and rsp, ~(%%stack_alignment-1) %xdefine rstkm [rsp+stack_size_padded] mov rstkm, rstk %else ; can keep rsp in rstk during whole function sub rsp, stack_size_padded and rsp, ~(%%stack_alignment-1) %xdefine rstkm rstk %endif %endif WIN64_PUSH_XMM %endif %endif %endmacro %macro SETUP_STACK_POINTER 1 %ifnum %1 %if %1 != 0 && (HAVE_ALIGNED_STACK == 0 || mmsize == 32) %if %1 > 0 %assign regs_used (regs_used + 1) %elif ARCH_X86_64 && regs_used == num_args && num_args <= 4 + UNIX64 * 2 %warning ""Stack pointer will overwrite register argument"" %endif %endif %endif %endmacro %macro DEFINE_ARGS_INTERNAL 3+ %ifnum %2 DEFINE_ARGS %3 %elif %1 == 4 DEFINE_ARGS %2 %elif %1 > 4 DEFINE_ARGS %2, %3 %endif %endmacro %if WIN64 ; Windows x64 ;================================================= DECLARE_REG 0, rcx DECLARE_REG 1, rdx DECLARE_REG 2, R8 DECLARE_REG 3, R9 DECLARE_REG 4, R10, 40 DECLARE_REG 5, R11, 48 DECLARE_REG 6, rax, 56 DECLARE_REG 7, rdi, 64 DECLARE_REG 8, rsi, 72 DECLARE_REG 9, rbx, 80 DECLARE_REG 10, rbp, 88 DECLARE_REG 11, R12, 96 DECLARE_REG 12, R13, 104 DECLARE_REG 13, R14, 112 DECLARE_REG 14, R15, 120 %macro PROLOGUE 2-5+ 0 ; #args, #regs, #xmm_regs, [stack_size,] arg_names... %assign num_args %1 %assign regs_used %2 ASSERT regs_used >= num_args SETUP_STACK_POINTER %4 ASSERT regs_used <= 15 PUSH_IF_USED 7, 8, 9, 10, 11, 12, 13, 14 ALLOC_STACK %4, %3 %if mmsize != 8 && stack_size == 0 WIN64_SPILL_XMM %3 %endif LOAD_IF_USED 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 DEFINE_ARGS_INTERNAL %0, %4, %5 %endmacro %macro WIN64_PUSH_XMM 0 ; Use the shadow space to store XMM6 and XMM7, the rest needs stack space allocated. %if xmm_regs_used > 6 movaps [rstk + stack_offset + 8], xmm6 %endif %if xmm_regs_used > 7 movaps [rstk + stack_offset + 24], xmm7 %endif %if xmm_regs_used > 8 %assign %%i 8 %rep xmm_regs_used-8 movaps [rsp + (%%i-8)*16 + stack_size + 32], xmm %+ %%i %assign %%i %%i+1 %endrep %endif %endmacro %macro WIN64_SPILL_XMM 1 %assign xmm_regs_used %1 ASSERT xmm_regs_used <= 16 %if xmm_regs_used > 8 %assign stack_size_padded (xmm_regs_used-8)*16 + (~stack_offset&8) + 32 SUB rsp, stack_size_padded %endif WIN64_PUSH_XMM %endmacro %macro WIN64_RESTORE_XMM_INTERNAL 1 %assign %%pad_size 0 %if xmm_regs_used > 8 %assign %%i xmm_regs_used %rep xmm_regs_used-8 %assign %%i %%i-1 movaps xmm %+ %%i, [%1 + (%%i-8)*16 + stack_size + 32] %endrep %endif %if stack_size_padded > 0 %if stack_size > 0 && (mmsize == 32 || HAVE_ALIGNED_STACK == 0) mov rsp, rstkm %else add %1, stack_size_padded %assign %%pad_size stack_size_padded %endif %endif %if xmm_regs_used > 7 movaps xmm7, [%1 + stack_offset - %%pad_size + 24] %endif %if xmm_regs_used > 6 movaps xmm6, [%1 + stack_offset - %%pad_size + 8] %endif %endmacro %macro WIN64_RESTORE_XMM 1 WIN64_RESTORE_XMM_INTERNAL %1 %assign stack_offset (stack_offset-stack_size_padded) %assign xmm_regs_used 0 %endmacro %define has_epilogue regs_used > 7 || xmm_regs_used > 6 || mmsize == 32 || stack_size > 0 %macro RET 0 WIN64_RESTORE_XMM_INTERNAL rsp POP_IF_USED 14, 13, 12, 11, 10, 9, 8, 7 %if mmsize == 32 vzeroupper %endif AUTO_REP_RET %endmacro %elif ARCH_X86_64 ; *nix x64 ;============================================= DECLARE_REG 0, rdi DECLARE_REG 1, rsi DECLARE_REG 2, rdx DECLARE_REG 3, rcx DECLARE_REG 4, R8 DECLARE_REG 5, R9 DECLARE_REG 6, rax, 8 DECLARE_REG 7, R10, 16 DECLARE_REG 8, R11, 24 DECLARE_REG 9, rbx, 32 DECLARE_REG 10, rbp, 40 DECLARE_REG 11, R12, 48 DECLARE_REG 12, R13, 56 DECLARE_REG 13, R14, 64 DECLARE_REG 14, R15, 72 %macro PROLOGUE 2-5+ ; #args, #regs, #xmm_regs, [stack_size,] arg_names... %assign num_args %1 %assign regs_used %2 ASSERT regs_used >= num_args SETUP_STACK_POINTER %4 ASSERT regs_used <= 15 PUSH_IF_USED 9, 10, 11, 12, 13, 14 ALLOC_STACK %4 LOAD_IF_USED 6, 7, 8, 9, 10, 11, 12, 13, 14 DEFINE_ARGS_INTERNAL %0, %4, %5 %endmacro %define has_epilogue regs_used > 9 || mmsize == 32 || stack_size > 0 %macro RET 0 %if stack_size_padded > 0 %if mmsize == 32 || HAVE_ALIGNED_STACK == 0 mov rsp, rstkm %else add rsp, stack_size_padded %endif %endif POP_IF_USED 14, 13, 12, 11, 10, 9 %if mmsize == 32 vzeroupper %endif AUTO_REP_RET %endmacro %else ; X86_32 ;============================================================== DECLARE_REG 0, eax, 4 DECLARE_REG 1, ecx, 8 DECLARE_REG 2, edx, 12 DECLARE_REG 3, ebx, 16 DECLARE_REG 4, esi, 20 DECLARE_REG 5, edi, 24 DECLARE_REG 6, ebp, 28 %define rsp esp %macro DECLARE_ARG 1-* %rep %0 %define r%1m [rstk + stack_offset + 4*%1 + 4] %define r%1mp dword r%1m %rotate 1 %endrep %endmacro DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14 %macro PROLOGUE 2-5+ ; #args, #regs, #xmm_regs, [stack_size,] arg_names... %assign num_args %1 %assign regs_used %2 ASSERT regs_used >= num_args %if num_args > 7 %assign num_args 7 %endif %if regs_used > 7 %assign regs_used 7 %endif SETUP_STACK_POINTER %4 ASSERT regs_used <= 7 PUSH_IF_USED 3, 4, 5, 6 ALLOC_STACK %4 LOAD_IF_USED 0, 1, 2, 3, 4, 5, 6 DEFINE_ARGS_INTERNAL %0, %4, %5 %endmacro %define has_epilogue regs_used > 3 || mmsize == 32 || stack_size > 0 %macro RET 0 %if stack_size_padded > 0 %if mmsize == 32 || HAVE_ALIGNED_STACK == 0 mov rsp, rstkm %else add rsp, stack_size_padded %endif %endif POP_IF_USED 6, 5, 4, 3 %if mmsize == 32 vzeroupper %endif AUTO_REP_RET %endmacro %endif ;====================================================================== %if WIN64 == 0 %macro WIN64_SPILL_XMM 1 %endmacro %macro WIN64_RESTORE_XMM 1 %endmacro %macro WIN64_PUSH_XMM 0 %endmacro %endif ; On AMD cpus <=K10, an ordinary ret is slow if it immediately follows either ; a branch or a branch target. So switch to a 2-byte form of ret in that case. ; We can automatically detect ""follows a branch"", but not a branch target. ; (SSSE3 is a sufficient condition to know that your cpu doesn't have this problem.) %macro REP_RET 0 %if has_epilogue RET %else rep ret %endif %endmacro %define last_branch_adr $$ %macro AUTO_REP_RET 0 %ifndef cpuflags times ((last_branch_adr-$)>>31)+1 rep ; times 1 iff $ != last_branch_adr. %elif notcpuflag(ssse3) times ((last_branch_adr-$)>>31)+1 rep %endif ret %endmacro %macro BRANCH_INSTR 0-* %rep %0 %macro %1 1-2 %1 %2 %1 %%branch_instr: %xdefine last_branch_adr %%branch_instr %endmacro %rotate 1 %endrep %endmacro BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, jna, jnae, jb, jbe, jnb, jnbe, jc, jnc, js, jns, jo, jno, jp, jnp %macro TAIL_CALL 2 ; callee, is_nonadjacent %if has_epilogue call %1 RET %elif %2 jmp %1 %endif %endmacro ;============================================================================= ; arch-independent part ;============================================================================= %assign function_align 16 ; Begin a function. ; Applies any symbol mangling needed for C linkage, and sets up a define such that ; subsequent uses of the function name automatically refer to the mangled version. ; Appends cpuflags to the function name if cpuflags has been specified. ; The """" empty default parameter is a workaround for nasm, which fails if SUFFIX ; is empty and we call cglobal_internal with just %1 %+ SUFFIX (without %2). %macro cglobal 1-2+ """" ; name, [PROLOGUE args] cglobal_internal 1, %1 %+ SUFFIX, %2 %endmacro %macro cvisible 1-2+ """" ; name, [PROLOGUE args] cglobal_internal 0, %1 %+ SUFFIX, %2 %endmacro %macro cglobal_internal 2-3+ %if %1 %xdefine %%FUNCTION_PREFIX private_prefix %xdefine %%VISIBILITY hidden %else %xdefine %%FUNCTION_PREFIX public_prefix %xdefine %%VISIBILITY %endif %ifndef cglobaled_%2 %xdefine %2 mangle(%%FUNCTION_PREFIX %+ _ %+ %2) %xdefine %2.skip_prologue %2 %+ .skip_prologue CAT_XDEFINE cglobaled_, %2, 1 %endif %xdefine current_function %2 %ifidn __OUTPUT_FORMAT__,elf global %2:function %%VISIBILITY %else global %2 %endif align function_align %2: RESET_MM_PERMUTATION ; needed for x86-64, also makes disassembly somewhat nicer %xdefine rstk rsp ; copy of the original stack pointer, used when greater alignment than the known stack alignment is required %assign stack_offset 0 ; stack pointer offset relative to the return address %assign stack_size 0 ; amount of stack space that can be freely used inside a function %assign stack_size_padded 0 ; total amount of allocated stack space, including space for callee-saved xmm registers on WIN64 and alignment padding %assign xmm_regs_used 0 ; number of XMM registers requested, used for dealing with callee-saved registers on WIN64 %ifnidn %3, """" PROLOGUE %3 %endif %endmacro %macro cextern 1 %xdefine %1 mangle(private_prefix %+ _ %+ %1) CAT_XDEFINE cglobaled_, %1, 1 extern %1 %endmacro ; like cextern, but without the prefix %macro cextern_naked 1 %xdefine %1 mangle(%1) CAT_XDEFINE cglobaled_, %1, 1 extern %1 %endmacro %macro const 1-2+ %xdefine %1 mangle(private_prefix %+ _ %+ %1) %ifidn __OUTPUT_FORMAT__,elf global %1:data hidden %else global %1 %endif %1: %2 %endmacro ; This is needed for ELF, otherwise the GNU linker assumes the stack is ; executable by default. %ifidn __OUTPUT_FORMAT__,elf SECTION .note.GNU-stack noalloc noexec nowrite progbits %endif ; cpuflags %assign cpuflags_mmx (1<<0) %assign cpuflags_mmx2 (1<<1) | cpuflags_mmx %assign cpuflags_3dnow (1<<2) | cpuflags_mmx %assign cpuflags_3dnowext (1<<3) | cpuflags_3dnow %assign cpuflags_sse (1<<4) | cpuflags_mmx2 %assign cpuflags_sse2 (1<<5) | cpuflags_sse %assign cpuflags_sse2slow (1<<6) | cpuflags_sse2 %assign cpuflags_sse3 (1<<7) | cpuflags_sse2 %assign cpuflags_ssse3 (1<<8) | cpuflags_sse3 %assign cpuflags_sse4 (1<<9) | cpuflags_ssse3 %assign cpuflags_sse42 (1<<10)| cpuflags_sse4 %assign cpuflags_avx (1<<11)| cpuflags_sse42 %assign cpuflags_xop (1<<12)| cpuflags_avx %assign cpuflags_fma4 (1<<13)| cpuflags_avx %assign cpuflags_avx2 (1<<14)| cpuflags_avx %assign cpuflags_fma3 (1<<15)| cpuflags_avx %assign cpuflags_cache32 (1<<16) %assign cpuflags_cache64 (1<<17) %assign cpuflags_slowctz (1<<18) %assign cpuflags_lzcnt (1<<19) %assign cpuflags_aligned (1<<20) ; not a cpu feature, but a function variant %assign cpuflags_atom (1<<21) %assign cpuflags_bmi1 (1<<22)|cpuflags_lzcnt %assign cpuflags_bmi2 (1<<23)|cpuflags_bmi1 %define cpuflag(x) ((cpuflags & (cpuflags_ %+ x)) == (cpuflags_ %+ x)) %define notcpuflag(x) ((cpuflags & (cpuflags_ %+ x)) != (cpuflags_ %+ x)) ; Takes an arbitrary number of cpuflags from the above list. ; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the specified cpu. ; You shouldn't need to invoke this macro directly, it's a subroutine for INIT_MMX &co. %macro INIT_CPUFLAGS 0-* %xdefine SUFFIX %undef cpuname %assign cpuflags 0 %if %0 >= 1 %rep %0 %ifdef cpuname %xdefine cpuname cpuname %+ _%1 %else %xdefine cpuname %1 %endif %assign cpuflags cpuflags | cpuflags_%1 %rotate 1 %endrep %xdefine SUFFIX _ %+ cpuname %if cpuflag(avx) %assign avx_enabled 1 %endif %if (mmsize == 16 && notcpuflag(sse2)) || (mmsize == 32 && notcpuflag(avx2)) %define mova movaps %define movu movups %define movnta movntps %endif %if cpuflag(aligned) %define movu mova %elif cpuflag(sse3) && notcpuflag(ssse3) %define movu lddqu %endif %endif %if cpuflag(sse2) CPUNOP amdnop %else CPUNOP basicnop %endif %endmacro ; Merge mmx and sse* ; m# is a simd register of the currently selected size ; xm# is the corresponding xmm register if mmsize >= 16, otherwise the same as m# ; ym# is the corresponding ymm register if mmsize >= 32, otherwise the same as m# ; (All 3 remain in sync through SWAP.) %macro CAT_XDEFINE 3 %xdefine %1%2 %3 %endmacro %macro CAT_UNDEF 2 %undef %1%2 %endmacro %macro INIT_MMX 0-1+ %assign avx_enabled 0 %define RESET_MM_PERMUTATION INIT_MMX %1 %define mmsize 8 %define num_mmregs 8 %define mova movq %define movu movq %define movh movd %define movnta movntq %assign %%i 0 %rep 8 CAT_XDEFINE m, %%i, mm %+ %%i CAT_XDEFINE nnmm, %%i, %%i %assign %%i %%i+1 %endrep %rep 8 CAT_UNDEF m, %%i CAT_UNDEF nnmm, %%i %assign %%i %%i+1 %endrep INIT_CPUFLAGS %1 %endmacro %macro INIT_XMM 0-1+ %assign avx_enabled 0 %define RESET_MM_PERMUTATION INIT_XMM %1 %define mmsize 16 %define num_mmregs 8 %if ARCH_X86_64 %define num_mmregs 16 %endif %define mova movdqa %define movu movdqu %define movh movq %define movnta movntdq %assign %%i 0 %rep num_mmregs CAT_XDEFINE m, %%i, xmm %+ %%i CAT_XDEFINE nnxmm, %%i, %%i %assign %%i %%i+1 %endrep INIT_CPUFLAGS %1 %endmacro %macro INIT_YMM 0-1+ %assign avx_enabled 1 %define RESET_MM_PERMUTATION INIT_YMM %1 %define mmsize 32 %define num_mmregs 8 %if ARCH_X86_64 %define num_mmregs 16 %endif %define mova movdqa %define movu movdqu %undef movh %define movnta movntdq %assign %%i 0 %rep num_mmregs CAT_XDEFINE m, %%i, ymm %+ %%i CAT_XDEFINE nnymm, %%i, %%i %assign %%i %%i+1 %endrep INIT_CPUFLAGS %1 %endmacro INIT_XMM %macro DECLARE_MMCAST 1 %define mmmm%1 mm%1 %define mmxmm%1 mm%1 %define mmymm%1 mm%1 %define xmmmm%1 mm%1 %define xmmxmm%1 xmm%1 %define xmmymm%1 xmm%1 %define ymmmm%1 mm%1 %define ymmxmm%1 xmm%1 %define ymmymm%1 ymm%1 %define xm%1 xmm %+ m%1 %define ym%1 ymm %+ m%1 %endmacro %assign i 0 %rep 16 DECLARE_MMCAST i %assign i i+1 %endrep ; I often want to use macros that permute their arguments. e.g. there's no ; efficient way to implement butterfly or transpose or dct without swapping some ; arguments. ; ; I would like to not have to manually keep track of the permutations: ; If I insert a permutation in the middle of a function, it should automatically ; change everything that follows. For more complex macros I may also have multiple ; implementations, e.g. the SSE2 and SSSE3 versions may have different permutations. ; ; Hence these macros. Insert a PERMUTE or some SWAPs at the end of a macro that ; permutes its arguments. It's equivalent to exchanging the contents of the ; registers, except that this way you exchange the register names instead, so it ; doesn't cost any cycles. %macro PERMUTE 2-* ; takes a list of pairs to swap %rep %0/2 %xdefine %%tmp%2 m%2 %rotate 2 %endrep %rep %0/2 %xdefine m%1 %%tmp%2 CAT_XDEFINE nn, m%1, %1 %rotate 2 %endrep %endmacro %macro SWAP 2+ ; swaps a single chain (sometimes more concise than pairs) %ifnum %1 ; SWAP 0, 1, ... SWAP_INTERNAL_NUM %1, %2 %else ; SWAP m0, m1, ... SWAP_INTERNAL_NAME %1, %2 %endif %endmacro %macro SWAP_INTERNAL_NUM 2-* %rep %0-1 %xdefine %%tmp m%1 %xdefine m%1 m%2 %xdefine m%2 %%tmp CAT_XDEFINE nn, m%1, %1 CAT_XDEFINE nn, m%2, %2 %rotate 1 %endrep %endmacro %macro SWAP_INTERNAL_NAME 2-* %xdefine %%args nn %+ %1 %rep %0-1 %xdefine %%args %%args, nn %+ %2 %rotate 1 %endrep SWAP_INTERNAL_NUM %%args %endmacro ; If SAVE_MM_PERMUTATION is placed at the end of a function, then any later ; calls to that function will automatically load the permutation, so values can ; be returned in mmregs. %macro SAVE_MM_PERMUTATION 0-1 %if %0 %xdefine %%f %1_m %else %xdefine %%f current_function %+ _m %endif %assign %%i 0 %rep num_mmregs CAT_XDEFINE %%f, %%i, m %+ %%i %assign %%i %%i+1 %endrep %endmacro %macro LOAD_MM_PERMUTATION 1 ; name to load from %ifdef %1_m0 %assign %%i 0 %rep num_mmregs CAT_XDEFINE m, %%i, %1_m %+ %%i CAT_XDEFINE nn, m %+ %%i, %%i %assign %%i %%i+1 %endrep %endif %endmacro ; Append cpuflags to the callee's name iff the appended name is known and the plain name isn't %macro call 1 call_internal %1 %+ SUFFIX, %1 %endmacro %macro call_internal 2 %xdefine %%i %2 %ifndef cglobaled_%2 %ifdef cglobaled_%1 %xdefine %%i %1 %endif %endif call %%i LOAD_MM_PERMUTATION %%i %endmacro ; Substitutions that reduce instruction size but are functionally equivalent %macro add 2 %ifnum %2 %if %2==128 sub %1, -128 %else add %1, %2 %endif %else add %1, %2 %endif %endmacro %macro sub 2 %ifnum %2 %if %2==128 add %1, -128 %else sub %1, %2 %endif %else sub %1, %2 %endif %endmacro ;============================================================================= ; AVX abstraction layer ;============================================================================= %assign i 0 %rep 16 %if i < 8 CAT_XDEFINE sizeofmm, i, 8 %endif CAT_XDEFINE sizeofxmm, i, 16 CAT_XDEFINE sizeofymm, i, 32 %assign i i+1 %endrep %undef i %macro CHECK_AVX_INSTR_EMU 3-* %xdefine %%opcode %1 %xdefine %%dst %2 %rep %0-2 %ifidn %%dst, %3 %error non-avx emulation of ``%%opcode'' is not supported %endif %rotate 1 %endrep %endmacro ;%1 == instruction ;%2 == minimal instruction set ;%3 == 1 if float, 0 if int ;%4 == 1 if non-destructive or 4-operand (xmm, xmm, xmm, imm), 0 otherwise ;%5 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not ;%6+: operands %macro RUN_AVX_INSTR 6-9+ %ifnum sizeof%7 %assign __sizeofreg sizeof%7 %elifnum sizeof%6 %assign __sizeofreg sizeof%6 %else %assign __sizeofreg mmsize %endif %assign __emulate_avx 0 %if avx_enabled && __sizeofreg >= 16 %xdefine __instr v%1 %else %xdefine __instr %1 %if %0 >= 8+%4 %assign __emulate_avx 1 %endif %endif %ifnidn %2, fnord %ifdef cpuname %if notcpuflag(%2) %error use of ``%1'' %2 instruction in cpuname function: current_function %elif cpuflags_%2 < cpuflags_sse && notcpuflag(sse2) && __sizeofreg > 8 %error use of ``%1'' sse2 instruction in cpuname function: current_function %endif %endif %endif %if __emulate_avx %xdefine __src1 %7 %xdefine __src2 %8 %ifnidn %6, %7 %if %0 >= 9 CHECK_AVX_INSTR_EMU {%1 %6, %7, %8, %9}, %6, %8, %9 %else CHECK_AVX_INSTR_EMU {%1 %6, %7, %8}, %6, %8 %endif %if %5 && %4 == 0 %ifnid %8 ; 3-operand AVX instructions with a memory arg can only have it in src2, ; whereas SSE emulation prefers to have it in src1 (i.e. the mov). ; So, if the instruction is commutative with a memory arg, swap them. %xdefine __src1 %8 %xdefine __src2 %7 %endif %endif %if __sizeofreg == 8 MOVQ %6, __src1 %elif %3 MOVAPS %6, __src1 %else MOVDQA %6, __src1 %endif %endif %if %0 >= 9 %1 %6, __src2, %9 %else %1 %6, __src2 %endif %elif %0 >= 9 __instr %6, %7, %8, %9 %elif %0 == 8 __instr %6, %7, %8 %elif %0 == 7 __instr %6, %7 %else __instr %6 %endif %endmacro ;%1 == instruction ;%2 == minimal instruction set ;%3 == 1 if float, 0 if int ;%4 == 1 if non-destructive or 4-operand (xmm, xmm, xmm, imm), 0 otherwise ;%5 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not %macro AVX_INSTR 1-5 fnord, 0, 1, 0 %macro %1 1-10 fnord, fnord, fnord, fnord, %1, %2, %3, %4, %5 %ifidn %2, fnord RUN_AVX_INSTR %6, %7, %8, %9, %10, %1 %elifidn %3, fnord RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2 %elifidn %4, fnord RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2, %3 %elifidn %5, fnord RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2, %3, %4 %else RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2, %3, %4, %5 %endif %endmacro %endmacro ; Instructions with both VEX and non-VEX encodings ; Non-destructive instructions are written without parameters AVX_INSTR addpd, sse2, 1, 0, 1 AVX_INSTR addps, sse, 1, 0, 1 AVX_INSTR addsd, sse2, 1, 0, 1 AVX_INSTR addss, sse, 1, 0, 1 AVX_INSTR addsubpd, sse3, 1, 0, 0 AVX_INSTR addsubps, sse3, 1, 0, 0 AVX_INSTR aesdec, fnord, 0, 0, 0 AVX_INSTR aesdeclast, fnord, 0, 0, 0 AVX_INSTR aesenc, fnord, 0, 0, 0 AVX_INSTR aesenclast, fnord, 0, 0, 0 AVX_INSTR aesimc AVX_INSTR aeskeygenassist AVX_INSTR andnpd, sse2, 1, 0, 0 AVX_INSTR andnps, sse, 1, 0, 0 AVX_INSTR andpd, sse2, 1, 0, 1 AVX_INSTR andps, sse, 1, 0, 1 AVX_INSTR blendpd, sse4, 1, 0, 0 AVX_INSTR blendps, sse4, 1, 0, 0 AVX_INSTR blendvpd, sse4, 1, 0, 0 AVX_INSTR blendvps, sse4, 1, 0, 0 AVX_INSTR cmppd, sse2, 1, 1, 0 AVX_INSTR cmpps, sse, 1, 1, 0 AVX_INSTR cmpsd, sse2, 1, 1, 0 AVX_INSTR cmpss, sse, 1, 1, 0 AVX_INSTR comisd, sse2 AVX_INSTR comiss, sse AVX_INSTR cvtdq2pd, sse2 AVX_INSTR cvtdq2ps, sse2 AVX_INSTR cvtpd2dq, sse2 AVX_INSTR cvtpd2ps, sse2 AVX_INSTR cvtps2dq, sse2 AVX_INSTR cvtps2pd, sse2 AVX_INSTR cvtsd2si, sse2 AVX_INSTR cvtsd2ss, sse2 AVX_INSTR cvtsi2sd, sse2 AVX_INSTR cvtsi2ss, sse AVX_INSTR cvtss2sd, sse2 AVX_INSTR cvtss2si, sse AVX_INSTR cvttpd2dq, sse2 AVX_INSTR cvttps2dq, sse2 AVX_INSTR cvttsd2si, sse2 AVX_INSTR cvttss2si, sse AVX_INSTR divpd, sse2, 1, 0, 0 AVX_INSTR divps, sse, 1, 0, 0 AVX_INSTR divsd, sse2, 1, 0, 0 AVX_INSTR divss, sse, 1, 0, 0 AVX_INSTR dppd, sse4, 1, 1, 0 AVX_INSTR dpps, sse4, 1, 1, 0 AVX_INSTR extractps, sse4 AVX_INSTR haddpd, sse3, 1, 0, 0 AVX_INSTR haddps, sse3, 1, 0, 0 AVX_INSTR hsubpd, sse3, 1, 0, 0 AVX_INSTR hsubps, sse3, 1, 0, 0 AVX_INSTR insertps, sse4, 1, 1, 0 AVX_INSTR lddqu, sse3 AVX_INSTR ldmxcsr, sse AVX_INSTR maskmovdqu, sse2 AVX_INSTR maxpd, sse2, 1, 0, 1 AVX_INSTR maxps, sse, 1, 0, 1 AVX_INSTR maxsd, sse2, 1, 0, 1 AVX_INSTR maxss, sse, 1, 0, 1 AVX_INSTR minpd, sse2, 1, 0, 1 AVX_INSTR minps, sse, 1, 0, 1 AVX_INSTR minsd, sse2, 1, 0, 1 AVX_INSTR minss, sse, 1, 0, 1 AVX_INSTR movapd, sse2 AVX_INSTR movaps, sse AVX_INSTR movd, mmx AVX_INSTR movddup, sse3 AVX_INSTR movdqa, sse2 AVX_INSTR movdqu, sse2 AVX_INSTR movhlps, sse, 1, 0, 0 AVX_INSTR movhpd, sse2, 1, 0, 0 AVX_INSTR movhps, sse, 1, 0, 0 AVX_INSTR movlhps, sse, 1, 0, 0 AVX_INSTR movlpd, sse2, 1, 0, 0 AVX_INSTR movlps, sse, 1, 0, 0 AVX_INSTR movmskpd, sse2 AVX_INSTR movmskps, sse AVX_INSTR movntdq, sse2 AVX_INSTR movntdqa, sse4 AVX_INSTR movntpd, sse2 AVX_INSTR movntps, sse AVX_INSTR movq, mmx AVX_INSTR movsd, sse2, 1, 0, 0 AVX_INSTR movshdup, sse3 AVX_INSTR movsldup, sse3 AVX_INSTR movss, sse, 1, 0, 0 AVX_INSTR movupd, sse2 AVX_INSTR movups, sse AVX_INSTR mpsadbw, sse4 AVX_INSTR mulpd, sse2, 1, 0, 1 AVX_INSTR mulps, sse, 1, 0, 1 AVX_INSTR mulsd, sse2, 1, 0, 1 AVX_INSTR mulss, sse, 1, 0, 1 AVX_INSTR orpd, sse2, 1, 0, 1 AVX_INSTR orps, sse, 1, 0, 1 AVX_INSTR pabsb, ssse3 AVX_INSTR pabsd, ssse3 AVX_INSTR pabsw, ssse3 AVX_INSTR packsswb, mmx, 0, 0, 0 AVX_INSTR packssdw, mmx, 0, 0, 0 AVX_INSTR packuswb, mmx, 0, 0, 0 AVX_INSTR packusdw, sse4, 0, 0, 0 AVX_INSTR paddb, mmx, 0, 0, 1 AVX_INSTR paddw, mmx, 0, 0, 1 AVX_INSTR paddd, mmx, 0, 0, 1 AVX_INSTR paddq, sse2, 0, 0, 1 AVX_INSTR paddsb, mmx, 0, 0, 1 AVX_INSTR paddsw, mmx, 0, 0, 1 AVX_INSTR paddusb, mmx, 0, 0, 1 AVX_INSTR paddusw, mmx, 0, 0, 1 AVX_INSTR palignr, ssse3 AVX_INSTR pand, mmx, 0, 0, 1 AVX_INSTR pandn, mmx, 0, 0, 0 AVX_INSTR pavgb, mmx2, 0, 0, 1 AVX_INSTR pavgw, mmx2, 0, 0, 1 AVX_INSTR pblendvb, sse4, 0, 0, 0 AVX_INSTR pblendw, sse4 AVX_INSTR pclmulqdq AVX_INSTR pcmpestri, sse42 AVX_INSTR pcmpestrm, sse42 AVX_INSTR pcmpistri, sse42 AVX_INSTR pcmpistrm, sse42 AVX_INSTR pcmpeqb, mmx, 0, 0, 1 AVX_INSTR pcmpeqw, mmx, 0, 0, 1 AVX_INSTR pcmpeqd, mmx, 0, 0, 1 AVX_INSTR pcmpeqq, sse4, 0, 0, 1 AVX_INSTR pcmpgtb, mmx, 0, 0, 0 AVX_INSTR pcmpgtw, mmx, 0, 0, 0 AVX_INSTR pcmpgtd, mmx, 0, 0, 0 AVX_INSTR pcmpgtq, sse42, 0, 0, 0 AVX_INSTR pextrb, sse4 AVX_INSTR pextrd, sse4 AVX_INSTR pextrq, sse4 AVX_INSTR pextrw, mmx2 AVX_INSTR phaddw, ssse3, 0, 0, 0 AVX_INSTR phaddd, ssse3, 0, 0, 0 AVX_INSTR phaddsw, ssse3, 0, 0, 0 AVX_INSTR phminposuw, sse4 AVX_INSTR phsubw, ssse3, 0, 0, 0 AVX_INSTR phsubd, ssse3, 0, 0, 0 AVX_INSTR phsubsw, ssse3, 0, 0, 0 AVX_INSTR pinsrb, sse4 AVX_INSTR pinsrd, sse4 AVX_INSTR pinsrq, sse4 AVX_INSTR pinsrw, mmx2 AVX_INSTR pmaddwd, mmx, 0, 0, 1 AVX_INSTR pmaddubsw, ssse3, 0, 0, 0 AVX_INSTR pmaxsb, sse4, 0, 0, 1 AVX_INSTR pmaxsw, mmx2, 0, 0, 1 AVX_INSTR pmaxsd, sse4, 0, 0, 1 AVX_INSTR pmaxub, mmx2, 0, 0, 1 AVX_INSTR pmaxuw, sse4, 0, 0, 1 AVX_INSTR pmaxud, sse4, 0, 0, 1 AVX_INSTR pminsb, sse4, 0, 0, 1 AVX_INSTR pminsw, mmx2, 0, 0, 1 AVX_INSTR pminsd, sse4, 0, 0, 1 AVX_INSTR pminub, mmx2, 0, 0, 1 AVX_INSTR pminuw, sse4, 0, 0, 1 AVX_INSTR pminud, sse4, 0, 0, 1 AVX_INSTR pmovmskb, mmx2 AVX_INSTR pmovsxbw, sse4 AVX_INSTR pmovsxbd, sse4 AVX_INSTR pmovsxbq, sse4 AVX_INSTR pmovsxwd, sse4 AVX_INSTR pmovsxwq, sse4 AVX_INSTR pmovsxdq, sse4 AVX_INSTR pmovzxbw, sse4 AVX_INSTR pmovzxbd, sse4 AVX_INSTR pmovzxbq, sse4 AVX_INSTR pmovzxwd, sse4 AVX_INSTR pmovzxwq, sse4 AVX_INSTR pmovzxdq, sse4 AVX_INSTR pmuldq, sse4, 0, 0, 1 AVX_INSTR pmulhrsw, ssse3, 0, 0, 1 AVX_INSTR pmulhuw, mmx2, 0, 0, 1 AVX_INSTR pmulhw, mmx, 0, 0, 1 AVX_INSTR pmullw, mmx, 0, 0, 1 AVX_INSTR pmulld, sse4, 0, 0, 1 AVX_INSTR pmuludq, sse2, 0, 0, 1 AVX_INSTR por, mmx, 0, 0, 1 AVX_INSTR psadbw, mmx2, 0, 0, 1 AVX_INSTR pshufb, ssse3, 0, 0, 0 AVX_INSTR pshufd, sse2 AVX_INSTR pshufhw, sse2 AVX_INSTR pshuflw, sse2 AVX_INSTR psignb, ssse3, 0, 0, 0 AVX_INSTR psignw, ssse3, 0, 0, 0 AVX_INSTR psignd, ssse3, 0, 0, 0 AVX_INSTR psllw, mmx, 0, 0, 0 AVX_INSTR pslld, mmx, 0, 0, 0 AVX_INSTR psllq, mmx, 0, 0, 0 AVX_INSTR pslldq, sse2, 0, 0, 0 AVX_INSTR psraw, mmx, 0, 0, 0 AVX_INSTR psrad, mmx, 0, 0, 0 AVX_INSTR psrlw, mmx, 0, 0, 0 AVX_INSTR psrld, mmx, 0, 0, 0 AVX_INSTR psrlq, mmx, 0, 0, 0 AVX_INSTR psrldq, sse2, 0, 0, 0 AVX_INSTR psubb, mmx, 0, 0, 0 AVX_INSTR psubw, mmx, 0, 0, 0 AVX_INSTR psubd, mmx, 0, 0, 0 AVX_INSTR psubq, sse2, 0, 0, 0 AVX_INSTR psubsb, mmx, 0, 0, 0 AVX_INSTR psubsw, mmx, 0, 0, 0 AVX_INSTR psubusb, mmx, 0, 0, 0 AVX_INSTR psubusw, mmx, 0, 0, 0 AVX_INSTR ptest, sse4 AVX_INSTR punpckhbw, mmx, 0, 0, 0 AVX_INSTR punpckhwd, mmx, 0, 0, 0 AVX_INSTR punpckhdq, mmx, 0, 0, 0 AVX_INSTR punpckhqdq, sse2, 0, 0, 0 AVX_INSTR punpcklbw, mmx, 0, 0, 0 AVX_INSTR punpcklwd, mmx, 0, 0, 0 AVX_INSTR punpckldq, mmx, 0, 0, 0 AVX_INSTR punpcklqdq, sse2, 0, 0, 0 AVX_INSTR pxor, mmx, 0, 0, 1 AVX_INSTR rcpps, sse, 1, 0, 0 AVX_INSTR rcpss, sse, 1, 0, 0 AVX_INSTR roundpd, sse4 AVX_INSTR roundps, sse4 AVX_INSTR roundsd, sse4 AVX_INSTR roundss, sse4 AVX_INSTR rsqrtps, sse, 1, 0, 0 AVX_INSTR rsqrtss, sse, 1, 0, 0 AVX_INSTR shufpd, sse2, 1, 1, 0 AVX_INSTR shufps, sse, 1, 1, 0 AVX_INSTR sqrtpd, sse2, 1, 0, 0 AVX_INSTR sqrtps, sse, 1, 0, 0 AVX_INSTR sqrtsd, sse2, 1, 0, 0 AVX_INSTR sqrtss, sse, 1, 0, 0 AVX_INSTR stmxcsr, sse AVX_INSTR subpd, sse2, 1, 0, 0 AVX_INSTR subps, sse, 1, 0, 0 AVX_INSTR subsd, sse2, 1, 0, 0 AVX_INSTR subss, sse, 1, 0, 0 AVX_INSTR ucomisd, sse2 AVX_INSTR ucomiss, sse AVX_INSTR unpckhpd, sse2, 1, 0, 0 AVX_INSTR unpckhps, sse, 1, 0, 0 AVX_INSTR unpcklpd, sse2, 1, 0, 0 AVX_INSTR unpcklps, sse, 1, 0, 0 AVX_INSTR xorpd, sse2, 1, 0, 1 AVX_INSTR xorps, sse, 1, 0, 1 ; 3DNow instructions, for sharing code between AVX, SSE and 3DN AVX_INSTR pfadd, 3dnow, 1, 0, 1 AVX_INSTR pfsub, 3dnow, 1, 0, 0 AVX_INSTR pfmul, 3dnow, 1, 0, 1 ; base-4 constants for shuffles %assign i 0 %rep 256 %assign j ((i>>6)&3)*1000 + ((i>>4)&3)*100 + ((i>>2)&3)*10 + (i&3) %if j < 10 CAT_XDEFINE q000, j, i %elif j < 100 CAT_XDEFINE q00, j, i %elif j < 1000 CAT_XDEFINE q0, j, i %else CAT_XDEFINE q, j, i %endif %assign i i+1 %endrep %undef i %undef j ; tzcnt is equivalent to ""rep bsf"" and is backwards-compatible with bsf. ; This lets us use tzcnt without bumping the yasm version requirement yet. %define tzcnt rep bsf ; convert FMA4 to FMA3 if possible %macro FMA4_INSTR 4 %macro %1 4-8 %1, %2, %3, %4 %if cpuflag(fma4) v%5 %1, %2, %3, %4 %elifidn %1, %2 v%6 %1, %4, %3 ; %1 = %1 * %3 + %4 %elifidn %1, %3 v%7 %1, %2, %4 ; %1 = %2 * %1 + %4 %elifidn %1, %4 v%8 %1, %2, %3 ; %1 = %2 * %3 + %1 %else %error fma3 emulation of ``%5 %1, %2, %3, %4'' is not supported %endif %endmacro %endmacro FMA4_INSTR fmaddpd, fmadd132pd, fmadd213pd, fmadd231pd FMA4_INSTR fmaddps, fmadd132ps, fmadd213ps, fmadd231ps FMA4_INSTR fmaddsd, fmadd132sd, fmadd213sd, fmadd231sd FMA4_INSTR fmaddss, fmadd132ss, fmadd213ss, fmadd231ss FMA4_INSTR fmaddsubpd, fmaddsub132pd, fmaddsub213pd, fmaddsub231pd FMA4_INSTR fmaddsubps, fmaddsub132ps, fmaddsub213ps, fmaddsub231ps FMA4_INSTR fmsubaddpd, fmsubadd132pd, fmsubadd213pd, fmsubadd231pd FMA4_INSTR fmsubaddps, fmsubadd132ps, fmsubadd213ps, fmsubadd231ps FMA4_INSTR fmsubpd, fmsub132pd, fmsub213pd, fmsub231pd FMA4_INSTR fmsubps, fmsub132ps, fmsub213ps, fmsub231ps FMA4_INSTR fmsubsd, fmsub132sd, fmsub213sd, fmsub231sd FMA4_INSTR fmsubss, fmsub132ss, fmsub213ss, fmsub231ss FMA4_INSTR fnmaddpd, fnmadd132pd, fnmadd213pd, fnmadd231pd FMA4_INSTR fnmaddps, fnmadd132ps, fnmadd213ps, fnmadd231ps FMA4_INSTR fnmaddsd, fnmadd132sd, fnmadd213sd, fnmadd231sd FMA4_INSTR fnmaddss, fnmadd132ss, fnmadd213ss, fnmadd231ss FMA4_INSTR fnmsubpd, fnmsub132pd, fnmsub213pd, fnmsub231pd FMA4_INSTR fnmsubps, fnmsub132ps, fnmsub213ps, fnmsub231ps FMA4_INSTR fnmsubsd, fnmsub132sd, fnmsub213sd, fnmsub231sd FMA4_INSTR fnmsubss, fnmsub132ss, fnmsub213ss, fnmsub231ss ; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug %if ARCH_X86_64 == 0 %macro vpbroadcastq 2 %if sizeof%1 == 16 movddup %1, %2 %else vbroadcastsd %1, %2 %endif %endmacro %endif ",16318,True,2600.8513176326587,median "FORMAT: 1A HOST: http://aeronbroker.github.io/Aeron/ TITLE: Aeron IoT Broker GEri NGSI API DATE: 14 June 2016 VERSION: v1 APIARY_PROJECT: iotbrokerngsiinterface SPEC_URL: https://github.com/Aeronbroker/Aeron/blob/master/doc/apiary-doc.apib GITHUB_SOURCE: https://github.com/Aeronbroker/Aeron.git ## Copyright Copyright - This specification is licensed under the [FIWARE Open Specification License (implicit patents license)](http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_Open_Specification_Legal_Notice_(implicit_patents_license)). ## License This specification is licensed under the [FIWARE Open Specification License (implicit patents license)](http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_Open_Specification_Legal_Notice_(implicit_patents_license)). # IoT Broker NGSI data Interface The information exchange between the IoT Broker and other components is based on the FIWARE NGSI standards. Therefore, for readers familiar with FIWARE NGSI, this manual does not contain a lot of new information. For the formal specification documents, please refer to this archive. ## NGSI Context Management Information Model ### Entities The central aspect of the FIWARE NGSI information model is the concept of 'entities'. Entities are the virtual representation of all kinds of physical objects in the real world. Examples for physical entities are tables, rooms, or persons. Virtual entities have an identifier and a type. For example, a virtual entity representing a person named “John” could have the identifier “John” and the type “person”. ### Attributes Any information about physical entities is expressed in the form of 'attributes' of virtual entities. Attributes have a name and a type as well. For example, the body temperature of John would be represented as an attribute having the name “body_temperature” and the type “temperature”. Values of such attributes are contained by value containers. This kind of container does not only consist of the actual attribute value, but also contains a set of metadata. Metadata is data about data; in in our body temperature example this metadata could represent the time of measurement, the measurement unit, and other information about the attribute value. ### Attribute Domains There also is a concept of 'attribute domains' in version 1.0 of FIWARE NGSI. An attribute domain logically groups together a set of attributes. For example, the attribute domain ""health_status"" could comprise of the attributes ""body_temperature"" and ""blood_pressure"". Please note that the attribute domains features is likely to become deprecated in future versions of FIWARE NGSI. ### Context Elements The data structure used for exchanging information about entities is 'context element'. A context element contains information about multiple attributes of one entity. The domain of these attributes can also be specified inside the context element; in this case all provided attribute values have to belong to that domain. Formally, a context element contains the following information: * an entity id and type * a list of triplets holding information about attributes of the entity * (optionally) the name of an attribute domain * (optionally) a list of triplets that apply to all attribute values of the given domain ### NGSI Context Management Interfaces FIWARE NGSI defines two interfaces for exchanging information based on the information model. The NGSI-10 is the 'data interface', used for exchanging information about entities and their attribute, i.e., attribute values and metadata. The NGSI-9 is the 'availability interface'; used for 'availability' information about entities and their attributes. Here, instead of exchanging attribute values, information about which provider can provide which context information is exchanged. Please note that NGSI-9 and NGSI-10 represent different functionalities and are not different versions of the same interface. To avoid confusion, it is likely that in the future the names 'NGSI-10' and 'NGSI-10' will be replaced by more meaningful names. ### About this guide The IoT Broker GE, being a data broker, mainly uses NGSI 10. This interface is used both for exchanging data between data consumers and the IoT Broker, and for exchanging data between the IoT Broker and data providers. The IoT Broker additionally uses NGSI 9 for communicating with an instance of the IoT Discovery GE in order to get information about the addresses of data providers matching the requests of the data consumers. The NGSI-9 interface used in this communication is mainly specified in the documentation of the IoT Discovery GE (http://docs.ngsi9.apiary.io/#). While this guide describes the message formats and service endpoints, please refer to the IoT Broker Open Specification (https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE.OpenSpecification.IoT.Backend.IoTBroker) for details about the IoT Broker data flows. # Data exchange via FIWARE NGSI-10 standard operations and convenience operation. FIWARE NGSI-10 supports a direct XML-representation of the NGSI-10 operations that were defined in the OMA specification of NGSI-10. These operations can be invoked by issuing a POST request on HTTP resources that correspond to the respective operation.Any possible interaction with the IoT Broker can be done using these six standard operations. In addition, FIWARE NGSI defines also a set of operations for simplified interaction with data providers. These operations are called 'convenience operations'. They are redundant in the sense that the same results could be achieved as well by using only standard operations instead, so they only exist for the sake of convenience. For example, all information about a specific context entity can be retrieved by a HTTP GET on a convenience resource representing that context entity, while with standard operations the user would have to fomulate a request message in the right format and submit it to the generic query resource using HTTP POST. Below the standard operations defined by NGSI 10 are described, followed by the convenience operations. ## Standard Context Query [/ngsi10/queryContext] Generic queries for context information. The expected request body is an instance of queryContextRequest; the response body is an instance of queryContextResponse. ### Issue a context query [POST] + Request (application/xml) ConferenceRoom temperature + Request (application/json) { ""entities"": [{ ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" }], ""attributes"": [""temperature""] } + Response 200 (application/xml) 404 CONTEXT ELEMENT NOT FOUND + Response 200 (application/json) { ""contextResponses"": [], ""errorCode"": { ""reasonPhrase"": ""CONTEXT ELEMENT NOT FOUND"", ""code"": 404 } } + Response 200 (application/xml) ConferenceRoom indoorTemperature Room 6 ID string 1110 200 Ok + Response 200 (application/json) { ""contextResponses"": [{ ""contextElement"": { ""attributes"": [{ ""contextValue"": ""6"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""indoorTemperature"", ""type"": ""Room"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" } }, ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } }] } ## Standard Context Subscription [/ngsi10/subscribeContext] Generic subscriptions for context information. The expected request body is an instance of subscribeContextRequest; the response body is an instance of subscribeContextResponse. ### Issue a context subscription [POST] + Request (application/xml) ConferenceRoom temperature 127.0.0.1 P5M someXPATH someScopeType someScopeValue ONCHANGE P5M + Request (application/json) { ""entities"": [{ ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" }], ""attributes"": [""temperature""], ""notifyConditions"": [{ ""type"": ""ONCHANGE"" }], ""reference"": ""127.0.0.1"", ""duration"": ""P5M"", ""restriction"": { ""scopes"": [{ ""scopeType"": ""someScopeType"", ""scopeValue"": ""someScopeValue"" }], ""attributeExpression"": ""someXPATH"" } } + Response 200 (application/xml) 12345 P5Y P5Y + Response 200 (application/json) { ""subscribeResponse"": { ""subscriptionId"": ""12345"", ""duration"": ""P5Y"", ""throttling"": ""P5Y"" } } ## Standard Context Subscription Update [/ngsi10/updateContextSubscription] Generic update of context subscriptions. The expected request body is an instance of updateContexSubscriptiontRequest; the response body is an instance of updateContextSubscriptionResponse. ### Issue a context subscription update [POST] + Request (application/xml) P5Y myScopeType myScopeValue + Request (application/json) { ""duration"": ""P5Y"", ""notifyCondition"": [], ""restriction"": { ""scopes"": [{ ""scopeType"": ""myScopeType"", ""scopeValue"": ""myScopeValue"" }], ""attributeExpression"": """" } } + Response 200 (application/xml) 12345 470 Subscription ID not found + Response 200 (application/json) { ""subscribeError"": { ""subscriptionId"": ""12345"", ""statusCode"": { ""reasonPhrase"": ""Subscription ID not found"", ""code"": 470 } } } + Response 200 (application/xml) 12345 P5Y P1D + Response 200 (application/json) { ""subscribeResponse"": { ""subscriptionId"": ""12345"", ""duration"": ""P5Y"", ""throttling"": ""P1D"" } } ## Standard Context Subscription Cancellation [/ngsi10/unsubscribeContext] Generic unsubscribe operations. The expected request body is an instance of unsubscribeContextRequest; the response body is an instance of unsubscribeContextResponse. ### Unsubscribe [POST] + Request (application/xml) 1245 + Request (application/json) { ""subscriptionId"": ""1245"" } + Response 200 (application/xml) 12345 200 OK + Response 200 (application/json) { ""subscriptionId"": ""12345"", ""statusCode"": { ""reasonPhrase"": ""OK"", ""code"": 200 } } + Response 200 (application/xml) 12345 470 Subscription ID not found + Response 200 (application/json) { ""subscriptionId"": ""12345"", ""statusCode"": { ""reasonPhrase"": ""Subscription ID not found"", ""code"": 470 } } ## Standard Context Notification [/ngsi10/notifyContext] Notification operation to send context data matching a previous subscription. The expected request body is an instance of notifyContextRequest; the response body is an instance of notifyContextResponse. ### Notify [POST] + Request (application/xml) 12345 http://localhost/test ConferenceRoom temperature Room 10 ID string 1110 200 Ok + Request (application/json) { ""contextResponses"": [{ ""contextElement"": { ""attributes"": [{ ""contextValue"": ""10"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""temperature"", ""type"": ""Room"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" } }, ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } }], ""subscriptionId"": ""12345"", ""originator"": ""http://localhost/test"" } + Response 200 (application/xml) 200 Ok + Response 200 (application/xml) 470 SUBSCRIPTION ID NOT FOUND + Response 200 (application/json) { ""responseCode"": { ""code"": 200, ""reasonPhrase"": ""Ok"" } } + Response 200 (application/json) { ""responseCode"": { ""code"": 470, ""reasonPhrase"": ""SUBSCRIPTION ID NOT FOUND"" } } ## Standard Context Data Push [/ngsi10/updateContext] Generic context updates. The expected request body is an instance of updateContextRequest; the response body is an instance of updateContextResponse. ### Update context data [POST] + Request (application/xml) ConferenceRoom temperature degree 20 ID long 1 UPDATE + Request (application/json) { ""contextElements"": [{ ""attributes"": [{ ""contextValue"": ""20"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1"", ""type"": ""long"" }], ""name"": ""temperature"", ""type"": ""degree"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" } }], ""updateAction"": ""UPDATE"" } + Response 200 (application/xml) ConferenceRoom temperature 200 Ok + Response 200 (application/json) { ""contextResponses"": [{ ""contextElement"": { ""attributes"": [{ ""name"": ""temperature"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" } }, ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } }] } ## Convenience Interaction with Individual Context Entity [/ngsi10/contextEntities/ConferenceRoom] ### Retrieve all entity information [GET] + Response 200 (application/xml) ConferenceRoom indoorTemperature Room 6 ID string 1110 200 Ok
a
+ Response 200 (application/json) { ""contextElement"": { ""attributes"": [{ ""contextValue"": ""6"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""indoorTemperature"", ""type"": ""Room"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" } }, ""statusCode"": { ""details"": ""a"", ""reasonPhrase"": ""Ok"", ""code"": 200 } } ### Replace a number of attribute values [PUT] + Request (application/xml) temperature degree 10 ID string 1110 humidity percentage 70 ID string 2312 + Request (application/json) { ""attributes"": [{ ""contextValue"": ""10"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""temperature"", ""type"": ""degree"" }, { ""contextValue"": ""70"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""2312"", ""type"": ""string"" }], ""name"": ""humidity"", ""type"": ""percentage"" }] } + Response 200 (application/xml) temperature degree humidity percentage 200 Ok + Response 200 (application/json) { ""contextResponse"": { ""attributes"": [{ ""name"": ""temperature"", ""type"": ""degree"" }, { ""name"": ""humidity"", ""type"": ""percentage"" }], ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } } } + Response 200 (application/xml) 404 Context Element not Found
No Attribute with given value IDs found
+ Response 200 (application/json) { ""errorCode"": { ""details"": ""No Attribute with given value IDs found"", ""reasonPhrase"": ""Context Element not Found"", ""code"": 404 } } ### Append context attribute values [POST] + Request (application/xml) temperature degree 10 ID string 1110 humidity percentage 70 ID string 2312 + Request (application/json) { ""attributes"": [{ ""contextValue"": ""10"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""temperature"", ""type"": ""degree"" }, { ""contextValue"": ""70"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""2312"", ""type"": ""string"" }], ""name"": ""humidity"", ""type"": ""percentage"" }], ""contextAttributeList"": [{ ""contextValue"": ""10"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""temperature"", ""type"": ""degree"" }, { ""contextValue"": ""70"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""2312"", ""type"": ""string"" }], ""name"": ""humidity"", ""type"": ""percentage"" }] } + Response 200 (application/xml) temperature degree 10 ID string 1110 humidity percentage 70 ID string 2312 200 Ok + Response 200 (application/json) { ""contextAttributeResponse"": { ""attributes"": [{ ""contextValue"": ""10"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""temperature"", ""type"": ""degree"" }, { ""contextValue"": ""70"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""2312"", ""type"": ""string"" }], ""name"": ""humidity"", ""type"": ""percentage"" }], ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } } } + Response 200 (application/xml) 404 Context Element not found + Response 200 (application/json) { ""errorCode"": { ""reasonPhrase"": ""Context Element not found"", ""code"": 404 } } ### Delete all entity information [DELETE] + Response 200 (application/xml) 200 Ok + Response 200 (application/json) { ""reasonPhrase"": ""Ok"", ""code"": 200 } + Response 200 (application/xml) 404 Context Element not found + Response 200 (application/json) { ""reasonPhrase"": ""Context Element not found"", ""code"": 404 } ## Convenience Interaction with an Individual Attribute of an Individual Entity [/ngsi10/contextEntities/ConferenceRoom/attributes/temperature] ### Retrieve attribute values [GET] + Response 200 (application/xml) temperature degree 10 ID string 1110 temperature degree 12 ID string 4837 200 OK + Response 200 (application/json) { ""attributes"": [{ ""contextValue"": ""10"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""temperature"", ""type"": ""degree"" }, { ""contextValue"": ""12"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""4837"", ""type"": ""string"" }], ""name"": ""temperature"", ""type"": ""degree"" }], ""statusCode"": { ""reasonPhrase"": ""OK"", ""code"": 200 } } ### Append context attribute value [POST] + Request (application/xml) degree 10 ID string 1110 + Request (application/json) { ""contextValue"":""10"", ""contextMetadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""type"": ""degree"" } + Response 200 (application/xml) 200 Ok + Response 200 (application/json) { ""reasonPhrase"": ""Ok"", ""code"": 200 } ### Delete all values of attribute [DELETE] + Response 200 (application/xml) 200 Ok + Response 200 (application/json) { ""reasonPhrase"": ""Ok"", ""code"": 200 } ## Convenience Interaction with an Individual Attribute Value Instance of an Individual Entity [/ngsi10/contextEntities/ConferenceRoom/attributes/temperature/id77] ### Retrieve attribute value and associated metadata [GET] + Response 200 (application/xml) temperature degree 200 OK + Response 200 (application/json) { ""attributes"": [{ ""name"": ""temperature"", ""type"": ""degree"" }], ""statusCode"": { ""reasonPhrase"": ""OK"", ""code"": 200 } } + Response 200 (application/xml) temperature 404 Not Found
Value ID id77 not found.
+ Response 200 (application/json) { ""attributes"": [{ ""name"": ""temperature"" }], ""statusCode"": { ""details"": ""Value ID id77 not found."", ""reasonPhrase"": ""Not Found"", ""code"": 404 } } ### Replace context attribute value [PUT] + Request (application/xml) degree 10 200 Ok + Response 200 (application/json) { ""reasonPhrase"": ""Ok"", ""code"": 200 } ### Delete all value attribute [DELETE] + Response 200 (application/xml) 200 Ok + Response 200 (application/json) { ""reasonPhrase"": ""Ok"", ""code"": 200 } ## Convenience Interaction with Attribute Domain of Individual Entity [/ngsi10/contextEntities/ConferenceRoom/attributeDomain/roomInfo] ### Retrieve all attribute information belonging to attribute domain [GET] + Response 200 (application/xml) temperature degree 10 ID string 1110 humidity percentage 70 ID string 2312 200 Ok + Response 200 (application/json) { ""attributes"": [{ ""contextValue"": ""10"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""temperature"", ""type"": ""degree"" }, { ""contextValue"": ""70"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""2312"", ""type"": ""string"" }], ""name"": ""humidity"", ""type"": ""percentage"" }], ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } } ## Convenience Interaction with Entity Type [/ngsi10/contextEntityTypes/Room] ### Retrieve all context information about entities of specified type [GET] + Response 200 (application/xml) ConferenceRoom indoorTemperature degree 6 ID string 1110 200 Ok Office humidity percentage 70 200 Ok + Response 200 (application/json) { ""contextResponses"": [{ ""contextElement"": { ""attributes"": [{ ""contextValue"": ""6"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""indoorTemperature"", ""type"": ""degree"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" } }, ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } }, { ""contextElement"": { ""attributes"": [{ ""contextValue"": ""70"", ""name"": ""humidity"", ""type"": ""percentage"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""Office"", ""type"": ""Room"" } }, ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } }] } ## Convenience Interaction with Attribute of Entity Type [/ngsi10/contextEntityTypes/Room/attributes/indoorTemperature] ### Retrieve all values of specified attribute of the context entities of the specific type [GET] + Response 200 (application/xml) ConferenceRoom indoorTemperature degree 6 ID string 1110 200 Ok Office indoorTemperature degree 13 200 Ok + Response 200 (application/json) { ""contextResponses"": [{ ""contextElement"": { ""attributes"": [{ ""contextValue"": ""6"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""indoorTemperature"", ""type"": ""degree"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" } }, ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } }, { ""contextElement"": { ""attributes"": [{ ""contextValue"": ""13"", ""name"": ""indoorTemperature"", ""type"": ""degree"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""Office"", ""type"": ""Room"" } }, ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } }] } ## Convenience Interaction with Attribute Domain of Entity Type [/ngsi10/contextEntityTypes/Room/attributeDomains/roomInfo] ### For all context entities of the specific type, retrieve the values of all attributes belonging to the attribute domain [GET] + Response 200 (application/xml) ConferenceRoom indoorTemperature degree 6 ID string 1110 humidity percentage 70 200 Ok Office indoorTemperature degree 13 200 Ok + Response 200 (application/json) { ""contextResponses"": [{ ""contextElement"": { ""attributes"": [{ ""contextValue"": ""6"", ""metadata"": [{ ""name"": ""ID"", ""value"": ""1110"", ""type"": ""string"" }], ""name"": ""indoorTemperature"", ""type"": ""degree"" }, { ""contextValue"": ""70"", ""name"": ""humidity"", ""type"": ""percentage"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" } }, ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } }, { ""contextElement"": { ""attributes"": [{ ""contextValue"": ""13"", ""name"": ""indoorTemperature"", ""type"": ""degree"" }], ""domainMetadata"": [], ""entityId"": { ""isPattern"": false, ""id"": ""Office"", ""type"": ""Room"" } }, ""statusCode"": { ""reasonPhrase"": ""Ok"", ""code"": 200 } }] } ## Convenience Subscription Container [/ngsi10/contextSubscriptions] ### Create a new subscription [POST] + Request (application/xml) ConferenceRoom temperature 127.0.0.1 P5Y someXPATH someScopeType someScopeValue ONCHANGE P5Y + Request (application/json) { ""entities"": [{ ""isPattern"": false, ""id"": ""ConferenceRoom"", ""type"": ""Room"" }], ""attributes"": [""temperature""], ""notifyConditions"": [{ ""type"": ""ONCHANGE"" }], ""reference"": ""127.0.0.1"", ""duration"": ""P5Y"", ""notifyCondition"": [{ ""type"": ""ONCHANGE"" }], ""throttling"": ""P5Y"", ""restriction"": { ""scopes"": [{ ""scopeType"": ""someScopeType"", ""scopeValue"": ""someScopeValue"" }], ""attributeExpression"": ""someXPATH"" } } + Response 200 (application/xml) 123 P5Y P5Y + Response 200 (application/json) { ""subscribeResponse"": { ""subscriptionId"": ""123"", ""duration"": ""P5Y"", ""throttling"": ""P5Y"" } } ## Convenience Interaction with individual subscription [/ngsi10/contextSubscriptions/12345] ### Update subscription [PUT] + Request (application/xml) P5Y + Request (application/json) { ""duration"": ""P5Y"", ""notifyCondition"": [] } + Response 200 (application/xml) 12345 470 Subscription ID not found + Response 200 (application/json) { ""subscribeError"": { ""subscriptionId"": ""12345"", ""statusCode"": { ""reasonPhrase"": ""Subscription ID not found"", ""code"": 470 } } } + Response 200 (application/xml) 12345 P5Y P1D + Response 200 (application/json) { ""subscribeResponse"": { ""subscriptionId"": ""12345"", ""duration"": ""P5Y"", ""throttling"": ""P1D"" } } ### Cancel subscription [DELETE] + Response 200 (application/xml) 12345 200 OK + Response 200 (application/json) { ""subscriptionId"": ""12345"", ""statusCode"": { ""reasonPhrase"": ""OK"", ""code"": 200 } } + Response 200 (application/xml) 12345 470 Subscription ID not found + Response 200 (application/json) { ""subscriptionId"": ""12345"", ""statusCode"": { ""reasonPhrase"": ""Subscription ID not found"", ""code"": 470 } } ",12196,True,3129.2241002793835,median ";------------------------------------------------------------------------------- ; opcodes.nasm - locate the opcode table entry for a given opcode byte. ;------------------------------------------------------------------------------- module monitor.opcodes %include ""opcodes.ah"" publicproc FindOpcode section .data ; This is a table of mnemonics for the dissassembler opn_add DB ""add"",0 opn_push DB ""push"",0 opn_pop DB ""pop"",0 opn_or DB ""or"",0 opn_adc DB ""adc"",0 opn_sbb DB ""sbb"",0 opn_and DB ""and"",0 opn_daa DB ""daa"",0 opn_sub DB ""sub"",0 opn_das DB ""das"",0 opn_xor DB ""xor"",0 opn_aaa DB ""aaa"",0 opn_cmp DB ""cmp"",0 opn_aas DB ""aas"",0 opn_inc DB ""inc"",0 opn_dec DB ""dec"",0 opn_pusha DB ""pusha"",0 opn_popa DB ""popa"",0 opn_bound DB ""bound"",0 opn_arpl DB ""arpl"",0 opn_imul DB ""imul"",0 opn_insb DB ""insb"",0 opn_ins DB ""ins"",0 opn_outsb DB ""outsb"",0 opn_outs DB ""outs"",0 opn_jo DB ""jo"",0 opn_jno DB ""jno"",0 opn_jb DB ""jb"",0 opn_jnb DB ""jnb"",0 opn_jz DB ""jz"",0 opn_jnz DB ""jnz"",0 opn_jbe DB ""jbe"",0 opn_ja DB ""ja"",0 opn_js DB ""js"",0 opn_jns DB ""jns"",0 opn_jp DB ""jp"",0 opn_jnp DB ""jnp"",0 opn_jl DB ""jl"",0 opn_jge DB ""jge"",0 opn_jle DB ""jle"",0 opn_jg DB ""jg"",0 opn_test DB ""test"",0 opn_xchg DB ""xchg"",0 opn_mov DB ""mov"",0 opn_lea DB ""lea"",0 opn_nop DB ""nop"",0 opn_cbw DB ""cbw"",0 opn_cwd DB ""cwd"",0 opn_call DB ""call"",0 opn_wait DB ""wait"",0 opn_pushf DB ""pushf"",0 opn_popf DB ""popf"",0 opn_sahf DB ""sahf"",0 opn_lahf DB ""lahf"",0 opn_movs DB ""movs"",0 opn_cmps DB ""cmps"",0 opn_stos DB ""stos"",0 opn_lods DB ""lods"",0 opn_scas DB ""scas"",0 opn_movsb DB ""movsb"",0 opn_cmpsb DB ""cmpsb"",0 opn_stosb DB ""stosb"",0 opn_lodsb DB ""lodsb"",0 opn_scasb DB ""scasb"",0 opn_rol DB ""rol"",0 opn_ror DB ""ror"",0 opn_rcl DB ""rcl"",0 opn_rcr DB ""rcr"",0 opn_shl DB ""shl"",0 opn_shr DB ""shr"",0 opn_sar DB ""sar"",0 opn_ret DB ""ret"",0 opn_les DB ""les"",0 opn_lds DB ""lds"",0 opn_enter DB ""enter"",0 opn_retf DB ""retf"",0 opn_int DB ""int"",0 opn_into DB ""into"",0 opn_iret DB ""iret"",0 opn_leave DB ""leave"",0 opn_aam DB ""aam"",0 opn_aad DB ""aad"",0 opn_xlat DB ""xlat"",0 opn_loopnz DB ""loopnz"",0 opn_loopz DB ""loopz"",0 opn_loop DB ""loop"",0 opn_jcxz DB ""jcxz"",0 opn_in DB ""in"",0 opn_out DB ""out"",0 opn_jmp DB ""jmp"",0 opn_lock DB ""lock"",0 opn_repnz DB ""repnz"",0 opn_repz DB ""repz"",0 opn_hlt DB ""hlt"",0 opn_cmc DB ""cmc"",0 opn_not DB ""not"",0 opn_neg DB ""neg"",0 opn_mul DB ""mul"",0 opn_div DB ""div"",0 opn_idiv DB ""idiv"",0 opn_clc DB ""clc"",0 opn_stc DB ""stc"",0 opn_cli DB ""cli"",0 opn_sti DB ""sti"",0 opn_cld DB ""cld"",0 opn_std DB ""std"",0 opn_movsx DB ""movsx"",0 opn_movzx DB ""movzx"",0 opn_lfs DB ""lfs"",0 opn_lgs DB ""lgs"",0 opn_lss DB ""lss"",0 opn_clts DB ""clts"",0 opn_shld DB ""shld"",0 opn_shrd DB ""shrd"",0 opn_bsf DB ""bsf"",0 opn_bsr DB ""bsr"",0 opn_bt DB ""bt"",0 opn_bts DB ""bts"",0 opn_btr DB ""btr"",0 opn_btc DB ""btc"",0 opn_ibts DB ""ibts"",0 opn_xbts DB ""xbts"",0 opn_seto DB ""seto"",0 opn_setno DB ""setno"",0 opn_setb DB ""setb"",0 opn_setnb DB ""setnb"",0 opn_setz DB ""setz"",0 opn_setnz DB ""setnz"",0 opn_setbe DB ""setbe"",0 opn_seta DB ""seta"",0 opn_sets DB ""sets"",0 opn_setns DB ""setns"",0 opn_setp DB ""setp"",0 opn_setnp DB ""setnp"",0 opn_setl DB ""setl"",0 opn_setge DB ""setge"",0 opn_setle DB ""setle"",0 opn_setg DB ""setg"",0 opn_lar DB ""lar"",0 opn_lsl DB ""lsl"",0 opn_lgdt DB ""lgdt"",0 opn_lidt DB ""lidt"",0 opn_lldt DB ""lldt"",0 opn_lmsw DB ""lmsw"",0 opn_ltr DB ""ltr"",0 opn_sgdt DB ""sgdt"",0 opn_sidt DB ""sidt"",0 opn_sldt DB ""sldt"",0 opn_smsw DB ""smsw"",0 opn_str DB ""str"",0 opn_verr DB ""verr"",0 opn_verw DB ""verw"",0 opn_fnop DB ""fnop"",0 opn_fchs DB ""fchs"",0 opn_fabs DB ""fabs"",0 opn_ftst DB ""ftst"",0 opn_fxam DB ""fxam"",0 opn_fld1 DB ""fld1"",0 opn_fldl2t DB ""fldl2t"",0 opn_fldl2e DB ""fldl2e"",0 opn_fldpi DB ""fldpi"",0 opn_fldlg2 DB ""fldlg2"",0 opn_fldln2 DB ""fldln2"",0 opn_fldz DB ""fldz"",0 opn_f2xm1 DB ""f2xm1"",0 opn_fyl2x DB ""fyl2x"",0 opn_fptan DB ""fptan"",0 opn_fpatan DB ""fpatan"",0 opn_fprem1 DB ""fprem1"",0 opn_fxtract DB ""fxtract"",0 opn_fdecstp DB ""fdecstp"",0 opn_fincstp DB ""fincstp"",0 opn_fprem DB ""fprem"",0 opn_fyl2xp1 DB ""fyl2xp1"",0 opn_fsqrt DB ""fsqrt"",0 opn_fsincos DB ""fsincos"",0 opn_frndint DB ""frndint"",0 opn_fscale DB ""fscale"",0 opn_fsin DB ""fsin"",0 opn_fcos DB ""fcos"",0 opn_fucompp DB ""fucompp"",0 opn_feni DB ""feni"",0 opn_fdisi DB ""fdisi"",0 opn_fclex DB ""fclex"",0 opn_finit DB ""finit"",0 opn_fsetpm DB ""fsetpm"",0 opn_fcompp DB ""fcompp"",0 opn_fld DB ""fld"",0 opn_fxch DB ""fxch"",0 opn_fstp DB ""fstp"",0 opn_esc DB ""esc"",0 opn_fldenv DB ""fldenv"",0 opn_fldcw DB ""fldcw"",0 opn_fstenv DB ""fstenv"",0 opn_fstcw DB ""fstcw"",0 opn_ffree DB ""ffree"",0 opn_fst DB ""fst"",0 opn_fucom DB ""fucom"",0 opn_fucomp DB ""fucomp"",0 opn_frstor DB ""frstor"",0 opn_fsave DB ""fsave"",0 opn_fstsw DB ""fstsw"",0 opn_fbld DB ""fbld"",0 opn_fild DB ""fild"",0 opn_fbstp DB ""fbstp"",0 opn_fistp DB ""fistp"",0 opn_fmul DB ""fmul"",0 opn_fcom DB ""fcom"",0 opn_fsub DB ""fsub"",0 opn_fdiv DB ""fdiv"",0 opn_fadd DB ""fadd"",0 opn_fcomp DB ""fcomp"",0 opn_fiadd DB ""fiadd"",0 opn_fimul DB ""fimul"",0 opn_ficom DB ""ficom"",0 opn_ficomp DB ""ficomp"",0 opn_fisub DB ""fisub"",0 opn_fidiv DB ""fidiv"",0 opn_fist DB ""fist"",0 opn_invlpg DB ""invlpg"",0 opn_invd DB ""invd"",0 opn_wbinvd DB ""wbinvd"",0 opn_rdtsc DB ""rdtsc"",0 opn_rdmsr DB ""rdmsr"",0 opn_wrmsr DB ""wrmsr"",0 opn_cpuid DB ""cpuid"",0 opn_sysenter DB ""sysenter"",0 opn_sysexit DB ""sysexit"",0 opn_syscall DB ""syscall"",0 opn_sysret DB ""sysret"",0 ; Table of opcodes. Each entry consists of a mask value, ; a comparison value, a pointer to the name, the addressing mode to be ; used in dissassembly, and the base length of the instruction (possibly ; modified by the exact addressing mode encountered) base0 DW 0FCh DW 00h DD opn_add DB OP_REGRMREG DB 2 DW 0E7h DW 06h DD opn_push DB OP_SEG35 DB 1 DW 0FEh DW 04h DD opn_add DB OP_ACCIMM DB 1 DW 0E7h DW 07h DD opn_pop DB OP_SEG35 DB 1 DW 0FCh DW 08h DD opn_or DB OP_REGRMREG DB 2 DW 0FEh DW 0Ch DD opn_or DB OP_ACCIMM DB 1 DW 0FCh DW 010h DD opn_adc DB OP_REGRMREG DB 2 DW 0FEh DW 014h DD opn_adc DB OP_ACCIMM DB 1 DW 0FCh DW 018h DD opn_sbb DB OP_REGRMREG DB 2 DW 0FEh DW 01Ch DD opn_sbb DB OP_ACCIMM DB 1 DW 0 DW 0 DD 0 DW 0 DW 0 base1 DW 0FCh DW 020h DD opn_and DB OP_REGRMREG DB 2 DW 0FEh DW 024h DD opn_and DB OP_ACCIMM DB 1 DW 0FFh DW 027h DD opn_daa DB OP_CODEONLY DB 1 DW 0FCh DW 028h DD opn_sub DB OP_REGRMREG DB 2 DW 0FEh DW 02ch DD opn_sub DB OP_ACCIMM DB 1 DW 0FFh DW 02Fh DD opn_das DB OP_CODEONLY DB 1 DW 0FCh DW 030h DD opn_xor DB OP_REGRMREG DB 2 DW 0FEh DW 034h DD opn_xor DB OP_ACCIMM DB 1 DW 0FFh DW 037h DD opn_aaa DB OP_CODEONLY DB 1 DW 0FCh DW 038h DD opn_cmp DB OP_REGRMREG DB 2 DW 0FEh DW 03Ch DD opn_cmp DB OP_ACCIMM DB 1 DW 0FFh DW 03Fh DD opn_aas DB OP_CODEONLY DB 1 DW 0 DW 0 DD 0 DW 0 DW 0 base2 DW 0f8h DW 040h DD opn_inc DB OP_WREG02 DB 1 DW 0f8h DW 048h DD opn_dec DB OP_WREG02 DB 1 DW 0f8h DW 050h DD opn_push DB OP_WREG02 DB 1 DW 0f8h DW 058h DD opn_pop DB OP_WREG02 DB 1 DW 0 DW 0 DD 0 DW 0 DW 0 base3 DW 0ffh DW 060h DD opn_pusha DB OP_CODEONLY DB 1 DW 0ffh DW 061h DD opn_popa DB OP_CODEONLY DB 1 DW 0ffh DW 062h DD opn_bound DB OP_WORDREGRM DB 2 DW 0ffh DW 063h DD opn_arpl DB OP_WORDRMREG DB 2 DW 0fdh DW 068h DD opn_push DB OP_IMM DB 1 DW 0fdh DW 069h DD opn_imul DB OP_IMUL DB 2 DW 0ffh DW 06ch DD opn_insb DB OP_CODEONLY DB 1 DW 0ffh DW 06dh DD opn_ins DB OP_CODEONLY DB 1 DW 0ffh DW 06eh DD opn_outsb DB OP_CODEONLY DB 1 DW 0ffh DW 06fh DD opn_outs DB OP_CODEONLY DB 1 DW 0ffh DW 070h DD opn_jo DB OP_SHORTBRANCH DB 2 DW 0ffh DW 071h DD opn_jno DB OP_SHORTBRANCH DB 2 DW 0ffh DW 072h DD opn_jb DB OP_SHORTBRANCH DB 2 DW 0ffh DW 073h DD opn_jnb DB OP_SHORTBRANCH DB 2 DW 0ffh DW 074h DD opn_jz DB OP_SHORTBRANCH DB 2 DW 0ffh DW 075h DD opn_jnz DB OP_SHORTBRANCH DB 2 DW 0ffh DW 076h DD opn_jbe DB OP_SHORTBRANCH DB 2 DW 0ffh DW 077h DD opn_ja DB OP_SHORTBRANCH DB 2 DW 0ffh DW 078h DD opn_js DB OP_SHORTBRANCH DB 2 DW 0ffh DW 079h DD opn_jns DB OP_SHORTBRANCH DB 2 DW 0ffh DW 07ah DD opn_jp DB OP_SHORTBRANCH DB 2 DW 0ffh DW 07bh DD opn_jnp DB OP_SHORTBRANCH DB 2 DW 0ffh DW 07ch DD opn_jl DB OP_SHORTBRANCH DB 2 DW 0ffh DW 07dh DD opn_jge DB OP_SHORTBRANCH DB 2 DW 0ffh DW 07eh DD opn_jle DB OP_SHORTBRANCH DB 2 DW 0ffh DW 07fh DD opn_jg DB OP_SHORTBRANCH DB 2 DW 0 DW 0 DD 0 DW 0 DW 0 base4 DW 038fch DW 080h DD opn_add DB OP_RMIMMSIGNED DB 2 DW 038feh DW 0880h DD opn_or DB OP_RMIMMSIGNED DB 2 DW 038fch DW 0880h DD opn_or DB OP_RMIMMSIGNED DB 2 DW 038fch DW 01080h DD opn_adc DB OP_RMIMMSIGNED DB 2 DW 038fch DW 01880h DD opn_sbb DB OP_RMIMMSIGNED DB 2 DW 038feh DW 02080h DD opn_and DB OP_RMIMMSIGNED DB 2 DW 038fch DW 02080h DD opn_and DB OP_RMIMMSIGNED DB 2 DW 038fch DW 02880h DD opn_sub DB OP_RMIMMSIGNED DB 2 DW 038feh DW 03080h DD opn_xor DB OP_RMIMMSIGNED DB 2 DW 038fch DW 03080h DD opn_xor DB OP_RMIMMSIGNED DB 2 DW 038fch DW 03880h DD opn_cmp DB OP_RMIMMSIGNED DB 2 DW 0feh DW 084h DD opn_test DB OP_REGRM DB 2 DW 0feh DW 086h DD opn_xchg DB OP_REGRM DB 2 DW 0fch DW 088h DD opn_mov DB OP_REGRMREG DB 2 DW 020fdh DW 08ch DD opn_mov DB OP_SEGRMSEG DB 2 DW 0fdh DW 08ch DD opn_mov DB OP_SEGRMSEG DB 2 DW 0ffh DW 08dh DD opn_lea DB OP_WORDREGRM DB 2 DW 038ffh DW 08fh DD opn_pop DB OP_NOSTRICTRM DB 2 DW 0ffh DW 090h DD opn_nop DB OP_CODEONLY DB 1 DW 0f8h DW 090h DD opn_xchg DB OP_ACCREG02 DB 1 DW 0ffh DW 098h DD opn_cbw DB OP_CBW DB 1 DW 0ffh DW 099h DD opn_cwd DB OP_CODEONLY DB 1 DW 0ffh DW 09ah DD opn_call DB OP_SEGBRANCH DB 5 DW 0ffh DW 09bh DD opn_wait DB OP_CODEONLY DB 1 DW 0ffh DW 09ch DD opn_pushf DB OP_INSWORDSIZE DB 1 DW 0ffh DW 09dh DD opn_popf DB OP_INSWORDSIZE DB 1 DW 0ffh DW 09eh DD opn_sahf DB OP_CODEONLY DB 1 DW 0ffh DW 09fh DD opn_lahf DB OP_CODEONLY DB 1 DW 0 DW 0 DD 0 DW 0 DW 0 base5 DW 0feh DW 0a0h DD opn_mov DB OP_ACCABS DB 3 DW 0feh DW 0a2h DD opn_mov DB OP_ABSACC DB 3 DW 0ffh DW 0a5h DD opn_movs DB OP_INSWORDSIZE DB 1 DW 0ffh DW 0a7h DD opn_cmps DB OP_INSWORDSIZE DB 1 DW 0feh DW 0a8h DD opn_test DB OP_ACCIMM DB 1 DW 0ffh DW 0abh DD opn_stos DB OP_INSWORDSIZE DB 1 DW 0ffh DW 0adh DD opn_lods DB OP_INSWORDSIZE DB 1 DW 0ffh DW 0afh DD opn_scas DB OP_INSWORDSIZE DB 1 DW 0ffh DW 0a4h DD opn_movsb DB OP_CODEONLY DB 1 DW 0ffh DW 0a6h DD opn_cmpsb DB OP_CODEONLY DB 1 DW 0ffh DW 0aah DD opn_stosb DB OP_CODEONLY DB 1 DW 0ffh DW 0ach DD opn_lodsb DB OP_CODEONLY DB 1 DW 0ffh DW 0aeh DD opn_scasb DB OP_CODEONLY DB 1 DW 0f0h DW 0b0h DD opn_mov DB OP_ACCIMMB3 DB 1 DW 0 DW 0 DD 0 DW 0 DW 0 base6 DW 038feh DW 0c0h DD opn_rol DB OP_RMSHIFT DB 2 DW 038feh DW 08c0h DD opn_ror DB OP_RMSHIFT DB 2 DW 038feh DW 010c0h DD opn_rcl DB OP_RMSHIFT DB 2 DW 038feh DW 018c0h DD opn_rcr DB OP_RMSHIFT DB 2 DW 038feh DW 020c0h DD opn_shl DB OP_RMSHIFT DB 2 DW 038feh DW 028c0h DD opn_shr DB OP_RMSHIFT DB 2 DW 038feh DW 038c0h DD opn_sar DB OP_RMSHIFT DB 2 DW 0ffh DW 0c2h DD opn_ret DB OP_RET DB 3 DW 0ffh DW 0c3h DD opn_ret DB OP_CODEONLY DB 1 DW 0ffh DW 0c4h DD opn_les DB OP_WORDREGRM DB 2 DW 0ffh DW 0c5h DD opn_lds DB OP_WORDREGRM DB 2 DW 038feh DW 0c6h DD opn_mov DB OP_RMIMM DB 2 DW 0ffh DW 0c8h DD opn_enter DB OP_ENTER DB 4 DW 0ffh DW 0cah DD opn_retf DB OP_RET DB 3 DW 0ffh DW 0cbh DD opn_retf DB OP_CODEONLY DB 1 DW 0ffh DW 0cch DD opn_int DB OP_INTR DB 1 DW 0ffh DW 0cdh DD opn_int DB OP_INTR DB 2 DW 0ffh DW 0ceh DD opn_into DB OP_CODEONLY DB 1 DW 0ffh DW 0cfh DD opn_iret DB OP_CODEONLY DB 1 DW 0ffh DW 0c9h DD opn_leave DB OP_CODEONLY DB 1 DW 038fch DW 0d0h DD opn_rol DB OP_RMSHIFT DB 2 DW 038fch DW 08d0h DD opn_ror DB OP_RMSHIFT DB 2 DW 038fch DW 010d0h DD opn_rcl DB OP_RMSHIFT DB 2 DW 038fch DW 018d0h DD opn_rcr DB OP_RMSHIFT DB 2 DW 038fch DW 020d0h DD opn_shl DB OP_RMSHIFT DB 2 DW 038fch DW 028d0h DD opn_shr DB OP_RMSHIFT DB 2 DW 038fch DW 038d0h DD opn_sar DB OP_RMSHIFT DB 2 DW 0ffffh DW 0ad4h DD opn_aam DB OP_CODEONLY DB 2 DW 0ffffh DW 0ad5h DD opn_aad DB OP_CODEONLY DB 2 DW 0ffh DW 0d7h DD opn_xlat DB OP_CODEONLY DB 1 DW 0 DW 0 DD 0 DW 0 DW 0 base7 DW 0ffh DW 0e0h DD opn_loopnz DB OP_SHORTBRANCH DB 2 DW 0ffh DW 0e1h DD opn_loopz DB OP_SHORTBRANCH DB 2 DW 0ffh DW 0e2h DD opn_loop DB OP_SHORTBRANCH DB 2 DW 0ffh DW 0e3h DD opn_jcxz DB OP_SHORTBRANCH DB 2 DW 0feh DW 0e4h DD opn_in DB OP_PORTACCPORT DB 2 DW 0feh DW 0e6h DD opn_out DB OP_PORTACCPORT DB 2 DW 0ffh DW 0e8h DD opn_call DB OP_BRANCH DB 3 DW 0ffh DW 0e9h DD opn_jmp DB OP_BRANCH DB 3 DW 0ffh DW 0eah DD opn_jmp DB OP_SEGBRANCH DB 5 DW 0ffh DW 0ebh DD opn_jmp DB OP_SHORTBRANCH DB 2 DW 0feh DW 0ech DD opn_in DB OP_ACCDX DB 1 DW 0feh DW 0eeh DD opn_out DB OP_DXACC DB 1 DW 0ffh DW 0f0h DD opn_lock DB OP_CODEONLY DB 1 DW 0ffh DW 0f2h DD opn_repnz DB OP_CODEONLY DB 1 DW 0ffh DW 0f3h DD opn_repz DB OP_CODEONLY DB 1 DW 0ffh DW 0f4h DD opn_hlt DB OP_CODEONLY DB 1 DW 0ffh DW 0f5h DD opn_cmc DB OP_CODEONLY DB 1 DW 038feh DW 0f6h DD opn_test DB OP_RMIMM DB 2 DW 038feh DW 010f6h DD opn_not DB OP_RM DB 2 DW 038feh DW 018f6h DD opn_neg DB OP_RM DB 2 DW 038feh DW 020f6h DD opn_mul DB OP_RM DB 2 DW 038feh DW 028f6h DD opn_imul DB OP_RM DB 2 DW 038feh DW 030f6h DD opn_div DB OP_RM DB 2 DW 038feh DW 038f6h DD opn_idiv DB OP_RM DB 2 DW 0ffh DW 0f8h DD opn_clc DB OP_CODEONLY DB 1 DW 0ffh DW 0f9h DD opn_stc DB OP_CODEONLY DB 1 DW 0ffh DW 0fah DD opn_cli DB OP_CODEONLY DB 1 DW 0ffh DW 0fbh DD opn_sti DB OP_CODEONLY DB 1 DW 0ffh DW 0fch DD opn_cld DB OP_CODEONLY DB 1 DW 0ffh DW 0fdh DD opn_std DB OP_CODEONLY DB 1 DW 038feh DW 0feh DD opn_inc DB OP_RM DB 2 DW 038feh DW 08feh DD opn_dec DB OP_RM DB 2 DW 038ffh DW 010ffh DD opn_call DB OP_RM DB 2 DW 038ffh DW 018ffh DD opn_call DB OP_FARRM DB 2 DW 038ffh DW 020ffh DD opn_jmp DB OP_RM DB 2 DW 038ffh DW 028ffh DD opn_jmp DB OP_FARRM DB 2 DW 038ffh DW 030ffh DD opn_push DB OP_NOSTRICTRM DB 2 DW 0 DW 0 DD 0 DW 0 DW 0 base386 DW 0feh DW 0beh DD opn_movsx DB OP_MIXEDREGRM DB 2 DW 0feh DW 0b6h DD opn_movzx DB OP_MIXEDREGRM DB 2 DW 0f7h DW 0a0h DD opn_push DB OP_SEG35 DB 1 DW 0f7h DW 0a1h DD opn_pop DB OP_SEG35 DB 1 DW 0ffh DW 0b4h DD opn_lfs DB OP_WORDREGRM DB 2 DW 0ffh DW 0b5h DD opn_lgs DB OP_WORDREGRM DB 2 DW 0ffh DW 0b2h DD opn_lss DB OP_WORDREGRM DB 2 DW 0ffh DW 06h DD opn_clts DB OP_CODEONLY DB 1 DW 0ffh DW 0afh DD opn_imul DB OP_WORDREGRM DB 2 DW 0ffh DW 0a4h DD opn_shld DB OP_REGRMSHIFT DB 3 DW 0ffh DW 0a5h DD opn_shld DB OP_REGRMSHIFT DB 2 DW 0ffh DW 0ach DD opn_shrd DB OP_REGRMSHIFT DB 3 DW 0ffh DW 0adh DD opn_shrd DB OP_REGRMSHIFT DB 2 DW 0ffh DW 0bch DD opn_bsf DB OP_WORDREGRM DB 2 DW 0ffh DW 0bdh DD opn_bsr DB OP_WORDREGRM DB 2 DW 0ffh DW 0a3h DD opn_bt DB OP_WORDRMREG DB 2 DW 0ffh DW 0abh DD opn_bts DB OP_WORDRMREG DB 2 DW 0ffh DW 0b3h DD opn_btr DB OP_WORDRMREG DB 2 DW 0ffh DW 0bbh DD opn_btc DB OP_WORDRMREG DB 2 DW 038ffh DW 020bah DD opn_bt DB OP_BITNUM DB 3 DW 038ffh DW 028bah DD opn_bts DB OP_BITNUM DB 3 DW 038ffh DW 030bah DD opn_btr DB OP_BITNUM DB 3 DW 038ffh DW 038bah DD opn_btc DB OP_BITNUM DB 3 DW 0ffh DW 0a7h DD opn_ibts DB OP_CODEONLY DB 1 DW 0ffh DW 0a6h DD opn_xbts DB OP_CODEONLY DB 1 DW 0ffh DW 080h DD opn_jo DB OP_BRANCH DB 3 DW 0ffh DW 081h DD opn_jno DB OP_BRANCH DB 3 DW 0ffh DW 082h DD opn_jb DB OP_BRANCH DB 3 DW 0ffh DW 083h DD opn_jnb DB OP_BRANCH DB 3 DW 0ffh DW 084h DD opn_jz DB OP_BRANCH DB 3 DW 0ffh DW 085h DD opn_jnz DB OP_BRANCH DB 3 DW 0ffh DW 086h DD opn_jbe DB OP_BRANCH DB 3 DW 0ffh DW 087h DD opn_ja DB OP_BRANCH DB 3 DW 0ffh DW 088h DD opn_js DB OP_BRANCH DB 3 DW 0ffh DW 089h DD opn_jns DB OP_BRANCH DB 3 DW 0ffh DW 08ah DD opn_jp DB OP_BRANCH DB 3 DW 0ffh DW 08bh DD opn_jnp DB OP_BRANCH DB 3 DW 0ffh DW 08ch DD opn_jl DB OP_BRANCH DB 3 DW 0ffh DW 08dh DD opn_jge DB OP_BRANCH DB 3 DW 0ffh DW 08eh DD opn_jle DB OP_BRANCH DB 3 DW 0ffh DW 08fh DD opn_jg DB OP_BRANCH DB 3 DW 038ffh DW 090h DD opn_seto DB OP_NOSTRICTRM DB 2 DW 038ffh DW 091h DD opn_setno DB OP_NOSTRICTRM DB 2 DW 038ffh DW 092h DD opn_setb DB OP_NOSTRICTRM DB 2 DW 038ffh DW 093h DD opn_setnb DB OP_NOSTRICTRM DB 2 DW 038ffh DW 094h DD opn_setz DB OP_NOSTRICTRM DB 2 DW 038ffh DW 095h DD opn_setnz DB OP_NOSTRICTRM DB 2 DW 038ffh DW 096h DD opn_setbe DB OP_NOSTRICTRM DB 2 DW 038ffh DW 097h DD opn_seta DB OP_NOSTRICTRM DB 2 DW 038ffh DW 098h DD opn_sets DB OP_NOSTRICTRM DB 2 DW 038ffh DW 099h DD opn_setns DB OP_NOSTRICTRM DB 2 DW 038ffh DW 09ah DD opn_setp DB OP_NOSTRICTRM DB 2 DW 038ffh DW 09bh DD opn_setnp DB OP_NOSTRICTRM DB 2 DW 038ffh DW 09ch DD opn_setl DB OP_NOSTRICTRM DB 2 DW 038ffh DW 09dh DD opn_setge DB OP_NOSTRICTRM DB 2 DW 038ffh DW 09eh DD opn_setle DB OP_NOSTRICTRM DB 2 DW 038ffh DW 09fh DD opn_setg DB OP_NOSTRICTRM DB 2 DW 0c0fdh DW 0c020h DD opn_mov DB OP_386REG DB 2 DW 0c0fdh DW 0c021h DD opn_mov DB OP_386REG DB 2 DW 0c0fdh DW 0c024h DD opn_mov DB OP_386REG DB 2 DW 0ffh DW 02h DD opn_lar DB OP_WORDREGRM DB 2 DW 0ffh DW 03h DD opn_lsl DB OP_WORDREGRM DB 2 DW 038ffh DW 01001h DD opn_lgdt DB OP_NOSTRICTRM DB 2 DW 038ffh DW 01801h DD opn_lidt DB OP_NOSTRICTRM DB 2 DW 038ffh DW 01000h DD opn_lldt DB OP_NOSTRICTRM DB 2 DW 038ffh DW 03001h DD opn_lmsw DB OP_NOSTRICTRM DB 2 DW 038ffh DW 01800h DD opn_ltr DB OP_NOSTRICTRM DB 2 DW 038ffh DW 01h DD opn_sgdt DB OP_NOSTRICTRM DB 2 DW 038ffh DW 0801h DD opn_sidt DB OP_NOSTRICTRM DB 2 DW 038ffh DW 00h DD opn_sldt DB OP_NOSTRICTRM DB 2 DW 038ffh DW 02001h DD opn_smsw DB OP_NOSTRICTRM DB 2 DW 038ffh DW 0800h DD opn_str DB OP_NOSTRICTRM DB 2 DW 038ffh DW 02000h DD opn_verr DB OP_NOSTRICTRM DB 2 DW 038ffh DW 02800h DD opn_verw DB OP_NOSTRICTRM DB 2 ; Some Pentium (and better) instructions DW 0FFh DW 30h DD opn_wrmsr DB OP_CODEONLY DB 1 DW 0FFh DW 32h DD opn_rdmsr DB OP_CODEONLY DB 1 DW 0FFh DW 31h DD opn_rdtsc DB OP_CODEONLY DB 1 DW 0FFh DW 0A2h DD opn_cpuid DB OP_CODEONLY DB 1 DW 0FFh DW 01h DD opn_invlpg DB OP_CODEONLY DB 1 DW 0FFh DW 08h DD opn_invd DB OP_CODEONLY DB 1 DW 0FFh DW 09h DD opn_wbinvd DB OP_CODEONLY DB 1 DW 0FFh DW 34h DD opn_sysenter DB OP_CODEONLY DB 1 DW 0FFh DW 36h DD opn_sysexit DB OP_CODEONLY DB 1 DW 0FFh DW 05h DD opn_syscall DB OP_CODEONLY DB 1 DW 0FFh DW 07h DD opn_sysret DB OP_CODEONLY DB 1 DD 0,0,0 ; Table end marker ;--- single byte commands --- floats DW 0ffffh DW 0d0d9h DD opn_fnop DB OP_CODEONLY DB 2 DW 0ffffh DW 0e0d9h DD opn_fchs DB OP_CODEONLY DB 2 DW 0ffffh DW 0e1d9h DD opn_fabs DB OP_CODEONLY DB 2 DW 0ffffh DW 0e4d9h DD opn_ftst DB OP_CODEONLY DB 2 DW 0ffffh DW 0e5d9h DD opn_fxam DB OP_CODEONLY DB 2 DW 0ffffh DW 0e8d9h DD opn_fld1 DB OP_CODEONLY DB 2 DW 0ffffh DW 0e9d9h DD opn_fldl2t DB OP_CODEONLY DB 2 DW 0ffffh DW 0ead9h DD opn_fldl2e DB OP_CODEONLY DB 2 DW 0ffffh DW 0ebd9h DD opn_fldpi DB OP_CODEONLY DB 2 DW 0ffffh DW 0ecd9h DD opn_fldlg2 DB OP_CODEONLY DB 2 DW 0ffffh DW 0edd9h DD opn_fldln2 DB OP_CODEONLY DB 2 DW 0ffffh DW 0eed9h DD opn_fldz DB OP_CODEONLY DB 2 DW 0ffffh DW 0f0d9h DD opn_f2xm1 DB OP_CODEONLY DB 2 DW 0ffffh DW 0f1d9h DD opn_fyl2x DB OP_CODEONLY DB 2 DW 0ffffh DW 0f2d9h DD opn_fptan DB OP_CODEONLY DB 2 DW 0ffffh DW 0f3d9h DD opn_fpatan DB OP_CODEONLY DB 2 DW 0ffffh DW 0f5d9h DD opn_fprem1 DB OP_CODEONLY DB 2 DW 0ffffh DW 0f4d9h DD opn_fxtract DB OP_CODEONLY DB 2 DW 0ffffh DW 0f6d9h DD opn_fdecstp DB OP_CODEONLY DB 2 DW 0ffffh DW 0f7d9h DD opn_fincstp DB OP_CODEONLY DB 2 DW 0ffffh DW 0f8d9h DD opn_fprem DB OP_CODEONLY DB 2 DW 0ffffh DW 0f9d9h DD opn_fyl2xp1 DB OP_CODEONLY DB 2 DW 0ffffh DW 0fad9h DD opn_fsqrt DB OP_CODEONLY DB 2 DW 0ffffh DW 0fbd9h DD opn_fsincos DB OP_CODEONLY DB 2 DW 0ffffh DW 0fcd9h DD opn_frndint DB OP_CODEONLY DB 2 DW 0ffffh DW 0fdd9h DD opn_fscale DB OP_CODEONLY DB 2 DW 0ffffh DW 0fed9h DD opn_fsin DB OP_CODEONLY DB 2 DW 0ffffh DW 0ffd9h DD opn_fcos DB OP_CODEONLY DB 2 DW 0ffffh DW 0e9dah DD opn_fucompp DB OP_CODEONLY DB 2 DW 0ffffh DW 0e0dbh DD opn_feni DB OP_CODEONLY DB 2 DW 0ffffh DW 0e1dbh DD opn_fdisi DB OP_CODEONLY DB 2 DW 0ffffh DW 0e2dbh DD opn_fclex DB OP_CODEONLY DB 2 DW 0ffffh DW 0e3dbh DD opn_finit DB OP_CODEONLY DB 2 DW 0ffffh DW 0e4dbh DD opn_fsetpm DB OP_CODEONLY DB 2 DW 0ffffh DW 0d9deh DD opn_fcompp DB OP_CODEONLY DB 2 ; --- Group 1, RM 3 --- DW 0f8ffh DW 0c0d9h DD opn_fld DB OP_FLOATRM DB 2 DW 0f8ffh DW 0c8d9h DD opn_fxch DB OP_FLOATRM DB 2 DW 0f8fbh DW 0d8d9h DD opn_fstp DB OP_FLOATRM DB 2 DW 0c0ffh DW 0c0d9h DD opn_esc DB OP_ESC DB 2 ; --- Group 1, RM0-2 --- DW 038ffh DW 020d9h DD opn_fldenv DB OP_FLOATNOPTR DB 2 DW 038ffh DW 028d9h DD opn_fldcw DB OP_FLOATNOPTR DB 2 DW 038ffh DW 030d9h DD opn_fstenv DB OP_FLOATNOPTR DB 2 DW 038ffh DW 038d9h DD opn_fstcw DB OP_FLOATNOPTR DB 2 ; --- Group 5, RM3 --- DW 0f8ffh DW 0c0ddh DD opn_ffree DB OP_FLOATRM DB 2 DW 0f8ffh DW 0d0ddh DD opn_fst DB OP_FLOATRM DB 2 DW 0f8ffh DW 0e0ddh DD opn_fucom DB OP_FLOATRM DB 2 DW 0f8ffh DW 0e8ddh DD opn_fucomp DB OP_FLOATRM DB 2 DW 0c0ffh DW 0c0ddh DD opn_esc DB OP_ESC DB 2 ; --- Group 5, RM0-2 --- DW 038ffh DW 020ddh DD opn_frstor DB OP_FLOATNOPTR DB 2 DW 038ffh DW 030ddh DD opn_fsave DB OP_FLOATNOPTR DB 2 DW 038ffh DW 038ddh DD opn_fstsw DB OP_FLOATNOPTR DB 2 ; --- Group 3 & 7--- DW 0c0fbh DW 0c0dbh DD opn_esc DB OP_ESC DB 2 DW 038ffh DW 028dbh DD opn_fld DB OP_SIZEFLOATRM DB 2 DW 038ffh DW 038dbh DD opn_fstp DB OP_SIZEFLOATRM DB 2 ; --- Group 7 --- DW 038ffh DW 020dfh DD opn_fbld DB OP_SIZEFLOATRM DB 2 DW 038ffh DW 028dfh DD opn_fild DB OP_SIZEFLOATRM DB 2 DW 038ffh DW 030dfh DD opn_fbstp DB OP_SIZEFLOATRM DB 2 DW 038ffh DW 038dfh DD opn_fistp DB OP_SIZEFLOATRM DB 2 ; --- Math, group 0,2,4,6 special RM 3--- DW 0c0ffh DW 0c0dah DD opn_esc DB OP_ESC DB 2 DW 0f8ffh DW 0c0deh DD opn_fadd DB OP_FLOATMATH DB 2 DW 0f8ffh DW 0c8deh DD opn_fmul DB OP_FLOATMATH DB 2 DW 0f8ffh DW 0d0deh DD opn_fcom DB OP_FLOATRM DB 2 DW 0f8ffh DW 0d8deh DD opn_esc DB OP_ESC DB 2 DW 0f0ffh DW 0e0deh DD opn_fsub DB OP_FLOATMATH DB 2 DW 0f0ffh DW 0f0deh DD opn_fdiv DB OP_FLOATMATH DB 2 ; --- Math, other --- DW 038fbh DW 0d8h DD opn_fadd DB OP_FLOATMATH DB 2 DW 038fbh DW 08d8h DD opn_fmul DB OP_FLOATMATH DB 2 DW 038fbh DW 010d8h DD opn_fcom DB OP_FLOATRM DB 2 DW 038fbh DW 018d8h DD opn_fcomp DB OP_FLOATRM DB 2 DW 030fbh DW 020d8h DD opn_fsub DB OP_FLOATMATH DB 2 DW 030fbh DW 030d8h DD opn_fdiv DB OP_FLOATMATH DB 2 DW 038fbh DW 0dah DD opn_fiadd DB OP_FLOATMATH DB 2 DW 038fbh DW 08dah DD opn_fimul DB OP_FLOATMATH DB 2 DW 038fbh DW 010dah DD opn_ficom DB OP_FLOATRM DB 2 DW 038fbh DW 018dah DD opn_ficomp DB OP_FLOATRM DB 2 DW 030fbh DW 020dah DD opn_fisub DB OP_FLOATMATH DB 2 DW 030fbh DW 030dah DD opn_fidiv DB OP_FLOATMATH DB 2 ; --- groups 1, 3, 5, 7 --- ; --- keep the follwing from going into error, RM3 --- DW 0e0f9h DW 0c0d9h DD opn_esc DB OP_ESC DB 2 DW 038fbh DW 0d9h DD opn_fld DB OP_FLOATRM DB 2 DW 038fbh DW 010d9h DD opn_fst DB OP_FLOATRM DB 2 DW 038fbh DW 018d9h DD opn_fstp DB OP_FLOATRM DB 2 DW 038fbh DW 0dbh DD opn_fild DB OP_FLOATRM DB 2 DW 038fbh DW 010dbh DD opn_fist DB OP_FLOATRM DB 2 DW 038fbh DW 018dbh DD opn_fistp DB OP_FLOATRM DB 2 ; --- Catch-all --- DW 0f8h DW 0d8h DD opn_esc DB OP_ESC DB 2 DW 0 DW 0 DD 0 DW 0 DW 0 indexes DD base0,base1,base2,base3,base4,base5,base6,base7 section .text ; FindOpcode - find operation code in table. ; Input: GS:ESI - address. ; Output: CF=0 - found; ; CF=1 - not found. proc FindOpcode mov ebx,base386 ; Assume it is an 0F opcode inc esi ; Point to next byte cmp byte [gs:esi-1],0Fh ; Is it? je .GoTable ; Yes, go parse second byte dec esi ; Else point back to first byte mov ebx,floats ; Assume floating xor eax,eax ; mov al,[gs:esi] ; Get the opcode and al,0F8h ; Apply the FLOAT mask cmp al,0D8h ; Apply FLOAT compare je .GoTable ; Yes, go look for opcode shr al,5 ; Else use upper three bits of mov ebx,[indexes+eax*4] ; opcode to select a table .GoTable: test word [ebx],-1 ; See if at end of table jz .NoEntry ; Yes, not found mov ax,[gs:esi] ; Get the opcode and ax,[ebx+tOpCode.Mask] ; Mask it cmp ax,[ebx+tOpCode.Compare]; Compare with the compare value je .GotEntry ; Quit if found add ebx,tOpCode_size ; Else go to next entry jmp .GoTable .GotEntry: clc ; Found, exit ret .NoEntry: stc ; Not found, exit ret endp ;--------------------------------------------------------------- ",16272,True,4206.581941553686,median "FORMAT: 1A HOST: https://ktatje-219919.appspot.com/api # KTA Organizer # General ## Documentation This document contains all general information. For API documentation you can go here [KTA Organizer · Apiary](https://ktaorganizer.docs.apiary.io). ## Source Code All source code is publicly (don't worry its secure) available in the [KTA Organizer](https://github.com/KTA-Organizer) organisation on Github. ### Organizer-API It provides all API calls abstracted away that the front-end needs such as MySQL calls, bucket storage, document storage, etc. It is written in Typescript and deployed on Google App Engine for NodeJS. Browser client written in Vue. Development instructions in the README. ### Organizer-Client Browser client written in Vue. Development instructions in the README. # Devops Everything is hosted on Google Cloud (project id: `ktatje-219919`). The following services are used. * App Engine for the back-end * SQL (MySQL) for our main database * Storage for backend configs, and the frontend build. * Datastore for storage of reports * Cloud Build for continuous deployment ## Continuous Integration Integration tests for the back-end are executed on every commit in the `dev` and `master` branch. These can be viewed here [Travis CI](https://travis-ci.org/KTA-Organizer/Organizer-API). ## Continuous Deployment We make use of Google Build to achieve a continuous deployment cycle. This means that when the `dev` branch is merged into the `master` branch a new version is built and deployment. ### Back-end On the back-end the builder creates a new App Engine image to deploy. This new version will seamlessly replace the current version and migrate the traffic. ### Front-end The front-end builder transpiles the Vue code and puts the final javascript files into a bucket (Google Cloud Storage). The backend streams the html, javascript and css files from the bucket to the browser. # Why we chose to do X? An explanation why we made non straight-forward decisions. ### Why are reports stored in Datastore instead of MySQL? Reports need to be immutable (except for comments) thus using a relational database would retroactively change the reports when a discipline is changed. By storing the full report in datastore (JSON) and keeping a reference in MySQL we get queryable but immutable reports. ### Why are the front-end files in a bucket? The back-api not only handles REST API request but also serves the front-end files. We use continuous deployment and the front-end and back-end deployment should happen separate from each other. By putting the front-end files in the `kta-frontend-public` bucket the back-end can always stream the latest version of the front-end to the browser without restarting. ### Why are the back-end configurations in a bucket? All configuration of the backend is done in a JSON file that is stored on the `kta-backend-config` bucket. There are 3 configurations, 1 for each environment (testing, development and production). This way all configuration is centralised and stored seperatly. No sensitive data is stored in the source code. ### How we check on duplicate users while inserting. First we check if the user has a National Register Number. If not, we check on the email address. It is possible that the user doesn't have both. If this is the case we check on the name. When a user is added without both unique properties and has the same name as an existing user, the system won't add this user. The administrator must provide an unique addition to the name to add this user. # License Copyright 2018 Howest Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Opleiding Collectie [/disciplines] ### Lijst de opleidingen [GET] + Response 200 (application/json) [ { ""id"":73, ""name"":""Kapper"", ""active"":1, ""creatorId"":202 } ] ### Maak een nieuwe opleiding [POST] + Request (application/json) { ""name"": ""Vrouwenkapper"" } + Response 200 (application/json) + Body [ 82 ] ## Opleiding [/disciplines/{id}] + Parameters + id (number) - ID van de opleiding ### Vraag de opleiding op [GET] + Response 200 (application/json) { ""id"":24, ""name"":""Leraar lichamelijke opvoeding"", ""active"":1, ""creatorId"":105 } ### Verander de naam van de opleiding [PUT] + Request (application/json) { ""name"": ""Herenkapper"" } + Response 200 (application/json) ## Opleiding Student [/disciplines/student/{id}] + Parameters + id (number) - ID van de student ### Vraag de opleiding van een student op [GET] + Response 200 (application/json) { ""id"":26, ""name"":""PAV"", ""active"":1, ""creatorId"":105 } ### Verander de opleiding van een student [PUT] + Request (application/json) { ""disciplineid"": 26 } + Response 200 ### Verwijder de opleiding van een student [DELETE] + Response 200 ## Module Collectie [/modules{?disciplineid}] + Parameters + disciplineid (number) - ID van de opleiding ### Lijst de modules van een opleiding [GET] + Response 200 (application/json) [ { ""id"": 52, ""name"": ""Basket"", ""active"": 1, ""creatorId"": 105, ""disciplineid"": 24, ""creation"": ""2018-12-17T13:31:46.000Z"" }, { ""id"": 53, ""name"": ""Voetbal"", ""active"": 1, ""creatorId"": 105, ""disciplineid"": 24, ""creation"": ""2018-11-16T16:31:14.000Z"" }, { ""id"": 54, ""name"": ""Ping pong"", ""active"": 1, ""creatorId"": 105, ""disciplineid"": 24, ""creation"": ""2018-11-16T16:36:34.000Z"" } ] ## Module [/modules] ### Maak een nieuwe module [POST] + Request (application/json) { ""disciplineid"": 24, ""name"": ""Zwemmen"" } + Response 200 (application/json) + Body [ 158 ] ## Bestaande Module [/modules/{id}] + Parameters + id (number) - ID van de module ### Vraag een module op [GET] + Response 200 (application/json) { ""id"": 52, ""name"": ""Basket"", ""active"": 1, ""creatorId"": 105, ""disciplineid"": 24, ""creation"": ""2018-12-17T13:31:46.000Z"", ""domains"": [ { ""id"": 19, ""moduleid"": 52, ""name"": ""Lay-ups scoren"", ""active"": 1, ""creatorId"": 105, ""creation"": ""2018-11-16T16:20:52.000Z"", ""goals"": [ { ""id"": 29, ""name"": ""3 lay-ups scoren van de 5"", ""domainid"": 19, ""creation"": ""2018-11-16T16:21:39.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 17, ""name"": ""de leerling zet twee stappen voor hij springt"", ""weight"": 1, ""goalid"": 29, ""creation"": ""2018-11-16T16:22:06.000Z"", ""creatorId"": 105, ""active"": 0 }, { ""id"": 24, ""name"": ""de leerling kan zijn stress onder controle houden"", ""weight"": 1, ""goalid"": 29, ""creation"": ""2018-11-16T16:29:12.000Z"", ""creatorId"": 105, ""active"": 0 } ] }, { ""id"": 30, ""name"": ""lay-up via twee kanten"", ""domainid"": 19, ""creation"": ""2018-11-16T16:22:59.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 18, ""name"": ""de leerling kan zowel een lay-up scoren via rechts al links"", ""weight"": 1, ""goalid"": 30, ""creation"": ""2018-11-16T16:23:30.000Z"", ""creatorId"": 105, ""active"": 1 }, { ""id"": 144, ""name"": ""effffffffffffffffffffffffffffffff"", ""weight"": 1, ""goalid"": 30, ""creation"": ""2018-12-17T12:40:54.000Z"", ""creatorId"": 105, ""active"": 0 } ] }, { ""id"": 31, ""name"": ""Correcte techniek"", ""domainid"": 19, ""creation"": ""2018-11-16T16:24:20.000Z"", ""active"": 0, ""creatorId"": 105, ""criteria"": [ { ""id"": 19, ""name"": ""de leerlingen gebruikt het twee-passen ritme"", ""weight"": 1, ""goalid"": 31, ""creation"": ""2018-11-16T16:25:12.000Z"", ""creatorId"": 105, ""active"": 1 }, { ""id"": 20, ""name"": ""de leerling blijft links van het bord als hij links aanloopt"", ""weight"": 1, ""goalid"": 31, ""creation"": ""2018-11-16T16:25:36.000Z"", ""creatorId"": 105, ""active"": 1 }, { ""id"": 21, ""name"": ""de leerling kan zijn techniek beschrijven "", ""weight"": 1, ""goalid"": 31, ""creation"": ""2018-11-16T16:26:41.000Z"", ""creatorId"": 105, ""active"": 1 } ] } ] }, { ""id"": 20, ""moduleid"": 52, ""name"": ""Driepunters"", ""active"": 0, ""creatorId"": 105, ""creation"": ""2018-11-16T16:27:14.000Z"", ""goals"": [ { ""id"": 32, ""name"": ""3 driepunters scoren van de 6"", ""domainid"": 20, ""creation"": ""2018-11-16T16:27:38.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 25, ""name"": ""de leerling houdt zijn stress onder controleren"", ""weight"": 1, ""goalid"": 32, ""creation"": ""2018-11-16T16:29:25.000Z"", ""creatorId"": 105, ""active"": 1 }, { ""id"": 125, ""name"": ""test"", ""weight"": 3, ""goalid"": 32, ""creation"": ""2018-12-13T12:10:14.000Z"", ""creatorId"": 105, ""active"": 1 } ] }, { ""id"": 33, ""name"": ""Correcte techniek"", ""domainid"": 20, ""creation"": ""2018-11-16T16:27:56.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 22, ""name"": ""De leerling sprint lichtjes omhoog"", ""weight"": 1, ""goalid"": 33, ""creation"": ""2018-11-16T16:28:12.000Z"", ""creatorId"": 105, ""active"": 1 }, { ""id"": 23, ""name"": ""de leerling heeft geen balansproblemen bij het terecht komen"", ""weight"": 1, ""goalid"": 33, ""creation"": ""2018-11-16T16:28:42.000Z"", ""creatorId"": 105, ""active"": 1 } ] }, { ""id"": 34, ""name"": ""driepunters van links, rechts en midden"", ""domainid"": 20, ""creation"": ""2018-11-16T16:30:00.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 26, ""name"": ""de leerling scoort van elke richting"", ""weight"": 1, ""goalid"": 34, ""creation"": ""2018-11-16T16:30:24.000Z"", ""creatorId"": 105, ""active"": 1 } ] } ] } ] } ### Pas de opleiding en de naam van een module aan [PUT] + Request (application/json) { ""disciplineid"": 26, ""name"": ""Basketten"" } + Response 200 ## Module status [/modules/{id}/status] + Parameters + id (number) - ID van de module ### Pas de status van een module aan [PUT] + Request (application/json) { ""active"": 0 } + Response 200 ## Doelstellingen [/goals] ### Maak een nieuwe doelstelling [POST] + Request (application/json) { ""name"": ""Test doelstelling"", ""domainid"": 19, ""creatorid"": 105 } + Response 200 (application/json) + Body [ 135 ] ## Doelstelling update [/goals/{id}] + Parameters + id (number) - ID van de doelstelling ### Pas een doelstelling aan [PUT] + Request (application/json) { ""name"": ""Test doelstelling update"" } + Response 200 ## Doelstelling status update [/goals/{id}/status] + Parameters + id (number) - ID van de doelstelling ### Aanpassing status doelstelling [PUT] + Request (application/json) { ""active"": 0 } + Response 200 ## Domeinen [/domains] ### Maak een nieuw domein [POST] + Request (application/json) { ""name"": ""Test domein"", ""moduleid"": 52 } + Response 200 (application/json) + Body [ 101 ] ## Domein update [/domains/{id}] + Parameters + id (number) - ID van het domein ### Pas een domein aan [PUT] + Request (application/json) { ""name"": ""Test domein update"" } + Response 200 ## Domein status update [/domains/{id}/status] + Parameters + id (number) - ID van het domein ### Aanpassing status domein [PUT] + Request (application/json) { ""active"": 0 } + Response 200 ## Criteria [/criteria] ### Maak een nieuw criterion [POST] + Request (application/json) { ""name"": ""Test criterion"", ""goalid"": 29, ""weight"": 1 } + Response 200 (application/json) + Body { ""id"": 174, ""name"": ""Test criterion"", ""weight"": 1, ""goalid"": 29, ""creation"": ""2018-12-19T07:54:16.000Z"", ""creatorId"": 105, ""active"": 1 } ## Criteria update [/criteria/{id}] + Parameters + id (number) - ID van het criterion ### Pas een criterion aan [PUT] + Request (application/json) { ""name"": ""Test criterion update"" } + Response 200 ## Criterion status update [/criteria/{id}/status] + Parameters + id (number) - ID van het criterion ### Aanpassing status criterion [PUT] + Request (application/json) { ""active"": 0 } + Response 200 ## Meldingen Collectie [/meldingen] ### Lijst alle meldingen [GET] + Response 200 (application/json) [ { ""id"": 208, ""creatorId"": 187, ""titel"": ""Prettige feestdagen"", ""tekst"": ""

Ben, Thomas en Ward wensen iedereen prettige feestdagen toe!


HOHOHO


xoxo


\\ufeff\\""Image

"", ""datum"": ""2018-12-13T11:04:56.000Z"", ""creator"": { ""id"": 187, ""email"": ""ben.de.boevere@student.howest.be"", ""firstname"": ""Ben"", ""lastname"": ""De Boevere"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-12-06T08:28:22.000Z"", ""creatorId"": 105, ""nationalRegisterNumber"": ""84346846846"", ""userid"": null, ""teacher"": null, ""student"": null, ""staff"": null, ""roles"": [ ""ADMIN"" ], ""role"": ""ADMIN"" } }, { ""id"": 211, ""creatorId"": 105, ""titel"": ""deadline rapport kerst"", ""tekst"": ""

13/12/2018

"", ""datum"": ""2018-12-13T12:17:20.000Z"", ""creator"": { ""id"": 105, ""email"": ""admin@test.test"", ""firstname"": ""John"", ""lastname"": ""Doe"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-05T17:16:51.000Z"", ""creatorId"": null, ""nationalRegisterNumber"": ""93051822361"", ""userid"": 105, ""teacher"": null, ""student"": null, ""staff"": 0, ""roles"": [ ""ADMIN"" ], ""role"": ""ADMIN"" } }, { ""id"": 225, ""creatorId"": 105, ""titel"": ""Hello world!"", ""tekst"": ""

Hello world!

"", ""datum"": ""2018-12-17T14:48:29.000Z"", ""creator"": { ""id"": 105, ""email"": ""admin@test.test"", ""firstname"": ""John"", ""lastname"": ""Doe"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-05T17:16:51.000Z"", ""creatorId"": null, ""nationalRegisterNumber"": ""93051822361"", ""userid"": 105, ""teacher"": null, ""student"": null, ""staff"": 0, ""roles"": [ ""ADMIN"" ], ""role"": ""ADMIN"" } } ] ### Maak een nieuwe melding [POST] + Request (application/json) { ""titel"": ""Test melding"", ""tekst"": ""Dit is de tekst van deze melding."" } + Response 201 ## Melding [/meldingen/{id}] + Parameters + id (number) - ID van de melding ### Verwijder een melding [DELETE] + Response 200 ## Evaluations [/evaluations] ### Lijst alle evaluaties op [GET] + Response 200 (application/json) [ { ""id"": 35, ""startdate"": ""2018-12-12T23:00:00.000Z"", ""enddate"": ""2018-12-12T23:00:00.000Z"", ""studentid"": 186, ""teacherid"": 105, ""moduleid"": 56, ""periodname"": ""Kerst"" }, { ""id"": 36, ""startdate"": ""2018-12-12T23:00:00.000Z"", ""enddate"": ""2018-12-16T23:00:00.000Z"", ""studentid"": 107, ""teacherid"": 105, ""moduleid"": 56, ""periodname"": ""Pasen"" }, { ""id"": 39, ""startdate"": ""2018-08-31T22:00:00.000Z"", ""enddate"": ""2018-12-16T23:00:00.000Z"", ""studentid"": 186, ""teacherid"": 105, ""moduleid"": 56, ""periodname"": ""Kerst"" }, { ""id"": 43, ""startdate"": ""2018-12-16T23:00:00.000Z"", ""enddate"": ""2018-12-16T23:00:00.000Z"", ""studentid"": 183, ""teacherid"": 105, ""moduleid"": 52, ""periodname"": ""Pasen"" }, { ""id"": 44, ""startdate"": ""2018-12-16T23:00:00.000Z"", ""enddate"": ""2018-12-16T23:00:00.000Z"", ""studentid"": 107, ""teacherid"": 105, ""moduleid"": 56, ""periodname"": ""Pasen"" }, { ""id"": 45, ""startdate"": ""2018-12-16T23:00:00.000Z"", ""enddate"": ""2018-12-16T23:00:00.000Z"", ""studentid"": 155, ""teacherid"": 105, ""moduleid"": 54, ""periodname"": ""Pasen"" }, { ""id"": 46, ""startdate"": ""2018-12-16T23:00:00.000Z"", ""enddate"": null, ""studentid"": 153, ""teacherid"": 106, ""moduleid"": 53, ""periodname"": ""Pasen"" }, { ""id"": 47, ""startdate"": ""2018-12-16T23:00:00.000Z"", ""enddate"": ""2018-12-16T23:00:00.000Z"", ""studentid"": 183, ""teacherid"": 106, ""moduleid"": 54, ""periodname"": ""Pasen"" } ] ### Maak een nieuwe evaluatie [POST] + Request (application/json) { ""studentid"": 107, ""moduleid"": 52, ""startdate"": ""2018-11-06"", ""periodname"": ""Kerst"" } + Response 200 (application/json) { ""evaluationsheetid"": 61 } ## Evaluatie [/evaluations/{id}] + Parameters + id (number) - ID van de evaluatie ### Vraag een evaluatie op [GET] + Response 200 (application/json) { ""id"": 61, ""startdate"": ""2018-11-05T23:00:00.000Z"", ""enddate"": null, ""studentid"": 107, ""teacherid"": 105, ""moduleid"": 52, ""periodname"": ""Kerst"", ""student"": { ""id"": 107, ""email"": ""student@test.test"", ""firstname"": ""Bob"", ""lastname"": ""Doe"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-06T12:11:12.000Z"", ""creatorId"": 105, ""nationalRegisterNumber"": ""63051822369"", ""userid"": null, ""teacher"": null, ""admin"": null, ""staff"": null, ""roles"": [ ""STUDENT"" ], ""role"": ""STUDENT"" }, ""teacher"": { ""id"": 105, ""email"": ""admin@test.test"", ""firstname"": ""John"", ""lastname"": ""Doe"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-05T17:16:51.000Z"", ""creatorId"": null, ""nationalRegisterNumber"": ""93051822361"", ""userid"": 105, ""teacher"": null, ""student"": null, ""staff"": 0, ""roles"": [ ""ADMIN"" ], ""role"": ""ADMIN"" }, ""scores"": [], ""module"": { ""id"": 52, ""name"": ""Basket"", ""active"": 0, ""creatorId"": 105, ""disciplineid"": 24, ""creation"": ""2018-12-18T14:18:11.000Z"", ""domains"": [ { ""id"": 19, ""moduleid"": 52, ""name"": ""Lay-ups scoren"", ""active"": 1, ""creatorId"": 105, ""creation"": ""2018-11-16T16:20:52.000Z"", ""goals"": [ { ""id"": 29, ""name"": ""3 lay-ups scoren van de 5"", ""domainid"": 19, ""creation"": ""2018-11-16T16:21:39.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 17, ""name"": ""de leerling zet twee stappen voor hij springt"", ""weight"": 1, ""goalid"": 29, ""creation"": ""2018-11-16T16:22:06.000Z"", ""creatorId"": 105, ""active"": 0 }, { ""id"": 24, ""name"": ""de leerling kan zijn stress onder controle houden"", ""weight"": 1, ""goalid"": 29, ""creation"": ""2018-11-16T16:29:12.000Z"", ""creatorId"": 105, ""active"": 0 }, { ""id"": 174, ""name"": ""Test criterion update"", ""weight"": 1, ""goalid"": 29, ""creation"": ""2018-12-19T07:54:16.000Z"", ""creatorId"": 105, ""active"": 0 } ] }, { ""id"": 30, ""name"": ""lay-up via twee kanten"", ""domainid"": 19, ""creation"": ""2018-11-16T16:22:59.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 18, ""name"": ""de leerling kan zowel een lay-up scoren via rechts al links"", ""weight"": 1, ""goalid"": 30, ""creation"": ""2018-11-16T16:23:30.000Z"", ""creatorId"": 105, ""active"": 1 } ] }, { ""id"": 31, ""name"": ""Correcte techniek"", ""domainid"": 19, ""creation"": ""2018-11-16T16:24:20.000Z"", ""active"": 0, ""creatorId"": 105, ""criteria"": [ { ""id"": 19, ""name"": ""de leerlingen gebruikt het twee-passen ritme"", ""weight"": 1, ""goalid"": 31, ""creation"": ""2018-11-16T16:25:12.000Z"", ""creatorId"": 105, ""active"": 1 }, { ""id"": 20, ""name"": ""de leerling blijft links van het bord als hij links aanloopt"", ""weight"": 1, ""goalid"": 31, ""creation"": ""2018-11-16T16:25:36.000Z"", ""creatorId"": 105, ""active"": 1 }, { ""id"": 21, ""name"": ""de leerling kan zijn techniek beschrijven "", ""weight"": 1, ""goalid"": 31, ""creation"": ""2018-11-16T16:26:41.000Z"", ""creatorId"": 105, ""active"": 1 } ] }, { ""id"": 135, ""name"": ""Test doelstelling updated"", ""domainid"": 19, ""creation"": ""2018-12-18T14:22:24.000Z"", ""active"": 0, ""creatorId"": 105, ""criteria"": [] } ] }, { ""id"": 20, ""moduleid"": 52, ""name"": ""Driepunters"", ""active"": 0, ""creatorId"": 105, ""creation"": ""2018-11-16T16:27:14.000Z"", ""goals"": [ { ""id"": 32, ""name"": ""3 driepunters scoren van de 6"", ""domainid"": 20, ""creation"": ""2018-11-16T16:27:38.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 25, ""name"": ""de leerling houdt zijn stress onder controleren"", ""weight"": 1, ""goalid"": 32, ""creation"": ""2018-11-16T16:29:25.000Z"", ""creatorId"": 105, ""active"": 1 } ] }, { ""id"": 33, ""name"": ""Correcte techniek"", ""domainid"": 20, ""creation"": ""2018-11-16T16:27:56.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 22, ""name"": ""De leerling sprint lichtjes omhoog"", ""weight"": 1, ""goalid"": 33, ""creation"": ""2018-11-16T16:28:12.000Z"", ""creatorId"": 105, ""active"": 1 }, { ""id"": 23, ""name"": ""de leerling heeft geen balansproblemen bij het terecht komen"", ""weight"": 1, ""goalid"": 33, ""creation"": ""2018-11-16T16:28:42.000Z"", ""creatorId"": 105, ""active"": 1 } ] }, { ""id"": 34, ""name"": ""driepunters van links, rechts en midden"", ""domainid"": 20, ""creation"": ""2018-11-16T16:30:00.000Z"", ""active"": 1, ""creatorId"": 105, ""criteria"": [ { ""id"": 26, ""name"": ""de leerling scoort van elke richting"", ""weight"": 1, ""goalid"": 34, ""creation"": ""2018-11-16T16:30:24.000Z"", ""creatorId"": 105, ""active"": 1 } ] } ] }, { ""id"": 101, ""moduleid"": 52, ""name"": ""Test domain update"", ""active"": 0, ""creatorId"": 105, ""creation"": ""2018-12-18T14:31:27.000Z"", ""goals"": [] } ] }, ""discipline"": { ""id"": 24, ""name"": ""Leraar lichamelijke opvoeding"", ""active"": 1, ""creatorId"": 105 } } ### Verwijder een evaluatie [DELETE] + Response 200 ## Rapporten Collectie [/reports] ### Lijst alle rapporten op [GET] + Response 200 (application/json) { ""total"": 7, ""perPage"": 10000000000, ""lastPage"": 1, ""page"": 1, ""items"": [ { ""id"": ""5726607939469312"", ""evaluationsheetid"": 47, ""creation"": ""2018-12-17T20:35:47.000Z"", ""open"": 0, ""discipline"": { ""id"": 24, ""name"": ""Leraar lichamelijke opvoeding"" }, ""module"": { ""id"": 54, ""name"": ""Ping pong"" }, ""student"": { ""id"": 183, ""firstname"": ""Thomas"", ""lastname"": ""Billietje"" }, ""teacher"": { ""id"": 106, ""firstname"": ""Anna"", ""lastname"": ""Doe"" } }, { ""id"": ""5676533754626048"", ""evaluationsheetid"": 45, ""creation"": ""2018-12-17T20:07:51.000Z"", ""open"": 0, ""discipline"": { ""id"": 24, ""name"": ""Leraar lichamelijke opvoeding"" }, ""module"": { ""id"": 54, ""name"": ""Ping pong"" }, ""student"": { ""id"": 155, ""firstname"": ""Bert"", ""lastname"": ""Decloedt"" }, ""teacher"": { ""id"": 105, ""firstname"": ""John"", ""lastname"": ""Doe"" } }, { ""id"": ""5668294832947200"", ""evaluationsheetid"": 44, ""creation"": ""2018-12-17T20:07:34.000Z"", ""open"": 0, ""discipline"": { ""id"": 26, ""name"": ""PAV"" }, ""module"": { ""id"": 56, ""name"": ""Algemeen"" }, ""student"": { ""id"": 107, ""firstname"": ""Bob"", ""lastname"": ""Doe"" }, ""teacher"": { ""id"": 105, ""firstname"": ""John"", ""lastname"": ""Doe"" } }, { ""id"": ""5660980839186432"", ""evaluationsheetid"": 43, ""creation"": ""2018-12-17T19:43:54.000Z"", ""open"": 0, ""discipline"": { ""id"": 24, ""name"": ""Leraar lichamelijke opvoeding"" }, ""module"": { ""id"": 52, ""name"": ""Basket"" }, ""student"": { ""id"": 183, ""firstname"": ""Thomas"", ""lastname"": ""Billietje"" }, ""teacher"": { ""id"": 105, ""firstname"": ""John"", ""lastname"": ""Doe"" } }, { ""id"": ""5741031244955648"", ""evaluationsheetid"": 36, ""creation"": ""2018-12-17T19:43:05.000Z"", ""open"": 0, ""discipline"": { ""id"": 26, ""name"": ""PAV"" }, ""module"": { ""id"": 56, ""name"": ""Algemeen"" }, ""student"": { ""id"": 107, ""firstname"": ""Bob"", ""lastname"": ""Doe"" }, ""teacher"": { ""id"": 105, ""firstname"": ""John"", ""lastname"": ""Doe"" } }, { ""id"": ""5747286126624768"", ""evaluationsheetid"": 39, ""creation"": ""2018-12-17T11:38:56.000Z"", ""open"": 1, ""discipline"": { ""id"": 26, ""name"": ""PAV"" }, ""module"": { ""id"": 56, ""name"": ""Algemeen"" }, ""student"": { ""id"": 186, ""firstname"": ""Ward"", ""lastname"": ""Vandendriessche"" }, ""teacher"": { ""id"": 105, ""firstname"": ""John"", ""lastname"": ""Doe"" } }, { ""id"": ""5715999101812736"", ""evaluationsheetid"": 35, ""creation"": ""2018-12-13T15:34:19.000Z"", ""open"": 0, ""discipline"": { ""id"": 26, ""name"": ""PAV"" }, ""module"": { ""id"": 56, ""name"": ""Algemeen"" }, ""student"": { ""id"": 186, ""firstname"": ""Ward"", ""lastname"": ""Vandendriessche"" }, ""teacher"": { ""id"": 105, ""firstname"": ""John"", ""lastname"": ""Doe"" } } ] } ### Voeg een rapport toe [POST] + Request (application/json) { ""evaluationsheetid"": 35 } + Response 200 (application/json) + Body { ""reportid"": ""5651124426113024"" } ## Gebruikers Collectie [/users] ### Lijst alle gebruikers op [GET] + Response 200 (application/json) { ""total"": 16, ""perPage"": 10000000000, ""lastPage"": 1, ""page"": 1, ""items"": [ { ""id"": 105, ""email"": ""admin@test.test"", ""firstname"": ""John"", ""lastname"": ""Doe"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-05T17:16:51.000Z"", ""creatorId"": null, ""nationalRegisterNumber"": ""93051822361"", ""userid"": 105, ""teacher"": null, ""student"": null, ""staff"": 0, ""roles"": [ ""ADMIN"" ], ""role"": ""ADMIN"" }, { ""id"": 108, ""email"": ""staff@test.test"", ""firstname"": ""Peter"", ""lastname"": ""Doe"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-06T12:12:24.000Z"", ""creatorId"": 105, ""nationalRegisterNumber"": ""23051822367"", ""userid"": 108, ""teacher"": 0, ""student"": 0, ""admin"": 0, ""roles"": [ ""STAFF"" ], ""role"": ""STAFF"" }, { ""id"": 188, ""email"": ""testgebruiker@hotmail.com"", ""firstname"": ""Perso"", ""lastname"": ""Neel"", ""gender"": ""F"", ""status"": ""DISABLED"", ""creation"": ""2018-12-06T08:32:47.000Z"", ""creatorId"": 187, ""nationalRegisterNumber"": ""43813813893"", ""userid"": 188, ""teacher"": null, ""student"": null, ""admin"": null, ""roles"": [ ""STAFF"" ], ""role"": ""STAFF"" } ] } ### Voeg een nieuwe gebruiker toe [POST] + Request (application/json) { ""firstname"": ""Fred"", ""lastname"": ""Billiet"", ""email"": ""testemailFred@gmail.com"", ""gender"": ""F"", ""roles"": [""ADMIN""], ""nationalRegisterNumber"": ""13751828367"" } + Response 200 ## Huidige Gebruiker [/users/current] ### Vraag de huidige gebruiker op [GET] + Response 200 (application/json) { ""id"": 105, ""email"": ""admin@test.test"", ""firstname"": ""John"", ""lastname"": ""Doe"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-05T17:16:51.000Z"", ""creatorId"": null, ""nationalRegisterNumber"": ""93051822361"", ""userid"": 105, ""teacher"": null, ""student"": null, ""staff"": 0, ""roles"": [ ""ADMIN"" ], ""role"": ""ADMIN"" } ## Gebruiker [/users/{id}] + Parameters + id (number) - ID van de gebruiker ### Vraag een gebruiker op [GET] + Response 200 (application/json) { ""id"": 105, ""email"": ""admin@test.test"", ""firstname"": ""John"", ""lastname"": ""Doe"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-05T17:16:51.000Z"", ""creatorId"": null, ""nationalRegisterNumber"": ""93051822361"", ""userid"": 105, ""teacher"": null, ""student"": null, ""staff"": 0, ""roles"": [ ""ADMIN"" ], ""role"": ""ADMIN"" } ### Pas een gebruiker aan [PUT] + Request (application/json) { ""firstname"": ""Fred"", ""lastname"": ""Debakker"", ""email"": ""testemailfred@gmail.com"", ""gender"": ""F"", ""roles"": [""ADMIN""], ""nationalRegisterNumber"": ""13051828367"" } + Response 200 ## Studenten CSV [/users/csv] ### Importeren [POST] + Request (multipart/form-data; boundary=---BOUNDARY) -----BOUNDARY Content-Disposition: form-data; filename=""leerlingen.csv"" Content-Type: text/csv -----BOUNDARY + Response 200 ## Authenticatie login [/auth/login] ### Gebruiker aanmelden [POST] + Request (application/json) { ""email"": ""admin@test.test"", ""password"": ""test"" } + Response 200 (application/json) + Body { ""id"": 105, ""email"": ""admin@test.test"", ""firstname"": ""John"", ""lastname"": ""Doe"", ""gender"": ""M"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-05T17:16:51.000Z"", ""creatorId"": null, ""nationalRegisterNumber"": ""93051822361"", ""userid"": 105, ""teacher"": null, ""student"": null, ""staff"": 0, ""roles"": [ ""ADMIN"" ], ""role"": ""ADMIN"" } ## Authenticatie logout [/auth/logout] ### Gebruiker afmelden [POST] + Response 200 ## Authenticatie vergeten [/auth/forgot] ### Gebruiker passwoord terugkrijgen [POST] + Request (application/json) { ""email"": ""teacher@test.test"" } + Response 200 ## Token [/auth/token/{token}] ### Token opvragen [GET] + Response 200 (application/json) { ""userid"": 105, ""tokenTimestamp"": ""2018-12-13T12:00:53.000Z"", ""token"": ""00174be80dc622bc6cdd084f5c35a186ad15a6806dfaca04beda695f07fcf8eb"", ""user"": { ""id"": 105, ""email"": ""admin@test.test"", ""firstname"": ""John"", ""lastname"": ""Doe"", ""gender"": ""F"", ""status"": ""ACTIVE"", ""creation"": ""2018-11-05T17:16:51.000Z"", ""creatorId"": null, ""nationalRegisterNumber"": ""13051826567"", ""userid"": 105, ""teacher"": null, ""student"": null, ""staff"": 0, ""roles"": [ ""ADMIN"" ], ""role"": ""ADMIN"" }, ""type"": ""PASSWORD_RESET"" }",12182,True,2799.090344085007,median "CLASS zcl_abapgit_gui_repo_over DEFINITION PUBLIC INHERITING FROM zcl_abapgit_gui_component FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_abapgit_gui_renderable . DATA: mv_order_by TYPE string READ-ONLY. METHODS constructor RAISING zcx_abapgit_exception. METHODS set_order_by IMPORTING iv_order_by TYPE string. METHODS set_order_direction IMPORTING iv_order_descending TYPE abap_bool. METHODS set_filter IMPORTING it_postdata TYPE cnht_post_data_tab. METHODS has_favorites RETURNING VALUE(rv_has_favorites) TYPE abap_bool. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF ty_overview, favorite TYPE string, ""! True for offline, false for online repo type TYPE string, key TYPE string, name TYPE string, url TYPE string, package TYPE string, branch TYPE string, created_by TYPE string, created_at TYPE string, deserialized_by TYPE string, deserialized_at TYPE string, END OF ty_overview, tty_overview TYPE STANDARD TABLE OF ty_overview WITH NON-UNIQUE DEFAULT KEY. CONSTANTS: BEGIN OF c_action, select TYPE string VALUE 'select', apply_filter TYPE string VALUE 'apply_filter', END OF c_action . DATA: mv_order_descending TYPE abap_bool, mv_filter TYPE string, mv_time_zone TYPE timezone, mt_col_spec TYPE zif_abapgit_definitions=>tty_col_spec, mt_overview TYPE tty_overview. METHODS: render_text_input IMPORTING iv_name TYPE string iv_label TYPE string iv_value TYPE string OPTIONAL iv_max_length TYPE string OPTIONAL RETURNING VALUE(ri_html) TYPE REF TO zif_abapgit_html, apply_filter CHANGING ct_overview TYPE tty_overview, map_repo_list_to_overview IMPORTING it_repo_list TYPE zif_abapgit_persistence=>tt_repo RETURNING VALUE(rt_overview) TYPE tty_overview RAISING zcx_abapgit_exception, render_table_header IMPORTING ii_html TYPE REF TO zif_abapgit_html, render_table IMPORTING ii_html TYPE REF TO zif_abapgit_html it_overview TYPE tty_overview, render_table_body IMPORTING ii_html TYPE REF TO zif_abapgit_html it_overview TYPE tty_overview, render_header_bar IMPORTING ii_html TYPE REF TO zif_abapgit_html, apply_order_by CHANGING ct_overview TYPE tty_overview, _add_column IMPORTING iv_tech_name TYPE string OPTIONAL iv_display_name TYPE string OPTIONAL iv_css_class TYPE string OPTIONAL iv_add_tz TYPE abap_bool OPTIONAL iv_title TYPE string OPTIONAL. METHODS render_scripts RETURNING VALUE(ri_html) TYPE REF TO zif_abapgit_html RAISING zcx_abapgit_exception. ENDCLASS. CLASS ZCL_ABAPGIT_GUI_REPO_OVER IMPLEMENTATION. METHOD apply_filter. IF mv_filter IS NOT INITIAL. DELETE ct_overview WHERE key NS mv_filter AND name NS mv_filter AND url NS mv_filter AND package NS mv_filter AND branch NS mv_filter AND created_by NS mv_filter AND created_at NS mv_filter AND deserialized_by NS mv_filter AND deserialized_at NS mv_filter. ENDIF. ENDMETHOD. METHOD apply_order_by. DATA: lt_sort TYPE abap_sortorder_tab, ls_sort LIKE LINE OF lt_sort. ls_sort-name = 'FAVORITE'. ls_sort-descending = abap_true. ls_sort-astext = abap_true. INSERT ls_sort INTO TABLE lt_sort. IF mv_order_by IS NOT INITIAL. ls_sort-name = mv_order_by. ls_sort-descending = mv_order_descending. ls_sort-astext = abap_true. INSERT ls_sort INTO TABLE lt_sort. ENDIF. SORT ct_overview BY (lt_sort). ENDMETHOD. METHOD constructor. super->constructor( ). mv_order_by = |NAME|. CALL FUNCTION 'GET_SYSTEM_TIMEZONE' IMPORTING timezone = mv_time_zone EXCEPTIONS customizing_missing = 1 OTHERS = 2. ASSERT sy-subrc = 0. ENDMETHOD. METHOD has_favorites. READ TABLE mt_overview WITH KEY favorite = abap_true TRANSPORTING NO FIELDS. IF sy-subrc = 0. rv_has_favorites = abap_true. ENDIF. ENDMETHOD. METHOD map_repo_list_to_overview. DATA: ls_overview LIKE LINE OF rt_overview, lo_repo_srv TYPE REF TO zcl_abapgit_repo, lv_date TYPE d, lv_time TYPE t. FIELD-SYMBOLS: LIKE LINE OF it_repo_list. LOOP AT it_repo_list ASSIGNING . CLEAR: ls_overview. lo_repo_srv = zcl_abapgit_repo_srv=>get_instance( )->get( -key ). ls_overview-favorite = zcl_abapgit_persistence_user=>get_instance( )->is_favorite_repo( -key ). ls_overview-type = -offline. ls_overview-key = -key. ls_overview-name = lo_repo_srv->get_name( ). ls_overview-url = -url. ls_overview-package = -package. ls_overview-branch = zcl_abapgit_git_branch_list=>get_display_name( -branch_name ). ls_overview-created_by = -created_by. IF -created_at IS NOT INITIAL. CONVERT TIME STAMP -created_at TIME ZONE mv_time_zone INTO DATE lv_date TIME lv_time. ls_overview-created_at = |{ lv_date DATE = USER } { lv_time TIME = USER }|. ENDIF. ls_overview-deserialized_by = -deserialized_by. IF -deserialized_at IS NOT INITIAL. CONVERT TIME STAMP -deserialized_at TIME ZONE mv_time_zone INTO DATE lv_date TIME lv_time. ls_overview-deserialized_at = |{ lv_date DATE = USER } { lv_time TIME = USER }|. ENDIF. INSERT ls_overview INTO TABLE rt_overview. ENDLOOP. ENDMETHOD. METHOD render_header_bar. ii_html->add( |
| ). ii_html->add( |
| ). ii_html->add( render_text_input( iv_name = |filter| iv_label = |Filter: | iv_value = mv_filter ) ). ii_html->add( || ). ii_html->add( |
| ). ii_html->add( zcl_abapgit_html=>zif_abapgit_html~a( iv_txt = ' Only Favorites' iv_act = |gHelper.toggleRepoListFavorites()| iv_typ = zif_abapgit_html=>c_action_type-onclick ) ). ii_html->add( `|` ). ii_html->add( zcl_abapgit_html=>zif_abapgit_html~a( iv_txt = ' Detail' iv_act = |gHelper.toggleRepoListDetail()| iv_typ = zif_abapgit_html=>c_action_type-onclick ) ). ii_html->add( |
| ). ENDMETHOD. METHOD render_scripts. CREATE OBJECT ri_html TYPE zcl_abapgit_html. ri_html->set_title( cl_abap_typedescr=>describe_by_object_ref( me )->get_relative_name( ) ). ri_html->add( 'setInitialFocus(""filter"");' ). ri_html->add( 'var gHelper = new RepoOverViewHelper();' ). ENDMETHOD. METHOD render_table. ii_html->add( |
| ). ii_html->add( || ). render_table_header( ii_html ). render_table_body( ii_html = ii_html it_overview = it_overview ). ii_html->add( |
| ). ii_html->add( |
| ). ENDMETHOD. METHOD render_table_body. CONSTANTS: lc_separator TYPE string VALUE `|`. DATA: lv_type_icon TYPE string, lv_favorite_icon TYPE string, lv_favorite_class TYPE string, lv_package_jump_data TYPE string, lv_package_obj_name TYPE sobj_name, lv_stage_link TYPE string, lv_patch_link TYPE string, lv_check_link TYPE string, lv_settings_link TYPE string, lv_branch_html TYPE string. FIELD-SYMBOLS: LIKE LINE OF it_overview. ii_html->add( '' ). LOOP AT it_overview ASSIGNING . IF -type = abap_true. lv_type_icon = 'plug/darkgrey'. ELSE. lv_type_icon = 'cloud-upload-alt/darkgrey'. ENDIF. IF -favorite = abap_true. lv_favorite_icon = 'star/blue'. lv_favorite_class = 'favorite'. ELSE. lv_favorite_icon = 'star/grey'. lv_favorite_class = ''. ENDIF. ii_html->add( || ). ii_html->add( || ). ii_html->add_a( iv_act = |{ zif_abapgit_definitions=>c_action-repo_toggle_fav }?{ -key }| iv_txt = ii_html->icon( iv_name = lv_favorite_icon iv_class = 'pad-sides' iv_hint = 'Click to toggle favorite' ) ). ii_html->add( || ). ii_html->add( |{ ii_html->icon( lv_type_icon ) }| ). ii_html->add( |{ ii_html->a( iv_txt = -name iv_act = |{ c_action-select }?{ -key }| ) }| ). IF -type = abap_false. ii_html->add( |{ ii_html->a( iv_txt = -url iv_act = |{ zif_abapgit_definitions=>c_action-url }?| && |{ -url }| ) }| ). ELSE. ii_html->add( || ). ENDIF. lv_package_obj_name = -package. lv_package_jump_data = zcl_abapgit_html_action_utils=>jump_encode( iv_obj_type = 'DEVC' iv_obj_name = lv_package_obj_name ). ii_html->add( |{ ii_html->a( iv_txt = -package iv_act = |{ zif_abapgit_definitions=>c_action-jump }?{ lv_package_jump_data }| ) }| ). IF -branch IS INITIAL. ii_html->add( | | ). ELSE. lv_branch_html = `` && `` && -branch && ``. ii_html->add( |{ ii_html->a( iv_txt = lv_branch_html iv_act = |{ zif_abapgit_definitions=>c_action-git_branch_switch }?{ -key }| ) }| ). ENDIF. ii_html->add( |{ -deserialized_by }| ). ii_html->add( |{ -deserialized_at }| ). ii_html->add( |{ -created_by }| ). ii_html->add( |{ -created_at }| ). ii_html->add( |{ -key }| ). ii_html->add( | | ). lv_check_link = ii_html->a( iv_txt = |Check| iv_act = |{ zif_abapgit_definitions=>c_action-repo_code_inspector }?{ -key } | ). ii_html->add( lv_check_link && lc_separator ). IF -type = abap_false. "" online repo lv_stage_link = ii_html->a( iv_txt = |Stage| iv_act = |{ zif_abapgit_definitions=>c_action-go_stage }?{ -key } | ). ii_html->add( lv_stage_link && lc_separator ). lv_patch_link = ii_html->a( iv_txt = |Patch| iv_act = |{ zif_abapgit_definitions=>c_action-go_patch }?{ -key } | ). ii_html->add( lv_patch_link && lc_separator ). ENDIF. lv_settings_link = ii_html->a( iv_txt = |Settings| iv_act = |{ zif_abapgit_definitions=>c_action-repo_settings }?{ -key } | ). ii_html->add( lv_settings_link ). ii_html->add( || ). ii_html->add( |{ ii_html->a( iv_txt = `›` iv_act = |{ c_action-select }?{ -key }| ) }| ). ii_html->add( || ). ENDLOOP. ii_html->add( || ). ENDMETHOD. METHOD render_table_header. CLEAR mt_col_spec. _add_column( iv_tech_name = 'FAVORITE' iv_css_class = 'wmin' ). _add_column( iv_tech_name = 'TYPE' iv_css_class = 'wmin' ). _add_column( iv_tech_name = 'NAME' iv_display_name = 'Name' ). _add_column( iv_tech_name = 'URL' iv_display_name = 'Url' ). _add_column( iv_tech_name = 'PACKAGE' iv_display_name = 'Package' ). _add_column( iv_tech_name = 'BRANCH' iv_display_name = 'Branch' ). _add_column( iv_tech_name = 'DESERIALIZED_BY' iv_display_name = 'Deserialized by' iv_css_class = 'ro-detail' ). _add_column( iv_tech_name = 'DESERIALIZED_AT' iv_display_name = 'Deserialized at' iv_css_class = 'ro-detail' iv_add_tz = abap_true ). _add_column( iv_tech_name = 'CREATED_BY' iv_display_name = 'Created by' iv_css_class = 'ro-detail' ). _add_column( iv_tech_name = 'CREATED_TAT' iv_display_name = 'Created at' iv_css_class = 'ro-detail' iv_add_tz = abap_true ). _add_column( iv_tech_name = 'KEY' iv_display_name = 'Key' iv_css_class = 'ro-detail' ). _add_column( iv_tech_name = 'ACTION' iv_display_name = 'Action' iv_css_class = 'ro-action' ). _add_column( iv_tech_name = 'GO' iv_css_class = 'ro-go' ). ii_html->add( || ). ii_html->add( || ). ii_html->add( zcl_abapgit_gui_chunk_lib=>render_order_by_header_cells( it_col_spec = mt_col_spec iv_order_by = mv_order_by iv_order_descending = mv_order_descending ) ). ii_html->add( '' ). ii_html->add( '' ). ENDMETHOD. METHOD render_text_input. DATA lv_attrs TYPE string. CREATE OBJECT ri_html TYPE zcl_abapgit_html. IF iv_value IS NOT INITIAL. lv_attrs = | value=""{ iv_value }""|. ENDIF. IF iv_max_length IS NOT INITIAL. lv_attrs = | maxlength=""{ iv_max_length }""|. ENDIF. ri_html->add( || ). ri_html->add( || ). ENDMETHOD. METHOD set_filter. FIELD-SYMBOLS: LIKE LINE OF it_postdata. READ TABLE it_postdata ASSIGNING INDEX 1. IF sy-subrc = 0. FIND FIRST OCCURRENCE OF REGEX `filter=(.*)` IN SUBMATCHES mv_filter. ENDIF. mv_filter = condense( mv_filter ). ENDMETHOD. METHOD set_order_by. mv_order_by = iv_order_by. ENDMETHOD. METHOD set_order_direction. mv_order_descending = iv_order_descending. ENDMETHOD. METHOD zif_abapgit_gui_renderable~render. mt_overview = map_repo_list_to_overview( zcl_abapgit_persist_factory=>get_repo( )->list( ) ). apply_order_by( CHANGING ct_overview = mt_overview ). apply_filter( CHANGING ct_overview = mt_overview ). CREATE OBJECT ri_html TYPE zcl_abapgit_html. render_header_bar( ri_html ). render_table( ii_html = ri_html it_overview = mt_overview ). register_deferred_script( render_scripts( ) ). ENDMETHOD. METHOD _add_column. FIELD-SYMBOLS LIKE LINE OF mt_col_spec. APPEND INITIAL LINE TO mt_col_spec ASSIGNING . -display_name = iv_display_name. -tech_name = iv_tech_name. -title = iv_title. -css_class = iv_css_class. -add_tz = iv_add_tz. ENDMETHOD. ENDCLASS. ",4325,False,923.9435855607413,median "FORMAT: 1A # CIG-Exchange API This is a **API Blueprint** file that describes **CIG-Exchange API**. # Group Trading/Ping ## invest/api/ping [/invest/api/ping] ### Ping test [GET] Execute an api ping test. + Response 200 (application/json) + Attributes (Ping Response) # Group Trading/Contact Us ## invest/api/contact_us [/invest/api/contact_us] ### Contact Us [POST] Send contact us email message. + Request (application/json) + Attributes (ContactUs Request) + Response 204 # Group Trading/Offerings ## invest/api/offerings [/invest/api/offerings] ### Offerings [GET] Get visible offerings from verified organisations. This call doesn't require JWT. + Response 200 (application/json) + Attributes (array[Trading Offering Response]) # Group Trading/Users ## invest/api/users/activities [/invest/api/users/activities] ### Create activity [POST] Create a new UserActivity object. Api call will save request body as jsonb in 'user_activity.info' field. + Request (application/json) + Attributes (Activity Request) + Response 204 ## invest/api/users/signup [/invest/api/users/signup] ### Signup [POST] Create a new account. + Request (application/json) + Attributes (User Request) + Response 200 (application/json) + Attributes (User Signup Response) ## invest/api/users/signup/{user}/webauthn [/invest/api/users/signup/{user}/webauthn] ### Web Authn Signup [POST] This api call used in pair with 'Signup' or 'Create organisation'. Request body must contain Credential Creation Response. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + Request (application/json) + Attributes (Credential Creation Response) + Response 204 ## invest/api/users/signin [/invest/api/users/signin] ### Signin [POST] Login to existing account. Either email or mobile should be specified. + Request (application/json) + Attributes (User Signin Request) + Response 200 (application/json) + Attributes (User Response) ## invest/api/users/signin/{user}/webauthn [/invest/api/users/signin/{user}/webauthn] ### Web Authn Signin [POST] This api call used in pair with 'Verify OTP'. Request body must contain Credential Assertion Creation Response. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + Request (application/json) + Attributes (Credential Assertion Creation Response) + Response 200 (application/json) + Attributes (OTP Response) ## invest/api/users/send_otp [/invest/api/users/send_otp] ### Send OTP [POST] Send one time password. Supported types are ""email"" and ""phone"" + Request (application/json) + Attributes (OTP Send Request) + Response 204 ## invest/api/users/verify_otp [/invest/api/users/verify_otp] ### Verify OTP [POST] Verify one time password. Supported types are ""email"" and ""phone"". On success, jwt is returned. + Request (application/json) + Attributes (OTP Verify Request) + Response 200 (application/json) + Attributes (OTP Response) # Group Trading/Organisations ## invest/api/organisations/signup [/invest/api/organisations/signup] ### Create organisation [POST] Creates a new Organisation object and User object. User will be admin in created organisation. On success, user id is returned. + Request (application/json) + Attributes (Create Organisation Request) + Response 200 (application/json) + Attributes (User Signup Response) # Group P2P/Me ## p2p/api/me/info [/p2p/api/me/info] ### Get user info [GET] Returns user info. + Response 200 (application/json) + Attributes (Info Response) # Group P2P/JWT ## p2p/api/ping-jwt [/p2p/api/ping-jwt] ### Ping JWT [GET] Checks user jwt. For outdated jwt api call will return status code 401. + Response 204 # Group P2P/Users ## p2p/api/users/switch/{organisation} [/p2p/api/users/switch/{organisation}] ### Switch Organisation [POST] Changes organisation. On success, jwt is returned. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 200 (application/json) + Attributes (OTP Response) ## p2p/api/users/{user} [/p2p/api/users/{user}] ### Retrieve user [GET] Returns a specific User object. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + Response 200 (application/json) + Attributes (Update User Response) ### Update user [PATCH] Updates a specific User object. Fields that are present in json will be updated, even when they are empty. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + Request (application/json) + Attributes (Update User Request) + Response 200 (application/json) + Attributes (Update User Response) ## p2p/api/users/{user}/contacts [/p2p/api/users/{user}/contacts] ### Retrieve user contacts [GET] Returns all user contacts. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + Response 200 (application/json) + Attributes (array[User Contact Response]) ### Create user contact [POST] Creates a new secondary Contact object. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + Request (application/json) + Attributes (User Contact Request) + Response 200 (application/json) + Attributes (User Contact Response) ## p2p/api/users/{user}/contacts/{contact} [/p2p/api/users/{user}/contacts/{contact}] ### Update user contact [PATCH] Updates Contact object. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + contact: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - contact id + Request (application/json) + Attributes (User Contact Request) + Response 200 (application/json) + Attributes (User Contact Response) ### Delete user contact [DELETE] Deletes a specific Contact object. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + contact: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - contact id + Response 204 ## p2p/api/users/{user}/activities [/p2p/api/users/{user}/activities] ### Retrieve user activities [GET] Returns all UserActivities for user. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + Response 200 (application/json) + Attributes (array[Activity Response]) ### Create user activity [POST] Create a new UserActivity object. Api call will save request body as jsonb in 'user_activity.info' field. JWT will be saved as jsonb in 'user_activity.jwt' field. + Parameters + user: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - user id + Request (application/json) + Attributes (Activity Request) + Response 204 # Group P2P/Dashboard ## p2p/api/organisations/{organisation}/dashboard [/p2p/api/organisations/{organisation}/dashboard] ### Get organisation info [GET] Returns organisation main info. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 200 (application/json) + Attributes (Organisation Info Response) ## p2p/api/organisations/{organisation}/dashboard/users [/p2p/api/organisations/{organisation}/dashboard/users] ### Get organisation users info [GET] Returns organisation users info. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 200 (application/json) + Attributes (array[Organisation Users Info Response]) ## p2p/api/organisations/{organisation}/dashboard/offerings [/p2p/api/organisations/{organisation}/dashboard/offerings] ### Get organisation offerings breakdown [GET] Returns organisation offerings type breakdown. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 200 (application/json) + Attributes (array[Organisation Offerings Type Response]) ## p2p/api/organisations/{organisation}/dashboard/clicks [/p2p/api/organisations/{organisation}/dashboard/clicks] ### Get organisation offerings clicks [GET] Returns organisation offerings clicks. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 200 (application/json) + Attributes (array[Organisation Offerings Clicks Response]) # Group P2P/Offerings ## p2p/api/organisations/{organisation}/offerings [/p2p/api/organisations/{organisation}/offerings] ### Create offering [POST] Creates a new Offering object. Offering 'id' is ignored in request and will be assigned in response. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Request (application/json) + Attributes (Offering Request) + Response 200 (application/json) + Attributes (Offering Response) ### Retrieve all offerings [GET] Returns all Offerings available on the server. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 200 (application/json) + Attributes (array[Offering Response]) ## p2p/api/organisations/{organisation}/offerings/{offering} [/p2p/api/organisations/{organisation}/offerings/{offering}] ### Retrieve offering [GET] Returns a specific Offering object. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + offering: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the offering + Response 200 (application/json) + Attributes (Offering Response) ### Update offering [PATCH] Updates a specific Offering object. Fields that are present in json will be updated, even when they are empty. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + offering: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the offering + Request (application/json) + Attributes (Offering Update Request) + Response 200 (application/json) + Attributes (Offering Response) ### Delete offering [DELETE] Deletes a specific Offering object. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + offering: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the offering + Response 204 # Group P2P/Offering Media ## p2p/api/organisations/{organisation}/offerings/{offering}/media/upload [/p2p/api/organisations/{organisation}/offerings/{offering}/media/upload] ### Upload offering media [PUT] Upload a media file for a specific offering. Return media object on success. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + offering: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the offering + Request Raw media bytes + Response 200 (application/json) + Attributes (Offering Media Response) ## p2p/api/organisations/{organisation}/offerings/{offering}/media/ordering [/p2p/api/organisations/{organisation}/offerings/{offering}/media/ordering] ### Upload offering media order [POST] Update ordering for array of media. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + offering: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the offering + Request (application/json) + Attributes (array[Update Offering Media Index Request]) + Response 204 ## p2p/api/organisations/{organisation}/offerings/{offering}/media/{media} [/p2p/api/organisations/{organisation}/offerings/{offering}/media/{media}] ### Update offering media [PATCH] Update offering media meta properties. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + offering: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the offering + media: `fdb283d4-7341-1111-0000-371d22d27cfc` (string, required) - UUID of the media + Request (application/json) + Attributes (Offering Media Request) + Response 200 (application/json) + Attributes (Offering Media Response) ### Delete offering media [DELETE] Delete offering media. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + offering: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the offering + media: `fdb283d4-7341-1111-0000-371d22d27cfc` (string, required) - UUID of the media + Response 204 # Group Trading/Offering Media ## invest/api/offerings/{offering}/media [/invest/api/offerings/{offering}/media] ### Get offering media [GET] List all public media for the offering + Parameters + offering: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the offering + Response 200 (application/json) + Attributes (array[Offering Media Response]) # Group P2P/Invitations ## p2p/api/organisations/{organisation}/invitations [/p2p/api/organisations/{organisation}/invitations] ### Send invitation [POST] Creates user if not exist or invites existing user to organisation. Returns invited user id on success. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Request (application/json) + Attributes (Invitation Request) + Response 200 (application/json) + Attributes (User Response) ### Retrieve invitations [GET] Returns all Invitations for organisation. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 200 (application/json) + Attributes (array[OrganisationUser Response]) ## p2p/api/organisations/{organisation}/invitations/{user} [/p2p/api/organisations/{organisation}/invitations/{user}] ### Delete invitation [DELETE] Deletes a specific invitation. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + user: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the user to cancel invitation + Response 204 # Group Trading/Invitations ## invest/api/users/accept-invitation [/invest/api/users/accept-invitation] ### Accept invitation [POST] Accept invitation using invitation id + Request (application/json) + Attributes (Accept Invitation Request) + Response 200 (application/json) + Attributes (OTP Response) # Group P2P/OrganisationUsers ## p2p/api/organisations/{organisation}/users [/p2p/api/organisations/{organisation}/users] ### Retrieve organisation users [GET] Returns all users belonging to sepcified organisation. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 200 (application/json) + Attributes (array[OrganisationUser Response]) ## p2p/api/organisations/{organisation}/users/{user} [/p2p/api/organisations/{organisation}/users/{user}] ### Change organisation user role [PATCH] Update user role in organisation. Only organisation admin can use this api call. Organisation admin can unset himself from admin role. Last organisation admin can't be unset. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + user: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the user to delete from the organisation + Request (application/json) + Attributes (Patch Organisation User Request) + Response 204 ### Delete organisation user [DELETE] Deletes a specific organisation user. Only admin and organisation admin can use this api call. Organisation admin can't delete himself from organisation. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + user: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the user to delete from the organisation + Response 204 ### Add organisation user [POST] Only admin can directly add user to organisation. Other users must use /p2p/api/organisations/{organisation}/invitations. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + user: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - UUID of the user to add from the organisation + Response 204 # Group P2P/Organisations ## p2p/api/organisations [/p2p/api/organisations] ### Create organisation [POST] Creates a new Organisation object. Organisation 'id' is ignored in request and will be assigned in response. + Request (application/json) + Attributes (Organisation Request) + Response 200 (application/json) + Attributes (Organisation Response) ### Retrieve all organisations [GET] Returns all Organisations for user. + Response 200 (application/json) + Attributes (array[Organisation Response]) ## p2p/api/organisations/{organisation} [/p2p/api/organisations/{organisation}] ### Retrieve organisation [GET] Returns a specific Organisation object. Admin can retrieve any organisation. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 200 (application/json) + Attributes (Organisation Response) ### Update organisation [PATCH] Updates a specific Organisation object. Fields that are present in json will be updated, even when they are empty. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Request (application/json) + Attributes (Organisation Request) + Response 200 (application/json) + Attributes (Organisation Response) ### Delete organisation [DELETE] Deletes a specific Organisation object. Only admin user can delete organisation. + Parameters + organisation: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - organisation id + Response 204 ## Data Structures ### Ping Response + `message`: `Pong!` (string, required) - ping response message + `status`: `true` (boolean, required) - ping response status ### Activity Request + `type`: `type` (string, required) - activity type + `any_field`: `any_field` (string) - any addition data ### Activity Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user activity UUID + `user_id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user UUID + `type`: `type` (string, required) - activity type + `info` (object, required) - activity info + `jwt` (object, required) - activity jwt + `created_at`: `2018-12-20T12:18:32+00:00` (string, required) - user activity creation timestamp + `updated_at`: `2018-12-20T12:18:32+00:00` (string, required) - user activity updated timestamp ### ContactUs Request + `name`: `Dredd Test` (string, required) - name + `email`: `email` (string, required) - email + `message`: `This is a dredd test generated email` (string, required) - message ### Map Object + `any_field`: `any_value` (string) - map values ### Trading Offering Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - offering UUID + `title`: `title` (string, required) - offering title + `title_map` (Multilanguage String, required) - offering title map + `type`: `type1, type2` (array[string], required) - offering types array + `description`: `description` (string, required) - offering description + `description_map` (Multilanguage String, required) - offering description map + `rating`: `rating` (string) - offering rating + `slug`: `slug` (string) - offering slug + `amount`: `200.98` (number, required) - offering amount + `remaining`: `100.66` (number, required) - offering remaining + `interest`: `10.5` (number, required) - offering interest + `period`: `300` (number, required) - offering period + `origin`: `origin` (string, required) - offering origin + `map` (Map Object, required) - offering map object + `location`: `location` (string, required) - offering location + `location_map` (Multilanguage String, required) - offering location map + `tagline1`: `tagline1` (string, required) - offering tagline 1 + `tagline1_map` (Multilanguage String, required) - offering tagline1 map + `tagline2`: `tagline2` (string, required) - offering tagline 2 + `tagline2_map` (Multilanguage String, required) - offering tagline2 map + `tagline3`: `tagline3` (string, required) - offering tagline 3 + `tagline3_map` (Multilanguage String, required) - offering tagline3 map + `current_debt_level`: `current_debt_level` (string, required) - current debt level + `current_debt_level_map` (Multilanguage String, required) - current debt level map + `current_debt_end_datetime`: `2016-06-23` (string, required) - current debt end datetime + `amount_already_taken`: `300` (number, required) - amount already taken + `minimum_investment`: `10` (number, required) - offering minimum_investment + `maximum_investment`: `500` (number, required) - offering maximum_investment + `transaction_fee`: `100` (number, required) - offering transaction fee + `p2p_fee`: `20` (number, required) - offering p2p fee + `referral_reward`: `20` (number, required) - offering referral reward + `closing_date`: `2016-06-23` (string, required) - offering closing date + `is_visible`: `true` (boolean, required) - offering visibility flag + `offering_direct_url` (Offering Direct Urls, required) - offering direct url + `organisation`: `organisation` (string, required) - offering organisation name + `organisation_website`: `website` (string, required) - offering website + `organisation_id`: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - offering organisation + `media` (array[Offering Media Response]) - offering media + `created_at`: `2018-12-20T12:18:32+00:00` (string, required) - offering creation timestamp + `updated_at`: `2018-12-20T12:18:32+00:00` (string, required) - offering updated timestamp ### Offering Request + `title` (Multilanguage String, required) - offering title + `type`: `type1, type2` (array[string], required) - offering types array + `description` (Multilanguage String) - offering description + `rating` (string) - offering rating + `slug` (string) - offering slug + `amount`: `200.98` (number) - offering amount + `interest`: `10.5` (number) - offering interest + `period`: `300` (number) - offering period + `origin`: `origin` (string, required) - offering origin + `map` (Map Object) - offering map object + `location` (Multilanguage String) - offering location object + `tagline1` (Multilanguage String) - offering tagline 1 + `tagline2` (Multilanguage String) - offering tagline 2 + `tagline3` (Multilanguage String) - offering tagline 3 + `current_debt_level` (Multilanguage String) - current debt level + `current_debt_end_datetime`: `2016-06-23` (string) - current debt end datetime + `amount_already_taken`: `100` (number) - amount already taken + `minimum_investment`: `10` (number) - offering minimum_investment + `maximum_investment`: `500` (number) - offering maximum_investment + `transaction_fee`: `100` (number) - offering transaction fee + `p2p_fee`: `20` (number) - offering p2p fee + `referral_reward`: `20` (number) - offering referral reward + `closing_date`: `2016-06-23` (string) - offering closing date + `is_visible`: `true` (boolean) - offering visibility flag + `offering_direct_url` (Offering Direct Urls, required) - offering direct url + `organisation_id`: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - offering organisation ### Offering Update Request + `title` (Multilanguage String) - offering title + `type`: `type1, type2` (array[string]) - offering types array + `description` (Multilanguage String) - offering description + `rating` (string) - offering rating + `slug` (string) - offering slug + `amount`: `200.98` (number) - offering amount + `interest`: `10.5` (number) - offering interest + `period`: `300` (number) - offering period + `origin`: `origin` (string) - offering origin + `map` (Map Object) - offering map object + `location` (Multilanguage String) - offering location object + `tagline1` (Multilanguage String) - offering tagline 1 + `tagline2` (Multilanguage String) - offering tagline 2 + `tagline3` (Multilanguage String) - offering tagline 3 + `current_debt_level` (Multilanguage String) - current debt level + `current_debt_end_datetime`: `2016-06-23` (string) - current debt end datetime + `amount_already_taken`: `105` (number) - amount already taken + `minimum_investment`: `10` (number) - offering minimum_investment + `maximum_investment`: `500` (number) - offering maximum_investment + `transaction_fee`: `100` (number) - offering transaction fee + `p2p_fee`: `20` (number) - offering p2p fee + `referral_reward`: `20` (number) - offering referral reward + `closing_date`: `2016-06-23` (string) - offering closing date + `is_visible`: `true` (boolean) - offering visibility flag + `offering_direct_url` (Offering Direct Urls) - offering direct url + `organisation_id`: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string) - offering organisation ### Multilanguage String + `en`: `string` (string) - en + `fr`: `string` (string) - fr + `it`: `string` (string) - it + `de`: `string` (string) - de ### Offering Direct Urls + `en`: `url` (string, required) - offering direct url(en) + `fr`: `url` (string, required) - offering direct url(fr) + `it`: `url` (string, required) - offering direct url(it) + `de`: `url` (string, required) - offering direct url(de) ### Organisation Info Response + `total_offerings`: `5` (number, required) - total offerings + `total_users`: `3` (number, required) - total users + `total_amount`: `100000` (number, required) - total amount + `remaining_amount`: `50000` (number, required) - remaining amount ### Organisation Users Info Response + `user_id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user UUID + `name`: `First Name` (string, required) - user first name + `lastname`: `Last Name` (string, required) - user last name + `count`: `5` (number, required) - login count + `average`: 80 (number, required) - average session in seconds ### Organisation Offerings Type Response + `type`: `type` (string, required) - offering type + `count`: `5` (number, required) - type count ### Organisation Offerings Clicks Response + `offering_id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - offering UUID + `title`: `title` (string, required) - offering title + `title_map` (Multilanguage String, required) - offering title map + `count`: `5` (number, required) - type count ### Offering Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - offering UUID + `title`: `title` (string, required) - offering title + `title_map` (Multilanguage String, required) - offering title map + `type`: `type1, type2` (array[string], required) - offering types array + `description`: `description` (string, required) - offering description + `description_map` (Multilanguage String, required) - offering description map + `rating`: `rating` (string) - offering rating + `slug`: `slug` (string) - offering slug + `amount`: `200.98` (number, required) - offering amount + `remaining`: `0` (number, required) - offering remaining + `interest`: `10.5` (number, required) - offering interest + `period`: `300` (number, required) - offering period + `origin`: `origin` (string, required) - offering origin + `map` (Map Object, required) - offering map object + `location`: `location` (string, required) - offering location + `location_map` (Multilanguage String, required) - offering location map + `tagline1`: `tagline1` (string, required) - offering tagline 1 + `tagline1_map` (Multilanguage String, required) - offering tagline1 map + `tagline2`: `tagline2` (string, required) - offering tagline 2 + `tagline2_map` (Multilanguage String, required) - offering tagline2 map + `tagline3`: `tagline3` (string, required) - offering tagline 3 + `tagline3_map` (Multilanguage String, required) - offering tagline3 map + `current_debt_level`: `current_debt_level` (string, required) - current debt level + `current_debt_level_map` (Multilanguage String, required) - current debt level map + `current_debt_end_datetime`: `2016-06-23` (string, required) - current debt end datetime + `amount_already_taken`: `200.98` (number, required) - amount already taken + `minimum_investment`: `10` (number, required) - offering minimum_investment + `maximum_investment`: `500` (number, required) - offering maximum_investment + `transaction_fee`: `100` (number, required) - offering transaction fee + `p2p_fee`: `20` (number, required) - offering p2p fee + `referral_reward`: `20` (number, required) - offering referral reward + `closing_date`: `2016-06-23` (string, required) - offering closing date + `is_visible`: `true` (boolean, required) - offering visibility flag + `offering_direct_url` (Offering Direct Urls, required) - offering direct url + `organisation_id`: `38e47f7e-1ecc-11e9-ab14-d663bd873d94` (string, required) - offering organisation + `media` (Offering Media Types) - offering media + `created_at`: `2018-12-20T12:18:32+00:00` (string, required) - offering creation timestamp + `updated_at`: `2018-12-20T12:18:32+00:00` (string, required) - offering updated timestamp ### Offering Media Types + `offering-images` (array[Offering Media Response]) - offering images + `offering-documents` (array[Offering Media Response]) - offering documents ### Update User Request + `name`: `Updated First Name` (string) - user first name + `lastname`: `Updated Last Name` (string) - user last name + `title`: `Mrs` (string) - user title ### Update User Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user UUID + `name`: `Updated First Name` (string, required) - user first name + `lastname`: `Updated Last Name` (string, required) - user last name + `title`: `Mrs` (string, required) - user title ### Invitation Request + `name`: `First Name` (string, required) - user first name + `lastname`: `Last Name` (string, required) - user last name + `title`: `Mr` (string, required) - user title + `email`: `blackhole+dev+test+org@cig-exchange.ch` (string, required) - user email + `phone_country_code`: `+1` (string, required) - user mobile number code + `phone_number`: `1111111111` (string, required) - user mobile number ### Accept Invitation Request + `invitation_id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - media object uuid ### Create Organisation Request + `name`: `First Name` (string, required) - user first name + `lastname`: `Last Name` (string, required) - user last name + `title`: `Mr` (string, required) - user title + `email`: `blackhole+dev+test+org@cig-exchange.ch` (string, required) - user email + `phone_country_code`: `+1` (string, required) - user mobile number code + `phone_number`: `1111111111` (string, required) - user mobile number + `organisation_name`: `organisation_name` (string) - organisation name + `reference_key`: `reference_key` (string) - organisation reference key + `webauthn`: `false` (boolean, required) - 'true' for using web authn authorization ### Organisation Request + `type`: `type` (string) - organisation type + `name`: `name` (string) - organisation name + `website`: `website` (string) - organisation website + `reference_key`: `reference_key` (string) - organisation reference key + `offering_rating_description` (Multilanguage String) - organisation offering rating description + `status`: `unverified` (string) - organisation status ### Organisation Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - organisation UUID + `type`: `type` (string) - organisation type + `name`: `name` (string) - organisation name + `website`: `website` (string) - organisation website + `reference_key`: `reference_key` (string) - organisation reference key + `offering_rating_description`: `offering_rating_description` (string) - organisation offering rating description + `offering_rating_description_map` (Multilanguage String) - organisation offering rating description map + `status`: `unverified` (string) - organisation status + `created_at`: `2018-12-20T12:18:32+00:00` (string, required) - organisation creation timestamp + `updated_at`: `2018-12-20T12:18:32+00:00` (string, required) - organisation updated timestamp ### User Request + `name`: `First Name` (string, required) - user first name + `lastname`: `Last Name` (string, required) - user last name + `title`: `Mr` (string, required) - user title + `email`: `blackhole+dev+test@cig-exchange.ch` (string, required) - user email + `phone_country_code`: `+1` (string, required) - user mobile number code + `phone_number`: `1111111111` (string, required) - user mobile number + `reference_key`: `credit_24_gate` (string) - organisation reference key, required for 'p2p' platform + `platform`: `trading` (string, required) - platform to create account on, supported values are 'p2p' and 'trading' + `webauthn`: `false` (boolean, required) - 'true' for using web authn authorization ### User Signin Request + `email`: `blackhole+dev+test@cig-exchange.ch` (string) - user email + `phone_country_code`: `+1` (string) - user mobile number code + `phone_number`: `1111111111` (string) - user mobile number ### User Response + `uuid`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user account uuid ### User Signup Response + `uuid`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user account uuid + `publicKey` (object) - web authn Credential Creation Options for 2-factor authorization ### Credential Creation Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - Credential Creation Response id + `rawId`: `raw id` (string, required) - Credential Creation Response rawID + `type`: `type` (string, required) - Credential Creation Response type + `response` (object, required) - Credential Creation Response response ### Credential Assertion Creation Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - Credential Assertion Creation Response id + `rawId`: `raw id` (string, required) - Credential Assertion Creation Response rawID + `type`: `type` (string, required) - Credential Assertion Creation Response type + `response` (object, required) - Credential Assertion Creation Response response ### OTP Send Request + `uuid`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user account uuid + `type`: `email` (string, required) - otp type, supported values are 'email' and 'phone' ### OTP Verify Request + `uuid`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user account uuid + `type`: `email` (string, required) - otp type, supported values are 'email' and 'phone' + `code`: `123456` (string, required) - otp code ### OTP Response + `jwt`: `1234567890` (string) - jwt for futher auth + `status`: `success` (string, required) - auth status can be `success` and `web authn` + `publicKey` (object) - web authn Credential Assertion Request Options for 2-factor authorization ### Info Response + `user_id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user account uuid + `role`: `admin` (string, required) - user role + `organisation_id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - organisation uuid + `organisation_role`: `admin` (string, required) - organisation role + `email`: `blackhole+dev+test@cig-exchange.ch` (string, required) - user email ### OrganisationUser Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - user account uuid + `name`: `First Name` (string, required) - user first name + `last_name`: `Last Name` (string, required) - user last name + `title`: `Mr` (string, required) - user title + `email`: `email` (string, required) - user email + `last_login`: `2018-12-20T12:18:32+00:00` (string) - last login + `is_admin`: `false` (boolean) - user role in organisation ### Patch Organisation User Request + `is_admin`: `true` (boolean, required) - new user role in organisation ### Offering Media Request + `type`: `offering-image` (string) - media object type: offering-image, offering-document + `subtype`: `media subtype` (string) - media object subtype + `title`: `title` (string) - media object title + `mime_type`: `image/png` (string) - media mime type + `file_extension`: `png` (string) - media file extension + `description`: `description` (string) - media description + `index`: `100` (number, required) - media index ### Offering Media Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - media object uuid + `type`: `media type` (string, required) - media object type: offering-image, offering-document + `subtype`: `media subtype` (string) - media object subtype + `title`: `title` (string, required) - media object title + `url`: `relative_url` (string, required) - media relative URL + `mime_type`: `image/png` (string, required) - media mime type + `file_extension`: `png` (string, required) - media file extension + `file_size`: `100` (number, required) - media file size in bytes + `description`: `description` (string) - media description + `index`: `100` (number, required) - media index + `created_at`: `2018-12-20T12:18:32+00:00` (string, required) - media creation timestamp + `updated_at`: `2018-12-20T12:18:32+00:00` (string, required) - media updated timestamp ### Update Offering Media Index Request + `media_id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - media object uuid + `index`: `100` (number, required) - media index ### User Contact Request + `index`: `100` (number, required) - contact index + `location`: `location` (string) - contact location + `type`: `type` (string) - contact type + `subtype`: `subtype` (string) - contact subtype + `value1`: `value1` (string) - contact value1 + `value2`: `value2` (string) - contact value2 + `value3`: `value3` (string) - contact value3 + `value4`: `value4` (string) - contact value4 + `value5`: `value5` (string) - contact value5 + `value6`: `value6` (string) - contact value6 + `value5`: `value5` (string) - contact value5 ### User Contact Response + `id`: `fdb283d4-7341-4517-b501-371d22d27cfc` (string, required) - media object uuid + `index`: `100` (number, required) - contact index + `level`: `level` (string, required) - contact level + `location`: `location` (string, required) - contact location + `type`: `type` (string, required) - contact type + `subtype`: `subtype` (string, required) - contact subtype + `value1`: `value1` (string, required) - contact value1 + `value2`: `value2` (string, required) - contact value2 + `value3`: `value3` (string, required) - contact value3 + `value4`: `value4` (string, required) - contact value4 + `value5`: `value5` (string, required) - contact value5 + `value6`: `value6` (string, required) - contact value6 + `value5`: `value5` (string, required) - contact value5 + `created_at`: `2018-12-20T12:18:32+00:00` (string, required) - contact creation timestamp + `updated_at`: `2018-12-20T12:18:32+00:00` (string, required) - contact updated timestamp ",12273,True,2634.123607522792,median "//*************************************** //************Start Menu***************** //*************************************** // A(114) - Z(139) // !(140) // 0(169) - 9(178) start_menu: // zero out map MOV r15 r14 JAL r9 clear_screen MOV r14 r15 MOVI 0 r8 // zero out r8 for toggle return address LUI 63 r0 // top left most glyph address ORI 255 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 // offset rows by 4 down ADDI -22 r0 // and 22 columns MOVI 129 r1 // Store 'P' STOR r1 r0 ADDI -1 r0 MOVI 114 r1 // Store 'A' STOR r1 r0 ADDI -1 r0 MOV r0 r10 // save this location to draw closed mouth too MOVI 245 r1 // Store 'pacman0' STOR r1 r0 ADDI -1 r0 MOVI 126 r1 // Store 'M' STOR r1 r0 ADDI -1 r0 MOVI 114 r1 // Store 'A' STOR r1 r0 ADDI -1 r0 MOVI 127 r1 // Store 'N' STOR r1 r0 ADDI -1 r0 MOVI 0 r1 // Store ' ' STOR r1 r0 ADDI -1 r0 MOVI 171 r1 // Store '2' STOR r1 r0 ADDI -1 r0 LUI 1 r1 // Store 'pill' ORI 15 r1 STOR r1 r0 ADDI -1 r0 MOVI 169 r1 // Store '0' STOR r1 r0 ADDI 6 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 // offset rows by 4 down MOVI 129 r1 // Store 'P' STOR r1 r0 ADDI -1 r0 MOVI 131 r1 // Store 'R' STOR r1 r0 ADDI -1 r0 MOVI 118 r1 // Store 'E' STOR r1 r0 ADDI -1 r0 MOVI 132 r1 // Store 'S' STOR r1 r0 ADDI -1 r0 MOVI 132 r1 // Store 'S' STOR r1 r0 ADDI 6 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 MOVI 133 r1 // Store 'T' STOR r1 r0 ADDI -1 r0 MOVI 128 r1 // Store 'O' STOR r1 r0 ADDI -1 r0 MOVI 0 r1 // Store ' ' STOR r1 r0 ADDI -1 r0 MOVI 115 r1 // Store 'B' STOR r1 r0 ADDI -1 r0 MOVI 118 r1 // Store 'E' STOR r1 r0 ADDI -1 r0 MOVI 120 r1 // Store 'G' STOR r1 r0 ADDI -1 r0 MOVI 122 r1 // Store 'I' STOR r1 r0 ADDI -1 r0 MOVI 127 r1 // Store 'N' STOR r1 r0 ADDI 5 r0 ADDI 106 r0 ADDI 106 r0 LUI 255 r4 // start timer ORI 231 r4 MOVI 250 r5 // .5 seconds (500 milliseconds) ADDI 125 r5 ADDI 125 r5 STOR r5 r4 BUC flash_start dead_menu: // zero out map MOV r15 r14 JAL r9 clear_screen MOV r14 r15 MOVI 0 r8 // zero out r8 for toggle return address LUI 63 r0 // top left most glyph address ORI 255 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 // offset rows by 4 down ADDI -22 r0 // and 22 columns MOVI 120 r1 // Store 'G' STOR r1 r0 ADDI -1 r0 MOVI 114 r1 // Store 'A' STOR r1 r0 ADDI -1 r0 MOV r0 r10 // save this location to draw closed mouth too MOVI 126 r1 // Store 'M' STOR r1 r0 ADDI -1 r0 MOVI 118 r1 // Store 'E' STOR r1 r0 ADDI -1 r0 MOVI 0 r1 // Store ' ' STOR r1 r0 ADDI -1 r0 MOV r0 r10 // save this location to draw closed mouth too MOVI 245 r1 // Store 'pacman0' STOR r1 r0 ADDI -1 r0 MOVI 135 r1 // Store 'V' STOR r1 r0 ADDI -1 r0 MOVI 118 r1 // Store 'E' STOR r1 r0 ADDI -1 r0 MOVI 131 r1 // Store 'R' STOR r1 r0 ADDI -1 r0 MOVI 140 r1 // Store '!' STOR r1 r0 ADDI 6 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 // offset rows by 4 down MOVI 129 r1 // Store 'P' STOR r1 r0 ADDI -1 r0 MOVI 131 r1 // Store 'R' STOR r1 r0 ADDI -1 r0 MOVI 118 r1 // Store 'E' STOR r1 r0 ADDI -1 r0 MOVI 132 r1 // Store 'S' STOR r1 r0 ADDI -1 r0 MOVI 132 r1 // Store 'S' STOR r1 r0 ADDI 6 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 ADDI -106 r0 MOVI 133 r1 // Store 'T' STOR r1 r0 ADDI -1 r0 MOVI 128 r1 // Store 'O' STOR r1 r0 ADDI -1 r0 MOVI 0 r1 // Store ' ' STOR r1 r0 ADDI -1 r0 MOVI 115 r1 // Store 'B' STOR r1 r0 ADDI -1 r0 MOVI 118 r1 // Store 'E' STOR r1 r0 ADDI -1 r0 MOVI 120 r1 // Store 'G' STOR r1 r0 ADDI -1 r0 MOVI 122 r1 // Store 'I' STOR r1 r0 ADDI -1 r0 MOVI 127 r1 // Store 'N' STOR r1 r0 ADDI 5 r0 ADDI 106 r0 ADDI 106 r0 LUI 255 r4 // start timer ORI 231 r4 MOVI 250 r5 // .5 seconds (500 milliseconds) ADDI 125 r5 ADDI 125 r5 STOR r5 r4 BUC flash_start flash_start: MOV r0 r7 //check if start button has been pressed on NES controller MOV r15 r14 JAL r9 checkstart MOV r14 r15 LUI 255 r3 // calculate timer return value address ORI 230 r3 LOAD r3 r3 // load timer rv into r3 CMPI 1 r3 BNE choose_draw MOV r15 r14 JAL r9 toggle MOV r14 r15 choose_draw: // choose whether to draw 'start' or 'blank' CMPI 1 r8 BNE draw_blank draw_start: MOVI 205 r1 // Draw closed pacmanRIGHT0 STOR r1 r10 MOVI 132 r1 // Store 'S' STOR r1 r7 ADDI -1 r7 MOVI 133 r1 // Store 'T' STOR r1 r7 ADDI -1 r7 MOVI 114 r1 // Store 'A' STOR r1 r7 ADDI -1 r7 MOVI 131 r1 // Store 'R' STOR r1 r7 ADDI -1 r7 MOVI 133 r1 // Store 'T' STOR r1 r7 JUC r9 flash_start draw_blank: MOVI 245 r1 STOR r1 r10 MOVI 0 r1 // otherwise draw nothing STOR r1 r7 ADDI -1 r7 MOVI 0 r1 STOR r1 r7 ADDI -1 r7 MOVI 0 r1 STOR r1 r7 ADDI -1 r7 MOVI 0 r1 STOR r1 r7 ADDI -1 r7 MOVI 0 r1 STOR r1 r7 JUC r9 flash_start toggle: XORI 1 r8 // toggle rv LUI 255 r4 // reset timer ORI 231 r4 LUI 2 r5 // really close to 500, maybe 512 STOR r5 r4 RETX checkstart: MOVI 0 r2 // Check 'START' LUI 255 r2 ORI 252 r2 LOAD r2 r2 CMPI 1 r2 JEQ r9 next_screen // if start asserted, start game RETX clear_screen: MOV r2 r10 //save this register MOV r3 r11 // save this register MOVI 0 r0 // zero-out temp LUI 63 r2 // create glyph address ORI 255 r2 LUI 8 r3 // create counter constraint of 2120 (# of glyphs) ORI 72 r3 MOVI 0 r1 // glyph 0 to be drawn loop: STOR r1 r2 // draw glyph ADDI -1 r2 // decrement address pointer ADDI 1 r0 // increment counter CMP r0 r3 // check counter <= 2120 BLT loop MOV r10 r2 // else restore the reg's MOV r11 r3 RETX //*** end start menu**/// next_screen: JAL r6 initlevel LUI 255 r0 //make timer reset address ORI 243 r0 LUI 4 r1 //set 512+256 miliseconds on timer //TIMER SET STOR r1 r0 //set pacman state to right0 LUI 51 r4 ORI 145 r4 MOVI 64 r1 STOR r1 r4 //set pacman initial mouth toggle to 1 LUI 51 r4 ORI 146 r4 MOVI 1 r1 STOR r1 r4 //set pacman mouth toggle timer LUI 255 r1 ORI 231 r1 MOVI 250 r2 STOR r2 r1 //store 250 ms on timer. //TIMER SET //put pacman on initial spot in map LUI 51 r4 ORI 144 r4 //store address in r4 LUI 63 r1 # make address for top corner in frame buffer ORI 255 r1 MOVI 53 r8 MULI -28 r8 ADD r8 r1 # Offset by rows ADDI -26 r1 # Offset by columns STOR R1 r4 //Initialize pill remaining counter in gamestate by MOVIng 244 Pills left on board to addr 13301 LUI 51 r4 ORI 245 r4 MOVI 244 r0 STOR r0 r4 //initialize lives left LUI 51 r4 //lives left addr ORI 244 r4 //lives left addr MOVI 4 r0 STOR r0 r4 JAL r6 drawLivesLeft mainLoop: JAL r6 PACMAN_UPDATE_STATE JAL r6 PACMAN_DRAW_GLYPH JUC r6 mainLoop drawLivesLeft: LUI 63 r1 # make address for writting location in frame buffer ORI 255 r1 MOVI 53 r8 MULI -37 r8 ADD r8 r1 # Offset by rows ADDI -14 r1 # Offset by columns //zero out space where lives drawn MOVI 0 r0 // number of lives drawn MOVI 0 r2 // blank glyph livesClearLoop: CMPI 5 r0 BEQ endlivesClearLoop STOR r2 r1 ADDI -1 r1 ADDI 1 r0 BUC livesClearLoop endlivesClearLoop: ADDI 5 r1 //reset address LUI 51 r8 //lives left addr ORI 244 r8 //lives left addr LOAD r8 r8 MOVI 0 r0 MOVI 226 r2 //pman glyph livesLoop: CMP r0 r8 BEQ endlivesLoop STOR r2 r1 ADDI -1 r1 ADDI 1 r0 BUC livesLoop endlivesLoop: RETX //:::PACMAN STATE MACHINE::: //register usage: r14 used to save return address of this function. //registers r0, r1 destroyed as general purpose, r4 used to store state address // STATES: // For the '0' states, the state feild will evaluate to 0 if masked with 0x0F (15). // the ZERO ('0') states are where pacman is centered on a tile. // In the 0 state pacman will continue MOVIng forward unless the player inputs a direction // if pacman reaches any state0 and a ghost position is this tile, nextstate is dead1. // // 0x10: pacmanUP0 (16) --centered on tile, facing up. nextstate will be up1, unless player input // 0x20: pacmanDOWN0 (32) --centered on tile, facing down. nextstate is player input direction, else down1 // 0x30: pacmanLEFT0 (48) --centered on tile, facing left. nextstate is player input direction, else left1 // 0x40: pacmanRIGHT0 (64) --centered on tile, facing right. nextstate is player input direction, else right1 // The rest of the states are defined with the following pattern // the number in parenthesis is the decimal value. // // 0x11 pacmanUP1 (17) //nextstate up2, if player inputs down then nextstate down0 // 0x12 pacmanUP2 (18) //nextstate up3, if player pushes down then nextstate down3 // 0x13 pacmanUP3 (19) //nextstate up0, if player pushes down then nextstate down2 // // 0x21 pacmanDOWN1 (33) //nextstate down2, if player inputs up then nextstate up0 // 0x22 pacmanDOWN2 (34) //nextstate down3, if player inputs up then nextstate up3 // 0x23 pacmanDOWN3 (35) //nextstate down0, if player inputs up then nextstate up2 // // 0x31 pacmanLEFT1 (49) //nextstate left2, if player inputs right then nextstate right0 // 0x32 pacmanLEFT2 (50) //nextstate left3, if player inputs right then nextstate right3 // 0x33 pacmanLEFT3 (51) //nextstate left0, if player inputs right then nextstate right2 // // 0x41 pacmanRIGHT1 (65) //nextstate right2, if player inputs right then nextstate left0 // 0x42 pacmanRIGHT2 (66) //nextstate right3, if player inputs right then nextstate left3 // 0x43 pacmanRIGHT3 (67) //nextstate right0, if player inputs right then nextstate left2 // // 0x01 pacmanDEAD1 (1) //nextstate dead2 // 0x02 pacmanDEAD2 (2) //nextstate dead3 // 0x03 pacmanDEAD3 (3) //nextstate dead4 // 0x04 pacmanDEAD4 (4) //nextstate pacleft0, reset position, do magic to clear his board tile. /////THIS FUNCTION UPDATES PACMAN STATEMACHINE BY ONE STEP. // // The first thing it does is check the timer. If the timer is not active, it immediately leaves. // Otherwise: // check what state pacman is in // check controller input accordingly, // update state & position variables // reset timer // PACMAN_UPDATE_STATE: MOV r15 r14 //store old return adress LUI 255 r0 //check timer by making address ORI 242 r0 LOAD r0 r0 //then loading its value and cmp to 1 CMPI 1 r0 JNE r6 endPacmanStateUpdate //if timer was not active, do not update state. // //else, continue on to update pacman state: // //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::GET CURRENT STATE ADDRESS:::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //CURRENT STATE state address 13201, store address in r4 LUI 51 r4 ORI 145 r4 //store address in r4 //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::ZERO STATES:::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // // If in a ZERO state: // check if on a ghost, if so die. // otherwise, check player input in all directions and start MOVIng. // if player has made no input selections, keep going in current direction. // CHECK IF PACMAN HIT GHOST: (Any ghost position is on pacmans square) // if hit, set nextstate to dead, // jump to reset timer to progress to next state. // // if position = AnyGhostPosition // nextstate = pacmanDEAD1 // JUC endPacmanState_SetTimer //Check if in a '0' state: LOAD r1 r4 //read current state, address in r4 MOV r1 r0 //copy STATE into temp register. ANDI 15 r0 //mask it by ANDing it with 0xF (15) CMPI 0 r0 //if masked value is not zero, check if it is in another state JNE r6 UpStates //by branching to the next comparison, to check if it is an upstate //check if up/down controls are pushed: state0_updown: JAL r6 CheckUP //CheckUP is a function that checks if controller up button is pushed MOV r0 r1 //store the result of checkup in r1 JAL r6 CheckDOWN //CheckDOWN is a function that checks if controller down button is pushed CMP r0 r1 //compare the results of both checkup and checkdown, by comparing r1 and r0 BEQ state0_leftright //if controller UP/DOWN are pushed together, input could be left or right CMPI 1 r0 //Else, check if down was pushed. r0 will be 1 if down was pushed BEQ pacmanTryMoveDOWN BUC pacmanTryMoveUP //check if left/right controls are pushed: state0_leftright: JAL r6 CheckRIGHT //CheckLEFT is a function that checks if controller up button is pushed MOV r0 r1 //store the result of checkLEFT in r1 JAL r6 CheckLEFT //CheckRIGHT is a function that checks if controller right button is pushed CMP r0 r1 //compare the results of both checkup and checkdown, by comparing r1 and r0 BEQ state0_NoInput //if controller LEFT/RIGHT are pushed together and up/down was not processed exclusively, entire dpad pushed CMPI 1 r0 //Else, check if RIGHT was pushed. r0 will be 1 if right was pushed BEQ pacmanTryMoveLEFT BUC pacmanTryMoveRIGHT state0_NoInput: LOAD r1 r4 //load state CMPI 16 r1 //check if in up0 state. BEQ pacmanMoveUP //if not in up0 state, check if in down0 state CMPI 32 r1 //check if in down0 state. BEQ pacmanMoveDOWN //if not in down0 state, check if in left0 state, else: CMPI 48 r1 //check if in left0 state. BEQ pacmanMoveLEFT CMPI 64 r1 //check if in right0 state. BEQ pacmanMoveRIGHT //if not in right0 state, do not update state. JUC r6 endPacmanState_SetTimer pacmanMoveUP: JAL r6 pacman_isWallUP CMPI 1 r0 //check if wall is above JEQ r6 endPacmanState_SetTimer //if there is wall, do not update state, reset timer. else: MOV r4 r0 // move state address to r0 to prepare for setStateUP call JAL r6 setStateUP1 // set pacman state to up1 JUC r6 endPacmanState_SetTimer pacmanMoveDOWN: JAL r6 pacman_isWallDOWN CMPI 1 r0 //check if wall is below JEQ r6 endPacmanState_SetTimer //if there is wall, do not update state, reset timer. else: MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateDOWN1 // set pacman state JUC r6 endPacmanState_SetTimer pacmanMoveLEFT: JAL r6 pacman_isWallLEFT CMPI 1 r0 //check if wall is left JEQ r6 endPacmanState_SetTimer //if there is wall, do not update state, reset timer. else: MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateLEFT1 // set pacman state to left1 JUC r6 endPacmanState_SetTimer pacmanMoveRIGHT: JAL r6 pacman_isWallRIGHT CMPI 1 r0 //check if wall is right JEQ r6 endPacmanState_SetTimer //if there is wall, do not update state, reset timer. else: MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateRIGHT1 // set pacman state JUC r6 endPacmanState_SetTimer pacmanTryMoveUP: JAL r6 pacman_isWallUP CMPI 1 r0 //check if wall is above JEQ r6 state0_NoInput MOV r4 r0 // move state address to r0 to prepare for setStateUP call JAL r6 setStateUP1 // set pacman state to up1 JUC r6 endPacmanState_SetTimer pacmanTryMoveDOWN: JAL r6 pacman_isWallDOWN CMPI 1 r0 //check if wall is below JEQ r6 state0_NoInput MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateDOWN1 // set pacman state JUC r6 endPacmanState_SetTimer pacmanTryMoveLEFT: JAL r6 pacman_isWallLEFT CMPI 1 r0 //check if wall is left JEQ r6 state0_NoInput MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateLEFT1 // set pacman state to left1 JUC r6 endPacmanState_SetTimer pacmanTryMoveRIGHT: JAL r6 pacman_isWallRIGHT CMPI 1 r0 //check if wall is right JEQ r6 state0_NoInput MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateRIGHT1 // set pacman state JUC r6 endPacmanState_SetTimer ////:::::::::::::::::::::::End Zero States:::::::::::::::::::::::::: UpStates: //if we are traveling up and not centered on a tile, we will //continue to travel up, thus only the down button must be checked. //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanUP1::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanUP1: LOAD r1 r4 //read current state, address in r4 CMPI 17 r1 //if state is pacmanUP1 BNE pacmanUP2 //JAL r6 CheckDOWN //check if down control is pushed //CMPI 1 r0 //BNE UP1Cont //UP1Rev: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateDOWN0 // set pacman state //JUC r6 endPacmanState_SetTimer UP1Cont: MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateUP2 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanUP2::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanUP2: LOAD r1 r4 //read current state, address in r4 CMPI 18 r1 //if state is pacmanUP2 BNE pacmanUP3 //JAL r6 CheckDOWN //check if down control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 9 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateDOWN3 // set pacman state //JUC r6 endPacmanState_SetTimer LUI 51 r0 //update pacman position by making position address in r0 ORI 144 r0 LOAD r1 r0 //then getting it in r1 ADDI 53 r1 //adding one STOR r1 r0 //and storing back to position address in r0 MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateUP3 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanUP3::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanUP3: LOAD r1 r4 //read current state, address in r4 CMPI 19 r1 //if state is pacmanUP3 BNE pacmanDOWN1 // //JAL r6 CheckDOWN //check if down control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 4 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateDOWN2 // set pacman state //JUC r6 endPacmanState_SetTimer MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateUP0 // set pacman state JUC r6 endPacmanState_SetTimer //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: DownStates: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanDOWN1::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanDOWN1: LOAD r1 r4 //read current state, address in r4 CMPI 33 r1 //if state is pacmanDOWN1 BNE pacmanDOWN2 //JAL r6 CheckUP //check if control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 4 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateUP0 // set pacman state //JUC r6 endPacmanState_SetTimer MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateDOWN2 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanDOWN2::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanDOWN2: LOAD r1 r4 //read current state, address in r4 CMPI 34 r1 //if state is pacmanDOWN2 BNE pacmanDOWN3 //JAL r6 CheckUP //check if control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 9 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateUP3 // set pacman state //and storing back to position address in r0 //JUC r6 endPacmanState_SetTimer LUI 51 r0 //update pacman position by making position address in r0 ORI 144 r0 LOAD r1 r0 //then getting it in r1 ADDI -53 r1 //adding one STOR r1 r0 MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateDOWN3 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanDOWN3::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanDOWN3: LOAD r1 r4 //read current state, address in r4 CMPI 35 r1 //check state BNE pacmanLEFT1 // //JAL r6 CheckUP //check if down control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 4 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateUP2 // set pacman state //JUC r6 endPacmanState_SetTimer MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateDOWN0 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: LeftStates: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanLEFT1::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanLEFT1: LOAD r1 r4 //read current state, address in r4 CMPI 49 r1 //check state BNE pacmanLEFT2 //JAL r6 CheckRIGHT //check if control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 4 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateRIGHT0 // set pacman state //JUC r6 endPacmanState_SetTimer MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateLEFT2 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanLEFT2::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanLEFT2: LOAD r1 r4 //read current state, address in r4 CMPI 50 r1 //check state BNE pacmanLEFT3 //JAL r6 CheckRIGHT //check if control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 9 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateRIGHT3 // set pacman state //JUC r6 endPacmanState_SetTimer LUI 51 r0 //update pacman position by making position address in r0 ORI 144 r0 LOAD r1 r0 //then getting it in r1 ADDI 1 r1 //adding one STOR r1 r0 //and storing back to position address in r0 MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateLEFT3 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanLEFT3::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanLEFT3: LOAD r1 r4 //read current state, address in r4 CMPI 51 r1 //check state BNE pacmanRIGHT1 // //JAL r6 CheckRIGHT //check if down control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 4 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateLEFT2 // set pacman state //JUC r6 endPacmanState_SetTimer MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateLEFT0 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: RightStates: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanRIGHT1::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanRIGHT1: LOAD r1 r4 //read current state, address in r4 CMPI 65 r1 //check state BNE pacmanRIGHT2 //JAL r6 CheckLEFT //check if control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 4 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateLEFT0 // set pacman state //JUC r6 endPacmanState_SetTimer MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateRIGHT2 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanRIGHT2::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanRIGHT2: LOAD r1 r4 //read current state, address in r4 CMPI 66 r1 //check state BNE pacmanRIGHT3 //JAL r6 CheckLEFT //check if control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 9 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateLEFT3 // set pacman state //JUC r6 endPacmanState_SetTimer LUI 51 r0 //update pacman position by making position address in r0 ORI 144 r0 LOAD r1 r0 //then getting it in r1 ADDI -1 r1 //adding one STOR r1 r0 //and storing back to position address in r0 MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateRIGHT3 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::pacmanRIGHT3::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: pacmanRIGHT3: LOAD r1 r4 //read current state, address in r4 CMPI 67 r1 //check state BNE pacmanDEAD1 // //JAL r6 CheckLEFT //check if LEFT control is pushed //CMPI 1 r0 //BNE 4 //if button isnt pushed, skip down 4 lines, otherwise do the following: //MOV r4 r0 // move state address to r0 to prepare for setState call //JAL r6 setStateLEFT2 // set pacman state //JUC r6 endPacmanState_SetTimer MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateRIGHT0 // set pacman state JUC r6 endPacmanState_SetTimer //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: DeadStates: pacmanDEAD1: LOAD r1 r4 //read current state, address in r4 CMPI 1 r1 //if state is pacmanDEAD1 BNE pacmanDEAD2 // MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateDEAD2 // set pacman state JUC r6 endPacmanState_SetTimer pacmanDEAD2: LOAD r1 r4 //read current state, address in r4 CMPI 1 r1 //if state is pacmanDEAD1 BNE pacmanDEAD3 // MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateDEAD3 // set pacman state JUC r6 endPacmanState_SetTimer pacmanDEAD3: LOAD r1 r4 //read current state, address in r4 CMPI 1 r1 //if state is pacmanDEAD1 BNE pacmanDEAD4 // MOV r4 r0 // move state address to r0 to prepare for setState call JAL r6 setStateDEAD4 // set pacman state JUC r6 endPacmanState_SetTimer pacmanDEAD4: MOV r4 r0 // //default case, move state address to r0 to prepare for setState call JAL r6 setStateLEFT0 // set pacman state JUC r6 endPacmanState_SetTimer LUI 51 r0 //update pacman position by making position address in r0 ORI 144 r0 LOAD r1 r0 //then getting it in r1 ADDI 1 r1 //adding one STOR r1 r0 //and storing back to position address in r0 endPacmanState_SetTimer: LUI 255 r0 //make timer reset address ORI 243 r0 MOVI 125 r1 //set 512+256 miliseconds on timer //TIMER SET STOR r1 r0 endPacmanStateUpdate: MOV r14 r15 //restore old return adress RETX //return //CHECK_DIRECTION functions. Use only register r0 and ra for safety. This way when calling these functions, //only the r0 and ra registers must be preserved first if they are important. CheckRIGHT: LUI 255 r0 //make right address in r0 ORI 248 r0 LOAD r0 r0 //save result back into r0 RETX CheckLEFT: LUI 255 r0 //make address in r0 ORI 249 r0 LOAD r0 r0 //save result back into r0 RETX //return CheckUP: LUI 255 r0 ORI 251 r0 LOAD r0 r0 RETX CheckDOWN: LUI 255 r0 ORI 250 r0 LOAD r0 r0 RETX pacman_isWallUP: LUI 51 r0 //make address 13200 where pacman location is stored ORI 144 r0 LOAD r0 r0 //save result back into r0 ADDI 53 r0 //increment r0 to get location of square above pacman (53 adress spaces higher in memory) LOAD r0 r0 // LOAD glyph number MOVI 100 r9 MULI 8 r9 CMP r0 r9 SGE r0 // use Scond instruction to set r0 to 1 if r0 is greater or equal to 800, else 0 if not. RETX // return to calling function pacman_isWallDOWN: LUI 51 r0 //make address 13200 where pacman location is stored ORI 144 r0 LOAD r0 r0 //save result back into r0 ADDI -53 r0 //increment r0 to get location of square below pacman (53 adress spaces lower in memory) LOAD r0 r0 // LOAD glyph number MOVI 100 r9 MULI 8 r9 CMP r0 r9 SGE r0 // use Scond instruction to set r0 to 1 if r0 is greater or equal to 800, else 0 if not. RETX // return to calling function pacman_isWallLEFT: LUI 51 r0 //make address 13200 where pacman location is stored ORI 144 r0 LOAD r0 r0 //save result back into r0 ADDI 1 r0 //increment r0 to get location of square left of pacman (1 space higher in memory) LOAD r0 r0 // LOAD glyph number MOVI 100 r9 MULI 8 r9 CMP r0 r9 SGE r0 // use Scond instruction to set r0 to 1 if r0 is greater or equal to 800, else 0 if not. RETX // return to calling function pacman_isWallRIGHT: LUI 51 r0 //make address 13200 where pacman location is stored ORI 144 r0 LOAD r0 r0 //save result back into r0 ADDI -1 r0 //increment r0 to get location of square right of pacman (1 space lower in memory) LOAD r0 r0 MOVI 100 r9 MULI 8 r9 CMP r0 r9 SGE r0 // use Scond instruction to set r0 to 1 if r0 is greater or equal to 800, else 0 if not. RETX // return to calling function //:::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::SET_STATES:::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::: //::::::::::Store states to memory:::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::: // The following functions assume 'state address' has been moved to r0 //**actorUP** setStateUP0: MOVI 16 r1 STOR r1 r0 RETX setStateUP1: MOVI 17 r1 STOR r1 r0 RETX setStateUP2: MOVI 18 r1 STOR r1 r0 RETX setStateUP3: MOVI 19 r1 STOR r1 r0 RETX //**actorDOWN** setStateDOWN0: MOVI 32 r1 STOR r1 r0 RETX setStateDOWN1: MOVI 33 r1 STOR r1 r0 RETX setStateDOWN2: MOVI 34 r1 STOR r1 r0 RETX setStateDOWN3: MOVI 35 r1 STOR r1 r0 RETX //**actorLEFT** setStateLEFT0: MOVI 48 r1 STOR r1 r0 RETX setStateLEFT1: MOVI 49 r1 STOR r1 r0 RETX setStateLEFT2: MOVI 50 r1 STOR r1 r0 RETX setStateLEFT3: MOVI 51 r1 STOR r1 r0 RETX //**actorRIGHT** setStateRIGHT0: MOVI 64 r1 STOR r1 r0 RETX setStateRIGHT1: MOVI 65 r1 STOR r1 r0 RETX setStateRIGHT2: MOVI 66 r1 STOR r1 r0 RETX setStateRIGHT3: MOVI 67 r1 STOR r1 r0 RETX //**pacmanDEAD** setStateDEAD1: MOVI 1 r1 STOR r1 r0 RETX setStateDEAD2: MOVI 2 r1 STOR r1 r0 RETX setStateDEAD3: MOVI 3 r1 STOR r1 r0 RETX setStateDEAD4: MOVI 4 r1 STOR r1 r0 RETX PACMAN_DRAW_GLYPH: //pacman's draw glyph // // if opentimer == 1 // load open timer // open timer in 65510 //make of timer address in r1 LUI 255 r1 ORI 230 r1 LOAD r1 r1 //store result back in r1 //check to see if is 1 CMPI 1 r1 //check condition code BNE AFTER_MOUTH_TOGGLE //if timer is 1, invert the mouth condition //get the value of the mouth condition //r2 has the mouth condition address LUI 51 r2 ORI 146 r2 LOAD r4 r2 XORI 1 r4 //MOUTH POSITION IN r4 //store back in memory STOR r4 r2 //after toggling, reset timer to toggle again next time it activates: //added mouth toggle timer reset~! LUI 255 r1 ORI 231 r1 MOVI 125 r2 STOR r2 r1 //store 250 ms on timer. //TIMER SET AFTER_MOUTH_TOGGLE: //MOUTH POSITION IN r4 //cleaned up register usage a bit //MAKE PACMAN LOCATION ADDRESS IN r2 LUI 51 r2 ORI 144 r2 //MAKE PACMAN STATE ADDRESS IN r3 LUI 51 r3 ORI 145 r3 //load location of pacman INTO r0 LOAD r0 r2 //CHECK IF STATE UP0 drawUP0: load r5 r3 CMPI 16 r5 BNE drawUP1 //else check if in state UP1 //check the condition of the mouth //if open CMPI 1 R4 BNE CLOSED_STATE_UP0 LUI 1 r1 //load PACMAN_OPEN_UP_0 ORI 8 r1 STOR r1 r0 ADDI -53 r0 //get location below pacman MOVI 0 r1 //LOAD BLANK STOR r1 r0 RETX CLOSED_STATE_UP0: LUI 0 r1 //load PACMAN_CLOSED_UP_0 ORI 212 r1 STOR r1 r0 ADDI -53 r0 //get location below pacman MOVI 0 r1 //LOAD BLANK STOR r1 r0 RETX //CHECK IF STATE UP1 drawUP1: LOAD R5 R3 CMPI 17 r5 BNE drawUP2 //else check if in state UP2 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_UP1 //GET PACMAN_OPEN_6...GLYPH NUM 270 MOVI 255 r1 ADDI 15 R1 //R1 SHOULD BE 270 NOW STOR R1 R0 //LOAD GLYPH INTO POSITION ADDI 53 R0 // GET POSITION ABOVE PACMAN //NOW NEED TO LOAD PACMAN_OPEN_UP5 //IT IS GLPYH NUM 269 MOVI 255 R1 ADDI 14 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX CLOSED_STATE_UP1: //LOAD PACMAN_CLOSED_UP6 //IT'S GLYPH 218 MOVI 218 R1 STOR R1 R0 //LOAD INTO POSITION ADDI 53 R0 // GET POSITION ABOVE PACMAN //fixed this, was negative, needed positive //NOW NEED TO LOAD PMANCLOSED_UP_5 //IT'S GLYPH 217 MOVI 217 R1 STOR R1 R0 //LOAD INTO POSITION RETX //CHECK IF STATE UP2 drawUP2: LOAD R5 R3 CMPI 18 r5 BNE drawUP3 //else check if in state UP3 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_UP2 //GET PMANOPEN_UP_4 //THIS IS GLYPH 268 MOVI 255 r1 ADDI 13 R1 //R1 SHOULD BE 268 NOW STOR R1 R0 //LOAD INTO POSITION ADDI 53 R0 // GET POSITION ABOVE PACMAN //NOW NEED TO LOAD PMANOPEN_Up_3 //ITS IN LOCATION 267 MOVI 255 R1 ADDI 12 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX CLOSED_STATE_UP2: //LOAD PMANCLOSED_Up_4 //are these right? //IT'S GLYPH 216 MOVI 216 R1 STOR R1 R0 //LOAD INTO POSITION ADDI 53 R0 // GET POSITION ABOVE PACMAN //NOW NEED TO LOAD PMANCLOSED_Up_3 //IT'S GLYPH 215 MOVI 215 R1 ///wait what? STOR R1 R0 //LOAD INTO POSITION RETX //CHECK IF STATE UP3 drawUP3: LOAD R5 R3 CMPI 19 r5 BNE drawDOWN0 //else check if in state drawDOWN0 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_UP3 //GET PMANOPEN_Up_1 //THIS IS GLYPH 265 MOVI 255 r1 ADDI 10 R1 //R1 SHOULD BE 265 NOW STOR R1 R0 //LOAD POSITION ADDI -53 R0 // GET POSITION BELOW PACMAN //NOW NEED TO PMANOPEN_Up_2 //ITS IN LOCATION 266 MOVI 255 R1 ADDI 11 R1 //R1 SHOULD BE 266 STOR r1 r0 //STORE POSITION BELOW PACMAN RETX CLOSED_STATE_UP3: //LOAD PMANCLOSED_Up_1 //IT'S GLYPH 213 MOVI 213 R1 //wait what? STOR R1 R0 //LOAD INTO POSITION ADDI -53 R0 // GET POSITION BELOW PACMAN //NOW NEED TO LOAD PMANCLOSED_Up_2 //IT'S GLYPH 266 MOVI 255 r1 ADDI 11 r1 //R1 should be 266 STOR r1 r0 //STORE POSITION BELOW PACMAN RETX //COPY AND PASTING FROM STATE 1 //CHECK IF STATE DOWN0 drawDOWN0: LOAD R5 R3 CMPI 32 r5 BNE drawDOWN1 //else check if in state UP1 //check the condition of the mouth //if open CMPI 1 R4 BNE CLOSED_STATE_DOWN0 //load PMANOPEN_DOWN_0 //GLYPH 219 MOVI 219 R1 STOR r1 r0 ADDI 53 r0 //get location ABOVE pacman MOVI 0 r1 //LOAD BLANK STOR r1 r0 RETX CLOSED_STATE_DOWN0: LUI 0 r1 //load PMANCLOSED_DOWN_0 // GLYPH 179 MOVI 179 R1 STOR r1 r0 ADDI 53 r0 //get location ABOVE pacman MOVI 0 r1 //LOAD BLANK STOR r1 r0 RETX //CHECK IF STATE DOWN1 drawDOWN1: LOAD R5 R3 CMPI 33 r5 BNE drawDOWN2 //else check if in state DOWN2 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_DOWN1 //GET PMANOPEN_Down_1...in GLYPH 220 MOVI 220 r1 STOR R1 R0 //LOAD POSITION ADDI -53 R0 // GET POSITION BELOW PACMAN //NOW NEED TO LOAD PMANOPEN_Down_2 //ITS IN LOCATION 221 MOVI 221 R1 STOR r1 r0 //STORE POSITION BELOW PACMAN RETX CLOSED_STATE_DOWN1: //LOAD PMANCLOSED_Down_1 //IT'S GLYPH 180 MOVI 180 R1 STOR R1 R0 //LOAD INTO POSITION ADDI -53 R0 // GET POSITION BELOW PACMAN //NOW NEED TO LOAD PMANCLOSED_Down_2 //IT'S GLYPH 181 MOVI 181 R1 STOR R1 R0 //LOAD INTO POSITION RETX //CHECK IF STATE DOWN2 drawDOWN2: LOAD R5 R3 CMPI 34 r5 BNE drawDOWN3 //else check if in state DOWN2 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_DOWN2 //GET PMANOPEN_DOWN_3 //THIS IS GLYPH 222 MOVI 222 r1 STOR R1 R0 //LOAD POSITION ADDI -53 R0 // GET POSITION BELOW PACMAN //NOW NEED TO LOAD PMANOPEN_Down_4 //ITS IN LOCATION 223 MOVI 223 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX CLOSED_STATE_DOWN2: //LOAD PMANCLOSED_DOWN_3 //IT'S GLYPH 182 MOVI 182 R1 STOR R1 R0 //LOAD INTO POSITION ADDI -53 R0 // GET POSITION BELOW PACMAN //NOW NEED TO LOAD PMANCLOSE_Down_4 //IT'S GLYPH 183 MOVI 183 R1 STOR R1 R0 //LOAD INTO POSITION RETX //CHECK IF STATE DOWN3 drawDOWN3: LOAD R5 R3 CMPI 35 r5 BNE drawLEFT0 //else check if in state drawDOWN0 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_DOWN3 //GET PMANOPEN_Down_6 //THIS IS GLYPH 225 MOVI 225 r1 STOR R1 R0 //LOAD POSITION ADDI 53 R0 // GET POSITION ABOVE PACMAN //NOW NEED TO PMANOPEN_Down_5 //ITS IN LOCATION 224 MOVI 224 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX CLOSED_STATE_DOWN3: //LOAD PMANCLOSED_Down_6 //IT'S GLYPH 185 MOVI 185 R1 STOR R1 R0 //LOAD INTO POSITION ADDI 53 R0 // GET POSITION ABOVE PACMAN //NOW NEED TO LOAD PMANOPEN_Down_5 (SAME AS PMANCLOSED) //IT'S GLYPH 224 MOVI 224 R1 //is this right? i guess its same as pmanclosed? STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX // COPY AND PASTED FROM DOWN STATES //CHECK IF STATE LEFT0 drawLEFT0: LOAD R5 R3 CMPI 48 r5 BNE drawLEFT1 //else check if in state LEFT1 //check the condition of the mouth //if open CMPI 1 R4 BNE CLOSED_STATE_LEFT0 //load PMANOPEN_LEFT_0 //GLYPH 226 MOVI 226 R1 STOR r1 r0 ADDI -1 r0 //get location TO THE RIGHT MOVI 0 r1 //LOAD BLANK STOR r1 r0 RETX CLOSED_STATE_LEFT0: LUI 0 r1 //load PMANCLOSED_LEFT_0 // GLYPH 186 MOVI 186 R1 STOR r1 r0 ADDI -1 r0 //get location TO THE RIGHT MOVI 0 r1 //LOAD BLANK STOR r1 r0 RETX //CHECK IF STATE LEFT1 drawLEFT1: LOAD R5 R3 CMPI 49 r5 BNE drawLEFT2 //else check if in state LEFT2 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_LEFT1 //GET PMANOPEN_Left_6...in GLYPH 232 MOVI 232 r1 STOR R1 R0 //LOAD POSITION ADDI 1 R0 // GET POSITION TO THE LEFT OF PACMAN //NOW NEED TO PMANOPEN_Left_5 //ITS IN LOCATION 231 MOVI 231 R1 STOR r1 r0 //STORE POSITION BELOW PACMAN RETX CLOSED_STATE_LEFT1: //LOAD PMANCLOSED_Left_6 //IT'S GLYPH 192 MOVI 192 R1 STOR R1 R0 //LOAD INTO POSITION ADDI 1 R0 // GET POSITION TO THE LEFT OF PACMAN //NOW NEED TO LOAD PMANCLOSED_Left_5 //IT'S GLYPH 191 MOVI 191 R1 STOR R1 R0 //LOAD INTO POSITION RETX //CHECK IF STATE LEFT2 drawLEFT2: LOAD R5 R3 CMPI 50 r5 BNE drawLEFT3 //else check if in state LEFT2 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_LEFT2 //GET PMANOPEN_Left_4 //THIS IS GLYPH 230 MOVI 230 r1 STOR R1 R0 //LOAD POSITION ADDI 1 R0 // GET POSITION TO THE LEFT OF PACMAN //NOW NEED TO LOAD PMANOPEN_Left_3 //ITS IN LOCATION 229 MOVI 229 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX CLOSED_STATE_LEFT2: //LOAD PMANCLOSED_Left_4 //IT'S GLYPH 190 MOVI 190 R1 STOR R1 R0 //LOAD INTO POSITION ADDI 1 R0 // GET POSITION BELOW PACMAN //NOW NEED TO LOAD PMANCLOSED_Left_3 //IT'S GLYPH 189 MOVI 189 R1 STOR R1 R0 //LOAD INTO POSITION RETX //CHECK IF STATE LEFT3 drawLEFT3: LOAD R5 R3 CMPI 51 r5 BNE drawRIGHT0 //else check if in state drawRIGHT0 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_LEFT3 //GET PMANOPEN_Left_1 //THIS IS GLYPH 227 MOVI 227 r1 STOR R1 R0 //LOAD POSITION ADDI -1 R0 // GET POSITION TO THE RIGHT OF PACMAN //NOW NEED TO PMANOPEN_Left_2 //ITS IN LOCATION 228 MOVI 228 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX CLOSED_STATE_LEFT3: //LOAD PMANCLOSED_Left_1 //IT'S GLYPH 187 MOVI 187 R1 STOR R1 R0 //LOAD INTO POSITION ADDI -1 R0 // GET POSITION TO THE RIGHT PACMAN //NOW NEED TO LOAD PMANCLOSED_Left_2 (SAME AS PMANCLOSED) //IT'S GLYPH 188 MOVI 188 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX // COPY AND PASTE FROM LEFT //CHECK IF STATE RIGHT0 drawRIGHT0: LOAD R5 R3 CMPI 64 r5 BNE drawRIGHT1 //else check if in state RIGHT1 //check the condition of the mouth //if open CMPI 1 R4 BNE CLOSED_STATE_RIGHT0 //load PMANOPEN_RIGHT_0 //GLYPH 245 MOVI 245 R1 STOR r1 r0 ADDI 1 r0 //get location TO THE LEFT MOVI 0 r1 //LOAD BLANK STOR r1 r0 RETX CLOSED_STATE_RIGHT0: LUI 0 r1 //load PMANCLOSED_RIGHT_0 // GLYPH 205 MOVI 205 R1 STOR r1 r0 ADDI 1 r0 //get location TO THE LEFT MOVI 0 r1 //LOAD BLANK STOR r1 r0 RETX //CHECK IF STATE RIGHT1 drawRIGHT1: LOAD R5 R3 CMPI 65 r5 BNE drawRIGHT2 //else check if in state RIGHT2 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_RIGHT1 //GET PMANOPEN_Right_1...in GLYPH 246 MOVI 246 r1 STOR R1 R0 //LOAD POSITION ADDI -1 R0 // GET POSITION TO THE RIGHT OF PACMAN //NOW NEED TO PMANOPEN_Right_2 //ITS IN LOCATION 247 MOVI 247 R1 STOR r1 r0 //STORE POSITION BELOW PACMAN RETX CLOSED_STATE_RIGHT1: //LOAD PMANCLOSED_Right_1 //IT'S GLYPH 206 MOVI 206 R1 STOR R1 R0 //LOAD INTO POSITION ADDI -1 R0 // GET POSITION TO THE RIGHT OF PACMAN //NOW NEED TO LOAD PMANCLOSED_Right_2 //IT'S GLYPH 207 MOVI 207 R1 STOR R1 R0 //LOAD INTO POSITION RETX //CHECK IF STATE RIGHT2 drawRIGHT2: LOAD R5 R3 CMPI 66 r5 BNE drawRIGHT3 //else check if in state RIGHT2 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_RIGHT2 //GET PMANOPEN_Right_3 //THIS IS GLYPH 248 MOVI 248 r1 STOR R1 R0 //LOAD POSITION ADDI -1 R0 // GET POSITION TO THE RIGHT OF PACMAN //NOW NEED TO LOAD PMANOPEN_Right_4 //ITS IN LOCATION 249 MOVI 249 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX CLOSED_STATE_RIGHT2: //LOAD PMANCLOSED_Right_3 //IT'S GLYPH 208 MOVI 208 R1 STOR R1 R0 //LOAD INTO POSITION ADDI -1 R0 // GET POSITION TO THE RIGHT PACMAN //NOW NEED TO LOAD PMANCLOSED_Right_4 //IT'S GLYPH 209 MOVI 209 R1 STOR R1 R0 //LOAD INTO POSITION RETX //CHECK IF STATE RIGHT3 drawRIGHT3: LOAD R5 R3 CMPI 67 r5 BNE drawDEAD1 //else check if in state drawRIGHT0 //CHECK CONDITION OF MOUTH //IF OPEN CMPI 1 R4 BNE CLOSED_STATE_RIGHT3 //GET PMANOPEN_Right_6 //THIS IS GLYPH 251 MOVI 251 r1 STOR R1 R0 //LOAD POSITION ADDI 1 R0 // GET POSITION TO THE LEFT OF PACMAN //NOW NEED TO PMANOPEN_Right_5 //ITS IN LOCATION 250 MOVI 250 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX CLOSED_STATE_RIGHT3: //LOAD PMANCLOSED_Right_6 //IT'S GLYPH 211 MOVI 211 R1 STOR R1 R0 //LOAD INTO POSITION ADDI 1 R0 // GET POSITION TO THE LEFT PACMAN //NOW NEED TO LOAD PMANCLOSED_Right_5 (SAME AS PMANCLOSED) //IT'S GLYPH 210 MOVI 210 R1 STOR r1 r0 //STORE POSITION ABOVE PACMAN RETX initlevel: LUI 55 r0 // Make the address for where init function starts ORI 182 r0 // MOV r0 r3 // r3 current address of where we are reading from memory LUI 63 r1 # make address for writting location in frame buffer ORI 255 r1 MOVI 53 r8 MULI -5 r8 ADD r8 r1 # Offset by rows ADDI -13 r1 # Offset by columns MOVI 0 r6 loopi: CMPI 31 r6 BEQ endloopi #this should support labels, jump endloopi MOVI 0 r7 loopj: CMPI 28 r7 BEQ endloopj #jump to endloopj MOV r6 r4 MULI 53 r4 ADD r7 r4 MULI -1 r4 ADD r1 r4 LOAD r5 r3 STOR r5 r4 SUBI 1 r3 ADDI 1 r7 BUC loopj endloopj: ADDI 1 r6 BUC loopi endloopi: RETX drawDEAD1: ADD r0 r0",16174,True,2873.164566403577,median ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Copyright(c) 2011-2016 Intel Corporation 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 Intel Corporation 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 ; OWNER 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. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %include ""md5_mb_mgr_datastruct.asm"" %include ""reg_sizes.asm"" default rel ;; code to compute double octal MD5 using AVX512 ;; Stack must be aligned to 64 bytes before call ;; Windows clobbers: rax rbx rdx rsi rdi r8 r9 r10 r11 r12 r13 r14 r15 ;; Windows preserves: rcx rbp ;; ;; Linux clobbers: rax rbx rcx rdx rsi r8 r9 r10 r11 r12 r13 r14 r15 ;; Linux preserves: rdi rbp ;; ;; clobbers zmm0-8, 14-31 ;; clobbers all GPRs other than arg1 and rbp %ifidn __OUTPUT_FORMAT__, win64 %define arg1 rcx ; arg0 %define arg2 rdx ; arg1 %define reg3 r8 ; arg2 %define reg4 r9 ; arg3 %define var1 rdi %define var2 rsi %define local_func_decl(func_name) global func_name %else %define arg1 rdi ; arg0 %define arg2 rsi ; arg1 %define var1 rdx ; arg2 %define var2 rcx ; arg3 %define local_func_decl(func_name) global func_name:function internal %endif %define state arg1 %define num_blks arg2 %define IN (state + _data_ptr) %define DIGEST state %define SIZE num_blks ;; These are pointers to data block1 and block2 in the stack ; which will ping pong back and forth %define DPTR1 rbx %define DPTR2 var2 %define IDX var1 %define TBL rax %define inp0 r8 %define inp1 r9 %define inp2 r10 %define inp3 r11 %define inp4 r12 %define inp5 r13 %define inp6 r14 %define inp7 r15 ;; Transposed Digest Storage %define A zmm0 %define B zmm1 %define C zmm2 %define D zmm3 %define A1 zmm4 %define B1 zmm5 %define C1 zmm6 %define D1 zmm7 %define md5c zmm16 %define MASK0 zmm17 %define MASK1 zmm18 %define TMP0 zmm20 %define TMP1 zmm21 ;; Data are stored into the Wx after transposition %define W0 zmm8 %define W1 zmm9 %define W2 zmm10 %define W3 zmm11 %define W4 zmm12 %define W5 zmm13 %define W6 zmm14 %define W7 zmm15 %define W8 zmm24 %define W9 zmm25 %define W10 zmm26 %define W11 zmm27 %define W12 zmm28 %define W13 zmm29 %define W14 zmm30 %define W15 zmm31 %define MD5_DIGEST_ROW_SIZE (16*4) %define APPEND(a,b) a %+ b %define APPEND3(a,b,c) a %+ b %+ c ;; Temporary registers used during data transposition %define RESZ resb 64* ;; Assume stack aligned to 64 bytes before call ;; Therefore FRAMESIZE mod 64 must be 64-8 = 56 struc STACK _DATA: RESZ 2*2*16 ; 2 blocks * 2 sets of lanes * 16 regs _DIGEST: RESZ 8 ; stores Z_AA-Z_DD, Z_AA2-Z_DD2 _TMPDIGEST: RESZ 2 ; stores Z_AA, Z_BB temporarily _RSP_SAVE: RESQ 1 ; original RSP endstruc %define Z_AA rsp + _DIGEST + 64*0 %define Z_BB rsp + _DIGEST + 64*1 %define Z_CC rsp + _DIGEST + 64*2 %define Z_DD rsp + _DIGEST + 64*3 %define Z_AA1 rsp + _DIGEST + 64*4 %define Z_BB1 rsp + _DIGEST + 64*5 %define Z_CC1 rsp + _DIGEST + 64*6 %define Z_DD1 rsp + _DIGEST + 64*7 %define MD5_DIGEST_ROW_SIZE (32*4) ;; ;; MD5 left rotations (number of bits) ;; %define rot11 7 %define rot12 12 %define rot13 17 %define rot14 22 %define rot21 5 %define rot22 9 %define rot23 14 %define rot24 20 %define rot31 4 %define rot32 11 %define rot33 16 %define rot34 23 %define rot41 6 %define rot42 10 %define rot43 15 %define rot44 21 %macro TRANSPOSE16 18 %define %%r0 %1 %define %%r1 %2 %define %%r2 %3 %define %%r3 %4 %define %%r4 %5 %define %%r5 %6 %define %%r6 %7 %define %%r7 %8 %define %%r8 %9 %define %%r9 %10 %define %%r10 %11 %define %%r11 %12 %define %%r12 %13 %define %%r13 %14 %define %%r14 %15 %define %%r15 %16 %define %%t0 %17 %define %%t1 %18 ; r0 = {a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0} ; r1 = {b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0} ; r2 = {c15 c14 c13 c12 c11 c10 c9 c8 c7 c6 c5 c4 c3 c2 c1 c0} ; r3 = {d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0} ; r4 = {e15 e14 e13 e12 e11 e10 e9 e8 e7 e6 e5 e4 e3 e2 e1 e0} ; r5 = {f15 f14 f13 f12 f11 f10 f9 f8 f7 f6 f5 f4 f3 f2 f1 f0} ; r6 = {g15 g14 g13 g12 g11 g10 g9 g8 g7 g6 g5 g4 g3 g2 g1 g0} ; r7 = {h15 h14 h13 h12 h11 h10 h9 h8 h7 h6 h5 h4 h3 h2 h1 h0} ; r8 = {i15 i14 i13 i12 i11 i10 i9 i8 i7 i6 i5 i4 i3 i2 i1 i0} ; r9 = {j15 j14 j13 j12 j11 j10 j9 j8 j7 j6 j5 j4 j3 j2 j1 j0} ; r10 = {k15 k14 k13 k12 k11 k10 k9 k8 k7 k6 k5 k4 k3 k2 k1 k0} ; r11 = {l15 l14 l13 l12 l11 l10 l9 l8 l7 l6 l5 l4 l3 l2 l1 l0} ; r12 = {m15 m14 m13 m12 m11 m10 m9 m8 m7 m6 m5 m4 m3 m2 m1 m0} ; r13 = {n15 n14 n13 n12 n11 n10 n9 n8 n7 n6 n5 n4 n3 n2 n1 n0} ; r14 = {o15 o14 o13 o12 o11 o10 o9 o8 o7 o6 o5 o4 o3 o2 o1 o0} ; r15 = {p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0} ; r0 = {p0 o0 n0 m0 l0 k0 j0 i0 h0 g0 f0 e0 d0 c0 b0 a0} ; r1 = {p1 o1 n1 m1 l1 k1 j1 i1 h1 g1 f1 e1 d1 c1 b1 a1} ; r2 = {p2 o2 n2 m2 l2 k2 j2 i2 h2 g2 f2 e2 d2 c2 b2 a2} ; r3 = {p3 o3 n3 m3 l3 k3 j3 i3 h3 g3 f3 e3 d3 c3 b3 a3} ; r4 = {p4 o4 n4 m4 l4 k4 j4 i4 h4 g4 f4 e4 d4 c4 b4 a4} ; r5 = {p5 o5 n5 m5 l5 k5 j5 i5 h5 g5 f5 e5 d5 c5 b5 a5} ; r6 = {p6 o6 n6 m6 l6 k6 j6 i6 h6 g6 f6 e6 d6 c6 b6 a6} ; r7 = {p7 o7 n7 m7 l7 k7 j7 i7 h7 g7 f7 e7 d7 c7 b7 a7} ; r8 = {p8 o8 n8 m8 l8 k8 j8 i8 h8 g8 f8 e8 d8 c8 b8 a8} ; r9 = {p9 o9 n9 m9 l9 k9 j9 i9 h9 g9 f9 e9 d9 c9 b9 a9} ; r10 = {p10 o10 n10 m10 l10 k10 j10 i10 h10 g10 f10 e10 d10 c10 b10 a10} ; r11 = {p11 o11 n11 m11 l11 k11 j11 i11 h11 g11 f11 e11 d11 c11 b11 a11} ; r12 = {p12 o12 n12 m12 l12 k12 j12 i12 h12 g12 f12 e12 d12 c12 b12 a12} ; r13 = {p13 o13 n13 m13 l13 k13 j13 i13 h13 g13 f13 e13 d13 c13 b13 a13} ; r14 = {p14 o14 n14 m14 l14 k14 j14 i14 h14 g14 f14 e14 d14 c14 b14 a14} ; r15 = {p15 o15 n15 m15 l15 k15 j15 i15 h15 g15 f15 e15 d15 c15 b15 a15} ; process top half (r0..r3) {a...d} vshufps %%t0, %%r0, %%r1, 0x44 ; t0 = {b13 b12 a13 a12 b9 b8 a9 a8 b5 b4 a5 a4 b1 b0 a1 a0} vshufps %%r0, %%r0, %%r1, 0xEE ; r0 = {b15 b14 a15 a14 b11 b10 a11 a10 b7 b6 a7 a6 b3 b2 a3 a2} vshufps %%t1, %%r2, %%r3, 0x44 ; t1 = {d13 d12 c13 c12 d9 d8 c9 c8 d5 d4 c5 c4 d1 d0 c1 c0} vshufps %%r2, %%r2, %%r3, 0xEE ; r2 = {d15 d14 c15 c14 d11 d10 c11 c10 d7 d6 c7 c6 d3 d2 c3 c2} vshufps %%r3, %%t0, %%t1, 0xDD ; r3 = {d13 c13 b13 a13 d9 c9 b9 a9 d5 c5 b5 a5 d1 c1 b1 a1} vshufps %%r1, %%r0, %%r2, 0x88 ; r1 = {d14 c14 b14 a14 d10 c10 b10 a10 d6 c6 b6 a6 d2 c2 b2 a2} vshufps %%r0, %%r0, %%r2, 0xDD ; r0 = {d15 c15 b15 a15 d11 c11 b11 a11 d7 c7 b7 a7 d3 c3 b3 a3} vshufps %%t0, %%t0, %%t1, 0x88 ; t0 = {d12 c12 b12 a12 d8 c8 b8 a8 d4 c4 b4 a4 d0 c0 b0 a0} ; use r2 in place of t0 vshufps %%r2, %%r4, %%r5, 0x44 ; r2 = {f13 f12 e13 e12 f9 f8 e9 e8 f5 f4 e5 e4 f1 f0 e1 e0} vshufps %%r4, %%r4, %%r5, 0xEE ; r4 = {f15 f14 e15 e14 f11 f10 e11 e10 f7 f6 e7 e6 f3 f2 e3 e2} vshufps %%t1, %%r6, %%r7, 0x44 ; t1 = {h13 h12 g13 g12 h9 h8 g9 g8 h5 h4 g5 g4 h1 h0 g1 g0} vshufps %%r6, %%r6, %%r7, 0xEE ; r6 = {h15 h14 g15 g14 h11 h10 g11 g10 h7 h6 g7 g6 h3 h2 g3 g2} vshufps %%r7, %%r2, %%t1, 0xDD ; r7 = {h13 g13 f13 e13 h9 g9 f9 e9 h5 g5 f5 e5 h1 g1 f1 e1} vshufps %%r5, %%r4, %%r6, 0x88 ; r5 = {h14 g14 f14 e14 h10 g10 f10 e10 h6 g6 f6 e6 h2 g2 f2 e2} vshufps %%r4, %%r4, %%r6, 0xDD ; r4 = {h15 g15 f15 e15 h11 g11 f11 e11 h7 g7 f7 e7 h3 g3 f3 e3} vshufps %%r2, %%r2, %%t1, 0x88 ; r2 = {h12 g12 f12 e12 h8 g8 f8 e8 h4 g4 f4 e4 h0 g0 f0 e0} ; use r6 in place of t0 vshufps %%r6, %%r8, %%r9, 0x44 ; r6 = {j13 j12 i13 i12 j9 j8 i9 i8 j5 j4 i5 i4 j1 j0 i1 i0} vshufps %%r8, %%r8, %%r9, 0xEE ; r8 = {j15 j14 i15 i14 j11 j10 i11 i10 j7 j6 i7 i6 j3 j2 i3 i2} vshufps %%t1, %%r10, %%r11, 0x44 ; t1 = {l13 l12 k13 k12 l9 l8 k9 k8 l5 l4 k5 k4 l1 l0 k1 k0} vshufps %%r10, %%r10, %%r11, 0xEE ; r10 = {l15 l14 k15 k14 l11 l10 k11 k10 l7 l6 k7 k6 l3 l2 k3 k2} vshufps %%r11, %%r6, %%t1, 0xDD ; r11 = {l13 k13 j13 113 l9 k9 j9 i9 l5 k5 j5 i5 l1 k1 j1 i1} vshufps %%r9, %%r8, %%r10, 0x88 ; r9 = {l14 k14 j14 114 l10 k10 j10 i10 l6 k6 j6 i6 l2 k2 j2 i2} vshufps %%r8, %%r8, %%r10, 0xDD ; r8 = {l15 k15 j15 115 l11 k11 j11 i11 l7 k7 j7 i7 l3 k3 j3 i3} vshufps %%r6, %%r6, %%t1, 0x88 ; r6 = {l12 k12 j12 112 l8 k8 j8 i8 l4 k4 j4 i4 l0 k0 j0 i0} ; use r10 in place of t0 vshufps %%r10, %%r12, %%r13, 0x44 ; r10 = {n13 n12 m13 m12 n9 n8 m9 m8 n5 n4 m5 m4 n1 n0 a1 m0} vshufps %%r12, %%r12, %%r13, 0xEE ; r12 = {n15 n14 m15 m14 n11 n10 m11 m10 n7 n6 m7 m6 n3 n2 a3 m2} vshufps %%t1, %%r14, %%r15, 0x44 ; t1 = {p13 p12 013 012 p9 p8 09 08 p5 p4 05 04 p1 p0 01 00} vshufps %%r14, %%r14, %%r15, 0xEE ; r14 = {p15 p14 015 014 p11 p10 011 010 p7 p6 07 06 p3 p2 03 02} vshufps %%r15, %%r10, %%t1, 0xDD ; r15 = {p13 013 n13 m13 p9 09 n9 m9 p5 05 n5 m5 p1 01 n1 m1} vshufps %%r13, %%r12, %%r14, 0x88 ; r13 = {p14 014 n14 m14 p10 010 n10 m10 p6 06 n6 m6 p2 02 n2 m2} vshufps %%r12, %%r12, %%r14, 0xDD ; r12 = {p15 015 n15 m15 p11 011 n11 m11 p7 07 n7 m7 p3 03 n3 m3} vshufps %%r10, %%r10, %%t1, 0x88 ; r10 = {p12 012 n12 m12 p8 08 n8 m8 p4 04 n4 m4 p0 00 n0 m0} ;; At this point, the registers that contain interesting data are: ;; t0, r3, r1, r0, r2, r7, r5, r4, r6, r11, r9, r8, r10, r15, r13, r12 ;; Can use t1 and r14 as scratch registers vmovdqa32 %%r14, MASK0 vpermi2q %%r14, %%t0, %%r2 ; r14 = {h8 g8 f8 e8 d8 c8 b8 a8 h0 g0 f0 e0 d0 c0 b0 a0} vmovdqa32 %%t1, MASK1 vpermi2q %%t1, %%t0, %%r2 ; t1 = {h12 g12 f12 e12 d12 c12 b12 a12 h4 g4 f4 e4 d4 c4 b4 a4} vmovdqa32 %%r2, MASK0 vpermi2q %%r2, %%r3, %%r7 ; r2 = {h9 g9 f9 e9 d9 c9 b9 a9 h1 g1 f1 e1 d1 c1 b1 a1} vmovdqa32 %%t0, MASK1 vpermi2q %%t0, %%r3, %%r7 ; t0 = {h13 g13 f13 e13 d13 c13 b13 a13 h5 g5 f5 e5 d5 c5 b5 a5} vmovdqa32 %%r3, MASK0 vpermi2q %%r3, %%r1, %%r5 ; r3 = {h10 g10 f10 e10 d10 c10 b10 a10 h2 g2 f2 e2 d2 c2 b2 a2} vmovdqa32 %%r7, MASK1 vpermi2q %%r7, %%r1, %%r5 ; r7 = {h14 g14 f14 e14 d14 c14 b14 a14 h6 g6 f6 e6 d6 c6 b6 a6} vmovdqa32 %%r1, MASK0 vpermi2q %%r1, %%r0, %%r4 ; r1 = {h11 g11 f11 e11 d11 c11 b11 a11 h3 g3 f3 e3 d3 c3 b3 a3} vmovdqa32 %%r5, MASK1 vpermi2q %%r5, %%r0, %%r4 ; r5 = {h15 g15 f15 e15 d15 c15 b15 a15 h7 g7 f7 e7 d7 c7 b7 a7} vmovdqa32 %%r0, MASK0 vpermi2q %%r0, %%r6, %%r10 ; r0 = {p8 o8 n8 m8 l8 k8 j8 i8 p0 o0 n0 m0 l0 k0 j0 i0} vmovdqa32 %%r4, MASK1 vpermi2q %%r4, %%r6, %%r10 ; r4 = {p12 o12 n12 m12 l12 k12 j12 i12 p4 o4 n4 m4 l4 k4 j4 i4} vmovdqa32 %%r6, MASK0 vpermi2q %%r6, %%r11, %%r15 ; r6 = {p9 o9 n9 m9 l9 k9 j9 i9 p1 o1 n1 m1 l1 k1 j1 i1} vmovdqa32 %%r10, MASK1 vpermi2q %%r10, %%r11, %%r15 ; r10 = {p13 o13 n13 m13 l13 k13 j13 i13 p5 o5 n5 m5 l5 k5 j5 i5} vmovdqa32 %%r11, MASK0 vpermi2q %%r11, %%r9, %%r13 ; r11 = {p10 o10 n10 m10 l10 k10 j10 i10 p2 o2 n2 m2 l2 k2 j2 i2} vmovdqa32 %%r15, MASK1 vpermi2q %%r15, %%r9, %%r13 ; r15 = {p14 o14 n14 m14 l14 k14 j14 i14 p6 o6 n6 m6 l6 k6 j6 i6} vmovdqa32 %%r9, MASK0 vpermi2q %%r9, %%r8, %%r12 ; r9 = {p11 o11 n11 m11 l11 k11 j11 i11 p3 o3 n3 m3 l3 k3 j3 i3} vmovdqa32 %%r13, MASK1 vpermi2q %%r13, %%r8, %%r12 ; r13 = {p15 o15 n15 m15 l15 k15 j15 i15 p7 o7 n7 m7 l7 k7 j7 i7} ;; At this point r8 and r12 can be used as scratch registers vshuff64x2 %%r8, %%r14, %%r0, 0xEE ; r8 = {p8 o8 n8 m8 l8 k8 j8 i8 h8 g8 f8 e8 d8 c8 b8 a8} vshuff64x2 %%r0, %%r14, %%r0, 0x44 ; r0 = {p0 o0 n0 m0 l0 k0 j0 i0 h0 g0 f0 e0 d0 c0 b0 a0} vshuff64x2 %%r12, %%t1, %%r4, 0xEE ; r12 = {p12 o12 n12 m12 l12 k12 j12 i12 h12 g12 f12 e12 d12 c12 b12 a12} vshuff64x2 %%r4, %%t1, %%r4, 0x44 ; r4 = {p4 o4 n4 m4 l4 k4 j4 i4 h4 g4 f4 e4 d4 c4 b4 a4} vshuff64x2 %%r14, %%r7, %%r15, 0xEE ; r14 = {p14 o14 n14 m14 l14 k14 j14 i14 h14 g14 f14 e14 d14 c14 b14 a14} vshuff64x2 %%t1, %%r7, %%r15, 0x44 ; t1 = {p6 o6 n6 m6 l6 k6 j6 i6 h6 g6 f6 e6 d6 c6 b6 a6} vshuff64x2 %%r15, %%r5, %%r13, 0xEE ; r15 = {p15 o15 n15 m15 l15 k15 j15 i15 h15 g15 f15 e15 d15 c15 b15 a15} vshuff64x2 %%r7, %%r5, %%r13, 0x44 ; r7 = {p7 o7 n7 m7 l7 k7 j7 i7 h7 g7 f7 e7 d7 c7 b7 a7} vshuff64x2 %%r13, %%t0, %%r10, 0xEE ; r13 = {p13 o13 n13 m13 l13 k13 j13 i13 h13 g13 f13 e13 d13 c13 b13 a13} vshuff64x2 %%r5, %%t0, %%r10, 0x44 ; r5 = {p5 o5 n5 m5 l5 k5 j5 i5 h5 g5 f5 e5 d5 c5 b5 a5} vshuff64x2 %%r10, %%r3, %%r11, 0xEE ; r10 = {p10 o10 n10 m10 l10 k10 j10 i10 h10 g10 f10 e10 d10 c10 b10 a10} vshuff64x2 %%t0, %%r3, %%r11, 0x44 ; t0 = {p2 o2 n2 m2 l2 k2 j2 i2 h2 g2 f2 e2 d2 c2 b2 a2} vshuff64x2 %%r11, %%r1, %%r9, 0xEE ; r11 = {p11 o11 n11 m11 l11 k11 j11 i11 h11 g11 f11 e11 d11 c11 b11 a11} vshuff64x2 %%r3, %%r1, %%r9, 0x44 ; r3 = {p3 o3 n3 m3 l3 k3 j3 i3 h3 g3 f3 e3 d3 c3 b3 a3} vshuff64x2 %%r9, %%r2, %%r6, 0xEE ; r9 = {p9 o9 n9 m9 l9 k9 j9 i9 h9 g9 f9 e9 d9 c9 b9 a9} vshuff64x2 %%r1, %%r2, %%r6, 0x44 ; r1 = {p1 o1 n1 m1 l1 k1 j1 i1 h1 g1 f1 e1 d1 c1 b1 a1} vmovdqa32 %%r2, %%t0 ; r2 = {p2 o2 n2 m2 l2 k2 j2 i2 h2 g2 f2 e2 d2 c2 b2 a2} vmovdqa32 %%r6, %%t1 ; r6 = {p6 o6 n6 m6 l6 k6 j6 i6 h6 g6 f6 e6 d6 c6 b6 a6} %endmacro %macro ROTATE_ARGS 0 %xdefine TMP_ D %xdefine D C %xdefine C B %xdefine B A %xdefine A TMP_ %endm %macro ROTATE_ARGS1 0 %xdefine TMP_ D1 %xdefine D1 C1 %xdefine C1 B1 %xdefine B1 A1 %xdefine A1 TMP_ %endm ;; ;; single MD5 step ;; ;; A = B +ROL32((A +Ft(B,C,D) +data +const), nrot) ;;eg: PROCESS_LOOP MD5constx, Mdatax, F_IMMEDx, NROTx %macro PROCESS_LOOP 6 %define %%MD5const %1 %define %%data %2 %define %%F_IMMED %3 %define %%NROT %4 %define %%TMP_PR0 %5 %define %%TMP_PR1 %6 ; a=b+((a+Ft(b,c,d)+Mj+ti)<=1) local_func_decl(md5_mb_x16x2_avx512) md5_mb_x16x2_avx512: mov rax, rsp sub rsp, STACK_size and rsp, -64 mov [rsp + _RSP_SAVE], rax mov DPTR1, rsp lea DPTR2, [rsp + 64*32] ;; Load MD5 constant pointer to register lea TBL, [MD5_TABLE] vmovdqa32 MASK0, [PSHUFFLE_TRANSPOSE16_MASK1] vmovdqa32 MASK1, [PSHUFFLE_TRANSPOSE16_MASK2] ;; Preload input data from 16 segments. xor IDX, IDX ;; transpose input onto stack ;; first 16 lanes read mov inp0, [IN + 0*8] mov inp1, [IN + 1*8] mov inp2, [IN + 2*8] mov inp3, [IN + 3*8] mov inp4, [IN + 4*8] mov inp5, [IN + 5*8] mov inp6, [IN + 6*8] mov inp7, [IN + 7*8] vmovdqu32 W0,[inp0+IDX] vmovdqu32 W1,[inp1+IDX] vmovdqu32 W2,[inp2+IDX] vmovdqu32 W3,[inp3+IDX] vmovdqu32 W4,[inp4+IDX] vmovdqu32 W5,[inp5+IDX] vmovdqu32 W6,[inp6+IDX] vmovdqu32 W7,[inp7+IDX] mov inp0, [IN + 8*8] mov inp1, [IN + 9*8] mov inp2, [IN +10*8] mov inp3, [IN +11*8] mov inp4, [IN +12*8] mov inp5, [IN +13*8] mov inp6, [IN +14*8] mov inp7, [IN +15*8] vmovdqu32 W8, [inp0+IDX] vmovdqu32 W9, [inp1+IDX] vmovdqu32 W10,[inp2+IDX] vmovdqu32 W11,[inp3+IDX] vmovdqu32 W12,[inp4+IDX] vmovdqu32 W13,[inp5+IDX] vmovdqu32 W14,[inp6+IDX] vmovdqu32 W15,[inp7+IDX] ;; first 16 lanes trans&write TRANSPOSE16 W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10, W11, W12, W13, W14, W15, TMP0, TMP1 vmovdqa32 [DPTR1+_DATA+(0)*64],W0 vmovdqa32 [DPTR1+_DATA+(1)*64],W1 vmovdqa32 [DPTR1+_DATA+(2)*64],W2 vmovdqa32 [DPTR1+_DATA+(3)*64],W3 vmovdqa32 [DPTR1+_DATA+(4)*64],W4 vmovdqa32 [DPTR1+_DATA+(5)*64],W5 vmovdqa32 [DPTR1+_DATA+(6)*64],W6 vmovdqa32 [DPTR1+_DATA+(7)*64],W7 vmovdqa32 [DPTR1+_DATA+(8)*64],W8 vmovdqa32 [DPTR1+_DATA+(9)*64],W9 vmovdqa32 [DPTR1+_DATA+(10)*64],W10 vmovdqa32 [DPTR1+_DATA+(11)*64],W11 vmovdqa32 [DPTR1+_DATA+(12)*64],W12 vmovdqa32 [DPTR1+_DATA+(13)*64],W13 vmovdqa32 [DPTR1+_DATA+(14)*64],W14 vmovdqa32 [DPTR1+_DATA+(15)*64],W15 ;; second 16 lanes read mov inp0, [IN + 16*8] mov inp1, [IN + 17*8] mov inp2, [IN + 18*8] mov inp3, [IN + 19*8] mov inp4, [IN + 20*8] mov inp5, [IN + 21*8] mov inp6, [IN + 22*8] mov inp7, [IN + 23*8] vmovdqu32 W0,[inp0+IDX] vmovdqu32 W1,[inp1+IDX] vmovdqu32 W2,[inp2+IDX] vmovdqu32 W3,[inp3+IDX] vmovdqu32 W4,[inp4+IDX] vmovdqu32 W5,[inp5+IDX] vmovdqu32 W6,[inp6+IDX] vmovdqu32 W7,[inp7+IDX] mov inp0, [IN + 24*8] mov inp1, [IN + 25*8] mov inp2, [IN + 26*8] mov inp3, [IN + 27*8] mov inp4, [IN + 28*8] mov inp5, [IN + 29*8] mov inp6, [IN + 30*8] mov inp7, [IN + 31*8] vmovdqu32 W8, [inp0+IDX] vmovdqu32 W9, [inp1+IDX] vmovdqu32 W10,[inp2+IDX] vmovdqu32 W11,[inp3+IDX] vmovdqu32 W12,[inp4+IDX] vmovdqu32 W13,[inp5+IDX] vmovdqu32 W14,[inp6+IDX] vmovdqu32 W15,[inp7+IDX] ;; second 16 lanes trans&write TRANSPOSE16 W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10, W11, W12, W13, W14, W15, TMP0, TMP1 vmovdqa32 [DPTR1+_DATA+(16+0)*64],W0 vmovdqa32 [DPTR1+_DATA+(16+1)*64],W1 vmovdqa32 [DPTR1+_DATA+(16+2)*64],W2 vmovdqa32 [DPTR1+_DATA+(16+3)*64],W3 vmovdqa32 [DPTR1+_DATA+(16+4)*64],W4 vmovdqa32 [DPTR1+_DATA+(16+5)*64],W5 vmovdqa32 [DPTR1+_DATA+(16+6)*64],W6 vmovdqa32 [DPTR1+_DATA+(16+7)*64],W7 vmovdqa32 [DPTR1+_DATA+(16+8)*64],W8 vmovdqa32 [DPTR1+_DATA+(16+9)*64],W9 vmovdqa32 [DPTR1+_DATA+(16+10)*64],W10 vmovdqa32 [DPTR1+_DATA+(16+11)*64],W11 vmovdqa32 [DPTR1+_DATA+(16+12)*64],W12 vmovdqa32 [DPTR1+_DATA+(16+13)*64],W13 vmovdqa32 [DPTR1+_DATA+(16+14)*64],W14 vmovdqa32 [DPTR1+_DATA+(16+15)*64],W15 ;; Initialize digests ;; vmovdqu32 replace vmovdqa32 vmovdqu32 A, [DIGEST + 0 * MD5_DIGEST_ROW_SIZE] vmovdqu32 B, [DIGEST + 1 * MD5_DIGEST_ROW_SIZE] vmovdqu32 C, [DIGEST + 2 * MD5_DIGEST_ROW_SIZE] vmovdqu32 D, [DIGEST + 3 * MD5_DIGEST_ROW_SIZE] ; Load the digest for each stream (9-16) vmovdqu32 A1,[DIGEST + 0 * MD5_DIGEST_ROW_SIZE + 64] vmovdqu32 B1,[DIGEST + 1 * MD5_DIGEST_ROW_SIZE + 64] vmovdqu32 C1,[DIGEST + 2 * MD5_DIGEST_ROW_SIZE + 64] vmovdqu32 D1,[DIGEST + 3 * MD5_DIGEST_ROW_SIZE + 64] .lloop: ;; Increment IDX to point to next data block (64 bytes per block) add IDX, 64 ; Save digests for later addition vmovdqa32 [Z_AA], A vmovdqa32 [Z_BB], B vmovdqa32 [Z_CC], C vmovdqa32 [Z_DD], D vmovdqa32 [Z_AA1], A1 vmovdqa32 [Z_BB1], B1 vmovdqa32 [Z_CC1], C1 vmovdqa32 [Z_DD1], D1 sub SIZE, 1 je .LastLoop %assign I 0 %assign I_fimm 0xCA %rep 16 ; 0<=I<=15 %assign I_rotX I/16+1 %assign I_rotY (I % 4 + 1) %assign I_data I vpbroadcastd md5c, [TBL + I * 4] PROCESS_LOOP md5c, DPTR1+ I_data*64, I_fimm, APPEND3(rot, I_rotX, I_rotY), TMP0, TMP1 %assign I (I+1) %endrep ;; first 16 lanes read mov inp0, [IN + 0*8] mov inp1, [IN + 1*8] mov inp2, [IN + 2*8] mov inp3, [IN + 3*8] mov inp4, [IN + 4*8] mov inp5, [IN + 5*8] mov inp6, [IN + 6*8] mov inp7, [IN + 7*8] vmovdqu32 W0,[inp0+IDX] vmovdqu32 W1,[inp1+IDX] vmovdqu32 W2,[inp2+IDX] vmovdqu32 W3,[inp3+IDX] vmovdqu32 W4,[inp4+IDX] vmovdqu32 W5,[inp5+IDX] vmovdqu32 W6,[inp6+IDX] vmovdqu32 W7,[inp7+IDX] mov inp0, [IN + 8*8] mov inp1, [IN + 9*8] mov inp2, [IN +10*8] mov inp3, [IN +11*8] mov inp4, [IN +12*8] mov inp5, [IN +13*8] mov inp6, [IN +14*8] mov inp7, [IN +15*8] vmovdqu32 W8, [inp0+IDX] vmovdqu32 W9, [inp1+IDX] vmovdqu32 W10,[inp2+IDX] vmovdqu32 W11,[inp3+IDX] vmovdqu32 W12,[inp4+IDX] vmovdqu32 W13,[inp5+IDX] vmovdqu32 W14,[inp6+IDX] vmovdqu32 W15,[inp7+IDX] %assign I 16 %assign I_fimm 0xE4 %rep 16 ; 16<=I<=31 %assign I_data ((5*I+1) % 16) %assign I_rotX I/16+1 %assign I_rotY (I % 4 + 1) vpbroadcastd md5c, [TBL + I * 4] PROCESS_LOOP md5c, DPTR1+ I_data*64, I_fimm, APPEND3(rot, I_rotX, I_rotY), TMP0, TMP1 %assign I (I+1) %endrep ;; first 16 lanes trans&write TRANSPOSE16 W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10, W11, W12, W13, W14, W15, TMP0, TMP1 vmovdqa32 [DPTR2+_DATA+(0)*64],W0 vmovdqa32 [DPTR2+_DATA+(1)*64],W1 vmovdqa32 [DPTR2+_DATA+(2)*64],W2 vmovdqa32 [DPTR2+_DATA+(3)*64],W3 vmovdqa32 [DPTR2+_DATA+(4)*64],W4 vmovdqa32 [DPTR2+_DATA+(5)*64],W5 vmovdqa32 [DPTR2+_DATA+(6)*64],W6 vmovdqa32 [DPTR2+_DATA+(7)*64],W7 vmovdqa32 [DPTR2+_DATA+(8)*64],W8 vmovdqa32 [DPTR2+_DATA+(9)*64],W9 vmovdqa32 [DPTR2+_DATA+(10)*64],W10 vmovdqa32 [DPTR2+_DATA+(11)*64],W11 vmovdqa32 [DPTR2+_DATA+(12)*64],W12 vmovdqa32 [DPTR2+_DATA+(13)*64],W13 vmovdqa32 [DPTR2+_DATA+(14)*64],W14 vmovdqa32 [DPTR2+_DATA+(15)*64],W15 %assign I 32 %assign I_fimm 0x96 %rep 16 ; 32<=I<=47 %assign I_data ((3*I+5) % 16) %assign I_rotX I/16+1 %assign I_rotY (I % 4 + 1) vpbroadcastd md5c, [TBL + I * 4] PROCESS_LOOP md5c, DPTR1+ I_data*64, I_fimm, APPEND3(rot, I_rotX, I_rotY), TMP0, TMP1 %assign I (I+1) %endrep ;; second 16 lanes read mov inp0, [IN + 16*8] mov inp1, [IN + 17*8] mov inp2, [IN + 18*8] mov inp3, [IN + 19*8] mov inp4, [IN + 20*8] mov inp5, [IN + 21*8] mov inp6, [IN + 22*8] mov inp7, [IN + 23*8] vmovdqu32 W0,[inp0+IDX] vmovdqu32 W1,[inp1+IDX] vmovdqu32 W2,[inp2+IDX] vmovdqu32 W3,[inp3+IDX] vmovdqu32 W4,[inp4+IDX] vmovdqu32 W5,[inp5+IDX] vmovdqu32 W6,[inp6+IDX] vmovdqu32 W7,[inp7+IDX] mov inp0, [IN + 24*8] mov inp1, [IN + 25*8] mov inp2, [IN + 26*8] mov inp3, [IN + 27*8] mov inp4, [IN + 28*8] mov inp5, [IN + 29*8] mov inp6, [IN + 30*8] mov inp7, [IN + 31*8] vmovdqu32 W8, [inp0+IDX] vmovdqu32 W9, [inp1+IDX] vmovdqu32 W10,[inp2+IDX] vmovdqu32 W11,[inp3+IDX] vmovdqu32 W12,[inp4+IDX] vmovdqu32 W13,[inp5+IDX] vmovdqu32 W14,[inp6+IDX] vmovdqu32 W15,[inp7+IDX] %assign I 48 %assign I_fimm 0x39 %rep 16 ; 48<=I<=63 %assign I_rotX (I/16+1) %assign I_rotY (I % 4 + 1) %assign I_data ((7*I) % 16) vpbroadcastd md5c, [TBL + I * 4] PROCESS_LOOP md5c, DPTR1+ I_data*64, I_fimm, APPEND3(rot, I_rotX, I_rotY), TMP0, TMP1 %assign I (I+1) %endrep ;; second 16 lanes trans&write TRANSPOSE16 W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10, W11, W12, W13, W14, W15, TMP0, TMP1 vmovdqa32 [DPTR2+_DATA+(16+0)*64],W0 vmovdqa32 [DPTR2+_DATA+(16+1)*64],W1 vmovdqa32 [DPTR2+_DATA+(16+2)*64],W2 vmovdqa32 [DPTR2+_DATA+(16+3)*64],W3 vmovdqa32 [DPTR2+_DATA+(16+4)*64],W4 vmovdqa32 [DPTR2+_DATA+(16+5)*64],W5 vmovdqa32 [DPTR2+_DATA+(16+6)*64],W6 vmovdqa32 [DPTR2+_DATA+(16+7)*64],W7 vmovdqa32 [DPTR2+_DATA+(16+8)*64],W8 vmovdqa32 [DPTR2+_DATA+(16+9)*64],W9 vmovdqa32 [DPTR2+_DATA+(16+10)*64],W10 vmovdqa32 [DPTR2+_DATA+(16+11)*64],W11 vmovdqa32 [DPTR2+_DATA+(16+12)*64],W12 vmovdqa32 [DPTR2+_DATA+(16+13)*64],W13 vmovdqa32 [DPTR2+_DATA+(16+14)*64],W14 vmovdqa32 [DPTR2+_DATA+(16+15)*64],W15 ; Add old digest vpaddd A,A,[Z_AA] vpaddd B,B,[Z_BB] vpaddd C,C,[Z_CC] vpaddd D,D,[Z_DD] vpaddd A1,A1,[Z_AA1] vpaddd B1,B1,[Z_BB1] vpaddd C1,C1,[Z_CC1] vpaddd D1,D1,[Z_DD1] ; Swap DPTR1 and DPTR2 xchg DPTR1, DPTR2 ;; Proceed to processing of next block jmp .lloop .LastLoop: %assign I 0 %assign I_fimm 0xCA %rep 16 ; 0<=I<=15 %assign I_rotX I/16+1 %assign I_rotY (I % 4 + 1) %assign I_data I vpbroadcastd md5c, [TBL + I * 4] PROCESS_LOOP md5c, DPTR1+ I_data*64, I_fimm, APPEND3(rot, I_rotX, I_rotY), TMP0, TMP1 %assign I (I+1) %endrep %assign I 16 %assign I_fimm 0xE4 %rep 16 ; 16<=I<=31 %assign I_data ((5*I+1) % 16) %assign I_rotX I/16+1 %assign I_rotY (I % 4 + 1) vpbroadcastd md5c, [TBL + I * 4] PROCESS_LOOP md5c, DPTR1+ I_data*64, I_fimm, APPEND3(rot, I_rotX, I_rotY), TMP0, TMP1 %assign I (I+1) %endrep %assign I 32 %assign I_fimm 0x96 %rep 16 ; 32<=I<=47 %assign I_data ((3*I+5) % 16) %assign I_rotX I/16+1 %assign I_rotY (I % 4 + 1) vpbroadcastd md5c, [TBL + I * 4] PROCESS_LOOP md5c, DPTR1+ I_data*64, I_fimm, APPEND3(rot, I_rotX, I_rotY), TMP0, TMP1 %assign I (I+1) %endrep %assign I 48 %assign I_fimm 0x39 %rep 16 ; 48<=I<=63 %assign I_rotX (I/16+1) %assign I_rotY (I % 4 + 1) %assign I_data ((7*I) % 16) vpbroadcastd md5c, [TBL + I * 4] PROCESS_LOOP md5c, DPTR1+ I_data*64, I_fimm, APPEND3(rot, I_rotX, I_rotY), TMP0, TMP1 %assign I (I+1) %endrep ; Add old digest vpaddd A,A,[Z_AA] vpaddd B,B,[Z_BB] vpaddd C,C,[Z_CC] vpaddd D,D,[Z_DD] vpaddd A1,A1,[Z_AA1] vpaddd B1,B1,[Z_BB1] vpaddd C1,C1,[Z_CC1] vpaddd D1,D1,[Z_DD1] ;; update into data pointers %assign I 0 %rep 16 mov inp0, [IN + (2*I)*8] mov inp1, [IN + (2*I +1)*8] add inp0, IDX add inp1, IDX mov [IN + (2*I)*8], inp0 mov [IN + (2*I+1)*8], inp1 %assign I (I+1) %endrep vmovdqu32 [DIGEST + 0*MD5_DIGEST_ROW_SIZE ], A vmovdqu32 [DIGEST + 1*MD5_DIGEST_ROW_SIZE ], B vmovdqu32 [DIGEST + 2*MD5_DIGEST_ROW_SIZE ], C vmovdqu32 [DIGEST + 3*MD5_DIGEST_ROW_SIZE ], D ; Store the digest for each stream (9-16) vmovdqu32 [DIGEST + 0 * MD5_DIGEST_ROW_SIZE + 64], A1 vmovdqu32 [DIGEST + 1 * MD5_DIGEST_ROW_SIZE + 64], B1 vmovdqu32 [DIGEST + 2 * MD5_DIGEST_ROW_SIZE + 64], C1 vmovdqu32 [DIGEST + 3 * MD5_DIGEST_ROW_SIZE + 64], D1 mov rsp, [rsp + _RSP_SAVE] ret section .data align 64 MD5_TABLE: dd 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee dd 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501 dd 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be dd 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821 dd 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa dd 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8 dd 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed dd 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a dd 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c dd 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70 dd 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05 dd 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665 dd 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039 dd 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1 dd 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1 dd 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 PSHUFFLE_TRANSPOSE16_MASK1: dq 0x0000000000000000 dq 0x0000000000000001 dq 0x0000000000000008 dq 0x0000000000000009 dq 0x0000000000000004 dq 0x0000000000000005 dq 0x000000000000000C dq 0x000000000000000D PSHUFFLE_TRANSPOSE16_MASK2: dq 0x0000000000000002 dq 0x0000000000000003 dq 0x000000000000000A dq 0x000000000000000B dq 0x0000000000000006 dq 0x0000000000000007 dq 0x000000000000000E dq 0x000000000000000F ",16331,True,5317.753360363008,median "FORMAT: 1A # THORChain API This documentation outlines the API for THORChain. NOTE: This document is a **work in progress**. # Group Health Check ## Ping [GET /thorchain/ping] + Response 200 (plain/text) + Attributes + ping: ""pong"" (string) + Body {""ping"":""pong""} # Group Pools This section documents the pools API resources. ## Pool [/thorchain/pool/{asset}] A pool contains all the information of THORChain liquidity pool + Parameters + asset: `BNB.BNB` (required, string) - The asset of the pool + Attributes + balance_rune (string) - amount of rune the pool has + balance_asset (string) - amount of asset the pool has + asset (string) - pool asset + pool_units (string) - total number of units within the pool + status (string) - status of the pool + synth_units (string) - total number of synth units within the pool + pending_inbound_rune (string) - amount of pending rune within the pool + pending_inbound_asset (string) - amount of pending asset within the pool ### Get a pool [GET] Retrieve a liquidity pool with the given asset + Response 200 (application/json) + Attributes (Pool) + Body { ""balance_rune"": ""13460619152985"", ""balance_asset"": ""3197744873"", ""asset"": ""BTC.BTC"", ""pool_units"": ""14694928607473"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""464993836"", ""pending_inbound_asset"": ""101713319"" } ### Get all the liquidity pools [GET /thorchain/pools] Retrieve all the liquidity pools from THORChain + Response 200 (application/json) + Attributes (array[Pool]) + Body [ { ""balance_rune"": ""990304018943"", ""balance_asset"": ""14902274220"", ""asset"": ""BCH.BCH"", ""pool_units"": ""944477442283"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""257058484"" }, { ""balance_rune"": ""5227668587847"", ""balance_asset"": ""117072844569"", ""asset"": ""BNB.BNB"", ""pool_units"": ""4919785756191"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""1589030575"" }, { ""balance_rune"": ""2906260051490"", ""balance_asset"": ""643467346"", ""asset"": ""BNB.BTCB-1DE"", ""pool_units"": ""2816600000000"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""230000"" }, { ""balance_rune"": ""2414614240711"", ""balance_asset"": ""26650266002988"", ""asset"": ""BNB.BUSD-BD1"", ""pool_units"": ""2348364113912"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""82718240853"" }, { ""balance_rune"": ""9019619987525"", ""balance_asset"": ""45893334588"", ""asset"": ""ETH.ETH"", ""pool_units"": ""8549256862314"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""14500000000"", ""pending_inbound_asset"": ""64193305"" }, { ""balance_rune"": ""90000000000"", ""balance_asset"": ""33000000000"", ""asset"": ""ETH.LINK-0X514910771AF9CA656AF840DFF83E8264ECF986CA"", ""pool_units"": ""101000000000"", ""status"": ""Staged"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""0"", ""pending_inbound_asset"": ""0"" }, { ""balance_rune"": ""1028041431770"", ""balance_asset"": ""52175862117"", ""asset"": ""LTC.LTC"", ""pool_units"": ""1076474234756"", ""status"": ""Available"", ""synth_units"": ""0"", ""pending_inbound_rune"": ""6313867419"", ""pending_inbound_asset"": ""3910921839"" } ] ### Get a liquidity provider of a pool [GET /thorchain/pool/{asset}/liquidity_provider/{address}] + Parameters + asset: `BNB.BNB` (required, string) - The asset of the pool + address: `thorxxxxxxxxxxxxxxxxxxxxxxx` (required, string) - The address of the liquidity provider + Response 200 (application/json) + Attributes (LiquidityProvider) + Body { ""asset"": ""BNB.BNB"", ""rune_address"": ""thor1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"", ""asset_address"": ""bnb1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"", ""last_add_height"": 82745, ""units"": ""0"", ""pending_rune"": ""0"", ""pending_asset"": ""242000000"", ""pending_tx_Id"": ""C4C876802xxxxxxxxxxBC408829878446A37011EBBA0C5CAA3DD64A548879CB228"", ""rune_deposit_value"": ""0"", ""asset_deposit_value"": ""0"" } ### Get all liquidity providers of a pool [GET /thorchain/pool/{asset}/liquidity_providers] + Parameters + asset: `BNB.BNB` (required, string) - The asset of the pool + Response 200 (application/json) + Attributes (array[LiquidityProvider]) # Group Tx This section document Tx API resource ## Tx [/thorchain/tx/{hash}] + Parameters + hash: `E17A0906E015F0C343691C18E475C8CB5F3F6C63F5BCDE0F3A341909763CC92B` (required, string) - Tx hash of an inbound transaction or outbound transaction + Attributes + tx (ObservedTx) - observed tx information + status (enum) + done + incomplete + out_hashes (array[string]) - a list of outbound hashes + block_height (string) - the block hight this tx get observed + signers (array[string]) - a list of signer address that has sign this tx off + observed_pub_key (string) - public key of the vault which observe this tx ### Get a tx with given hash [GET] Retrieve a tx with the given hash from THORChain + Response 200 (application/json) + Body { ""tx"": { ""id"": ""CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7"", ""chain"": ""BTC"", ""from_address"": ""bcrt1q0s4mg25tu6termrk8egltfyme4q7sg3h8kkydt"", ""to_address"": ""bcrt1qf3s7q037eancht7sg0aj995dht25rwrnqsf45e"", ""coins"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""150000000"" }], ""gas"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""100000"" }], ""memo"": ""ADD:BTC.BTC:tthor1zupk5lmc84r2dh738a9g3zscavannjy3nzplwt"" }, ""status"": ""incomplete"", ""out_hashes"": null, ""block_height"": ""162"", ""signers"": [ ""tthor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5"" ], ""observed_pub_key"": ""tthorpub1addwnpepq27ck6u44zl8qqdnmzjjc8rg72amrxrsp42p9vd7kt6marhy6ww76z8shwe"" } ## TxSigners [/thorchain/tx/{hash}/signers] + Parameters + hash: `E17A0906E015F0C343691C18E475C8CB5F3F6C63F5BCDE0F3A341909763CC92B` (required, string) - Tx hash of an inbound transaction or outbound transaction + Attributes + tx_id (string) - tx hash + tx (ObservedTx) - observed tx , the tx that reach 2/3 majority consensus + height (string) - block height that this tx reach super majority consensus + in_tx (array[ObservedTx]) - all observed tx + action - potential outbound tx + out_txs (array[string]) - outbound tx hashes ### Get tx signers [GET] Get tx signers that match the request hash + Response 200 (application/json) + Body { ""tx_id"": ""CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7"", ""tx"": { ""tx"": { ""id"": ""CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7"", ""chain"": ""BTC"", ""from_address"": ""bcrt1q0s4mg25tu6termrk8egltfyme4q7sg3h8kkydt"", ""to_address"": ""bcrt1qf3s7q037eancht7sg0aj995dht25rwrnqsf45e"", ""coins"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""150000000"" } ], ""gas"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""100000"" } ], ""memo"": ""ADD:BTC.BTC:tthor1zupk5lmc84r2dh738a9g3zscavannjy3nzplwt"" }, ""status"": ""incomplete"", ""out_hashes"": null, ""block_height"": ""162"", ""signers"": [ ""tthor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5"" ], ""observed_pub_key"": ""tthorpub1addwnpepq27ck6u44zl8qqdnmzjjc8rg72amrxrsp42p9vd7kt6marhy6ww76z8shwe"" }, ""height"": ""15"", ""in_tx"": [ { ""tx"": { ""id"": ""CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7"", ""chain"": ""BTC"", ""from_address"": ""bcrt1q0s4mg25tu6termrk8egltfyme4q7sg3h8kkydt"", ""to_address"": ""bcrt1qf3s7q037eancht7sg0aj995dht25rwrnqsf45e"", ""coins"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""150000000"" } ], ""gas"": [ { ""asset"": ""BTC.BTC"", ""amount"": ""100000"" } ], ""memo"": ""ADD:BTC.BTC:tthor1zupk5lmc84r2dh738a9g3zscavannjy3nzplwt"" }, ""status"": ""incomplete"", ""out_hashes"": null, ""block_height"": ""162"", ""signers"": [ ""tthor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5"" ], ""observed_pub_key"": ""tthorpub1addwnpepq27ck6u44zl8qqdnmzjjc8rg72amrxrsp42p9vd7kt6marhy6ww76z8shwe"" } ], ""actions"": null, ""out_txs"": null } # Group Nodes This section document all the API for Node resource ## Node [/thorchain/node/{node_address}] + Parameters + node_address: `thor1f3s7q037eancht7sg0aj995dht25rwrnu4ats5` (string,required) - node address + Attributes + node_address (string) - node address + status (string) - status , values can be active,disabled,standby + pub_key_set + secp256k1 (string) - secp256k1 public key + ed25519 (string) - ed25519 public key + validator_cons_pub_key (string) - the consensus pubkey used by the node + bond (string) - current bond + active_block_height (string) - block height this node become active + bond_address (string) - bond address + status_since (string) - block height this node become current status + signer_membership (array[string]) - a list of vault public key that this node is a member of + requested_to_leave (boolean) - indicate whether this node had requested to leave_height + forced_to_leave (boolean) - indicate whether this node had been forced to leave by the network or not, if this field is true , usually means this node had been banned + ip_address (string) - node ip address + version (string) - the version of thornode software this node is running + slash_points (string) - the slash points the node accumulated when they are active , slash points will be reset next time when node become active + jail + node_address (string) - node address + release_height (string) - on which block height , this node will be released from jail, if it is 0 , means the node is not in jail + reason (string) - why the node has been jailed + current_award (string) - node current award + observe_chains - chain and block heights this node is observing , this is useful to know whether a node is falling behind in regards to observing + preflight_status + status (string) - what status the node will be in next + reason (string) - why the node will be in the status above + code (string) - error code ### Get a node [GET] Retrieve the node with given node address from THORChain + Response 200 (application/json) + Attributes (Node) + Body { ""node_address"": ""tthor1257g60tcxvu4dvflpszgkwq34d5vw6pgz0wkdu"", ""status"": ""active"", ""pub_key_set"": { ""secp256k1"": ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"", ""ed25519"": ""tthorpub1zcjduepqcuwkyr4d0lfrftdla7f6nnkxuxu9p7grpfmy36jktv9wcqal5w3qgds2ch"" }, ""validator_cons_pub_key"": ""tthorcpub1zcjduepq44vy0erpdcmekppgknu2u05znl8vmqs2nl0f92ezp4uj3zn695rqqdhta0"", ""bond"": ""0"", ""active_block_height"": ""1"", ""bond_address"": ""tbnb1ftdj7ttfa4chaf6xl04elnh30shhg4qvy4mw3r"", ""status_since"": ""0"", ""signer_membership"": null, ""requested_to_leave"": false, ""forced_to_leave"": false, ""leave_height"": ""0"", ""ip_address"": ""119.18.3.176"", ""version"": ""0.17.0"", ""slash_points"": ""1"", ""jail"": { ""node_address"": ""tthor1257g60tcxvu4dvflpszgkwq34d5vw6pgz0wkdu"", ""release_height"": ""0"", ""reason"": """" }, ""current_award"": ""0"", ""observe_chains"": [ { ""chain"": ""BTC"", ""height"": ""632"" }, { ""chain"": ""ETH"", ""height"": ""6"" }, { ""chain"": ""BNB"", ""height"": ""1883"" } ], ""preflight_status"": { ""status"": ""standby"", ""reason"": ""node account does not have minimum bond requirement: 0/100000000"", ""code"": ""1"" } } ### Get all nodes [GET /thorchain/nodes] Retrieve all nodes that have bond + Response 200 (application/json) + Attributes (array[Node]) # Group Vaults ## AsgardVault [/thorchain/vaults/asgard] + Attributes + block_height (string) - block height when the vault get created + pub_key (string) - vault's public key + coins (array[Coin]) - coins in this asgard vault + type (string) - vault type , it could be asgard or yggdrasil + status (string) - status , it could be active , retiring , inactive + status_since (string) - block height this vault get to current status + membership (array[string]) - a list of node public key , represent which nodes created this vault + chains (array[string]) - a list of chains this vault support + inbound_tx_count (string) - number of inbound tx to this vault , across all chain + outbound_tx_count (string) - number of outbound tx from this vault + pending_tx_heights (array[string]) - pending txes for migration + routers (array[ChainRouter]) - chain router + addresses (array[ChainAddress]) - chain addresses ### Get Asgard vaults [GET] Retrieve all current active Asgard vaults from thorchain + Response 200 (application/json) + Attributes (array[AsgardVault]) + Body [ { ""block_height"": 30, ""pub_key"": ""tthorpub1addwnpepqfha5sms6cyxgmr9y6j3lg5pxzyc3x9g4hkanlwu2j5jgkva4ncaurn5zmd"", ""coins"": [ { ""asset"": ""BNB.RUNE-67C"", ""amount"": ""3000000000000000"" }, { ""asset"": ""BNB.BNB"", ""amount"": ""100000000000"" }, { ""asset"": ""BNB.LOK-3C0"", ""amount"": ""40000000000"" }, { ""asset"": ""BNB.BTCB-101"", ""amount"": ""40000000000"" }, { ""asset"": ""BTC.BTC"", ""amount"": ""100000000"" }, { ""asset"": ""LTC.LTC"", ""amount"": ""500000000"" }, { ""asset"": ""BCH.BCH"", ""amount"": ""500000000"" }, { ""asset"": ""ETH.TKN-0X3B7FA4DD21C6F9BA3CA375217EAD7CAB9D6BF483"", ""amount"": ""500000000"" }, { ""asset"": ""ETH.ETH"", ""amount"": ""1000000000"" } ], ""type"": ""AsgardVault"", ""status"": ""ActiveVault"", ""membership"": [ ""tthorpub1addwnpepqfha5sms6cyxgmr9y6j3lg5pxzyc3x9g4hkanlwu2j5jgkva4ncaurn5zmd"" ], ""chains"": [ ""THOR"", ""BTC"", ""LTC"", ""BCH"", ""BNB"", ""ETH"" ], ""inbound_tx_count"": 11, ""routers"": [ { ""chain"": ""ETH"", ""router"": ""0xE65e9d372F8cAcc7b6dfcd4af6507851Ed31bb44"" } ], ""addresses"": [ { ""chain"": ""THOR"", ""address"": ""tthor1syneecwgwvn6zkv47k3cq65fuzrp24yzxyk279"" }, { ""chain"": ""BTC"", ""address"": ""bcrt1qsyneecwgwvn6zkv47k3cq65fuzrp24yz6pz56g"" }, { ""chain"": ""LTC"", ""address"": ""rltc1qsyneecwgwvn6zkv47k3cq65fuzrp24yzyvcadk"" }, { ""chain"": ""BCH"", ""address"": ""qzqj088pepej0g2ejh668qr238sgv925sg4g5hp57p"" }, { ""chain"": ""BNB"", ""address"": ""tbnb1syneecwgwvn6zkv47k3cq65fuzrp24yzg9gfnq"" }, { ""chain"": ""ETH"", ""address"": ""0x61666aa597b4344f855d25b92385b5eb0c650074"" } ] } ] ## YggdrasilVault [/thorchain/vaults/yggdrasil] + Attributes + block_height (string) - block height when the vault get created + pub_key (string) - vault's public key + coins (array[Coin]) - coins in this asgard vault + type (string) - vault type, it could be asgard or yggdrasil + status_since (string) - block height this vault get to current status + membership (array[string]) - a list of node public key, represent which nodes created this vault + chains (array[string]) - a list of chains this vault support + inbound_tx_count (string) - number of inbound tx to this vault, across all chain + outbound_tx_count (string) - number of outbound tx from this vault + pending_tx_heights (array[string]) - pending txes for migration + routers (array[ChainRouter]) - chain router + status (string) - node status, it could be active, standby etc + bond (string) - bond + total_value (string) - total value in this yggdrasil vault + addresses (array[ChainAddress]) - chain addresses ### Get Yggdrasil vaults [GET /thorchain/vaults/yggdrasil] Retrieve all Yggdrasil vaults from THORChain + Response 200 (application/json) + Attributes (array[YggdrasilVault]) + Body [ { ""block_height"": ""0"", ""pub_key"": ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"", ""coins"": [ { ""asset"": ""BNB.BNB"", ""amount"": ""0"" }, { ""asset"": ""BTC.BTC"", ""amount"": ""0"" }, { ""asset"": ""ETH.ETH"", ""amount"": ""3604472318"" }, { ""asset"": ""BNB.LOK-3C0"", ""amount"": ""0"" }, { ""asset"": ""BNB.TCAN-014"", ""amount"": ""1000000"" } ], ""type"": ""yggdrasil"", ""status"": ""active"", ""status_since"": ""0"", ""membership"": [ ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"" ], ""chains"": [ ""THOR"", ""BTC"", ""BNB"", ""ETH"" ], ""inbound_tx_count"": ""21"", ""outbound_tx_count"": ""23"", ""pending_tx_heights"": null, ""routers"": [ { ""chain"": ""ETH"", ""router"": ""0xE65e9d372F8cAcc7b6dfcd4af6507851Ed31bb44"" } ], ""addresses"": [ { ""chain"": ""THOR"", ""address"": ""tthor1syneecwgwvn6zkv47k3cq65fuzrp24yzxyk279"" }, { ""chain"": ""BTC"", ""address"": ""bcrt1qsyneecwgwvn6zkv47k3cq65fuzrp24yz6pz56g"" }, { ""chain"": ""LTC"", ""address"": ""rltc1qsyneecwgwvn6zkv47k3cq65fuzrp24yzyvcadk"" }, { ""chain"": ""BCH"", ""address"": ""qzqj088pepej0g2ejh668qr238sgv925sg4g5hp57p"" }, { ""chain"": ""BNB"", ""address"": ""tbnb1syneecwgwvn6zkv47k3cq65fuzrp24yzg9gfnq"" }, { ""chain"": ""ETH"", ""address"": ""0x61666aa597b4344f855d25b92385b5eb0c650074"" } ] } ] ### Get a vault by pubkey [GET /thorchain/vault/{pubkey}] + Parameters + pubkey (string,required) - pubkey of the vault + Response 200 (application/json) + Attributes (AsgardVault) + Body { ""block_height"": 30, ""pub_key"": ""tthorpub1addwnpepqfha5sms6cyxgmr9y6j3lg5pxzyc3x9g4hkanlwu2j5jgkva4ncaurn5zmd"", ""coins"": [ { ""asset"": ""BNB.RUNE-67C"", ""amount"": ""3000000000000000"" }, { ""asset"": ""BNB.BNB"", ""amount"": ""100000000000"" }, { ""asset"": ""BNB.LOK-3C0"", ""amount"": ""40000000000"" }, { ""asset"": ""BNB.BTCB-101"", ""amount"": ""40000000000"" }, { ""asset"": ""BTC.BTC"", ""amount"": ""100000000"" }, { ""asset"": ""LTC.LTC"", ""amount"": ""500000000"" }, { ""asset"": ""BCH.BCH"", ""amount"": ""500000000"" }, { ""asset"": ""ETH.TKN-0X3B7FA4DD21C6F9BA3CA375217EAD7CAB9D6BF483"", ""amount"": ""500000000"" }, { ""asset"": ""ETH.ETH"", ""amount"": ""1000000000"" } ], ""type"": ""AsgardVault"", ""status"": ""ActiveVault"", ""membership"": [ ""tthorpub1addwnpepqfha5sms6cyxgmr9y6j3lg5pxzyc3x9g4hkanlwu2j5jgkva4ncaurn5zmd"" ], ""chains"": [ ""THOR"", ""BTC"", ""LTC"", ""BCH"", ""BNB"", ""ETH"" ], ""inbound_tx_count"": 11, ""routers"": [ { ""chain"": ""ETH"", ""router"": ""0xE65e9d372F8cAcc7b6dfcd4af6507851Ed31bb44"" } ], ""addresses"": [ { ""chain"": ""THOR"", ""address"": ""tthor1syneecwgwvn6zkv47k3cq65fuzrp24yzxyk279"" }, { ""chain"": ""BTC"", ""address"": ""bcrt1qsyneecwgwvn6zkv47k3cq65fuzrp24yz6pz56g"" }, { ""chain"": ""LTC"", ""address"": ""rltc1qsyneecwgwvn6zkv47k3cq65fuzrp24yzyvcadk"" }, { ""chain"": ""BCH"", ""address"": ""qzqj088pepej0g2ejh668qr238sgv925sg4g5hp57p"" }, { ""chain"": ""BNB"", ""address"": ""tbnb1syneecwgwvn6zkv47k3cq65fuzrp24yzg9gfnq"" }, { ""chain"": ""ETH"", ""address"": ""0x61666aa597b4344f855d25b92385b5eb0c650074"" } ] } ### Get vault pubkeys [GET /thorchain/vaults/pubkeys] Retrieve all vaults public keys + Response 200 (application/json) + Attributes + asgard (array[string]) - all Asgard vaults public key + yggdrasil (array[string]) - all Yggdrasil vaults publikc keys + Body { ""asgard"": [ ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"" ], ""yggdrasil"": [] } # Group Network This section document all API related to THORChain network ## Network [/thorchain/network] + Attributes + bond_reward_rune (string) - total amount of awarded rune for node operators + total_bond_units (string) - total amount of bond units + total_reserve (string) - total amount of reserve in rune + burned_bep_2_rune (string) - total amount of burned BEP2 rune to native rune + burned_erc_20_rune (string) - total amount of burned ERC20 rune to native rune ### Get network data [GET] Retrieve network data from THORChain + Response 200 (applicaton/json) + Attributes (Network) + Body { ""bond_reward_rune"": ""857134475040"", ""total_bond_units"": ""0"", ""total_reserve"": ""21999180112172346"", ""burned_bep_2_rune"": ""674699077345087"", ""burned_erc_20_rune"": ""66369401654835"" } ## InboundAddresses [/thorchain/inbound_addresses] Inbound addresses will return a list of addresses, one per chain. The address might change frequently if THORChain has multiple Asgards. + Attributes + chain (string) - chain + pub_key (string) - public key + address (string) - address + halted (boolean) - indicate whether this chain has halted + gas_rate (string) - gas rate, for ETH, it is in Gwei, for BTC/BCH/LTC it is gas_rate per vbyte ### Get inbound addresses [GET] Retrieve all the inbound addresses from THORChain + Response 200 (application/json) + Attributes (array[InboundAddresses]) + Body [ { ""chain"": ""BCH"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""qzvhxqm3clrhewqllfmt2ekuaa7puhwpns3kl5nj7a"", ""gas_rate"": ""6"" }, { ""chain"": ""BNB"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""bnb1n9esxuw8ca7ts8l6w66kdh800s09msvul6vlse"", ""halted"": true, ""gas_rate"": ""11250"" }, { ""chain"": ""BTC"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""bc1qn9esxuw8ca7ts8l6w66kdh800s09msvutydc46"", ""gas_rate"": ""214"" }, { ""chain"": ""ETH"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""0x1091c4de6a3cf09cda00abdaed42c7c3b69c83ec"", ""router"": ""0x42A5Ed456650a09Dc10EBc6361A7480fDd61f27B"", ""gas_rate"": ""40"" }, { ""chain"": ""LTC"", ""pub_key"": ""thorpub1addwnpepq2jqhv5rdqlkusfxy05stfzcgslhhz5qh8pxetw5ry2aa6awgdh3shq8s82"", ""address"": ""ltc1qn9esxuw8ca7ts8l6w66kdh800s09msvu0chud2"", ""gas_rate"": ""147"" } ] ## LastBlockHeight [/thorchain/lastblock/{chain}] Last block height per chain + Parameters + chain: `BNB` (string,required) - chain + Attributes + chain (string) - chain + last_observed_in (number) - last observed in block height + last_sign_out (number) - last sign out block height + thorchain (number) - current thorchain block height ### Get last block height per chain [GET] Retrieve the last block height information about the request chain + Response 200 (application/json) + Attributes (array[LastBlockHeight]) + Body [ { ""chain"": ""BNB"", ""last_observed_in"": 159097122, ""last_signed_out"": 233726, ""thorchain"": 233735 } ] ### Get all last block height [GET /thorchain/lastblock] Retrieve lastest block infomation across all chains + Response 200 (application/json) + Attributes (array[LastBlockHeight]) + Body [ { ""chain"": ""BCH"", ""last_observed_in"": 684829, ""last_signed_out"": 233674, ""thorchain"": 233727 }, { ""chain"": ""BNB"", ""last_observed_in"": 159097122, ""last_signed_out"": 233674, ""thorchain"": 233727 }, { ""chain"": ""BTC"", ""last_observed_in"": 680532, ""last_signed_out"": 233674, ""thorchain"": 233727 }, { ""chain"": ""ETH"", ""last_observed_in"": 12308554, ""last_signed_out"": 233674, ""thorchain"": 233727 }, { ""chain"": ""LTC"", ""last_observed_in"": 2040853, ""last_signed_out"": 233674, ""thorchain"": 233727 } ] ## Version [/thorchain/version] Network version using semantic version + Attributes + current (string) - current version + next (string) - next version ### Get current network version [GET] Retrieve current network version from THORChain + Response 200 (application/json) + Attributes (Version) + Body { ""current"": ""0.17.0"", ""next"": ""0.17.0"" } ## Constants [/thorchain/constants] Constant values used by THORChain, some of the values can be overrided by mimir ### Get constant values from THORChain [GET] Retrieve constant values from THORChain + Response 200 (application/json) + Body { ""int_64_values"": { ""AsgardSize"": 40, ""BadValidatorRate"": 43200, ""BadValidatorRedline"": 3, ""BlocksPerYear"": 5256000, ""ChurnInterval"": 43200, ""ChurnRetryInterval"": 720, ""DesiredValidatorSet"": 100, ""DoubleSignMaxAge"": 24, ""EmissionCurve"": 6, ""FailKeygenSlashPoints"": 720, ""FailKeysignSlashPoints"": 2, ""FullImpLossProtectionBlocks"": 1440000, ""FundMigrationInterval"": 360, ""IncentiveCurve"": 100, ""JailTimeKeygen"": 4320, ""JailTimeKeysign"": 60, ""LackOfObservationPenalty"": 2, ""LiquidityLockUpBlocks"": 0, ""MaxAvailablePools"": 100, ""MaxSwapsPerBlock"": 100, ""MinRunePoolDepth"": 1000000000000, ""MinSlashPointsForBadValidator"": 100, ""MinSwapsPerBlock"": 10, ""MinimumBondInRune"": 100000000000000, ""MinimumNodesForBFT"": 4, ""MinimumNodesForYggdrasil"": 6, ""NativeTransactionFee"": 2000000, ""ObservationDelayFlexibility"": 10, ""ObserveSlashPoints"": 1, ""OldValidatorRate"": 43200, ""OutboundTransactionFee"": 2000000, ""PoolCycle"": 43200, ""SigningTransactionPeriod"": 300, ""StagedPoolCost"": 1000000000, ""VirtualMultSynths"": 2, ""YggFundLimit"": 50, ""YggFundRetry"": 1000 }, ""bool_values"": { ""StrictBondLiquidityRatio"": true }, ""string_values"": { ""DefaultPoolStatus"": ""Staged"" } } ## Ragnarok [/thorchain/ragnarok] This is just a true/false indicate whether THORChain is in Ragnarok or not ### Get Ragnarok status [GET] + Response 200 (application/json) + Attributes (boolean) + Body false # Group Queue ## OutboundQueue [/thorchain/queue] + Attributes + swap (number) - number of swaps in the queue + outbound (number) - number of outbound tx in the queue for customer + internal (number) - number of internal tx in the queue. internal tx include migration,yggdrasil+ ### Get outbound queue [GET] Retrieve the outbound queue information from THORChain + Response 200 (application/json) + Attributes (OutboundQueue) + Body { ""swap"": 0, ""outbound"": 0, ""internal"": 0 } ### Get outbound queue detail [GET /thorchain/queue/outbound] Get the list of tx out items in the queue + Response 200 (application/json) + Attributes (array[TxOutItem]) + Body [ { ""chain"": ""ETH"", ""to_address"": ""0xf42d7db7fde6060349d61ad29636df23cf03e4b1"", ""vault_pub_key"": ""tthorpub1addwnpepqtg7cdttvvy5wvchvwaytsklst483gmrf7cv42qkq392aa29h6cyv4p83ug"", ""coin"": { ""asset"": ""ETH.ETH"", ""amount"": ""158037"" }, ""memo"": ""MIGRATE:14701"", ""max_gas"": [ { ""asset"": ""ETH.ETH"", ""amount"": ""120000"" } ], ""gas_rate"": 1, ""in_hash"": ""0000000000000000000000000000000000000000000000000000000000000000"" } ] # Group Keygen / Keysign ## Keygen [/thorchain/keygen/{height}/{pubkey}] + Parameters + height: 1024 (int,required) - block height + pubkey (string,required) - node public key + Attributes + keygen_block + height (string) - block height + keygens (array[string]) - a list node public keys , indicate who should be part of this keygen + signature (string) - base64 encoded signaure of the keygen block ### Get Keygen [GET] Retrieve Keygen block from THORChain + Response 200 (application/json) + Attributes (Keygen) + Body { ""keygen_block"": { ""height"": ""1024"", ""keygens"": null }, ""signature"": ""NhKsZqRHNIMZ1Dw45/KQqFVcNBkl9B9/2MQrs5EinO4R5XlPSryW6SvRMe1f3//NLJ6yExqjmSBObR5+CClsqw=="" } ## Keysign [/thorchain/keysign/{height}/{pubkey}] + Parameters + height: 1024 (int,required) - block height + pubkey (string,required) - node public key + Attributes + keysign + height (string) - block height + tx_array (array[TxOutItem]) - list of tx out items + signature (string) - base64 encoded signature of keysign ### Get Keysign [GET] Retrieve Keysign information from THORChain + Response 200 (application/json) + Attributes (Keysign) + Body { ""keysign"": { ""height"": ""18"", ""tx_array"": [ { ""chain"": ""BNB"", ""to"": ""tbnb189az9plcke2c00vns0zfmllfpfdw67dtv25kgx"", ""vault_pubkey"": ""tthorpub1addwnpepqd9nqqmgay6mju0yq72ptjucmk9atawtev4v4n6wkee5y26q80eccg0xk37"", ""coin"": { ""asset"": ""BNB.BNB"", ""amount"": ""149887500"" }, ""memo"": ""REFUND:50B303717A650F5D93B28CF34C8971E06382003AFFDB92E5935F3540D187490B"", ""max_gas"": [ { ""asset"": ""BNB.BNB"", ""amount"": ""56250"" } ], ""gas_rate"": ""56250"", ""in_hash"": ""50B303717A650F5D93B28CF34C8971E06382003AFFDB92E5935F3540D187490B"", ""out_hash"": ""601FB5AD52259BB023BC93996F40640CCC088B04528EB829E8FE9E9AC82F81C4"" } ] }, ""signature"": ""0cJZ7kFoe6h3VA9yC/D+joTtfq7pJibxTK6GsjpHayNjapNCig20cqqSUerscKTwRPxB2D9DJaYVJ1C41wM9Bw=="" } # Group THORNames ## THORName [/thorchain/thorname/{name}] + Parameters + name (string,required) - THORName name ### Get Keygen [GET] Retrieve THORName from THORChain + Response 200 (application/json) + Attributes (array[THORName]) + Body [ { ""name"": ""my-thorname"", ""chain"": ""THOR"", ""address"": ""thor1xxxxx"", ""expire_block_height"": 4000 } ] # Data Structures ## LiquidityProvider (object) + asset (string) - the asset of the non-rune asset + rune_address (string) - the rune address of the liquidity provider + asset_address (string) - the non-rune asset address of the liquidity provider + last_add (string) - block height of the last add + last_withdraw (string) - block height of the last withdraw + units (string) - the total number of units of the pool + pending_rune (string) - rune that has been provided, but not committed yet. Awaiting a provision of the non-rune asset + pending_asset (string) - asset + pending_tx_id (string) - pending tx id ## Coin (object) + asset (string) - asset + amount (string) = amount ## ObservedTx (object) + id (string) - transaction hash + chain (string) - chain + from_address (string) - from address + to_address (string) - to address + coins (array[Coin]) - coins + gas (array[Coin]) - amount of gas paid by the tx + memo (string) - memo ## TxOutItem (object) + chain (string) - chain + to (string) - to address + vault_pubkey (string) - vault public key + coin (Coin) - coin + memo (string) - memo + max_gas (Coin) - maxmum gas allowed to spend + gas_rate (string) - gas rate , signer has to use this gas rate to sign an outbound tx + in_hash (string) - inbound tx hash + out_hash (string) - outbound tx hash , this will be available after the txout item had been signed and observed back by bifrost ## ChainRouter (object) + chain (string) - chain + router (string) - router address ## ChainAddress (object) + chain (string) - chain + address (string) - address ",12233,True,2521.416634668743,median "FORMAT: 1A HOST: http://local.comet-demo.test/api/ AUTH_TYPE: key AUTH_NAME: X-Authorization AUTH_LOCATION: header # Travel Books API This project contains the implementation of a simple Laravel example RESTful API for travel books. We have several different models: countries, languages, authors and books. Travel books are written by one author, in one language, for one country. For this relatively simple API with 20 endpoints, Comet is able to generate 112 test-cases. ## JSON API In the following section, a short overview of the general capabilities of the API will be given. **Note:** This documentation will display parameters with brackets (`[` and `]`) for readability, but actual URLs will need to be percent-encoded (`%5B` and `%5D`). ### Filtering and Search Filtering lets you query data that contains certain matching attributes or relationships. These take the form of `filter[attribute]=value`. For example, you can request all the books by a certain publisher: ```http /books?filter[publisher]=ABC ``` ### Includes For some resources (e.g. books), you can also include related resources with `include=[relationship]`. A comma-delimited list can be used to request multiple relationships. ``` /books?include=author,country ``` ## Status Codes |Code | Description |----- | ----------- |`200` | OK |`204` | No Content - successful request with no response content |`400` | Bad Request - malformed request |`401` | Unauthorized - invalid or no authentication details provided |`404` | Not Found - resource does not exist |`405` | Method Not Allowed |`5xx` | Server Error # Group Locales The locale endpoints can be used to access information about countries and their respective languages. ## Countries [/countries] Resource representing a list of all countries. + Attributes (array, fixed-type) + (Country) + Model (application/json) + Headers ``` X-RateLimit-Limit: 60 X-RateLimit-Remaining: ``` + Body ```json [ { ""code"": ""CH"", ""name"": ""Switzerland"" }, { ""code"": ""DE"", ""name"": ""Germany"" }, { ""code"": ""FR"", ""name"": ""France"" }, { ""code"": ""US"", ""name"": ""United States of America"" } ] ``` + Schema ```json { ""type"": ""array"", ""items"": { ""description"": ""Country specified by name and country-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 }, ""languages"": { ""description"": ""Languages that belong to this country"", ""type"": ""array"", ""items"": { ""description"": ""Language specified by name and language-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] } }, ""authors"": { ""description"": ""Authors belonging to this country"", ""type"": ""array"", ""items"": { ""description"": ""Author model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""first_name"": { ""type"": ""string"" }, ""last_name"": { ""type"": ""string"" }, ""date_of_birth"": { ""type"": [ ""string"", ""null"" ] }, ""homepage"": { ""type"": [ ""string"", ""null"" ], ""format"": ""uri"" }, ""country_code"": { ""type"": [ ""string"", ""null"" ] } }, ""type"": ""object"", ""required"": [ ""id"", ""first_name"", ""last_name"" ] } }, ""books"": { ""description"": ""Travel books for this country"", ""type"": ""array"", ""items"": { ""description"": ""Book model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""title"": { ""type"": ""string"" }, ""description"": { ""type"": ""string"" }, ""publisher"": { ""type"": ""string"" }, ""price"": { ""type"": ""number"" }, ""author_id"": { ""type"": ""integer"" }, ""country_code"": { ""type"": ""string"" }, ""language_code"": { ""type"": ""string"" } }, ""type"": ""object"", ""required"": [ ""id"", ""title"", ""description"", ""publisher"", ""price"", ""author_id"", ""country_code"", ""language_code"" ] } } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] }, ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` ### Retrieve countries [GET /countries{?include}] Retrieve a list of all countries. The following relationships can optionally be included in the response: |name | |----------- | |`languages` | |`books` | |`authors` | + Parameters + include: `languages,authors` (array[string], optional) - Comma-separated list of relationships to include + Request + Headers ``` Accept: application/json ``` + Response 200 [Countries][] + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Create country [POST] Endpoint for creating a new country. + Request (application/json) + Headers ``` X-Authorization: Accept: application/json ``` + Body ```json { ""code"": ""DE"", ""name"": ""Germany"" } ``` + Schema ```json { ""description"": ""Country specified by name and country-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ], ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` + Response 201 [Country][] + Response 422 (application/json) + Attributes + errors (array[Error422]) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ## Country [/countries/{code}] Resource representing a single country. + Parameters + code: `CH` (string, required) - ISO 3166-1 alpha-2 code of the requested country + Attributes (object, fixed-type) + code: `CH` (string, required) - ISO 3166-1 alpha-2 code of the country + name: `Switzerland` (string, required) - English name of the country + Model (application/json) + Headers ``` X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 ``` + Body ```json { ""code"": ""CH"", ""name"": ""Switzerland"" } ``` + Schema ```json { ""description"": ""Country specified by name and country-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 }, ""languages"": { ""description"": ""Languages that belong to this country"", ""type"": ""array"", ""items"": { ""description"": ""Language specified by name and language-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] } }, ""authors"": { ""description"": ""Authors belonging to this country"", ""type"": ""array"", ""items"": { ""description"": ""Author model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""first_name"": { ""type"": ""string"" }, ""last_name"": { ""type"": ""string"" }, ""date_of_birth"": { ""type"": [ ""string"", ""null"" ] }, ""homepage"": { ""type"": [ ""string"", ""null"" ], ""format"": ""uri"" }, ""country_code"": { ""type"": [ ""string"", ""null"" ] } }, ""type"": ""object"", ""required"": [ ""id"", ""first_name"", ""last_name"" ] } }, ""books"": { ""description"": ""Travel books for this country"", ""type"": ""array"", ""items"": { ""description"": ""Book model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""title"": { ""type"": ""string"" }, ""description"": { ""type"": ""string"" }, ""publisher"": { ""type"": ""string"" }, ""price"": { ""type"": ""number"" }, ""author_id"": { ""type"": ""integer"" }, ""country_code"": { ""type"": ""string"" }, ""language_code"": { ""type"": ""string"" } }, ""type"": ""object"", ""required"": [ ""id"", ""title"", ""description"", ""publisher"", ""price"", ""author_id"", ""country_code"", ""language_code"" ] } } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ], ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` ### Show country [GET /countries/{code}{?include}] + Parameters + include: `languages,authors` (array[string], optional) - Comma-separated list of relationships to include + Request + Headers ``` Accept: application/json ``` + Response 200 [Country][] + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Update country [PATCH] Update an existing country object with new data. + Request (application/json) + Headers ``` X-Authorization: Accept: application/json ``` + Body ```json { ""code"": ""DE"", ""name"": ""Germany"" } ``` + Schema ```json { ""description"": ""Country specified by name and country-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ], ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` + Response 200 [Country][] + Response 422 (application/json) + Attributes + errors (array[Error422]) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Delete country [DELETE] Delete an existing country from database. + Request + Headers ``` X-Authorization: Accept: application/json ``` + Response 204 (application/json) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ## Languages [/languages] Resource representing a list of all languages. + Attributes (array, fixed-type) + (Language) + Model (application/json) + Headers ``` X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 ``` + Body ```json [ { ""code"": ""de"", ""name"": ""German"" }, { ""code"": ""en"", ""name"": ""English"" }, { ""code"": ""fr"", ""name"": ""French"" } ] ``` + Schema ```json { ""type"": ""array"", ""items"": { ""description"": ""Language specified by name and language-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 }, ""countries"": { ""description"": ""Countries the language is spoken in"", ""type"": ""array"", ""items"": { ""description"": ""Country specified by name and country-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] } }, ""books"": { ""description"": ""Travel books in this language"", ""type"": ""array"", ""items"": { ""description"": ""Book model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""title"": { ""type"": ""string"" }, ""description"": { ""type"": ""string"" }, ""publisher"": { ""type"": ""string"" }, ""price"": { ""type"": ""number"" }, ""author_id"": { ""type"": ""integer"" }, ""country_code"": { ""type"": ""string"" }, ""language_code"": { ""type"": ""string"" } }, ""type"": ""object"", ""required"": [ ""id"", ""title"", ""description"", ""publisher"", ""price"", ""author_id"", ""country_code"", ""language_code"" ] } } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] }, ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` ### Retrieve languages [GET /languages{?include}] Retrieve a list of all languages. The following relationships can optionally be included in the response: |name | |----------- | |`countries` | |`books` | + Parameters + include: `books` (array[string], optional) - Comma-separated list of relationships to include + Request + Headers ``` Accept: application/json ``` + Response 200 [Languages][] + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Create language [POST] Endpoint for creating a new language. + Request (application/json) + Headers ``` X-Authorization: Accept: application/json ``` + Body ```json { ""code"": ""de"", ""name"": ""German"" } ``` + Schema ```json { ""description"": ""Language specified by name and language-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ], ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` + Response 201 [Language][] + Response 422 (application/json) + Attributes + errors (array[Error422]) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ## Language [/languages/{code}] Resource representing a single language. + Parameters + code: `de` (string, required) - ISO 639-1 code of the requested language + Attributes (object, fixed-type) + code: `de` (string, required) - ISO 639-1 code of the language + name: `German` (string, required) - English name of the language + Model (application/json) + Headers ``` X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 ``` + Body ```json { ""code"": ""de"", ""name"": ""German"" } ``` + Schema ```json { ""description"": ""Country specified by name and country-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 }, ""languages"": { ""description"": ""Languages that belong to this country"", ""type"": ""array"", ""items"": { ""description"": ""Language specified by name and language-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] } }, ""authors"": { ""description"": ""Authors belonging to this country"", ""type"": ""array"", ""items"": { ""description"": ""Author model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""first_name"": { ""type"": ""string"" }, ""last_name"": { ""type"": ""string"" }, ""date_of_birth"": { ""type"": [ ""string"", ""null"" ] }, ""homepage"": { ""type"": [ ""string"", ""null"" ], ""format"": ""uri"" }, ""country_code"": { ""type"": [ ""string"", ""null"" ] } }, ""type"": ""object"", ""required"": [ ""id"", ""first_name"", ""last_name"" ] } }, ""books"": { ""description"": ""Travel books for this country"", ""type"": ""array"", ""items"": { ""description"": ""Book model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""title"": { ""type"": ""string"" }, ""description"": { ""type"": ""string"" }, ""publisher"": { ""type"": ""string"" }, ""price"": { ""type"": ""number"" }, ""author_id"": { ""type"": ""integer"" }, ""country_code"": { ""type"": ""string"" }, ""language_code"": { ""type"": ""string"" } }, ""type"": ""object"", ""required"": [ ""id"", ""title"", ""description"", ""publisher"", ""price"", ""author_id"", ""country_code"", ""language_code"" ] } } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ], ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` ### Show language [GET /languages/{code}{?include}] + Parameters + include: `books,countries` (array[string], optional) - Comma-separated list of relationships to include + Request + Headers ``` Accept: application/json ``` + Response 200 (application/json) [Language][] + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Update language [PATCH] Update an existing language object with new data. + Request (application/json) + Headers ``` X-Authorization: Accept: application/json ``` + Body ```json { ""code"": ""de"", ""name"": ""German"" } ``` + Schema ```json { ""description"": ""Language specified by name and language-code"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ], ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` + Response 200 [Language][] + Response 422 (application/json) + Attributes + errors (array[Error422]) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Delete language [DELETE] Delete an existing language from database. + Request + Headers ``` X-Authorization: Accept: application/json ``` + Response 204 (application/json) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) # Group Root ## Authors [/authors] Resource representing a list of all authors. + Attributes (array, fixed-type) + (AuthorResponse) + Model (application/json) + Headers ``` X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 ``` + Body ```json [ { ""id"": 1, ""last_name"": ""Wehner"", ""first_name"": ""Tony"", ""date_of_birth"": ""2002-08-20 00:00:00"", ""homepage"": ""https://morar.com/facilis-labore-hic-minus-sunt-maiores-cupiditate.html"", ""country_code"": ""DE"" }, { ""id"": 2, ""last_name"": ""Jakubowski"", ""first_name"": ""Beryl"", ""date_of_birth"": ""1949-08-16 00:00:00"", ""homepage"": ""http://murphy.biz/sit-non-accusantium-sunt-rerum-et-et-nisi-qui.html"", ""country_code"": ""DE"" } ] ``` + Schema ```json { ""type"": ""array"", ""items"": { ""description"": ""Author model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""first_name"": { ""type"": ""string"" }, ""last_name"": { ""type"": ""string"" }, ""date_of_birth"": { ""type"": [ ""string"", ""null"" ] }, ""homepage"": { ""type"": [ ""string"", ""null"" ], ""format"": ""uri"" }, ""country_code"": { ""type"": [ ""string"", ""null"" ] }, ""books"": { ""description"": ""Books that the author has written"", ""type"": ""array"", ""items"": { ""description"": ""Book model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""title"": { ""type"": ""string"" }, ""description"": { ""type"": ""string"" }, ""publisher"": { ""type"": ""string"" }, ""price"": { ""type"": ""number"" }, ""author_id"": { ""type"": ""integer"" }, ""country_code"": { ""type"": ""string"" }, ""language_code"": { ""type"": ""string"" } }, ""type"": ""object"", ""required"": [ ""id"", ""title"", ""description"", ""publisher"", ""price"", ""author_id"", ""country_code"", ""language_code"" ] } }, ""country"": { ""description"": ""Country the author is from"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] } }, ""type"": ""object"", ""required"": [ ""id"", ""first_name"", ""last_name"" ] }, ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` ### Retrieve authors [GET /authors{?include,filter%5bname%5d,filter%5bhidden%5d,filter%5bgender%5d}] Retrieve a list of all authors. The following relationships can optionally be included in the response: `books`, `country`. + Parameters + include: `books,country` (array[string], optional) - Comma-separated list of relationships to include + filter%5bname%5d: `Tony` (string, optional) - Filter by author name + filter%5bhidden%5d: `true` (boolean, optional) - Include hidden authors + filter%5bgender%5d: `male` (enum[string], optional) - Filter by author gender + Members + male + female + other + Request + Headers ``` Accept: application/json ``` + Response 200 [Authors][] + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Create author [POST] Endpoint for creating a new author. + Request (application/json) + Attributes (AuthorRequest) + Headers ``` X-Authorization: Accept: application/json ``` + Body ```json { ""last_name"": ""Rau"", ""first_name"": ""Gage"", ""date_of_birth"": ""2011-10-30 00:00:00"", ""homepage"": ""http://www.lowe.biz/fugiat-doloribus-in-beatae-aut-alias"", ""country_code"": ""US"" } ``` + Schema ```json { ""description"": ""Author model"", ""properties"": { ""first_name"": { ""type"": ""string"" }, ""last_name"": { ""type"": ""string"" }, ""date_of_birth"": { ""type"": [ ""string"", ""null"" ] }, ""homepage"": { ""type"": [ ""string"", ""null"" ], ""format"": ""uri"" }, ""country_code"": { ""type"": [ ""string"", ""null"" ] } }, ""type"": ""object"", ""required"": [ ""id"", ""first_name"", ""last_name"" ], ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` + Response 201 [Author][] + Response 422 (application/json) + Attributes + errors (array[Error422]) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ## Author [/authors/{id}] Resource representing a single author. + Parameters + id: `1` (number, required) - ID of the requested author + Attributes (AuthorResponse) + Model (application/json) + Headers ``` X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 ``` + Body ```json { ""id"": 1, ""last_name"": ""Wehner"", ""first_name"": ""Tony"", ""date_of_birth"": ""2002-08-20 00:00:00"", ""homepage"": ""https://morar.com/facilis-labore-hic-minus-sunt-maiores-cupiditate.html"", ""country_code"": ""DE"" } ``` + Schema ```json { ""description"": ""Author model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""first_name"": { ""type"": ""string"" }, ""last_name"": { ""type"": ""string"" }, ""date_of_birth"": { ""type"": [ ""string"", ""null"" ] }, ""homepage"": { ""type"": [ ""string"", ""null"" ], ""format"": ""uri"" }, ""country_code"": { ""type"": [ ""string"", ""null"" ] }, ""books"": { ""description"": ""Books that the author has written"", ""type"": ""array"", ""items"": { ""description"": ""Book model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""title"": { ""type"": ""string"" }, ""description"": { ""type"": ""string"" }, ""publisher"": { ""type"": ""string"" }, ""price"": { ""type"": ""number"" }, ""author_id"": { ""type"": ""integer"" }, ""country_code"": { ""type"": ""string"" }, ""language_code"": { ""type"": ""string"" } }, ""type"": ""object"", ""required"": [ ""id"", ""title"", ""description"", ""publisher"", ""price"", ""author_id"", ""country_code"", ""language_code"" ] } }, ""country"": { ""description"": ""Country the author is from"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] } }, ""type"": ""object"", ""required"": [ ""id"", ""first_name"", ""last_name"" ], ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` ### Show author [GET /authors/{id}{?include}] + Parameters + include: `books` (array[string], optional) - Comma-separated list of relationships to include + Request + Headers ``` Accept: application/json ``` + Response 200 [Author][] + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Update author [PATCH] Update an existing author object with new data. + Request (application/json) + Attributes (AuthorRequest) + Headers ``` X-Authorization: Accept: application/json ``` + Body ```json { ""last_name"": ""Rau"", ""first_name"": ""Gage"", ""date_of_birth"": ""2011-10-30 00:00:00"", ""homepage"": ""http://www.lowe.biz/fugiat-doloribus-in-beatae-aut-alias"", ""country_code"": ""US"" } ``` + Schema ```json { ""description"": ""Author model"", ""properties"": { ""first_name"": { ""type"": ""string"" }, ""last_name"": { ""type"": ""string"" }, ""date_of_birth"": { ""type"": [ ""string"", ""null"" ] }, ""homepage"": { ""type"": [ ""string"", ""null"" ], ""format"": ""uri"" }, ""country_code"": { ""type"": [ ""string"", ""null"" ] } }, ""type"": ""object"", ""required"": [ ""id"", ""first_name"", ""last_name"" ], ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` + Response 200 [Author][] + Response 422 (application/json) + Attributes + errors (array[Error422]) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Delete author [DELETE] Delete an existing author from database. + Request + Headers ``` X-Authorization: Accept: application/json ``` + Response 204 (application/json) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ## Books [/books] Resource representing a list of all books. + Attributes (array, fixed-type) + (BookResponse) + Model (application/json) + Headers ``` X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 ``` + Body ```json [ { ""id"": 1, ""title"": ""reprehenderit quod enim"", ""description"": ""Quas dicta itaque iure ut consequatur laborum voluptatibus. Nihil sint sint non rerum laborum. Et laudantium est quia sunt vero vel natus. Perspiciatis est non esse hic neque id fuga rerum."", ""publisher"": ""omnis"", ""price"": 24, ""author_id"": 4, ""country_code"": ""DE"", ""language_code"": ""de"" }, { ""id"": 2, ""title"": ""illum sit voluptas"", ""description"": ""Repudiandae molestiae sit et magni. Reiciendis illo qui voluptas facere doloremque. Amet magnam voluptates saepe dolores."", ""publisher"": ""voluptatem"", ""price"": 20, ""author_id"": 4, ""country_code"": ""DE"", ""language_code"": ""de"" } ] ``` + Schema ```json { ""type"": ""array"", ""items"": { ""description"": ""Book model"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""title"": { ""type"": ""string"" }, ""description"": { ""type"": ""string"" }, ""publisher"": { ""type"": ""string"" }, ""price"": { ""type"": ""number"" }, ""author_id"": { ""type"": ""integer"" }, ""country_code"": { ""type"": ""string"" }, ""language_code"": { ""type"": ""string"" }, ""author"": { ""description"": ""The author of the book"", ""properties"": { ""id"": { ""type"": ""integer"" }, ""first_name"": { ""type"": ""string"" }, ""last_name"": { ""type"": ""string"" }, ""date_of_birth"": { ""type"": [ ""string"", ""null"" ] }, ""homepage"": { ""type"": [ ""string"", ""null"" ], ""format"": ""uri"" }, ""country_code"": { ""type"": [ ""string"", ""null"" ] } }, ""type"": ""object"", ""required"": [ ""id"", ""first_name"", ""last_name"" ] }, ""country"": { ""description"": ""Country the travel book is for"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] }, ""language"": { ""description"": ""Language the book is written in"", ""properties"": { ""name"": { ""type"": ""string"" }, ""code"": { ""type"": ""string"", ""minLength"": 2, ""maxLength"": 2 } }, ""type"": ""object"", ""required"": [ ""name"", ""code"" ] } }, ""type"": ""object"", ""required"": [ ""id"", ""title"", ""description"", ""publisher"", ""price"", ""author_id"", ""country_code"", ""language_code"" ] }, ""$schema"": ""http://json-schema.org/draft-04/schema#"" } ``` ### Retrieve books [GET /books{?include,filter%5btitle%5d,filter%5bpublisher%5d,filter%5bauthor%5d,filter%5bcountry%5d,filter%5blanguage%5d}] Retrieve a list of all books. The following relationships can optionally be included in the response: |name | |----------- | |`author` | |`country` | |`language` | + Parameters + include: `author,country` (array[string], optional) - Comma-separated list of relationships to include + filter%5btitle%5d: `Reprehenderit` (string, optional) - Filter by book title + filter%5bpublisher%5d: `omnis` (string, optional) - Filter by publisher name + filter%5bauthor%5d: `1` (number, optional) - Filter by author id + filter%5bcountry%5d: `DE` (string, optional) - Filter by country code + filter%5blanguage%5d: `en` (string, optional) - Filter by language code + Request + Headers ``` Accept: application/json ``` + Response 200 [Books][] + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Create book [POST] Endpoint for creating a new book. + Request (application/json) + Attributes (BookRequest) + Headers ``` X-Authorization: Accept: application/json ``` + Body ```json { ""id"": 25, ""title"": ""maxime sint voluptates"", ""description"": ""Et qui ab odit hic nemo illum. Sint velit adipisci qui mollitia est. Qui vel qui dignissimos qui."", ""publisher"": ""sint"", ""price"": 15, ""author_id"": 16, ""country_code"": ""CH"", ""language_code"": ""fr"" } ``` + Response 201 [Book][] + Response 422 (application/json) + Attributes + errors (array[Error422]) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ## Book [/books/{id}] Resource representing a single book. + Parameters + id: `1` (number, required) - ID of the requested book + Model (application/json) + Attributes (BookResponse) + Headers ``` X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 ``` + Body ```json { ""id"": 1, ""title"": ""reprehenderit quod enim"", ""description"": ""Quas dicta itaque iure ut consequatur laborum voluptatibus. Nihil sint sint non rerum laborum. Et laudantium est quia sunt vero vel natus. Perspiciatis est non esse hic neque id fuga rerum."", ""publisher"": ""omnis"", ""price"": 24, ""author_id"": 4, ""country_code"": ""DE"", ""language_code"": ""de"" } ``` ### Show book [GET /books/{id}{?include}] + Parameters + include: `author` (array[string], optional) - Comma-separated list of relationships to include + Request + Headers ``` Accept: application/json ``` + Response 200 (application/json) + Attributes (BookResponse) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Update book [PATCH] Update an existing book object with new data. + Request (application/json) + Attributes (BookRequest) + Headers ``` X-Authorization: Accept: application/json ``` + Body ```json { ""id"": 25, ""title"": ""maxime sint voluptates"", ""description"": ""Et qui ab odit hic nemo illum. Sint velit adipisci qui mollitia est. Qui vel qui dignissimos qui."", ""publisher"": ""sint"", ""price"": 15, ""author_id"": 16, ""country_code"": ""CH"", ""language_code"": ""fr"" } ``` + Response 200 [Book][] + Response 422 (application/json) + Attributes + errors (array[Error422]) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ### Delete book [DELETE] Delete an existing book from database. + Request + Headers ``` X-Authorization: Accept: application/json ``` + Response 204 (application/json) + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) ## Fetch current author [GET /me] + Request + Headers ``` Accept: application/json ``` + Response 200 [Author][] + Response 401 (application/json) + Attributes + errors (array[Error401]) + Response 404 (application/json) + Attributes + errors (array[Error404]) + Response 405 (application/json) + Attributes + errors (array[Error405]) + Response 500 (application/json) + Attributes + errors (array[Error500]) # Data Structures ## AuthorResponse (object, fixed-type) + id: `1` (number, required) - ID of the author + last_name: `Wehner` (string, required) + first_name: `Tony` (string, required) + date_of_birth: `2002-08-20 00:00:00` (string, nullable, optional) + homepage: `https://morar.com/facilis-labore.html` (string, nullable, optional) - Personal homepage of the author + country_code: `DE` (string, nullable, optional) - ISO 3166-1 alpha-2 code of the country ## AuthorRequest (object, fixed-type) + last_name: `Wehner` (string, required) + first_name: `Tony` (string, required) + date_of_birth: `2002-08-20 00:00:00` (string, nullable, optional) + homepage: `https://morar.com/facilis-labore.html` (string, nullable, optional) - Personal homepage of the author + country_code: `DE` (string, nullable, optional) - ISO 3166-1 alpha-2 code of the country ## BookResponse (object, fixed-type) + id: `1` (number, required) - ID of the book + title: `Reprehenderit quod enim` (string, required) + description: `Quas dicta itaque iure ut consequatur laborum voluptatibus.` (string, required) + publisher: `omnis` (string, required) + price: `24` (number, required) - Personal homepage of the author + author_id: `1` (number, required) - ID of the author + country_code: `DE` (string, required) - ISO 3166-1 alpha-2 code of the country + language_code: `de` (string, required) - ISO 639-1 code of the language ## BookRequest (object, fixed-type) + title: `Reprehenderit quod enim` (string, required) + description: `Quas dicta itaque iure ut consequatur laborum voluptatibus.` (string, required) + publisher: `omnis` (string, required) + price: `24` (number, required) - Personal homepage of the author + author_id: `1` (number, required) - ID of the author + country_code: `DE` (string, required) - ISO 3166-1 alpha-2 code of the country + language_code: `de` (enum[string], required) - ISO 639-1 code of the language + de + ch + fr ## Error422 (object) + title: `Invalid Request` (required, string) - Short, human-readable summary of the error + message: `The given data was invalid.` (required, string) - Human-readable explanation for this specific error + errors (ValidationError, required) + status: 422 (required, number) - HTTP status code generated by the origin server ## Error401 (object) + title: `Unauthorized` (required, string) - Short, human-readable summary of the error + message: `You are not authorized to access this resource.` (required, string) - Human-readable explanation for this specific error + status: 401 (required, number) - HTTP status code generated by the origin server ## Error404 (object) + title: `Record not found` (required, string) - Short, human-readable summary of the error + message: `The requested resource could not be found.` (required, string) - Human-readable explanation for this specific error + status: 404 (required, number) - HTTP status code generated by the origin server ## Error405 (object) + title: `Method Not Allowed` (required, string) - Short, human-readable summary of the error + message: `The method specified in the request is not allowed for this resource.` (required, string) - Human-readable explanation for this specific error + status: 405 (required, number) - HTTP status code generated by the origin server ## Error500 (object) + title: `Internal Server Error` (required, string) - Short, human-readable summary of the error + message: `Whoops, looks like something went wrong.` (required, string) - Human-readable explanation for this specific error + status: 500 (required, number) - HTTP status code generated by the origin server ## ValidationError (object) + *title (string)* (array[string]) + ""Please specify a book title"" (string) ",12484,True,3416.355182845426,median "FORMAT: 1A HOST: http://polls.apiblueprint.org/ FORMAT: 1A HOST: https://pracevcr.cz/api2/ # Český Trh Práce s.r.o. This API demonstrates functionality of real server API for Recruitis app. There are 4 groups with own actions - candidates, jobs, interviews and newsfeed. fejoe #CHANGELOG :[changelog](apidoc_changelog.apib) #TODO dodělat tyto API: - Dotazník :) - Zamyslet se nad error handlerem. message_localize neni implementovan SESSIONMANAGER - callback on after call destruct session! at se nic neposila zpet do CLI! #Group Authentication ## Login [/login] :[](apidoc_login.apib) #Group Me ## My account information [/me] ### Me [GET] Získání informací o mém účtu, za kterého jsem právě přihlášen + Request + Headers Authorization: Bearer 68b0c063374ac7fe0abaa18342dbad23168876a1.8699.3e398f0ccd4c857b29de10397534afac + Response 200 (application/json) { ""payload"": { ""fullname"": ""Michal Macinka"", ""email"": ""macinka@gmail.com"", ""img_src"": ""http://lide.uhk.cz/fim/student/macinmi1/avatar_2.jpg"", ""device_id"": ""x56sj64uzr4we64rtb489uzjj186drgv13e"", ""device_name"": ""restapiklient"" }, ""meta"": { ""duration"": ""2259.39"", ""total_duration"": 2300, ""code"": 200, ""message"": """", ""message_localized"": ""OK"" } } + Response 401 (application/json) { ""payload"": null, ""meta"": { ""duration"": ""139.58"", ""total_duration"": 440, ""code"": 404, ""message"": ""Musíte být přihlášen"", } } # Group Answers API calls for actions connected with answers. ## Answers List [/answers{?limit,page,search,jobid,flowid}] Seznam všech došlých odpovědí k dané firmě ### Get All Answers [GET] + Request + Headers Authorization: Bearer 68b0c063374ac7fe0abaa18342dbad23168876a1.8699.3e398f0ccd4c857b29de10397534afac + Parameters + limit (optional,numeric,`10`) - pocet entit, ktere se maji zobrazit + page (optional,numeric,`1`) - strana s vypisem odpovedi + search (optional,string) - Vyhledávání ve jméně + jobid (optional,int) - Omezení na určitý inzerát + flowid (optional,int) - Filtrace podle konkrétního flow + Response 200 (application/json) { ""payload"": [ { ""candidate_id"": 1, ""answer_id"": 1, ""job_id"": 123456, ""name"": { ""first_name"": ""Michal"", ""last_name"": ""Macinka"", ""initials"": ""MM"" }, ""title"": { ""before"": null, ""after"": null }, ""user_img"": ""http://lide.uhk.cz/fim/student/macinmi1/avatar_2.jpg"", ""rating"": 4, ""signup_job"": { ""job_title"": ""Android Developer"", ""job_source_site"": ""PRACEvIT.cz"" }, ""date_response"": ""18.02.17 17:31"", ""phone"": ""666777888"", ""flow_id"": 4, ""rejected"": false, ""agreement_status"": null, ""agreement_reason"": false, ""source_site"": ""PRACEvCR.cz"" }, { ""candidate_id"": 2, ""answer_id"": 2, ""job_id"": 123456, ""name"": { ""first_name"": ""Karel"", ""last_name"": ""Nový"", ""initials"": ""KN"" }, ""title"": { ""before"": ""Ing."", ""after"": null }, ""user_img"": null, ""rating"": 2, ""signup_job"": { ""job_title"": ""Android Developer"", ""job_source_site"": ""PRACEvIT.cz"" }, ""date_response"": ""19.02.17 15:42"", ""phone"": ""777888777"", ""flow_id"": 1, ""rejected"": false, ""agreement_status"": null, ""agreement_reason"": false, ""source_site"": ""PRACEvCR.cz"" }, { ""candidate_id"": 3, ""answer_id"": 3, ""job_id"": 123456, ""name"": { ""first_name"": ""Libor"", ""last_name"": ""Souček"", ""initials"": ""LS"" }, ""title"": { ""before"": ""Mgr."", ""after"": ""Ph.D."" }, ""user_img"": ""http://pracevcr.cz/upload/employees/-/1.jpg"", ""rating"": 123456, ""signup_job"": { ""job_title"": ""Android Developer"", ""job_source_site"": ""PRACEvIT.cz"" }, ""date_response"": ""21.02.17 07:32"", ""phone"": ""111222333"", ""flow_id"": 3, ""rejected"": false, ""agreement_status"": 1, ""agreement_reason"": ""Souhlas byl přijat"", ""source_site"": ""PRACEvCR.cz"" }, { ""candidate_id"": 4, ""job_id"": 123456, ""name"": { ""first_name"": ""Jiří"", ""last_name"": ""Koral"", ""initials"": ""JK"" }, ""title"": { ""before"": null, ""after"": ""DiS."" }, ""user_img"": ""http://pracevcr.cz/upload/employees/-/5.jpg"", ""rating"": 5, ""signup_job"": { ""job_title"": ""Android Developer"", ""job_source_site"": ""PRACEvIT.cz"" }, ""first_response_date"": ""21.02.17 07:30"", ""phone"": ""111222444"", ""flow_id"": 4, ""rejected"": false, ""agreement_status"": 0, ""agreement_reason"": """", ""source_site"": ""PRACEvCR.cz"" }, { ""candidate_id"": 5, ""answer_id"": 5, ""job_id"": 123456, ""name"": { ""first_name"": ""Jiří"", ""last_name"": ""Mladý"", ""initials"": ""JM"" }, ""title"": { ""before"": ""Mgr."", ""after"": null }, ""user_img"": null, ""rating"": 4, ""signup_job"": { ""job_title"": ""Android Developer"", ""job_source_site"": ""PRACEvIT.cz"" }, ""date_response"": ""20.02.17 23:30"", ""phone"": ""222555888"", ""flow_id"": 5, ""rejected"": false, ""agreement_status"": -1, ""agreement_reason"": ""uchazeč zamítl tuto pozici"", ""source_site"": ""PRACEvCR.cz"" }, { ""candidate_id"": 6, ""answer_id"": 6, ""job_id"": 123456, ""name"": { ""first_name"": ""Tomáš"", ""last_name"": ""Tichý"", ""initials"": ""TT"" }, ""title"": { ""before"": """", ""after"": """" }, ""user_img"": ""http://pracevcr.cz/upload/employees/-/0.jpg"", ""rating"": 0, ""signup_job"": { ""job_title"": ""Android Developer"", ""job_source_site"": ""PRACEvIT.cz"" }, ""date_response"": ""17.02.17 17:31"", ""phone"": ""999999991"", ""flow_id"": 0, ""rejected"": true, ""agreement_status"": null, ""agreement_reason"": null, ""source_site"": ""PRACEvCR.cz"" }, { ""candidate_id"": 7, ""answer_id"": 7, ""job_id"": 123456, ""name"": { ""first_name"": ""Lukáš"", ""last_name"": ""Kabeláč"", ""initials"": ""LK"" }, ""title"": { ""before"": null, ""after"": null }, ""user_img"": null, ""rating"": 3, ""signup_job"": { ""job_title"": ""Android Developer"", ""job_source_site"": ""PRACEvCR.cz"" }, ""date_response"": ""29.06.17 10:38"", ""phone"": ""999999992"", ""flow_id"": 6, ""rejected"": false, ""agreement_status"": null, ""agreement_reason"": null, ""source_site"": ""PRACEvCR.cz"" }, { ""candidate_id"": 8, ""answer_id"": 8, ""job_id"": 123456, ""name"": { ""first_name"": ""Lukáš"", ""last_name"": ""Kabeláč"", ""initials"": ""LK"" }, ""title"": { ""before"": null, ""after"": null }, ""user_img"": null, ""rating"": 0, ""agreement_status"": null, ""agreement_reason"": null, ""signup_job"": { ""job_title"": ""Úklidový pracovník v obrovském nadnárodním korporátu: milióny benefitů ve formě tužek na psaní (všechny mají ulomený hrot, takže jsou úplně k ničemu, ale no neber to); práce 43h denně, kde budeš neustále ve stresu a navíc prakticky skoro vůbec neplacená; ale máme tu kafe zadarmo, samozřejmě pro zaměstnance po zkušebce; tady prostě chceš pracovat a neboj, my ti tu možnost nabídneme a jako bonus tě sedřem z kůže, pošli CVčko ;)"", ""job_source_site"": ""PRACEvHRADCI.cz"" }, ""date_response"": ""07.07.17 17:22"", ""phone"": ""999999992"", ""flow_id"": 0, ""rejected"": false, ""source_site"": ""PRACEvCR.cz"" } ], ""meta"": { ""entries_from"": 1, ""entries_to"": 10, ""entries_total"": 50, ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""The resource you're looking for doesn't exist."" } } ## Answers Detail [/answers/{id}] Detail konkrétní odpovědi. Vysvětlení parametru `agreement_status` a `agreement_reason` : - `agreement_status`: Jedná se o informaci, jestli je daný uchazeč zkopírován a čeká na schválení, nebo danou nabídku pozice již zamítl. Může nabývat hodnot null,0,1,-1. NULL: Zadaný člověk nebyl zkopírován a nemusí čekat na žádné schválení 0: Zadaný člověk čeká na vyjádření. V tuto chvíli je zakázané provádět s ním jakékoli pohovorové operace. 1: Zadaný člověk schválil zkopírování na konkrétní pozici. -1: zadaný člověk zamítl danou pozici. V tuto chvíli je zakázané provádět s ním jakékoli pohovorové operace. - `agreement_reason`: Pokud `agreement_status` nabývá hodnoty 1 nebo -1, poté je zde řečen důvod schválení / zamítnutí. flow_id:
NOVY / NEW = 0;
VE VYBERU / IN_SELECTION = 1;
TELEFON / PRE_SCREENING = 3;
POHOVOR / INTERVIEW = 4;
VYBRAN / SELECTED = 5;
PRIJAT / ACCEPTED = 6;
rejected:
0 //not rejected 1 //rejected ### Get Answer Detail [GET] + Parameters + id (required, number, `1`) - Answer id + Response 200 (application/json) { ""payload"": { ""candidate_id"": 1, ""name"": { ""first_name"": ""Michal"", ""last_name"": ""Macinka"", ""initials"": ""MM"" }, ""title"": { ""before"": null, ""after"": null }, ""user_img"": ""http://lide.uhk.cz/fim/student/macinmi1/avatar_2.jpg"", ""email"": null, ""phone"": null, ""sign_job"": { ""job_title"": ""Android Developer"", ""job_source_site"": ""PRACEvCR.cz"" }, ""flow_id"": 4, ""rejected"": false, ""rating"": 4, ""agreement_status"": -1, ""agreement_reason"": ""uchazeč zamítl tuto pozici"", ""interview_date"": ""21.02.17 09:30"", ""date_response"": ""18.02.17 17:31"", ""attachments"": [ { ""url"": ""https://pracevcr.cz/upload/attachments/-/9d2ef6f7cde1ca66dec745f155ec77c6.html"", ""name"": ""Systémový email - profesia.sk"" }, { ""url"": ""https://pracevcr.cz/upload/cv/-/8d66585d613a15c50b4c279043d1af47.pdf"", ""name"": ""PROFESIASKCV2257959sk.pdf"" }, { ""url"": ""https://pracevcr.cz/upload/cv/-/6e8bed5384f4eccf961fcb22cd97c956.txt"", ""name"": ""suhlasosobneudaje.txt"" } ], ""cover_letter"": """" }, ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Candidate with {candidate_id} doesn't exists."" } } ## Modify Answer flow [/answers/{id}/flow/{value}] Modifikuje fázi výběru dané odpovědi. ####Vysvětlění flow hodnot | Flow ID | Vysvětlení | Poznámka | |:-------|----------------------|----------------------| | `0` | Status ""Nový"" | | `1` | Status ""Nepřiřazený"" | | `2` | Status ""Další kolo"" | Toto ID se momentálně nepoužívá | | `3` | Status ""Telefon"" | | `4` | Status ""Pohovor"" | | `5` | Status ""Vybrán"" | | `6` | Status ""Přijat"" | | `8` | Status ""Smazán"" | Toto ID zapřičiní, že daný uchazeč z odpovědi zmizí. | ### Modify Answer Flow [PUT] + Parameters + id (required, number, `1`) - Answer id + value (required, number, `1`) - Flow id : číslo od 0 do 8 + Response 200 (application/json) { ""payload"": null, ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Answer doesnt found."" } } ## Modify Answer rating [/answers/{id}/rating/{value}] Upraví hodnocení dané odpovědi. Hodnota `value` může nabývat hodnot 0 až 5. ### Modify Answer Rating [PUT] + Parameters + id (required, number, `1`) - Answer id + value (required, number, `1`) - Flow id : číslo od 0 do 5 + Response 200 (application/json) { ""payload"": null, ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Answer doesn't found."" } } ## Reject answer [/answers/{id}/reject] Zařadí danou odpověď do odmítnutých ### Reject Answer [PUT] + Parameters + id (required, number, `1`) - Answer id + Response 200 (application/json) { ""payload"": null, ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Answer doesn't found."" } } ## Accept answer [/answers/{id}/reject] Znovu zařadí odpověď mezi aktivní. ### Reject Answer [PUT] + Parameters + id (required, number, `1`) - Answer id + Response 200 (application/json) { ""payload"": null, ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Answer doesn't found."" } } ## Answer Questionaire [/answers/{id}/questionaire] ### Get All Q&A for Specific Answer [GET] + Parameters + id (required, number, `1`) - Answer id + Response 200 (application/json) { ""payload"":[ { ""question"": ""Je něco, co jsme uváděli v inzerátu, že požadujeme a nejste si jistý/á, zda byste to zvládl/a? Do jaké míry?"", ""answer"": null, ""multiple_answers"": [ { ""answer"": ""Ne"", ""selected"": false }, { ""answer"": ""Ano"", ""selected"": true }, { ""answer"": ""Nevím"", ""selected"": false } ] }, { ""question"": ""Odkud jste se o nabídce práce doslechli?"", ""answer"": ""Facebook"", ""multiple_answers"": null }, { ""question"": ""Jaké je Vaše nejvyšší dosažené vzdělání?"", ""answer"": ""VŠ"", ""multiple_answers"": null }, { ""question"": ""Jaká je Vaše představa hrubé mzdy?"", ""answer"": ""25 tisíc"", ""multiple_answers"": null } } ], ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Questionnaire doesn't exists."" } } ## Candidate History [/newsfeed/{?limit,page,candidate_id}] ### Get All History for Specific Candidate [GET] + Parameters + candidate_id (required, number, `1`) - Candidate id + limit (optional,numeric,`10`) - pocet entit, ktere se maji zobrazit + page (optional,numeric,`1`) - strana s vypisem odpovedi + Response 200 (application/json) { ""payload"": { ""newsfeed_id"": ""260824"", ""candidate_id"": ""235616"", ""user_img"": null, ""date_created"": ""2017-08-25 10:58:19"", ""action_content"": ""Byl změněn stav uchazeče Mirek Pílek3 na pre-screening u inzerátu Testovací pozice - Hledáme pracovnici úklidu."", ""icon"": ""icon-directions"", ""attachments"": [], ""personalist"": ""Jiří Landovský"", ""personalist_id"": ""8784"", ""name"": { ""first_name"": ""Jiří"", ""last_name"": ""Landovský"", ""initials"": ""JL"" }, ""title"": { ""before"": null, ""after"": null } }, ""payload_old"": { ""candidate_id"": 1, ""history"": [ { ""history_id"": 1, ""author"": null, ""date_time"": ""21.06.17 14:22"", ""action_type"": ""icon-bubble"", ""action_content"": ""Uchazeč Will Smith byl přidán přes systémový email do inzerátu Pracovník/ce úklidu"" }, { ""history_id"": 2, ""author"": ""Tereza Barková"", ""date_time"": ""21.06.17 14:25"", ""action_type"": ""icon-directions"", ""action_content"": ""Byl změněn stav uchazeče Will Smith na pre-screening u inzerátu Pracovník/ce úklidu."" }, { ""history_id"": 3, ""author"": ""Tereza Barková"", ""date_time"": ""21.06.17 14:31"", ""action_type"": ""icon-briefcase"", ""action_content"": ""Byla naplánovaná schůzka s Will Smith v 20.07.2017 11:00"" }, { ""history_id"": 4, ""author"": ""Tereza Barková"", ""date_time"": ""21.06.17 14:32"", ""action_type"": ""icon-envelope"", ""action_content"": ""Uchazečovi byla odeslána zpráva s pozváním na pohovor."" }, { ""history_id"": 5, ""author"": ""Štěpán Bartyzal"", ""date_time"": ""11.07.17 12:41"", ""action_type"": ""icon-trash"", ""action_content"": ""Uchazeč Will Smith byl odstraněn z inzerátu Pracovník/ce úklidu."" }, { ""history_id"": 6, ""author"": ""Tereza Barková"", ""date_time"": ""11.07.17 14:31"", ""action_type"": ""icon-envelope"", ""action_content"": ""Uchazečovi byla odeslána zpráva \\""Připomenutí nabídky pracovní pozice\\""."" }, { ""history_id"": 7, ""author"": ""Tereza Barková"", ""date_time"": ""11.07.17 14:31"", ""action_type"": ""icon-action-redo"", ""action_content"": ""Uchazeč Will Smith byl přiřazen k inzerátu Testovací pozice - Hledáme pracovnici úklidu. Nyní systém čeká na souhlas se zpracováním osobních údajů."" }, { ""history_id"": 8, ""author"": ""Tereza Barková"", ""date_time"": ""11.07.17 14:31"", ""action_type"": ""icon-user-following"", ""action_content"": ""Personalista manuálně potvrdil schválení osobních údajů pro pozici Testovací pozice - Hledáme pracovnici úklidu"" }, { ""history_id"": 9, ""author"": ""Tereza Barková"", ""date_time"": ""11.07.17 14:39"", ""action_type"": ""icon-action-redo"", ""action_content"": ""Uchazeč Will Smith byl přiřazen k inzerátu Aha. Nyní systém čeká na souhlas se zpracováním osobních údajů."" }, { ""history_id"": 10, ""author"": ""Tereza Barková"", ""date_time"": ""11.07.17 14:39"", ""action_type"": ""icon-envelope"", ""action_content"": ""Uchazečovi byla odeslána zpráva \\""Připomenutí nabídky pracovní pozice\\""."" }, { ""history_id"": 11, ""author"": ""Tereza Barková"", ""date_time"": ""11.07.17 14:41"", ""action_type"": ""fa-tags"", ""action_content"": ""Uchazeči Will Smith byly přidány tyto tagy: oprávnění C."" } ] }, ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Candidate with {candidate_id} doesn't exists."" } } # Group Jobs API calls for actions connected with jobs. ## Jobs Detail [/jobs/{id}] + Parameters + id (optional, number, `1`) - Job id ### Get Jobs Detail [GET] + Response 200 (application/json) { ""payload"": [ { ""job_id"": 123456, ""title"": ""Android Developer"", ""source_site"": ""PRACEvCR.cz"", ""personalist"": ""Tomáš Krátký"", ""date_created"": ""23.03.17 17:42"", ""views"": 92, ""answers"": 8, ""active"": true, ""public_link"": ""http://ceskytrhprace.pracevcr.cz/detail/347677-mamca-s-dusi-personalistky"", ""edit_link"": ""http://pracevcr.cz/zadavatel/inzerat/novy/iid347677/sid07ec2194ec509104427c0a4da7955bc8"" } ], ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Job with {job_id} doesn't exists."" } } ## Jobs Lists [/jobs] ### Get All Jobs [GET] + Response 200 (application/json) { ""payload"": [ { ""job_id"": 123456, ""title"": ""Android Developer"", ""source_site"": ""PRACEvCR.cz"", ""personalist"": ""Tomáš Krátký"", ""date_created"": ""2017-03-23 17:42:10"", ""views"": 92, ""flow_answers"": [ { ""flow"": 0, ""value"": 9 }, { ""flow"": 1, ""value"": 1 }, { ""flow"": 2, ""value"": 0 }, { ""flow"": 3, ""value"": 0 }, { ""flow"": 4, ""value"": 1 }, { ""flow"": 5, ""value"": 0 }, { ""flow"": 6, ""value"": 0 }, { ""flow"": 7, ""value"": 0 }, { ""flow"": 8, ""value"": 0 }, { ""flow"": 9, ""value"": 0 }, { ""flow"": -1, ""value"": 0 } ], ""answers"": 8, ""active"": true, ""channels"": { ""portal"": { ""date_end"": false, ""date_from"": ""2017-06-25 10:20:10"", ""active"": true, ""paused"": false }, ""company_page"": { ""date_end"": ""2017-06-25 10:20:10"", ""date_from"": false, ""paused"": true, ""active"": false }, ""internal"": { ""date_end"": false, ""date_from"": false, ""active"": false, ""paused"": false } } }, { ""job_id"": 123457, ""title"": ""Senior Java Developer"", ""source_site"": ""PRACEvIT.cz"", ""personalist"": ""Jiří Tichý"", ""date_created"": ""2017-02-14 09:30:22"", ""views"": 25, ""flow_answers"": [ { ""flow"": 0, ""value"": 9 }, { ""flow"": 1, ""value"": 1 }, { ""flow"": 2, ""value"": 0 }, { ""flow"": 3, ""value"": 0 }, { ""flow"": 4, ""value"": 1 }, { ""flow"": 5, ""value"": 0 }, { ""flow"": 6, ""value"": 0 }, { ""flow"": 7, ""value"": 0 }, { ""flow"": 8, ""value"": 0 }, { ""flow"": 9, ""value"": 0 }, { ""flow"": -1, ""value"": 0 } ], ""answers"": 4, ""active"": true, ""channels"": { ""portal"": { ""date_end"": false, ""date_from"": ""2017-06-25 10:20:10"", ""active"": true, ""paused"": false }, ""company_page"": { ""date_end"": ""2017-06-25 10:20:10"", ""date_from"": false, ""paused"": true, ""active"": false }, ""internal"": { ""date_end"": false, ""date_from"": false, ""active"": false, ""paused"": false } } }, { ""job_id"": 123458, ""title"": ""Vrchní podavač mýdel a holka pro všechno ve státní věznici"", ""source_site"": ""PRACEvCR.cz"", ""personalist"": ""Jan Andrej Arnošt Dobromír Milič Zátopek"", ""date_created"": ""2017-13-32 25:73:33"", ""views"": 4092, ""flow_answers"": [ { ""flow"": 0, ""value"": 9 }, { ""flow"": 1, ""value"": 1 }, { ""flow"": 2, ""value"": 0 }, { ""flow"": 3, ""value"": 0 }, { ""flow"": 4, ""value"": 1 }, { ""flow"": 5, ""value"": 0 }, { ""flow"": 6, ""value"": 0 }, { ""flow"": 7, ""value"": 0 }, { ""flow"": 8, ""value"": 0 }, { ""flow"": 9, ""value"": 0 }, { ""flow"": -1, ""value"": 0 } ], ""answers"": 886, ""active"": true, ""channels"": { ""portal"": { ""date_end"": false, ""date_from"": ""2017-06-25 10:20:10"", ""active"": true, ""paused"": false }, ""company_page"": { ""date_end"": ""2017-06-25 10:20:10"", ""date_from"": false, ""paused"": true, ""active"": false }, ""internal"": { ""date_end"": false, ""date_from"": false, ""active"": false, ""paused"": false } } } ], ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""The resource you're looking for doesn't exist."" } } # Group Interviews API calls for actions connected with interviews. ## Interviews Lists [/interviews] ### Get All Interviews [GET] + Response 200 (application/json) { ""payload"": [ { ""interview_id"": 1, ""answer_id"": 1 ""candidate_id"": 1, ""name"": { ""first_name"": ""Michal"", ""last_name"": ""Macinka"", ""initials"": ""MM"" }, ""title"": { ""before"": null, ""after"": null }, ""user_img"": ""http://lide.uhk.cz/fim/student/macinmi1/avatar_2.jpg"", ""date_from"": ""21.02.17 09:30"", ""date_to"": ""21.02.17 10:30"", ""personalist"": ""Tomáš Krátký"" }, { ""interview_id"": 2, ""candidate_id"": 2, ""name"": { ""first_name"": ""Věra"", ""last_name"": ""Chládková"", ""initials"": ""VC"" }, ""title"": { ""before"": ""Mgr."", ""after"": null }, ""user_img"": null, ""date_from"": ""17.01.17 11:20"", ""date_to"": ""17.01.17 12:20"", ""personalist"": ""Jana Tučná"" }, { ""interview_id"": 3, ""candidate_id"": 3, ""name"": { ""first_name"": ""Jiří"", ""last_name"": ""Modrý"", ""initials"": ""JM"" }, ""title"": { ""before"": ""Ing."", ""after"": ""Ph.D."" }, ""user_img"": null, ""date_from"": ""10.04.17 07:00"", ""date_to"": ""10.04.17 9:30"", ""personalist"": ""Tomáš Krátký"" } ], ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""The resource you're looking for doesn't exist."" } } # Group Newsfeed API volání, které vrací všechny informace, které se chronologicky staly v systému, popřípade u konkrétního uchazeče. ## News Lists [/newsfeed{?limit,page,candidateid}] ### Get All News / News for certain candidate [GET] + Parameters + limit (optional,numeric,`10`) - pocet entit, ktere se maji zobrazit + page (optional,numeric,`1`) - strana s vypisem odpovedi + candidateid (optional,numeric,`1`) - Vypíše historii akcí jen ke konkrétnímu uchazeči + Response 200 (application/json) { ""payload"": [ ], ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""The resource you're looking for doesn't exist."" } } # Group Miscellaneous ## Send Email Message [/messages/send/email/] ### Send Email [POST] Procedura na poslání emailu danému uchazeči + Request (application/json) { ""jobid"":31116, ""title"":""testovací zpráva"", ""body"":""testuji %OSLOVENI%"", ""recipients"":""251663,251654,111"" } + Response 201 (application/json) { ""payload"": { ""title"": ""Zamítnutí uchazeče"", ""body"": ""Dobrý den, děkujeme Vám za účast ve výběrovém řízení na pozici %INZERAT%, bohužel Vám musíme sdělit, že byl vybrán vhodnější kandidát. Děkujeme za pochopení a přejeme mnoho úspěchů. S pozdravem, %MOJEJMENO% %SPOLECNOST%"" }, ""meta"": { ""duration"": 2259, ""code"": 200, ""message"": """", ""message_localized"": ""Přihlášení proběhlo v pořádku"" } } ## Send SMS Message [/messages/send/sms/] ### Send SMS [POST] Procedura na poslání SMS danému uchazeči. Uchazeč musí mít k sobě přidělen telefonní kontakt. Pokud nemá, funkce vrací + Request (application/json) { ""jobid"":31116, ""body"":""testuji %OSLOVENI%"", ""recipients"":""251663,251654,111"" } + Response 201 (application/json) { ""payload"": { ""body"": ""Dobrý den, děkujeme Vám za účast ve výběrovém řízení na pozici %INZERAT%, bohužel Vám musíme sdělit, že byl vybrán vhodnější kandidát. Děkujeme za pochopení a přejeme mnoho úspěchů. S pozdravem, %MOJEJMENO% %SPOLECNOST%"" }, ""meta"": { ""duration"": 2259, ""code"": 200, ""message"": """", ""message_localized"": """" } } ## Get Email Template [/email/template/email/{id}] ### Get Email template [GET] Volání, které vrátí nejvhodnější šablonu emailu. Pokud si daný uživatel vytvořil svojí, vrátí se mu prioritně ona. + Parameters + id (numeric,`10`) - ID stavu, pro ktere se ma dana sablona vratit + Response 201 (application/json) { ""payload"": { ""title"": ""Zamítnutí uchazeče"", ""body"": ""Dobrý den, děkujeme Vám za účast ve výběrovém řízení na pozici %INZERAT%, bohužel Vám musíme sdělit, že byl vybrán vhodnější kandidát. Děkujeme za pochopení a přejeme mnoho úspěchů. S pozdravem, %MOJEJMENO% %SPOLECNOST%"" }, ""meta"": { ""duration"": 2259, ""code"": 200, ""message"": """", ""message_localized"": """" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""duration"": 39, ""code"": 404, ""message"": """", ""message_localized"": """" } } ## Get SMS Template [/messages/template/sms/{id}] ### Get SMS template [GET] Volání, které vrátí nejvhodnější šablonu pro SMS. Pokud si daný uživatel vytvořil svojí, vrátí se mu prioritně ona. + Parameters + id (numeric,`10`) - ID stavu, pro ktere se ma dana sablona vratit + Response 201 (application/json) { ""payload"": { ""body"": ""Dobrý den, děkujeme Vám za účast ve výběrovém řízení na pozici %INZERAT%, bohužel Vám musíme sdělit, že byl vybrán vhodnější kandidát. Děkujeme za pochopení a přejeme mnoho úspěchů. S pozdravem, %MOJEJMENO% %SPOLECNOST%"" }, ""meta"": { ""duration"": 2259, ""code"": 200, ""message"": """", ""message_localized"": """" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""duration"": 39, ""code"": 404, ""message"": """", ""message_localized"": """" } } ## Comments [/comments/{?id,field,argument}] ### get specifics comments [GET] + Parameters + id (optional, number, `1`) ID konkrétního komentáře. + field (required, string, `applicant`) Místo, ke kterému se komentáře vztahuje. Nyní jsou povoleny dve hodnoty: `applicant` a `offer`. + argument (required, number, `123456`) ID daného `fieldu`: Takže buď ID uchazeče, nebo ID inzerátu + Response 200 (application/json) { ""payload"": [ { ""id"": ""30138"", ""body"": ""gmeaio fjweapi fjweaoif jweaij"", ""author"": ""Štěpán Bartyzal"", ""author_id"": ""8699"", ""date_created"": ""2017-08-28 14:18:24"", ""date_edited"": null, ""tags"": [] }, { ""id"": ""30139"", ""body"": ""faiop fjwepoa fjpweoaj fjpweagpjowejgop"", ""author"": ""Štěpán Bartyzal"", ""author_id"": ""8699"", ""date_created"": ""2017-08-28 14:18:26"", ""date_edited"": null, ""tags"": [] } ], ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Nebyly nalezeny žádné komentáře."" } } ## Jobs Detail [/jobs/{id}/customflow] + Parameters + id (optional, number, `1`) - Job id ### Get Jobs Detail [GET] + Response 200 (application/json) { ""payload"": [ { ""job_id"": 123456, ""title"": ""Testovací inzerát s dynamickým flow"", ""source_site"": ""PRACEvCR.cz"", ""personalist"": ""Michal Macinka"", ""date_created"": ""23.03.17 17:42"", ""views"": 92, ""answers"": 8, ""active"": true, ""public_link"": ""http://ceskytrhprace.pracevcr.cz/detail/347677-mamca-s-dusi-personalistky"", ""edit_link"": ""http://pracevcr.cz/zadavatel/inzerat/novy/iid347677/sid07ec2194ec509104427c0a4da7955bc8"" } ], ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""Job with {job_id} doesn't exists."" } } ## Jobs Lists [/jobs/customflow] ### Get All Jobs [GET] + Response 200 (application/json) { ""payload"": [ { ""job_id"": 123456, ""title"": ""Testovací inzerát s dynamickým flow"", ""source_site"": ""PRACEvCR.cz"", ""personalist"": ""Michal Macinka"", ""date_created"": ""2017-03-23 17:42:10"", ""views"": 92, ""flow_answers"": [ { ""action_id"": 0, ""flow_id"": 40, ""label"": ""nová odpověď"", ""value"": 2 }, { ""action_id"": 1, ""flow_id"": 43, ""label"": ""nerozřazení"", ""value"": 1 }, { ""action_id"": 3, ""flow_id"": 45, ""label"": ""telefon"", ""value"": 2 }, { ""action_id"": 4, ""flow_id"": 47, ""label"": ""1. pohovor"", ""value"": 3 }, { ""action_id"": 4, ""flow_id"": 48, ""label"": ""2. pohovor"", ""value"": 4 }, { ""action_id"": 6, ""flow_id"": 49, ""label"": ""přijatí"", ""value"": 4 }, { ""action_id"": -1, ""flow_id"": 50, ""label"": ""zamítnutí"", ""value"": 3 } ], ""answers"": 8, ""active"": true, ""channels"": { ""portal"": { ""date_end"": false, ""date_from"": ""2017-06-25 10:20:10"", ""active"": true, ""paused"": false }, ""company_page"": { ""date_end"": ""2017-06-25 10:20:10"", ""date_from"": false, ""paused"": true, ""active"": false }, ""internal"": { ""date_end"": false, ""date_from"": false, ""active"": false, ""paused"": false } } } ], ""meta"": { ""code"": 200, ""message"": ""OK"" } } + Response 404 (application/json) { ""payload"": null, ""meta"": { ""code"": 404, ""message"": ""The resource you're looking for doesn't exist."" } }",12178,False,2382.3944160244164,median ":Class vecdb ⍝ Dyalog APL vector database - see https://github.com/Dyalog/vecdb (⎕IO ⎕ML)←1 1 :Section Constants :Field Public Shared Version←'0.2.6' ⍝ Parallel DB :Field Public Shared TypeNames←,¨'I1' 'I2' 'I4' 'F' 'B' 'C' ⍝ To come: C4=323 indexed chars ⍝ Tn=Fixed with text (no index table) :Field Public Shared TypeNums←83 163 323 645 11 163 :Field Public Shared SummaryFns←'sum' 'max' 'min' 'count' :Field Public Shared CalcFns←,⊂'map' :Field Public Shared SummaryAPLFns←'+/' '⌈/' '⌊/' '≢' :Field Public Shared ReSummaryAPLFns←'+/' '⌈/' '⌊/' '+/' :EndSection ⍝ Constants :Section Instance Fields ⍝ The fact that these are public does not mean it is safe to change them :Field Public Name←'' :Field Public Folder←'' ⍝ Where is it :Field Public BlockSize←100000 ⍝ Small while we test (must be multiple of 8) :Field Public NumBlocks←1 ⍝ We start with one block :Field Public noFiles←0 ⍝ in-memory database (not supported) :Field Public isOpen←0 ⍝ Not yet open :Field Public ShardFolders←⍬ ⍝ List of Shard Folders :Field Public LocalFolders←⍬ ⍝ Shard Folders as seen by slave task :Field Public ShardFn←⍬ ⍝ Shard Calculation Function :Field Public ShardCols←⍬ ⍝ ShardFn input column indices :Field Public ShardSelected←⍬ ⍝ Shards selected :Field Private AllShards←0 ⍝ Are all Shards in use? :Field _Columns←⍬ :Field _Types←⍬ :Field _Count←⍬ :EndSection ⍝ Instance Fields fileprops←'Name' 'BlockSize' ⍝ To go in comp 4 of meta.vecdb eis←{(≡⍵)∊0 1:⊂,⍵ ⋄ ⍵} ⍝ enclose if simple sizeOf←{(size dr)←⍵ ⋄⌈size×8÷⍨⌊dr÷10} ⍝ size in bytes of ⍵[1] elements of type ⍵[2] :Section Properties :Property Columns :Access Public ∇ r←get r←_Columns,_CalcCols ∇ :EndProperty :Property Types :Access public ∇ r←get r←_Types,_CalcTypes ∇ :EndProperty :Property Count :Access public ∇ r←get r←⊃⊃+/_Counts[ShardSelected].counter ∇ :EndProperty :EndSection ⍝ Properties ∇ Open(folder) :Implements Constructor :Access Public OpenFull(folder ⍬) ⍝ Open all shards ∇ ∇ InitCalcs tn;i;calc;spec;space;inv ⍝ Extract calculation data from meta file :If 8=2⊃⎕FSIZE tn ⍝ If File format pre-dates calculated columns 'unused'∆FAPPEND tn ⍝ 8 'unused'∆FAPPEND tn ⍝ 9 (⍬ ⍬ ⍬)∆FAPPEND tn ⍝ 10 Calc Col Names, Source Columns, Data Type :EndIf (_CalcCols _CalcSources _CalcTypes)←⎕FREAD tn,10 ⍝ Calculated column definitions mappings,←⎕NS¨(≢_CalcCols)⍴⊂'' ⍝ Add mappings :For i :In ⍳≢_CalcCols ⍝ Run setup for each calculated coumn space←(i+≢_Columns)⊃mappings (calc spec inv)←⎕FREAD tn,10+i :If '{'=⊃calc ⍝ User-defined space.Type←2 ⍝ Calculation space.Spec←spec ⍝ Store data space⍎'Calc←',calc ⍝ Define function :If 0≠⍴inv ⋄ space⍎'CalcInv←',inv ⋄ :EndIf ⍝ Define inverse :Else ⍎'(i⊃_CalcCols) ',calc,'_Setup spec' :EndIf :EndFor ∇ ∇ name map_Setup(from to);cix;six;i;n;src;m;col;symbol;char;calcix ⍝ Setup for a ""mapped"" column (cix six)←Columns⍳(⊂name),_CalcSources[calcix←_CalcCols⍳⊂name] (col src)←mappings[cix six] :If (,'C')≡cix⊃Types ⍝ Special case char :AndIf (from≡⍳≢from)∨char←(,'C')≡six⊃Types ⍝ char-char or ""direct"" map :If char symbol←src.symbol ⍝ source symbols m←(≢from)≥i←from⍳symbol ⍝ mappable symbols (m/symbol)←to[m/i] ⍝ remap :Else symbol←to :EndIf col.file←0 ⍝ there is no symbol file col.Type←1 ⍝ Symbol col.symbol←symbol ⍝ Store symbol list col.(SymbolIndex←symbol∘⍳) ⍝ Create lookup function col.Source←six ⍝ Store the source column :Else col.Type←2 ⍝ Calc/CalcInv col.(to from)←to from col.(SymbolIndex←from∘⍳) col.(TargetIndex←to∘⍳) col.(Calc←to∘{⍺⌷⍨⊂SymbolIndex ⍵}) col.(CalcInv←from∘{⍺⌷⍨⊂TargetIndex ⍵}) :EndIf ∇ ∇ r←AddCalc spec;name;source;type;calc;file;tn;i;inv :Access Public 'not allowed unless all shards are open'⎕SIGNAL AllShards↓11 (name source type calc spec inv)←6↑,¨spec,⍬ ⍬ ⍬ 'unknown source column'⎕SIGNAL((⊂source)∊_Columns)↓11 'unknown data type'⎕SIGNAL((⊂type)∊TypeNames)↓11 :If '{'≠1⊃calc :Select calc :Case 'map' :If 2≠⍴spec :OrIf ≢/≢¨spec 'map source and target must have the same length'⎕SIGNAL 11 :EndIf :Else ('Unknown standard calculation: ',calc)⎕SIGNAL 11 :EndSelect :EndIf file←Folder,'meta.vecdb' ⎕FHOLD tn←file ⎕FSTIE 0 (_CalcCols _CalcSources _CalcTypes)←⎕FREAD tn,10 ⍝ Calculated column definitions :If (≢_CalcCols)≥i←_CalcCols⍳⊂name ⍝ Existing source? (i⊃_CalcSources)←source (i⊃_CalcTypes)←type (_CalcCols _CalcSources _CalcTypes)⎕FREPLACE tn,10 (calc spec inv)⎕FREPLACE tn,10+i :Else ⍝ New source ((_CalcCols _CalcSources _CalcTypes),∘⊂¨name source type)⎕FREPLACE tn,10 :If (10+i)=2⊃⎕FSIZE tn ⍝ Append or replace? (calc spec inv)⎕FAPPEND tn :Else ⋄ (calc spec inv)⎕FREPLACE tn,10+i :EndIf :EndIf InitCalcs tn ⍝ re-read all from file (optimise later if necessary) ⎕FUNTIE tn ⍝ Also unholds it ∇ ∇ r←RemoveCalc name;file;tn;m;i;cn :Access Public 'not allowed unless all shards are open'⎕SIGNAL AllShards↓11 'calc not found'⎕SIGNAL((⊂name)∊_CalcCols)↓11 file←Folder,'meta.vecdb' ⎕FHOLD tn←file ⎕FSTIE 0 (_CalcCols _CalcSources _CalcTypes)←⎕FREAD tn,10 ⍝ Calculated column definitions i←(m←~_CalcCols∊⊂name)⍳0 (m∘/¨_CalcCols _CalcSources _CalcTypes)⎕FREPLACE tn,10 :For cn :In ⌽i↓10+⍳≢_CalcCols (⎕FREAD tn,cn)⎕FREPLACE tn,cn-1 ⍝ Copy following specs down :EndFor :If (11+≢_CalcCols)=2⊃⎕FSIZE tn ⍝ Did we stop using the last component? ⎕FDROP tn,¯1 :EndIf InitCalcs tn ⍝ re-read all from file (optimise later if necessary) ⎕FUNTIE tn ⍝ Also unholds it ∇ ∇ r←Calc(name data);i;ns;cix;src;col :Access Public 'calculation not found'⎕SIGNAL((≢_CalcCols)≢columns)⍴11 'Column types and names do not have same length'⎕SIGNAL((≢columns)≠≢types)⍴11 'Invalid column types - see vecdb.TypeNames'⎕SIGNAL(∧/types∊TypeNames)↓11 'Column(s) already exist'⎕SIGNAL(∨/columns∊_Columns)⍴11 :If 0=≢data ⋄ data←(≢columns)⍴⊂⍬ ⋄ :EndIf ⍝ Default data is all zeros 'Data lengths not all the same'⎕SIGNAL(1≠≢length←∪≢¨data)/11 folder,←((¯1↑folder)∊'/\\')↓'/' ⍝ make sure we have trailing separator metafile←folder,'meta.vecdb' :If create ⍝ We are CREATEing a database :If Exists ¯1↓folder ⍝ Folder already exists ('""',metafile,'"" already exists')⎕SIGNAL(Exists metafile)/11 :Else ⍝ Folder does not exist :Trap 0 ⋄ MkDir ¯1↓folder :Else ⋄ ⎕DMX.EM ⎕SIGNAL ⎕DMX.EN :EndTrap :EndIf ProcessOptions options ⍝ Sets global fields 'Block size must be a multiple of 8'⎕SIGNAL(0≠8|BlockSize)/11 ⍝ Set defaults for sharding (1 shard) ShardFolders,←(0=⍴ShardFolders)/⊂folder ShardFolders←AddSlash¨ShardFolders :If 0=⎕NC 'LocalFolders' ⋄ LocalFolders←ShardFolders ⋄ :EndIf LocalFolders←AddSlash¨LocalFolders shardfolders←ShardFolders ⍝ When creating we have the full view ShardCols←,ShardCols :If 0≠⍴ShardFn ⋄ findshard←⍎ShardFn ⋄ :EndIf ⍝ Define shard calculation function (Name _Columns _Types)←name columns types ⍝ Set Class fields mappings←⎕NS¨(≢_Columns)⍴⊂'' :Else ⍝ We are adding columns to an open database (_Columns _Types)←(_Columns _Types),¨columns types ⍝ Extend Class fields mappings,←⎕NS¨(≢columns)⍴⊂'' :EndIf newcols←(-≢columns)↑⍳≢_Columns ⍝ Indices of new coulumns newchars←'C'=⊃¨_Types[newcols] ⍝ /// Should really be driven off mappings.Type=1 in the future :For i :In newchars/newcols ⍝ Create symbol files for CHAR fields col←i⊃mappings dix←newcols⍳i ⍝ data index col.symbol←{⍵[∪⍳⍨↑⍵]}dix⊃data ⍝ Unique symbols in input data col.file←folder,(⍕i),'.symbol' ⍝ Symbol file name in main folder col.symbol PutSymbols col.file ⍝ Read symbols col.(SymbolIndex←symbol∘⍳) ⍝ Create lookup function (dix⊃data)←col.SymbolIndex dix⊃data ⍝ Convert indices :EndFor :If create (shards data)←newcols ShardData data ⍝ NB data has one COLUMN per shard data←data,⊂⍬ :Else ⍝ adding columns shards←⍳≢Shards data←((≢newcols),≢shards)⍴⊂⍬ ⍝ No data provided when adding cols :EndIf :For f :In ⍳≢ShardFolders 3 ⎕MKDIR sf←f⊃ShardFolders d←data[;shards⍳f] ⍝ extract records for one shard :If create n←≢⊃d :Else n←f⊃_Counts.counter :EndIf size←BlockSize×1⌈⌈n÷BlockSize ⍝ At least one block :If create ⍝ # of records in the shard tn←(sf,'counters.vecdb')⎕NCREATE 0 n ⎕NAPPEND tn 645 ⍝ Record the number of records as a FLOAT ⎕NUNTIE tn :EndIf :For i :In newcols ⍝ For each column being added ai3←⎕AI[3] dr←(TypeNames⍳_Types[i])⊃TypeNums tn←(filename←sf,(⍕i),'.vector')⎕NCREATE 0 (sizeOf size dr)⎕NRESIZE tn ⎕NUNTIE tn :If 0≠≢⊃d ⍝ if there is some data to write temp←dr ¯1 ⎕MAP filename'W' temp[]←size↑(newcols⍳i)⊃d ⎕EX'temp' :EndIf ⍝ 'col ',(⍕i),': ',⍕⎕ai[3]-ai3 :EndFor :EndFor :If create tn←metafile (⎕FCREATE⍠3) 0 ('vecdb ',Version)∆FAPPEND tn ⍝ 1 'See github.com/Dyalog/vecdb/doc/Implementation.md'∆FAPPEND tn ⍝ 2 'unused'∆FAPPEND tn ⍝ 3 (fileprops(⍎¨fileprops))∆FAPPEND tn ⍝ 4 (Name BlockSize) (_Columns _Types)∆FAPPEND tn ⍝ 5 ((2,≢ShardFolders)⍴ShardFolders,LocalFolders) ∆FAPPEND tn ⍝ 6 (ShardFn ShardCols)∆FAPPEND tn ⍝ 7 'unused'∆FAPPEND tn ⍝ 8 'unused'∆FAPPEND tn ⍝ 9 (⍬ ⍬ ⍬)∆FAPPEND tn ⍝ 10 Calc Col Names, Source Columns, Data Type :Else ⍝ Extending tn←metafile ⎕FTIE 0 (_Columns _Types)⎕FREPLACE tn 5 :EndIf ⎕FUNTIE tn ∇ ∇X ∆FAPPEND Y ⍝ Work-around for Samba on Mac X ⎕FAPPEND Y ⎕FUNTIE ⍬ ∇ ∇ (shards data)←cix ShardData data;six;s;char;rawdata;sym;c;counts;m ⍝ Shards is a vector of shards to be updated ⍝ data has one column per shard, and one row per column :If 0=≢⊃rawdata←data shards←⍬ ⋄ data←0/⍪data →0 :EndIf :If 1=≢shardfolders ⍝ Data will necessarily all be in the 1st shard then! shards←,1 ⋄ data←⍪data :Else ⍝ Database *is* sharded :If (≢cix)∨.≡cols ⋄ cols←,⊂,cols ⋄ :EndIf ⍝ Enclose if simple p←p×(≢¨cols)≥p←cols⍳¨' ' ⍝ position of separator summary←(0⌈p-1)↑¨cols colnames←p↓¨cols :EndIf ∇ ∇ {r}←AddColumns(columns types);z :Access Public 'not allowed unless all shards are open'⎕SIGNAL AllShards↓11 1 CreateOrExtend Name Folder columns types''⍬ z←Close ⋄ Open,⊂Folder ⍝ Reopen - might want to optimise this later? r←⍬ ∇ ∇ {r}←RemoveColumns columns;tn;keep;metafile;f;c;colix;file;sf;m;sym :Access Public 'not allowed unless all shards are open'⎕SIGNAL AllShards↓11 :If ∨/m←~columns∊_Columns ('Columns not found:',⍕m/columns)⎕SIGNAL 11 :EndIf 'Cannot remove sharding columns'⎕SIGNAL(∨/columns∊_Columns[ShardCols])⍴11 'Cannot remove all columns'⎕SIGNAL(∧/_Columns∊columns)⍴11 keep←~_Columns∊columns ⎕EX'Shards' ⍝ We will reopen the file at the end, need to remove maps :For f :In ⍳≢shardfolders colix←1 sf←f⊃shardfolders :For c :In ⍳≢_Columns tn←(file←sf,(⍕c),'.vector')⎕NTIE 0 sym←{22::0 ⋄ (Folder,(⍕c),'.symbol')⎕NTIE ⍵}0 :If c⊃keep ⍝ keeping this column :If c≠colix ⍝ needs renaming (sf,(⍕colix),'.vector')⎕NRENAME tn :If (f=1)∧sym≠0 (Folder,(⍕colix),'.symbol')⎕NRENAME sym :EndIf :EndIf colix+←1 :Else ⍝ erasing this column file ⎕NERASE tn :If (f=1)∧sym≠0 (Folder,(⍕c),'.symbol')⎕NERASE sym :EndIf :EndIf ⎕NUNTIE ⎕NNUMS∩tn,sym :EndFor :EndFor (_Columns _Types)←keep∘/¨_Columns _Types metafile←Folder,'meta.vecdb' tn←metafile ⎕FTIE 0 (_Columns _Types)⎕FREPLACE tn 5 ⎕FUNTIE tn {}Close ⋄ Open,⊂Folder ⍝ Reopen r←⍬ ∇ ∇ r←Query args;where;cols;groupby;col;value;ix;j;s;count;Data;Cols;summary;m;i;f;cix;calc;mapped;c;columns;map :Access Public (where cols groupby)←3↑args,(≢args)↓⍬ ⍬ ⍬ cols←(0≠≢cols)/,,¨eis cols columns←Columns :If 2=≢where ⋄ :AndIf where[1]∊columns ⍝ just a single constraint? where←,⊂where :EndIf (summary cols)←ParseSummary cols 'UNKNOWN SUMMARY FUNCTION'⎕SIGNAL(∧/summary∊SummaryFns,⊂'')↓11 :If 0≠≢groupby ⍝ We are grouping :If 1=≡groupby ⋄ groupby←,⊂groupby ⋄ :EndIf ⍝ Enclose if simple m←(0≠≢¨summary)∨cols∊groupby ⍝ summary or one of the grouping cols? 'ONLY SUMMARIZED COLUMNS MAY BE SELECTED WHEN GROUPING'⎕SIGNAL(∧/m)↓11 :EndIf r←0 2⍴0 ⍝ (shard indices) :For s :In ShardSelected Cols←s⊃Shards count←⊃(s⊃_Counts).counter ix←⎕NULL :For (col value) :In where ⍝ AND them all together :If (≢columns) records selected blksize←numrecs←≢indices :EndIf split←0 ⍝ We did it all at once :Repeat :Trap 1 ⍝ WS FULL recs←blksize⌊numrecs-offset :If indices≡⎕NULL ⍝ All records still selected data←offset((s⊃Shards)[allix].{⍵↑⍺↓vector})recs :Else data←(s⊃Shards)[allix].{vector[⍵]}⊂recs↑offset↓indices :EndIf :For c :In calccols ⍝ /// equivalent code exists in Read: refactor someday? (c⊃data)←mappings[(≢_Columns)+calcix[c]].Calc c⊃data :EndFor r⍪←data[groupix]groupfn data[colix] offset+←blksize ⎕EX'data' :Else ⍝ Got a WS FULL split←1 ⍝ We had to go around again blksize←blksize(⌈÷)2 ⎕←(⍕⎕AI[3]),': block size reduced: ',⍕blksize :If blksize<100000 ∘∘∘ :EndIf :EndTrap :Until offset≥numrecs :If split ⍝ re-summarize partial results r←(↓⍉r[;groupix])regroupfn↓⍉r[;colix] :EndIf :EndFor :If 1<≢ix ⍝ re-summarize partial results r←(↓⍉r[;groupix])regroupfn↓⍉r[;colix] :EndIf :For char :In {⍵/⍳⍴⍵}'C'=⊃¨Types[(≢groupby)↑allix] ⍝ Symbol Group By cols r[;char]←mappings[allix[char]].{symbol[⍵]}r[;char] :EndFor ∇ ∇ r←Read(ix cols);char;m;num;cix;s;indices;t;calcix;calccols;c;nss;six;tix ⍝ Read specified indices of named columns :Access Public :If 1=⍴⍴ix ⋄ ix←1,⍪⊂ix ⋄ :EndIf ⍝ Single Shard? :If 1=≡cols ⋄ cols←,⊂cols ⋄ :EndIf ⍝ Single simple column name ⎕SIGNAL/ValidateColumns cols tix←six←cix←Columns⍳cols :If 0≠⍴calccols←((≢_CalcCols)≥calcix←_CalcCols⍳cols)/⍳⍴cols six[calccols]←_Columns⍳_CalcSources[calcix[calccols]] ⍝ source columns for calculated cols :EndIf r←(⍴cix)⍴⊂⍬ 'Data found in unopened shard!'⎕SIGNAL(∧/ix[;1]∊ShardSelected)↓11 :For (s indices) :In ↓ix :If indices≡⎕NULL ⋄ r←r,¨(s⊃_Counts).counter↑¨(s⊃Shards)[six].vector :Else ⋄ r←r,¨(s⊃Shards)[six].{vector[⍵]}⊂indices ⋄ :EndIf :EndFor :If 0≠⍴char←{⍵/⍳≢⍵}'C'=⊃¨Types[cix] ⍝ Symbol transation :AndIf 0≠⍴char←(m←2=⊃¨(nss←mappings[cix[char]]).⎕NC⊂'symbol')/char r[char]←(m/nss).{symbol[⍵]}r[char] :EndIf :For c :In calccols~char ⍝ Exclude char-char maps handled above (c⊃r)←mappings[cix[c]].Calc c⊃r :EndFor ∇ ∇ r←ValidateColumns cols;bad ⍝ Return result suitable for ⎕SIGNAL/ r←''⍬ :If ~0∊⍴bad←cols~Columns r←('Unknown Column Names:',,⍕bad)11 :EndIf ∇ ∇ r←Append(cols data);length;canupdate;shards;s;growth;tn;cix;count;i;append;Cols;size;d;n :Access Public 'Data lengths not all the same'⎕SIGNAL(1≠≢length←∪≢¨data)/11 'Col and Data counts not the same'⎕SIGNAL((≢cols)≠≢data)/11 ⎕SIGNAL/ValidateColumns cols cix←_Columns⍳cols data←cix IndexSymbols data ⍝ Char to Symbol indices (shards data)←(⍳≢_Columns)ShardData data 'data may only be appended to opened shards'⎕SIGNAL(∧/shards∊ShardSelected)↓11 :For s :In shards d←data[;shards⍳s] length←≢⊃d ⍝ # records to be written to *this* Shard Cols←s⊃Shards ⍝ Mapped columns in this Shard count←⊃(s⊃_Counts).counter ⍝ Active records in this Shard size←≢Cols[⊃cix].vector ⍝ Current Shard allocation :If 0≠canupdate←length⌊size-count ⍝ Updates to existing maps i←⊂count+⍳canupdate i(Cols[cix]).{vector[⍺]←⍵}canupdate↑¨d :EndIf :If length>canupdate ⍝ We need to extend the file append←(≢_Columns)⍴⊂⍬ append[cix]←canupdate↓¨d ⍝ Data which was not updated growth←BlockSize×(length-canupdate)(⌈÷)BlockSize ⍝ How many records to add to the Shard ExtendShard(s⊃shardfolders)Cols growth append :EndIf _Counts[s].counter[1]←count+length ⍝ Update (mapped) counter :EndFor r←0 ∇ ∇ {r}←Update(ix cols data);cix;indices;s;p;i :Access Public :If 1=≡cols ⋄ (cols data)←,∘⊂¨cols data ⋄ :EndIf ⍝ Simple col name ⎕SIGNAL/ValidateColumns cols cix←Columns⍳cols 'Cannot update Sharding Cols'⎕SIGNAL(cix∊ShardCols)/11 data←cix IndexSymbols data :If 1=≢ix ⋄ data←⍪data ⍝ One shard :Else ⍝ Partition data by Shard p←(≢⊃data)⍴0 ⋄ p[+\\1,≢¨¯1↓ix[;2]]←1 data←↑p∘⊂¨data :EndIf 'data must be in opened shards!'⎕SIGNAL(∧/ix[;1]∊ShardSelected)↓11 :For i :In ⍳≢ix ⍝ Each shard (s indices)←ix[i;] (⊂indices)((s⊃Shards)[cix]).{vector[⍺]←⍵}data[;i] :EndFor r←0 ∇ ∇ r←Delete folder;file;tn;folders;files;f;shards :Access Public Shared ⍝ Erase a vecdb file without opening it first (it might be too damaged to open) ⍝ Does check whether there is a meta file in the folder ⍝ Also deletes folder←AddSlash folder 'Folder not found'⎕SIGNAL(DirExists folder)↓22 ⍝ Not there 'Not a vecdb'⎕SIGNAL(Exists file←folder,'meta.vecdb')↓22 ⍝ Paranoia tn←file ⎕FTIE 0 folders←(⎕FREAD tn 6),⊂folder ⍝ shards first file ⎕FERASE tn :For folder :In folders :If isWindows ⎕CMD'rmdir ""',folder,'"" /s /q' :Else 1 _SH'rm -r ',folder :EndIf :EndFor r←~DirExists folder ∇ ∇ r←Erase :Access Public ⍝ /// needs error trapping 'all shards must be open'⎕SIGNAL AllShards↓11 'vecdb is not open'⎕SIGNAL isOpen↓11 {}Close {}Delete Folder r←0 ∇ ∇ ix←ns SymbolUpdate values;m ⍝ Convert values to symbol indices, and update the file if necessary :If ∨/m←(≢ns.symbol)/dev/null' :Else ('shell command failed: ',cmd)⎕SIGNAL 11/⍨~suppress :EndTrap ∇ ∇ r←APLVersion :Select 3↑⊃'.'⎕WG'APLVersion' :CaseList 'Lin' 'AIX' 'Sol' r←'*nix' :Case 'Win' r←'Win' :Case 'Mac' r←'Mac' :Else ... ⍝ unknown version :EndSelect ∇ :EndSection ⍝ Files :EndClass ⍝)(!Delete!!0 0 0 0 0 0 0!0 ",12422,True,2586.010858974667,median "(* MacDisplaySettings.applescript Denis G. Pelli, denis.pelli@nyu.edu May 24, 2021. INTRODUCTION This applescript run handler allows you read and set seven parameters in the macOS System Preferences Displays panel: Brightness (slider), ""Automatically adjust brightness"" (checkbox), True Tone (checkbox) (present only on some Macs made in 2018 or later), Night Shift (pop up and checkbox), Color Profile (by name or row number), and the ""Show Profiles For This Display Only"" checkbox. Apple invites users to use these parameters to personally customize their experience by enabling dynamic adjustments of all displayed images in response to personal preference, ambient lighting, and time of day. Users seem to like that, but those adjustments could defeat an experimenter's efforts to calibrate the display one day and, at a later date, use the calibrations to reliably present an accurately specified stimulus. MacDisplaySettings aims to satisfy everyone, by allowing your calibration and test programs to use the computer in a fixed state, unaffected by user whims, ambient lighting, and time of day, while saving and restoring whatever custom states the users have customized it to. MacDisplaySettings reports and controls these seven settings. It allows you to read their current states, set them to standard values for your critical work, and, when you're done, restore them whatever the values were before the experiment. I wrote this script to be invoked from MATLAB, but you could call it from any application running under macOS. To support an external monitor the caller must provide the global rect of the external screen; that's not necessary for the main screen. MacDisplaySettings allows you to temporarily override any macOS user customization of the display, to allow calibration and user testing with stable display settings. It allows you to peek and poke seven settings in the System Preferences:Displays panel by using the corresponding fields in the oldXXX and newXXX arguments, where XXX is as follows: DISPLAY brightness the Brightness slider automatically the ""Automatically adjust brightness"" checkbox (true or false) trueTone the ""True Tone"" checkbox (true or false) NIGHT SHIFT nightShiftSchedule the Night Shift Schedule pop up menu ('Off','Custom', or 'Sunset to Sunrise') nightShiftManual the Night Shift Manual checkbox (true or false) COLOR showProfilesForThisDisplayOnly the checkbox (true or false) profile name of selection in Color Profile menu (text) profileRow row # of selection in Color Profile menu (integer) profileFilename name of file inside folder iccroot(). INPUT ARGS: The screenNumber, if provided, must be an integer of an available screen, i.e. one of the values returned by Screen('Screens'). If newProfileRow is specified then newProfile is ignored. True Tone is not available on Macs manufactured before 2018. OUTPUT ARGS: The variables oldXXX (where XXX stands for any of the fields listed above) report the prior state of all available parameters. errorMsgFinal is the last output argument. If everything worked then errorMsgFinal is an empty string. Otherwise it will describe one failure, even if there were several. In peeking, the fields corresponding to parameters that could not be read will be empty [], and is not flagged as an error. Any omission in poking is flagged as an error. If you get an error while poking, you might call MacDisplaySettings again to compare the new peek with what you poked. SCREENNUMBER (AND GLOBAL RECT): We endeavor to interpret screenNumber in the same way as Psychtoolbox Screen does (0 for main screen, 1 for first external monitor, etc.). To achieve this we request the global rect of the desired monitor as 4 input arguments. We anticipate that the rect will be provided by Screen('GlobalRect',screenNumber). We use this rect to select whichever window of System Preferences: Displays is on the desired monitor. This is reliable, provided the user does not move those windows to different screens. This applescript code works with whichever Displays window is currently on the desired monitor. (If there are several, it will arbitrarily pick one.) BRIGHTNESS is a slider on the Displays panel, allowing users to easily adjust the ""Brightness"" of Apple Macintosh displays. Setting this parameter is equivalent to manually opening the System Preference:Displays and adjusting the ""brightnes"" slider. The ""brightness"" setting controls the luminance of the fluorescent light that is behind the liquid crystal display. I believe that this ""brightness"" setting controls only the luminance of the source, and does not affect the liquid crystal display. The screen luminance is presumably the product of the two factors: luminance of the source and transmission of the liquid crystal, at each wavelength. AUTOMATICALLY is a checkbox on the Displays panel. When enabled, the macOS adjusts the display luminance to track ambient lighting. I find that pleasant as a user, but it ruins my attempts to calibrate. TRUE TONE checkbox on the Displays panel. NIGHT SHIFT panel has a ""Schedule"" pop-up menu and a ""Manual"" checkbox. DISPLAY PROFILE is a menu of named profiles on the ""Color"" panel. Most of these controls don't interact. However, showProfilesForThisDisplayOnly affects the choices available for selecting a Profile. When you call MacDisplaySettings with a setting for showProfilesForThisDisplayOnly, that setting is applied before it peeks or pokes the Profile selection. ERROR CHECKING. Most of the controls are straightforward. You are just peeking and poking a Boolean (0 or 1) or a small integer with a known range. Brightness and Profile are more subtle, so MacDisplaySettings always checks by peeking immediately after poking Brightness (float) or Profile (whether by name or by row). A discrepancy will be flagged by a string in errorMsgFinal. Note that you provide a float to Brightness but within macOS it's quantized to roughly 18-bit precision. The peek of Brightness is considered erroneous only if it differes by more than 0.001 from what we poked. FOR SPEED WE LEAVE SYSTEM PREFERENCES OPEN: This script uses the System Preferences app, which takes 30 s to open, if it isn't already open, so we leave it open. All returned values are empty [] if your application (e.g. MATLAB) does not have permission to control your computer (see APPLE SECURITY below). In MATLAB, you should call MacDisplaySettings.m, which calls this applescript: oldSettings=MacDisplaySettings(screenNumber,newSettings); To call this applescript directly from MATLAB: [status, errorMsgFinal, oldBrightness, oldAutomatically, oldTrueTone, ... oldNightSchedule, oldNightShiftManual, oldProfileRow, oldProfile] ... = ... system(['osascript MacDisplaySettings.applescript ' ... num2str(screenNumber) ' '... num2str(newBrightness) ' ' ... num2str(newAutomatically) ' '... num2str(newTrueTone) ' '... num2str(newNightShiftSchedule) ' ' ... num2str(ewNightShiftManual) ' '... num2str(newShowProfilesForThisDisplayOnly) ' '... num2str(newProfileRow) ' ' ... '""' newProfile '""']); Calling from any other language is very similar. Ignore the returned ""status"", which seems to always be zero. COMPATIBILITY: macOS VERSION: Works on macOS Big Sur (11.3) and earlier. Tested on Mavericks, Yosemite, El Capitan, Mojave, Catalina, and Big Sur (all major macOS versions from 10.9 to 11.3). Not tested on macOS prior to 10.9. INTERNATIONAL: It is designed (but not yet tested) to work internationally, with macOS localized for any language, not just English. (For example, that is why we select the Display/Colors panel by the internal name ""displaysDisplayTab"" instead using the localized name ""Display"".) MULTIPLE SCREENS: Coded to support multiple screens, but not yet tested with values of screenNumber other than zero. APPLE PRIVACY. Unless the application (e.g. MATLAB) has the needed user-granted permissions to control the computer, attempts by MacDisplaySettings to change settings will be blocked by the macOS. The needed permissions include Accessibility, Full Disk Access, and Automation, all in System Preferences: Security & Privacy: Privacy. Here are Apple pages on privacy in general, and accessibility in particular: https://support.apple.com/guide/mac-help/change-privacy-preferences-on-mac-mh32356/mac https://support.apple.com/guide/mac-help/allow-accessibility-apps-to-access-your-mac-mh43185/mac New versions of macOS may demand more permissions. In some cases MacDisplaySettings will detect the missing permission, open the appropriate Security and Privacy System Preference panel, and provide an error dialog window asking the user to provide the permission. In other cases MacDisplaySettings merely prints the macOS error message. The granting of permission needs to be done only once for your specific MATLAB app. When you upgrade MATLAB it typically has a new name, and will be treated as a new app, requiring newly granted permissions. Only users with administation privileges can grant permission. When you grant permission, sometimes the macOS doesn't seem to notice right away, and keeps claiming MATLAB lacks permission. It may help to restart MATLAB or reboot. Psychtoolbox Screen.mex. Screen(... 'Brightness'): The Psychtoolbox for MATLAB and macOS has a Screen call to get and set the brightness. THANKS to Mario Kleiner for explaining how macOS ""brightness"" works. Thanks to nick.peatfield@gmail.com for sharing his applescript code for dimmer.scpt and brighter.scpt. SEE ALSO: Script Debugger app from Late Night Software. https://latenightsw.com/ UI Browser app from UI Browser by PFiddlesoft. https://pfiddlesoft.com/uibrowser/ ScriptingAllowed.applescript (http://psych.nyu.edu/pelli/software.html) The Psychtoolbox call to get and set the Macintosh brightness: [oldBrightness]=Screen('ConfigureDisplay','Brightness', ...); http://www.manpagez.com/man/1/osascript/ https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html https://discussions.apple.com/thread/6418291 https://stackoverflow.com/questions/13415994/how-to-get-the-number-of-items-in-a-pop-up-menu-without-opening-it-using-applesc HISTORY May 21, 2015. Wrote AutoBrightness to control the ""Automatically adjust brightness"" checkbox of the Displays panel. May 29, 2015 Enhanced to allow specification of screenNumber. June 1, 2015. Polished the comments. July 25, 2015 Previously worked on Mavericks (macOS 10.9). Now enhanced to also support Yosemite (macOS 10.10.4). August 3, 2015 Now uses try-blocks to try first group 1 and then group 2 to cope with variations in Apple's macOS. I find that under macOS 10.9 the checkbox is always in group 1. Under macOS 10.10 I have previously found it in group 2, but now I find it in group 1, so it seems best for the program to keep trying groups until it finds the checkbox: first 1, then 2, then give up. February 29, 2016 Improved the wording of the pop-up screen to spell out what the user needs to do to allow MATLAB to control the computer. June 25, 2017. First version of Brightness, based on my AutoBrightness.applescript April 9, 2020. Now called MacDisplaySettings.applescript merging code from Brightness and AutoBrightness, and adding code for True Tone and Night Shift. April 14, 2020. Added loops to wait ""until exists tab group 1 of window windowNumber"" before accessing it. This change has enormously increased the reliability. I think the old failures were timeouts, and the wait loops seem to have almost entirely fixed that. May 2, 2020. Watching it work, I notice that the operations on the System Preferences panel are glacially slow while it's in background, behind MATLAB, but zippy, like a fast human operator, when System Preferences is foremost. Observing that, I now ""activate"" System Preferences at the beginning (and reactivate the former app when we exit), and this runs much faster. Formerly delays of 60 s were common. Now it reliably takes 3 s. May 5, 2020. Return an error message if anything went wrong. The user will know that everything's ok if the error string is empty. Also apply the user's setting of newShowProfilesForThisDisplayOnly before peeking and poking. May 9, 2020. Improved speed (from 3 to 1.6 s) by replacing fixed delays in applescript with wait loops. Enhanced the built-in peek of brightness afer poking. Now if the peek differs by more than 0.001, MacDisplaySettings waits 100 ms and tries again, to let the value settle, as the visual effect is a slow fade. Then it reports in errorMsgFinal if the new peek differs by more than 0.001. In limited testing, waiting for a good answer works: the peek-poke difference rarely exceeds +/-5e-6 and never exceeds 0.001. It's my impression that if we always waited 100 ms, then the discrepancy would always be less than +/-5e-6. May 15, 2020. MacDisplaySettings.m now also passes a flag indicating whether Psychtoolbox has a window on the main screen. In that case, AppleScript will not try to show a dialog. Added a loop in AppleScript to wait for System Preferences window to open; this fixes a rare error. Replaced every error code with a message in errorMsgFinal. May 20, 2020. MacDisplaySettings hung up on my student Benji Luo with the Night Shift panel showing. I suspect it was in an endless loop waiting for the menu to pop up after a click. I rewrote the loop to throw an error if the menu doesn't appear after three attempts of clicking and waiting up to 500 ms each time. June 9, 2020. Cosmetic. Improved explanation of APPLE PRIVACY, July 15, 2020. Added new fields ""profileFilename"" and ""profileFolder"" to output. They give the filename and folder of the profile. Use iccread to read the ColorSync Profile file into a struct. February 25, 2021. MacDisplaySettings fully supports macOS Mojave and earlier. Currently MacDisplaySettings.m prints a warning and only returns partial results if running on macOS Catalina or newer. May 13, 2021. MacDisplaySettings now fully supports macOS Big Sur (11.3) and Mojave (10.14) and earlier. It probably also works fine on intermediate versions, i.e. Catalina (10.15), but that has yet to be tested. Note that in macOS Big Sur the ""Night Shift"" feature of System Preferences: Displays has acquired a new slider (not present in Mojave) to specify Color Temperature, and we haven't yet added support for it. It would be easy to add, but it doesn't seem relevant to the expected users of this function, so let me know if you need it. I expect users of MacDisplaySettings to be turning off Night Shift, so they wouldn't care what color temperature was selected while that feature is disabled. Added two new flags debugSpeak and debugNotify (below) that can be set to true to faciliate debugging. May 24, 2021. MacDisplaySettings now also supports macOS Catalina, the only missing version, so it has now been tested (and debugged) on all versions from macOS Mavericks (10.9) through macOS Big Sur (11.3). *) on run argv -- INPUT ARGUMENTS: screenNumber, screen rect, newBrightness, newAutomatically, newTrueTone, -- newNightShiftSchedule, newNightShiftManual, -- newShowProfilesForThisDisplayOnly, newProfileRow, newProfile. -- OUTPUT ARGUMENTS: olsdBrightness, oldAutomatically, oldTrueTone, oldNightShift, -- oldShowProfilesForThisDisplayOnly, oldProfileRow, oldProfile, errorMsgFinal. -- integer screenNumber. Zero for main screen. Default is zero. --integer 4 values for global rect of desired screen. (Can be -1 -1 -1 -1 for main screen.) -- float newBrightness: -1.0 (ignore) or 0.0 to 1.0 value of brightness slider. -- integer newAutomatically: -1 (ignore) or 0 or 1 logical value of checkbox. -- integer newTrueTone: -1 (ignore) or 0 or 1 logical value of checkbox. -- A value of -1 leaves the setting unchanged. -- Returns oldBrightness (-1, or 0.0 to 1.0), oldAutomatically (-1, or 0 or 1), -- oldTrueTone (-1, or 0 or 1), oldNightShiftSchedule (-1, or 1, 2, or 3), -- oldNightShiftManual (-1 or 0 or 1), -- oldShowProfilesForThisDisplayOnly (-1, or 0 or 1), -- oldProfileRow (-1 or integer), oldProfile (string). -- TrueTone only exists on some Macs manufactured 2018 or later. When not -- available, oldTrueTone is []. tell application ""Finder"" set mainRect to bounds of window of desktop end tell --DEBUGGING set debugSpeak to false set debugNotify to false --To see the notification controlled by debugNotify --you need to enable notifications --(in System Preferences: Notifications) --from Apple's Script Editor. I don't know why --that app is relevant, but maybe Apple uses it --to send the notification. --The notification should appear in the upper right --of your screen as MacDisplaySettings returns --to MATLAB. It contains the information --returned to MATLAB, so it's only interesting for --debugging. --GET ARGUMENTS set theRect to {-1, -1, -1, -1} try set screenNumber to item 1 of argv as integer on error set screenNumber to 0 -- Default is the main screen. end try try set item 1 of theRect to item 2 of argv as integer on error set item 1 of theRect to item 1 of mainRect -- Default is the main screen. end try try set item 2 of theRect to item 3 of argv as integer on error set item 2 of theRect to item 2 of mainRect -- Default is the main screen. end try try set item 3 of theRect to item 4 of argv as integer on error set item 3 of theRect to item 3 of mainRect -- Default is the main screen. end try try set item 4 of theRect to item 5 of argv as integer on error set item 4 of theRect to item 4 of mainRect -- Default is the main screen. end try try set windowIsOpenOnMainScreen to item 6 of argv as integer if windowIsOpenOnMainScreen > 0 then set windowIsOpenOnMainScreen to true else set windowIsOpenOnMainScreen to false end if on error set windowIsOpenOnMainScreen to true end try try set newBrightness to item 7 of argv as real on error set newBrightness to -1.0 -- Unspecified value, so don't change the setting. end try try set newAutomatically to item 8 of argv as integer on error set newAutomatically to -1 -- Unspecified value, so don't change the setting. end try try set newTrueTone to item 9 of argv as integer on error set newTrueTone to -1 -- Unspecified value, so don't change the setting. end try try --To ease passing the Night Shift Schedule menu choice back and forth --between MATLAB and AppleScript (and for compatibility with international --variations of macOS), we receive and pass just the integer index into --the list: {'Off','Custom','Sunset to Sunrise'}. This should work in --international (i.e. translated) versions of macOS. set newNightShiftSchedule to item 10 of argv as integer on error set newNightShiftSchedule to -1 -- Unspecified value, so don't change the setting. end try try set newNightShiftManual to item 11 of argv as integer on error set newNightShiftManual to -1 -- Unspecified value, so don't change the setting. end try try set newShowProfilesForThisDisplayOnly to item 12 of argv as integer on error set newShowProfilesForThisDisplayOnly to -1 -- Unspecified value, so don't change the setting. end try try set newProfileRow to item 13 of argv as integer on error set newProfileRow to -1 -- Unspecified value is ignored. end try try set newProfile to item 14 of argv as string on error set newProfile to -1 -- Unspecified value is ignored. end try if newProfile as string is equal to """" then set newProfile to -1 end if -- CHECK ARGUMENTS if newNightShiftSchedule is not in {-1, 1, 2, 3} then set errorMsgFinal to ""newNightShiftSchedule "" & newNightShiftSchedule & "" should be one of -1, 1, 2, 3."" return {oldBrightness, oldAutomatically, ¬ oldTrueTone, oldNightShiftSchedule, oldNightShiftManual, ¬ oldShowProfilesForThisDisplayOnly, oldProfileRow, ¬ ""|"" & oldProfile & ""|"", ""|"" & oldProfileFilename & ""|"", ""|"" & errorMsgFinal & ""|""} end if set leaveSystemPrefsRunning to true -- This could be made a further argument. set macOSVersion to system version of (system info) considering numeric strings set isNightShiftAvailable to macOSVersion ≥ ""10.12.4"" set isMojaveOrBetter to macOSVersion ≥ ""10.14.0"" set isCatalinaOrBetter to macOSVersion ≥ ""10.15.0"" end considering -- Default values. The value -1 means don't modify this setting. set oldBrightness to -1.0 set oldAutomatically to -1 set oldTrueTone to -1 set oldProfile to """" set oldProfileFilename to """" set oldProfileRow to -1 set oldShowProfilesForThisDisplayOnly to -1 set oldNightShiftSchedule to -1 set oldNightShiftManual to -1 set errorMsgFinal to """" -- The ""ok"" flags help track what failed. We return an error message if -- any failed that shouldn't. set trueToneOk to false set groupOk to false set brightnessOk to false set profileOk to false set manualOk to false set scheduleOk to false -- GET NAME OF CURRENT APP. -- Save name of current active application (probably MATLAB) to -- restore at end as the frontmost. Apparently this -- works reliably only if saved ""as text"". --https://stackoverflow.com/questions/44017508/set-application-to-frontmost-in-applescript --https://stackoverflow.com/questions/13097426/activating-an-application-in-applescript-with-the-application-as-a-variable set currentApp to path to frontmost application as text --ACTIVATE SYSTEM PREFERENCES APP tell application ""System Preferences"" activate -- Bring it to the front, which makes the rest MUCH faster. -- This is the international way to get to the desired pane of Displays, -- immune to language localizations. set current pane to pane id ""com.apple.preference.displays"" set wasRunning to running reveal anchor ""displaysDisplayTab"" of pane id ""com.apple.preference.displays"" end tell -- FIND THE SYSTEM PREFS WINDOWS ON THE DESIRED SCREEN. -- theRect is received as an argument. In MATLAB theRect=Screen('GlobalRect',screen). -- Formerly we always referred to ""window windowNumber"" but windowNumber changes -- if a window is brought forward. The frontmost window is always number 1. So now -- we refer to ""theWindow"" which doesn't change when we bring the window to the front. -- We know a window is on the desired screen by checking whether its x y position -- is inside the global rect of the desired screen, which is received as an -- argument when MacDisplayScreen.applescript is called. (If the global rect is not -- provided, the default is the rect of the main screen, which we compute above.) set theWindow to -1 set mainWindow to -1 if screenNumber is equal to 0 then set theRect to mainRect end if --set theRect to {1000, 0, 3600, 1000} -- for debugging tell application ""System Events"" tell application process ""System Preferences"" repeat until exists window 1 delay 0.05 end repeat repeat with w from 1 to (count windows) set winPos to position of window w set x to item 1 of winPos set y to item 2 of winPos if (x ≥ item 1 of theRect and x ≤ item 3 of theRect and ¬ y ≥ item 2 of theRect and y ≤ item 4 of theRect) then set theWindow to window w end if -- We never use the variable ""mainWindow"", but it's cheap to -- find it, and it's handy to have when debugging. if (x ≥ item 1 of mainRect and x ≤ item 3 of mainRect and ¬ y ≥ item 2 of mainRect and y ≤ item 4 of mainRect) then set mainWindow to window w end if end repeat end tell end tell if theWindow is equal to -1 then set AppleScript's text item delimiters to space set theString to theRect as string set AppleScript's text item delimiters to """" set errorMsgFinal to ""Could not find System Preferences window on screenNumber "" & screenNumber & "" with rect ["" & theString & ""]."" activate application currentApp -- Restore active application. --delay 0.1 -- May not be needed. return {oldBrightness, oldAutomatically, ¬ oldTrueTone, oldNightShiftSchedule, oldNightShiftManual, ¬ oldShowProfilesForThisDisplayOnly, oldProfileRow, ¬ ""|"" & oldProfile & ""|"", ""|"" & oldProfileFilename & ""|"", ""|"" & errorMsgFinal & ""|""} end if -- PERMISSION CHECK, TRUE TONE, BRIGHTNESS & AUTOMATIC, tell application ""System Events"" -- CHECK FOR PERMISSION set applicationName to item 1 of (get name of processes whose frontmost is true) if not UI elements enabled then tell application ""System Preferences"" activate reveal anchor ""Privacy_Accessibility"" of pane id ""com.apple.preference.security"" if windowIsOpenOnMainScreen then -- Psychtoolbox has a window open that might obscure -- our dialog window. So we return instead and let -- MacDisplaySettings close all windows. set errorMsgFinal to ""To set Displays preferences, "" & applicationName & ¬ "" needs your permission to control this computer. "" & ¬ ""Please unlock System Preferences: Security & Privacy: "" & ¬ ""Privacy and click the boxes to grant "" & applicationName & "" permission for Full Disk Access and Automation. "" return {oldBrightness, oldAutomatically, ¬ oldTrueTone, oldNightShiftSchedule, oldNightShiftManual, ¬ oldShowProfilesForThisDisplayOnly, oldProfileRow, ¬ ""|"" & oldProfile & ""|"", ""|"" & oldProfileFilename & ""|"", ""|"" & errorMsgFinal & ""|""} end if display alert ""To set Displays preferences, "" & applicationName & ¬ "" needs your permission to control this computer. "" & ¬ ""BEFORE you click OK below, please unlock System Preferences: Security & Privacy: "" & ¬ ""Privacy and click the boxes to grant permission for Full Disk Access and Automation. "" & ¬ ""THEN click OK."" end tell return {oldBrightness, oldAutomatically, ¬ oldTrueTone, oldNightShiftSchedule, oldNightShiftManual, ¬ oldShowProfilesForThisDisplayOnly, oldProfileRow, ¬ ""|"" & oldProfile & ""|"", ""|"" & oldProfileFilename & ""|"", ""|"" & errorMsgFinal & ""|""} end if --DISPLAY PANEL -- TRUE TONE, BRIGHTNESS & AUTOMATIC set screenNumber to 1 tell process ""System Preferences"" repeat 10 times if exists theWindow then exit repeat delay 0.05 end repeat if not (exists theWindow) then set errorMsgFinal to ""screenNumber "" & screenNumber & "" is not available."" activate application currentApp -- Restore active application. --delay 0.1 return {oldBrightness, oldAutomatically, ¬ oldTrueTone, oldNightShiftSchedule, oldNightShiftManual, ¬ oldShowProfilesForThisDisplayOnly, oldProfileRow, ¬ ""|"" & oldProfile & ""|"", ""|"" & oldProfileFilename & ""|"", ""|"" & errorMsgFinal & ""|""} end if repeat delay 0.05 set refGroup to a reference to tab group 1 of theWindow if exists refGroup then --Works before macOS Big Sur. --On Big Sur we sometimes need this, and sometimes the alternate below. --It depends partly on whether the System Preferences App was already open. --I'm very surprised that the applescript object hierarchy within an app is --so changeable, but this two-pronged approach seems to work reliably. --Not yet tested on macOS Catalina (10.15). if debugSpeak then say ""TRUE TONE uses standard access"" end if set trueToneCheckbox to 1 --Not sure in Catalina whether it's 1 or 2. exit repeat end if set refGroup to a reference to tab group 1 of group 1 of theWindow if exists refGroup then --Needed in Big Sur. if debugSpeak then say ""TRUE TONE uses alternate access"" end if set trueToneCheckbox to 2 --Not sure in Catalina whether it's 1 or 2. exit repeat end if end repeat tell refGroup -- TRUE TONE --Old Macs don't have this feature, so --it's not an error for the True Tone checkbox --to be missing. if isCatalinaOrBetter then set trueToneCheckbox to 2 --Not sure in Catalina whether it's 1 or 2. else set trueToneCheckbox to 1 end if if debugSpeak then say ""TRUE TONE"" end if set trueToneOk to false if exists checkbox trueToneCheckbox then try tell checkbox trueToneCheckbox set oldTrueTone to value if newTrueTone is in {0, 1} and newTrueTone is not oldTrueTone then click -- It's stale, so update it. end if end tell --Succeeded with True Tone. set trueToneOk to true on error -- Don't report True Tone error. -- Just return oldTrueTone=-1. set trueToneOk to false end try end if -- BRIGHTNESS & AUTOMATIC repeat with version from 1 to 3 -- Find the brightness controls inside the UI: -- 1 works on macOS 10.9 and 10.14, and some versions of 10.10. -- 2 works on macOS 10.11 through 10.13, and some versions of 10.10. -- 3 works on macOS Catalina. try -- older than macOS Mojave set refSlider to (a reference to slider 1 of group 1) set automaticallyRef to (a reference to checkbox 1 of group 1) if not (exists refSlider) then -- macOS Mojave set refSlider to (a reference to slider 1 of group 2) set automaticallyRef to (a reference to checkbox 1 of group 2) if not (exists refSlider) then -- macOS Catalina and Big Sur set refSlider to (a reference to slider 1) set automaticallyRef to (a reference to checkbox 1) end if if not (exists refSlider) then error ""Could not find the brightness slider."" end if end if set oldBrightness to value of refSlider -- Get brightness set groupOk to true set errorMsgLocal to """" exit repeat on error errorMsgLocal set groupOk to false end try end repeat if groupOk is false then set errorMsgFinal to ""Could not find Brightness in Display panel data."" else try -- BRIGHTNESS if debugSpeak then say ""BRIGHTNESS"" end if set brightnessOk to false set oldBrightness to value of refSlider -- Get brightness if newBrightness > -1 then -- Check the poke by peeking. -- We can't demand equality (of peek and poke) because -- macOS uses only about 18-bit precision internally. --Visually, moving the slider causes a slow --fade. (Maybe that's why they gave it such high precision.) --It's possible that the value we --read similarly takes time to reach the --requested setting. So when we read a bad --value (different by at least 0.001 from the newBrightness we poked) --then we wait a bit and try again. After 2000 --poke-peek pairs with random brightnesses (0.0 to 1.0), --only 5 immediate peeks differed by at least 0.01, and only 11 differed -- by at least 0.0001. The rest were within --+/- 5e-6 of the value poked. (The outliers were all --brighter than desired, suggesting that dimming is --slower than brightening.) In limited testing, this delay --seems to have eliminated the outliers, so the peek-poke --difference never exceeds +/- 5e-6. Given --that the brightness always settles to the desired value --perhaps the extra peek is superfluous. I'm leaving it in --because MacDisplaySettings is slow anyway, due to applescript, --so the extra up to 200 ms of the peek seems good insurance --for detecting unanticipated problems in particular Macs, --or different versions of the macOS. set value of refSlider to newBrightness -- Set brightness set b to value of refSlider -- Get brightness set bErr to (b - newBrightness) --is the peek bad? if bErr > 1.0E-3 or bErr < -1.0E-3 then -- yep, it's bad. Wait and peek again. delay 0.1 set b to value of refSlider -- Get brightness set bErr to (b - newBrightness) if bErr > 1.0E-3 or bErr < -1.0E-3 then error ""Poked Brightness "" & newBrightness & "" but peeked "" & b & ""."" end if end if end if --Succeeded with Brightness. -- AUTOMATICALLY if debugSpeak then say ""AUTOMATICALLY"" end if tell automaticallyRef -- Enable/disable Automatically adjust brightness set oldAutomatically to value if newAutomatically is in {0, 1} and ¬ newAutomatically is not oldAutomatically then click -- It's stale, so update it. end if end tell --Succeeded with Automatically. --Succeeded with Brightness and Automatically. set brightnessOk to true on error errorMsgLocal set errorMsgFinal to errorMsgLocal set brightnessOk to false end try end if end tell end tell end tell -- This block of code selects the right window (a System Preferences window on -- the desired screen) and selects the Color pane within it. --if not isCatalinaOrBetter then if debugSpeak then say ""SELECT THE RIGHT SCREEN"" end if tell application ""System Events"" tell process ""System Preferences"" tell theWindow select perform action ""AXRaise"" of theWindow repeat if exists group 1 then set refGroup to a reference to tab group 1 of group 1 --set refGroup to a reference to tab group 1 exit repeat end if if exists tab group 1 then set refGroup to a reference to tab group 1 exit repeat end if delay 0.05 end repeat tell refGroup tell radio button 2 --""Color"" --This click selects color. click delay 0.05 --Not sure if needed. end tell end tell end tell end tell end tell --end if -- COLOR PANEL if debugSpeak then say ""COLOR PANEL"" end if if true then tell application ""System Events"" tell process ""System Preferences"" repeat 10 times -- macOS Big Sur set tabGroupRef to a reference to tab group 1 of group 1 of theWindow set openButton to 1 if exists checkbox 1 of tabGroupRef then exit repeat end if -- macOS Catalina set tabGroupRef to a reference to tab group 1 of theWindow set openButton to 1 if exists checkbox 1 of tabGroupRef then exit repeat end if -- macOS before Catalina set tabGroupRef to a reference to group 1 of theWindow set openButton to 2 if exists checkbox 1 of tabGroupRef then exit repeat end if delay 0.05 end repeat if not (exists checkbox 1 of tabGroupRef) then error ""Could not find the checkbox that controls display of color profiles."" end if tell tabGroupRef -- Show all profiles. try repeat until exists checkbox 1 delay 0.05 end repeat tell checkbox 1 -- Yes/no: Show profiles for this display only. set oldShowProfilesForThisDisplayOnly to value if newShowProfilesForThisDisplayOnly is not equal to -1 then -- Set new value. if newShowProfilesForThisDisplayOnly is not equal to oldShowProfilesForThisDisplayOnly ¬ then click end if end if end tell -- checkbox 1 -- GET oldProfile, short name of selected profile. if debugSpeak then say ""GET PROFILE"" end if try --This fails (and recovers due to try/catch) if no --profile is selected in displayed list, --presumably because the actually selected profile is only --in the full list, and we're only showing the short list as --a result of the checkbox newShowProfilesForThisDisplayOnly. --If no profile is selected in the displayed list, --then we just return an empty string in oldProfile. repeat until exists row 1 of table 1 of scroll area 1 delay 0.05 end repeat tell table 1 of scroll area 1 set oldProfile to value of static text 1 of ¬ (row 1 where selected is true) end tell end try if debugSpeak then say ""color profile is "" & (oldProfile as string) end if --GET oldProfileRow, the row number of selected profile. tell table 1 of scroll area 1 repeat with profileRow from 1 to 101 if selected of row profileRow then exit repeat end repeat set oldProfileRow to profileRow if oldProfileRow is 101 then set oldProfileRow to -1 error ""Could not select Profile by row."" end if end tell if debugSpeak then say ""row "" & (oldProfileRow as string) end if -- GET OldProfileFilename. -- Skip if no profile is selected. --Otherwise, click the ""Open profile"" button --and read the name of the window opened by --ColorSync Utility app. Then try to kill --the app. (Killing it is easier than just closing --its new window.) if oldProfile as string is not equal to """" then repeat until exists button openButton delay 0.05 end repeat click button openButton --""Open Profile"" -- Read ColorSync Utility window title. tell application ""System Events"" set colorSyncApp to name of (first application process whose frontmost is true) set oldProfileFilename to name of first window of application process colorSyncApp if "".icc"" is in oldProfileFilename then -- Quit ColorSync Utility. --We try to kiil it in two ways because each seems less than --wholly reliable, yet the combo does seem reliable. We --proceed without flagging an error even if neither --attempt works so the app is still running (with new --window open). try tell application ""ColorSync Utility"" quit end tell on error errorMsgLocal number errorNumber --Quitting didn't work (possibly because we're --running in a non-English language, so the --app name didn't match), so try to kill it. -- This killing code comes from: -- https://discussions.apple.com/thread/5950317 try tell application ""System Events"" -- Kill the application without dialog. set theID to (unix id of processes whose name is colorSyncApp) do shell script ""kill -9 "" & theID delay 0.1 end tell on error errorMsgLocal number errorNumber -- Neither quit nor kill worked; just proceed without warning. end try end try end if end tell end if if debugSpeak then --say ""oldProfileFilename="" & (oldProfileFilename as string) end if --SELECT NEW PROFILE. --If newProfileRow is valid, then use it to select by row. --Otherwise, if newProfile is valid, then use it to select by name. if debugSpeak then say ""SELECT NEW PROFILE"" end if tell table 1 of scroll area 1 if newProfileRow is not equal to -1 then --newProfileRow specifies profile row. --say ""newProfileRow="" & (newProfileRow as string) if selected of row newProfileRow is true then -- If the desired row is already selected -- then we first select and activate another row, -- and then reselect and activate the one we want. -- This ensures that a fresh copy of the profile -- is loaded from disk. if newProfileRow is equal to 1 then select last row --another row else select row 1 --another row end if activate --the app click --the other row end if select row newProfileRow --the desired row activate --the app click --the desired row if selected of row newProfileRow is false then error ""Could not select ColorSyhc Profile row "" & (newProfileRow as string) & ""."" end if else --newProfile specifies profile name. --say ""newProfile="" & (newProfile as string) if newProfile is not equal to -1 then try if selected of ¬ (row 1 where value of static text 1 is newProfile) then if oldProfileRow is equal to 1 then select last row --another row else select row 1 --another row end if activate --the app click --the other row end if select (row 1 where value of static text 1 is newProfile) activate --the app click --the desired row on error error ""Could not select ColorSync Profile '"" & newProfile & ""' by name."" end try if newProfile is not equal to value ¬ of static text 1 of (row 1 where selected is true) then error ""Could not select Profile '"" & newProfile & ""' by name."" end if end if end if end tell set profileOk to true on error errorMsgLocal number errorNumber set profileOk to false set errorMsgFinal to errorMsgLocal end try end tell end tell end tell end if -- NIGHT SHIFT PANEL if debugSpeak then say ""NIGHT SHIFT"" end if tell application ""System Preferences"" reveal anchor ""displaysNightShiftTab"" of pane id ""com.apple.preference.displays"" end tell tell application ""System Events"" tell process ""System Preferences"" repeat 10 times --Big Sur set refGroup to a reference to tab group 1 of group 1 of theWindow if exists refGroup then exit repeat end if --Before Big Sur set refGroup to a reference to tab group 1 of theWindow if exists refGroup then exit repeat end if delay 0.05 end repeat if not (exists refGroup) then error ""Could not find the NightShift controls."" end if tell refGroup -- NIGHT SHIFT MANUAL try tell checkbox 1 -- Enable/disable Night Shift Manual set oldNightShiftManual to value --display alert ""4 Read!"" if newNightShiftManual is in {0, 1} and ¬ newNightShiftManual is not oldNightShiftManual then click -- It's stale, so update it. --display alert ""5 Wrote!"" end if end tell --Succeeded with Night Shift Manual. set manualOk to true on error set manualOk to false end try -- NIGHT SHIFT SCHEDULE try repeat until exists pop up button 1 delay 0.05 end repeat tell pop up button 1 -- Select Night Shift Schedule -- We get the selection value, i.e. text which may -- be in foreign language. set theLabel to value -- Then we find it in the pop up menu and keep its index. -- The nested repeat loops are my attempt to -- eliminate a hang that I think was due to waiting -- forever, after a click, for the menu to appear. -- When I manually click a pop-up menu the menu appears -- and remains forever. But after the applescript ""click"" -- command, the menu appears only briefly. -- My hypothesis is that perhaps the menu came and went -- before my loop started waiting for it to appear. The new -- code waits for up to 500 ms, and then tries again -- (up to twice more) to click and wait. If, after three tries, -- the menu still hasn't appeared, then we fail with an -- applescript error, so i'll get some diagnostic information. repeat 3 times click -- reveal pop up menu repeat 10 times if exists menu 1 then exit repeat delay 0.05 end repeat if exists menu 1 then exit repeat end repeat repeat with i from 1 to 3 set x to name of menu item i of menu 1 if theLabel is x then set oldNightShiftSchedule to i exit repeat end if end repeat --Hit escape key to hide the menu. key code 53 if newNightShiftSchedule > 0 then repeat 3 times click -- reveal pop up menu repeat 10 times if exists menu 1 then exit repeat delay 0.05 end repeat if exists menu 1 then exit repeat end repeat click menu item newNightShiftSchedule of menu 1 end if end tell --Succeeded with Night Shift Schedule. set scheduleOk to true on error set scheduleOk to false end try end tell end tell end tell --SHOW MAIN DISPLAYS PANEL AS WE LEAVE if debugSpeak then say ""RESTORE"" end if tell application ""System Preferences"" reveal anchor ""displaysDisplayTab"" of pane id ""com.apple.preference.displays"" end tell if wasRunning or leaveSystemPrefsRunning then -- Leave it running. else quit application ""System Preferences"" end if if errorMsgFinal as string is equal to """" then if not profileOk then set errorMsgFinal to ""Could not peek/poke Profile selection."" if isNightShiftAvailable then if not manualOk then set errorMsgFinal to ""Could not peek/poke Night Shift manual."" if not scheduleOk then set errorMsgFinal to ""Could not peek/poke Night Shift schedule."" end if -- Many computers don't support True Tone, so we don't flag this as an error. -- It's enough that the field is left empty. --if not trueToneOk then set errorMsgFinal to ""Could not peek/poke True Tone."" if not brightnessOk then set errorMsgFinal to ""Could not peek/poke Brightness and Automatically."" end if -- RESTORE FRONTMOST APPLICATION (PROBABLY MATLAB). activate application currentApp -- Restore active application. if debugNotify then --To see this message you need to enable notifications --from Apple's Script Editor. I don't know why, but --maybe Apple uses that app to send the notification. --It should appear in the upper right of your --screen as MacDisplaySettings returns to MATLAB. display notification ""oldBrightness="" & (oldBrightness as text) & "", oldAutomatically= "" & (oldAutomatically as text) ¬ & "", oldTrueTone="" & (oldTrueTone as text) & "", oldNightShiftSchedule="" & (oldNightShiftSchedule as text) & "", oldNightShiftManual="" & (oldNightShiftManual as text) & ¬ "", oldShowProfilesForThisDisplayOnly="" & (oldShowProfilesForThisDisplayOnly as text) & "", oldProfileRow="" & (oldProfileRow as text) & ¬ "", oldProfile="" & (oldProfile as text) & "", oldProfileFilename="" & oldProfileFilename & "", errorMsgFinal="" & errorMsgFinal end if if debugSpeak then say ""RETURN"" end if return {oldBrightness, oldAutomatically, ¬ oldTrueTone, oldNightShiftSchedule, oldNightShiftManual, ¬ oldShowProfilesForThisDisplayOnly, oldProfileRow, ¬ ""|"" & oldProfile & ""|"", ""|"" & oldProfileFilename & ""|"", ""|"" & errorMsgFinal & ""|""} end run ",12081,False,2294.9670534410257,median "[MusicConfig] Location=300962 Yiruma - River Flows In You (viewtifulday Remix)/River flows in you.mp3 Extension=mp3 MD5=ea‌​c7‌​ba‌​94‌​e2‌​31‌​d3‌​69‌​0a‌​aa‌​4d‌​10‌​ab‌​ac‌​72‌​6b Source=OSU MetreNumber=4 Title=River Flows In You (viewtifulday Remix) [TagConfig] Tagger=Carra Time=2016/9/2 19:57:44 Confidence=4 [MiscConfig] LinkedFile=300962 Yiruma - River Flows In You (viewtifulday Remix)/Yiruma - River Flows In You (viewtifulday Remix) (jjy) [test].osu osuMapID=300962 [BeatInfo] Count=385 Beat_0={0.032,1,Bb min,Bbm} Beat_1={0.42161038961039,0,Bb min,Bbm} Beat_2={0.81122077922078,0,Bb min,Bbm} Beat_3={1.20083116883117,0,Bb min,Bbm} Beat_4={1.5904415584415599,1,Bb min,F#} Beat_5={1.9800519480519498,0,Bb min,F#} Beat_6={2.36966233766234,0,Bb min,F#} Beat_7={2.7592727272727298,0,Bb min,F#} Beat_8={3.1488831168831197,1,Bb min,C#} Beat_9={3.5384935064935097,0,Bb min,C#} Beat_10={3.9281038961038997,0,Bb min,C#} Beat_11={4.31771428571429,0,Bb min,C#} Beat_12={4.70732467532468,1,Bb min,Ab} Beat_13={5.0969350649350691,0,Bb min,Ab} Beat_14={5.4865454545454586,0,Bb min,Ab} Beat_15={5.8761558441558481,0,Bb min,Ab} Beat_16={6.2657662337662376,1,Bb min,Bbm} Beat_17={6.6553766233766272,0,Bb min,Bbm} Beat_18={7.0449870129870167,0,Bb min,Bbm} Beat_19={7.4345974025974062,0,Bb min,Bbm} Beat_20={7.8242077922077957,1,Bb min,F#} Beat_21={8.2138181818181852,0,Bb min,F#} Beat_22={8.6034285714285748,0,Bb min,F#} Beat_23={8.9930389610389643,0,Bb min,F#} Beat_24={9.3826493506493538,1,Bb min,C#} Beat_25={9.7722597402597433,0,Bb min,C#} Beat_26={10.161870129870133,0,Bb min,C#} Beat_27={10.551480519480522,0,Bb min,C#} Beat_28={10.941090909090912,1,Bb min,Ab} Beat_29={11.330701298701301,0,Bb min,Ab} Beat_30={11.720311688311691,0,Bb min,Ab} Beat_31={12.10992207792208,0,Bb min,Ab} Beat_32={12.49953246753247,1,Bb min,Bbm} Beat_33={12.88914285714286,0,Bb min,Bbm} Beat_34={13.278753246753249,0,Bb min,Bbm} Beat_35={13.668363636363639,0,Bb min,Bbm} Beat_36={14.057974025974028,1,Bb min,F#} Beat_37={14.447584415584418,0,Bb min,F#} Beat_38={14.837194805194807,0,Bb min,F#} Beat_39={15.226805194805197,0,Bb min,F#} Beat_40={15.616415584415586,1,Bb min,C#} Beat_41={16.006025974025977,0,Bb min,C#} Beat_42={16.395636363636367,0,Bb min,C#} Beat_43={16.785246753246756,0,Bb min,C#} Beat_44={17.174857142857146,1,Bb min,Ab} Beat_45={17.564467532467535,0,Bb min,Ab} Beat_46={17.954077922077925,0,Bb min,Ab} Beat_47={18.343688311688314,0,Bb min,Ab} Beat_48={18.733298701298704,1,Bb min,Bbm} Beat_49={19.122909090909094,0,Bb min,Bbm} Beat_50={19.512519480519483,0,Bb min,Bbm} Beat_51={19.902129870129873,0,Bb min,Bbm} Beat_52={20.291740259740262,1,Bb min,F#} Beat_53={20.681350649350652,0,Bb min,F#} Beat_54={21.070961038961041,0,Bb min,F#} Beat_55={21.460571428571431,0,Bb min,F#} Beat_56={21.85018181818182,1,Bb min,C#} Beat_57={22.23979220779221,0,Bb min,C#} Beat_58={22.6294025974026,0,Bb min,C#} Beat_59={23.019012987012989,0,Bb min,C#} Beat_60={23.408623376623378,1,Bb min,Ab} Beat_61={23.798233766233768,0,Bb min,Ab} Beat_62={24.187844155844157,0,Bb min,Ab} Beat_63={24.577454545454547,0,Bb min,Ab} Beat_64={24.967064935064936,1,Bb min,Bbm} Beat_65={25.356675324675326,0,Bb min,Bbm} Beat_66={25.746285714285715,0,Bb min,Bbm} Beat_67={26.135896103896105,0,Bb min,Bbm} Beat_68={26.525506493506494,1,Bb min,F#} Beat_69={26.915116883116884,0,Bb min,F#} Beat_70={27.304727272727273,0,Bb min,F#} Beat_71={27.694337662337663,0,Bb min,F#} Beat_72={28.083948051948052,1,Bb min,C#} Beat_73={28.473558441558442,0,Bb min,C#} Beat_74={28.863168831168831,0,Bb min,C#} Beat_75={29.252779220779221,0,Bb min,C#} Beat_76={29.642389610389611,1,Bb min,Ab} Beat_77={30.032,0,Bb min,Ab} Beat_78={30.42161038961039,0,Bb min,Ab} Beat_79={30.811220779220779,0,Bb min,Ab} Beat_80={31.200831168831169,1,Bb min,Bbm} Beat_81={31.590441558441558,0,Bb min,Bbm} Beat_82={31.980051948051948,0,Bb min,Bbm} Beat_83={32.369662337662341,0,Bb min,Bbm} Beat_84={32.75927272727273,1,Bb min,F#} Beat_85={33.14888311688312,0,Bb min,F#} Beat_86={33.538493506493509,0,Bb min,F#} Beat_87={33.9281038961039,0,Bb min,F#} Beat_88={34.317714285714288,1,Bb min,C#} Beat_89={34.707324675324678,0,Bb min,C#} Beat_90={35.096935064935067,0,Bb min,C#} Beat_91={35.486545454545457,0,Bb min,C#} Beat_92={35.876155844155846,1,Bb min,Ab} Beat_93={36.265766233766236,0,Bb min,Ab} Beat_94={36.655376623376625,0,Bb min,Ab} Beat_95={37.044987012987015,0,Bb min,Ab} Beat_96={37.434597402597404,1,Bb min,Bbm} Beat_97={37.824207792207794,0,Bb min,Bbm} Beat_98={38.213818181818183,0,Bb min,Bbm} Beat_99={38.603428571428573,0,Bb min,Bbm} Beat_100={38.993038961038962,1,Bb min,Bbm} Beat_101={39.382649350649352,0,Bb min,Bbm} Beat_102={39.772259740259742,0,Bb min,Bbm} Beat_103={40.161870129870131,0,Bb min,Bbm} Beat_104={40.551480519480521,1,Bb min,Bbm} Beat_105={40.94109090909091,0,Bb min,Bbm} Beat_106={41.3307012987013,0,Bb min,Bbm} Beat_107={41.720311688311689,0,Bb min,Bbm} Beat_108={42.109922077922079,1,Bb min,Bbm} Beat_109={42.499532467532468,0,Bb min,Bbm} Beat_110={42.889142857142858,0,Bb min,Bbm} Beat_111={43.278753246753247,0,Bb min,Bbm} Beat_112={43.668363636363637,1,Bb min,Bbm} Beat_113={44.057974025974026,0,Bb min,Bbm} Beat_114={44.447584415584416,0,Bb min,Bbm} Beat_115={44.837194805194805,0,Bb min,Bbm} Beat_116={45.226805194805195,1,Bb min,F#} Beat_117={45.616415584415584,0,Bb min,F#} Beat_118={46.006025974025974,0,Bb min,F#} Beat_119={46.395636363636363,0,Bb min,F#} Beat_120={46.785246753246753,1,Bb min,C#} Beat_121={47.174857142857142,0,Bb min,C#} Beat_122={47.564467532467532,0,Bb min,C#} Beat_123={47.954077922077921,0,Bb min,C#} Beat_124={48.343688311688311,1,Bb min,Ab} Beat_125={48.7332987012987,0,Bb min,Ab} Beat_126={49.12290909090909,0,Bb min,Ab} Beat_127={49.512519480519479,0,Bb min,Ab} Beat_128={49.902129870129869,1,Bb min,Bbm} Beat_129={50.291740259740259,0,Bb min,Bbm} Beat_130={50.681350649350648,0,Bb min,Bbm} Beat_131={51.070961038961038,0,Bb min,Bbm} Beat_132={51.460571428571427,1,Bb min,F#} Beat_133={51.850181818181817,0,Bb min,F#} Beat_134={52.239792207792206,0,Bb min,F#} Beat_135={52.629402597402596,0,Bb min,F#} Beat_136={53.019012987012985,1,Bb min,C#} Beat_137={53.408623376623375,0,Bb min,C#} Beat_138={53.798233766233764,0,Bb min,C#} Beat_139={54.187844155844154,0,Bb min,C#} Beat_140={54.577454545454543,1,Bb min,Ab} Beat_141={54.967064935064933,0,Bb min,Ab} Beat_142={55.356675324675322,0,Bb min,Ab} Beat_143={55.746285714285712,0,Bb min,Ab} Beat_144={56.1358961038961,1,Bb min,Bbm} Beat_145={56.525506493506491,0,Bb min,Bbm} Beat_146={56.91511688311688,0,Bb min,Bbm} Beat_147={57.30472727272727,0,Bb min,Bbm} Beat_148={57.694337662337659,1,Bb min,F#} Beat_149={58.083948051948049,0,Bb min,F#} Beat_150={58.473558441558438,0,Bb min,F#} Beat_151={58.863168831168828,0,Bb min,F#} Beat_152={59.252779220779217,1,Bb min,C#} Beat_153={59.642389610389607,0,Bb min,C#} Beat_154={60.032,0,Bb min,C#} Beat_155={60.421610389610386,0,Bb min,C#} Beat_156={60.811220779220776,1,Bb min,Ab} Beat_157={61.200831168831165,0,Bb min,Ab} Beat_158={61.590441558441555,0,Bb min,Ab} Beat_159={61.980051948051944,0,Bb min,Ab} Beat_160={62.369662337662334,1,Bb min,Bbm} Beat_161={62.759272727272723,0,Bb min,Bbm} Beat_162={63.148883116883113,0,Bb min,Bbm} Beat_163={63.5384935064935,0,Bb min,Bbm} Beat_164={63.928103896103892,1,Bb min,F#} Beat_165={64.317714285714288,0,Bb min,F#} Beat_166={64.707324675324685,0,Bb min,F#} Beat_167={65.096935064935082,0,Bb min,F#} Beat_168={65.486545454545478,1,Bb min,C#} Beat_169={65.876155844155875,0,Bb min,C#} Beat_170={66.265766233766271,0,Bb min,C#} Beat_171={66.655376623376668,0,Bb min,C#} Beat_172={67.044987012987065,1,Bb min,Ab} Beat_173={67.434597402597461,0,Bb min,Ab} Beat_174={67.824207792207858,0,Bb min,Ab} Beat_175={68.213818181818255,0,Bb min,Ab} Beat_176={68.603428571428651,1,Bb min,Bbm} Beat_177={68.993038961039048,0,Bb min,Bbm} Beat_178={69.382649350649444,0,Bb min,Bbm} Beat_179={69.772259740259841,0,Bb min,Bbm} Beat_180={70.161870129870238,1,Bb min,F#} Beat_181={70.551480519480634,0,Bb min,F#} Beat_182={70.941090909091031,0,Bb min,F#} Beat_183={71.330701298701428,0,Bb min,F#} Beat_184={71.720311688311824,1,Bb min,C#} Beat_185={72.109922077922221,0,Bb min,C#} Beat_186={72.499532467532617,0,Bb min,C#} Beat_187={72.889142857143014,0,Bb min,C#} Beat_188={73.278753246753411,1,Bb min,Ab} Beat_189={73.668363636363807,0,Bb min,Ab} Beat_190={74.0579740259742,0,Bb min,Ab} Beat_191={74.4475844155846,0,Bb min,Ab} Beat_192={74.837194805195,1,Bb min,Bbm} Beat_193={75.2268051948054,0,Bb min,Bbm} Beat_194={75.61641558441579,0,Bb min,Bbm} Beat_195={76.006025974026187,0,Bb min,Bbm} Beat_196={76.395636363636584,1,Bb min,F#} Beat_197={76.78524675324698,0,Bb min,F#} Beat_198={77.174857142857377,0,Bb min,F#} Beat_199={77.564467532467773,0,Bb min,F#} Beat_200={77.95407792207817,1,Bb min,C#} Beat_201={78.343688311688567,0,Bb min,C#} Beat_202={78.733298701298963,0,Bb min,C#} Beat_203={79.12290909090936,0,Bb min,C#} Beat_204={79.512519480519757,1,Bb min,Ab} Beat_205={79.902129870130153,0,Bb min,Ab} Beat_206={80.29174025974055,0,Bb min,Ab} Beat_207={80.681350649350946,0,Bb min,Ab} Beat_208={81.070961038961343,1,Bb min,Bbm} Beat_209={81.46057142857174,0,Bb min,Bbm} Beat_210={81.850181818182136,0,Bb min,Bbm} Beat_211={82.239792207792533,0,Bb min,Bbm} Beat_212={82.62940259740293,1,Bb min,F#} Beat_213={83.019012987013326,0,Bb min,F#} Beat_214={83.408623376623723,0,Bb min,F#} Beat_215={83.798233766234119,0,Bb min,F#} Beat_216={84.187844155844516,1,Bb min,C#} Beat_217={84.577454545454913,0,Bb min,C#} Beat_218={84.967064935065309,0,Bb min,C#} Beat_219={85.3566753246757,0,Bb min,C#} Beat_220={85.7462857142861,1,Bb min,Ab} Beat_221={86.1358961038965,0,Bb min,Ab} Beat_222={86.5255064935069,0,Bb min,Ab} Beat_223={86.915116883117292,0,Bb min,Ab} Beat_224={87.304727272727689,1,Bb min,Bbm} Beat_225={87.694337662338086,0,Bb min,Bbm} Beat_226={88.083948051948482,0,Bb min,Bbm} Beat_227={88.473558441558879,0,Bb min,Bbm} Beat_228={88.863168831169276,1,Bb min,F#} Beat_229={89.252779220779672,0,Bb min,F#} Beat_230={89.642389610390069,0,Bb min,F#} Beat_231={90.032000000000465,0,Bb min,F#} Beat_232={90.421610389610862,1,Bb min,C#} Beat_233={90.811220779221259,0,Bb min,C#} Beat_234={91.200831168831655,0,Bb min,C#} Beat_235={91.590441558442052,0,Bb min,C#} Beat_236={91.980051948052449,1,Bb min,Ab} Beat_237={92.369662337662845,0,Bb min,Ab} Beat_238={92.759272727273242,0,Bb min,Ab} Beat_239={93.148883116883638,0,Bb min,Ab} Beat_240={93.538493506494035,1,Bb min,Bbm} Beat_241={93.928103896104432,0,Bb min,Bbm} Beat_242={94.317714285714828,0,Bb min,Bbm} Beat_243={94.707324675325225,0,Bb min,Bbm} Beat_244={95.096935064935622,1,Bb min,F#} Beat_245={95.486545454546018,0,Bb min,F#} Beat_246={95.876155844156415,0,Bb min,F#} Beat_247={96.265766233766811,0,Bb min,F#} Beat_248={96.655376623377208,1,Bb min,C#} Beat_249={97.0449870129876,0,Bb min,C#} Beat_250={97.434597402598,0,Bb min,C#} Beat_251={97.8242077922084,0,Bb min,C#} Beat_252={98.2138181818188,1,Bb min,Ab} Beat_253={98.603428571429191,0,Bb min,Ab} Beat_254={98.993038961039588,0,Bb min,Ab} Beat_255={99.382649350649984,0,Bb min,Ab} Beat_256={99.772259740260381,1,Bb min,Bbm} Beat_257={100.16187012987078,0,Bb min,Bbm} Beat_258={100.55148051948117,0,Bb min,Bbm} Beat_259={100.94109090909157,0,Bb min,Bbm} Beat_260={101.33070129870197,1,Bb min,F#} Beat_261={101.72031168831236,0,Bb min,F#} Beat_262={102.10992207792276,0,Bb min,F#} Beat_263={102.49953246753316,0,Bb min,F#} Beat_264={102.88914285714355,1,Bb min,C#} Beat_265={103.27875324675395,0,Bb min,C#} Beat_266={103.66836363636435,0,Bb min,C#} Beat_267={104.05797402597474,0,Bb min,C#} Beat_268={104.44758441558514,1,Bb min,Ab} Beat_269={104.83719480519554,0,Bb min,Ab} Beat_270={105.22680519480593,0,Bb min,Ab} Beat_271={105.61641558441633,0,Bb min,Ab} Beat_272={106.00602597402673,1,Bb min,Ab} Beat_273={106.39563636363712,0,Bb min,Ab} Beat_274={106.78524675324752,0,Bb min,Ab} Beat_275={107.17485714285792,0,Bb min,Ab} Beat_276={107.56446753246831,1,C# min,C#m} Beat_277={107.95407792207871,0,C# min,C#m} Beat_278={108.34368831168911,0,C# min,C#m} Beat_279={108.7332987012995,0,C# min,C#m} Beat_280={109.1229090909099,1,C# min,A} Beat_281={109.5125194805203,0,C# min,A} Beat_282={109.90212987013069,0,C# min,A} Beat_283={110.29174025974109,0,C# min,A} Beat_284={110.68135064935149,1,C# min,E} Beat_285={111.07096103896188,0,C# min,E} Beat_286={111.46057142857228,0,C# min,E} Beat_287={111.85018181818268,0,C# min,E} Beat_288={112.23979220779307,1,C# min,B} Beat_289={112.62940259740347,0,C# min,B} Beat_290={113.01901298701387,0,C# min,B} Beat_291={113.40862337662426,0,C# min,B} Beat_292={113.79823376623466,1,C# min,C#m} Beat_293={114.18784415584506,0,C# min,C#m} Beat_294={114.57745454545545,0,C# min,C#m} Beat_295={114.96706493506585,0,C# min,C#m} Beat_296={115.35667532467625,1,C# min,A} Beat_297={115.74628571428664,0,C# min,A} Beat_298={116.13589610389704,0,C# min,A} Beat_299={116.52550649350744,0,C# min,A} Beat_300={116.91511688311783,1,C# min,E} Beat_301={117.30472727272823,0,C# min,E} Beat_302={117.69433766233863,0,C# min,E} Beat_303={118.08394805194902,0,C# min,E} Beat_304={118.47355844155942,1,C# min,B} Beat_305={118.86316883116982,0,C# min,B} Beat_306={119.25277922078021,0,C# min,B} Beat_307={119.64238961039061,0,C# min,B} Beat_308={120.032000000001,1,C# min,C#m} Beat_309={120.4216103896114,0,C# min,C#m} Beat_310={120.8112207792218,0,C# min,C#m} Beat_311={121.2008311688322,0,C# min,C#m} Beat_312={121.59044155844259,1,C# min,A} Beat_313={121.98005194805299,0,C# min,A} Beat_314={122.36966233766339,0,C# min,A} Beat_315={122.75927272727378,0,C# min,A} Beat_316={123.14888311688418,1,C# min,E} Beat_317={123.53849350649458,0,C# min,E} Beat_318={123.92810389610497,0,C# min,E} Beat_319={124.31771428571537,0,C# min,E} Beat_320={124.70732467532577,1,C# min,B} Beat_321={125.09693506493616,0,C# min,B} Beat_322={125.48654545454656,0,C# min,B} Beat_323={125.87615584415696,0,C# min,B} Beat_324={126.26576623376735,1,C# min,C#m} Beat_325={126.65537662337775,0,C# min,C#m} Beat_326={127.04498701298815,0,C# min,C#m} Beat_327={127.43459740259854,0,C# min,C#m} Beat_328={127.82420779220894,1,C# min,A} Beat_329={128.21381818181934,0,C# min,A} Beat_330={128.60342857142973,0,C# min,A} Beat_331={128.99303896104013,0,C# min,A} Beat_332={129.38264935065052,1,C# min,E} Beat_333={129.77225974026092,0,C# min,E} Beat_334={130.16187012987132,0,C# min,E} Beat_335={130.55148051948171,0,C# min,E} Beat_336={130.94109090909211,1,C# min,B} Beat_337={131.33070129870251,0,C# min,B} Beat_338={131.7203116883129,0,C# min,B} Beat_339={132.1099220779233,0,C# min,B} Beat_340={132.4995324675337,1,C# min,C#m} Beat_341={132.88914285714409,0,C# min,C#m} Beat_342={133.27875324675449,0,C# min,C#m} Beat_343={133.66836363636489,0,C# min,C#m} Beat_344={134.05797402597528,1,C# min,A} Beat_345={134.44758441558568,0,C# min,A} Beat_346={134.83719480519608,0,C# min,A} Beat_347={135.22680519480647,0,C# min,A} Beat_348={135.61641558441687,1,C# min,E} Beat_349={136.00602597402727,0,C# min,E} Beat_350={136.39563636363766,0,C# min,E} Beat_351={136.78524675324806,0,C# min,E} Beat_352={137.17485714285846,1,C# min,B} Beat_353={137.56446753246885,0,C# min,B} Beat_354={137.95407792207925,0,C# min,B} Beat_355={138.34368831168965,0,C# min,B} Beat_356={138.73329870130004,1,C# min,C#m} Beat_357={139.12290909091044,0,C# min,C#m} Beat_358={139.51251948052084,0,C# min,C#m} Beat_359={139.90212987013123,0,C# min,C#m} Beat_360={140.29174025974163,1,C# min,A} Beat_361={140.68135064935203,0,C# min,A} Beat_362={141.07096103896242,0,C# min,A} Beat_363={141.46057142857282,0,C# min,A} Beat_364={141.85018181818322,1,C# min,E} Beat_365={142.23979220779361,0,C# min,E} Beat_366={142.629402597404,0,C# min,E} Beat_367={143.01901298701441,0,C# min,E} Beat_368={143.4086233766248,1,C# min,B} Beat_369={143.7982337662352,0,C# min,B} Beat_370={144.1878441558456,0,C# min,B} Beat_371={144.577454545456,0,C# min,B} Beat_372={144.96706493506639,1,C# min,B} Beat_373={145.35667532467679,0,C# min,B} Beat_374={145.74628571428718,0,C# min,B} Beat_375={146.13589610389758,0,C# min,B} Beat_376={146.52550649350798,1,C# min,N} Beat_377={146.91511688311837,0,C# min,N} Beat_378={147.30472727272877,0,C# min,N} Beat_379={147.69433766233917,0,C# min,N} Beat_380={148.08394805194956,1,C# min,N} Beat_381={148.47355844155996,0,C# min,N} Beat_382={148.86316883117036,0,C# min,N} Beat_383={149.25277922078075,0,C# min,N} Beat_384={149.64238961039115,1,F# Maj,N} ",12263,True,4400.851991017575,median "{""createdAt"":""2019-11-01T09:09:08.181Z"",""version"":""14.0.2"",""kind"":""ARC#ProjectExport"",""requests"":[{""url"":""http://localhost:8080/Users/DeleteUserById/5dbbf49a332e690ed569770d"",""method"":""DELETE"",""payload"":"""",""name"":""Users-DeleteUserById"",""description"":""- Returns a list of all meal plans\\t\\n\\t- Example URL \\n\\t\\thttp://localhost:8080/MealPlans/GetAllMealPlans"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572599215716,""created"":1572583030268,""kind"":""ARC#RequestData"",""key"":""079dfb91-f82d-44a5-8e0e-13739ff8d086""},{""type"":""saved"",""headers"":"""",""method"":""GET"",""name"":""Semester-GetAllSemestersByMarketId"",""payload"":""grant_type=password&scope=vtms-internal-api openid profile&client_id=test-data-tool-qa&username=AA271AB99F094A20B6C410B8B28964D6&password=6i/WgG8?&client_secret=759a357ac6ad41048f60614038dd20e6"",""url"":""http://localhost:8080/Semesters/GetAllSemestersByMarketId/5dbbd6922bfe38f36f25d07e"",""updated"":1572597627774,""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""created"":1560351845341,""description"":"""",""kind"":""ARC#RequestData"",""key"":""20484cef-de53-4ff6-ae9c-294e9ba50575""},{""url"":""http://localhost:8080/MealPlans/CreateMealPlan/5dbbd6922bfe38f36f25d07f"",""method"":""POST"",""payload"":""{\\n\\""Name\\"": \\""New UPenn Meal Plan\\"",\\n\\""WeeklyCost\\"": 1,\\n\\""MarketId\\"": 1\\n}"",""name"":""MealPlan-CreateMealPlan"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572596345480,""created"":1572493165382,""description"":""- Creates a new meal plan. This meal plan will later need to be associated with a Market. The repository call to create this association exists, however, it has not yet been exposed to rest. It should perhaps be added to this endpoint. See the DBInit.go to for how to associate a meal plan with a market. \\n\\t- Example Post Body:\\n\\t\\t{\\n\\t\\t\\t\\""Name\\"": \\""Example Meal Plan\\"",\\n\\t\\t\\t\\""WeeklyCost\\"": 99.99,\\n\\t\\t}\\n\\t- Example Response (The created object Id)\\n\\t\\t{\\n\\t\\t\\t\\""Id\\"": \\""5dbbd721da252c05a4f96f48\\""\\n\\t\\t}"",""kind"":""ARC#RequestData"",""key"":""251fc719-c65f-40bd-8d75-208d8bc35b16""},{""url"":""http://localhost:8080/MealPlans/UpdateMealPlan"",""method"":""POST"",""payload"":""{\\n\\""Id\\"": \\""5dbbb0a53eae0534ab2a021b\\"",\\n\\""Name\\"": \\""TestMealPlan4Updated\\"",\\n\\""WeeklyCost\\"": 999,\\n\\""MarketId\\"": 10\\n}"",""name"":""MealPlan-UpdateMealPlan"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572592003844,""description"":""- Updates an existing meal plan. \\n\\t- Example post body \\n\\t\\t{\\n\\t\\t\\t\\""Id\\"": \\""5dbbb0a53eae0534ab2a021b\\"",\\n\\t\\t\\t\\""Name\\"": \\""Example Meal Plan - Drexel\\"",\\n\\t\\t\\t\\""WeeklyCost\\"": 102.95,\\n\\t\\t}\\n\\t- Example response\\n\\t\\t{\\n\\t\\t\\t\\""NumRecordsAffected\\"": 1,\\n\\t\\t\\t\\""TableName\\"": \\""MealPlans\\"",\\n\\t\\t\\t\\""Action\\"": \\""Update\\""\\n\\t\\t}"",""created"":1572583183839,""kind"":""ARC#RequestData"",""key"":""30d184e9-3d30-438c-8015-46e46f20950f""},{""url"":""http://localhost:8080/Users/GetAllUsers"",""method"":""GET"",""payload"":"""",""name"":""Users-GetAllUsers"",""description"":""- Returns a list of all meal plans\\t\\n\\t- Example URL \\n\\t\\thttp://localhost:8080/MealPlans/GetAllMealPlans"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572598317807,""created"":1572583030268,""kind"":""ARC#RequestData"",""key"":""447a2de1-2a50-40fe-a6f4-140c3ca8a3ec""},{""url"":""http://localhost:8080/MealPlans/GetAllMealPlansByMarketId/5dbbd6922bfe38f36f25d07f"",""method"":""GET"",""payload"":"""",""name"":""MealPlan-GetAllMeallPlansByMarketId"",""description"":""\\t- Returns a list of all meal plans available in for the given market id\\n\\t- Example URL\\n\\t\\thttp://localhost:8080/MealPlans/GetAllMealPlansByMarketId/{mealPlanId}\\n\\t- Example response\\n\\t\\t[\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\""Id\\"": \\""5dbbd6922bfe38f36f25d09e\\"",\\n\\t\\t\\t\\t\\""Name\\"": \\""UPenn Meal Plan\\"",\\n\\t\\t\\t\\t\\""WeeklyCost\\"": 149\\n\\t\\t\\t}\\n\\t\\t]"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572592398544,""created"":1572591866009,""kind"":""ARC#RequestData"",""key"":""50b72341-a1d3-4af0-ac48-72e76445b3a5""},{""type"":""saved"",""headers"":"""",""method"":""GET"",""name"":""MealPlan-GetMealPlanById"",""payload"":""grant_type=password&scope=vtms-internal-api openid profile&client_id=test-data-tool-qa&username=AA271AB99F094A20B6C410B8B28964D6&password=6i/WgG8?&client_secret=759a357ac6ad41048f60614038dd20e6"",""url"":""http://localhost:8080/MealPlans/GetMealPlanById/5dbbb0a53eae0534ab2a021b"",""updated"":1572592054225,""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""created"":1560351845341,""description"":""\\t- Gets a single meal plan by its object id \\n\\t- Example URL\\n\\t\\thttp://localhost:8080/MealPlans/GetMealPlanById/5dbbb0a53eae0534ab2a021b\\n\\t- Example response\\n\\t\\t{\\n\\t\\t\\t\\""Id\\"": \\""5dbbb0a53eae0534ab2a021b\\"",\\n\\t\\t\\t\\""Name\\"": \\""Example Meal Plan - Drexel\\"",\\n\\t\\t\\t\\""WeeklyCost\\"": 102.95,\\n\\t\\t}"",""kind"":""ARC#RequestData"",""key"":""66e4204f-46ac-431c-ab03-a398e910fcd0""},{""type"":""saved"",""headers"":""Content-Type: application/json"",""method"":""POST"",""name"":""Semester-UpdateSemester"",""payload"":""{\\n\\""Id\\"": \\""5dbbd6922bfe38f36f25d084\\"",\\n\\""StartDate\\"": \\""2019-09-01T00:00:00Z\\"",\\n\\""EndDate\\"": \\""2025-12-01T00:00:00Z\\"",\\n\\""Name\\"": \\""\\""\\n}"",""url"":""http://localhost:8080/Semesters/UpdateSemester"",""updated"":1572597786730,""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""created"":1560351845341,""description"":"""",""kind"":""ARC#RequestData"",""key"":""7aeabc5b-bd40-4851-8a1a-e94f867573dd""},{""url"":""http://localhost:8080/Markets/CreateMarket"",""method"":""POST"",""payload"":""{\\n\\""Name\\"": \\""New Market\\""\\n}"",""name"":""Market-CreateMarket"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572596906644,""created"":1572493165382,""description"":""Creates a new market"",""headers"":""Content-Type: application/json"",""kind"":""ARC#RequestData"",""key"":""8b0e0b01-4e60-4cc6-b336-33fd9e626174""},{""url"":""http://localhost:8080/MealPlans/DeleteMealPlanById/5dbbb0a53eae0534ab2a021b"",""method"":""DELETE"",""payload"":"""",""name"":""DeleteMealPlanById"",""description"":"""",""projects"":[],""type"":""saved"",""updated"":1572587054023,""created"":1572587054023,""kind"":""ARC#RequestData"",""key"":""8f0fda2b-3d36-41c5-85e3-f06cad0015fe""},{""url"":""http://localhost:8080/Markets/UpdateMarket"",""method"":""POST"",""payload"":""{\\n\\""Id\\"": \\""5dbbed0408ce788bb231fd39\\"",\\n\\""Name\\"": \\""New Market Update\\""\\n}"",""name"":""Market-UpdateMarket"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572597138716,""created"":1572493165382,""description"":""Updates the meatadata of an existing market"",""headers"":""Content-Type: application/json"",""kind"":""ARC#RequestData"",""key"":""91c49f9b-0432-49ab-a025-39807ebeb614""},{""url"":""http://localhost:8080/MealPlans/GetAllMealPlans"",""method"":""GET"",""payload"":"""",""name"":""MealPlan-GetAllMealPlans"",""description"":""- Returns a list of all meal plans\\t\\n\\t- Example URL \\n\\t\\thttp://localhost:8080/MealPlans/GetAllMealPlans"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572592164612,""created"":1572583030268,""kind"":""ARC#RequestData"",""key"":""ab41cb5d-c5e5-43b6-9855-3c6767470262""},{""headers"":""Content-Type: application/json\\nAuthorization: Bearer 644028e1fa7a3602f24c3f5c17652f9f"",""method"":""PUT"",""name"":""Add/update prepayment"",""payload"":""{\\n \\""id\\"": 413,\\n \\""name\\"": \\""PA Prepayment Form for PA-3\\"",\\n \\""prepaymentTypeId\\"": 3,\\n \\""prepaymentAmount\\"": 100,\\n \\""prepaymentPercentBasisId\\"": 1,\\n \\""registrationNumber\\"": \\""83-958-481\\"",\\n \\""filingMethod\\"": 1,\\n \\""filingFrequency\\"": 1,\\n \\""oSeriesCommittedFilingFrequencyId\\"": null,\\n \\""fiscalYearStartMonthOverride\\"": 1,\\n \\""occasionalFilingThreshold\\"": null,\\n \\""occasionalFilingStartDate\\"": null,\\n \\""allowFiscalYearOverride\\"": false,\\n \\""isEdit\\"": false,\\n \\""isCommitted\\"": false,\\n \\""configuratorColorId\\"": 3,\\n \\""startDate\\"": \\""0001-01-01\\"",\\n \\""isExpired\\"": false,\\n \\""schedules\\"": [\\n \\n ],\\n \\""fields\\"": [\\n \\n ]\\n}"",""type"":""saved"",""url"":""http://localhost:23521/config/api/v1/returns/413?taxpayerId=1853"",""updated"":1504810089825,""id"":""Add%2Fupdate%20prepayment/http%3A%2F%2Flocalhost%3A23521%2Fconfig%2Fapi%2Fv1%2Freturns%2F1692%3FtaxpayerId%3D1853/POST/e24abddc-3ba6-4889-aff1-23f544706487"",""projects"":[""e24abddc-3ba6-4889-aff1-23f544706487""],""created"":1504810089825,""kind"":""ARC#RequestData"",""key"":""add%2Fupdate%20prepayment/http%3A%2F%2Flocalhost%3A23521%2Fconfig%2Fapi%2Fv1%2Freturns%2F413%3Ftaxpayerid%3D1853/put/e24abddc-3ba6-4889-aff1-23f544706487""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer ac08b84bf09268f3d8be52f43332c959"",""method"":""GET"",""name"":""AdminMetricsReport"",""payload"":""{\\n \\""taxpayerFilingPeriodId\\"": 413\\n}"",""url"":""http://localhost:23521/admin/api/core/metrics"",""updated"":1517945134716,""projects"":[""e24abddc-3ba6-4889-aff1-23f544706487""],""created"":1517945134716,""kind"":""ARC#RequestData"",""key"":""adminmetricsreport/http%3A%2F%2Flocalhost%3A23521%2Fadmin%2Fapi%2Fcore%2Fmetrics/get/e24abddc-3ba6-4889-aff1-23f544706487""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer c851e2b335127f2bc84a48df06f736a2"",""method"":""GET"",""name"":""AdminMetricsReport"",""payload"":""{\\n \\""taxpayerFilingPeriodId\\"": 413\\n}"",""url"":""http://localhost:23521/retailtaxextract/api/v1/companies/TRANS1/locations"",""updated"":1520878816891,""projects"":[""c17fe24f-2455-4017-a470-a714f94bd1ff""],""created"":1520878816891,""kind"":""ARC#RequestData"",""key"":""adminmetricsreport/http%3A%2F%2Flocalhost%3A23521%2Fretailtaxextract%2Fapi%2Fv1%2Fcompanies%2Ftrans1%2Flocations/get/c17fe24f-2455-4017-a470-a714f94bd1ff""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer 96b0287e84d694f5dd8489165bf15cd7"",""method"":""POST"",""name"":""CopyProducts-DEV"",""payload"":""{\\n\\tcopyFromTaxpayerId: 4208,\\n\\tcopyToTaxpayerId: 5209\\n}"",""url"":""https://devportal.vertexsmb.com/config/api/v1/companies/5209/products/copyProducts"",""updated"":1501167866048,""projects"":[""bcdb1971-d5a9-4b04-b53d-0e9992f96960""],""created"":1501167866048,""kind"":""ARC#RequestData"",""key"":""copyproducts-dev/https%3A%2F%2Fdevportal.vertexsmb.com%2Fconfig%2Fapi%2Fv1%2Fcompanies%2F5209%2Fproducts%2Fcopyproducts/post/bcdb1971-d5a9-4b04-b53d-0e9992f96960""},{""type"":""saved"",""headers"":""Content-Type: application/json"",""method"":""POST"",""name"":""CopyProducts-Local"",""payload"":""{\\n\\tcopyFromTaxpayerId: 4208,\\n\\tcopyToTaxpayerId: 5209\\n}"",""url"":""http://localhost:23521/config/api/v1/companies/5209/products/copyProducts"",""updated"":1501166974856,""projects"":[""bcdb1971-d5a9-4b04-b53d-0e9992f96960""],""created"":1501166974856,""kind"":""ARC#RequestData"",""key"":""copyproducts-local/http%3A%2F%2Flocalhost%3A23521%2Fconfig%2Fapi%2Fv1%2Fcompanies%2F5209%2Fproducts%2Fcopyproducts/post/bcdb1971-d5a9-4b04-b53d-0e9992f96960""},{""headers"":"""",""method"":""POST"",""name"":""CustomerAdminDetails"",""payload"":""{\\n\\tdeployment: \\""sandbox_dev_deploy-latest.json\\""\\n \\tbranch: \\""8.4.0\\""\\n \\trelease: \\""8.4.0.55555\\""\\n \\tfailedRedeploy: \\""false\\""\\n \\tcustomRedeploy: \\""false\\""\\n}\\n"",""type"":""saved"",""url"":""https://localhost:44327/api/deploymentautomation/deploy"",""updated"":1562559656061,""created"":1562559656061,""kind"":""ARC#RequestData"",""key"":""customeradmindetails/https%3A%2F%2Flocalhost%3A44327%2Fapi%2Fdeploymentautomation%2Fdeploy/post""},{""url"":""http://localhost:8080/Users/CreateUser"",""method"":""POST"",""payload"":""{\\n\\""Id\\"": \\""5dbbf49a332e690ed5697707\\"",\\n\\""MealPlanId\\"": \\""5dbbf49a332e690ed56976f9\\"",\\n\\""MarketId\\"": \\""5dbbf49a332e690ed56976db\\"",\\n\\""Name\\"": \\""SuperDrexelUser121\\""\\n}"",""name"":""Users-CreateUser"",""description"":""- Returns a list of all meal plans\\t\\n\\t- Example URL \\n\\t\\thttp://localhost:8080/MealPlans/GetAllMealPlans"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572599077047,""created"":1572583030268,""headers"":""Content-Type: application/json"",""kind"":""ARC#RequestData"",""key"":""dc538e54-5edb-4cdb-82fc-a0ce410ae035""},{""type"":""saved"",""headers"":""Content-Type: application/json"",""method"":""POST"",""name"":""deploy"",""payload"":""{\\n \\""deployment\\"": \\""sandbox_dev_deploy-latest.json\\"",\\n \\""branch\\"": \\""8.4.0\\"",\\n \\""release\\"": null,\\n \\""failedRedeploy\\"": \\""false\\"",\\n \\""customRedeploy\\"": \\""false\\"",\\n \\""jiraApiToken\\"": \\""bWljaGFlbC5zY3V0ZXJpQHZlcnRleHNtYi5jb206VnNFMjQ0dGRlZXpmeThsYzFCQng5Njc5\\"",\\n \\""debugMode\\"": \\""false\\"",\\n \\""targetEnvironment\\"": \\""DEV\\"",\\n \\""skipUpToDateProjets\\"": \\""true\\"" \\n}"",""url"":""https://localhost:44327/api/deploymentautomation/deploy"",""updated"":1563915846737,""projects"":[""09257249-fc57-440c-9d13-26ab65d91915""],""created"":1563915846737,""kind"":""ARC#RequestData"",""key"":""deploy/https%3A%2F%2Flocalhost%3A44327%2Fapi%2Fdeploymentautomation%2Fdeploy/post/09257249-fc57-440c-9d13-26ab65d91915""},{""type"":""google-drive"",""headers"":""Content-Type: application/json"",""method"":""GET"",""name"":""DoorBellGetSongDuration"",""payload"":""{\\n \\""macAddress\\"": 1,\\n \\""songYoutubeUrl\\"" : \\""https://www.youtube.com/watch?v=8bCkadgRskA&list=RDGMEMYH9CUrFO7CfLJpaD7UR85wVM4L1sxibr8IA&index=4\\""\\n}\\n "",""url"":""http://localhost:64804/api/ThemeSongs/getSongDuration?videoUrl=\\""https://www.youtube.com/watch?v=bzjQvsn921k&list=RDMMbzjQvsn921k\\"""",""driveId"":""0B1Md6aFsPGPEVDl4WjVKanJCd3M"",""updated"":1506539642593,""projects"":[""74c3eca7-2e03-4a42-8800-1707929e980f""],""created"":1506539642593,""kind"":""ARC#RequestData"",""key"":""doorbellgetsongduration/http%3A%2F%2Flocalhost%3A64804%2Fapi%2Fthemesongs%2Fgetsongduration%3Fvideourl%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dbzjqvsn921k%26list%3Drdmmbzjqvsn921k%22/get/74c3eca7-2e03-4a42-8800-1707929e980f""},{""type"":""saved"",""headers"":""Content-Type: application/json"",""method"":""POST"",""name"":""DoorBellPost"",""payload"":""{\\n \\""macAddress\\"": 1,\\n \\""songYoutubeUrl\\"" : \\""https://www.youtube.com/watch?v=8bCkadgRskA&list=RDGMEMYH9CUrFO7CfLJpaD7UR85wVM4L1sxibr8IA&index=4\\""\\n}\\n "",""url"":""http://localhost:64804/api/ThemeSongs/postThemeSong"",""updated"":1506523677369,""projects"":[""74c3eca7-2e03-4a42-8800-1707929e980f""],""created"":1506523677369,""kind"":""ARC#RequestData"",""key"":""doorbellpost/http%3A%2F%2Flocalhost%3A64804%2Fapi%2Fthemesongs%2Fpostthemesong/post/74c3eca7-2e03-4a42-8800-1707929e980f""},{""url"":""http://localhost:8080/MealPlans/DeleteMealPlanById/5dbbd6922bfe38f36f25d09c"",""method"":""DELETE"",""payload"":"""",""name"":""MealPlan-DeleteMealPlan"",""description"":""- First, removes any MealPlan_x_Market associations containing the given MealPlanId, then Updates the \\""MealPlanId\\"" of any users subscribed to the meal plan to null, then deletes the meal plan \\n\\t- Example URL \\n\\t\\thttp://localhost:8080/MealPlans/DeleteMealPlanById/5dbbb0a53eae0534ab2a021b\\n\\t- Example Response\\n\\t\\t[\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\""NumRecordsAffected\\"": 1,\\n\\t\\t\\t\\t\\""TableName\\"": \\""MealPlan_x_Market\\"",\\n\\t\\t\\t\\t\\""Action\\"": \\""Delete\\""\\n\\t\\t\\t},\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\""NumRecordsAffected\\"": 1,\\n\\t\\t\\t\\t\\""TableName\\"": \\""Users\\"",\\n\\t\\t\\t\\t\\""Action\\"": \\""Updated\\""\\n\\t\\t\\t},\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\""NumRecordsAffected\\"": 1,\\n\\t\\t\\t\\t\\""TableName\\"": \\""MealPlans\\"",\\n\\t\\t\\t\\t\\""Action\\"": \\""Delete\\""\\n\\t\\t\\t}\\n\\t\\t]"",""projects"":[""cce66898-53b6-466d-a223-be6e369948bc""],""type"":""saved"",""updated"":1572592121990,""created"":1572591866009,""kind"":""ARC#RequestData"",""key"":""ed27c915-2894-4519-8e4b-ebabce7eced5""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer ac08b84bf09268f3d8be52f43332c959"",""method"":""POST"",""name"":""GeneratePrepayments"",""payload"":""{\\n \\""taxpayerFilingPeriodId\\"": 413\\n}"",""url"":""http://localhost:23521/admin/api/adminCustomerPrePayments/generatePrepaymentForms"",""updated"":1516742918344,""projects"":[""e24abddc-3ba6-4889-aff1-23f544706487""],""created"":1516742918344,""kind"":""ARC#RequestData"",""key"":""generateprepayments/http%3A%2F%2Flocalhost%3A23521%2Fadmin%2Fapi%2Fadmincustomerprepayments%2Fgenerateprepaymentforms/post/e24abddc-3ba6-4889-aff1-23f544706487""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer 644028e1fa7a3602f24c3f5c17652f9f"",""method"":""POST"",""name"":""GeneratePrepayments"",""payload"":""{\\n taxpayerFilingPeriodId: 16979\\n}"",""url"":""http://localhost:23521/managetaxreturns/api/prepayments/generatePrepaymentForms"",""updated"":1516818002281,""projects"":[""e24abddc-3ba6-4889-aff1-23f544706487""],""created"":1516818002281,""kind"":""ARC#RequestData"",""key"":""generateprepayments/http%3A%2F%2Flocalhost%3A23521%2Fmanagetaxreturns%2Fapi%2Fprepayments%2Fgenerateprepaymentforms/post/e24abddc-3ba6-4889-aff1-23f544706487""},{""type"":""saved"",""headers"":""Content-Type: application/x-www-form-urlencoded"",""method"":""POST"",""name"":""GetBearerToken-DEV"",""payload"":""grant_type=password&scope=vtms-portal vtms-internal-api openid profile&client_id=test-data-tool-qa&username=vertuser2@vertex.local&password=P@ssw0rd@D3v&client_secret=759a357ac6ad41048f60614038dd20e6"",""url"":""https://devauth.vertexsmb.com/identity/connect/token"",""updated"":1560351845341,""projects"":[""40e64c1f-3fdc-4022-bd0e-b9241eeab72e""],""created"":1560351845341,""kind"":""ARC#RequestData"",""key"":""getbearertoken-dev/https%3A%2F%2Fdevauth.vertexsmb.com%2Fidentity%2Fconnect%2Ftoken/post/40e64c1f-3fdc-4022-bd0e-b9241eeab72e""},{""type"":""saved"",""headers"":""Content-Type: application/x-www-form-urlencoded"",""method"":""POST"",""name"":""GetBearerToken-Local"",""payload"":""grant_type=password&scope=vtms-portal vtms-internal-api openid profile&client_id=test-data-tool-dev&username=VertexUser1214&password=B0necru$h3r&client_secret=8958454c062d425b86e05e51161cb6fc"",""url"":""http://localhost:23510/identity/connect/token"",""updated"":1547652917768,""projects"":[""40e64c1f-3fdc-4022-bd0e-b9241eeab72e""],""created"":1547652917768,""kind"":""ARC#RequestData"",""key"":""getbearertoken-local/http%3A%2F%2Flocalhost%3A23510%2Fidentity%2Fconnect%2Ftoken/post/40e64c1f-3fdc-4022-bd0e-b9241eeab72e""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer 46aab2ec819892d78921df5311b53f08"",""method"":""GET"",""name"":""getBracketSchedule"",""payload"":""{\\n \\""taxpayerFilingPeriodId\\"": 413\\n}"",""url"":""http://localhost:23521/retailtaxextract/api/v1/retailtaxextracts/brackets/schedule?bracketScheduleId=8&configurationContainerId=&impositionTypeName=Combined&mainDivisionJursidictionId=11"",""updated"":1525186389380,""projects"":[""c17fe24f-2455-4017-a470-a714f94bd1ff""],""created"":1525186389380,""kind"":""ARC#RequestData"",""key"":""getbracketschedule/http%3A%2F%2Flocalhost%3A23521%2Fretailtaxextract%2Fapi%2Fv1%2Fretailtaxextracts%2Fbrackets%2Fschedule%3Fbracketscheduleid%3D8%26configurationcontainerid%3D%26impositiontypename%3Dcombined%26maindivisionjursidictionid%3D11/get/c17fe24f-2455-4017-a470-a714f94bd1ff""},{""headers"":""Content-Type: application/json\\nAuthorization: Bearer df8daf9d19c222a01c5b8ac4cc314c8a"",""method"":""GET"",""name"":""GetPartitions"",""payload"":""{\\n \\""subscriptionTypes\\"": {\\n \\""standard\\"": {\\n \\""id\\"": 40,\\n \\""name\\"": \\""Standard\\"",\\n \\""code\\"": \\""stand\\""\\n },\\n \\""professional\\"": {\\n \\""id\\"": 50,\\n \\""name\\"": \\""Professional\\"",\\n \\""code\\"": \\""prof\\""\\n },\\n \\""premium\\"": {\\n \\""id\\"": 60,\\n \\""name\\"": \\""Premium\\"",\\n \\""code\\"": \\""prem\\""\\n },\\n \\""cancel\\"": {\\n \\""id\\"": 11,\\n \\""name\\"": \\""Cancellation\\"",\\n \\""code\\"": \\""term\\""\\n },\\n \\""all\\"": [\\n {\\n \\""id\\"": 40,\\n \\""name\\"": \\""Standard\\"",\\n \\""code\\"": \\""stand\\""\\n },\\n {\\n \\""id\\"": 50,\\n \\""name\\"": \\""Professional\\"",\\n \\""code\\"": \\""prof\\""\\n },\\n {\\n \\""id\\"": 60,\\n \\""name\\"": \\""Premium\\"",\\n \\""code\\"": \\""prem\\""\\n },\\n {\\n \\""id\\"": 11,\\n \\""name\\"": \\""Cancellation\\"",\\n \\""code\\"": \\""term\\""\\n }\\n ]\\n },\\n \\""countryId\\"": 1,\\n \\""subscriptionFeatures\\"": 3,\\n \\""hasTaxabilityImpactReport\\"": false,\\n \\""hasRateFile\\"": false,\\n \\""hasRateFileCalc\\"": false,\\n \\""hasTestInstance\\"": false,\\n \\""role\\"": 1,\\n \\""clientSubTypeCode\\"": \\""VAR\\"",\\n \\""clientId\\"": 6357,\\n \\""clientName\\"": \\""TstClientName\\"",\\n \\""firstName\\"": \\""TstFirstName\\"",\\n \\""lastName\\"": \\""TstLastName\\"",\\n \\""email\\"": \\""TstEmailAddress@email.com\\"",\\n \\""phone\\"": \\""(555) 555-5555x55555\\"",\\n \\""address1\\"": \\""123 Fourth Street\\"",\\n \\""city\\"": \\""Philadelphia\\"",\\n \\""stateCode\\"": \\""PA\\"",\\n \\""postalCode\\"": \\""19128\\"",\\n \\""subscriptionId\\"": 50\\n}"",""type"":""saved"",""url"":""http://localhost:23530/api/core/partition/partitions"",""updated"":1510239389260,""projects"":[""bcdb1971-d5a9-4b04-b53d-0e9992f96960""],""created"":1510239389260,""kind"":""ARC#RequestData"",""key"":""getpartitions/http%3A%2F%2Flocalhost%3A23530%2Fapi%2Fcore%2Fpartition%2Fpartitions/get/bcdb1971-d5a9-4b04-b53d-0e9992f96960""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer 6abe05ff139fb20371a0e704e349e91e"",""method"":""GET"",""name"":""GetPrepayments-DEV"",""payload"":"""",""url"":""https://devportal.vertexsmb.com/manageTaxReturns/api/prepayments/16391"",""updated"":1501182779608,""projects"":[""e24abddc-3ba6-4889-aff1-23f544706487""],""created"":1501182779608,""kind"":""ARC#RequestData"",""key"":""getprepayments-dev/https%3A%2F%2Fdevportal.vertexsmb.com%2Fmanagetaxreturns%2Fapi%2Fprepayments%2F16391/get/e24abddc-3ba6-4889-aff1-23f544706487""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer c851e2b335127f2bc84a48df06f736a2"",""method"":""GET"",""name"":""getRteStatus"",""payload"":""{\\n \\""taxpayerFilingPeriodId\\"": 413\\n}"",""url"":""http://localhost:23521/retailtaxextract/api/v1/retailtaxextracts/brackets/getRteStatus"",""updated"":1524589897745,""projects"":[""c17fe24f-2455-4017-a470-a714f94bd1ff""],""created"":1524589897745,""kind"":""ARC#RequestData"",""key"":""getrtestatus/http%3A%2F%2Flocalhost%3A23521%2Fretailtaxextract%2Fapi%2Fv1%2Fretailtaxextracts%2Fbrackets%2Fgetrtestatus/get/c17fe24f-2455-4017-a470-a714f94bd1ff""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer 6abe05ff139fb20371a0e704e349e91e"",""method"":""GET"",""name"":""hasPrepayments-Local"",""payload"":"""",""url"":""http://localhost:23521/managetaxreturns/api/prepayments/4208/hasRegisteredPrepayments"",""updated"":1502117144844,""projects"":[""e24abddc-3ba6-4889-aff1-23f544706487""],""created"":1502117144844,""kind"":""ARC#RequestData"",""key"":""hasprepayments-local/http%3A%2F%2Flocalhost%3A23521%2Fmanagetaxreturns%2Fapi%2Fprepayments%2F4208%2Fhasregisteredprepayments/get/e24abddc-3ba6-4889-aff1-23f544706487""},{""type"":""google-drive"",""headers"":""Content-Type: application/json\\nUser-Agent: mgscuteri@gmail.com"",""method"":""GET"",""name"":""Last.Fm get artists"",""payload"":"""",""url"":"" http://ws.audioscrobbler.com/2.0/?method=artist.search&artist=joyryde&api_key=4635d8c6a44e2a305f278211e328b678&format=json"",""driveId"":""0B1Md6aFsPGPEdVBwcThuWFhTYzQ"",""updated"":1503949896064,""projects"":[""31712db4-ea49-41d7-9347-181fcc2a11f0""],""created"":1503949896064,""kind"":""ARC#RequestData"",""key"":""last.fm%20get%20artists/%20http%3A%2F%2Fws.audioscrobbler.com%2F2.0%2F%3Fmethod%3Dartist.search%26artist%3Djoyryde%26api_key%3D4635d8c6a44e2a305f278211e328b678%26format%3Djson/get/31712db4-ea49-41d7-9347-181fcc2a11f0""},{""headers"":""Content-Type: application/json\\nAuthorization: Bearer b197c1ee430be01eb64607d384c8dd1a"",""method"":""POST"",""name"":""Post Transaction"",""payload"":""{\\""ID\\"":6,\\""Product\\"":\\""testProdcut\\"",\\""Quantity\\"":3,\\""Total\\"":40.45}"",""type"":""saved"",""url"":""http://localhost:8084/transaction"",""updated"":1519062144563,""projects"":[""f24d0a85-9648-49f3-98a9-774382424d8f""],""created"":1519062144563,""kind"":""ARC#RequestData"",""key"":""post%20transaction/http%3A%2F%2Flocalhost%3A8084%2Ftransaction/post/f24d0a85-9648-49f3-98a9-774382424d8f""},{""headers"":""Content-Type: application/json\\nAuthorization: Bearer ccb019f7cc49678596094f54e8f970f8"",""method"":""GET"",""name"":""prepaymentPercentBases-Local"",""payload"":"""",""type"":""saved"",""url"":""http://localhost:23521/config/api/v1/percentbases"",""updated"":1502375357461,""projects"":[""e24abddc-3ba6-4889-aff1-23f544706487""],""created"":1502375357461,""kind"":""ARC#RequestData"",""key"":""prepaymentpercentbases-local/http%3A%2F%2Flocalhost%3A23521%2Fconfig%2Fapi%2Fv1%2Fpercentbases/get/e24abddc-3ba6-4889-aff1-23f544706487""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer 3395b80b9cf6df3d3b77ab0bc70ce75a"",""method"":""POST"",""name"":""RequestDataExtract-Local"",""payload"":""{\\n\\t\\""CompanyCode\\"": \\""CA123\\"",\\n\\t\\""ExtractName\\"": \\""AP Reconciliation WITH Parent Taxpayer\\"",\\n\\t\\""FilterValue\\"": [\\n\\t\\t\\""01/07/2019\\"",\\n\\t\\t\\""01/07/2019\\"",\\n\\t\\t\\""Output Tax\\"",\\n\\t\\t\\""CA123\\""\\n\\t]\\n}"",""url"":""http://localhost:23530/public/1/reports"",""updated"":1547653020471,""projects"":[""0ca82801-45ba-491a-ad5d-bdadcf7a3ed0""],""created"":1547653020471,""kind"":""ARC#RequestData"",""key"":""requestdataextract-local/http%3A%2F%2Flocalhost%3A23530%2Fpublic%2F1%2Freports/post/0ca82801-45ba-491a-ad5d-bdadcf7a3ed0""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nAuthorization: Bearer ac08b84bf09268f3d8be52f43332c959"",""method"":""POST"",""name"":""RequestDataExtract"",""payload"":""{\\n\\t\\""CompanyCode\\"": \\""knq41\\"",\\n\\t\\""ExtractName\\"": \\""AP Reconciliation WITH Parent Taxpayer\\"",\\n\\t\\""FilterValue\\"": [\\n\\t\\t\\""01/07/2019\\"",\\n\\t\\t\\""01/07/2019\\"",\\n\\t\\t\\""Output Tax\\"",\\n\\t\\t\\""PT01\\""\\n\\t]\\n}"",""url"":""https://devapi.vertexsmb.com/public/1/reports"",""updated"":1547652474645,""projects"":[""0ca82801-45ba-491a-ad5d-bdadcf7a3ed0""],""created"":1547652474645,""kind"":""ARC#RequestData"",""key"":""requestdataextract/https%3A%2F%2Fdevapi.vertexsmb.com%2Fpublic%2F1%2Freports/post/0ca82801-45ba-491a-ad5d-bdadcf7a3ed0""},{""type"":""saved"",""headers"":""Content-Type: application/json\\nauthorization: Bearer 84e8f5355cc0b5561f928e65f6919be1"",""method"":""POST"",""name"":""RequestTransactionReport"",""payload"":""{\\n \\""reportType\\"": 1,\\n \\""startDate\\"": \\""2015-01-08\\"",\\n \\""endDate\\"": \\""2018-11-10\\""\\n}"",""url"":""https://devportal.vertexsmb.com/config/api/v1/companies/4070/transactionreports"",""updated"":1542297226154,""projects"":[""40e64c1f-3fdc-4022-bd0e-b9241eeab72e""],""created"":1542297226154,""kind"":""ARC#RequestData"",""key"":""requesttransactionreport/https%3A%2F%2Fdevportal.vertexsmb.com%2Fconfig%2Fapi%2Fv1%2Fcompanies%2F4070%2Ftransactionreports/post/40e64c1f-3fdc-4022-bd0e-b9241eeab72e""},{""type"":""saved"",""headers"":""Accept: application/json\\nx-api-key: 0fd28c7d-20e9-49c5-a0bb-5f1ac37ea3e7"",""method"":""GET"",""name"":""SetList.fm - Get Band info from MBID"",""payload"":"""",""url"":""https://api.setlist.fm/rest/1.0/artist/b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d"",""updated"":1503951374327,""projects"":[""31712db4-ea49-41d7-9347-181fcc2a11f0""],""created"":1503951374327,""kind"":""ARC#RequestData"",""key"":""setlist.fm%20-%20get%20band%20info%20from%20mbid/https%3A%2F%2Fapi.setlist.fm%2Frest%2F1.0%2Fartist%2Fb10bbbfc-cf9e-42e0-be17-e2c3e1d2600d/get/31712db4-ea49-41d7-9347-181fcc2a11f0""},{""type"":""saved"",""headers"":""Accept: application/json\\nx-api-key: 0fd28c7d-20e9-49c5-a0bb-5f1ac37ea3e7"",""method"":""GET"",""name"":""SetList.fm - Search for Band MBID"",""payload"":"""",""url"":""https://api.setlist.fm/rest/1.0/search/artists?artistName=Joyryde&p=1&sort=sortName"",""updated"":1504017867043,""projects"":[""31712db4-ea49-41d7-9347-181fcc2a11f0""],""created"":1504017867043,""kind"":""ARC#RequestData"",""key"":""setlist.fm%20-%20search%20for%20band%20mbid/https%3A%2F%2Fapi.setlist.fm%2Frest%2F1.0%2Fsearch%2Fartists%3Fartistname%3Djoyryde%26p%3D1%26sort%3Dsortname/get/31712db4-ea49-41d7-9347-181fcc2a11f0""},{""type"":""google-drive"",""headers"":""\\n"",""method"":""GET"",""name"":""YoutubeApiGetVideoDetails"",""payload"":""{\\n \\""macAddress\\"": 1,\\n \\""songYoutubeUrl\\"" : \\""https://www.youtube.com/watch?v=8bCkadgRskA&list=RDGMEMYH9CUrFO7CfLJpaD7UR85wVM4L1sxibr8IA&index=4\\""\\n}\\n "",""url"":""https://www.googleapis.com/youtube/v3/videos?part=contentDetails?part?id=51hkxmw0sqA"",""driveId"":""0B1Md6aFsPGPETDExX1VJRzc5ZDQ"",""updated"":1506526698116,""projects"":[""74c3eca7-2e03-4a42-8800-1707929e980f""],""created"":1506526698116,""kind"":""ARC#RequestData"",""key"":""youtubeapigetvideodetails/https%3A%2F%2Fwww.googleapis.com%2Fyoutube%2Fv3%2Fvideos%3Fpart%3Dcontentdetails%3Fpart%3Fid%3D51hkxmw0sqa/get/74c3eca7-2e03-4a42-8800-1707929e980f""}],""projects"":[{""updated"":1572599317478,""order"":0,""requests"":[],""name"":""GoWebApp"",""kind"":""ARC#ProjectData"",""key"":""cce66898-53b6-466d-a223-be6e369948bc""}]}",12128,True,2539.930139016408,median "[MusicConfig] Location=43962 Jolin Tsai - Dancing Diva/Jolin Tsai - Dacing Diva.mp3 Extension=mp3 MD5=ad‌​1f‌​e8‌​55‌​09‌​c7‌​ea‌​b0‌​73‌​da‌​a1‌​e5‌​2f‌​c3‌​dc‌​80 Source=OSU MetreNumber=4 Title=Dancing Diva [TagConfig] Tagger=Carra Time=2016/9/3 20:24:21 Confidence=4 [MiscConfig] LinkedFile=43962 Jolin Tsai - Dancing Diva/Jolin Tsai - Dancing Diva (Breeze) [Agate's Normal].osu osuMapID=43962 [BeatInfo] Count=382 Beat_0={0.37,1,C# min,C#m} Beat_1={0.85387096774193494,0,C# min,C#m} Beat_2={1.33774193548387,0,C# min,C#m} Beat_3={1.8216129032258051,0,C# min,C#m} Beat_4={2.30548387096774,1,C# min,C#m} Beat_5={2.7893548387096749,0,C# min,C#m} Beat_6={3.27322580645161,0,C# min,C#m} Beat_7={3.757096774193545,0,C# min,C#m} Beat_8={4.24096774193548,1,C# min,C#m} Beat_9={4.7248387096774147,0,C# min,C#m} Beat_10={5.20870967741935,0,C# min,C#m} Beat_11={5.6925806451612848,0,C# min,C#m} Beat_12={6.17645161290322,1,C# min,C#} Beat_13={6.6603225806451549,0,C# min,C#} Beat_14={7.14419354838709,0,C# min,C#} Beat_15={7.628064516129025,0,C# min,C#} Beat_16={8.11193548387096,1,C# min,Bdim} Beat_17={8.5958064516128942,0,C# min,Bdim} Beat_18={9.0796774193548284,0,C# min,Bdim} Beat_19={9.5635483870967626,0,C# min,Bdim} Beat_20={10.047419354838697,1,C# min,C#} Beat_21={10.531290322580631,0,C# min,C#} Beat_22={11.015161290322565,0,C# min,C#} Beat_23={11.4990322580645,0,C# min,C#} Beat_24={11.982903225806433,1,C# min,Bdim} Beat_25={12.466774193548368,0,C# min,Bdim} Beat_26={12.950645161290302,0,C# min,Bdim} Beat_27={13.434516129032236,0,C# min,Bdim} Beat_28={13.91838709677417,1,C# min,C#} Beat_29={14.402258064516104,0,C# min,C#} Beat_30={14.886129032258038,0,C# min,C#} Beat_31={15.369999999999973,0,C# min,C#} Beat_32={15.853870967741907,1,C# min,Bdim} Beat_33={16.337741935483841,0,C# min,Bdim} Beat_34={16.821612903225777,0,C# min,Bdim} Beat_35={17.305483870967713,0,C# min,Bdim} Beat_36={17.789354838709649,1,C# min,C#} Beat_37={18.273225806451585,0,C# min,C#} Beat_38={18.757096774193521,0,C# min,C#} Beat_39={19.240967741935457,0,C# min,C#} Beat_40={19.724838709677392,1,C# min,Bdim} Beat_41={20.208709677419328,0,C# min,Bdim} Beat_42={20.692580645161264,0,C# min,Bdim} Beat_43={21.1764516129032,0,C# min,Bdim} Beat_44={21.660322580645136,1,C# min,C#} Beat_45={22.144193548387072,0,C# min,C#} Beat_46={22.628064516129008,0,C# min,C#} Beat_47={23.111935483870944,0,C# min,C#} Beat_48={23.59580645161288,1,C# min,C#} Beat_49={24.079677419354816,0,C# min,C#} Beat_50={24.563548387096752,0,C# min,D} Beat_51={25.047419354838688,0,C# min,D} Beat_52={25.531290322580624,1,C# min,E} Beat_53={26.01516129032256,0,C# min,E} Beat_54={26.499032258064496,0,C# min,D} Beat_55={26.982903225806432,0,C# min,D} Beat_56={27.466774193548368,1,C# min,C#} Beat_57={27.950645161290304,0,C# min,C#} Beat_58={28.434516129032239,0,C# min,D} Beat_59={28.918387096774175,0,C# min,D} Beat_60={29.402258064516111,1,C# min,E} Beat_61={29.886129032258047,0,C# min,E} Beat_62={30.369999999999983,0,C# min,D} Beat_63={30.853870967741919,0,C# min,D} Beat_64={31.337741935483855,1,C# min,C#} Beat_65={31.821612903225791,0,C# min,C#} Beat_66={32.305483870967727,0,C# min,D} Beat_67={32.789354838709663,0,C# min,D} Beat_68={33.2732258064516,1,C# min,E} Beat_69={33.757096774193535,0,C# min,E} Beat_70={34.240967741935471,0,C# min,D} Beat_71={34.724838709677407,0,C# min,D} Beat_72={35.208709677419343,1,C# min,C#} Beat_73={35.692580645161279,0,C# min,C#} Beat_74={36.176451612903215,0,C# min,C#} Beat_75={36.66032258064515,0,C# min,C#} Beat_76={37.144193548387086,1,C# min,C#} Beat_77={37.628064516129022,0,C# min,C#} Beat_78={38.111935483870958,0,C# min,C#} Beat_79={38.595806451612894,0,C# min,C#} Beat_80={39.07967741935483,1,C# min,C#} Beat_81={39.563548387096766,0,C# min,C#} Beat_82={40.0474193548387,0,C# min,C#} Beat_83={40.531290322580638,0,C# min,C#} Beat_84={41.015161290322574,1,C# min,E} Beat_85={41.49903225806451,0,C# min,E} Beat_86={41.982903225806446,0,C# min,E} Beat_87={42.466774193548382,0,C# min,E} Beat_88={42.950645161290318,1,C# min,A} Beat_89={43.434516129032254,0,C# min,A} Beat_90={43.91838709677419,0,C# min,A} Beat_91={44.402258064516126,0,C# min,A} Beat_92={44.886129032258062,1,C# min,Abm} Beat_93={45.37,0,C# min,Abm} Beat_94={45.853870967741933,0,C# min,Abm} Beat_95={46.337741935483869,0,C# min,Abm} Beat_96={46.821612903225805,1,C# min,C#} Beat_97={47.305483870967741,0,C# min,C#} Beat_98={47.789354838709677,0,C# min,C#} Beat_99={48.273225806451613,0,C# min,C#} Beat_100={48.757096774193549,1,C# min,E} Beat_101={49.240967741935485,0,C# min,E} Beat_102={49.724838709677421,0,C# min,E} Beat_103={50.208709677419357,0,C# min,E} Beat_104={50.692580645161293,1,C# min,A} Beat_105={51.176451612903229,0,C# min,A} Beat_106={51.660322580645165,0,C# min,A} Beat_107={52.1441935483871,0,C# min,A} Beat_108={52.628064516129037,1,C# min,C#sus4} Beat_109={53.111935483870973,0,C# min,C#sus4} Beat_110={53.595806451612908,0,C# min,C#sus4} Beat_111={54.079677419354844,0,C# min,C#sus4} Beat_112={54.56354838709678,1,C# min,C#m} Beat_113={55.047419354838716,0,C# min,C#m} Beat_114={55.531290322580652,0,C# min,C#m} Beat_115={56.015161290322588,0,C# min,C#m} Beat_116={56.499032258064524,1,C# min,C#m} Beat_117={56.98290322580646,0,C# min,C#m} Beat_118={57.466774193548396,0,C# min,C#m} Beat_119={57.950645161290332,0,C# min,C#m} Beat_120={58.434516129032268,1,C# min,C#m} Beat_121={58.918387096774204,0,C# min,C#m} Beat_122={59.40225806451614,0,C# min,C#m} Beat_123={59.886129032258076,0,C# min,C#m} Beat_124={60.370000000000012,1,C# min,C#} Beat_125={60.853870967741948,0,C# min,C#} Beat_126={61.337741935483884,0,C# min,C#} Beat_127={61.821612903225819,0,C# min,C#} Beat_128={62.305483870967755,1,C# min,Bdim} Beat_129={62.789354838709691,0,C# min,Bdim} Beat_130={63.273225806451627,0,C# min,Bdim} Beat_131={63.757096774193563,0,C# min,Bdim} Beat_132={64.240967741935492,1,C# min,C#} Beat_133={64.724838709677428,0,C# min,C#} Beat_134={65.208709677419364,0,C# min,C#} Beat_135={65.6925806451613,0,C# min,C#} Beat_136={66.176451612903236,1,C# min,Bdim} Beat_137={66.660322580645172,0,C# min,Bdim} Beat_138={67.144193548387108,0,C# min,Bdim} Beat_139={67.628064516129044,0,C# min,Bdim} Beat_140={68.11193548387098,1,C# min,C#} Beat_141={68.595806451612916,0,C# min,C#} Beat_142={69.079677419354852,0,C# min,C#} Beat_143={69.563548387096787,0,C# min,C#} Beat_144={70.047419354838723,1,C# min,Bdim} Beat_145={70.531290322580659,0,C# min,Bdim} Beat_146={71.0151612903226,0,C# min,Bdim} Beat_147={71.499032258064531,0,C# min,Bdim} Beat_148={71.982903225806467,1,C# min,C#} Beat_149={72.4667741935484,0,C# min,C#} Beat_150={72.950645161290339,0,C# min,C#} Beat_151={73.434516129032275,0,C# min,C#} Beat_152={73.918387096774211,1,C# min,Bdim} Beat_153={74.402258064516147,0,C# min,Bdim} Beat_154={74.886129032258083,0,C# min,Bdim} Beat_155={75.370000000000019,0,C# min,Bdim} Beat_156={75.853870967741955,1,C# min,C#} Beat_157={76.337741935483891,0,C# min,C#} Beat_158={76.821612903225827,0,C# min,C#} Beat_159={77.305483870967763,0,C# min,C#} Beat_160={77.7893548387097,1,C# min,C#} Beat_161={78.273225806451634,0,C# min,C#} Beat_162={78.75709677419357,0,C# min,D} Beat_163={79.2409677419355,0,C# min,D} Beat_164={79.724838709677442,1,C# min,E} Beat_165={80.208709677419378,0,C# min,E} Beat_166={80.692580645161314,0,C# min,D} Beat_167={81.17645161290325,0,C# min,D} Beat_168={81.660322580645186,1,C# min,C#} Beat_169={82.144193548387122,0,C# min,C#} Beat_170={82.628064516129058,0,C# min,D} Beat_171={83.111935483871,0,C# min,D} Beat_172={83.59580645161293,1,C# min,E} Beat_173={84.079677419354866,0,C# min,E} Beat_174={84.5635483870968,0,C# min,D} Beat_175={85.047419354838738,0,C# min,D} Beat_176={85.531290322580674,1,C# min,C#} Beat_177={86.015161290322609,0,C# min,C#} Beat_178={86.499032258064545,0,C# min,D} Beat_179={86.982903225806481,0,C# min,D} Beat_180={87.466774193548417,1,C# min,E} Beat_181={87.950645161290353,0,C# min,E} Beat_182={88.434516129032289,0,C# min,D} Beat_183={88.918387096774225,0,C# min,D} Beat_184={89.402258064516161,1,C# min,C#} Beat_185={89.8861290322581,0,C# min,C#} Beat_186={90.370000000000033,0,C# min,C#} Beat_187={90.853870967741969,0,C# min,C#} Beat_188={91.3377419354839,1,C# min,C#} Beat_189={91.821612903225841,0,C# min,C#} Beat_190={92.305483870967777,0,C# min,C#} Beat_191={92.789354838709713,0,C# min,C#} Beat_192={93.273225806451649,1,C# min,C#} Beat_193={93.757096774193585,0,C# min,C#} Beat_194={94.240967741935521,0,C# min,C#} Beat_195={94.724838709677456,0,C# min,C#} Beat_196={95.208709677419392,1,C# min,E} Beat_197={95.692580645161328,0,C# min,E} Beat_198={96.176451612903264,0,C# min,E} Beat_199={96.6603225806452,0,C# min,E} Beat_200={97.144193548387136,1,C# min,A} Beat_201={97.628064516129072,0,C# min,A} Beat_202={98.111935483871008,0,C# min,A} Beat_203={98.595806451612944,0,C# min,A} Beat_204={99.07967741935488,1,C# min,Abm} Beat_205={99.563548387096816,0,C# min,Abm} Beat_206={100.04741935483875,0,C# min,Abm} Beat_207={100.53129032258069,0,C# min,Abm} Beat_208={101.01516129032262,1,C# min,C#} Beat_209={101.49903225806456,0,C# min,C#} Beat_210={101.9829032258065,0,C# min,C#} Beat_211={102.46677419354843,0,C# min,C#} Beat_212={102.95064516129037,1,C# min,E} Beat_213={103.4345161290323,0,C# min,E} Beat_214={103.91838709677424,0,C# min,E} Beat_215={104.40225806451618,0,C# min,E} Beat_216={104.88612903225811,1,C# min,A} Beat_217={105.37000000000005,0,C# min,A} Beat_218={105.85387096774198,0,C# min,A} Beat_219={106.33774193548392,0,C# min,A} Beat_220={106.82161290322586,1,C# min,C#sus4} Beat_221={107.30548387096779,0,C# min,C#sus4} Beat_222={107.78935483870973,0,C# min,C#sus4} Beat_223={108.27322580645166,0,C# min,C#sus4} Beat_224={108.7570967741936,1,C# min,C#m} Beat_225={109.24096774193554,0,C# min,C#m} Beat_226={109.72483870967747,0,C# min,C#m} Beat_227={110.20870967741941,0,C# min,C#m} Beat_228={110.69258064516134,1,C# min,E} Beat_229={111.17645161290328,0,C# min,E} Beat_230={111.66032258064521,0,C# min,E} Beat_231={112.14419354838715,0,C# min,E} Beat_232={112.62806451612909,1,C# min,Ebm} Beat_233={113.11193548387102,0,C# min,Ebm} Beat_234={113.59580645161296,0,C# min,Ebm} Beat_235={114.07967741935489,0,C# min,Ebm} Beat_236={114.56354838709683,1,C# min,D} Beat_237={115.04741935483877,0,C# min,D} Beat_238={115.5312903225807,0,C# min,D} Beat_239={116.01516129032264,0,C# min,D} Beat_240={116.49903225806457,1,C# min,C#m} Beat_241={116.98290322580651,0,C# min,C#m} Beat_242={117.46677419354845,0,C# min,C#m} Beat_243={117.95064516129038,0,C# min,C#m} Beat_244={118.43451612903232,1,C# min,E} Beat_245={118.91838709677425,0,C# min,E} Beat_246={119.40225806451619,0,C# min,E} Beat_247={119.88612903225813,0,C# min,E} Beat_248={120.37000000000006,1,C# min,Ebm} Beat_249={120.853870967742,0,C# min,Ebm} Beat_250={121.33774193548393,0,C# min,Ebm} Beat_251={121.82161290322587,0,C# min,Ebm} Beat_252={122.30548387096781,1,C# min,D} Beat_253={122.78935483870974,0,C# min,D} Beat_254={123.27322580645168,0,C# min,D} Beat_255={123.75709677419361,0,C# min,D} Beat_256={124.24096774193555,1,C# min,C#} Beat_257={124.72483870967749,0,C# min,C#} Beat_258={125.20870967741942,0,C# min,C#} Beat_259={125.69258064516136,0,C# min,C#} Beat_260={126.17645161290329,1,C# min,EM7} Beat_261={126.66032258064523,0,C# min,EM7} Beat_262={127.14419354838717,0,C# min,EM7} Beat_263={127.6280645161291,0,C# min,EM7} Beat_264={128.11193548387104,1,C# min,AM7} Beat_265={128.59580645161296,0,C# min,AM7} Beat_266={129.07967741935488,0,C# min,AM7} Beat_267={129.5635483870968,0,C# min,AM7} Beat_268={130.04741935483872,1,C# min,Ab} Beat_269={130.53129032258065,0,C# min,Ab} Beat_270={131.01516129032257,0,C# min,Ab} Beat_271={131.49903225806449,0,C# min,Ab} Beat_272={131.98290322580641,1,C# min,C#} Beat_273={132.46677419354833,0,C# min,C#} Beat_274={132.95064516129025,0,C# min,C#} Beat_275={133.43451612903218,0,C# min,C#} Beat_276={133.9183870967741,1,C# min,EM7} Beat_277={134.40225806451602,0,C# min,EM7} Beat_278={134.88612903225794,0,C# min,EM7} Beat_279={135.36999999999986,0,C# min,EM7} Beat_280={135.85387096774178,1,C# min,AM7} Beat_281={136.33774193548371,0,C# min,AM7} Beat_282={136.82161290322563,0,C# min,AM7} Beat_283={137.30548387096755,0,C# min,AM7} Beat_284={137.78935483870947,1,C# min,Ab} Beat_285={138.27322580645139,0,C# min,Ab} Beat_286={138.75709677419332,0,C# min,Ab} Beat_287={139.24096774193524,0,C# min,Ab} Beat_288={139.72483870967716,1,C# min,DM7} Beat_289={140.20870967741908,0,C# min,DM7} Beat_290={140.692580645161,0,C# min,DM7} Beat_291={141.17645161290292,0,C# min,DM7} Beat_292={141.66032258064485,1,C# min,DM7} Beat_293={142.14419354838677,0,C# min,DM7} Beat_294={142.62806451612869,0,C# min,DM7} Beat_295={143.11193548387061,0,C# min,DM7} Beat_296={143.59580645161253,1,C# min,Absus4} Beat_297={144.07967741935445,0,C# min,Absus4} Beat_298={144.56354838709638,0,C# min,Absus4} Beat_299={145.0474193548383,0,C# min,Absus4} Beat_300={145.53129032258022,1,C# min,Absus4} Beat_301={146.01516129032214,0,C# min,Absus4} Beat_302={146.49903225806406,0,C# min,Absus4} Beat_303={146.98290322580598,0,C# min,Absus4} Beat_304={147.46677419354791,1,C# min,Absus4} Beat_305={147.95064516128983,0,C# min,Absus4} Beat_306={148.43451612903175,0,C# min,Absus4} Beat_307={148.91838709677367,0,C# min,Absus4} Beat_308={149.40225806451559,1,C# min,C#} Beat_309={149.88612903225751,0,C# min,C#} Beat_310={150.36999999999944,0,C# min,C#} Beat_311={150.85387096774136,0,C# min,C#} Beat_312={151.33774193548328,1,C# min,E} Beat_313={151.8216129032252,0,C# min,E} Beat_314={152.30548387096712,0,C# min,E} Beat_315={152.78935483870905,0,C# min,E} Beat_316={153.27322580645097,1,C# min,A} Beat_317={153.75709677419289,0,C# min,A} Beat_318={154.24096774193481,0,C# min,A} Beat_319={154.72483870967673,0,C# min,A} Beat_320={155.20870967741865,1,C# min,Abm} Beat_321={155.69258064516058,0,C# min,Abm} Beat_322={156.1764516129025,0,C# min,Abm} Beat_323={156.66032258064442,0,C# min,Abm} Beat_324={157.14419354838634,1,C# min,C#} Beat_325={157.62806451612826,0,C# min,C#} Beat_326={158.11193548387018,0,C# min,C#} Beat_327={158.59580645161211,0,C# min,C#} Beat_328={159.07967741935403,1,C# min,E} Beat_329={159.56354838709595,0,C# min,E} Beat_330={160.04741935483787,0,C# min,E} Beat_331={160.53129032257979,0,C# min,E} Beat_332={161.01516129032171,1,C# min,A} Beat_333={161.49903225806364,0,C# min,A} Beat_334={161.98290322580556,0,C# min,A} Beat_335={162.46677419354748,0,C# min,A} Beat_336={162.9506451612894,1,C# min,C#sus4} Beat_337={163.43451612903132,0,C# min,C#sus4} Beat_338={163.91838709677325,0,C# min,C#sus4} Beat_339={164.40225806451517,0,C# min,C#sus4} Beat_340={164.88612903225709,1,C# min,C#} Beat_341={165.369999999999,0,C# min,C#} Beat_342={165.85387096774093,0,C# min,C#} Beat_343={166.33774193548285,0,C# min,C#} Beat_344={166.82161290322478,1,C# min,E} Beat_345={167.3054838709667,0,C# min,E} Beat_346={167.78935483870862,0,C# min,E} Beat_347={168.27322580645054,0,C# min,E} Beat_348={168.75709677419246,1,C# min,A} Beat_349={169.24096774193438,0,C# min,A} Beat_350={169.72483870967631,0,C# min,A} Beat_351={170.20870967741823,0,C# min,A} Beat_352={170.69258064516015,1,C# min,Abm} Beat_353={171.17645161290207,0,C# min,Abm} Beat_354={171.660322580644,0,C# min,Abm} Beat_355={172.14419354838591,0,C# min,Abm} Beat_356={172.62806451612784,1,C# min,C#} Beat_357={173.11193548386976,0,C# min,C#} Beat_358={173.59580645161168,0,C# min,C#} Beat_359={174.0796774193536,0,C# min,C#} Beat_360={174.56354838709552,1,C# min,E} Beat_361={175.04741935483744,0,C# min,E} Beat_362={175.53129032257937,0,C# min,E} Beat_363={176.01516129032129,0,C# min,E} Beat_364={176.49903225806321,1,C# min,A} Beat_365={176.98290322580513,0,C# min,A} Beat_366={177.46677419354705,0,C# min,A} Beat_367={177.95064516128898,0,C# min,A} Beat_368={178.4345161290309,1,C# min,C#sus4} Beat_369={178.91838709677282,0,C# min,C#sus4} Beat_370={179.40225806451474,0,C# min,C#sus4} Beat_371={179.88612903225666,0,C# min,C#sus4} Beat_372={180.36999999999858,1,C# min,N} Beat_373={180.85387096774051,0,C# min,N} Beat_374={181.33774193548243,0,C# min,N} Beat_375={181.82161290322435,0,C# min,N} Beat_376={182.30548387096627,1,C# min,N} Beat_377={182.78935483870819,0,C# min,N} Beat_378={183.27322580645011,0,C# min,N} Beat_379={183.75709677419204,0,C# min,N} Beat_380={184.24096774193396,1,C# min,N} Beat_381={184.72483870967588,0,C# min,N} ",12216,True,4367.664172947571,median "[MusicConfig] Location=318810 Kanon Wakeshima - still doll/still doll.mp3 Extension=mp3 MD5=5d‌​dc‌​8f‌​4c‌​a7‌​20‌​3a‌​3b‌​75‌​96‌​a8‌​af‌​66‌​4f‌​c4‌​3c Source=OSU MetreNumber=3 Title=still doll [TagConfig] Tagger=Carra Time=2017/2/5 18:38:28 Confidence=1 [MiscConfig] LinkedFile=318810 Kanon Wakeshima - still doll/Kanon Wakeshima - still doll (Okorin) [advanced].osu osuMapID=318810 [BeatInfo] Count=397 Beat_0={0.553,1,F min,Fm} Beat_1={1.0614745762711859,0,F min,Fm} Beat_2={1.5699491525423719,0,F min,Fm} Beat_3={2.0784237288135579,1,F min,C#} Beat_4={2.5868983050847438,0,F min,C#} Beat_5={3.09537288135593,0,F min,C#} Beat_6={3.6038474576271158,1,F min,D} Beat_7={4.1123220338983018,0,F min,D} Beat_8={4.6207966101694877,0,F min,D} Beat_9={5.1292711864406737,1,F min,C} Beat_10={5.63774576271186,0,F min,C} Beat_11={6.1462203389830456,0,F min,C} Beat_12={6.6546949152542316,1,F min,Fm} Beat_13={7.1631694915254176,0,F min,Fm} Beat_14={7.6716440677966036,0,F min,Fm} Beat_15={8.18011864406779,1,F min,C#} Beat_16={8.6885932203389764,0,F min,C#} Beat_17={9.1970677966101633,0,F min,C#} Beat_18={9.7055423728813484,1,F min,D} Beat_19={10.214016949152533,0,F min,D} Beat_20={10.72249152542372,0,F min,D} Beat_21={11.230966101694907,1,F min,C} Beat_22={11.739440677966092,0,F min,C} Beat_23={12.247915254237277,0,F min,C} Beat_24={12.756389830508464,1,F min,Fm} Beat_25={13.264864406779651,0,F min,Fm} Beat_26={13.773338983050836,0,F min,Fm} Beat_27={14.281813559322021,1,F min,C#} Beat_28={14.790288135593208,0,F min,C#} Beat_29={15.298762711864395,0,F min,C#} Beat_30={15.80723728813558,1,F min,Bdim} Beat_31={16.315711864406765,0,F min,Bdim} Beat_32={16.824186440677952,0,F min,Bdim} Beat_33={17.332661016949139,1,F min,C} Beat_34={17.841135593220326,0,F min,C} Beat_35={18.349610169491509,0,F min,C} Beat_36={18.858084745762696,1,F min,Fm} Beat_37={19.366559322033883,0,F min,Fm} Beat_38={19.875033898305066,0,F min,Fm} Beat_39={20.383508474576253,1,F min,C#} Beat_40={20.89198305084744,0,F min,C#} Beat_41={21.400457627118627,0,F min,C#} Beat_42={21.908932203389814,1,F min,Bdim} Beat_43={22.417406779660997,0,F min,Bdim} Beat_44={22.925881355932184,0,F min,Bdim} Beat_45={23.434355932203371,1,F min,C} Beat_46={23.942830508474554,0,F min,C} Beat_47={24.451305084745741,0,F min,C} Beat_48={24.959,1,F min,Fm} Beat_49={25.467474576271186,0,F min,Fm} Beat_50={25.97594915254237,0,F min,C#} Beat_51={26.484423728813557,1,F min,C#} Beat_52={26.992898305084744,0,F min,Bdim} Beat_53={27.50137288135593,0,F min,Bdim} Beat_54={28.009847457627117,1,F min,C} Beat_55={28.5183220338983,0,F min,C} Beat_56={29.027,1,F min,N} Beat_57={29.535474576271188,0,F min,N} Beat_58={30.043949152542375,0,F min,N} Beat_59={30.552423728813558,1,F min,Fm} Beat_60={31.060898305084745,0,F min,Fm} Beat_61={31.569372881355932,0,F min,Fm} Beat_62={32.077847457627115,1,F min,C#} Beat_63={32.586322033898306,0,F min,C#} Beat_64={33.094796610169489,0,F min,C#} Beat_65={33.603271186440672,1,F min,Bdim} Beat_66={34.111745762711863,0,F min,Bdim} Beat_67={34.620220338983046,0,F min,Bdim} Beat_68={35.128694915254229,1,F min,C} Beat_69={35.63716949152542,0,F min,C} Beat_70={36.1456440677966,0,F min,C} Beat_71={36.654118644067793,1,F min,Fm} Beat_72={37.162593220338977,0,F min,Fm} Beat_73={37.67106779661016,0,F min,Fm} Beat_74={38.17954237288135,1,F min,C#} Beat_75={38.688016949152534,0,F min,C#} Beat_76={39.196491525423724,0,F min,C#} Beat_77={39.704966101694907,1,F min,Bdim} Beat_78={40.213440677966091,0,F min,Bdim} Beat_79={40.721915254237274,0,F min,Bdim} Beat_80={41.230389830508464,1,F min,C} Beat_81={41.738864406779655,0,F min,C} Beat_82={42.247338983050838,0,F min,C} Beat_83={42.755813559322021,1,F min,Fm} Beat_84={43.264288135593205,0,F min,Fm} Beat_85={43.772762711864395,0,F min,Fm} Beat_86={44.281237288135578,1,F min,C#} Beat_87={44.789711864406769,0,F min,C#} Beat_88={45.298186440677952,0,F min,C#} Beat_89={45.806661016949136,1,F min,Bdim} Beat_90={46.315135593220326,0,F min,Bdim} Beat_91={46.823610169491509,0,F min,Bdim} Beat_92={47.3320847457627,1,F min,C} Beat_93={47.840559322033883,0,F min,C} Beat_94={48.349033898305066,0,F min,C} Beat_95={48.85750847457625,1,F min,Fm} Beat_96={49.36598305084744,0,F min,Fm} Beat_97={49.87445762711863,0,F min,Fm} Beat_98={50.382932203389814,1,F min,C#} Beat_99={50.891406779661,0,F min,C#} Beat_100={51.39988135593218,0,F min,C#} Beat_101={51.908355932203371,1,F min,Bdim} Beat_102={52.416830508474554,0,F min,Bdim} Beat_103={52.925305084745744,0,F min,Bdim} Beat_104={53.433779661016928,1,F min,C} Beat_105={53.942254237288111,0,F min,C} Beat_106={54.4507288135593,0,F min,C} Beat_107={54.959,1,F min,Fm} Beat_108={55.467474576271186,0,F min,Fm} Beat_109={55.975949152542377,0,F min,C#} Beat_110={56.48442372881356,1,F min,C#} Beat_111={56.992898305084751,0,F min,Bdim} Beat_112={57.501372881355934,0,F min,Bdim} Beat_113={58.009847457627117,1,F min,C} Beat_114={58.518322033898308,0,F min,C} Beat_115={59.027,1,F min,N} Beat_116={59.535474576271184,0,F min,N} Beat_117={60.043949152542375,0,F min,N} Beat_118={60.552423728813558,1,A min,Dm} Beat_119={61.060898305084748,0,A min,Dm} Beat_120={61.569372881355932,0,A min,Dm} Beat_121={62.077847457627115,1,A min,C} Beat_122={62.586322033898306,0,A min,C} Beat_123={63.094796610169489,0,A min,C} Beat_124={63.603271186440672,1,A min,Em} Beat_125={64.111745762711863,0,A min,Em} Beat_126={64.620220338983046,0,A min,Em} Beat_127={65.128694915254229,1,A min,Am} Beat_128={65.637169491525412,0,A min,Am} Beat_129={66.14564406779661,0,A min,Am} Beat_130={66.6541186440678,1,A min,Dm} Beat_131={67.162593220338977,0,A min,Dm} Beat_132={67.67106779661016,0,A min,Dm} Beat_133={68.179542372881343,1,A min,G} Beat_134={68.688016949152541,0,A min,G} Beat_135={69.196491525423724,0,A min,G} Beat_136={69.704966101694907,1,A min,Em} Beat_137={70.213440677966091,0,A min,Em} Beat_138={70.721915254237274,0,A min,Em} Beat_139={71.230389830508472,1,A min,Am} Beat_140={71.738864406779655,0,A min,Am} Beat_141={72.247338983050838,0,A min,Am} Beat_142={72.755813559322021,1,A min,Dm} Beat_143={73.2642881355932,0,A min,Dm} Beat_144={73.7727627118644,0,A min,Dm} Beat_145={74.281237288135586,1,A min,G} Beat_146={74.789711864406769,0,A min,G} Beat_147={75.298186440677952,0,A min,G} Beat_148={75.806661016949136,1,A min,Em} Beat_149={76.315135593220333,0,A min,Em} Beat_150={76.8236101694915,0,A min,Em} Beat_151={77.3320847457627,1,A min,Am} Beat_152={77.840559322033883,0,A min,Am} Beat_153={78.349033898305066,0,A min,Am} Beat_154={78.85750847457625,1,A min,Dm} Beat_155={79.365983050847433,0,A min,Dm} Beat_156={79.87445762711863,0,A min,Dm} Beat_157={80.382932203389814,1,A min,G} Beat_158={80.891406779661,0,A min,G} Beat_159={81.39988135593218,0,A min,G} Beat_160={81.908355932203364,1,A min,Em} Beat_161={82.416830508474561,0,A min,Em} Beat_162={82.925305084745744,0,A min,Em} Beat_163={83.433779661016928,1,A min,Am} Beat_164={83.942254237288111,0,A min,Am} Beat_165={84.4507288135593,0,A min,Am} Beat_166={84.959203389830492,1,F min,Fm} Beat_167={85.467677966101675,0,F min,Fm} Beat_168={85.976152542372859,0,F min,Fm} Beat_169={86.484627118644042,1,F min,C#} Beat_170={86.993101694915225,0,F min,C#} Beat_171={87.501576271186423,0,F min,C#} Beat_172={88.0100508474576,1,F min,Bdim} Beat_173={88.518525423728789,0,F min,Bdim} Beat_174={89.026999999999973,0,F min,Bdim} Beat_175={89.535474576271156,1,F min,C} Beat_176={90.043949152542353,0,F min,C} Beat_177={90.552423728813523,0,F min,C} Beat_178={91.06089830508472,1,F min,Fm} Beat_179={91.5693728813559,0,F min,Fm} Beat_180={92.077847457627087,0,F min,Fm} Beat_181={92.586322033898284,1,F min,C#} Beat_182={93.094796610169453,0,F min,C#} Beat_183={93.603271186440651,0,F min,C#} Beat_184={94.111745762711834,1,F min,Bdim} Beat_185={94.620220338983017,0,F min,Bdim} Beat_186={95.128694915254215,0,F min,Bdim} Beat_187={95.637169491525384,1,F min,C} Beat_188={96.145644067796582,0,F min,C} Beat_189={96.654118644067765,0,F min,C} Beat_190={97.162593220338948,1,F min,Fm} Beat_191={97.671067796610131,0,F min,Fm} Beat_192={98.179542372881315,0,F min,Fm} Beat_193={98.688016949152512,1,F min,C#} Beat_194={99.1964915254237,0,F min,C#} Beat_195={99.704966101694879,0,F min,C#} Beat_196={100.21344067796606,1,F min,Bdim} Beat_197={100.72191525423725,0,F min,Bdim} Beat_198={101.23038983050844,0,F min,Bdim} Beat_199={101.73886440677963,1,F min,C} Beat_200={102.24733898305081,0,F min,C} Beat_201={102.755813559322,0,F min,C} Beat_202={103.26428813559318,1,F min,Fm} Beat_203={103.77276271186437,0,F min,Fm} Beat_204={104.28123728813554,0,F min,Fm} Beat_205={104.78971186440674,1,F min,C#} Beat_206={105.29818644067792,0,F min,C#} Beat_207={105.80666101694911,0,F min,C#} Beat_208={106.31513559322031,1,F min,Bdim} Beat_209={106.82361016949147,0,F min,Bdim} Beat_210={107.33208474576267,0,F min,Bdim} Beat_211={107.84055932203386,1,F min,C} Beat_212={108.34903389830504,0,F min,C} Beat_213={108.85750847457624,0,F min,C} Beat_214={109.3659830508474,1,F min,Fm} Beat_215={109.8744576271186,0,F min,Fm} Beat_216={110.38293220338979,0,F min,C#} Beat_217={110.89140677966097,1,F min,D} Beat_218={111.39988135593217,0,F min,C} Beat_219={111.909,1,F min,C} Beat_220={112.41747457627119,0,F min,C} Beat_221={112.92594915254237,0,F min,C} Beat_222={113.43442372881357,1,F min,Fm} Beat_223={113.94289830508475,0,F min,Fm} Beat_224={114.45137288135594,0,F min,Fm} Beat_225={114.95984745762712,1,F min,C#} Beat_226={115.4683220338983,0,F min,C#} Beat_227={115.97679661016949,0,F min,C#} Beat_228={116.48527118644068,1,F min,Bdim} Beat_229={116.99374576271187,0,F min,Bdim} Beat_230={117.50222033898305,0,F min,Bdim} Beat_231={118.01069491525423,1,F min,C} Beat_232={118.51916949152542,0,F min,C} Beat_233={119.02764406779662,0,F min,C} Beat_234={119.5361186440678,1,F min,Fm} Beat_235={120.04459322033898,0,F min,Fm} Beat_236={120.55306779661017,0,F min,Fm} Beat_237={121.06154237288135,1,F min,C#} Beat_238={121.57001694915255,0,F min,C#} Beat_239={122.07849152542373,0,F min,C#} Beat_240={122.58696610169491,1,F min,Bdim} Beat_241={123.0954406779661,0,F min,Bdim} Beat_242={123.60391525423728,0,F min,Bdim} Beat_243={124.11238983050848,1,F min,C} Beat_244={124.62086440677966,0,F min,C} Beat_245={125.12933898305084,0,F min,C} Beat_246={125.63781355932203,1,F min,Fm} Beat_247={126.14628813559321,0,F min,Fm} Beat_248={126.65476271186441,0,F min,Fm} Beat_249={127.16323728813559,1,F min,C#} Beat_250={127.67171186440677,0,F min,C#} Beat_251={128.18018644067797,0,F min,C#} Beat_252={128.68866101694914,1,F min,Bdim} Beat_253={129.19713559322034,0,F min,Bdim} Beat_254={129.70561016949151,0,F min,Bdim} Beat_255={130.21408474576271,1,F min,C} Beat_256={130.72255932203387,0,F min,C} Beat_257={131.23103389830507,0,F min,C} Beat_258={131.73950847457627,1,F min,Fm} Beat_259={132.24798305084744,0,F min,Fm} Beat_260={132.75645762711864,0,F min,Fm} Beat_261={133.26493220338983,1,F min,C#} Beat_262={133.773406779661,0,F min,C#} Beat_263={134.2818813559322,0,F min,C#} Beat_264={134.79035593220337,1,F min,Bdim} Beat_265={135.29883050847457,0,F min,Bdim} Beat_266={135.80730508474574,0,F min,Bdim} Beat_267={136.31577966101693,1,F min,C} Beat_268={136.82425423728813,0,F min,C} Beat_269={137.3327288135593,0,F min,C} Beat_270={137.8412033898305,1,A min,Dm} Beat_271={138.34967796610167,0,A min,Dm} Beat_272={138.85815254237286,0,A min,Dm} Beat_273={139.36662711864403,1,A min,C} Beat_274={139.87510169491523,0,A min,C} Beat_275={140.38357627118643,0,A min,C} Beat_276={140.8920508474576,1,A min,Em} Beat_277={141.40052542372879,0,A min,Em} Beat_278={141.909,0,A min,Em} Beat_279={142.41747457627116,1,A min,Am} Beat_280={142.92594915254236,0,A min,Am} Beat_281={143.43442372881353,0,A min,Am} Beat_282={143.94289830508473,1,A min,Dm} Beat_283={144.45137288135589,0,A min,Dm} Beat_284={144.95984745762709,0,A min,Dm} Beat_285={145.46832203389829,1,A min,G} Beat_286={145.97679661016946,0,A min,G} Beat_287={146.48527118644066,0,A min,G} Beat_288={146.99374576271185,1,A min,C} Beat_289={147.50222033898302,0,A min,C} Beat_290={148.01069491525422,0,A min,C} Beat_291={148.51916949152539,1,A min,Am} Beat_292={149.02764406779659,0,A min,Am} Beat_293={149.53611864406776,0,A min,Am} Beat_294={150.04459322033895,1,A min,Dm} Beat_295={150.55306779661015,0,A min,Dm} Beat_296={151.06154237288132,0,A min,Dm} Beat_297={151.57001694915252,1,A min,G} Beat_298={152.07849152542372,0,A min,G} Beat_299={152.58696610169488,0,A min,G} Beat_300={153.09544067796605,1,A min,Em} Beat_301={153.60391525423725,0,A min,Em} Beat_302={154.11238983050845,0,A min,Em} Beat_303={154.62086440677962,1,A min,Am} Beat_304={155.12933898305082,0,A min,Am} Beat_305={155.637813559322,0,A min,Am} Beat_306={156.14628813559318,1,A min,Dm} Beat_307={156.65476271186438,0,A min,Dm} Beat_308={157.16323728813555,0,A min,Dm} Beat_309={157.67171186440675,1,A min,G} Beat_310={158.18018644067792,0,A min,G} Beat_311={158.68866101694911,0,A min,G} Beat_312={159.19713559322031,1,A min,Em} Beat_313={159.70561016949148,0,A min,Em} Beat_314={160.21408474576268,0,A min,Em} Beat_315={160.72255932203387,1,A min,Am} Beat_316={161.23103389830504,0,A min,Am} Beat_317={161.73950847457624,0,A min,Am} Beat_318={162.24798305084741,1,A min,Dm} Beat_319={162.75645762711861,0,A min,Dm} Beat_320={163.26493220338978,0,A min,Dm} Beat_321={163.77340677966097,1,A min,Em} Beat_322={164.28188135593217,0,A min,Em} Beat_323={164.79035593220334,0,A min,Em} Beat_324={165.29883050847454,1,A min,Em} Beat_325={165.80730508474574,0,A min,Em} Beat_326={166.3157796610169,0,A min,Em} Beat_327={166.82425423728807,1,A min,Am} Beat_328={167.33272881355927,0,A min,Am} Beat_329={167.84120338983047,0,A min,Am} Beat_330={168.34967796610164,1,A min,Dm} Beat_331={168.85815254237284,0,A min,Dm} Beat_332={169.36662711864403,0,A min,Dm} Beat_333={169.8751016949152,1,A min,G} Beat_334={170.3835762711864,0,A min,G} Beat_335={170.8920508474576,0,A min,G} Beat_336={171.40052542372877,1,A min,Em} Beat_337={171.90899999999994,0,A min,Em} Beat_338={172.41747457627113,0,A min,Em} Beat_339={172.92594915254233,1,A min,Am} Beat_340={173.4344237288135,0,A min,Am} Beat_341={173.9428983050847,0,A min,Am} Beat_342={174.45137288135589,1,F min,Fm} Beat_343={174.95984745762706,0,F min,Fm} Beat_344={175.46832203389826,0,F min,Fm} Beat_345={175.97679661016946,1,F min,C#} Beat_346={176.48527118644063,0,F min,C#} Beat_347={176.9937457627118,0,F min,C#} Beat_348={177.502220338983,1,F min,D} Beat_349={178.01069491525419,0,F min,D} Beat_350={178.51916949152536,0,F min,D} Beat_351={179.02764406779656,1,F min,E} Beat_352={179.53611864406776,0,F min,E} Beat_353={180.04459322033893,0,F min,E} Beat_354={180.55306779661009,1,F min,Fm} Beat_355={181.06154237288132,0,F min,Fm} Beat_356={181.57001694915249,0,F min,Fm} Beat_357={182.07849152542366,1,F min,C#} Beat_358={182.58696610169486,0,F min,C#} Beat_359={183.09544067796605,0,F min,C#} Beat_360={183.60391525423722,1,F min,Fm} Beat_361={184.11238983050842,0,F min,Fm} Beat_362={184.62086440677962,0,F min,Fm} Beat_363={185.12933898305079,1,F min,E} Beat_364={185.63781355932196,0,F min,E} Beat_365={186.14628813559315,0,F min,E} Beat_366={186.654,1,F min,Fm} Beat_367={187.16247457627119,0,F min,Fm} Beat_368={187.67094915254236,0,F min,C#} Beat_369={188.17942372881356,1,F min,D} Beat_370={188.68789830508473,0,F min,C} Beat_371={189.19637288135593,0,F min,C} Beat_372={189.70484745762713,0,F min,C} Beat_373={190.213,1,F min,Fm} Beat_374={190.72147457627119,0,F min,Fm} Beat_375={191.22994915254236,0,F min,Fm} Beat_376={191.73842372881356,1,F min,Fm} Beat_377={192.24689830508473,0,F min,Fm} Beat_378={192.75537288135593,0,F min,Fm} Beat_379={193.26384745762712,1,F min,Fm} Beat_380={193.77232203389829,0,F min,Fm} Beat_381={194.28079661016949,0,F min,Fm} Beat_382={194.78927118644066,1,F min,Fm} Beat_383={195.29774576271186,0,F min,Fm} Beat_384={195.80622033898305,0,F min,Fm} Beat_385={196.31469491525422,1,F min,Fm} Beat_386={196.82316949152542,0,F min,N} Beat_387={197.33164406779659,0,F min,N} Beat_388={197.84011864406779,1,F min,N} Beat_389={198.34859322033896,0,F min,N} Beat_390={198.85706779661015,0,F min,N} Beat_391={199.36554237288135,1,F min,N} Beat_392={199.87401694915252,0,F min,N} Beat_393={200.38249152542372,0,F min,N} Beat_394={200.89096610169491,1,F min,N} Beat_395={201.39944067796608,0,F min,N} Beat_396={201.90791525423728,0,C Maj,N} ",12099,True,4317.8946542515,median ".set k_p_in, 0 .set k_p_wei, 8 .set k_p_out, 16 .set k_hi, 24 .set k_wi, 28 .set k_n, 32 .set k_k, 36 .set k_c, 40 .set k_ho, 44 .set k_wo, 48 .set k_stride_h, 52 .set k_stride_w, 56 .set k_dilation_h, 60 .set k_dilation_w, 64 .set k_pad_h, 68 .set k_pad_w, 72 .set k_y, 76 .set k_x, 80 .set k_group, 84 .set k_batch_m, 88 .set k_stride_m, 92 .set k_alpha, 96 .set k_beta, 100 .set k_gamma, 104 .set k_magic_0, 108 .set k_magic_1, 112 .set k_magic_2, 116 .set k_shift_pack_0, 120 .set s_block_ib, 2 ; bx, ho*wo .set s_ka, 0 .set s_block_ig, 3 ; by, group .set s_block_in, 4 ; bz, batch .set s_p_in, 6 .set s_p_wei, 8 .set s_p_out, 10 .set s_hi, 16 .set s_wi, 17 .set s_n, 18 .set s_k, 19 .set s_c, 20 .set s_ho, 21 .set s_wo, 22 .set s_stride_h, 23 .set s_stride_w, 24 .set s_dilation_h, 25 .set s_dilation_w, 26 .set s_pad_h, 27 .set s_pad_w, 28 .set s_y, 29 .set s_x, 30 .set s_group, 31 .set s_batch_m, 32 .set s_stride_m, 33 .set s_alpha, 34 .set s_beta, 35 .set s_gamma, 36 .set s_magic_0, 37 .set s_magic_1, 38 .set s_magic_2, 39 .set s_shift_pack_0, 40 .set s__pack_0, 41 .set s_shift_m0, 42 .set s_shift_m1, s_shift_pack_0 .set s_in_stride_wi, 12 .set s_in_stride_n, 13 .set s_wei_stride_k, 14 .set s_out_stride_wo, 15 .set s_out_stride_n, 43 .set s_in_diff_hi, 44 .set s_in_diff_wi, 45 .set s_dilation_w_x, 46 .set s_move_slice_k_ix, 47 .set s_kitr, 1 .set s_wei_offset, 48 .set s_out_stride, s_wei_offset .set s_sld_b_stride, 49 .set s_br, 50 .set s_ib_stride, 51 .set s_tmp, 52 .set s_end, 58 ; magic_0: x ; magic_1: wo .set v_c, 0 .set v_c_buf, v_c .set v_sld_b_os, 32 .set v_a, 33 .set v_ib, 49 .set v_b, 50 .set v_gld_a, 82 .set v_gld_b, v_b .set v_wei_iy_list, v_b+12 .set v_wei_ix_list, v_b+15 .set v_wei_flag, v_b+18 .set v_wei_os, v_b+21 .set v_tmp, v_b+24 .set v_wei_ik, v_a .set v_wei_ic, v_a+1 .set v_wei_ie, v_a+2 .set v_wei_flag_ik, v_a+3 .set v_sst_b_os, v_a+4 .set v_in_os, 98 .set v_in_ihi, 100 .set v_in_iwi, 102 .set v_in_flag, 104 .set v_out_os, 106 .set v_out_flag, 108 .set v_tid, 100 .set v_end, 112 ; short wide igemv .text .globl igemm_fwd_btm_nhwc_fp16_256x16x16_r3 .p2align 8 .type igemm_fwd_btm_nhwc_fp16_256x16x16_r3,@function igemm_fwd_btm_nhwc_fp16_256x16x16_r3: s_load_dwordx2 s[s_p_in+0:s_p_in+1], s[s_ka+0:s_ka+1], 0+k_p_in s_load_dwordx4 s[s_p_wei+0:s_p_wei+3], s[s_ka+0:s_ka+1], 0+k_p_wei s_load_dwordx16 s[s_hi+0:s_hi+15], s[s_ka+0:s_ka+1], 0+k_hi s_load_dwordx8 s[s_batch_m:s_batch_m+7], s[s_ka+0:s_ka+1], 0+k_batch_m s_load_dword s[s_shift_pack_0], s[s_ka+0:s_ka+1], 0+k_shift_pack_0 v_mov_b32 v[v_tid], v0 s_mov_b32 s[s_ib_stride], 128 ; calculate wei offset, 16x8, 16 for k, 8 for yxc, 4 for yx, 2 for c v_lshrrev_b32 v[v_wei_ik], 3, v0 s_mov_b32 s[s_tmp], 17*4 * 4 ; 17dword per row, 4 row v_and_b32 v[v_tmp+5], 7, v0 s_lshl_b32 s[s_block_ig], s[s_block_ig], 1 v_and_b32 v[v_wei_ic], 1, v0 s_lshl_b32 s[s_block_in], s[s_block_in], 1 v_lshrrev_b32 v[v_tmp+4], 1, v0 s_lshl_b32 s[s_block_ib], s[s_block_ib], 8 ; 256 half v_mov_b32 v[v_ib], v0 v_mul_u32_u24 v[v_tmp+5], s[s_tmp] ,v[v_tmp+5] v_lshlrev_b32 v[v_sst_b_os], 2, v[v_wei_ik] ; store, k*n*k_pack, ds_write2 if possible, n*k_pack->16dword, pad to 17 v_mov_b32 v[v_sld_b_os], 0 ; load v_lshlrev_b32 v[v_wei_ic], 3, v[v_wei_ic] ; 8xc, k_pack, 4x dword v_and_b32 v[v_wei_ie], 3, v[v_tmp+4] ; yx v_add_nc_u32 v[v_sst_b_os], v[v_sst_b_os], v[v_tmp+5] ; note, do not use or due to pad s_waitcnt lgkmcnt(0) s_mul_i32 s[s_tmp], s[s_x], s[s_c] s_bfe_u32 s[s_shift_m0], s[s_shift_pack_0], 0x00080000 ; offset:0, width:8 v_mad_u32_u24 v[v_tmp+1], s[s_c], v[v_wei_ie], v[v_wei_ic] s_mul_i32 s[s_wei_stride_k], s[s_tmp], s[s_y] s_lshl_b32 s[s_wei_offset], s[s_c], 2+1 ; 4x s_c, half s_mul_i32 s[s_tmp+5], s[s_wei_stride_k], s[s_k] v_mad_u32_u24 v[v_wei_os], s[s_wei_stride_k], v[v_wei_ik], v[v_tmp+1] s_mul_i32 s[s_tmp+2], s[s_block_ig], s[s_tmp+5] v_cmp_gt_u32 s[s_k], v[v_wei_ik] s_add_u32 s[s_p_wei], s[s_p_wei], s[s_tmp+2] v_cndmask_b32 v[v_wei_flag_ik], 0, 1 s_addc_u32 s[s_p_wei+1], s[s_p_wei+1], 0 v_lshlrev_b32 v[v_wei_os], 1, v[v_wei_os] ; divide x .mdiv_u32_rem_vs v_wei_ix_list+0,v_wei_iy_list+0,v_wei_ie,s_magic_0,s_shift_m0,s_x,v_tmp v_add_nc_u32 v[v_wei_os+1], s[s_wei_offset], v[v_wei_os+0] v_add_nc_u32 v[v_wei_ie], 4, v[v_wei_ie] v_cmp_gt_u32 s[s_y], v[v_wei_iy_list+0] v_cndmask_b32 v[v_wei_flag+0], 0, v[v_wei_flag_ik] v_cmp_gt_u32 s[s_x], v[v_wei_ix_list+0] v_cndmask_b32 v[v_wei_flag+0], 0, v[v_wei_flag+0] .mdiv_u32_rem_vs v_wei_ix_list+1,v_wei_iy_list+1,v_wei_ie,s_magic_0,s_shift_m0,s_x,v_tmp v_add_nc_u32 v[v_wei_os+2], s[s_wei_offset], v[v_wei_os+1] v_add_nc_u32 v[v_wei_ie], 4, v[v_wei_ie] v_cmp_gt_u32 s[s_y], v[v_wei_iy_list+1] v_cndmask_b32 v[v_wei_flag+1], 0, v[v_wei_flag_ik] v_cmp_gt_u32 s[s_x], v[v_wei_ix_list+1] v_cndmask_b32 v[v_wei_flag+1], 0, v[v_wei_flag+1] .mdiv_u32_rem_vs v_wei_ix_list+2,v_wei_iy_list+2,v_wei_ie,s_magic_0,s_shift_m0,s_x,v_tmp v_cmp_gt_u32 s[s_y], v[v_wei_iy_list+2] v_cndmask_b32 v[v_wei_flag+2], 0, v[v_wei_flag_ik] v_cmp_gt_u32 s[s_x], v[v_wei_ix_list+2] v_cndmask_b32 v[v_wei_flag+2], 0, v[v_wei_flag+2] v_cmpx_le_u32 1, v[v_wei_flag+0] global_load_dwordx4 v[v_gld_b+0:v_gld_b+3], v[v_wei_os+0], s[s_p_wei:s_p_wei+1] s_mov_b64 exec, -1 v_cmpx_le_u32 1, v[v_wei_flag+1] global_load_dwordx4 v[v_gld_b+4:v_gld_b+7], v[v_wei_os+1], s[s_p_wei:s_p_wei+1] s_mov_b64 exec, -1 v_cmpx_le_u32 1, v[v_wei_flag+2] global_load_dwordx4 v[v_gld_b+8:v_gld_b+11], v[v_wei_os+2], s[s_p_wei:s_p_wei+1] s_mov_b64 exec, -1 s_mov_b32 s[s_tmp+5], 32*17*4 ; stride for wei sst offset. 8 thread for k, each thread store 4 c, hence 8*4=32 ; 17 dword per row ; calculate in offset s_mul_i32 s[s_in_stride_wi], s[s_c], s[s_group] s_bfe_u32 s[s_shift_m1], s[s_shift_pack_0], 0x00080008 ; offset:8, width:8 s_mul_i32 s[s_tmp+2], s[s_wi], s[s_in_stride_wi] s_mul_i32 s[s_tmp+0], s[s_block_ig], s[s_c] s_mul_i32 s[s_in_stride_n], s[s_hi], s[s_tmp+2] v_add_nc_u32 v[v_ib], s[s_block_ib], v[v_ib] s_mul_i32 s[s_tmp+3], s[s_block_in], s[s_in_stride_n] s_lshl_b32 s[s_in_stride_wi], s[s_in_stride_wi], 1 s_add_u32 s[s_tmp+0], s[s_tmp+0], s[s_tmp+3] v_add_nc_u32 v[v_sst_b_os+1], s[s_tmp+5], v[v_sst_b_os+0] .mdiv_u32_rem_vs v_in_iwi,v_in_ihi,v_ib,s_magic_1,s_shift_m1,s_wo,v_tmp s_add_u32 s[s_p_in], s[s_p_in], s[s_tmp+0] v_add_nc_u32 v[v_tmp+5], s[s_ib_stride], v[v_ib] s_addc_u32 s[s_p_in+1], s[s_p_in+1], 0 v_mul_lo_u32 v[v_in_ihi], s[s_stride_h], v[v_in_ihi] .v_clear_nc v_gld_a, 4 v_sub_nc_i32 v[v_in_ihi], v[v_in_ihi], s[s_pad_h] v_mul_lo_u32 v[v_in_iwi], s[s_stride_w], v[v_in_iwi] .v_clear_nc v_gld_a+4, 4 v_sub_nc_i32 v[v_in_iwi], v[v_in_iwi], s[s_pad_w] v_add_nc_u32 v[v_sst_b_os+2], s[s_tmp+5], v[v_sst_b_os+1] .mdiv_u32_rem_vs v_in_iwi+1,v_in_ihi+1,v_tmp+5,s_magic_1,s_shift_m1,s_wo,v_tmp v_mul_lo_u32 v[v_tmp], s[s_wi], v[v_in_ihi] v_cmp_gt_u32 s[s_hi], v[v_in_ihi] v_cndmask_b32 v[v_in_flag], 0, 1 v_add_nc_u32 v[v_tmp], v[v_in_iwi], v[v_tmp] v_cmp_gt_u32 s[s_wi], v[v_in_iwi] v_cndmask_b32 v[v_in_flag], 0, v[v_in_flag] v_mul_lo_u32 v[v_in_os], s[s_in_stride_wi], v[v_tmp] v_mul_lo_u32 v[v_in_ihi+1], s[s_stride_h], v[v_in_ihi+1] .v_clear_nc v_gld_a+8, 4 v_sub_nc_i32 v[v_in_ihi+1], v[v_in_ihi+1], s[s_pad_h] v_mul_lo_u32 v[v_in_iwi+1], s[s_stride_w], v[v_in_iwi+1] .v_clear_nc v_gld_a+12, 4 v_sub_nc_i32 v[v_in_iwi+1], v[v_in_iwi+1], s[s_pad_w] v_cmpx_le_u32 1, v[v_in_flag] global_load_dwordx4 v[v_gld_a+0:v_gld_a+3], v[v_in_os], s[s_p_in:s_p_in+1] global_load_dwordx4 v[v_gld_a+4:v_gld_a+7], v[v_in_os], s[s_p_in:s_p_in+1] offset:16 s_mov_b64 exec, -1 v_mul_lo_u32 v[v_tmp], s[s_wi], v[v_in_ihi+1] v_cmp_gt_u32 s[s_hi], v[v_in_ihi+1] v_cndmask_b32 v[v_in_flag+1], 0, 1 v_add_nc_u32 v[v_tmp], v[v_in_iwi+1], v[v_tmp] v_cmp_gt_u32 s[s_wi], v[v_in_iwi+1] v_cndmask_b32 v[v_in_flag+1], 0, v[v_in_flag+1] v_mul_lo_u32 v[v_in_os+1], s[s_in_stride_wi], v[v_tmp] v_cmpx_le_u32 1, v[v_in_flag+1] global_load_dwordx4 v[v_gld_a+ 8:v_gld_a+11], v[v_in_os+1], s[s_p_in:s_p_in+1] global_load_dwordx4 v[v_gld_a+12:v_gld_a+15], v[v_in_os+1], s[s_p_in:s_p_in+1] offset:16 s_mov_b64 exec, -1 s_mul_i32 s[s_br], s[s_wo], s[s_ho] s_mul_i32 s[s_out_stride_wo], s[s_k], s[s_group] s_mul_i32 s[s_in_diff_wi], s[s_dilation_w], s[s_in_stride_wi] s_mov_b32 s[s_move_slice_k_ix], 0 s_mul_i32 s[s_out_stride_n], s[s_br], s[s_out_stride_wo] s_mul_i32 s[s_tmp+1], s[s_block_ig], s[s_k] s_mul_i32 s[s_tmp+4], s[s_block_in], s[s_out_stride_n] s_add_u32 s[s_tmp+1], s[s_tmp+1], s[s_tmp+4] s_add_u32 s[s_p_out], s[s_p_out], s[s_tmp+1] s_addc_u32 s[s_p_out+1], s[s_p_out+1], 0 ; calculate diffs, for y, x s_sub_i32 s[s_tmp+3], s[s_x], 1 s_mul_i32 s[s_tmp], s[s_in_diff_wi], s[s_tmp+3] s_mul_i32 s[s_tmp+1], s[s_in_stride_wi], s[s_wi] s_mul_i32 s[s_tmp+1], s[s_tmp+1], s[s_dilation_h] s_sub_i32 s[s_in_diff_hi], s[s_tmp+1], s[s_tmp] s_mul_i32 s[s_dilation_w_x], s[s_dilation_w], s[s_tmp+3] s_mul_i32 s[s_dilation_w_x], s[s_dilation_w_x], -1 v_add_nc_u32 v[v_tmp+5], s[s_ib_stride], v[v_ib] s_mul_i32 s[s_out_stride], s[s_stride_m], s[s_out_stride_wo] s_lshl_b32 s[s_out_stride], s[s_out_stride], 1 s_lshl_b32 s[s_out_stride_n], s[s_out_stride_n], 1 ; output offset v_mul_lo_u32 v[v_out_os], s[s_k], v[v_ib] v_lshlrev_b32 v[v_out_os], 1, v[v_out_os] v_cmp_gt_u32 s[s_out_stride_n], v[v_out_os] v_cndmask_b32 v[v_out_flag], 0, 1 v_mul_lo_u32 v[v_out_os+1], s[s_k], v[v_tmp+5] v_lshlrev_b32 v[v_out_os+1], 1, v[v_out_os+1] v_cmp_gt_u32 s[s_out_stride_n], v[v_out_os+1] v_cndmask_b32 v[v_out_flag+1], 0, 1 s_mov_b32 s[s_sld_b_stride], 17*8*4 s_waitcnt vmcnt(2) v_cmpx_le_u32 1, v[v_wei_flag+0] ds_write2_b32 v[v_sst_b_os+0], v[v_gld_b+0], v[v_gld_b+1], offset0:17*0 offset1:17*1 ds_write2_b32 v[v_sst_b_os+0], v[v_gld_b+2], v[v_gld_b+3], offset0:17*2 offset1:17*3 s_mov_b64 exec, -1 v_cmpx_le_u32 1, v[v_wei_flag+1] ds_write2_b32 v[v_sst_b_os+1], v[v_gld_b+4], v[v_gld_b+5], offset0:17*0 offset1:17*1 ds_write2_b32 v[v_sst_b_os+1], v[v_gld_b+6], v[v_gld_b+7], offset0:17*2 offset1:17*3 s_mov_b64 exec, -1 v_cmpx_le_u32 1, v[v_wei_flag+2] ds_write2_b32 v[v_sst_b_os+2], v[v_gld_b+8], v[v_gld_b+9], offset0:17*0 offset1:17*1 ds_write2_b32 v[v_sst_b_os+2], v[v_gld_b+10], v[v_gld_b+11], offset0:17*2 offset1:17*3 s_mov_b64 exec, -1 .v_clear_nc v_c, 32 s_waitcnt lgkmcnt(0) s_barrier ds_read_b128 v[v_b+ 0:v_b+ 3], v[v_sld_b_os], offset:17*4*0 + 0*4 ds_read_b128 v[v_b+ 4:v_b+ 7], v[v_sld_b_os], offset:17*4*0 + 4*4 s_sub_i32 s[s_kitr], s[s_wei_stride_k], 16 ds_read_b128 v[v_b+ 8:v_b+11], v[v_sld_b_os], offset:17*4*0 + 8*4 s_cmp_gt_i32 s[s_kitr], 0 ds_read_b128 v[v_b+12:v_b+15], v[v_sld_b_os], offset:17*4*0 +12*4 s_cbranch_scc0 L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_end L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_body: ; accumulate im ds_read_b128 v[v_b+16:v_b+19], v[v_sld_b_os], offset:17*4*1 + 0*4 ds_read_b128 v[v_b+20:v_b+23], v[v_sld_b_os], offset:17*4*1 + 4*4 ;--- start move slice window s_add_u32 s[s_move_slice_k_ix], 1, s[s_move_slice_k_ix] s_cmp_le_u32 s[s_x], s[s_move_slice_k_ix] s_cselect_b32 s[s_tmp], s[s_dilation_w_x], s[s_dilation_w] s_cselect_b32 s[s_tmp+1], s[s_in_diff_hi], s[s_in_diff_wi] v_add_nc_u32 v[v_in_iwi+0], s[s_tmp], v[v_in_iwi+0] v_add_nc_u32 v[v_in_iwi+1], s[s_tmp], v[v_in_iwi+1] v_add_nc_u32 v[v_in_os+0], s[s_tmp+1], v[v_in_os+0] v_add_nc_u32 v[v_in_os+1], s[s_tmp+1], v[v_in_os+1] s_cbranch_scc0 igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_acc_yx_x_end_1 s_mov_b32 s[s_move_slice_k_ix], 0 v_add_nc_i32 v[v_in_ihi+0], s[s_dilation_h], v[v_in_ihi+0] v_add_nc_i32 v[v_in_ihi+1], s[s_dilation_h], v[v_in_ihi+1] igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_acc_yx_x_end_1: v_cmp_gt_u32 s[s_wi], v[v_in_iwi+0] v_cndmask_b32 v[v_in_flag+0], 0, 1 v_cmp_gt_u32 s[s_wi], v[v_in_iwi+1] v_cndmask_b32 v[v_in_flag+1], 0, 1 v_cmp_gt_u32 s[s_hi], v[v_in_ihi+0] v_cndmask_b32 v[v_in_flag+0], 0, v[v_in_flag+0] v_cmp_gt_u32 s[s_hi], v[v_in_ihi+1] v_cndmask_b32 v[v_in_flag+1], 0, v[v_in_flag+1] ;--- end move slice window s_waitcnt vmcnt(0) v_mov_b32 v[v_a + 0], v[v_gld_a + 0] v_mov_b32 v[v_a + 1], v[v_gld_a + 1] v_mov_b32 v[v_a + 2], v[v_gld_a + 2] v_mov_b32 v[v_a + 3], v[v_gld_a + 3] v_mov_b32 v[v_a + 4], v[v_gld_a + 4] v_mov_b32 v[v_a + 5], v[v_gld_a + 5] v_mov_b32 v[v_a + 6], v[v_gld_a + 6] v_mov_b32 v[v_a + 7], v[v_gld_a + 7] v_mov_b32 v[v_a + 8], v[v_gld_a + 8] v_mov_b32 v[v_a + 9], v[v_gld_a + 9] v_mov_b32 v[v_a +10], v[v_gld_a +10] v_mov_b32 v[v_a +11], v[v_gld_a +11] v_mov_b32 v[v_a +12], v[v_gld_a +12] v_mov_b32 v[v_a +13], v[v_gld_a +13] v_mov_b32 v[v_a +14], v[v_gld_a +14] v_mov_b32 v[v_a +15], v[v_gld_a +15] .v_clear_nc v_gld_a, 16 v_cmpx_le_u32 1, v[v_in_flag+0] global_load_dwordx4 v[v_gld_a+0:v_gld_a+3], v[v_in_os], s[s_p_in:s_p_in+1] global_load_dwordx4 v[v_gld_a+4:v_gld_a+7], v[v_in_os], s[s_p_in:s_p_in+1] offset:16 s_mov_b64 exec, -1 v_cmpx_le_u32 1, v[v_in_flag+1] global_load_dwordx4 v[v_gld_a+ 8:v_gld_a+11], v[v_in_os+1], s[s_p_in:s_p_in+1] global_load_dwordx4 v[v_gld_a+12:v_gld_a+15], v[v_in_os+1], s[s_p_in:s_p_in+1] offset:16 s_mov_b64 exec, -1 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 0, v_b + 0 .fma_1x8_fp16 v_c+16, v_a + 8, v_b + 0 ds_read_b128 v[v_b+24:v_b+27], v[v_sld_b_os], offset:17*4*1 + 8*4 ds_read_b128 v[v_b+28:v_b+31], v[v_sld_b_os], offset:17*4*1 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 0, v_b + 8 .fma_1x8_fp16 v_c+24, v_a + 8, v_b + 8 ds_read_b128 v[v_b+ 0:v_b+ 3], v[v_sld_b_os], offset:17*4*2 + 0*4 ds_read_b128 v[v_b+ 4:v_b+ 7], v[v_sld_b_os], offset:17*4*2 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 1, v_b +16 .fma_1x8_fp16 v_c+16, v_a + 9, v_b +16 ds_read_b128 v[v_b+ 8:v_b+11], v[v_sld_b_os], offset:17*4*2 + 8*4 ds_read_b128 v[v_b+12:v_b+15], v[v_sld_b_os], offset:17*4*2 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 1, v_b +24 .fma_1x8_fp16 v_c+24, v_a + 9, v_b +24 ds_read_b128 v[v_b+16:v_b+19], v[v_sld_b_os], offset:17*4*3 + 0*4 ds_read_b128 v[v_b+20:v_b+23], v[v_sld_b_os], offset:17*4*3 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 2, v_b + 0 .fma_1x8_fp16 v_c+16, v_a +10, v_b + 0 ds_read_b128 v[v_b+24:v_b+27], v[v_sld_b_os], offset:17*4*3 + 8*4 ds_read_b128 v[v_b+28:v_b+31], v[v_sld_b_os], offset:17*4*3 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 2, v_b + 8 .fma_1x8_fp16 v_c+24, v_a +10, v_b + 8 ds_read_b128 v[v_b+ 0:v_b+ 3], v[v_sld_b_os], offset:17*4*4 + 0*4 ds_read_b128 v[v_b+ 4:v_b+ 7], v[v_sld_b_os], offset:17*4*4 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 3, v_b +16 .fma_1x8_fp16 v_c+16, v_a +11, v_b +16 ds_read_b128 v[v_b+ 8:v_b+11], v[v_sld_b_os], offset:17*4*4 + 8*4 ds_read_b128 v[v_b+12:v_b+15], v[v_sld_b_os], offset:17*4*4 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 3, v_b +24 .fma_1x8_fp16 v_c+24, v_a +11, v_b +24 ds_read_b128 v[v_b+16:v_b+19], v[v_sld_b_os], offset:17*4*5 + 0*4 ds_read_b128 v[v_b+20:v_b+23], v[v_sld_b_os], offset:17*4*5 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 4, v_b + 0 .fma_1x8_fp16 v_c+16, v_a +12, v_b + 0 ds_read_b128 v[v_b+24:v_b+27], v[v_sld_b_os], offset:17*4*5 + 8*4 ds_read_b128 v[v_b+28:v_b+31], v[v_sld_b_os], offset:17*4*5 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 4, v_b + 8 .fma_1x8_fp16 v_c+24, v_a +12, v_b + 8 ds_read_b128 v[v_b+ 0:v_b+ 3], v[v_sld_b_os], offset:17*4*6 + 0*4 ds_read_b128 v[v_b+ 4:v_b+ 7], v[v_sld_b_os], offset:17*4*6 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 5, v_b +16 .fma_1x8_fp16 v_c+16, v_a +13, v_b +16 ds_read_b128 v[v_b+ 8:v_b+11], v[v_sld_b_os], offset:17*4*6 + 8*4 ds_read_b128 v[v_b+12:v_b+15], v[v_sld_b_os], offset:17*4*6 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 5, v_b +24 .fma_1x8_fp16 v_c+24, v_a +13, v_b +24 ds_read_b128 v[v_b+16:v_b+19], v[v_sld_b_os], offset:17*4*7 + 0*4 ds_read_b128 v[v_b+20:v_b+23], v[v_sld_b_os], offset:17*4*7 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 6, v_b + 0 .fma_1x8_fp16 v_c+16, v_a +14, v_b + 0 ds_read_b128 v[v_b+24:v_b+27], v[v_sld_b_os], offset:17*4*7 + 8*4 ds_read_b128 v[v_b+28:v_b+31], v[v_sld_b_os], offset:17*4*7 +12*4 s_waitcnt lgkmcnt(4) v_add_nc_u32 v[v_sld_b_os], s[s_sld_b_stride], v[v_sld_b_os] ; accumulate sld_b_os .fma_1x8_fp16 v_c+ 8, v_a + 6, v_b + 8 .fma_1x8_fp16 v_c+24, v_a +14, v_b + 8 ds_read_b128 v[v_b+ 0:v_b+ 3], v[v_sld_b_os], offset:17*4*0 + 0*4 ds_read_b128 v[v_b+ 4:v_b+ 7], v[v_sld_b_os], offset:17*4*0 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 7, v_b +16 .fma_1x8_fp16 v_c+16, v_a +15, v_b +16 ds_read_b128 v[v_b+ 8:v_b+11], v[v_sld_b_os], offset:17*4*0 + 8*4 ds_read_b128 v[v_b+12:v_b+15], v[v_sld_b_os], offset:17*4*0 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 7, v_b +24 .fma_1x8_fp16 v_c+24, v_a +15, v_b +24 s_sub_i32 s[s_kitr], s[s_kitr], 16 s_cmp_gt_i32 s[s_kitr], 0 s_cbranch_scc1 L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_body L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_end: ds_read_b128 v[v_b+16:v_b+19], v[v_sld_b_os], offset:17*4*1 + 0*4 ds_read_b128 v[v_b+20:v_b+23], v[v_sld_b_os], offset:17*4*1 + 4*4 s_waitcnt vmcnt(0) v_add_nc_u32 v[v_ib], s[s_stride_m], v[v_ib] s_sub_i32 s[s_batch_m], s[s_batch_m], 1 v_mov_b32 v[v_a + 0], v[v_gld_a + 0] v_mov_b32 v[v_a + 1], v[v_gld_a + 1] v_mov_b32 v[v_a + 2], v[v_gld_a + 2] v_mov_b32 v[v_a + 3], v[v_gld_a + 3] v_mov_b32 v[v_a + 4], v[v_gld_a + 4] v_mov_b32 v[v_a + 5], v[v_gld_a + 5] v_mov_b32 v[v_a + 6], v[v_gld_a + 6] v_mov_b32 v[v_a + 7], v[v_gld_a + 7] v_mov_b32 v[v_a + 8], v[v_gld_a + 8] v_mov_b32 v[v_a + 9], v[v_gld_a + 9] v_mov_b32 v[v_a +10], v[v_gld_a +10] v_mov_b32 v[v_a +11], v[v_gld_a +11] v_mov_b32 v[v_a +12], v[v_gld_a +12] v_mov_b32 v[v_a +13], v[v_gld_a +13] v_mov_b32 v[v_a +14], v[v_gld_a +14] v_mov_b32 v[v_a +15], v[v_gld_a +15] s_cmp_gt_i32 s[s_batch_m], 0 s_cbranch_scc0 L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_end_not_load_next ; --- start move slice for batch m ; ihi = iho * s_stride_h + iy * s_dilation_h - s_pad_h ; iwi = iwo * s_stride_w + ix * s_dilation_w - s_pad_w ; we will update v_in_os below, so use this as v_tmp .mdiv_u32_rem_vs v_in_iwi,v_in_ihi,v_ib,s_magic_1,s_shift_m1,s_wo,v_in_os v_mul_u32_u24 v[v_in_ihi], s[s_stride_h], v[v_in_ihi] .v_clear_nc v_gld_a, 4 v_add_nc_u32 v[v_in_flag+1], s[s_ib_stride], v[v_ib] v_sub_nc_i32 v[v_in_ihi], v[v_in_ihi], s[s_pad_h] v_mul_u32_u24 v[v_in_iwi], s[s_stride_w], v[v_in_iwi] .v_clear_nc v_gld_a+4, 4 v_sub_nc_i32 v[v_in_iwi], v[v_in_iwi], s[s_pad_w] .mdiv_u32_rem_vs v_in_iwi+1,v_in_ihi+1,v_in_flag+1,s_magic_1,s_shift_m1,s_wo,v_in_os+1 v_mul_u32_u24 v[v_in_os], s[s_wi], v[v_in_ihi] v_cmp_gt_u32 s[s_hi], v[v_in_ihi] v_cndmask_b32 v[v_in_flag], 0, 1 v_add_nc_u32 v[v_in_os], v[v_in_iwi], v[v_in_os] v_cmp_gt_u32 s[s_wi], v[v_in_iwi] v_cndmask_b32 v[v_in_flag], 0, v[v_in_flag] v_mul_lo_u32 v[v_in_os], s[s_in_stride_wi], v[v_in_os] v_mul_u32_u24 v[v_in_ihi+1], s[s_stride_h], v[v_in_ihi+1] .v_clear_nc v_gld_a+8, 4 v_sub_nc_i32 v[v_in_ihi+1], v[v_in_ihi+1], s[s_pad_h] v_mul_u32_u24 v[v_in_iwi+1], s[s_stride_w], v[v_in_iwi+1] .v_clear_nc v_gld_a+12, 4 v_sub_nc_i32 v[v_in_iwi+1], v[v_in_iwi+1], s[s_pad_w] v_cmpx_le_u32 1, v[v_in_flag] global_load_dwordx4 v[v_gld_a+0:v_gld_a+3], v[v_in_os], s[s_p_in:s_p_in+1] global_load_dwordx4 v[v_gld_a+4:v_gld_a+7], v[v_in_os], s[s_p_in:s_p_in+1] offset:16 s_mov_b64 exec, -1 v_mul_u32_u24 v[v_in_os+1], s[s_wi], v[v_in_ihi+1] v_cmp_gt_u32 s[s_hi], v[v_in_ihi+1] v_cndmask_b32 v[v_in_flag+1], 0, 1 v_add_nc_u32 v[v_in_os+1], v[v_in_iwi+1], v[v_in_os+1] v_cmp_gt_u32 s[s_wi], v[v_in_iwi+1] v_cndmask_b32 v[v_in_flag+1], 0, v[v_in_flag+1] v_mul_lo_u32 v[v_in_os+1], s[s_in_stride_wi], v[v_in_os+1] s_mov_b32 s[s_move_slice_k_ix], 0 v_cmpx_le_u32 1, v[v_in_flag+1] global_load_dwordx4 v[v_gld_a+ 8:v_gld_a+11], v[v_in_os+1], s[s_p_in:s_p_in+1] global_load_dwordx4 v[v_gld_a+12:v_gld_a+15], v[v_in_os+1], s[s_p_in:s_p_in+1] offset:16 s_mov_b64 exec, -1 L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_end_not_load_next: ; --- end move slice for batch m s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 0, v_b + 0 .fma_1x8_fp16 v_c+16, v_a + 8, v_b + 0 ds_read_b128 v[v_b+24:v_b+27], v[v_sld_b_os], offset:17*4*1 + 8*4 ds_read_b128 v[v_b+28:v_b+31], v[v_sld_b_os], offset:17*4*1 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 0, v_b + 8 .fma_1x8_fp16 v_c+24, v_a + 8, v_b + 8 ds_read_b128 v[v_b+ 0:v_b+ 3], v[v_sld_b_os], offset:17*4*2 + 0*4 ds_read_b128 v[v_b+ 4:v_b+ 7], v[v_sld_b_os], offset:17*4*2 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 1, v_b +16 .fma_1x8_fp16 v_c+16, v_a + 9, v_b +16 ds_read_b128 v[v_b+ 8:v_b+11], v[v_sld_b_os], offset:17*4*2 + 8*4 ds_read_b128 v[v_b+12:v_b+15], v[v_sld_b_os], offset:17*4*2 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 1, v_b +24 .fma_1x8_fp16 v_c+24, v_a + 9, v_b +24 ds_read_b128 v[v_b+16:v_b+19], v[v_sld_b_os], offset:17*4*3 + 0*4 ds_read_b128 v[v_b+20:v_b+23], v[v_sld_b_os], offset:17*4*3 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 2, v_b + 0 .fma_1x8_fp16 v_c+16, v_a +10, v_b + 0 ds_read_b128 v[v_b+24:v_b+27], v[v_sld_b_os], offset:17*4*3 + 8*4 ds_read_b128 v[v_b+28:v_b+31], v[v_sld_b_os], offset:17*4*3 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 2, v_b + 8 .fma_1x8_fp16 v_c+24, v_a +10, v_b + 8 ds_read_b128 v[v_b+ 0:v_b+ 3], v[v_sld_b_os], offset:17*4*4 + 0*4 ds_read_b128 v[v_b+ 4:v_b+ 7], v[v_sld_b_os], offset:17*4*4 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 3, v_b +16 .fma_1x8_fp16 v_c+16, v_a +11, v_b +16 ds_read_b128 v[v_b+ 8:v_b+11], v[v_sld_b_os], offset:17*4*4 + 8*4 ds_read_b128 v[v_b+12:v_b+15], v[v_sld_b_os], offset:17*4*4 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 3, v_b +24 .fma_1x8_fp16 v_c+24, v_a +11, v_b +24 ds_read_b128 v[v_b+16:v_b+19], v[v_sld_b_os], offset:17*4*5 + 0*4 ds_read_b128 v[v_b+20:v_b+23], v[v_sld_b_os], offset:17*4*5 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 4, v_b + 0 .fma_1x8_fp16 v_c+16, v_a +12, v_b + 0 ds_read_b128 v[v_b+24:v_b+27], v[v_sld_b_os], offset:17*4*5 + 8*4 ds_read_b128 v[v_b+28:v_b+31], v[v_sld_b_os], offset:17*4*5 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 4, v_b + 8 .fma_1x8_fp16 v_c+24, v_a +12, v_b + 8 ds_read_b128 v[v_b+ 0:v_b+ 3], v[v_sld_b_os], offset:17*4*6 + 0*4 ds_read_b128 v[v_b+ 4:v_b+ 7], v[v_sld_b_os], offset:17*4*6 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 5, v_b +16 .fma_1x8_fp16 v_c+16, v_a +13, v_b +16 ds_read_b128 v[v_b+ 8:v_b+11], v[v_sld_b_os], offset:17*4*6 + 8*4 ds_read_b128 v[v_b+12:v_b+15], v[v_sld_b_os], offset:17*4*6 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 5, v_b +24 .fma_1x8_fp16 v_c+24, v_a +13, v_b +24 ds_read_b128 v[v_b+16:v_b+19], v[v_sld_b_os], offset:17*4*7 + 0*4 ds_read_b128 v[v_b+20:v_b+23], v[v_sld_b_os], offset:17*4*7 + 4*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 0, v_a + 6, v_b + 0 .fma_1x8_fp16 v_c+16, v_a +14, v_b + 0 ds_read_b128 v[v_b+24:v_b+27], v[v_sld_b_os], offset:17*4*7 + 8*4 ds_read_b128 v[v_b+28:v_b+31], v[v_sld_b_os], offset:17*4*7 +12*4 s_waitcnt lgkmcnt(4) .fma_1x8_fp16 v_c+ 8, v_a + 6, v_b + 8 .fma_1x8_fp16 v_c+24, v_a +14, v_b + 8 v_mov_b32 v[v_sld_b_os], 0 ; reset to start s_waitcnt lgkmcnt(2) .fma_1x8_fp16 v_c+ 0, v_a + 7, v_b +16 .activ_f32 v_c + 0, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 1, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 2, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 3, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 4, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 5, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 6, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 7, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 v_cvt_f16_f32 v[v_c + 0], v[v_c + 0] v_cvt_f16_f32 v[v_c + 1], v[v_c + 1] v_cvt_f16_f32 v[v_c + 2], v[v_c + 2] v_cvt_f16_f32 v[v_c + 3], v[v_c + 3] v_cvt_f16_f32 v[v_c + 4], v[v_c + 4] v_cvt_f16_f32 v[v_c + 5], v[v_c + 5] v_cvt_f16_f32 v[v_c + 6], v[v_c + 6] v_cvt_f16_f32 v[v_c + 7], v[v_c + 7] .fma_1x8_fp16 v_c+16, v_a +15, v_b +16 .activ_f32 v_c + 0+16, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 1+16, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 2+16, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 3+16, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 4+16, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 5+16, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 6+16, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 7+16, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 v_cvt_f16_f32 v[v_c +16], v[v_c +16] v_cvt_f16_f32 v[v_c +17], v[v_c +17] v_cvt_f16_f32 v[v_c +18], v[v_c +18] v_cvt_f16_f32 v[v_c +19], v[v_c +19] v_cvt_f16_f32 v[v_c +20], v[v_c +20] v_cvt_f16_f32 v[v_c +21], v[v_c +21] v_cvt_f16_f32 v[v_c +22], v[v_c +22] v_cvt_f16_f32 v[v_c +23], v[v_c +23] s_waitcnt lgkmcnt(0) .fma_1x8_fp16 v_c+ 8, v_a + 7, v_b +24 .activ_f32 v_c + 0+8, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 1+8, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 2+8, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 3+8, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 4+8, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 5+8, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 6+8, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 7+8, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 v_cvt_f16_f32 v[v_c + 8], v[v_c + 8] v_cvt_f16_f32 v[v_c + 9], v[v_c + 9] v_cvt_f16_f32 v[v_c +10], v[v_c +10] v_cvt_f16_f32 v[v_c +11], v[v_c +11] v_cvt_f16_f32 v[v_c +12], v[v_c +12] v_cvt_f16_f32 v[v_c +13], v[v_c +13] v_cvt_f16_f32 v[v_c +14], v[v_c +14] v_cvt_f16_f32 v[v_c +15], v[v_c +15] .fma_1x8_fp16 v_c+24, v_a +15, v_b +24 .activ_f32 v_c + 0+24, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 1+24, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 2+24, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 3+24, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 4+24, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 5+24, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 6+24, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 .activ_f32 v_c + 7+24, activ_mode, s_alpha, s_beta, s_gamma, v_tmp+0, v_tmp+1 v_cvt_f16_f32 v[v_c +24], v[v_c +24] v_cvt_f16_f32 v[v_c +25], v[v_c +25] v_cvt_f16_f32 v[v_c +26], v[v_c +26] v_cvt_f16_f32 v[v_c +27], v[v_c +27] v_cvt_f16_f32 v[v_c +28], v[v_c +28] v_cvt_f16_f32 v[v_c +29], v[v_c +29] v_cvt_f16_f32 v[v_c +30], v[v_c +30] v_cvt_f16_f32 v[v_c +31], v[v_c +31] v_pack_b32_f16 v[v_c_buf+0], v[v_c+ 0], v[v_c+ 1] v_pack_b32_f16 v[v_c_buf+1], v[v_c+ 2], v[v_c+ 3] v_pack_b32_f16 v[v_c_buf+2], v[v_c+ 4], v[v_c+ 5] v_pack_b32_f16 v[v_c_buf+3], v[v_c+ 6], v[v_c+ 7] v_pack_b32_f16 v[v_c_buf+4], v[v_c+ 8], v[v_c+ 9] v_pack_b32_f16 v[v_c_buf+5], v[v_c+10], v[v_c+11] v_pack_b32_f16 v[v_c_buf+6], v[v_c+12], v[v_c+13] v_pack_b32_f16 v[v_c_buf+7], v[v_c+14], v[v_c+15] v_cmpx_le_u32 1, v[v_out_flag] global_store_dwordx4 v[v_out_os], v[v_c_buf+0:v_c_buf+3], s[s_p_out:s_p_out+1] global_store_dwordx4 v[v_out_os], v[v_c_buf+4:v_c_buf+7], s[s_p_out:s_p_out+1], offset:16 s_mov_b64 exec, -1 v_pack_b32_f16 v[v_c_buf+ 8], v[v_c+16], v[v_c+17] v_pack_b32_f16 v[v_c_buf+ 9], v[v_c+18], v[v_c+19] v_pack_b32_f16 v[v_c_buf+10], v[v_c+20], v[v_c+21] v_pack_b32_f16 v[v_c_buf+11], v[v_c+22], v[v_c+23] v_pack_b32_f16 v[v_c_buf+12], v[v_c+24], v[v_c+25] v_pack_b32_f16 v[v_c_buf+13], v[v_c+26], v[v_c+27] v_pack_b32_f16 v[v_c_buf+14], v[v_c+28], v[v_c+29] v_pack_b32_f16 v[v_c_buf+15], v[v_c+30], v[v_c+31] v_cmpx_le_u32 1, v[v_out_flag+1] global_store_dwordx4 v[v_out_os+1], v[v_c_buf+ 8:v_c_buf+11], s[s_p_out:s_p_out+1] global_store_dwordx4 v[v_out_os+1], v[v_c_buf+12:v_c_buf+15], s[s_p_out:s_p_out+1], offset:16 s_mov_b64 exec, -1 s_cmp_le_i32 s[s_batch_m], 0 s_cbranch_scc1 L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_end ds_read_b128 v[v_b+ 0:v_b+ 3], v[v_sld_b_os], offset:17*4*0 + 0*4 ds_read_b128 v[v_b+ 4:v_b+ 7], v[v_sld_b_os], offset:17*4*0 + 4*4 ds_read_b128 v[v_b+ 8:v_b+11], v[v_sld_b_os], offset:17*4*0 + 8*4 ds_read_b128 v[v_b+12:v_b+15], v[v_sld_b_os], offset:17*4*0 +12*4 .v_clear_nc v_c, 32 v_add_nc_u32 v[v_out_os], s[s_out_stride], v[v_out_os] s_sub_i32 s[s_kitr], s[s_wei_stride_k], 16 v_add_nc_u32 v[v_out_os+1], s[s_out_stride], v[v_out_os+1] v_cmp_gt_u32 s[s_out_stride_n], v[v_out_os] v_cndmask_b32 v[v_out_flag], 0, 1 s_cmp_gt_i32 s[s_kitr], 0 v_cmp_gt_u32 s[s_out_stride_n], v[v_out_os+1] v_cndmask_b32 v[v_out_flag+1], 0, 1 s_cbranch_scc0 L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_end s_branch L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_fma_body L_igemm_fwd_btm_nhwc_fp16_256x16x16_r3_end: s_endpgm ; LDS: (16+1) * (3 * 4) * 16 * 4 = 13056 ; k pad r3 e:4 c dword .rodata .p2align 6 .amdhsa_kernel igemm_fwd_btm_nhwc_fp16_256x16x16_r3 .amdhsa_group_segment_fixed_size 13056 .amdhsa_user_sgpr_kernarg_segment_ptr 1 .amdhsa_system_sgpr_workgroup_id_x 1 .amdhsa_system_sgpr_workgroup_id_y 1 .amdhsa_system_sgpr_workgroup_id_z 1 .amdhsa_system_vgpr_workitem_id 0 .amdhsa_next_free_vgpr 112 .amdhsa_next_free_sgpr 58 .amdhsa_ieee_mode 0 .amdhsa_dx10_clamp 0 .amdhsa_wavefront_size32 1 .amdhsa_workgroup_processor_mode 0 .end_amdhsa_kernel ",16255,True,3939.8170780359724,median "{""mxGraphModel"": {""root"": {""mxCell"": [{""_id"": ""0""}, {""Object"": {""Object"": {""_gpu_id"": ""0"", ""_memory_size"": ""8.0"", ""_number_of_cpus"": ""2.0"", ""_as"": ""hw_resources""}, ""_as"": ""options""}, ""_id"": ""1"", ""_parent"": ""0"", ""_regions"": [{""id"": ""auto"", ""name"": ""app.yonohub.com"", ""selected"": true}], ""_hw_resources"": {""recommended"": {""cpu"": 0, ""gpu"": 0, ""memory"": 0}, ""total"": {""cpu"": 0, ""gpu"": 0, ""memory"": 0}}, ""_pipeline_region"": ""{\\""dep_reg_id\\"":\\""auto\\"",\\""node_id\\"":\\""\\"",\\""burstability\\"":true,\\""selectedResource\\"":\\""\\"",\\""resources_ids\\"":[],\\""resourcesObj\\"":[],\\""usage_factor\\"":0.1,\\""count\\"":\\""1\\"",\\""isBurstableConfigurable\\"":false,\\""spinner\\"":\\""sent\\"",\\""instanceType\\"":\\""C\\"",\\""instanceCount\\"":20,\\""dep_reg_resources\\"":null,\\""isCustomerSite\\"":false}""}, {""mxGeometry"": {""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""46"", ""_style"": ""edgeStyle=elbowEdgeStyle;rounded=0;jumpStyle=arc;html=1;endArrow=blockThin;jettySize=auto;orthogonalLoop=1;strokeColor=#838383;strokeWidth=3;"", ""_edge"": ""1"", ""_parent"": ""1"", ""_source"": ""10"", ""_target"": ""21"", ""_tooltip"": ""
Message Rate:36 Messages per second
Traffic:28.69632 Mbps
Last Updated:1 Seconds ago
Window Size:1 Seconds
""}, {""mxGeometry"": {""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""47"", ""_style"": ""edgeStyle=elbowEdgeStyle;rounded=0;jumpStyle=arc;html=1;endArrow=blockThin;jettySize=auto;orthogonalLoop=1;strokeColor=#838383;strokeWidth=3;"", ""_edge"": ""1"", ""_parent"": ""1"", ""_source"": ""11"", ""_target"": ""22"", ""_tooltip"": ""
Message Rate:36 Messages per second
Traffic:0.311024 Mbps
Last Updated:1 Seconds ago
Window Size:1 Seconds
""}, {""mxGeometry"": {""_x"": ""370"", ""_y"": ""645"", ""_width"": ""222"", ""_height"": ""172"", ""_as"": ""geometry""}, ""Object"": {""Object"": {""_gpu_id"": ""1"", ""_memory_size"": ""6.1"", ""_number_of_cpus"": ""0.6"", ""_as"": ""hw_resources""}, ""_batch_size"": ""1"", ""_dataset"": ""7"", ""_frame_rate"": ""50"", ""_loop"": ""true"", ""_play"": ""''"", ""_shuffle"": ""true"", ""_split"": ""train"", ""_number_of_instances"": ""1"", ""_region"": ""{\\""dep_reg_id\\"":\\""auto\\"",\\""node_id\\"":\\""\\"",\\""burstability\\"":true,\\""selectedResource\\"":\\""\\"",\\""resources_ids\\"":[],\\""resourcesObj\\"":[],\\""usage_factor\\"":0.1,\\""count\\"":\\""1\\"",\\""isBurstableConfigurable\\"":false,\\""spinner\\"":\\""sent\\"",\\""instanceType\\"":\\""GK\\"",\\""instanceCount\\"":1,\\""dep_reg_resources\\"":{},\\""isCustomerSite\\"":false}"", ""_execution_mode"": ""async"", ""_is_synced"": ""1"", ""_synced_values"": ""{\\""batch_size\\"":\\""batch_size\\""}"", ""_as"": ""options""}, ""_id"": ""2"", ""_value"": """", ""_style"": ""top;fillColor=#fff;strokeColor=#18e7bb;rotatable=0;resizable=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_blockID"": ""5edd0c990a32a55d4a63eab1"", ""_originalBlockID"": ""5ed4c7576b86ba39478836a4"", ""_tooltip"": ""The block is used to stream all the datasets available under the Image Classification category offered by Tensorflow Datasets package in a batch mode to be used in training/ testing of models."", ""_block"": ""1"", ""_yonoarc_block"": ""1"", ""_parent"": ""1"", ""_suggested"": ""1""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""15"", ""_width"": ""200"", ""_height"": ""55"", ""_as"": ""geometry""}, ""_id"": ""3"", ""_value"": ""Image Classifica.."", ""_style"": ""top;strokeColor=none;verticalLabelPosition=bottom;labelBackgroundColor=;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;verticalAlign=top;image=https://app.yonohub.com/editor/block-icon/ff3d205fa5c8426db4d6890206da222e.svg;shape=image;"", ""_vertex"": ""1"", ""_tooltip"": ""Image Classification Batch Player: The block is used to stream all the datasets available under the Image Classification category offered by Tensorflow Datasets package in a batch mode to be used in training/ testing of models."", ""_connectable"": ""0"", ""_parent"": ""2""}, {""mxGeometry"": {""_y"": ""137"", ""_width"": ""222"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""4"", ""_value"": """", ""_style"": ""shape=stencil(rVNNE4IgFPw13AkudWysTv2Jp2Iyohio2b8PQZvBr2xqhsvuvn1vGR6IBjqFkiGCC8gZoidESMOU5rK4QsiEgUYDXbKo6lVQHELBnJI6coexww8P0zPCR8N2hwYhRNlNybqIPWGQS6jSGWGQc9l0MVs3oB/3dIhSCy8rdsGLRTv+0v2+7Z/8G+Lfa4i7BrtxhzHREkccSF9A/ILtKfdexi3+UchPEbGf8MdH3GCPhNRsvoQGhp9soGUX1pYGiVRsZZ8TLoSulMwmI23biduy7jda4gU=);whiteSpace=wrap;html=1;strokeColor=#18e7bb;fontSize=10;fillColor=#18e7bb;fontColor=white;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_tooltip"": ""Running"", ""_status"": ""stopped"", ""_type"": ""version"", ""_parent"": ""2""}, {""mxGeometry"": {""_x"": ""30"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""5"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;fontColor=#FFF;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""4""}, {""mxGeometry"": {""_x"": ""70"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""6"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""4""}, {""mxGeometry"": {""_x"": ""110"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""7"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#FFF;movable=0;resizable=1;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""4""}, {""mxGeometry"": {""_x"": ""150"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""8"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""4""}, {""mxGeometry"": {""_x"": ""20"", ""_y"": ""110"", ""_width"": ""180"", ""_height"": ""20"", ""_as"": ""geometry""}, ""_id"": ""9"", ""_value"": ""Yonohub Team"", ""_style"": ""logo;fontSize=12;strokeColor=#70707030;strokeWidth=2;arcSize=15;rounded=1;fillColor=none;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""2""}, {""mxGeometry"": {""_x"": ""0.985"", ""_y"": ""0.27"", ""_width"": ""6"", ""_height"": ""6"", ""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""10"", ""_value"": """", ""_style"": ""rounded=1;arcSize=50;html=1;movable=0;resizable=0;rotatable=0;deletable=0;editable=0;selectable=0;strokeColor=#2d2a53;"", ""_vertex"": ""1"", ""_slug"": ""image_batches"", ""_key"": ""image_batches"", ""_tooltip"": ""Image Batch (perception_msgs/ImageBatch)\\nA batch of images of the selected dataset"", ""_message_tag"": ""perception_msgs/ImageBatch"", ""_ifFastRtps"": ""1"", ""_parent"": ""2""}, {""mxGeometry"": {""_x"": ""0.985"", ""_y"": ""0.5700000000000001"", ""_width"": ""6"", ""_height"": ""6"", ""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""11"", ""_value"": """", ""_style"": ""rounded=1;arcSize=50;html=1;movable=0;resizable=0;rotatable=0;deletable=0;editable=0;selectable=0;strokeColor=#2d2a53;"", ""_vertex"": ""1"", ""_slug"": ""labels"", ""_key"": ""labels"", ""_tooltip"": ""Labels (perception_msgs/LabelArray)\\nAn array of labels corresponds to the batch of images."", ""_message_tag"": ""perception_msgs/LabelArray"", ""_ifFastRtps"": ""1"", ""_parent"": ""2""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""-40"", ""_width"": ""200"", ""_height"": ""50"", ""_as"": ""geometry""}, ""_id"": ""12"", ""_value"": """", ""_style"": ""html=1;wrap=1;whiteSpace=wrap;strokeColor=none;fontSize=14;labelBackgroundColor=transparent;align=center;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_cell_type"": ""region_name"", ""_parent"": ""2""}, {""mxGeometry"": {""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""48"", ""_style"": ""edgeStyle=elbowEdgeStyle;rounded=0;jumpStyle=arc;html=1;endArrow=blockThin;jettySize=auto;orthogonalLoop=1;strokeColor=#838383;strokeWidth=3;"", ""_edge"": ""1"", ""_parent"": ""1"", ""_source"": ""23"", ""_target"": ""34"", ""_tooltip"": """"}, {""mxGeometry"": {""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""49"", ""_style"": ""edgeStyle=elbowEdgeStyle;rounded=0;jumpStyle=arc;html=1;endArrow=blockThin;jettySize=auto;orthogonalLoop=1;strokeColor=#838383;strokeWidth=3;"", ""_edge"": ""1"", ""_parent"": ""1"", ""_source"": ""24"", ""_target"": ""44"", ""_tooltip"": ""
Message Rate:Infinity Messages per second
Traffic:Infinity Mbps
Last Updated:22 Seconds ago
Window Size:0 Seconds
""}, {""mxGeometry"": {""_x"": ""888"", ""_y"": ""645"", ""_width"": ""222"", ""_height"": ""172"", ""_as"": ""geometry""}, ""Object"": {""Object"": {""_gpu_id"": ""1"", ""_memory_size"": ""6.1"", ""_number_of_cpus"": ""0.6"", ""_as"": ""hw_resources""}, ""_batch_size"": ""1"", ""_dataset_size"": ""50000"", ""_epochs"": ""10"", ""_lr"": ""0.001"", ""_model_name"": ""my_model"", ""_model_path"": ""/MyDrive/Tensorflow_Series/Part_2"", ""_momentum"": ""0.9"", ""_password"": ""password"", ""_username"": ""username"", ""_number_of_instances"": ""1"", ""_region"": ""{\\""dep_reg_id\\"":\\""auto\\"",\\""node_id\\"":\\""\\"",\\""burstability\\"":true,\\""selectedResource\\"":\\""\\"",\\""resources_ids\\"":[],\\""resourcesObj\\"":[],\\""usage_factor\\"":0.1,\\""count\\"":\\""1\\"",\\""isBurstableConfigurable\\"":false,\\""spinner\\"":\\""sent\\"",\\""instanceType\\"":\\""GK\\"",\\""instanceCount\\"":1,\\""dep_reg_resources\\"":{},\\""isCustomerSite\\"":false}"", ""_execution_mode"": ""sync"", ""_execution_mode_interval"": ""1"", ""_is_synced"": ""1"", ""_synced_values"": ""{\\""batch_size\\"":\\""batch_size\\""}"", ""_as"": ""options""}, ""_id"": ""13"", ""_value"": """", ""_style"": ""top;fillColor=#fff;strokeColor=#18e7bb;rotatable=0;resizable=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_blockID"": ""5edd0c400a32a55d4a63eab0"", ""_originalBlockID"": ""5ed4d89baf24d6d1f24770dc"", ""_tooltip"": ""A CNN classifier model as a block to be trained on the CIFAR dataset."", ""_block"": ""1"", ""_yonoarc_block"": ""1"", ""_parent"": ""1"", ""_suggested"": ""1""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""15"", ""_width"": ""200"", ""_height"": ""20"", ""_as"": ""geometry""}, ""_id"": ""14"", ""_value"": ""CIFAR CNN"", ""_style"": ""top;strokeColor=none;verticalLabelPosition=bottom;labelBackgroundColor=;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;verticalAlign=center;"", ""_vertex"": ""1"", ""_tooltip"": ""CIFAR CNN: A CNN classifier model as a block to be trained on the CIFAR dataset."", ""_connectable"": ""0"", ""_parent"": ""13""}, {""mxGeometry"": {""_y"": ""137"", ""_width"": ""222"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""15"", ""_value"": """", ""_style"": ""shape=stencil(rVNNE4IgFPw13AkudWysTv2Jp2Iyohio2b8PQZvBr2xqhsvuvn1vGR6IBjqFkiGCC8gZoidESMOU5rK4QsiEgUYDXbKo6lVQHELBnJI6coexww8P0zPCR8N2hwYhRNlNybqIPWGQS6jSGWGQc9l0MVs3oB/3dIhSCy8rdsGLRTv+0v2+7Z/8G+Lfa4i7BrtxhzHREkccSF9A/ILtKfdexi3+UchPEbGf8MdH3GCPhNRsvoQGhp9soGUX1pYGiVRsZZ8TLoSulMwmI23biduy7jda4gU=);whiteSpace=wrap;html=1;strokeColor=#18e7bb;fontSize=10;fillColor=#18e7bb;fontColor=white;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_tooltip"": ""Running"", ""_status"": ""stopped"", ""_type"": ""version"", ""_parent"": ""13""}, {""mxGeometry"": {""_x"": ""30"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""16"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;fontColor=#FFF;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""15""}, {""mxGeometry"": {""_x"": ""70"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""17"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""15""}, {""mxGeometry"": {""_x"": ""110"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""18"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#FFF;movable=0;resizable=1;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""15""}, {""mxGeometry"": {""_x"": ""150"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""19"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""15""}, {""mxGeometry"": {""_x"": ""20"", ""_y"": ""110"", ""_width"": ""180"", ""_height"": ""20"", ""_as"": ""geometry""}, ""_id"": ""20"", ""_value"": ""Yonohub Team"", ""_style"": ""logo;fontSize=12;strokeColor=#70707030;strokeWidth=2;arcSize=15;rounded=1;fillColor=none;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""13""}, {""mxGeometry"": {""_x"": ""-0.015"", ""_y"": ""0.27"", ""_width"": ""6"", ""_height"": ""6"", ""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""21"", ""_value"": """", ""_style"": ""rounded=1;arcSize=50;html=1;movable=0;resizable=0;rotatable=0;deletable=0;editable=0;selectable=0;strokeColor=#2d2a53;"", ""_vertex"": ""1"", ""_slug"": ""input_batch"", ""_key"": ""input_batch"", ""_tooltip"": ""Image Batch (perception_msgs/ImageBatch)\\nThe batch of images streamed from a player with a size equals to the batch size property."", ""_message_tag"": ""perception_msgs/ImageBatch"", ""_ifFastRtps"": ""1"", ""_parent"": ""13""}, {""mxGeometry"": {""_x"": ""-0.015"", ""_y"": ""0.5700000000000001"", ""_width"": ""6"", ""_height"": ""6"", ""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""22"", ""_value"": """", ""_style"": ""rounded=1;arcSize=50;html=1;movable=0;resizable=0;rotatable=0;deletable=0;editable=0;selectable=0;strokeColor=#2d2a53;"", ""_vertex"": ""1"", ""_slug"": ""labels"", ""_key"": ""labels"", ""_tooltip"": ""Labels (perception_msgs/LabelArray)\\nAn array of labels streamed from a player with a size equals to the batch size property."", ""_message_tag"": ""perception_msgs/LabelArray"", ""_ifFastRtps"": ""1"", ""_parent"": ""13""}, {""mxGeometry"": {""_x"": ""0.985"", ""_y"": ""0.27"", ""_width"": ""6"", ""_height"": ""6"", ""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""23"", ""_value"": """", ""_style"": ""rounded=1;arcSize=50;html=1;movable=0;resizable=0;rotatable=0;deletable=0;editable=0;selectable=0;strokeColor=#2d2a53;"", ""_vertex"": ""1"", ""_slug"": ""loss"", ""_key"": ""loss"", ""_tooltip"": ""Loss (yonoarc_msgs/Float64)\\nThe loss value of the training each epoch"", ""_message_tag"": ""yonoarc_msgs/Float64"", ""_ifFastRtps"": ""1"", ""_parent"": ""13""}, {""mxGeometry"": {""_x"": ""0.985"", ""_y"": ""0.5700000000000001"", ""_width"": ""6"", ""_height"": ""6"", ""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""24"", ""_value"": """", ""_style"": ""rounded=1;arcSize=50;html=1;movable=0;resizable=0;rotatable=0;deletable=0;editable=0;selectable=0;strokeColor=#2d2a53;"", ""_vertex"": ""1"", ""_slug"": ""accuracy"", ""_key"": ""accuracy"", ""_tooltip"": ""Accuracy (yonoarc_msgs/Float64)\\nThe accuracy percentage of the training each epoch"", ""_message_tag"": ""yonoarc_msgs/Float64"", ""_ifFastRtps"": ""1"", ""_parent"": ""13""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""-40"", ""_width"": ""200"", ""_height"": ""50"", ""_as"": ""geometry""}, ""_id"": ""25"", ""_value"": """", ""_style"": ""html=1;wrap=1;whiteSpace=wrap;strokeColor=none;fontSize=14;labelBackgroundColor=transparent;align=center;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_cell_type"": ""region_name"", ""_parent"": ""13""}, {""mxGeometry"": {""_x"": ""1332"", ""_y"": ""473"", ""_width"": ""222"", ""_height"": ""172"", ""_as"": ""geometry""}, ""Object"": {""Object"": {""_number_of_cpus"": ""0.1"", ""_memory_size"": ""0.4"", ""_gpu_id"": ""0"", ""_as"": ""hw_resources""}, ""_title"": ""Loss"", ""_x_axis_data"": ""header.seq"", ""_x_axis_name"": ""Epochs"", ""_y_axis_data"": ""data"", ""_y_axis_name"": ""Loss"", ""_number_of_instances"": ""1"", ""_region"": ""{\\""dep_reg_id\\"":\\""auto\\"",\\""node_id\\"":null,\\""burstability\\"":true,\\""selectedResource\\"":\\""\\"",\\""resources_ids\\"":[],\\""resourcesObj\\"":[],\\""usage_factor\\"":0.1,\\""count\\"":1,\\""isBurstableConfigurable\\"":false,\\""spinner\\"":null,\\""instanceType\\"":\\""C\\"",\\""instanceCount\\"":1,\\""dep_reg_resources\\"":null}"", ""_execution_mode"": ""async"", ""_as"": ""options""}, ""_id"": ""26"", ""_value"": """", ""_style"": ""top;fillColor=#fff;strokeColor=#18e7bb;rotatable=0;resizable=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_blockID"": ""5c74cd0c5f486a0017fd35e6"", ""_originalBlockID"": ""5b695d916ae5d70020fbfe35"", ""_tooltip"": ""This block visualizes a line chart on the dashboard using configurable fields in the incoming messages."", ""_block"": ""1"", ""_yonoarc_block"": ""1"", ""_parent"": ""1""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""15"", ""_width"": ""200"", ""_height"": ""55"", ""_as"": ""geometry""}, ""_id"": ""27"", ""_value"": ""Line Chart Viewer"", ""_style"": ""top;strokeColor=none;verticalLabelPosition=bottom;labelBackgroundColor=;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;verticalAlign=top;image=https://app.yonohub.com/editor/block-icon/10eefc671cf34a7782b65e3cbbc0ead1.svg;shape=image;"", ""_vertex"": ""1"", ""_tooltip"": ""Line Chart Viewer: This block visualizes a line chart on the dashboard using configurable fields in the incoming messages."", ""_connectable"": ""0"", ""_parent"": ""26""}, {""mxGeometry"": {""_y"": ""137"", ""_width"": ""222"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""28"", ""_value"": """", ""_style"": ""shape=stencil(rVNNE4IgFPw13AkudWysTv2Jp2Iyohio2b8PQZvBr2xqhsvuvn1vGR6IBjqFkiGCC8gZoidESMOU5rK4QsiEgUYDXbKo6lVQHELBnJI6coexww8P0zPCR8N2hwYhRNlNybqIPWGQS6jSGWGQc9l0MVs3oB/3dIhSCy8rdsGLRTv+0v2+7Z/8G+Lfa4i7BrtxhzHREkccSF9A/ILtKfdexi3+UchPEbGf8MdH3GCPhNRsvoQGhp9soGUX1pYGiVRsZZ8TLoSulMwmI23biduy7jda4gU=);whiteSpace=wrap;html=1;strokeColor=#18e7bb;fontSize=10;fillColor=#18e7bb;fontColor=white;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_tooltip"": ""Running"", ""_status"": ""stopped"", ""_type"": ""version"", ""_parent"": ""26""}, {""mxGeometry"": {""_x"": ""30"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""29"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;fontColor=#777;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""28""}, {""mxGeometry"": {""_x"": ""70"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""30"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""28""}, {""mxGeometry"": {""_x"": ""110"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""31"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=0;resizable=1;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""28""}, {""mxGeometry"": {""_x"": ""150"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""32"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""28""}, {""mxGeometry"": {""_x"": ""20"", ""_y"": ""110"", ""_width"": ""180"", ""_height"": ""20"", ""_as"": ""geometry""}, ""_id"": ""33"", ""_value"": ""Yonohub Team"", ""_style"": ""logo;fontSize=12;strokeColor=#70707030;strokeWidth=2;arcSize=15;rounded=1;fillColor=none;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""26""}, {""mxGeometry"": {""_x"": ""-0.015"", ""_y"": ""0.42000000000000004"", ""_width"": ""6"", ""_height"": ""6"", ""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""34"", ""_value"": """", ""_style"": ""rounded=1;arcSize=50;html=1;movable=0;resizable=0;rotatable=0;deletable=0;editable=0;selectable=0;strokeColor=#2d2a53;"", ""_vertex"": ""1"", ""_slug"": ""data"", ""_key"": ""data"", ""_tooltip"": ""Data (Any Message)\\nThe data to be plotted"", ""_message_tag"": ""Any Message"", ""_parent"": ""26""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""-40"", ""_width"": ""200"", ""_height"": ""50"", ""_as"": ""geometry""}, ""_id"": ""35"", ""_value"": """", ""_style"": ""html=1;wrap=1;whiteSpace=wrap;strokeColor=none;fontSize=14;labelBackgroundColor=transparent;align=center;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_cell_type"": ""region_name"", ""_parent"": ""26""}, {""mxGeometry"": {""_x"": ""1332"", ""_y"": ""860"", ""_width"": ""222"", ""_height"": ""172"", ""_as"": ""geometry""}, ""Object"": {""Object"": {""_number_of_cpus"": ""0.1"", ""_memory_size"": ""0.4"", ""_gpu_id"": ""0"", ""_as"": ""hw_resources""}, ""_title"": ""Accuracy"", ""_x_axis_data"": ""header.seq"", ""_x_axis_name"": ""Epochs"", ""_y_axis_data"": ""data"", ""_y_axis_name"": ""Accuracy"", ""_number_of_instances"": ""1"", ""_region"": ""{\\""dep_reg_id\\"":\\""auto\\"",\\""node_id\\"":null,\\""burstability\\"":true,\\""selectedResource\\"":\\""\\"",\\""resources_ids\\"":[],\\""resourcesObj\\"":[],\\""usage_factor\\"":0.1,\\""count\\"":1,\\""isBurstableConfigurable\\"":false,\\""spinner\\"":null,\\""instanceType\\"":\\""C\\"",\\""instanceCount\\"":1,\\""dep_reg_resources\\"":null}"", ""_execution_mode"": ""async"", ""_as"": ""options""}, ""_id"": ""36"", ""_value"": """", ""_style"": ""top;fillColor=#fff;strokeColor=#18e7bb;rotatable=0;resizable=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_blockID"": ""5c74cd0c5f486a0017fd35e6"", ""_originalBlockID"": ""5b695d916ae5d70020fbfe35"", ""_tooltip"": ""This block visualizes a line chart on the dashboard using configurable fields in the incoming messages."", ""_block"": ""1"", ""_yonoarc_block"": ""1"", ""_parent"": ""1""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""15"", ""_width"": ""200"", ""_height"": ""55"", ""_as"": ""geometry""}, ""_id"": ""37"", ""_value"": ""Line Chart Viewer"", ""_style"": ""top;strokeColor=none;verticalLabelPosition=bottom;labelBackgroundColor=;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;verticalAlign=top;image=https://app.yonohub.com/editor/block-icon/10eefc671cf34a7782b65e3cbbc0ead1.svg;shape=image;"", ""_vertex"": ""1"", ""_tooltip"": ""Line Chart Viewer: This block visualizes a line chart on the dashboard using configurable fields in the incoming messages."", ""_connectable"": ""0"", ""_parent"": ""36""}, {""mxGeometry"": {""_y"": ""137"", ""_width"": ""222"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""38"", ""_value"": """", ""_style"": ""shape=stencil(rVNNE4IgFPw13AkudWysTv2Jp2Iyohio2b8PQZvBr2xqhsvuvn1vGR6IBjqFkiGCC8gZoidESMOU5rK4QsiEgUYDXbKo6lVQHELBnJI6coexww8P0zPCR8N2hwYhRNlNybqIPWGQS6jSGWGQc9l0MVs3oB/3dIhSCy8rdsGLRTv+0v2+7Z/8G+Lfa4i7BrtxhzHREkccSF9A/ILtKfdexi3+UchPEbGf8MdH3GCPhNRsvoQGhp9soGUX1pYGiVRsZZ8TLoSulMwmI23biduy7jda4gU=);whiteSpace=wrap;html=1;strokeColor=#18e7bb;fontSize=10;fillColor=#18e7bb;fontColor=white;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_tooltip"": ""Running"", ""_status"": ""stopped"", ""_type"": ""version"", ""_parent"": ""36""}, {""mxGeometry"": {""_x"": ""30"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""39"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;fontColor=#777;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""38""}, {""mxGeometry"": {""_x"": ""70"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""40"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""38""}, {""mxGeometry"": {""_x"": ""110"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""41"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=0;resizable=1;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""38""}, {""mxGeometry"": {""_x"": ""150"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""42"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""38""}, {""mxGeometry"": {""_x"": ""20"", ""_y"": ""110"", ""_width"": ""180"", ""_height"": ""20"", ""_as"": ""geometry""}, ""_id"": ""43"", ""_value"": ""Yonohub Team"", ""_style"": ""logo;fontSize=12;strokeColor=#70707030;strokeWidth=2;arcSize=15;rounded=1;fillColor=none;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""36""}, {""mxGeometry"": {""_x"": ""-0.015"", ""_y"": ""0.42000000000000004"", ""_width"": ""6"", ""_height"": ""6"", ""_relative"": ""1"", ""_as"": ""geometry""}, ""_id"": ""44"", ""_value"": """", ""_style"": ""rounded=1;arcSize=50;html=1;movable=0;resizable=0;rotatable=0;deletable=0;editable=0;selectable=0;strokeColor=#2d2a53;"", ""_vertex"": ""1"", ""_slug"": ""data"", ""_key"": ""data"", ""_tooltip"": ""Data (Any Message)\\nThe data to be plotted"", ""_message_tag"": ""Any Message"", ""_parent"": ""36""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""-40"", ""_width"": ""200"", ""_height"": ""50"", ""_as"": ""geometry""}, ""_id"": ""45"", ""_value"": """", ""_style"": ""html=1;wrap=1;whiteSpace=wrap;strokeColor=none;fontSize=14;labelBackgroundColor=transparent;align=center;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_cell_type"": ""region_name"", ""_parent"": ""36""}, {""mxGeometry"": {""_x"": ""888"", ""_y"": ""860"", ""_width"": ""222"", ""_height"": ""172"", ""_as"": ""geometry""}, ""Object"": {""Object"": {""_number_of_cpus"": ""0.1"", ""_memory_size"": ""0.4"", ""_gpu_id"": ""0"", ""_as"": ""hw_resources""}, ""_model_path"": """", ""_number_of_instances"": ""1"", ""_region"": ""{\\""dep_reg_id\\"":\\""auto\\"",\\""node_id\\"":null,\\""burstability\\"":true,\\""selectedResource\\"":\\""\\"",\\""resources_ids\\"":[],\\""resourcesObj\\"":[],\\""usage_factor\\"":0.1,\\""count\\"":1,\\""isBurstableConfigurable\\"":false,\\""spinner\\"":null,\\""instanceType\\"":\\""C\\"",\\""instanceCount\\"":1,\\""dep_reg_resources\\"":null}"", ""_execution_mode"": ""async"", ""_as"": ""options""}, ""_id"": ""50"", ""_value"": """", ""_style"": ""top;fillColor=#fff;strokeColor=#929292;rotatable=0;resizable=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_blockID"": ""5ed4ffd91e21757fe74ef73e"", ""_originalBlockID"": ""5ed4ffd91e21757fe74ef73e"", ""_tooltip"": ""The block is used to open Netron to visualize an artificial neural network."", ""_block"": ""1"", ""_yonoarc_block"": ""1"", ""_parent"": ""1""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""15"", ""_width"": ""200"", ""_height"": ""55"", ""_as"": ""geometry""}, ""_id"": ""51"", ""_value"": ""Netron"", ""_style"": ""top;strokeColor=none;verticalLabelPosition=bottom;labelBackgroundColor=;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;verticalAlign=top;image=https://app.yonohub.com/editor/block-icon/608f8757b92944fabfc7b7f2d7253b27.svg;shape=image;"", ""_vertex"": ""1"", ""_tooltip"": ""Netron: The block is used to open Netron to visualize an artificial neural network."", ""_connectable"": ""0"", ""_parent"": ""50""}, {""mxGeometry"": {""_y"": ""137"", ""_width"": ""222"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""52"", ""_value"": """", ""_style"": ""shape=stencil(rVNNE4IgFPw13AkudWysTv2Jp2Iyohio2b8PQZvBr2xqhsvuvn1vGR6IBjqFkiGCC8gZoidESMOU5rK4QsiEgUYDXbKo6lVQHELBnJI6coexww8P0zPCR8N2hwYhRNlNybqIPWGQS6jSGWGQc9l0MVs3oB/3dIhSCy8rdsGLRTv+0v2+7Z/8G+Lfa4i7BrtxhzHREkccSF9A/ILtKfdexi3+UchPEbGf8MdH3GCPhNRsvoQGhp9soGUX1pYGiVRsZZ8TLoSulMwmI23biduy7jda4gU=);whiteSpace=wrap;html=1;strokeColor=#929292;fontSize=10;fillColor=#929292;fontColor=white;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_tooltip"": """", ""_status"": ""stopped"", ""_type"": ""version"", ""_parent"": ""50""}, {""mxGeometry"": {""_x"": ""30"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""53"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;fontColor=#777;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""52""}, {""mxGeometry"": {""_x"": ""70"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""54"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""52""}, {""mxGeometry"": {""_x"": ""110"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""55"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=0;resizable=1;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""52""}, {""mxGeometry"": {""_x"": ""150"", ""_width"": ""40"", ""_height"": ""34"", ""_as"": ""geometry""}, ""_id"": ""56"", ""_value"": """", ""_style"": ""html=1;strokeColor=none;fontSize=16;fillColor=transparent;fontColor=#777;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""52""}, {""mxGeometry"": {""_x"": ""20"", ""_y"": ""110"", ""_width"": ""180"", ""_height"": ""20"", ""_as"": ""geometry""}, ""_id"": ""57"", ""_value"": ""Yonohub Team"", ""_style"": ""logo;fontSize=12;strokeColor=#70707030;strokeWidth=2;arcSize=15;rounded=1;fillColor=none;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_parent"": ""50""}, {""mxGeometry"": {""_x"": ""10"", ""_y"": ""-40"", ""_width"": ""200"", ""_height"": ""50"", ""_as"": ""geometry""}, ""_id"": ""58"", ""_value"": """", ""_style"": ""html=1;wrap=1;whiteSpace=wrap;strokeColor=none;fontSize=14;labelBackgroundColor=transparent;align=center;fillColor=transparent;movable=1;resizable=0;rotatable=0;deletable=0;editable=0;connectable=0;selectable=1;locked=0;"", ""_vertex"": ""1"", ""_connectable"": ""0"", ""_cell_type"": ""region_name"", ""_parent"": ""50""}]}, ""_dx"": ""1776"", ""_dy"": ""883"", ""_grid"": ""1"", ""_gridSize"": ""1"", ""_guides"": ""1"", ""_tooltips"": ""1"", ""_connect"": ""0"", ""_arrows"": ""1"", ""_fold"": ""1"", ""_page"": ""1"", ""_pageScale"": ""1"", ""_pageWidth"": ""1776"", ""_pageHeight"": ""1032"", ""_total_number_cpus"": ""1"", ""_current_number_cpus"": ""0"", ""_total_number_gpus"": ""1"", ""_current_number_gpus"": ""0"", ""_total_memory_size"": ""1"", ""_current_memory_size"": ""0"", ""_version"": ""5"", ""_background"": ""#FCFAFA"", ""_defaultParent"": ""1"", ""_scale"": 0.75, ""_xPos"": 1372, ""_yPos"": 882}, ""customBlocks"": {}, ""pipelineParameters"": {""batch_size"": {""type"": ""number"", ""name"": ""Batch Size"", ""deletable"": true, ""live_mode"": false, ""description"": """", ""nodes"": [""b2"", ""b13""], ""order"": 0, ""min"": ""1"", ""max"": """", ""value"": ""32""}}}",12131,True,3403.140975935896,median "[MusicConfig] Location=176183 Jay Chou - Niu Zai Hen Mang/NZHM.mp3 Extension=mp3 MD5=e5‌​19‌​eb‌​dd‌​60‌​35‌​ca‌​59‌​2f‌​3d‌​5e‌​2d‌​28‌​0b‌​26‌​8e Source=OSU MetreNumber=4 Title=Niu Zai Hen Mang [TagConfig] Tagger=Carra Time=2016/9/10 23:20:22 Confidence=2 [MiscConfig] LinkedFile=176183 Jay Chou - Niu Zai Hen Mang/Jay Chou - Niu Zai Hen Mang (yf_bmp) [baka's Insane].osu osuMapID=176183 [BeatInfo] Count=407 Beat_0={0.268,1,C Maj,C} Beat_1={0.50993548387096754,0,C Maj,C} Beat_2={0.75187096774193507,0,C Maj,C} Beat_3={0.9938064516129026,0,C Maj,C} Beat_4={1.2357419354838701,1,C Maj,C} Beat_5={1.4776774193548377,0,C Maj,C} Beat_6={1.7196129032258052,0,C Maj,C} Beat_7={1.9615483870967725,0,C Maj,C} Beat_8={2.20348387096774,1,C Maj,F} Beat_9={2.4454193548387075,0,C Maj,F} Beat_10={2.6873548387096751,0,C Maj,F} Beat_11={2.9292903225806426,0,C Maj,F} Beat_12={3.17122580645161,1,C Maj,F} Beat_13={3.4131612903225776,0,C Maj,F} Beat_14={3.6550967741935452,0,C Maj,F} Beat_15={3.8970322580645127,0,C Maj,F} Beat_16={4.13896774193548,1,C Maj,G} Beat_17={4.3809032258064473,0,C Maj,G} Beat_18={4.6228387096774153,0,C Maj,G} Beat_19={4.8647741935483833,0,C Maj,G} Beat_20={5.10670967741935,1,C Maj,G} Beat_21={5.3486451612903174,0,C Maj,G} Beat_22={5.5905806451612854,0,C Maj,G} Beat_23={5.8325161290322534,0,C Maj,G} Beat_24={6.07445161290322,1,C Maj,C} Beat_25={6.3163870967741875,0,C Maj,C} Beat_26={6.5583225806451555,0,C Maj,C} Beat_27={6.8002580645161235,0,C Maj,C} Beat_28={7.0421935483870906,1,C Maj,C} Beat_29={7.2841290322580576,0,C Maj,C} Beat_30={7.5260645161290256,0,C Maj,C} Beat_31={7.7679999999999927,0,C Maj,C} Beat_32={8.00993548387096,1,C Maj,C} Beat_33={8.251870967741926,0,C Maj,C} Beat_34={8.4938064516128939,0,C Maj,C} Beat_35={8.7357419354838619,0,C Maj,C} Beat_36={8.9776774193548281,1,C Maj,C} Beat_37={9.2196129032257943,0,C Maj,C} Beat_38={9.4615483870967623,0,C Maj,C} Beat_39={9.70348387096773,0,C Maj,C} Beat_40={9.9454193548386964,1,C Maj,F} Beat_41={10.187354838709663,0,C Maj,F} Beat_42={10.429290322580631,0,C Maj,F} Beat_43={10.671225806451599,0,C Maj,F} Beat_44={10.913161290322565,1,C Maj,Fm} Beat_45={11.155096774193531,0,C Maj,Fm} Beat_46={11.397032258064499,0,C Maj,Fm} Beat_47={11.638967741935467,0,C Maj,Fm} Beat_48={11.880903225806433,1,C Maj,G} Beat_49={12.1228387096774,0,C Maj,G} Beat_50={12.364774193548367,0,C Maj,G} Beat_51={12.606709677419335,0,C Maj,G} Beat_52={12.848645161290301,1,C Maj,G} Beat_53={13.090580645161268,0,C Maj,G} Beat_54={13.332516129032236,0,C Maj,G} Beat_55={13.574451612903204,0,C Maj,G} Beat_56={13.81638709677417,1,C Maj,C} Beat_57={14.058322580645136,0,C Maj,C} Beat_58={14.300258064516104,0,C Maj,C} Beat_59={14.542193548387072,0,C Maj,C} Beat_60={14.784129032258038,1,C Maj,C} Beat_61={15.026064516129004,0,C Maj,C} Beat_62={15.267999999999972,0,C Maj,C} Beat_63={15.50993548387094,0,C Maj,C} Beat_64={15.751870967741906,1,C Maj,C} Beat_65={15.993806451612873,0,C Maj,C} Beat_66={16.235741935483841,0,C Maj,C} Beat_67={16.477677419354809,0,C Maj,C} Beat_68={16.719612903225777,1,C Maj,C} Beat_69={16.961548387096745,0,C Maj,C} Beat_70={17.203483870967712,0,C Maj,C} Beat_71={17.44541935483868,0,C Maj,C} Beat_72={17.687354838709648,1,C Maj,F} Beat_73={17.929290322580616,0,C Maj,F} Beat_74={18.171225806451584,0,C Maj,F} Beat_75={18.413161290322552,0,C Maj,F} Beat_76={18.65509677419352,1,C Maj,C} Beat_77={18.897032258064488,0,C Maj,C} Beat_78={19.138967741935456,0,C Maj,C} Beat_79={19.380903225806424,0,C Maj,C} Beat_80={19.622838709677392,1,C Maj,C} Beat_81={19.86477419354836,0,C Maj,C} Beat_82={20.106709677419328,0,C Maj,C} Beat_83={20.348645161290296,0,C Maj,C} Beat_84={20.590580645161264,1,C Maj,C} Beat_85={20.832516129032232,0,C Maj,C} Beat_86={21.0744516129032,0,C Maj,C} Beat_87={21.316387096774168,0,C Maj,C} Beat_88={21.558322580645136,1,C Maj,G} Beat_89={21.800258064516104,0,C Maj,G} Beat_90={22.042193548387072,0,C Maj,G} Beat_91={22.28412903225804,0,C Maj,G} Beat_92={22.526064516129008,1,C Maj,G} Beat_93={22.767999999999976,0,C Maj,G} Beat_94={23.009935483870944,0,C Maj,G} Beat_95={23.251870967741912,0,C Maj,G} Beat_96={23.49380645161288,1,C Maj,C} Beat_97={23.735741935483848,0,C Maj,C} Beat_98={23.977677419354816,0,C Maj,C} Beat_99={24.219612903225784,0,C Maj,C} Beat_100={24.461548387096752,1,C Maj,C} Beat_101={24.70348387096772,0,C Maj,C} Beat_102={24.945419354838688,0,C Maj,C} Beat_103={25.187354838709656,0,C Maj,C} Beat_104={25.429290322580623,1,C Maj,F} Beat_105={25.671225806451591,0,C Maj,F} Beat_106={25.913161290322559,0,C Maj,F} Beat_107={26.155096774193527,0,C Maj,F} Beat_108={26.397032258064495,1,C Maj,X} Beat_109={26.638967741935463,0,C Maj,X} Beat_110={26.880903225806431,0,C Maj,X} Beat_111={27.1228387096774,0,C Maj,X} Beat_112={27.364774193548367,1,C Maj,G} Beat_113={27.606709677419335,0,C Maj,G} Beat_114={27.848645161290303,0,C Maj,G} Beat_115={28.090580645161271,0,C Maj,G} Beat_116={28.332516129032239,1,C Maj,G} Beat_117={28.574451612903207,0,C Maj,G} Beat_118={28.816387096774175,0,C Maj,G} Beat_119={29.058322580645143,0,C Maj,G} Beat_120={29.300258064516111,1,C Maj,C} Beat_121={29.542193548387079,0,C Maj,C} Beat_122={29.784129032258047,0,C Maj,C} Beat_123={30.026064516129015,0,C Maj,C} Beat_124={30.267999999999983,1,C Maj,C} Beat_125={30.509935483870951,0,C Maj,C} Beat_126={30.751870967741919,0,C Maj,C} Beat_127={30.993806451612887,0,C Maj,C} Beat_128={31.235741935483855,1,C Maj,C} Beat_129={31.477677419354823,0,C Maj,C} Beat_130={31.719612903225791,0,C Maj,C} Beat_131={31.961548387096755,0,C Maj,C} Beat_132={32.203483870967723,1,C Maj,C} Beat_133={32.445419354838691,0,C Maj,C} Beat_134={32.687354838709659,0,C Maj,C} Beat_135={32.929290322580627,0,C Maj,C} Beat_136={33.171225806451595,1,C Maj,C} Beat_137={33.413161290322563,0,C Maj,C} Beat_138={33.655096774193531,0,C Maj,C} Beat_139={33.8970322580645,0,C Maj,C} Beat_140={34.138967741935467,1,C Maj,C} Beat_141={34.380903225806435,0,C Maj,C} Beat_142={34.6228387096774,0,C Maj,C} Beat_143={34.864774193548371,0,C Maj,C} Beat_144={35.106709677419339,1,C Maj,C} Beat_145={35.348645161290307,0,C Maj,C} Beat_146={35.590580645161275,0,C Maj,C} Beat_147={35.832516129032243,0,C Maj,C} Beat_148={36.074451612903211,1,C Maj,C} Beat_149={36.316387096774179,0,C Maj,C} Beat_150={36.558322580645147,0,C Maj,C} Beat_151={36.800258064516115,0,C Maj,C} Beat_152={37.042193548387083,1,C Maj,G} Beat_153={37.284129032258051,0,C Maj,G} Beat_154={37.526064516129018,0,C Maj,G} Beat_155={37.767999999999986,0,C Maj,G} Beat_156={38.009935483870954,1,C Maj,G} Beat_157={38.251870967741922,0,C Maj,G} Beat_158={38.49380645161289,0,C Maj,G} Beat_159={38.735741935483858,0,C Maj,G} Beat_160={38.977677419354826,1,C Maj,C} Beat_161={39.219612903225794,0,C Maj,C} Beat_162={39.461548387096762,0,C Maj,C} Beat_163={39.70348387096773,0,C Maj,C} Beat_164={39.9454193548387,1,C Maj,C} Beat_165={40.187354838709666,0,C Maj,C} Beat_166={40.429290322580634,0,C Maj,C} Beat_167={40.6712258064516,0,C Maj,C} Beat_168={40.91316129032257,1,C Maj,Am} Beat_169={41.155096774193538,0,C Maj,Am} Beat_170={41.397032258064506,0,C Maj,Am} Beat_171={41.638967741935474,0,C Maj,Am} Beat_172={41.880903225806442,1,C Maj,Fm} Beat_173={42.12283870967741,0,C Maj,Fm} Beat_174={42.364774193548378,0,C Maj,Fm} Beat_175={42.606709677419346,0,C Maj,Fm} Beat_176={42.848645161290314,1,C Maj,C} Beat_177={43.090580645161282,0,C Maj,C} Beat_178={43.33251612903225,0,C Maj,C} Beat_179={43.574451612903218,0,C Maj,C} Beat_180={43.816387096774186,1,C Maj,C} Beat_181={44.058322580645154,0,C Maj,C} Beat_182={44.300258064516122,0,C Maj,C} Beat_183={44.54219354838709,0,C Maj,C} Beat_184={44.784129032258058,1,C Maj,C} Beat_185={45.026064516129026,0,C Maj,C} Beat_186={45.267999999999994,0,C Maj,C} Beat_187={45.509935483870962,0,C Maj,C} Beat_188={45.75187096774193,1,C Maj,C} Beat_189={45.9938064516129,0,C Maj,C} Beat_190={46.235741935483865,0,C Maj,C} Beat_191={46.477677419354833,0,C Maj,C} Beat_192={46.7196129032258,1,C Maj,C} Beat_193={46.961548387096769,0,C Maj,C} Beat_194={47.203483870967737,0,C Maj,C} Beat_195={47.445419354838705,0,C Maj,C} Beat_196={47.687354838709673,1,C Maj,C} Beat_197={47.929290322580641,0,C Maj,C} Beat_198={48.171225806451609,0,C Maj,C} Beat_199={48.413161290322577,0,C Maj,C} Beat_200={48.655096774193545,1,C Maj,C} Beat_201={48.897032258064513,0,C Maj,C} Beat_202={49.138967741935481,0,C Maj,C} Beat_203={49.380903225806449,0,C Maj,C} Beat_204={49.622838709677417,1,C Maj,C} Beat_205={49.864774193548385,0,C Maj,C} Beat_206={50.106709677419353,0,C Maj,C} Beat_207={50.348645161290321,0,C Maj,C} Beat_208={50.590580645161289,1,C Maj,C} Beat_209={50.832516129032257,0,C Maj,C} Beat_210={51.074451612903225,0,C Maj,C} Beat_211={51.316387096774193,0,C Maj,C} Beat_212={51.558322580645161,1,C Maj,C} Beat_213={51.800258064516129,0,C Maj,C} Beat_214={52.0421935483871,0,C Maj,C} Beat_215={52.284129032258065,0,C Maj,C} Beat_216={52.526064516129033,1,C Maj,G} Beat_217={52.768,0,C Maj,G} Beat_218={53.009935483870969,0,C Maj,G} Beat_219={53.251870967741937,0,C Maj,G} Beat_220={53.493806451612905,1,C Maj,G} Beat_221={53.735741935483873,0,C Maj,G} Beat_222={53.977677419354841,0,C Maj,G} Beat_223={54.219612903225809,0,C Maj,G} Beat_224={54.461548387096776,1,C Maj,C} Beat_225={54.703483870967744,0,C Maj,C} Beat_226={54.945419354838712,0,C Maj,C} Beat_227={55.18735483870968,0,C Maj,C} Beat_228={55.429290322580648,1,C Maj,C} Beat_229={55.671225806451616,0,C Maj,C} Beat_230={55.913161290322584,0,C Maj,C} Beat_231={56.155096774193552,0,C Maj,C} Beat_232={56.39703225806452,1,C Maj,F} Beat_233={56.638967741935488,0,C Maj,F} Beat_234={56.880903225806456,0,C Maj,F} Beat_235={57.122838709677424,0,C Maj,F} Beat_236={57.364774193548392,1,C Maj,F} Beat_237={57.60670967741936,0,C Maj,F} Beat_238={57.848645161290328,0,C Maj,F} Beat_239={58.090580645161296,0,C Maj,F} Beat_240={58.332516129032264,1,C Maj,C} Beat_241={58.574451612903232,0,C Maj,C} Beat_242={58.8163870967742,0,C Maj,C} Beat_243={59.058322580645168,0,C Maj,C} Beat_244={59.300258064516136,1,C Maj,G} Beat_245={59.542193548387104,0,C Maj,G} Beat_246={59.784129032258072,0,C Maj,G} Beat_247={60.02606451612904,0,C Maj,G} Beat_248={60.268000000000008,1,C Maj,C} Beat_249={60.509935483870976,0,C Maj,C} Beat_250={60.751870967741944,0,C Maj,C} Beat_251={60.993806451612912,0,C Maj,C} Beat_252={61.23574193548388,1,C Maj,F} Beat_253={61.477677419354848,0,C Maj,G} Beat_254={61.719612903225816,0,C Maj,C} Beat_255={61.961548387096784,0,C Maj,C} Beat_256={62.203483870967752,1,C Maj,C} Beat_257={62.44541935483872,0,C Maj,C} Beat_258={62.687354838709688,0,C Maj,C} Beat_259={62.929290322580655,0,C Maj,C} Beat_260={63.171225806451623,1,C Maj,C} Beat_261={63.413161290322591,0,C Maj,C} Beat_262={63.655096774193559,0,C Maj,C} Beat_263={63.897032258064527,0,C Maj,C} Beat_264={64.138967741935488,1,C Maj,F} Beat_265={64.380903225806463,0,C Maj,F} Beat_266={64.622838709677424,0,C Maj,F} Beat_267={64.864774193548385,0,C Maj,F} Beat_268={65.10670967741936,1,C Maj,C} Beat_269={65.348645161290335,0,C Maj,C} Beat_270={65.5905806451613,0,C Maj,C} Beat_271={65.832516129032257,0,C Maj,C} Beat_272={66.074451612903232,1,C Maj,C} Beat_273={66.3163870967742,0,C Maj,C} Beat_274={66.558322580645168,0,C Maj,C} Beat_275={66.800258064516129,0,C Maj,C} Beat_276={67.0421935483871,1,C Maj,C} Beat_277={67.284129032258079,0,C Maj,C} Beat_278={67.52606451612904,0,C Maj,C} Beat_279={67.768,0,C Maj,C} Beat_280={68.009935483870976,1,C Maj,G} Beat_281={68.251870967741951,0,C Maj,G} Beat_282={68.493806451612912,0,C Maj,G} Beat_283={68.735741935483873,0,C Maj,G} Beat_284={68.977677419354848,1,C Maj,G} Beat_285={69.219612903225823,0,C Maj,G} Beat_286={69.461548387096784,0,C Maj,G} Beat_287={69.703483870967744,0,C Maj,G} Beat_288={69.94541935483872,1,C Maj,C} Beat_289={70.1873548387097,0,C Maj,C} Beat_290={70.429290322580655,0,C Maj,C} Beat_291={70.671225806451616,0,C Maj,C} Beat_292={70.913161290322591,1,C Maj,C} Beat_293={71.155096774193566,0,C Maj,C} Beat_294={71.397032258064527,0,C Maj,C} Beat_295={71.638967741935488,0,C Maj,C} Beat_296={71.880903225806463,1,C Maj,F} Beat_297={72.122838709677438,0,C Maj,F} Beat_298={72.3647741935484,0,C Maj,F} Beat_299={72.60670967741936,0,C Maj,F} Beat_300={72.848645161290335,1,C Maj,X} Beat_301={73.09058064516131,0,C Maj,X} Beat_302={73.332516129032271,0,C Maj,X} Beat_303={73.574451612903232,0,C Maj,X} Beat_304={73.8163870967742,1,C Maj,C} Beat_305={74.058322580645182,0,C Maj,C} Beat_306={74.300258064516143,0,C Maj,C} Beat_307={74.5421935483871,0,C Maj,C} Beat_308={74.784129032258079,1,C Maj,C} Beat_309={75.026064516129054,0,C Maj,C} Beat_310={75.268000000000015,0,C Maj,C} Beat_311={75.509935483870976,0,C Maj,C} Beat_312={75.751870967741951,1,C Maj,C} Beat_313={75.993806451612926,0,C Maj,C} Beat_314={76.235741935483887,0,C Maj,C} Beat_315={76.477677419354848,0,C Maj,C} Beat_316={76.719612903225823,1,C Maj,C} Beat_317={76.9615483870968,0,C Maj,C} Beat_318={77.203483870967759,0,C Maj,C} Beat_319={77.44541935483872,0,C Maj,C} Beat_320={77.6873548387097,1,C Maj,C} Beat_321={77.92929032258067,0,C Maj,C} Beat_322={78.171225806451631,0,C Maj,C} Beat_323={78.413161290322591,0,C Maj,C} Beat_324={78.655096774193566,1,C Maj,C} Beat_325={78.897032258064542,0,C Maj,C} Beat_326={79.1389677419355,0,C Maj,C} Beat_327={79.380903225806463,0,C Maj,C} Beat_328={79.622838709677438,1,C Maj,C} Beat_329={79.864774193548413,0,C Maj,C} Beat_330={80.106709677419374,0,C Maj,C} Beat_331={80.348645161290335,0,C Maj,C} Beat_332={80.59058064516131,1,C Maj,C} Beat_333={80.832516129032285,0,C Maj,C} Beat_334={81.074451612903246,0,C Maj,C} Beat_335={81.3163870967742,0,C Maj,C} Beat_336={81.558322580645182,1,C Maj,C} Beat_337={81.800258064516157,0,C Maj,C} Beat_338={82.042193548387118,0,C Maj,C} Beat_339={82.284129032258079,0,C Maj,C} Beat_340={82.526064516129054,1,C Maj,C} Beat_341={82.768000000000029,0,C Maj,C} Beat_342={83.00993548387099,0,C Maj,C} Beat_343={83.251870967741951,0,C Maj,C} Beat_344={83.493806451612926,1,C Maj,G} Beat_345={83.7357419354839,0,C Maj,G} Beat_346={83.977677419354862,0,C Maj,G} Beat_347={84.219612903225823,0,C Maj,G} Beat_348={84.4615483870968,1,C Maj,G} Beat_349={84.703483870967773,0,C Maj,G} Beat_350={84.945419354838734,0,C Maj,G} Beat_351={85.1873548387097,0,C Maj,G} Beat_352={85.42929032258067,1,C Maj,C} Beat_353={85.671225806451645,0,C Maj,C} Beat_354={85.9131612903226,0,C Maj,C} Beat_355={86.155096774193566,0,C Maj,C} Beat_356={86.397032258064542,1,C Maj,C} Beat_357={86.638967741935517,0,C Maj,C} Beat_358={86.880903225806478,0,C Maj,C} Beat_359={87.122838709677438,0,C Maj,C} Beat_360={87.364774193548413,1,C Maj,F} Beat_361={87.606709677419389,0,C Maj,F} Beat_362={87.848645161290349,0,C Maj,F} Beat_363={88.09058064516131,0,C Maj,F} Beat_364={88.332516129032285,1,C Maj,F} Beat_365={88.57445161290326,0,C Maj,F} Beat_366={88.816387096774221,0,C Maj,F} Beat_367={89.058322580645182,0,C Maj,F} Beat_368={89.300258064516157,1,C Maj,C} Beat_369={89.542193548387132,0,C Maj,C} Beat_370={89.7841290322581,0,C Maj,C} Beat_371={90.026064516129054,0,C Maj,C} Beat_372={90.268000000000029,1,C Maj,G} Beat_373={90.509935483871,0,C Maj,G} Beat_374={90.751870967741965,0,C Maj,G} Beat_375={90.993806451612926,0,C Maj,G} Beat_376={91.2357419354839,1,C Maj,C} Beat_377={91.477677419354876,0,C Maj,C} Beat_378={91.719612903225837,0,C Maj,C} Beat_379={91.9615483870968,0,C Maj,C} Beat_380={92.203483870967773,1,C Maj,C} Beat_381={92.445419354838748,0,C Maj,C} Beat_382={92.687354838709709,0,C Maj,C} Beat_383={92.92929032258067,0,C Maj,C} Beat_384={93.171225806451645,1,C Maj,C} Beat_385={93.41316129032262,0,C Maj,C} Beat_386={93.655096774193581,0,C Maj,C} Beat_387={93.897032258064542,0,C Maj,C} Beat_388={94.138967741935517,1,C Maj,N} Beat_389={94.380903225806492,0,C Maj,N} Beat_390={94.622838709677453,0,C Maj,N} Beat_391={94.864774193548413,0,C Maj,N} Beat_392={95.106709677419389,1,C Maj,N} Beat_393={95.348645161290364,0,C Maj,N} Beat_394={95.590580645161324,0,C Maj,N} Beat_395={95.832516129032285,0,C Maj,N} Beat_396={96.07445161290326,1,C Maj,N} Beat_397={96.316387096774235,0,C Maj,N} Beat_398={96.5583225806452,0,C Maj,N} Beat_399={96.800258064516157,0,C Maj,N} Beat_400={97.042193548387132,1,C Maj,N} Beat_401={97.284129032258107,0,C Maj,N} Beat_402={97.526064516129068,0,C Maj,N} Beat_403={97.768000000000029,0,C Maj,N} Beat_404={98.009935483871,1,C Maj,N} Beat_405={98.251870967741979,0,C Maj,N} Beat_406={98.49380645161294,0,G Maj,N} ",12181,True,4462.671683706594,median ";-------------------------------------------------------- ; File Created by SDCC : free open source ANSI-C Compiler ; Version 3.6.0 #9615 (MINGW64) ;-------------------------------------------------------- .module hw1 .optsdcc -mmcs51 --model-small ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- .globl _main .globl _putchar .globl _getchar .globl _printf .globl _getchar_nw .globl _Sys_Init .globl _UART0_Init .globl _SYSCLK_Init .globl _SPIF .globl _WCOL .globl _MODF .globl _RXOVRN .globl _TXBSY .globl _SLVSEL .globl _MSTEN .globl _SPIEN .globl _AD0EN .globl _ADCEN .globl _AD0TM .globl _ADCTM .globl _AD0INT .globl _ADCINT .globl _AD0BUSY .globl _ADBUSY .globl _AD0CM1 .globl _ADSTM1 .globl _AD0CM0 .globl _ADSTM0 .globl _AD0WINT .globl _ADWINT .globl _AD0LJST .globl _ADLJST .globl _CF .globl _CR .globl _CCF4 .globl _CCF3 .globl _CCF2 .globl _CCF1 .globl _CCF0 .globl _CY .globl _AC .globl _F0 .globl _RS1 .globl _RS0 .globl _OV .globl _F1 .globl _P .globl _TF2 .globl _EXF2 .globl _RCLK .globl _TCLK .globl _EXEN2 .globl _TR2 .globl _CT2 .globl _CPRL2 .globl _BUSY .globl _ENSMB .globl _STA .globl _STO .globl _SI .globl _AA .globl _SMBFTE .globl _SMBTOE .globl _PT2 .globl _PS .globl _PS0 .globl _PT1 .globl _PX1 .globl _PT0 .globl _PX0 .globl _P3_7 .globl _P3_6 .globl _P3_5 .globl _P3_4 .globl _P3_3 .globl _P3_2 .globl _P3_1 .globl _P3_0 .globl _EA .globl _ET2 .globl _ES .globl _ES0 .globl _ET1 .globl _EX1 .globl _ET0 .globl _EX0 .globl _P2_7 .globl _P2_6 .globl _P2_5 .globl _P2_4 .globl _P2_3 .globl _P2_2 .globl _P2_1 .globl _P2_0 .globl _S0MODE .globl _SM00 .globl _SM0 .globl _SM10 .globl _SM1 .globl _MCE0 .globl _SM20 .globl _SM2 .globl _REN0 .globl _REN .globl _TB80 .globl _TB8 .globl _RB80 .globl _RB8 .globl _TI0 .globl _TI .globl _RI0 .globl _RI .globl _P1_7 .globl _P1_6 .globl _P1_5 .globl _P1_4 .globl _P1_3 .globl _P1_2 .globl _P1_1 .globl _P1_0 .globl _TF1 .globl _TR1 .globl _TF0 .globl _TR0 .globl _IE1 .globl _IT1 .globl _IE0 .globl _IT0 .globl _P0_7 .globl _P0_6 .globl _P0_5 .globl _P0_4 .globl _P0_3 .globl _P0_2 .globl _P0_1 .globl _P0_0 .globl _PCA0CP4 .globl _PCA0CP3 .globl _PCA0CP2 .globl _PCA0CP1 .globl _PCA0CP0 .globl _PCA0 .globl _DAC1 .globl _DAC0 .globl _ADC0LT .globl _ADC0GT .globl _ADC0 .globl _RCAP4 .globl _TMR4 .globl _TMR3RL .globl _TMR3 .globl _RCAP2 .globl _TMR2 .globl _TMR1 .globl _TMR0 .globl _WDTCN .globl _PCA0CPH4 .globl _PCA0CPH3 .globl _PCA0CPH2 .globl _PCA0CPH1 .globl _PCA0CPH0 .globl _PCA0H .globl _SPI0CN .globl _EIP2 .globl _EIP1 .globl _TH4 .globl _TL4 .globl _SADDR1 .globl _SBUF1 .globl _SCON1 .globl _B .globl _RSTSRC .globl _PCA0CPL4 .globl _PCA0CPL3 .globl _PCA0CPL2 .globl _PCA0CPL1 .globl _PCA0CPL0 .globl _PCA0L .globl _ADC0CN .globl _EIE2 .globl _EIE1 .globl _RCAP4H .globl _RCAP4L .globl _XBR2 .globl _XBR1 .globl _XBR0 .globl _ACC .globl _PCA0CPM4 .globl _PCA0CPM3 .globl _PCA0CPM2 .globl _PCA0CPM1 .globl _PCA0CPM0 .globl _PCA0MD .globl _PCA0CN .globl _DAC1CN .globl _DAC1H .globl _DAC1L .globl _DAC0CN .globl _DAC0H .globl _DAC0L .globl _REF0CN .globl _PSW .globl _SMB0CR .globl _TH2 .globl _TL2 .globl _RCAP2H .globl _RCAP2L .globl _T4CON .globl _T2CON .globl _ADC0LTH .globl _ADC0LTL .globl _ADC0GTH .globl _ADC0GTL .globl _SMB0ADR .globl _SMB0DAT .globl _SMB0STA .globl _SMB0CN .globl _ADC0H .globl _ADC0L .globl _P1MDIN .globl _ADC0CF .globl _AMX0SL .globl _AMX0CF .globl _SADEN0 .globl _IP .globl _FLACL .globl _FLSCL .globl _P74OUT .globl _OSCICN .globl _OSCXCN .globl _P3 .globl __XPAGE .globl _EMI0CN .globl _SADEN1 .globl _P3IF .globl _AMX1SL .globl _ADC1CF .globl _ADC1CN .globl _SADDR0 .globl _IE .globl _P3MDOUT .globl _PRT3CF .globl _P2MDOUT .globl _PRT2CF .globl _P1MDOUT .globl _PRT1CF .globl _P0MDOUT .globl _PRT0CF .globl _EMI0CF .globl _EMI0TC .globl _P2 .globl _CPT1CN .globl _CPT0CN .globl _SPI0CKR .globl _ADC1 .globl _SPI0DAT .globl _SPI0CFG .globl _SBUF0 .globl _SBUF .globl _SCON0 .globl _SCON .globl _P7 .globl _TMR3H .globl _TMR3L .globl _TMR3RLH .globl _TMR3RLL .globl _TMR3CN .globl _P1 .globl _PSCTL .globl _CKCON .globl _TH1 .globl _TH0 .globl _TL1 .globl _TL0 .globl _TMOD .globl _TCON .globl _PCON .globl _P6 .globl _P5 .globl _P4 .globl _DPH .globl _DPL .globl _SP .globl _P0 ;-------------------------------------------------------- ; special function registers ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 G$P0$0$0 == 0x0080 _P0 = 0x0080 G$SP$0$0 == 0x0081 _SP = 0x0081 G$DPL$0$0 == 0x0082 _DPL = 0x0082 G$DPH$0$0 == 0x0083 _DPH = 0x0083 G$P4$0$0 == 0x0084 _P4 = 0x0084 G$P5$0$0 == 0x0085 _P5 = 0x0085 G$P6$0$0 == 0x0086 _P6 = 0x0086 G$PCON$0$0 == 0x0087 _PCON = 0x0087 G$TCON$0$0 == 0x0088 _TCON = 0x0088 G$TMOD$0$0 == 0x0089 _TMOD = 0x0089 G$TL0$0$0 == 0x008a _TL0 = 0x008a G$TL1$0$0 == 0x008b _TL1 = 0x008b G$TH0$0$0 == 0x008c _TH0 = 0x008c G$TH1$0$0 == 0x008d _TH1 = 0x008d G$CKCON$0$0 == 0x008e _CKCON = 0x008e G$PSCTL$0$0 == 0x008f _PSCTL = 0x008f G$P1$0$0 == 0x0090 _P1 = 0x0090 G$TMR3CN$0$0 == 0x0091 _TMR3CN = 0x0091 G$TMR3RLL$0$0 == 0x0092 _TMR3RLL = 0x0092 G$TMR3RLH$0$0 == 0x0093 _TMR3RLH = 0x0093 G$TMR3L$0$0 == 0x0094 _TMR3L = 0x0094 G$TMR3H$0$0 == 0x0095 _TMR3H = 0x0095 G$P7$0$0 == 0x0096 _P7 = 0x0096 G$SCON$0$0 == 0x0098 _SCON = 0x0098 G$SCON0$0$0 == 0x0098 _SCON0 = 0x0098 G$SBUF$0$0 == 0x0099 _SBUF = 0x0099 G$SBUF0$0$0 == 0x0099 _SBUF0 = 0x0099 G$SPI0CFG$0$0 == 0x009a _SPI0CFG = 0x009a G$SPI0DAT$0$0 == 0x009b _SPI0DAT = 0x009b G$ADC1$0$0 == 0x009c _ADC1 = 0x009c G$SPI0CKR$0$0 == 0x009d _SPI0CKR = 0x009d G$CPT0CN$0$0 == 0x009e _CPT0CN = 0x009e G$CPT1CN$0$0 == 0x009f _CPT1CN = 0x009f G$P2$0$0 == 0x00a0 _P2 = 0x00a0 G$EMI0TC$0$0 == 0x00a1 _EMI0TC = 0x00a1 G$EMI0CF$0$0 == 0x00a3 _EMI0CF = 0x00a3 G$PRT0CF$0$0 == 0x00a4 _PRT0CF = 0x00a4 G$P0MDOUT$0$0 == 0x00a4 _P0MDOUT = 0x00a4 G$PRT1CF$0$0 == 0x00a5 _PRT1CF = 0x00a5 G$P1MDOUT$0$0 == 0x00a5 _P1MDOUT = 0x00a5 G$PRT2CF$0$0 == 0x00a6 _PRT2CF = 0x00a6 G$P2MDOUT$0$0 == 0x00a6 _P2MDOUT = 0x00a6 G$PRT3CF$0$0 == 0x00a7 _PRT3CF = 0x00a7 G$P3MDOUT$0$0 == 0x00a7 _P3MDOUT = 0x00a7 G$IE$0$0 == 0x00a8 _IE = 0x00a8 G$SADDR0$0$0 == 0x00a9 _SADDR0 = 0x00a9 G$ADC1CN$0$0 == 0x00aa _ADC1CN = 0x00aa G$ADC1CF$0$0 == 0x00ab _ADC1CF = 0x00ab G$AMX1SL$0$0 == 0x00ac _AMX1SL = 0x00ac G$P3IF$0$0 == 0x00ad _P3IF = 0x00ad G$SADEN1$0$0 == 0x00ae _SADEN1 = 0x00ae G$EMI0CN$0$0 == 0x00af _EMI0CN = 0x00af G$_XPAGE$0$0 == 0x00af __XPAGE = 0x00af G$P3$0$0 == 0x00b0 _P3 = 0x00b0 G$OSCXCN$0$0 == 0x00b1 _OSCXCN = 0x00b1 G$OSCICN$0$0 == 0x00b2 _OSCICN = 0x00b2 G$P74OUT$0$0 == 0x00b5 _P74OUT = 0x00b5 G$FLSCL$0$0 == 0x00b6 _FLSCL = 0x00b6 G$FLACL$0$0 == 0x00b7 _FLACL = 0x00b7 G$IP$0$0 == 0x00b8 _IP = 0x00b8 G$SADEN0$0$0 == 0x00b9 _SADEN0 = 0x00b9 G$AMX0CF$0$0 == 0x00ba _AMX0CF = 0x00ba G$AMX0SL$0$0 == 0x00bb _AMX0SL = 0x00bb G$ADC0CF$0$0 == 0x00bc _ADC0CF = 0x00bc G$P1MDIN$0$0 == 0x00bd _P1MDIN = 0x00bd G$ADC0L$0$0 == 0x00be _ADC0L = 0x00be G$ADC0H$0$0 == 0x00bf _ADC0H = 0x00bf G$SMB0CN$0$0 == 0x00c0 _SMB0CN = 0x00c0 G$SMB0STA$0$0 == 0x00c1 _SMB0STA = 0x00c1 G$SMB0DAT$0$0 == 0x00c2 _SMB0DAT = 0x00c2 G$SMB0ADR$0$0 == 0x00c3 _SMB0ADR = 0x00c3 G$ADC0GTL$0$0 == 0x00c4 _ADC0GTL = 0x00c4 G$ADC0GTH$0$0 == 0x00c5 _ADC0GTH = 0x00c5 G$ADC0LTL$0$0 == 0x00c6 _ADC0LTL = 0x00c6 G$ADC0LTH$0$0 == 0x00c7 _ADC0LTH = 0x00c7 G$T2CON$0$0 == 0x00c8 _T2CON = 0x00c8 G$T4CON$0$0 == 0x00c9 _T4CON = 0x00c9 G$RCAP2L$0$0 == 0x00ca _RCAP2L = 0x00ca G$RCAP2H$0$0 == 0x00cb _RCAP2H = 0x00cb G$TL2$0$0 == 0x00cc _TL2 = 0x00cc G$TH2$0$0 == 0x00cd _TH2 = 0x00cd G$SMB0CR$0$0 == 0x00cf _SMB0CR = 0x00cf G$PSW$0$0 == 0x00d0 _PSW = 0x00d0 G$REF0CN$0$0 == 0x00d1 _REF0CN = 0x00d1 G$DAC0L$0$0 == 0x00d2 _DAC0L = 0x00d2 G$DAC0H$0$0 == 0x00d3 _DAC0H = 0x00d3 G$DAC0CN$0$0 == 0x00d4 _DAC0CN = 0x00d4 G$DAC1L$0$0 == 0x00d5 _DAC1L = 0x00d5 G$DAC1H$0$0 == 0x00d6 _DAC1H = 0x00d6 G$DAC1CN$0$0 == 0x00d7 _DAC1CN = 0x00d7 G$PCA0CN$0$0 == 0x00d8 _PCA0CN = 0x00d8 G$PCA0MD$0$0 == 0x00d9 _PCA0MD = 0x00d9 G$PCA0CPM0$0$0 == 0x00da _PCA0CPM0 = 0x00da G$PCA0CPM1$0$0 == 0x00db _PCA0CPM1 = 0x00db G$PCA0CPM2$0$0 == 0x00dc _PCA0CPM2 = 0x00dc G$PCA0CPM3$0$0 == 0x00dd _PCA0CPM3 = 0x00dd G$PCA0CPM4$0$0 == 0x00de _PCA0CPM4 = 0x00de G$ACC$0$0 == 0x00e0 _ACC = 0x00e0 G$XBR0$0$0 == 0x00e1 _XBR0 = 0x00e1 G$XBR1$0$0 == 0x00e2 _XBR1 = 0x00e2 G$XBR2$0$0 == 0x00e3 _XBR2 = 0x00e3 G$RCAP4L$0$0 == 0x00e4 _RCAP4L = 0x00e4 G$RCAP4H$0$0 == 0x00e5 _RCAP4H = 0x00e5 G$EIE1$0$0 == 0x00e6 _EIE1 = 0x00e6 G$EIE2$0$0 == 0x00e7 _EIE2 = 0x00e7 G$ADC0CN$0$0 == 0x00e8 _ADC0CN = 0x00e8 G$PCA0L$0$0 == 0x00e9 _PCA0L = 0x00e9 G$PCA0CPL0$0$0 == 0x00ea _PCA0CPL0 = 0x00ea G$PCA0CPL1$0$0 == 0x00eb _PCA0CPL1 = 0x00eb G$PCA0CPL2$0$0 == 0x00ec _PCA0CPL2 = 0x00ec G$PCA0CPL3$0$0 == 0x00ed _PCA0CPL3 = 0x00ed G$PCA0CPL4$0$0 == 0x00ee _PCA0CPL4 = 0x00ee G$RSTSRC$0$0 == 0x00ef _RSTSRC = 0x00ef G$B$0$0 == 0x00f0 _B = 0x00f0 G$SCON1$0$0 == 0x00f1 _SCON1 = 0x00f1 G$SBUF1$0$0 == 0x00f2 _SBUF1 = 0x00f2 G$SADDR1$0$0 == 0x00f3 _SADDR1 = 0x00f3 G$TL4$0$0 == 0x00f4 _TL4 = 0x00f4 G$TH4$0$0 == 0x00f5 _TH4 = 0x00f5 G$EIP1$0$0 == 0x00f6 _EIP1 = 0x00f6 G$EIP2$0$0 == 0x00f7 _EIP2 = 0x00f7 G$SPI0CN$0$0 == 0x00f8 _SPI0CN = 0x00f8 G$PCA0H$0$0 == 0x00f9 _PCA0H = 0x00f9 G$PCA0CPH0$0$0 == 0x00fa _PCA0CPH0 = 0x00fa G$PCA0CPH1$0$0 == 0x00fb _PCA0CPH1 = 0x00fb G$PCA0CPH2$0$0 == 0x00fc _PCA0CPH2 = 0x00fc G$PCA0CPH3$0$0 == 0x00fd _PCA0CPH3 = 0x00fd G$PCA0CPH4$0$0 == 0x00fe _PCA0CPH4 = 0x00fe G$WDTCN$0$0 == 0x00ff _WDTCN = 0x00ff G$TMR0$0$0 == 0x8c8a _TMR0 = 0x8c8a G$TMR1$0$0 == 0x8d8b _TMR1 = 0x8d8b G$TMR2$0$0 == 0xcdcc _TMR2 = 0xcdcc G$RCAP2$0$0 == 0xcbca _RCAP2 = 0xcbca G$TMR3$0$0 == 0x9594 _TMR3 = 0x9594 G$TMR3RL$0$0 == 0x9392 _TMR3RL = 0x9392 G$TMR4$0$0 == 0xf5f4 _TMR4 = 0xf5f4 G$RCAP4$0$0 == 0xe5e4 _RCAP4 = 0xe5e4 G$ADC0$0$0 == 0xbfbe _ADC0 = 0xbfbe G$ADC0GT$0$0 == 0xc5c4 _ADC0GT = 0xc5c4 G$ADC0LT$0$0 == 0xc7c6 _ADC0LT = 0xc7c6 G$DAC0$0$0 == 0xd3d2 _DAC0 = 0xd3d2 G$DAC1$0$0 == 0xd6d5 _DAC1 = 0xd6d5 G$PCA0$0$0 == 0xf9e9 _PCA0 = 0xf9e9 G$PCA0CP0$0$0 == 0xfaea _PCA0CP0 = 0xfaea G$PCA0CP1$0$0 == 0xfbeb _PCA0CP1 = 0xfbeb G$PCA0CP2$0$0 == 0xfcec _PCA0CP2 = 0xfcec G$PCA0CP3$0$0 == 0xfded _PCA0CP3 = 0xfded G$PCA0CP4$0$0 == 0xfeee _PCA0CP4 = 0xfeee ;-------------------------------------------------------- ; special function bits ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 G$P0_0$0$0 == 0x0080 _P0_0 = 0x0080 G$P0_1$0$0 == 0x0081 _P0_1 = 0x0081 G$P0_2$0$0 == 0x0082 _P0_2 = 0x0082 G$P0_3$0$0 == 0x0083 _P0_3 = 0x0083 G$P0_4$0$0 == 0x0084 _P0_4 = 0x0084 G$P0_5$0$0 == 0x0085 _P0_5 = 0x0085 G$P0_6$0$0 == 0x0086 _P0_6 = 0x0086 G$P0_7$0$0 == 0x0087 _P0_7 = 0x0087 G$IT0$0$0 == 0x0088 _IT0 = 0x0088 G$IE0$0$0 == 0x0089 _IE0 = 0x0089 G$IT1$0$0 == 0x008a _IT1 = 0x008a G$IE1$0$0 == 0x008b _IE1 = 0x008b G$TR0$0$0 == 0x008c _TR0 = 0x008c G$TF0$0$0 == 0x008d _TF0 = 0x008d G$TR1$0$0 == 0x008e _TR1 = 0x008e G$TF1$0$0 == 0x008f _TF1 = 0x008f G$P1_0$0$0 == 0x0090 _P1_0 = 0x0090 G$P1_1$0$0 == 0x0091 _P1_1 = 0x0091 G$P1_2$0$0 == 0x0092 _P1_2 = 0x0092 G$P1_3$0$0 == 0x0093 _P1_3 = 0x0093 G$P1_4$0$0 == 0x0094 _P1_4 = 0x0094 G$P1_5$0$0 == 0x0095 _P1_5 = 0x0095 G$P1_6$0$0 == 0x0096 _P1_6 = 0x0096 G$P1_7$0$0 == 0x0097 _P1_7 = 0x0097 G$RI$0$0 == 0x0098 _RI = 0x0098 G$RI0$0$0 == 0x0098 _RI0 = 0x0098 G$TI$0$0 == 0x0099 _TI = 0x0099 G$TI0$0$0 == 0x0099 _TI0 = 0x0099 G$RB8$0$0 == 0x009a _RB8 = 0x009a G$RB80$0$0 == 0x009a _RB80 = 0x009a G$TB8$0$0 == 0x009b _TB8 = 0x009b G$TB80$0$0 == 0x009b _TB80 = 0x009b G$REN$0$0 == 0x009c _REN = 0x009c G$REN0$0$0 == 0x009c _REN0 = 0x009c G$SM2$0$0 == 0x009d _SM2 = 0x009d G$SM20$0$0 == 0x009d _SM20 = 0x009d G$MCE0$0$0 == 0x009d _MCE0 = 0x009d G$SM1$0$0 == 0x009e _SM1 = 0x009e G$SM10$0$0 == 0x009e _SM10 = 0x009e G$SM0$0$0 == 0x009f _SM0 = 0x009f G$SM00$0$0 == 0x009f _SM00 = 0x009f G$S0MODE$0$0 == 0x009f _S0MODE = 0x009f G$P2_0$0$0 == 0x00a0 _P2_0 = 0x00a0 G$P2_1$0$0 == 0x00a1 _P2_1 = 0x00a1 G$P2_2$0$0 == 0x00a2 _P2_2 = 0x00a2 G$P2_3$0$0 == 0x00a3 _P2_3 = 0x00a3 G$P2_4$0$0 == 0x00a4 _P2_4 = 0x00a4 G$P2_5$0$0 == 0x00a5 _P2_5 = 0x00a5 G$P2_6$0$0 == 0x00a6 _P2_6 = 0x00a6 G$P2_7$0$0 == 0x00a7 _P2_7 = 0x00a7 G$EX0$0$0 == 0x00a8 _EX0 = 0x00a8 G$ET0$0$0 == 0x00a9 _ET0 = 0x00a9 G$EX1$0$0 == 0x00aa _EX1 = 0x00aa G$ET1$0$0 == 0x00ab _ET1 = 0x00ab G$ES0$0$0 == 0x00ac _ES0 = 0x00ac G$ES$0$0 == 0x00ac _ES = 0x00ac G$ET2$0$0 == 0x00ad _ET2 = 0x00ad G$EA$0$0 == 0x00af _EA = 0x00af G$P3_0$0$0 == 0x00b0 _P3_0 = 0x00b0 G$P3_1$0$0 == 0x00b1 _P3_1 = 0x00b1 G$P3_2$0$0 == 0x00b2 _P3_2 = 0x00b2 G$P3_3$0$0 == 0x00b3 _P3_3 = 0x00b3 G$P3_4$0$0 == 0x00b4 _P3_4 = 0x00b4 G$P3_5$0$0 == 0x00b5 _P3_5 = 0x00b5 G$P3_6$0$0 == 0x00b6 _P3_6 = 0x00b6 G$P3_7$0$0 == 0x00b7 _P3_7 = 0x00b7 G$PX0$0$0 == 0x00b8 _PX0 = 0x00b8 G$PT0$0$0 == 0x00b9 _PT0 = 0x00b9 G$PX1$0$0 == 0x00ba _PX1 = 0x00ba G$PT1$0$0 == 0x00bb _PT1 = 0x00bb G$PS0$0$0 == 0x00bc _PS0 = 0x00bc G$PS$0$0 == 0x00bc _PS = 0x00bc G$PT2$0$0 == 0x00bd _PT2 = 0x00bd G$SMBTOE$0$0 == 0x00c0 _SMBTOE = 0x00c0 G$SMBFTE$0$0 == 0x00c1 _SMBFTE = 0x00c1 G$AA$0$0 == 0x00c2 _AA = 0x00c2 G$SI$0$0 == 0x00c3 _SI = 0x00c3 G$STO$0$0 == 0x00c4 _STO = 0x00c4 G$STA$0$0 == 0x00c5 _STA = 0x00c5 G$ENSMB$0$0 == 0x00c6 _ENSMB = 0x00c6 G$BUSY$0$0 == 0x00c7 _BUSY = 0x00c7 G$CPRL2$0$0 == 0x00c8 _CPRL2 = 0x00c8 G$CT2$0$0 == 0x00c9 _CT2 = 0x00c9 G$TR2$0$0 == 0x00ca _TR2 = 0x00ca G$EXEN2$0$0 == 0x00cb _EXEN2 = 0x00cb G$TCLK$0$0 == 0x00cc _TCLK = 0x00cc G$RCLK$0$0 == 0x00cd _RCLK = 0x00cd G$EXF2$0$0 == 0x00ce _EXF2 = 0x00ce G$TF2$0$0 == 0x00cf _TF2 = 0x00cf G$P$0$0 == 0x00d0 _P = 0x00d0 G$F1$0$0 == 0x00d1 _F1 = 0x00d1 G$OV$0$0 == 0x00d2 _OV = 0x00d2 G$RS0$0$0 == 0x00d3 _RS0 = 0x00d3 G$RS1$0$0 == 0x00d4 _RS1 = 0x00d4 G$F0$0$0 == 0x00d5 _F0 = 0x00d5 G$AC$0$0 == 0x00d6 _AC = 0x00d6 G$CY$0$0 == 0x00d7 _CY = 0x00d7 G$CCF0$0$0 == 0x00d8 _CCF0 = 0x00d8 G$CCF1$0$0 == 0x00d9 _CCF1 = 0x00d9 G$CCF2$0$0 == 0x00da _CCF2 = 0x00da G$CCF3$0$0 == 0x00db _CCF3 = 0x00db G$CCF4$0$0 == 0x00dc _CCF4 = 0x00dc G$CR$0$0 == 0x00de _CR = 0x00de G$CF$0$0 == 0x00df _CF = 0x00df G$ADLJST$0$0 == 0x00e8 _ADLJST = 0x00e8 G$AD0LJST$0$0 == 0x00e8 _AD0LJST = 0x00e8 G$ADWINT$0$0 == 0x00e9 _ADWINT = 0x00e9 G$AD0WINT$0$0 == 0x00e9 _AD0WINT = 0x00e9 G$ADSTM0$0$0 == 0x00ea _ADSTM0 = 0x00ea G$AD0CM0$0$0 == 0x00ea _AD0CM0 = 0x00ea G$ADSTM1$0$0 == 0x00eb _ADSTM1 = 0x00eb G$AD0CM1$0$0 == 0x00eb _AD0CM1 = 0x00eb G$ADBUSY$0$0 == 0x00ec _ADBUSY = 0x00ec G$AD0BUSY$0$0 == 0x00ec _AD0BUSY = 0x00ec G$ADCINT$0$0 == 0x00ed _ADCINT = 0x00ed G$AD0INT$0$0 == 0x00ed _AD0INT = 0x00ed G$ADCTM$0$0 == 0x00ee _ADCTM = 0x00ee G$AD0TM$0$0 == 0x00ee _AD0TM = 0x00ee G$ADCEN$0$0 == 0x00ef _ADCEN = 0x00ef G$AD0EN$0$0 == 0x00ef _AD0EN = 0x00ef G$SPIEN$0$0 == 0x00f8 _SPIEN = 0x00f8 G$MSTEN$0$0 == 0x00f9 _MSTEN = 0x00f9 G$SLVSEL$0$0 == 0x00fa _SLVSEL = 0x00fa G$TXBSY$0$0 == 0x00fb _TXBSY = 0x00fb G$RXOVRN$0$0 == 0x00fc _RXOVRN = 0x00fc G$MODF$0$0 == 0x00fd _MODF = 0x00fd G$WCOL$0$0 == 0x00fe _WCOL = 0x00fe G$SPIF$0$0 == 0x00ff _SPIF = 0x00ff ;-------------------------------------------------------- ; overlayable register banks ;-------------------------------------------------------- .area REG_BANK_0 (REL,OVR,DATA) .ds 8 ;-------------------------------------------------------- ; internal ram data ;-------------------------------------------------------- .area DSEG (DATA) ;-------------------------------------------------------- ; overlayable items in internal ram ;-------------------------------------------------------- .area OSEG (OVR,DATA) .area OSEG (OVR,DATA) ;-------------------------------------------------------- ; Stack segment in internal ram ;-------------------------------------------------------- .area SSEG __start__stack: .ds 1 ;-------------------------------------------------------- ; indirectly addressable internal ram data ;-------------------------------------------------------- .area ISEG (DATA) ;-------------------------------------------------------- ; absolute internal ram data ;-------------------------------------------------------- .area IABS (ABS,DATA) .area IABS (ABS,DATA) ;-------------------------------------------------------- ; bit data ;-------------------------------------------------------- .area BSEG (BIT) ;-------------------------------------------------------- ; paged external ram data ;-------------------------------------------------------- .area PSEG (PAG,XDATA) ;-------------------------------------------------------- ; external ram data ;-------------------------------------------------------- .area XSEG (XDATA) ;-------------------------------------------------------- ; absolute external ram data ;-------------------------------------------------------- .area XABS (ABS,XDATA) ;-------------------------------------------------------- ; external initialized ram data ;-------------------------------------------------------- .area XISEG (XDATA) .area HOME (CODE) .area GSINIT0 (CODE) .area GSINIT1 (CODE) .area GSINIT2 (CODE) .area GSINIT3 (CODE) .area GSINIT4 (CODE) .area GSINIT5 (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area CSEG (CODE) ;-------------------------------------------------------- ; interrupt vector ;-------------------------------------------------------- .area HOME (CODE) __interrupt_vect: ljmp __sdcc_gsinit_startup ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- .area HOME (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area GSINIT (CODE) .globl __sdcc_gsinit_startup .globl __sdcc_program_startup .globl __start__stack .globl __mcs51_genXINIT .globl __mcs51_genXRAMCLEAR .globl __mcs51_genRAMCLEAR .area GSFINAL (CODE) ljmp __sdcc_program_startup ;-------------------------------------------------------- ; Home ;-------------------------------------------------------- .area HOME (CODE) .area HOME (CODE) __sdcc_program_startup: ljmp _main ; return from main will return to caller ;-------------------------------------------------------- ; code ;-------------------------------------------------------- .area CSEG (CODE) ;------------------------------------------------------------ ;Allocation info for local variables in function 'SYSCLK_Init' ;------------------------------------------------------------ ;i Allocated to registers r6 r7 ;------------------------------------------------------------ G$SYSCLK_Init$0$0 ==. C$c8051_SDCC.h$42$0$0 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:42: void SYSCLK_Init(void) ; ----------------------------------------- ; function SYSCLK_Init ; ----------------------------------------- _SYSCLK_Init: ar7 = 0x07 ar6 = 0x06 ar5 = 0x05 ar4 = 0x04 ar3 = 0x03 ar2 = 0x02 ar1 = 0x01 ar0 = 0x00 C$c8051_SDCC.h$46$1$2 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:46: OSCXCN = 0x67; // start external oscillator with mov _OSCXCN,#0x67 C$c8051_SDCC.h$49$1$2 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:49: for (i=0; i < 256; i++); // wait for oscillator to start mov r6,#0x00 mov r7,#0x01 00107$: mov a,r6 add a,#0xff mov r4,a mov a,r7 addc a,#0xff mov r5,a mov ar6,r4 mov ar7,r5 mov a,r4 orl a,r5 jnz 00107$ C$c8051_SDCC.h$51$1$2 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:51: while (!(OSCXCN & 0x80)); // Wait for crystal osc. to settle 00102$: mov a,_OSCXCN jnb acc.7,00102$ C$c8051_SDCC.h$53$1$2 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:53: OSCICN = 0x88; // select external oscillator as SYSCLK mov _OSCICN,#0x88 C$c8051_SDCC.h$56$1$2 ==. XG$SYSCLK_Init$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'UART0_Init' ;------------------------------------------------------------ G$UART0_Init$0$0 ==. C$c8051_SDCC.h$64$1$2 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:64: void UART0_Init(void) ; ----------------------------------------- ; function UART0_Init ; ----------------------------------------- _UART0_Init: C$c8051_SDCC.h$66$1$4 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:66: SCON0 = 0x50; // SCON0: mode 1, 8-bit UART, enable RX mov _SCON0,#0x50 C$c8051_SDCC.h$67$1$4 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:67: TMOD = 0x20; // TMOD: timer 1, mode 2, 8-bit reload mov _TMOD,#0x20 C$c8051_SDCC.h$68$1$4 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:68: TH1 = 0xFF&-(SYSCLK/BAUDRATE/16); // set Timer1 reload value for baudrate mov _TH1,#0xdc C$c8051_SDCC.h$69$1$4 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:69: TR1 = 1; // start Timer1 setb _TR1 C$c8051_SDCC.h$70$1$4 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:70: CKCON |= 0x10; // Timer1 uses SYSCLK as time base orl _CKCON,#0x10 C$c8051_SDCC.h$71$1$4 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:71: PCON |= 0x80; // SMOD00 = 1 (disable baud rate orl _PCON,#0x80 C$c8051_SDCC.h$73$1$4 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:73: TI0 = 1; // Indicate TX0 ready setb _TI0 C$c8051_SDCC.h$74$1$4 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:74: P0MDOUT |= 0x01; // Set TX0 to push/pull orl _P0MDOUT,#0x01 C$c8051_SDCC.h$75$1$4 ==. XG$UART0_Init$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'Sys_Init' ;------------------------------------------------------------ G$Sys_Init$0$0 ==. C$c8051_SDCC.h$83$1$4 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:83: void Sys_Init(void) ; ----------------------------------------- ; function Sys_Init ; ----------------------------------------- _Sys_Init: C$c8051_SDCC.h$85$1$6 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:85: WDTCN = 0xde; // disable watchdog timer mov _WDTCN,#0xde C$c8051_SDCC.h$86$1$6 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:86: WDTCN = 0xad; mov _WDTCN,#0xad C$c8051_SDCC.h$88$1$6 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:88: SYSCLK_Init(); // initialize oscillator lcall _SYSCLK_Init C$c8051_SDCC.h$89$1$6 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:89: UART0_Init(); // initialize UART0 lcall _UART0_Init C$c8051_SDCC.h$91$1$6 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:91: XBR0 |= 0x04; orl _XBR0,#0x04 C$c8051_SDCC.h$92$1$6 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:92: XBR2 |= 0x40; // Enable crossbar and weak pull-ups orl _XBR2,#0x40 C$c8051_SDCC.h$93$1$6 ==. XG$Sys_Init$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'putchar' ;------------------------------------------------------------ ;c Allocated to registers r7 ;------------------------------------------------------------ G$putchar$0$0 ==. C$c8051_SDCC.h$98$1$6 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:98: void putchar(char c) ; ----------------------------------------- ; function putchar ; ----------------------------------------- _putchar: mov r7,dpl C$c8051_SDCC.h$100$1$8 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:100: while (!TI0); 00101$: C$c8051_SDCC.h$101$1$8 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:101: TI0 = 0; jbc _TI0,00112$ sjmp 00101$ 00112$: C$c8051_SDCC.h$102$1$8 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:102: SBUF0 = c; mov _SBUF0,r7 C$c8051_SDCC.h$103$1$8 ==. XG$putchar$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'getchar' ;------------------------------------------------------------ ;c Allocated to registers ;------------------------------------------------------------ G$getchar$0$0 ==. C$c8051_SDCC.h$108$1$8 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:108: char getchar(void) ; ----------------------------------------- ; function getchar ; ----------------------------------------- _getchar: C$c8051_SDCC.h$111$1$10 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:111: while (!RI0); 00101$: C$c8051_SDCC.h$112$1$10 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:112: RI0 = 0; jbc _RI0,00112$ sjmp 00101$ 00112$: C$c8051_SDCC.h$113$1$10 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:113: c = SBUF0; mov dpl,_SBUF0 C$c8051_SDCC.h$114$1$10 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:114: putchar(c); // echo to terminal lcall _putchar C$c8051_SDCC.h$115$1$10 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:115: return SBUF0; mov dpl,_SBUF0 C$c8051_SDCC.h$116$1$10 ==. XG$getchar$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'getchar_nw' ;------------------------------------------------------------ ;c Allocated to registers ;------------------------------------------------------------ G$getchar_nw$0$0 ==. C$c8051_SDCC.h$121$1$10 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:121: char getchar_nw(void) ; ----------------------------------------- ; function getchar_nw ; ----------------------------------------- _getchar_nw: C$c8051_SDCC.h$124$1$12 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:124: if (!RI0) return 0xFF; jb _RI0,00102$ mov dpl,#0xff sjmp 00104$ 00102$: C$c8051_SDCC.h$127$2$13 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:127: RI0 = 0; clr _RI0 C$c8051_SDCC.h$128$2$13 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:128: c = SBUF0; mov dpl,_SBUF0 C$c8051_SDCC.h$129$2$13 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:129: putchar(c); // echo to terminal lcall _putchar C$c8051_SDCC.h$130$2$13 ==. ; C:/Program Files/SDCC/bin/../include/mcs51/c8051_SDCC.h:130: return SBUF0; mov dpl,_SBUF0 00104$: C$c8051_SDCC.h$132$1$12 ==. XG$getchar_nw$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'main' ;------------------------------------------------------------ ;imax Allocated to registers r4 r5 ;i Allocated to registers ;count Allocated to registers ;input Allocated to registers r6 r7 ;------------------------------------------------------------ G$main$0$0 ==. C$hw1.c$6$1$12 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:6: void main(void) /* start main function */ ; ----------------------------------------- ; function main ; ----------------------------------------- _main: C$hw1.c$13$1$28 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:13: Sys_Init(); /* Initialize UART, System clock and crossbar*/ lcall _Sys_Init C$hw1.c$14$1$28 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:14: putchar(' '); /* do this because we tell you to */ mov dpl,#0x20 lcall _putchar C$hw1.c$15$1$28 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:15: while(1) /* begin infinite loop */ 00109$: C$hw1.c$17$2$29 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:17: printf(""\\r\\n enter 1 to count to 18 or 2 to count to 270 \\r\\n""); mov a,#___str_0 push acc mov a,#(___str_0 >> 8) push acc mov a,#0x80 push acc lcall _printf dec sp dec sp dec sp C$hw1.c$18$2$29 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:18: input=getchar(); /* get count value */ lcall _getchar mov r6,dpl mov r7,#0x00 C$hw1.c$19$2$29 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:19: if (input=='1') /* if input is 1, count to 18 */ cjne r6,#0x31,00105$ cjne r7,#0x00,00105$ C$hw1.c$22$3$30 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:22: imax=18; mov r4,#0x12 mov r5,#0x00 sjmp 00106$ 00105$: C$hw1.c$24$2$29 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:24: else if (input=='2') /* if input is 2, count to 270 */ cjne r6,#0x32,00102$ cjne r7,#0x00,00102$ C$hw1.c$27$3$31 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:27: imax=270; mov r4,#0x0e mov r5,#0x01 sjmp 00106$ 00102$: C$hw1.c$29$2$29 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:29: else imax=0; /* for other inputs, skip counting */ mov r4,#0x00 mov r5,#0x00 00106$: C$hw1.c$30$2$29 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:30: printf(""\\n count value is %u "",imax); push ar5 push ar4 push ar4 push ar5 mov a,#___str_1 push acc mov a,#(___str_1 >> 8) push acc mov a,#0x80 push acc lcall _printf mov a,sp add a,#0xfb mov sp,a C$hw1.c$31$2$29 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:31: printf(""\\n\\n Decimal hex \\n\\r""); mov a,#___str_2 push acc mov a,#(___str_2 >> 8) push acc mov a,#0x80 push acc lcall _printf dec sp dec sp dec sp pop ar4 pop ar5 C$hw1.c$32$2$29 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:32: for(i=0;i<=imax;i++) mov r6,#0x00 mov r7,#0x00 00112$: clr c mov a,r4 subb a,r6 mov a,r5 xrl a,#0x80 mov b,r7 xrl b,#0x80 subb a,b jnc 00135$ ljmp 00109$ 00135$: C$hw1.c$35$3$32 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:35: printf(""%u %x \\n\\r"", count, count); push ar7 push ar6 push ar5 push ar4 push ar6 push ar7 push ar6 push ar7 mov a,#___str_3 push acc mov a,#(___str_3 >> 8) push acc mov a,#0x80 push acc lcall _printf mov a,sp add a,#0xf9 mov sp,a pop ar4 pop ar5 pop ar6 pop ar7 C$hw1.c$32$2$29 ==. ; C:\\SiLabs\\LITEC\\FirstProject\\hw1.c:32: for(i=0;i<=imax;i++) inc r6 cjne r6,#0x00,00112$ inc r7 sjmp 00112$ C$hw1.c$39$1$28 ==. XG$main$0$0 ==. ret .area CSEG (CODE) .area CONST (CODE) Fhw1$__str_0$0$0 == . ___str_0: .db 0x0d .db 0x0a .ascii "" enter 1 to count to 18 or 2 to count to 270 "" .db 0x0d .db 0x0a .db 0x00 Fhw1$__str_1$0$0 == . ___str_1: .db 0x0a .ascii "" count value is %u "" .db 0x00 Fhw1$__str_2$0$0 == . ___str_2: .db 0x0a .db 0x0a .ascii "" Decimal hex "" .db 0x0a .db 0x0d .db 0x00 Fhw1$__str_3$0$0 == . ___str_3: .ascii ""%u %x "" .db 0x0a .db 0x0d .db 0x00 .area XINIT (CODE) .area CABS (ABS,CODE) ",16355,True,2838.271225407208,median "[MusicConfig] Location=416444 Helblinde - Above the Clouds/Helblinde - Above the Clouds.mp3 Extension=mp3 MD5=e4‌​1d‌​cc‌​37‌​ef‌​58‌​c0‌​da‌​99‌​07‌​f0‌​ae‌​80‌​c6‌​04‌​c2 Source=OSU MetreNumber=4 Title=Above the Clouds [TagConfig] Tagger=Carra Time=2016/9/10 23:14:05 Confidence=4 [MiscConfig] LinkedFile=416444 Helblinde - Above the Clouds/Helblinde - Above the Clouds (Asserin) [Above the Collab].osu osuMapID=416444 [BeatInfo] Count=389 Beat_0={0.054,1,Bb Maj,Gm} Beat_1={0.387333333333333,0,Bb Maj,Gm} Beat_2={0.7206666666666659,0,Bb Maj,Gm} Beat_3={1.0539999999999989,0,Bb Maj,Gm} Beat_4={1.387333333333332,1,Bb Maj,Gm} Beat_5={1.720666666666665,0,Bb Maj,Gm} Beat_6={2.053999999999998,0,Bb Maj,Gm} Beat_7={2.3873333333333311,0,Bb Maj,Gm} Beat_8={2.7206666666666641,1,Bb Maj,Dm} Beat_9={3.0539999999999972,0,Bb Maj,Dm} Beat_10={3.38733333333333,0,Bb Maj,Dm} Beat_11={3.7206666666666632,0,Bb Maj,Dm} Beat_12={4.0539999999999958,1,Bb Maj,Dm} Beat_13={4.3873333333333289,0,Bb Maj,Dm} Beat_14={4.7206666666666619,0,Bb Maj,Dm} Beat_15={5.0539999999999949,0,Bb Maj,Dm} Beat_16={5.387333333333328,1,Bb Maj,Eb} Beat_17={5.720666666666661,0,Bb Maj,Eb} Beat_18={6.0539999999999941,0,Bb Maj,Eb} Beat_19={6.3873333333333271,0,Bb Maj,Eb} Beat_20={6.72066666666666,1,Bb Maj,Eb} Beat_21={7.0539999999999932,0,Bb Maj,Eb} Beat_22={7.3873333333333262,0,Bb Maj,Eb} Beat_23={7.7206666666666592,0,Bb Maj,Eb} Beat_24={8.0539999999999914,1,Bb Maj,Bb} Beat_25={8.3873333333333235,0,Bb Maj,Bb} Beat_26={8.7206666666666557,0,Bb Maj,Bb} Beat_27={9.0539999999999878,0,Bb Maj,Bb} Beat_28={9.38733333333332,1,Bb Maj,Bb} Beat_29={9.7206666666666521,0,Bb Maj,Bb} Beat_30={10.053999999999984,0,Bb Maj,Bb} Beat_31={10.387333333333316,0,Bb Maj,Bb} Beat_32={10.720666666666649,1,Bb Maj,Cm} Beat_33={11.053999999999981,0,Bb Maj,Cm} Beat_34={11.387333333333313,0,Bb Maj,Cm} Beat_35={11.720666666666645,0,Bb Maj,Cm} Beat_36={12.053999999999977,1,Bb Maj,Cm} Beat_37={12.387333333333309,0,Bb Maj,Cm} Beat_38={12.720666666666642,0,Bb Maj,Cm} Beat_39={13.053999999999974,0,Bb Maj,Cm} Beat_40={13.387333333333306,1,Bb Maj,Gm} Beat_41={13.720666666666638,0,Bb Maj,Gm} Beat_42={14.05399999999997,0,Bb Maj,Gm} Beat_43={14.387333333333302,0,Bb Maj,Gm} Beat_44={14.720666666666634,1,Bb Maj,Gm} Beat_45={15.053999999999967,0,Bb Maj,Gm} Beat_46={15.387333333333299,0,Bb Maj,Gm} Beat_47={15.720666666666631,0,Bb Maj,Gm} Beat_48={16.053999999999963,1,Bb Maj,A} Beat_49={16.387333333333295,0,Bb Maj,A} Beat_50={16.720666666666627,0,Bb Maj,A} Beat_51={17.053999999999959,0,Bb Maj,A} Beat_52={17.387333333333292,1,Bb Maj,A} Beat_53={17.720666666666624,0,Bb Maj,A} Beat_54={18.053999999999956,0,Bb Maj,A} Beat_55={18.387333333333288,0,Bb Maj,A} Beat_56={18.72066666666662,1,Bb Maj,D} Beat_57={19.053999999999952,0,Bb Maj,D} Beat_58={19.387333333333284,0,Bb Maj,D} Beat_59={19.720666666666617,0,Bb Maj,D} Beat_60={20.053999999999949,1,Bb Maj,D} Beat_61={20.387333333333281,0,Bb Maj,D} Beat_62={20.720666666666613,0,Bb Maj,D} Beat_63={21.053999999999945,0,Bb Maj,D} Beat_64={21.387333333333277,1,Bb Maj,Gm} Beat_65={21.72066666666661,0,Bb Maj,Gm} Beat_66={22.053999999999942,0,Bb Maj,Gm} Beat_67={22.387333333333274,0,Bb Maj,Gm} Beat_68={22.720666666666606,1,Bb Maj,Gm} Beat_69={23.053999999999938,0,Bb Maj,Gm} Beat_70={23.38733333333327,0,Bb Maj,Gm} Beat_71={23.720666666666602,0,Bb Maj,Gm} Beat_72={24.053999999999935,1,Bb Maj,Dm} Beat_73={24.387333333333267,0,Bb Maj,Dm} Beat_74={24.7206666666666,0,Bb Maj,Dm} Beat_75={25.053999999999931,0,Bb Maj,Dm} Beat_76={25.387333333333263,1,Bb Maj,Dm} Beat_77={25.720666666666595,0,Bb Maj,Dm} Beat_78={26.053999999999927,0,Bb Maj,Dm} Beat_79={26.38733333333326,0,Bb Maj,Dm} Beat_80={26.720666666666592,1,Bb Maj,Eb} Beat_81={27.053999999999924,0,Bb Maj,Eb} Beat_82={27.387333333333256,0,Bb Maj,Eb} Beat_83={27.720666666666588,0,Bb Maj,Eb} Beat_84={28.05399999999992,1,Bb Maj,Eb} Beat_85={28.387333333333252,0,Bb Maj,Eb} Beat_86={28.720666666666585,0,Bb Maj,Eb} Beat_87={29.053999999999917,0,Bb Maj,Eb} Beat_88={29.387333333333249,1,Bb Maj,Bb} Beat_89={29.720666666666581,0,Bb Maj,Bb} Beat_90={30.053999999999913,0,Bb Maj,Bb} Beat_91={30.387333333333245,0,Bb Maj,Bb} Beat_92={30.720666666666578,1,Bb Maj,Bb} Beat_93={31.05399999999991,0,Bb Maj,Bb} Beat_94={31.387333333333242,0,Bb Maj,Bb} Beat_95={31.720666666666574,0,Bb Maj,Bb} Beat_96={32.05399999999991,1,Bb Maj,Cm} Beat_97={32.387333333333245,0,Bb Maj,Cm} Beat_98={32.720666666666581,0,Bb Maj,Cm} Beat_99={33.053999999999917,0,Bb Maj,Cm} Beat_100={33.387333333333252,1,Bb Maj,Cm} Beat_101={33.720666666666588,0,Bb Maj,Cm} Beat_102={34.053999999999924,0,Bb Maj,Cm} Beat_103={34.38733333333326,0,Bb Maj,Cm} Beat_104={34.720666666666595,1,Bb Maj,Gm} Beat_105={35.053999999999931,0,Bb Maj,Gm} Beat_106={35.387333333333267,0,Bb Maj,Gm} Beat_107={35.7206666666666,0,Bb Maj,Gm} Beat_108={36.053999999999938,1,Bb Maj,Gm} Beat_109={36.387333333333274,0,Bb Maj,Gm} Beat_110={36.72066666666661,0,Bb Maj,Gm} Beat_111={37.053999999999945,0,Bb Maj,Gm} Beat_112={37.387333333333281,1,Bb Maj,Cm} Beat_113={37.720666666666617,0,Bb Maj,Cm} Beat_114={38.053999999999952,0,Bb Maj,Cm} Beat_115={38.387333333333288,0,Bb Maj,Cm} Beat_116={38.720666666666624,1,Bb Maj,D} Beat_117={39.053999999999959,0,Bb Maj,D} Beat_118={39.387333333333295,0,Bb Maj,D} Beat_119={39.720666666666631,0,Bb Maj,D} Beat_120={40.053999999999967,1,Bb Maj,Gm} Beat_121={40.3873333333333,0,Bb Maj,Gm} Beat_122={40.720666666666638,0,Bb Maj,Gm} Beat_123={41.053999999999974,0,Bb Maj,Gm} Beat_124={41.387333333333309,1,Bb Maj,Gm} Beat_125={41.720666666666645,0,Bb Maj,Gm} Beat_126={42.053999999999981,0,Bb Maj,Gm} Beat_127={42.387333333333316,0,Bb Maj,Gm} Beat_128={42.743,1,Bb Maj,Bb} Beat_129={43.076333333333338,0,Bb Maj,Bb} Beat_130={43.409666666666674,0,Bb Maj,Bb} Beat_131={43.743000000000009,0,Bb Maj,Bb} Beat_132={44.076333333333345,1,Bb Maj,Bb} Beat_133={44.409666666666681,0,Bb Maj,Bb} Beat_134={44.743000000000016,0,Bb Maj,Bb} Beat_135={45.076333333333352,0,Bb Maj,Bb} Beat_136={45.409666666666688,1,Bb Maj,F} Beat_137={45.743000000000023,0,Bb Maj,F} Beat_138={46.076333333333359,0,Bb Maj,F} Beat_139={46.409666666666695,0,Bb Maj,F} Beat_140={46.743000000000031,1,Bb Maj,F} Beat_141={47.076333333333366,0,Bb Maj,F} Beat_142={47.4096666666667,0,Bb Maj,F} Beat_143={47.743000000000038,0,Bb Maj,F} Beat_144={48.076333333333373,1,Bb Maj,Gm} Beat_145={48.409666666666709,0,Bb Maj,Gm} Beat_146={48.743000000000045,0,Bb Maj,Gm} Beat_147={49.07633333333338,0,Bb Maj,Gm} Beat_148={49.409666666666716,1,Bb Maj,Gm} Beat_149={49.743000000000052,0,Bb Maj,Gm} Beat_150={50.076333333333388,0,Bb Maj,Gm} Beat_151={50.409666666666723,0,Bb Maj,Gm} Beat_152={50.743000000000059,1,Bb Maj,Dm} Beat_153={51.076333333333395,0,Bb Maj,Dm} Beat_154={51.40966666666673,0,Bb Maj,Dm} Beat_155={51.743000000000066,0,Bb Maj,Dm} Beat_156={52.0763333333334,1,Bb Maj,Dm} Beat_157={52.409666666666737,0,Bb Maj,Dm} Beat_158={52.743000000000073,0,Bb Maj,Dm} Beat_159={53.076333333333409,0,Bb Maj,Dm} Beat_160={53.409666666666745,1,Bb Maj,Eb} Beat_161={53.74300000000008,0,Bb Maj,Eb} Beat_162={54.076333333333416,0,Bb Maj,Eb} Beat_163={54.409666666666752,0,Bb Maj,Eb} Beat_164={54.743000000000087,1,Bb Maj,F} Beat_165={55.076333333333423,0,Bb Maj,F} Beat_166={55.409666666666759,0,Bb Maj,F} Beat_167={55.743000000000094,0,Bb Maj,F} Beat_168={56.07633333333343,1,Bb Maj,Bb} Beat_169={56.409666666666766,0,Bb Maj,Bb} Beat_170={56.7430000000001,0,Bb Maj,Bb} Beat_171={57.076333333333437,0,Bb Maj,Bb} Beat_172={57.409666666666773,1,Bb Maj,Bb} Beat_173={57.743000000000109,0,Bb Maj,Bb} Beat_174={58.076333333333444,0,Bb Maj,Bb} Beat_175={58.40966666666678,0,Bb Maj,Bb} Beat_176={58.743000000000116,1,Bb Maj,Cm} Beat_177={59.076333333333451,0,Bb Maj,Cm} Beat_178={59.409666666666787,0,Bb Maj,Cm} Beat_179={59.743000000000123,0,Bb Maj,Cm} Beat_180={60.076333333333459,1,Bb Maj,Cm} Beat_181={60.409666666666794,0,Bb Maj,Cm} Beat_182={60.74300000000013,0,Bb Maj,Cm} Beat_183={61.076333333333466,0,Bb Maj,Cm} Beat_184={61.4096666666668,1,Bb Maj,F} Beat_185={61.743000000000137,0,Bb Maj,F} Beat_186={62.076333333333473,0,Bb Maj,F} Beat_187={62.409666666666809,0,Bb Maj,F} Beat_188={62.743000000000144,1,Bb Maj,F} Beat_189={63.07633333333348,0,Bb Maj,F} Beat_190={63.409666666666816,0,Bb Maj,F} Beat_191={63.743000000000151,0,Bb Maj,F} Beat_192={64.053,1,Bb Maj,Bb} Beat_193={64.386333333333326,0,Bb Maj,Bb} Beat_194={64.719666666666654,0,Bb Maj,Bb} Beat_195={65.052999999999983,0,Bb Maj,Bb} Beat_196={65.386333333333312,1,Bb Maj,Bb} Beat_197={65.71966666666664,0,Bb Maj,Bb} Beat_198={66.052999999999969,0,Bb Maj,Bb} Beat_199={66.3863333333333,0,Bb Maj,Bb} Beat_200={66.719666666666626,1,Bb Maj,F} Beat_201={67.052999999999955,0,Bb Maj,F} Beat_202={67.386333333333283,0,Bb Maj,F} Beat_203={67.719666666666612,0,Bb Maj,F} Beat_204={68.05299999999994,1,Bb Maj,F} Beat_205={68.386333333333269,0,Bb Maj,F} Beat_206={68.7196666666666,0,Bb Maj,F} Beat_207={69.052999999999926,0,Bb Maj,F} Beat_208={69.386333333333255,1,Bb Maj,Gm} Beat_209={69.719666666666583,0,Bb Maj,Gm} Beat_210={70.052999999999912,0,Bb Maj,Gm} Beat_211={70.386333333333241,0,Bb Maj,Gm} Beat_212={70.719666666666569,1,Bb Maj,Gm} Beat_213={71.0529999999999,0,Bb Maj,Gm} Beat_214={71.386333333333226,0,Bb Maj,Gm} Beat_215={71.719666666666555,0,Bb Maj,Gm} Beat_216={72.052999999999884,1,Bb Maj,Gm} Beat_217={72.386333333333212,0,Bb Maj,Dm} Beat_218={72.719666666666541,0,Bb Maj,Dm} Beat_219={73.052999999999869,0,Bb Maj,Dm} Beat_220={73.3863333333332,1,Bb Maj,Dm} Beat_221={73.719666666666527,0,Bb Maj,Dm} Beat_222={74.052999999999855,0,Bb Maj,Dm} Beat_223={74.386333333333184,0,Bb Maj,Dm} Beat_224={74.719666666666512,1,Bb Maj,Eb} Beat_225={75.052999999999841,0,Bb Maj,Eb} Beat_226={75.38633333333317,0,Bb Maj,Eb} Beat_227={75.7196666666665,0,Bb Maj,Eb} Beat_228={76.052999999999827,1,Bb Maj,F} Beat_229={76.386333333333155,0,Bb Maj,F} Beat_230={76.719666666666484,0,Bb Maj,F} Beat_231={77.052999999999813,0,Bb Maj,F} Beat_232={77.386333333333141,1,Bb Maj,Bb} Beat_233={77.71966666666647,0,Bb Maj,Bb} Beat_234={78.0529999999998,0,Bb Maj,Bb} Beat_235={78.386333333333127,0,Bb Maj,Bb} Beat_236={78.719666666666456,1,Bb Maj,Bb} Beat_237={79.052999999999784,0,Bb Maj,Bb} Beat_238={79.386333333333113,0,Bb Maj,Bb} Beat_239={79.719666666666441,0,Bb Maj,Bb} Beat_240={80.05299999999977,1,Bb Maj,Cm} Beat_241={80.3863333333331,0,Bb Maj,Cm} Beat_242={80.719666666666427,0,Bb Maj,Cm} Beat_243={81.052999999999756,0,Bb Maj,Cm} Beat_244={81.386333333333084,1,Bb Maj,Cm} Beat_245={81.719666666666413,0,Bb Maj,Cm} Beat_246={82.052999999999741,0,Bb Maj,Cm} Beat_247={82.38633333333307,0,Bb Maj,Cm} Beat_248={82.7196666666664,1,Bb Maj,F} Beat_249={83.052999999999727,0,Bb Maj,F} Beat_250={83.386333333333056,0,Bb Maj,F} Beat_251={83.719666666666384,0,Bb Maj,F} Beat_252={84.052999999999713,1,Bb Maj,F} Beat_253={84.386333333333042,0,Bb Maj,F} Beat_254={84.71966666666637,0,Bb Maj,F} Beat_255={85.0529999999997,0,Bb Maj,F} Beat_256={85.386333333333027,1,Bb Maj,Bb} Beat_257={85.719666666666356,0,Bb Maj,Bb} Beat_258={86.052999999999685,0,Bb Maj,Bb} Beat_259={86.386333333333013,0,Bb Maj,Bb} Beat_260={86.719666666666342,1,Bb Maj,Bb} Beat_261={87.05299999999967,0,Bb Maj,Bb} Beat_262={87.386333333333,0,Bb Maj,Bb} Beat_263={87.719666666666328,0,Bb Maj,Bb} Beat_264={88.052999999999656,1,Bb Maj,F} Beat_265={88.386333333332985,0,Bb Maj,F} Beat_266={88.719666666666313,0,Bb Maj,F} Beat_267={89.052999999999642,0,Bb Maj,F} Beat_268={89.386333333332971,1,Bb Maj,F} Beat_269={89.7196666666663,0,Bb Maj,F} Beat_270={90.052999999999628,0,Bb Maj,F} Beat_271={90.386333333332956,0,Bb Maj,F} Beat_272={90.719666666666285,1,Bb Maj,Gm} Beat_273={91.052999999999614,0,Bb Maj,Gm} Beat_274={91.386333333332942,0,Bb Maj,Gm} Beat_275={91.719666666666271,0,Bb Maj,Gm} Beat_276={92.0529999999996,1,Bb Maj,Gm} Beat_277={92.386333333332928,0,Bb Maj,Gm} Beat_278={92.719666666666257,0,Bb Maj,Gm} Beat_279={93.052999999999585,0,Bb Maj,Gm} Beat_280={93.386333333332914,1,Bb Maj,Dm} Beat_281={93.719666666666242,0,Bb Maj,Dm} Beat_282={94.052999999999571,0,Bb Maj,Dm} Beat_283={94.3863333333329,0,Bb Maj,Dm} Beat_284={94.719666666666228,1,Bb Maj,Dm} Beat_285={95.052999999999557,0,Bb Maj,Dm} Beat_286={95.386333333332885,0,Bb Maj,Dm} Beat_287={95.719666666666214,0,Bb Maj,Dm} Beat_288={96.052999999999543,1,Bb Maj,Eb} Beat_289={96.386333333332871,0,Bb Maj,Eb} Beat_290={96.7196666666662,0,Bb Maj,Eb} Beat_291={97.052999999999528,0,Bb Maj,Eb} Beat_292={97.386333333332857,1,Bb Maj,F} Beat_293={97.719666666666186,0,Bb Maj,F} Beat_294={98.052999999999514,0,Bb Maj,F} Beat_295={98.386333333332843,0,Bb Maj,F} Beat_296={98.719666666666171,1,Bb Maj,Bb} Beat_297={99.0529999999995,0,Bb Maj,Bb} Beat_298={99.386333333332828,0,Bb Maj,Bb} Beat_299={99.719666666666157,0,Bb Maj,Bb} Beat_300={100.05299999999949,1,Bb Maj,Bb} Beat_301={100.38633333333281,0,Bb Maj,Bb} Beat_302={100.71966666666614,0,Bb Maj,Bb} Beat_303={101.05299999999947,0,Bb Maj,Bb} Beat_304={101.3863333333328,1,Bb Maj,Cm} Beat_305={101.71966666666613,0,Bb Maj,Cm} Beat_306={102.05299999999946,0,Bb Maj,Cm} Beat_307={102.38633333333279,0,Bb Maj,Cm} Beat_308={102.71966666666611,1,Bb Maj,Cm} Beat_309={103.05299999999944,0,Bb Maj,Cm} Beat_310={103.38633333333277,0,Bb Maj,Cm} Beat_311={103.7196666666661,0,Bb Maj,Cm} Beat_312={104.05299999999943,1,Bb Maj,F} Beat_313={104.38633333333276,0,Bb Maj,F} Beat_314={104.71966666666609,0,Bb Maj,F} Beat_315={105.05299999999942,0,Bb Maj,F} Beat_316={105.38633333333274,1,Bb Maj,F} Beat_317={105.71966666666607,0,Bb Maj,F} Beat_318={106.0529999999994,0,Bb Maj,F} Beat_319={106.38633333333273,0,Bb Maj,F} Beat_320={106.71966666666606,1,Bb Maj,Bb} Beat_321={107.05299999999939,0,Bb Maj,Bb} Beat_322={107.38633333333272,0,Bb Maj,Bb} Beat_323={107.71966666666604,0,Bb Maj,Bb} Beat_324={108.05299999999937,1,Bb Maj,Bb} Beat_325={108.3863333333327,0,Bb Maj,Bb} Beat_326={108.71966666666603,0,Bb Maj,Bb} Beat_327={109.05299999999936,0,Bb Maj,Bb} Beat_328={109.38633333333269,1,Bb Maj,F} Beat_329={109.71966666666602,0,Bb Maj,F} Beat_330={110.05299999999934,0,Bb Maj,F} Beat_331={110.38633333333267,0,Bb Maj,F} Beat_332={110.719666666666,1,Bb Maj,F} Beat_333={111.05299999999933,0,Bb Maj,F} Beat_334={111.38633333333266,0,Bb Maj,F} Beat_335={111.71966666666599,0,Bb Maj,F} Beat_336={112.05299999999932,1,Bb Maj,Gm} Beat_337={112.38633333333264,0,Bb Maj,Gm} Beat_338={112.71966666666597,0,Bb Maj,Gm} Beat_339={113.0529999999993,0,Bb Maj,Gm} Beat_340={113.38633333333263,1,Bb Maj,Gm} Beat_341={113.71966666666596,0,Bb Maj,Gm} Beat_342={114.05299999999929,0,Bb Maj,Gm} Beat_343={114.38633333333262,0,Bb Maj,Gm} Beat_344={114.71966666666594,1,Bb Maj,Dm} Beat_345={115.05299999999927,0,Bb Maj,Dm} Beat_346={115.3863333333326,0,Bb Maj,Dm} Beat_347={115.71966666666593,0,Bb Maj,Dm} Beat_348={116.05299999999926,1,Bb Maj,Dm} Beat_349={116.38633333333259,0,Bb Maj,Dm} Beat_350={116.71966666666592,0,Bb Maj,Dm} Beat_351={117.05299999999924,0,Bb Maj,Dm} Beat_352={117.38633333333257,1,Bb Maj,Eb} Beat_353={117.7196666666659,0,Bb Maj,Eb} Beat_354={118.05299999999923,0,Bb Maj,Eb} Beat_355={118.38633333333256,0,Bb Maj,Eb} Beat_356={118.71966666666589,1,Bb Maj,F} Beat_357={119.05299999999922,0,Bb Maj,F} Beat_358={119.38633333333254,0,Bb Maj,F} Beat_359={119.71966666666587,0,Bb Maj,F} Beat_360={120.0529999999992,1,Bb Maj,Bb} Beat_361={120.38633333333253,0,Bb Maj,Bb} Beat_362={120.71966666666586,0,Bb Maj,Bb} Beat_363={121.05299999999919,0,Bb Maj,Bb} Beat_364={121.38633333333252,1,Bb Maj,Bb} Beat_365={121.71966666666584,0,Bb Maj,Bb} Beat_366={122.05299999999917,0,Bb Maj,Bb} Beat_367={122.3863333333325,0,Bb Maj,Bb} Beat_368={122.71966666666583,1,Bb Maj,Cm} Beat_369={123.05299999999916,0,Bb Maj,Cm} Beat_370={123.38633333333249,0,Bb Maj,Cm} Beat_371={123.71966666666582,0,Bb Maj,Cm} Beat_372={124.05299999999915,1,Bb Maj,Cm} Beat_373={124.38633333333247,0,Bb Maj,Cm} Beat_374={124.7196666666658,0,Bb Maj,Cm} Beat_375={125.05299999999913,0,Bb Maj,Cm} Beat_376={125.38633333333246,1,Bb Maj,F} Beat_377={125.71966666666579,0,Bb Maj,F} Beat_378={126.05299999999912,0,Bb Maj,F} Beat_379={126.38633333333245,0,Bb Maj,F} Beat_380={126.71966666666577,1,Bb Maj,F} Beat_381={127.0529999999991,0,Bb Maj,F} Beat_382={127.38633333333243,0,Bb Maj,F} Beat_383={127.71966666666576,0,Bb Maj,F} Beat_384={128.05299999999909,1,Bb Maj,F} Beat_385={128.38633333333243,0,Bb Maj,F} Beat_386={128.71966666666577,0,Bb Maj,F} Beat_387={129.05299999999912,0,Bb Maj,F} Beat_388={129.38633333333246,1,Bb Maj,N} ",12318,True,4477.567214591423,median "use16 org 0x7C00 BootStageOne: ; mov ah,0x00 ; reset disk mov dl,0 ; drive number int 0x13 ; mov ah,0x02 ; read sectors into memory mov al,1 ; numberOfSectorsToRead mov dl,0 ; driveNumber mov ch,0 ; cylinderNumber mov dh,0 ; headNumber mov cl,2 ; startingSectorNumber mov bx,DoSomething ; returnBuffer int 0x13 ; mov ah,0x02 ; read sectors into memory mov al,0x0E ; numberOfSectorsToRead mov dl,0 ; driveNumber mov ch,0 ; cylinderNumber mov dh,0 ; headNumber mov cl,3 ; startingSectorNumber mov bx,DoSomething2 ; returnBuffer int 0x13 ; jmp DoSomething ; buffer ; ret ; PreviousLabel: PadOutWithZeroesSectorOne: times ((0x200 - 2) - ($ - $$)) db 0x00 BootSectorSignature: dw 0xAA55 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; org 0x7E00 DoSomething: ; push TextSectorExplorer call DisplayStringWriteToConsoleWithNewline ; push StringHorizontalRule call DisplayStringWriteToConsoleWithNewline ; push CommandPromptSession0 call CommandPromptSessionRun ; TextSectorExplorer: db 'Sector Explorer',0 StringHorizontalRule: db '===============',0 PadOutWithZeroesSectorTwo: times ((0x200) - ($ - $$)) db 0x00 EndOfSectorTwo: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; org 0x8000 DoSomething2: CommandPromptSession0: dw CommandPromptDefnTest, CommandPromptSession0DiskLocation, CommandPromptSession0Command, 0 CommandPromptSession0Command: dw CommandHelp, 0 CommandPromptDefnTest: dw CommandPromptDefnTestCommands CommandPromptDefnTestCommands: dw CommandCalculate, CommandCylinderSet, CommandDiskSet, CommandExit, CommandFind, CommandHeadSet, CommandHelp, CommandLBA, CommandRead, CommandReadAscii, CommandReadNext, CommandSectorSet, CommandWrite, 0 CommandCalculate: dw CommandCalculateName, CommandCalculateDescription, CommandProcedureCalculate CommandCalculateName: db 'calculate',0 CommandCalculateDescription: db 'Performs a hexadecimal calculation (e.g. ""calculate 2 * 2"").',0 CommandCylinderSet: dw CommandCylinderSetName, CommandCylinderSetDescription, CommandProcedureCylinderSet CommandCylinderSetName: db 'cylinder',0 CommandCylinderSetDescription: db 'Sets the current cylinder number.',0 CommandDiskSet: dw CommandDiskSetName, CommandDiskSetDescription, CommandProcedureDiskSet CommandDiskSetName: db 'disk',0 CommandDiskSetDescription: db 'Sets the current disk number.',0 CommandExit: dw CommandExitName, CommandExitDescription, CommandProcedureExit CommandExitName: db 'exit',0 CommandExitDescription: db 'Ends the session.',0 CommandFind: dw CommandFindName, CommandFindDescription, CommandProcedureFind CommandFindName: db 'find',0 CommandFindDescription: db 'Searches the current track for the specified value.',0 CommandHeadSet: dw CommandHeadSetName, CommandHeadSetDescription, CommandProcedureHeadSet CommandHeadSetName: db 'head',0 CommandHeadSetDescription: db 'Sets the current head number.',0 CommandHelp: dw CommandHelpName, CommandHelpDescription, CommandProcedureHelp CommandHelpName: db 'help',0 CommandHelpDescription: db 'Displays this help text.',0 CommandLBA: dw CommandLBAName, CommandLBADescription, CommandProcedureLBA CommandLBAName: db 'lba',0 CommandLBADescription: db 'Converts a Logical Block Address to Cylinder-Head-Sector.',0 CommandRead: dw CommandReadName, CommandReadDescription, CommandProcedureRead CommandReadName: db 'read',0 CommandReadDescription: db 'Displays the contents of the current sector.',0 CommandReadAscii: dw CommandReadAsciiName, CommandReadAsciiDescription, CommandProcedureReadAscii CommandReadAsciiName: db 'readAscii',0 CommandReadAsciiDescription: db 'Displays the contents of the current sector as ASCII.',0 CommandReadNext: dw CommandReadNextName, CommandReadNextDescription, CommandProcedureReadNext CommandReadNextName: db 'readnext',0 CommandReadNextDescription: db 'Displays contents of the current sector and advances to the next.',0 CommandSectorSet: dw CommandSectorSetName, CommandSectorSetDescription, CommandProcedureSectorSet CommandSectorSetName: db 'sector',0 CommandSectorSetDescription: db 'Sets the current sector number.',0 CommandWrite: dw CommandWriteName, CommandWriteDescription, CommandProcedureWrite CommandWriteName: db 'write',0 CommandWriteDescription: db 'Writes bytes to the current sector.',0 CommandPromptSession0DiskLocation: dw CommandPromptSession0Disk, 0, 0, 1, 0 CommandPromptSession0Disk: dw 0, 0, 0, 0, CommandPromptSession0DiskFilesystem CommandPromptSession0DiskFilesystem: dw FilesystemDefnFAT16, CommandPromptSession0DiskFilesystemBootSectorBytes CommandPromptSession0DiskFilesystemBootSectorBytes: db 0x200 dup (0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ArrayEmpty: dw 0 ArrayPerformProcedureForEachItem: ; (array, procedureToPerform, parametersToPass, unpackParameterArray) ; push bp mov bp,sp push ax push si ; mov si,[bp+0x0A] ; array ; ForEachArrayMember: lodsw cmp ax,0x0000 je ElseIfArrayIsOutOfMembers ; if array is not out of members push ax push si ; push ax ; object ; push word [bp+6] ; parametersToPass cmp word [bp+4],1 jne DoNotUnpackParameterArray call ArrayPushAllItemsToStack DoNotUnpackParameterArray: ; call word [bp+8] ; procedureToPerform ; pop si pop ax jmp IfArrayNotOutOfMembersEnd ElseIfArrayIsOutOfMembers: jmp EndForEachArrayMember IfArrayNotOutOfMembersEnd: jmp ForEachArrayMember EndForEachArrayMember: ; pop si pop ax pop bp ret 8 ArrayPerformProcedureForEachItemWithNoParameters: ; (array, procedureToPerform) ; pop word [ArrayPerformProcedureForEachItemWithNoParametersReturnAddress] ; push ArrayEmpty push word 1 call ArrayPerformProcedureForEachItem ; push word [ArrayPerformProcedureForEachItemWithNoParametersReturnAddress] ret ; ArrayPerformProcedureForEachItemWithNoParametersReturnAddress: dw 0x0000 ArrayPushAllItemsToStack: ; (arrayToPush) ; ; save the old values ax,dx,si in memory ; because we can't use the stack like normal ; mov [ArrayPushAllItemsToStackAX],ax mov [ArrayPushAllItemsToStackDX],dx mov [ArrayPushAllItemsToStackSI],si ; pop dx ; return address pop si ; arrayToPush ForEachItemToPush: lodsw cmp ax,0x0000 je EndForEachItemToPush push ax ; item jmp ForEachItemToPush EndForEachItemToPush: ; push dx ; ; restore the old values ; mov ax,[ArrayPushAllItemsToStackAX] mov dx,[ArrayPushAllItemsToStackDX] mov si,[ArrayPushAllItemsToStackSI] ; ret ; no need to pop the parameter ; ArrayPushAllItemsToStackAX: dw 0 ArrayPushAllItemsToStackDX: dw 0 ArrayPushAllItemsToStackSI: dw 0 CommandProcedureCalculate: ; (session, command) push bp mov bp,sp push ax push cx push dx push di ; mov di,[bp+4] ; command mov di,[di+2] ; command.arguments ; push CommandProcedureCalculateNumberTemp push word [di+2] ; operand1 = command.arguments[1] call NumberParseFromString ; mov ax,[CommandProcedureCalculateNumberTemp] ; push CommandProcedureCalculateNumberTemp push word [di+6] ; operand2 = command.arguments[3] call NumberParseFromString ; mov cx,[CommandProcedureCalculateNumberTemp] ; mov di,[di+4] ; operator = command.arguments[2] mov dx,[di] ; IfOperatorIsAdd: ; cmp dx,'+' jne IfOperatorIsSubtract ; add ax,cx ; jmp EndIfOperator ; IfOperatorIsSubtract: ; cmp dx,'-' jne IfOperatorIsMultiply ; sub ax,cx ; jmp EndIfOperator ; IfOperatorIsMultiply: ; cmp dx,'*' jne IfOperatorIsDivide ; mul cx ; jmp EndIfOperator ; IfOperatorIsDivide: ; cmp dx,'/' jne EndIfOperator ; div cl ; mov [CommandProcedureCalculateNumberTemp],al ; push CommandProcedureCalculateStringTemp push CommandProcedureCalculateNumberTemp push word 1 call NumberConvertToStringHexadecimal ; push CommandProcedureCalculateStringTemp call DisplayStringWriteToConsole ; push TextR call DisplayStringWriteToConsole ; mov [CommandProcedureCalculateNumberTemp],ah ; push CommandProcedureCalculateStringTemp push CommandProcedureCalculateNumberTemp push word 1 call NumberConvertToStringHexadecimal ; push CommandProcedureCalculateStringTemp call DisplayStringWriteToConsoleWithNewline ; jmp EndCommandProcedureCalculate ; EndIfOperator: ; mov [CommandProcedureCalculateNumberTemp],ax ; push CommandProcedureCalculateStringTemp push CommandProcedureCalculateNumberTemp push word 2 call NumberConvertToStringHexadecimal ; push CommandProcedureCalculateStringTemp call DisplayStringWriteToConsoleWithNewline ; EndCommandProcedureCalculate: ; pop di pop dx pop cx pop ax pop bp ret 4 ; CommandProcedureCalculateNumberTemp: dw 0 CommandProcedureCalculateStringTemp: db '????',0 TextR: db 'R',0 CommandProcedureCylinderSet: ; (session, command) push bp mov bp,sp ; push word [bp+6] push word [bp+4] push word 2 push word 0x03FF ; lowest 10 bits only call CommandProcedureDiskLocationComponentSet ; pop bp ret 4 CommandProcedureDiskLocationComponentSet: ; (session, command, componentIndex, bitMaskToApply) push bp mov bp,sp push bx push si push di ; mov si,[bp+0xA] ; session mov si,[si+2] ; session.diskLocationCurrent ; mov di,[bp+8] ; command mov di,[di+2] ; command.arguments mov di,[di+2] ; command.arguments[1] (0 is command name) ; ; if argument[1] is specified ; cmp di,0 je EndCommandProcedureDiskLocationComponentSet ; push CommandProcedureDiskLocationComponentSetNumberTemp push di call NumberParseFromString ; mov di,[CommandProcedureDiskLocationComponentSetNumberTemp] ; mov bx,[si+0] ; session.diskLocationCurrent.disk add bx,[bp+6] ; componentIndex ; ; if component value is out of range ; cmp di,[bx] ; compare component value to disk's maximum jbe EndIfComponentValueOutOfRange ; push CommandProcedureDiskLocationComponentSetStringValueOutOfRange call DisplayStringWriteToConsoleWithNewline ; jmp EndCommandProcedureDiskLocationComponentSet ; EndIfComponentValueOutOfRange: ; and di,[bp+4] ; bitMaskToApply (is this still necessary?) ; add si,[bp+6] ; componentIndex mov [si],di ; session.diskLocationCurrent.[component] ; EndCommandProcedureDiskLocationComponentSet: pop di pop si pop bx pop bp ret 8 ; CommandProcedureDiskLocationComponentSetNumberTemp: dw 0 CommandProcedureDiskLocationComponentSetStringValueOutOfRange: db 'The specified value is outside the allowed range for the disk.',0 CommandProcedureDiskSet: ; (session, command) push bp mov bp,sp push ax push si push di ; mov si,[bp+6] ; session mov si,[si+2] ; session.diskLocationCurrent mov si,[si+0] ; session.diskLocationCurrent.disk ; mov di,[bp+4] ; command mov di,[di+2] ; command.arguments mov di,[di+2] ; command.arguments[1] (0 is command name) ; ; if argument[1] is specified ; cmp di,0 je EndIfArgumentsSpecified ; push CommandProcedureDiskSet_NumberTemp push di call NumberParseFromString ; mov di,[CommandProcedureDiskSet_NumberTemp] ; mov [si+0],di ; session.diskLocationCurrent.disk.diskNumber ; push si ; session.diskLocationCurrent.disk call DiskInitialize ; mov di,[bp+4] ; command mov di,[di+2] ; command.arguments mov di,[di+4] ; command.arguments[2] (0 is command name) ; ; if argument[2] is specified (ignoreLimits) ; push CommandProcedureDiskSet_IsArgument2IgnoreLimits push di push CommandProcedureDiskSet_TextIgnoreLimits call StringCompare ; cmp word [CommandProcedureDiskSet_IsArgument2IgnoreLimits],0 je EndIfIgnoreLimits ; call DisplayNewline push CommandProcedureDiskSet_TextCylinderHeadSectorLimitsWillBeIgnored call DisplayStringWriteToConsoleWithNewline ; mov word [si+2],0xFFFF mov word [si+4],0xFFFF mov word [si+6],0xFFFF ; EndIfIgnoreLimits: EndIfArgumentsSpecified: ; push si call DiskDisplay ; EndCommandProcedureDiskSet: pop di pop si pop ax pop bp ret 4 ; CommandProcedureDiskSet_IsArgument2IgnoreLimits: dw 0 CommandProcedureDiskSet_TextIgnoreLimits: db 'ignoreLimits',0 CommandProcedureDiskSet_TextCylinderHeadSectorLimitsWillBeIgnored: db 'Cylinder, head, and sector limits will be ignored.',0 CommandProcedureDiskSet_NumberTemp: dw 0 CommandProcedureExit: ; (session, command) push bp mov bp,sp push si ; mov word si,[bp+6] ; session mov word [si+6],1 ; session.isTerminated ; pop si pop bp ret 4 CommandProcedureFind: ; (session, command) push bp mov bp,sp push ax push bx push si push di ; mov si,[bp+6] ; session mov si,[si+2] ; session.diskLocationCurrent ; mov di,[bp+4] ; command mov di,[di+2] ; command.arguments mov di,[di+2] ; command.arguments[1] (0 is command name) ; push CommandProcedureFindNumberToFind push di call NumberParseFromString mov ax,[CommandProcedureFindNumberToFind] ; inc word [si+8] cmp word [si+8],0x200 jae EndForEachByteRead ; ForEachSectorOnDiskToSearch: ; push CommandProcedureReadBytesRead push si call DiskLocationSectorRead ; ForEachByteRead: ; mov bx,[si+8] cmp byte [CommandProcedureReadBytesRead+bx],al je EndForEachSectorOnDiskToSearch ; inc word [si+8] cmp word [si+8],0x200 jae EndForEachByteRead ; jmp ForEachByteRead EndForEachByteRead: ; push si ; session.diskLocationCurrent call DiskLocationSectorAdvance ; jmp ForEachSectorOnDiskToSearch EndForEachSectorOnDiskToSearch: ; push CommandProcedureReadBytesRead push word [si+8] push word 1 call CommandProcedureReadDisplayHexadecimal ; pop di pop si pop bx pop ax pop bp ret 4 ; CommandProcedureFindNumberTemp: db 0 CommandProcedureFindNumberToFind: db 0 CommandProcedureFindStringReadOffset: db '0000',0 CommandProcedureFindStringReadLength: db '0000',0 CommandProcedureFindCommandRead: dw 0, CommandProcedureFindCommandReadArguments CommandProcedureFindCommandReadArguments: dw CommandReadName, 0, 0 CommandProcedureHeadSet: ; (session, command) push bp mov bp,sp ; push word [bp+6] push word [bp+4] push word 4 push word 0xFFFF call CommandProcedureDiskLocationComponentSet ; pop bp ret 4 CommandProcedureHelp: ; (session, command) push bp mov bp,sp push ax push bx push si ; push CommandProcedureHelpTextLines ; array push DisplayStringWriteToConsoleWithNewline ; procedureToPerform call ArrayPerformProcedureForEachItemWithNoParameters ; mov si,[bp+6] ; session mov si,[si+0] ; session.defn mov si,[si+0] ; session.defn.commandDefnsAvailable ; ForEachCommandAvailableHelp: ; lodsw ; ax = command, si++ ; IfNoMoreCommands: cmp ax,0x0000 je EndForEachCommandAvailableHelp ; mov bx,ax push word [bx+0] ; command.name call DisplayStringWriteToConsole ; call DisplaySpace call DisplaySpace call DisplaySpace ; push word [bx+2] ; command.description call DisplayStringWriteToConsoleWithNewline ; jmp ForEachCommandAvailableHelp EndForEachCommandAvailableHelp: ; pop si pop bx pop ax pop bp ret 4 ; CommandProcedureHelpTextLines: dw HelpText0, HelpText1,0 HelpText0: db 'Commands',0 HelpText1: db '========',0 CommandProcedureLBA: ; (session, command) push bp mov bp,sp push si push di ; mov si,[bp+6] ; session mov si,[si+2] ; session.diskLocationCurrent ; mov di,[bp+4] ; command mov di,[di+2] ; command.arguments mov di,[di+2] ; command.arguments[1] (0 is command name) ; push CommandProcedureLBA_NumberTemp push word di ; operand = command.arguments[1] call NumberParseFromString ; push si ; returnDiskLocation push word [si+0] ; session.diskLocationCurrent.disk push word [CommandProcedureLBA_NumberTemp] ; lbaToConvert call DiskConvertLBAToCHS ; pop di pop si pop bp ret 4 ; CommandProcedureLBA_NumberTemp: dw 0 CommandProcedureRead: ; (session, command) push bp mov bp,sp push bx push dx push si push di ; mov si,[bp+6] ; session mov si,[si+2] ; session.diskLocationCurrent ; push CommandProcedureReadBytesRead push si call DiskLocationSectorRead ; mov di,[bp+4] ; command mov di,[di+2] ; command.arguments ; mov bx,0 ; starting byte index mov dx,0x200 ; number of bytes to display ; ; if argument 1 is specified ; cmp word [di+2],0 ; command.arguments[1] je EndIfByteIndexStartIsSpecified ; push CommandProcedureReadNumberTemp push word [di+2] call NumberParseFromString ; mov bx,[CommandProcedureReadNumberTemp] ; ; ; if argument 2 is specified ; cmp word [di+4],0 ; command.arguments[2] je EndIfByteIndexEndIsSpecified ; push CommandProcedureReadNumberTemp push word [di+4] call NumberParseFromString ; mov dx,[CommandProcedureReadNumberTemp] ; EndIfByteIndexEndIsSpecified: EndIfByteIndexStartIsSpecified: ; push CommandProcedureReadBytesRead push bx ; startIndex push dx ; length call CommandProcedureReadDisplayHexadecimal ; pop di pop si pop dx pop bx pop bp ret 4 ; CommandProcedureReadNumberTemp: dw 0 CommandProcedureReadStringTemp: db '0000',0 CommandProcedureReadBytesRead: db 0x200 dup (0) StringPeriodPeriod: db '..',0 CommandProcedureReadAscii: ; (session, command) push bp mov bp,sp push si ; mov si,[bp+6] ; session mov si,[si+2] ; session.diskLocationCurrent ; push CommandProcedureReadBytesRead push si call DiskLocationSectorRead ; push CommandProcedureReadBytesRead call CommandProcedureReadDisplayAscii ; pop si pop bp ret 4 CommandProcedureReadDisplayAscii: ; (byteBuffer) ; push bp mov bp,sp push bx push cx push si ; mov si,[bp+4] ; byteBuffer ; call DisplayNewline ; mov cx,4 ForEach128BytesReadFromDiskAscii: ; push cx ; mov cx,4 ForEachThirtyTwoBytesReadFromDiskAscii: ; push cx ; mov cx,0x20 ForEachByteReadFromDiskAscii: ; mov bl,[si] mov bh,0 mov word [CommandProcedureReadStringTemp],bx ; push CommandProcedureReadStringTemp call DisplayStringWriteToConsole ; inc si ; loop ForEachByteReadFromDiskAscii ; call DisplayNewline ; pop cx ; loop ForEachThirtyTwoBytesReadFromDiskAscii ; call DisplayNewline ; pop cx ; loop ForEach128BytesReadFromDiskAscii EndCommandProcedureReadAscii: ; pop si pop cx pop bx pop bp ret 2 ; CommandProcedureReadDisplayHexadecimal: ; (byteBuffer, startIndex, numberOfBytesToDisplay) ; push bp mov bp,sp push ax push bx push cx push dx push si push di ; mov si,[bp+8] ; byteBuffer mov bx,si add bx,[bp+6] ; startIndex mov dx,bx add dx,[bp+4] ; numberOfBytesToDisplay dec dx ; call DisplayNewline ; mov cx,4 ForEach128BytesReadFromDiskHexadecimal: ; push cx ; mov cx,4 ForEachThirtyTwoBytesReadFromDiskHexadecimal: ; push cx ; mov cx,0x8 ForEachFourBytesReadFromDiskHexadecimal: ; push cx ; mov cx,4 ForEachByteReadFromDiskHexadecimal: ; ; if byte index is between specified start and end ; cmp si,bx ; startIndex jb ElseIfByteNotWithinRangeSpecified ; cmp si,dx ; endIndex ja ElseIfByteNotWithinRangeSpecified ; push CommandProcedureReadStringTemp push si ; not al push word 1 call NumberConvertToStringHexadecimal ; jmp EndIfByteIsWithinRangeSpecified ; ElseIfByteNotWithinRangeSpecified: ; push CommandProcedureReadStringTemp push StringPeriodPeriod call StringCopy ; EndIfByteIsWithinRangeSpecified: ; push CommandProcedureReadStringTemp call DisplayStringWriteToConsole ; inc si ; loop ForEachByteReadFromDiskHexadecimal ; call DisplaySpace ; pop cx ; loop ForEachFourBytesReadFromDiskHexadecimal ; call DisplayNewline ; pop cx ; loop ForEachThirtyTwoBytesReadFromDiskHexadecimal ; call DisplayNewline ; pop cx ; loop ForEach128BytesReadFromDiskHexadecimal EndCommandProcedureReadHexadecimal: ; pop di pop si pop dx pop cx pop bx pop ax pop bp ret 6 CommandProcedureReadNext: ; (session, command) push bp mov bp,sp push cx push si push di ; mov si,[bp+6] ; session ; push si push word [bp+4] call CommandProcedureRead ; push word [si+2] ; session.diskLocationCurrent call DiskLocationSectorAdvance ; pop di pop si pop cx pop bp ret 4 CommandProcedureSectorSet: ; (session, command) push bp mov bp,sp ; push word [bp+6] push word [bp+4] push word 6 push word 0x003F ; lowest 6 bits only call CommandProcedureDiskLocationComponentSet ; pop bp ret 4 CommandProcedureWrite: ; (session, command) ; ; to be fixed ; push bp mov bp,sp push ax push bx push cx push dx ; mov si,[bp+6] ; session mov si,[si+2] ; session.diskLocationCurrent ; push CommandProcedureWriteTextWrite call DisplayStringWriteToConsoleWithNewline ; mov ah,0x00 ; reset disk mov dl,[si+0] ; drive number int 0x13 ; mov ah,0x02 ; read sectors into memory mov al,1 ; numberOfSectorsToRead mov dl,[si+0] ; driveNumber mov ch,[si+2] ; cylinderNumber mov dh,[si+4] ; headNumber mov cl,[si+6] ; startingSectorNumber mov bx,CommandProcedureReadBytesRead ; returnBuffer int 0x13 ; ForEachByteToWriteToDisk: ; push CommandProcedureWriteStringPrompt call DisplayStringWriteToConsole ; push CommandProcedureWriteStringTemp push word 2 call InputStringRead ; cmp byte [CommandProcedureWriteStringTemp],0 je EndForEachByteToWriteToDisk ; mov ah,0x03 ; write sectors to disk mov al,1 ; numberOfSectorsToWrite mov dl,[si+0] ; driveNumber mov ch,[si+2] ; cylinderNumber mov dh,[si+4] ; headNumber mov cl,[si+6] ; startingSectorNumber mov bx,CommandProcedureReadBytesRead ; returnBuffer int 0x13 ; jmp ForEachByteToWriteToDisk EndForEachByteToWriteToDisk: ; pop dx pop cx pop bx pop ax pop bp ret 4 ; CommandProcedureWriteStringTemp: db '??',0 CommandProcedureWriteStringPrompt: db '-',0 CommandProcedureWriteTextWrite: db 'write',0 CommandPromptCommand: ; +0 = defn ; +2 = arguments CommandPromptDefn: ; +0 = commandDefnsAvailable CommandPromptDefnCommandDefn: ; +0 = name ; +2 = description ; +4 = procedureToCall CommandPromptSession: ; +0 = commandPromptDefn ; +2 = diskLocationCurrent ; +4 = commandCurrent ; +6 = isTerminated CommandPromptSessionRun: ; (instance) ; push bp mov bp,sp push bx push si push di ; mov si,[bp+4] ; instance mov si,[si+2] ; instance.diskLocationCurrent mov si,[si+0] ; instance.diskLocationCurrent.disk ; push si call DiskInitialize ; push si call DiskDisplay ; mov si,[bp+4] ; instance ; LoopCommandPromptSessionRun: ; mov bx,[si+2] ; instance.diskLocationCurrent mov byte [CommandPromptSessionRunStringTemp],0x00 ; push CommandPromptSessionRunStringTemp push bx call DiskLocationConvertToString ; push CommandPromptSessionRunStringTemp call DisplayStringWriteToConsole ; push StringCommandPromptTerminator call DisplayStringWriteToConsole ; push CommandPromptSessionRunUserInputString push word 22 call InputStringRead ; ; if no command was entered at the prompt ; cmp byte [CommandPromptSessionRunUserInputString],0 jne ElseIfACommandWasEntered ; ; jmp EndIfNoCommandEntered ; ElseIfACommandWasEntered: ; push word [si+4] ; returnCommand = session.commandCurrent push si ; instance push CommandPromptSessionRunUserInputString ; stringToParse call CommandPromptSessionRunParseCommandString ; EndIfNoCommandEntered: ; IfCommandEnteredIsNotValid: mov di,[si+4] ; instance.commandCurrent cmp word [di+0],0x0000 ; command.defn jne ElseCommandEnteredIsValid ; push TextCommandNotValid call DisplayStringWriteToConsoleWithNewline ; jmp EndIfCommandEnteredIsNotValid ElseCommandEnteredIsValid: ; push si ; instance mov di,[si+4] ; command push di mov di,[di+0] ; command.defn call word [di+4] ; command.defn.procedureToCall ; EndIfCommandEnteredIsNotValid: ; call DisplayNewline ; cmp word [si+6],1 je EndLoopCommandPromptSessionRun ; jmp LoopCommandPromptSessionRun EndLoopCommandPromptSessionRun: ; push CommandPromptSessionRunStringExiting call DisplayStringWriteToConsoleWithNewline ; pop di pop si pop bx pop bp ret 2 ; StringCommandPromptTerminator: db '>',0 TextCommandNotValid: db 'The text entered was not a valid command. Enter ""help"" for help.',0 CommandPromptSessionRunUserInputString: db 0x200 dup (0) CommandPromptSessionRunStringExiting: db 'Exiting...',0 CommandPromptSessionRunStringTemp: db 0x0100 dup (0) CommandPromptSessionRunParseCommandString: ; (returnCommand, instance, stringToParse) ; push bp mov bp,sp push ax push bx push si push di ; mov di,[bp+8] ; returnCommand mov ax,0x0000 stosw ; returnCommand.defn = null ; push CommandPromptSessionRunParseCommandStringTokens push word [bp+4] ; stringToParse push StringSpace call StringSplitOnDelimiter ; mov si,[bp+6] ; instance mov si,[si+0] ; instance.defn mov si,[si+0] ; instance.defn.commandDefnsAvailable ; ForEachCommandDefnAvailable: ; lodsw ; ax = commandDefnsAvailable[si], si++ ; IfNoMoreCommandDefnsAvailable: cmp ax,0x0000 je EndForEachCommandDefnAvailable ; push CommandPromptSessionRunParseCommandStringIsMatch mov bx,ax push word [bx+0] ; commandDefn.name push word [CommandPromptSessionRunParseCommandStringTokens+0] ; stringToParseTokens[0] call StringCompare ; IfCommandDefnMatches: ; cmp word [CommandPromptSessionRunParseCommandStringIsMatch],1 jne ElseCommandDefnDoesNotMatch ; mov di,[bp+8] ; returnCommand stosw ; returnCommand.defn = commandDefn mov ax,CommandPromptSessionRunParseCommandStringTokens stosw ; returnCommand.arguments jmp EndForEachCommandDefnAvailable ; break ; ElseCommandDefnDoesNotMatch: ; jmp ForEachCommandDefnAvailable EndForEachCommandDefnAvailable: ; pop di pop si pop bx pop ax pop bp ret 6 ; CommandPromptSessionRunParseCommandStringIsMatch: dw 0x0000 CommandPromptSessionRunParseCommandStringTokens: dw 0x10 dup (0) Disk: ; +0 = diskNumber ; +2 = cylinderNumberMax ; +4 = headNumberMax ; +6 = sectorNumberMax ; +8 = filesystem DiskConvertLBAToCHS: ; (returnDiskLocation, disk, lbaToConvert) ; ; converts a logical block address to a cylinder-head-sector address ; push bp mov bp,sp push ax push bx push cx push dx push si push di ; mov si,[bp+6] ; disk mov di,[bp+8] ; returnDiskLocation ; mov [di+0],si ; returnDiskLocation.disk ; mov dx,0 ; dx is upper 16 bits of dividend for div instruction mov ax,[bp+4] ; lbaToConvert ; mov cx,[si+6] ; disk.sectorNumberMax div cx ; ax = ax / disk.sectorNumberMax, dx = remainder mov [di+6],dx ; returnDiskLocation.sector ; mov cx,[si+4] ; disk.headNumberMax inc cx ; total number of heads ; mov dx,0 ; dx is upper 16 bits of dividend for div instruction div cx ; ax = ax / number of heads, dx = remainder mov [di+4],dx ; returnDiskLocation.head mov [di+2],ax ; returnDiskLocation.cylinder ; pop di pop si pop dx pop cx pop bx pop ax pop bp ret 6 ; NumberTemp dw 0 StringTemp: db 'nnnn',0 DiskDisplay: ; (disk) push bp mov bp,sp push ax push bx push cx push dx push es push si push di ; mov si,[bp+4] ; disk ; call DisplayNewline ; push TextDiskNumber call DisplayStringWriteToConsole ; mov bx,[si+0] ; disk.diskNumber mov [DiskDisplay_NumberTemp],bx push DiskDisplay_StringTemp push DiskDisplay_NumberTemp push word 1 call NumberConvertToStringHexadecimal ; push DiskDisplay_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextMaximumCylinderNumber call DisplayStringWriteToConsole ; mov bx,[si+2] ; disk.cylinderNumberMax mov [DiskDisplay_NumberTemp],bx push DiskDisplay_StringTemp push DiskDisplay_NumberTemp push word 2 call NumberConvertToStringHexadecimal ; push DiskDisplay_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextMaximumHeadNumber call DisplayStringWriteToConsole ; mov bx,[si+4] ; disk.headNumberMax mov [DiskDisplay_NumberTemp],bx push DiskDisplay_StringTemp push DiskDisplay_NumberTemp push word 1 call NumberConvertToStringHexadecimal ; push DiskDisplay_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextMaximumSectorNumber call DisplayStringWriteToConsole ; mov bx,[si+6] ; disk.sectorNumberMax mov [DiskDisplay_NumberTemp],bx push DiskDisplay_StringTemp push DiskDisplay_NumberTemp push word 2 call NumberConvertToStringHexadecimal ; push DiskDisplay_StringTemp call DisplayStringWriteToConsoleWithNewline ; call DisplayNewline ; mov si,[si+8] ; disk.filesystem push si mov si,[si+0] ; disk.filesystem.defn call word [si+2] ; disk.filesystem.defn.methodDescribe ; call DisplayNewline ; pop di pop si pop es pop dx pop cx pop bx pop ax pop bp ret 2 ; DiskDisplay_StringTemp: db 'nnnn',0 DiskDisplay_NumberTemp: dw 0 TextDiskNumber: db 'Disk Number : ',0 TextMaximumHeadNumber: db 'Maximum Head Number : ',0 TextMaximumCylinderNumber: db 'Maximum Cylinder Number: ',0 TextMaximumSectorNumber: db 'Maximum Sector Number : ',0 DiskInitialize: ; (disk) push bp mov bp,sp push ax push bx push cx push dx push es push si push di ; mov si,[bp+4] ; disk ; push es mov bx,0 mov es,bx ; ""to guard against BIOS bugs"" ; mov ah,0x08 ; read drive parameters mov bx,si ; disk mov dl,[bx+0] ; disk.diskNumber mov di,0 ; ""to guard against BIOS bugs"" int 0x13 ; pop es ; ; if the read failed ; jnc EndIfDiskParametersReadFailed ; push DiskInitialize_StringError call DisplayStringWriteToConsoleWithNewline ; jmp EndCommandProcedureDiskInitialize ; EndIfDiskParametersReadFailed: ; mov bx,cx push bx ; mov cx,8 ror bx,cl rol bh,1 ; move the two highest bits to two lowest of byte rol bh,1 and bx,0x03FF ; low 10 bits only mov [si+2],bx ; disk.cylinderNumberMax ; pop bx ; mov [si+4],dh ; disk.headNumberMax ; and bx,0x3F ; low 6 bits mov [si+6],bx ; disk.sectorNumberMax ; ; hack: filesystem currently hardcoded ; mov [DiskInitialize_DiskLocationBootSector+0],si ; mov word [si+8],CommandPromptSession0DiskFilesystem ; mov si,[si+8] ; disk.filesystem mov si,[si+2] ; disk.filesystem.bootSectorBytes ; push si ; disk.filesystem.bootSectorBytes push DiskInitialize_DiskLocationBootSector call DiskLocationSectorRead ; EndCommandProcedureDiskInitialize: ; pop di pop si pop es pop dx pop cx pop bx pop ax pop bp ret 2 ; DiskInitialize_DiskLocationBootSector: dw 0, 0, 0, 1, 0 DiskInitialize_StringError: db 'An error occurred while attempting to read disk parameters.',0 DiskLocation: ; +0 = disk ; +2 = cylinderNumber ; +4 = headNumber ; +6 = sectorNumber ; +8 = byteOffsetWithinSector DiskLocationConvertToString: ; (returnString, diskLocationToConvert) ; push bp mov bp,sp push bx push cx push si ; mov si,[bp+4] ; diskLocationToConvert ; mov bx,2 ; offset of string representation of component ; push word [DiskLocationConvertToStringArrayTemp+bx] push word [si+0] ; diskLocationToConvert.disk.diskNumber push word 2 call NumberConvertToStringHexadecimal ; add bx,4 add si,2 mov cx,3 ForEachDiskLocationComponent: ; push word [DiskLocationConvertToStringArrayTemp+bx] push word si ; diskLocationToConvert.[component] push word 2 call NumberConvertToStringHexadecimal ; add si,2 add bx,4 ; loop ForEachDiskLocationComponent ; push word [bp+6] ; returnString push DiskLocationConvertToStringArrayTemp push StringColon call StringJoinMany ; pop si pop cx pop bx pop bp ret 4 ; DiskLocationConvertToStringArrayTemp: dw TextD,StringDiskNumber,TextC,StringCylinderNumber,TextH,StringHeadNumber,TextS,StringSectorNumber,0 StringDiskNumber: db '0000',0 StringCylinderNumber: db '0000',0 StringHeadNumber: db '0000',0 StringSectorNumber: db '0000',0 StringColon: db ':',0 TextD: db 'D',0 TextC: db 'C',0 TextH: db 'H',0 TextNN: db 'nn',0 TextS: db 'S',0 TextXX: db 'xx',0 DiskLocationSectorRead: ; (returnByteBuffer, instance) push bp mov bp,sp push ax push bx push cx push dx push si ; mov si,[bp+4] ; instance ; mov ah,0x00 ; reset disk mov dl,[si+0] ; drive number int 0x13 ; mov ah,0x02 ; read sectors into memory mov al,1 ; numberOfSectorsToRead mov bx,[si+0] ; drive mov bx,[bx+0] ; drive.driveNumber mov dl,bl ; mov bx,[si+2] ; cylinderNumber mov ch,bl ; cylinderNumber (low 8 bits) mov cl,bh ; cylinderNumber (high 2 bits) and cl,0x03 ; mask all except low two bits ror cl,1 ; shift the lowest two bits to the highest two positions ror cl,1 ; ; mov dh,[si+4] ; headNumber or cl,[si+6] ; startingSectorNumber mov bx,[bp+6] ; returnByteBuffer int 0x13 ; ; if there was an error during read ; jnc EndIfErrorOnSectorRead ; push TextErrorOccurredDuringReadAttempt call DisplayStringWriteToConsoleWithNewline ; jmp EndIfErrorOnSectorRead ; EndIfErrorOnSectorRead: ; pop si pop dx pop cx pop bx pop ax pop bp ret 4 ; TextErrorOccurredDuringReadAttempt: db 'An error occurred during the read attempt.',0 DiskLocationSectorAdvance: ; (diskLocation) ; push bp mov bp,sp push cx push si push di ; mov si,[bp+4] ; diskLocation mov di,[si+0] ; diskLocation.disk ; inc word [si+6] ; diskLocation.sector++ mov word [si+8],0 ; diskLocation.byteOffsetWithinSector = 0 ; ; if sector is out of range ; mov cx,[di+6] cmp word [si+6],cx jbe EndDiskLocationSectorAdvance ; mov word [si+6],1 ; sector = 1 inc word [si+4] ; head++ ; ; if head is out of range ; mov cx,[di+4] cmp word [si+4],cx jbe EndDiskLocationSectorAdvance ; mov word [si+4],0 ; head = 0 inc word [si+2] ; cylinder++ ; ; if cylinder is out of range ; mov cx,[di+2] cmp word [si+2],cx jbe EndDiskLocationSectorAdvance ; mov word [si+2],0 ; cylinder = 0 ; EndDiskLocationSectorAdvance: ; pop di pop si pop cx pop bp ; ret 2 DisplayNewline: ; push StringNewline call DisplayStringWriteToConsole ret ; StringNewline: db 0x0D,0x0A,0 DisplaySpace: ; push StringSpace call DisplayStringWriteToConsole ret ; StringSpace: db ' ',0 DisplayTab: ; push StringTab call DisplayStringWriteToConsole ret ; StringTab: db ' ',0 DisplayCharacterWriteToConsole: ; (charToWrite) ; push bp mov bp,sp push ax ; mov al,[bp+4] ; charToWrite ; mov ah,0x0E ; write character in teletype mode int 0x10 ; pop ax pop bp ret 2 DisplayBackspace: push ax push bx push cx push dx ; mov ah,0x03 ; get the cursor position mov bh,0x00 ; page 0 int 0x10 ; dec dl ; cursorPos.x-- ; mov ah,0x02 ; set the cursor position back mov bh,0x00 ; page 0 int 0x10 ; call DisplaySpace ; mov ah,0x02 ; set the cursor position back (again) mov bh,0x00 ; page 0 int 0x10 ; pop dx pop cx pop bx pop ax ret DisplayStringWriteToConsole: ; (stringToWrite) ; push bp mov bp,sp push ax push si ; mov si,[bp+4] ; stringToWrite ; mov ah,0x0E ; write character in teletype mode ; ForEachChar: lodsb cmp al,0x00 je EndForEachChar int 0x10 jmp ForEachChar EndForEachChar: ; pop si pop ax pop bp ret 2 DisplayStringWriteToConsoleWithNewline: ; (stringToWrite) ; pop word [DisplayStringWriteToConsoleWithNewlineReturnAddress] ; call DisplayStringWriteToConsole call DisplayNewline ; push word [DisplayStringWriteToConsoleWithNewlineReturnAddress] ret ; DisplayStringWriteToConsoleWithNewlineReturnAddress: dw 0x0000 Filesystem: ; +0 = defn ; +2 = bootSectorBytes FilesystemDefn: ; +0 = name ; +2 = methodDescribe ; +4 = methodConvertLBAToCHS ret FilesystemDefnFAT16: dw FilesystemDefnFAT16Name, FilesystemDefnFAT16Describe FilesystemDefnFAT16Name: db 'FAT16',0 FilesystemDefnFAT16Describe: ; (filesystem) push bp mov bp,sp push ax push bx push cx push dx push si ; mov si,[bp+4] ; filesystem mov si,[si+2] ; filesystem.bootSectorBytes ; push TextFilesystemType call DisplayStringWriteToConsole ; push TextFAT16 call DisplayStringWriteToConsoleWithNewline ; push TextBytesPerSector call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si ; filesystem.bootSectorBytes add bx,0x0B push bx push word 2 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextSectorsPerCluster call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si add bx,0x0D push bx push word 1 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextReservedSectors call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si add bx,0x0E push bx push word 2 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextNumberOfFATs call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si add bx,0x10 push bx push word 1 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextRootDirectoryEntriesMax call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si add bx,0x11 push bx push word 2 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextSectorsTotal call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si add bx,0x20 push bx push word 4 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextSectorsPerFAT call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si add bx,0x16 push bx push word 2 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextSectorsPerTrack call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si add bx,0x18 push bx push word 2 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextNumberOfHeads call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si add bx,0x1A push bx push word 2 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextNumberOfHiddenSectors call DisplayStringWriteToConsole ; push CommandProcedureFilesystem_StringTemp mov bx,si add bx,0x1C push bx push word 4 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextRootDirectorySector call DisplayStringWriteToConsole ; mov bx,si add bx,0x10 ; numberOfFATs mov cx,[bx] mov bx,si add bx,0x16 ; sectorsPerFAT mov ax,[bx] mul cl mov bx,si add bx,0x0E ; reservedSectors add ax,[bx] ; ; hidden sectors don't seem to count ; add ax,1 ; for the boot sector ; mov [CommandProcedureFilesystem_NumberTemp],ax ; push CommandProcedureFilesystem_StringTemp push CommandProcedureFilesystem_NumberTemp push word 2 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; push TextDataStartingSector call DisplayStringWriteToConsole ; ; ax still contains the root directory sector mov bx,si add bx,0x11 ; maximum root directory entries mov bx,[bx] push ax mov ax,bx mov cx,0x20 ; 32 bytes per directory entry mul cx mov cx,0x0200 ; hack: 512 bytes per sector div cx mov bx,ax pop ax add ax,bx ; mov bx,si add bx,0x1C mov bx,[bx] ; hidden sectors ;add ax,bx ; mov [CommandProcedureFilesystem_NumberTemp],ax ; push CommandProcedureFilesystem_StringTemp push CommandProcedureFilesystem_NumberTemp push word 2 call NumberConvertToStringHexadecimal ; push CommandProcedureFilesystem_StringTemp call DisplayStringWriteToConsoleWithNewline ; pop si pop dx pop cx pop bx pop ax pop bp ret 2 ; CommandProcedureFilesystem_NumberTemp: dw 0x1234 CommandProcedureFilesystem_StringTemp: db 'nnnnnnnn',0 TextBytesPerSector: db 'Bytes per Sector : ',0 TextDataStartingSector: db 'Data Starting Sector : ',0 TextFAT16: db 'FAT16',0 TextFilesystemType: db 'Filesystem Type : ',0 TextReservedSectors: db 'Reserved Sectors : ',0 TextNumberOfFATs: db 'FATs : ',0 TextNumberOfHeads: db 'Heads : ',0 TextNumberOfHiddenSectors: db 'Hidden Sectors : ',0 TextRootDirectoryEntriesMax: db 'Root Dir Entries Max : ',0 TextRootDirectorySector: db 'Root Dir Sector : ',0 TextSectorsPerCluster: db 'Sectors per Cluster : ',0 TextSectorsTotal: db 'Sectors Total : ',0 TextSectorsPerFAT: db 'Sectors per FAT : ',0 TextSectorsPerTrack: db 'Sectors per Track : ',0 InputKeyPressed: db 0x00,0x00 InputKeyRead: push ax ; mov ah,0x01 ; check for keystroke int 0x16 ; jz EndIfKeyPressed ; mov [InputKeyPressed],al ; mov ah,0x00 ; remove the keystroke from the buffer int 0x16 ; EndIfKeyPressed: ; pop ax ret InputStringRead: ; (returnString, numberOfCharactersMax) ; push bp mov bp,sp push ax push bx push cx push di ; mov di,[bp+6] ; returnString mov cx,0 ; WhileCharEnteredIsNotReturn: ; call InputKeyRead ; mov ax,[InputKeyPressed] mov word [InputKeyPressed],0x0000 cmp al,0x00 je NoKeyPressed ; IfKeyReturn: cmp al,0xD jne IfKeyBackspace ; mov al,0x00 stosb ; call DisplayNewline ; jmp EndWhileCharEnteredIsNotReturn IfKeyBackspace: cmp al,0x8 jne IfKeyOther ; ; IfNotAtBeginningOfLineAlready: cmp di,[bp+6] jle EndIfNotAtBeginningOfLineAlready ; dec di ; back up the cursor dec cx ; call DisplayBackspace ; EndIfNotAtBeginningOfLineAlready: ; jmp EndIfKey IfKeyOther: cmp word cx,[bp+4] ; numberOfCharactersMax jae WhileCharEnteredIsNotReturn ; push ax call DisplayCharacterWriteToConsole stosb ; inc cx ; EndIfKey: ; NoKeyPressed: ; jmp WhileCharEnteredIsNotReturn EndWhileCharEnteredIsNotReturn: ; pop di pop cx pop bx pop ax pop bp ret 4 NumberConvertToStringHexadecimal: ; (returnString, addressOfValueToConvert, numberOfBytesToConvert) ; push bp mov bp,sp push ax push bx push cx push dx push si push di ; mov si,[bp+6] ; addressOfValueToConvert ; mov di,[bp+8] ; di = returnString add di,[bp+4] ; add di,[bp+4] ; di = end of string (2 chars per byte) dec di ; account for null terminator ; mov cx,[bp+4] ; numberOfBytesToConvert ForEachByte: ; push cx lodsb ; ax = byte to convert, si = next byte mov cx,0x0002 ; nibbles per byte std ; reverse direction ForEachNibble: ; push ax ; save the original byte value ; ; shift bits 4 over if on second nibble cmp cx,0x0001 jne DoNotShift shr ax,1 shr ax,1 shr ax,1 shr ax,1 DoNotShift: ; and ax,0x000F ; mask all but last 4 bits ; cmp ax,0x000A jb EndIfNibbleGreaterThan9 ; if nibble > 9 add ax,0x0007 ; jump from numerals to letters EndIfNibbleGreaterThan9: add ax,0x0030 ; ascii '0' ; stosb ; returnValue += nibble char, di-- ; pop ax ; restore the original byte value ; loop ForEachNibble cld ; restore forward direction pop cx ; loop ForEachByte ; append a null mov di,[bp+8] ; di = returnString add di,[bp+4] add di,[bp+4] ; di = end of string (2 chars per byte) mov ax,0x0000 stosb ; pop di pop si pop dx pop cx pop bx pop ax pop bp ret 6 NumberParseFromString: ; (returnValue, stringToParse) push bp mov bp,sp push ax push cx push dx push si push di ; mov dx,0 ; returnValue = 0 ; mov si,[bp+4] ; stringToParse mov ax,0 ; ForEachCharInStringToParse: ; lodsb ; cmp al,0 je EndForEachCharInStringToParse ; ; if digit to parse is a lowercase letter cmp al,0x60 jb EndIfDigitToParseIsLowercase ; sub al,0x20 ; make it uppercase ; EndIfDigitToParseIsLowercase: ; ; if digit to parse is a letter cmp al,0x40 jb EndIfDigitToParseIsAOrGreater ; sub ax,0x7 ; jump from ascii letters back to numerals ; EndIfDigitToParseIsAOrGreater: ; sub al,0x30 ; ascii code of 0 ; mov cx,4 shl dx,cl ; add dx,ax ; jmp ForEachCharInStringToParse EndForEachCharInStringToParse: ; mov di,[bp+6] ; returnValue mov [di],dx ; returnValue = dx ; pop di pop si pop dx pop cx pop ax pop bp ret 4 StringAppend: ; (stringToAppendTo, stringToAppend) push bp mov bp,sp push ax push cx push si push di ; push StringAppendLengthOriginal push word [bp+6] ; stringToAppendTo call StringLength ; mov cx,[StringAppendLengthOriginal] mov si,[bp+6] ; stringToAppendTo rep lodsb ; push StringAppendLengthOriginal push word [bp+4] ; stringToAppend call StringLength ; mov di,si ; di = end of stringToAppendTo mov si,[bp+4] ; si = stringToAppend mov cx,[StringAppendLengthOriginal] rep movsb ; pop di pop si pop cx pop ax pop bp ret 4 ; StringAppendLengthOriginal: dw 0x0000 StringCompare: ; (returnValue, string0, string1) ; ; push bp mov bp,sp push ax push bx push cx push si push di ; mov di,[bp+8] mov word [di],0 ; returnValue = false ; mov si,[bp+6] ; string0 mov di,[bp+4] ; string1 ; ; determine the length of string0 first (hack) ; also, now that StringLength exists, should use that ; mov bx,si FindLength: lodsb cmp al,0x00 jne FindLength mov cx,si sub cx,bx mov si,bx ; reset si ; inc cx ; repe cmpsb ; mov di,[bp+8] ; ; if strings are equal cmp cx,0 jne ElseStringsAreNotEqual ; mov word [di],1 ; returnValue = true ; jmp EndIfStringsAreEqual ; ElseStringsAreNotEqual: ; mov word [di],0 ; returnValue = false ; EndIfStringsAreEqual: ; pop di pop si pop cx pop bx pop ax pop bp ret 6 StringCopy: ; (returnValue, stringToCopyFrom) push bp mov bp,sp push ax push si push di ; mov si,[bp+4] ; stringToCopyFrom mov di,[bp+6] ; returnValue ; ForEachCharStringCopy: lodsb stosb cmp al,0x00 je EndForEachCharStringCopy ; if char is null, break jmp ForEachCharStringCopy EndForEachCharStringCopy: ; pop di pop si pop ax pop bp ret 4 StringJoinMany: ; (returnString, stringsToJoin, delimiter) push bp mov bp,sp push ax push dx push si push di ; mov si,[bp+4] ; delimiter mov dx,[si] ; single delimiter for now mov si,[bp+6] ; stringsToJoin mov di,[bp+8] ; returnString ForEachStringToJoin: lodsw cmp ax,0x0000 je EndForEachStringToJoin ; if string is null, break ; else push si mov si,ax ; first char of string to join ForEachCharInStringToJoin: lodsb cmp al,0x00 jne ElseFESTJ ; if char is null mov ax,dx ; delimiter stosb jmp EndForEachCharInStringToJoin ElseFESTJ: stosb ; endIf jmp ForEachCharInStringToJoin EndForEachCharInStringToJoin: pop si ;endIf jmp ForEachStringToJoin EndForEachStringToJoin: ; terminate with a null mov al,0x00 stosb ; pop di pop si pop dx pop ax pop bp ret 6 StringLength: ; (returnValue, stringToFindLengthOf) ; ; push bp mov bp,sp push ax push bx push cx push si ; mov si,[bp+4] ; stringToFindLengthOf mov bx,si FindStringLength: lodsb cmp al,0x00 jne FindStringLength mov cx,si sub cx,bx sub cx,0x0001 ; don't count the terminating null ; mov si,[bp+6] ; returnValue mov [si+0],cx ; returnValue (or returnValue.x) = cx ; pop si pop cx pop bx pop ax pop bp ret 4 StringPrepend: ; (stringToPrependTo, stringToPrepend) push bp mov bp,sp push ax push cx push dx push si push di ; push StringPrependLengthOriginal push word [bp+6] ; stringToPrependTo call StringLength mov cx,[StringPrependLengthOriginal] ; push StringPrependLengthOriginal push word [bp+4] ; stringToPrepend call StringLength mov dx,[StringPrependLengthOriginal] ; not counting the null terminator yet ; mov si,[bp+6] ; stringToPrependTo add si,cx ; advance to end of stringToPrependTo mov di,si add di,dx ; advance even further to make room for stringToPrepend inc cx ; std ; reverse direction rep movsb ; shift the stringToPrependTo forward by stringToPrepend.length cld ; forward direction ; mov si,[bp+4] ; stringToPrepend mov di,[bp+6] ; stringToPrependTo mov cx,dx ; stringToPrepend.length inc dx rep movsb ; pop di pop si pop dx pop cx pop ax pop bp ret 4 ; StringPrependLengthOriginal: dw 0x0000 StringSplitOnDelimiter: ; (returnStringArray, stringToSplit, delimiter) ; ; modifies the original string ; push bp mov bp,sp push ax push bx push si push di ; mov bx,[bp+4] ; delimiter mov bx,[bx] ; single delimiter for now mov si,[bp+6] ; stringToSplit mov di,[bp+8] ; returnStringArray ; mov ax,si stosw ; returnStrings[0] = stringToParse[0], di++ ; ForEachCharInStringToSplit: lodsb ; IfCharIsNull: cmp al,0x00 je EndForEachCharInStringToSplit ; break ; ElseIfCharIsDelimiter: cmp al,bl ; delimiter jne EndIfCharIsDelimiter ; mov ax,si ; returnStrings[di] = beginning of next string, di++ stosw ; push di ; mov di,si ; in the original string dec di mov al,0x00 stosb ; replace the delimiter with a null ; pop di ; EndIfCharIsDelimiter: jmp ForEachCharInStringToSplit EndForEachCharInStringToSplit: ; mov ax,0x0000 ; terminate returnStrings with a null stosw ; pop di pop si pop bx pop ax pop bp ret 6 PadOutWithZeroesSectorsThreeThroughN: times ((0x2000) - ($ - $$)) db 0x00 EndOfSectorsThreeThroughN: ",16134,True,3318.062111863107,median "[MusicConfig] Location=434334 Electus - Whispers From The Sea/audio.mp3 Extension=mp3 MD5=67‌​3b‌​28‌​f3‌​1c‌​29‌​18‌​a0‌​3d‌​46‌​20‌​e0‌​50‌​bf‌​73‌​90 Source=OSU MetreNumber=4 Title=Whispers From The Sea [TagConfig] Tagger=Carra Time=2017/3/20 21:58:50 Confidence=1 [MiscConfig] LinkedFile=434334 Electus - Whispers From The Sea/Electus - Whispers From The Sea (deetz) [advanced].osu osuMapID=434334 [BeatInfo] Count=405 Beat_0={0.04,1,?,N} Beat_1={0.501538461538462,0,?,N} Beat_2={0.963076923076924,0,?,N} Beat_3={1.424615384615386,0,?,N} Beat_4={1.8861538461538481,1,?,N} Beat_5={2.34769230769231,0,?,N} Beat_6={2.8092307692307719,0,?,N} Beat_7={3.270769230769234,0,?,N} Beat_8={3.7323076923076961,1,?,N} Beat_9={4.1938461538461578,0,?,N} Beat_10={4.65538461538462,0,?,N} Beat_11={5.116923076923082,0,?,N} Beat_12={5.5784615384615437,1,?,N} Beat_13={6.0400000000000063,0,?,N} Beat_14={6.5015384615384679,0,?,N} Beat_15={6.9630769230769305,0,?,N} Beat_16={7.4246153846153922,1,?,N} Beat_17={7.8861538461538538,0,?,N} Beat_18={8.3476923076923146,0,?,N} Beat_19={8.8092307692307781,0,?,N} Beat_20={9.27076923076924,1,?,N} Beat_21={9.7323076923077014,0,?,N} Beat_22={10.193846153846163,0,?,N} Beat_23={10.655384615384625,0,?,N} Beat_24={11.116923076923087,1,?,N} Beat_25={11.57846153846155,0,?,N} Beat_26={12.040000000000012,0,?,N} Beat_27={12.501538461538473,0,?,N} Beat_28={12.963076923076935,1,?,N} Beat_29={13.424615384615397,0,?,N} Beat_30={13.88615384615386,0,?,N} Beat_31={14.347692307692322,0,?,N} Beat_32={14.809230769230783,1,?,N} Beat_33={15.270769230769245,0,?,N} Beat_34={15.732307692307707,0,?,N} Beat_35={16.19384615384617,0,?,N} Beat_36={16.65538461538463,1,?,N} Beat_37={17.116923076923094,0,?,N} Beat_38={17.578461538461557,0,?,N} Beat_39={18.040000000000017,0,?,N} Beat_40={18.50153846153848,1,?,N} Beat_41={18.96307692307694,0,?,N} Beat_42={19.424615384615404,0,?,N} Beat_43={19.886153846153867,0,?,N} Beat_44={20.347692307692327,1,?,N} Beat_45={20.809230769230791,0,?,N} Beat_46={21.27076923076925,0,?,N} Beat_47={21.732307692307714,0,?,N} Beat_48={22.193846153846174,1,?,N} Beat_49={22.655384615384637,0,?,N} Beat_50={23.1169230769231,0,?,N} Beat_51={23.578461538461561,0,?,N} Beat_52={24.040000000000024,1,?,N} Beat_53={24.501538461538484,0,?,N} Beat_54={24.963076923076947,0,?,N} Beat_55={25.424615384615411,0,?,N} Beat_56={25.886153846153871,1,?,N} Beat_57={26.347692307692334,0,?,N} Beat_58={26.809230769230794,0,?,N} Beat_59={27.270769230769258,0,?,N} Beat_60={27.732307692307721,1,?,N} Beat_61={28.193846153846181,0,?,N} Beat_62={28.655384615384644,0,?,N} Beat_63={29.116923076923104,0,?,N} Beat_64={29.578461538461568,1,?,N} Beat_65={30.040000000000031,0,?,N} Beat_66={30.501538461538491,0,?,N} Beat_67={30.963076923076954,0,?,N} Beat_68={31.424615384615414,1,?,N} Beat_69={31.886153846153878,0,?,N} Beat_70={32.347692307692341,0,?,N} Beat_71={32.8092307692308,0,?,N} Beat_72={33.270769230769261,1,?,N} Beat_73={33.732307692307728,0,?,N} Beat_74={34.193846153846188,0,?,N} Beat_75={34.655384615384648,0,?,N} Beat_76={35.116923076923115,1,?,N} Beat_77={35.578461538461575,0,?,N} Beat_78={36.040000000000035,0,?,N} Beat_79={36.501538461538495,0,?,N} Beat_80={36.963076923076962,1,?,N} Beat_81={37.424615384615421,0,?,N} Beat_82={37.886153846153881,0,?,N} Beat_83={38.347692307692348,0,?,N} Beat_84={38.809230769230808,1,?,N} Beat_85={39.270769230769268,0,?,N} Beat_86={39.732307692307735,0,?,N} Beat_87={40.193846153846195,0,?,N} Beat_88={40.655384615384655,1,?,N} Beat_89={41.116923076923115,0,?,N} Beat_90={41.578461538461582,0,?,N} Beat_91={42.040000000000042,0,?,N} Beat_92={42.5015384615385,1,?,N} Beat_93={42.963076923076969,0,?,N} Beat_94={43.424615384615429,0,?,N} Beat_95={43.886153846153888,0,?,N} Beat_96={44.347692307692348,1,?,N} Beat_97={44.809230769230815,0,?,N} Beat_98={45.270769230769275,0,?,N} Beat_99={45.732307692307735,0,?,N} Beat_100={46.1938461538462,1,?,N} Beat_101={46.655384615384662,0,?,N} Beat_102={47.116923076923122,0,?,N} Beat_103={47.578461538461589,0,?,N} Beat_104={48.040000000000049,1,?,N} Beat_105={48.501538461538509,0,?,N} Beat_106={48.963076923076969,0,?,N} Beat_107={49.424615384615436,0,?,N} Beat_108={49.886153846153896,1,?,N} Beat_109={50.347692307692355,0,?,N} Beat_110={50.809230769230822,0,?,N} Beat_111={51.270769230769282,0,?,N} Beat_112={51.732307692307742,1,?,N} Beat_113={52.193846153846209,0,?,N} Beat_114={52.655384615384669,0,?,N} Beat_115={53.116923076923129,0,?,N} Beat_116={53.578461538461589,1,?,N} Beat_117={54.040000000000056,0,?,N} Beat_118={54.501538461538516,0,?,N} Beat_119={54.963076923076976,0,?,N} Beat_120={55.424615384615443,1,?,N} Beat_121={55.8861538461539,0,?,N} Beat_122={56.347692307692363,0,?,N} Beat_123={56.80923076923083,0,?,N} Beat_124={57.270769230769289,1,?,N} Beat_125={57.732307692307749,0,?,N} Beat_126={58.193846153846209,0,?,N} Beat_127={58.655384615384676,0,?,N} Beat_128={59.116923076923136,1,?,N} Beat_129={59.578461538461596,0,?,N} Beat_130={60.040000000000063,0,?,N} Beat_131={60.501538461538523,0,?,N} Beat_132={60.963076923076983,1,?,N} Beat_133={61.424615384615443,0,?,N} Beat_134={61.88615384615391,0,?,N} Beat_135={62.34769230769237,0,?,N} Beat_136={62.80923076923083,1,?,N} Beat_137={63.2707692307693,0,?,N} Beat_138={63.732307692307756,0,?,N} Beat_139={64.193846153846224,0,?,N} Beat_140={64.655384615384691,1,?,N} Beat_141={65.116923076923143,0,?,N} Beat_142={65.57846153846161,0,?,N} Beat_143={66.040000000000077,0,?,N} Beat_144={66.50153846153853,1,?,N} Beat_145={66.963076923077,0,?,N} Beat_146={67.424615384615464,0,?,N} Beat_147={67.886153846153917,0,?,N} Beat_148={68.347692307692384,1,?,N} Beat_149={68.809230769230851,0,?,N} Beat_150={69.2707692307693,0,?,N} Beat_151={69.732307692307771,0,?,N} Beat_152={70.193846153846238,1,?,N} Beat_153={70.655384615384691,0,?,N} Beat_154={71.116923076923158,0,?,N} Beat_155={71.578461538461625,0,?,N} Beat_156={72.040000000000077,1,?,N} Beat_157={72.501538461538544,0,?,N} Beat_158={72.963076923077,0,?,N} Beat_159={73.424615384615464,0,?,N} Beat_160={73.886153846153931,1,?,N} Beat_161={74.347692307692384,0,?,N} Beat_162={74.809230769230851,0,?,N} Beat_163={75.270769230769318,0,?,N} Beat_164={75.732307692307771,1,?,N} Beat_165={76.193846153846238,0,?,N} Beat_166={76.6553846153847,0,?,N} Beat_167={77.116923076923158,0,?,N} Beat_168={77.578461538461625,1,?,N} Beat_169={78.040000000000092,0,?,N} Beat_170={78.501538461538544,0,?,N} Beat_171={78.963076923077011,0,?,N} Beat_172={79.424615384615478,1,?,N} Beat_173={79.886153846153931,0,?,N} Beat_174={80.3476923076924,0,?,N} Beat_175={80.809230769230851,0,?,N} Beat_176={81.270769230769318,1,?,N} Beat_177={81.732307692307785,0,?,N} Beat_178={82.193846153846238,0,?,N} Beat_179={82.6553846153847,0,?,N} Beat_180={83.116923076923172,1,?,N} Beat_181={83.578461538461625,0,?,N} Beat_182={84.040000000000092,0,?,N} Beat_183={84.501538461538559,0,?,N} Beat_184={84.963076923077011,1,?,N} Beat_185={85.424615384615478,0,?,N} Beat_186={85.886153846153945,0,?,N} Beat_187={86.3476923076924,0,?,N} Beat_188={86.809230769230865,1,?,N} Beat_189={87.270769230769332,0,?,N} Beat_190={87.732307692307785,0,?,N} Beat_191={88.193846153846252,0,?,N} Beat_192={88.6553846153847,1,?,N} Beat_193={89.116923076923172,0,?,N} Beat_194={89.578461538461639,0,?,N} Beat_195={90.040000000000092,0,?,N} Beat_196={90.501538461538559,1,?,N} Beat_197={90.963076923077026,0,?,N} Beat_198={91.424615384615478,0,?,N} Beat_199={91.886153846153945,0,?,N} Beat_200={92.347692307692412,1,?,N} Beat_201={92.809230769230865,0,?,N} Beat_202={93.270769230769332,0,?,N} Beat_203={93.7323076923078,0,?,N} Beat_204={94.193846153846252,1,?,N} Beat_205={94.655384615384719,0,?,N} Beat_206={95.116923076923186,0,?,N} Beat_207={95.578461538461639,0,?,N} Beat_208={96.0400000000001,1,?,N} Beat_209={96.501538461538573,0,?,N} Beat_210={96.963076923077026,0,?,N} Beat_211={97.424615384615493,0,?,N} Beat_212={97.886153846153945,1,?,N} Beat_213={98.347692307692412,0,?,N} Beat_214={98.809230769230879,0,?,N} Beat_215={99.270769230769332,0,?,N} Beat_216={99.7323076923078,1,?,N} Beat_217={100.19384615384627,0,?,N} Beat_218={100.65538461538472,0,?,N} Beat_219={101.11692307692319,0,?,N} Beat_220={101.57846153846165,1,?,N} Beat_221={102.04000000000011,0,?,N} Beat_222={102.50153846153857,0,?,N} Beat_223={102.96307692307704,0,?,N} Beat_224={103.42461538461549,1,?,N} Beat_225={103.88615384615396,0,?,N} Beat_226={104.34769230769243,0,?,N} Beat_227={104.80923076923088,0,?,N} Beat_228={105.27076923076935,1,?,N} Beat_229={105.7323076923078,0,?,N} Beat_230={106.19384615384627,0,?,N} Beat_231={106.65538461538473,0,?,N} Beat_232={107.11692307692319,1,?,N} Beat_233={107.57846153846165,0,?,N} Beat_234={108.04000000000012,0,?,N} Beat_235={108.50153846153857,0,?,N} Beat_236={108.96307692307704,1,?,N} Beat_237={109.42461538461551,0,?,N} Beat_238={109.88615384615396,0,?,N} Beat_239={110.34769230769243,0,?,N} Beat_240={110.80923076923089,1,?,N} Beat_241={111.27076923076935,0,?,N} Beat_242={111.73230769230781,0,?,N} Beat_243={112.19384615384628,0,?,N} Beat_244={112.65538461538473,1,?,N} Beat_245={113.1169230769232,0,?,N} Beat_246={113.57846153846167,0,?,N} Beat_247={114.04000000000012,0,?,N} Beat_248={114.50153846153859,1,?,N} Beat_249={114.96307692307704,0,?,N} Beat_250={115.42461538461551,0,?,N} Beat_251={115.88615384615397,0,?,N} Beat_252={116.34769230769243,1,?,N} Beat_253={116.80923076923089,0,?,N} Beat_254={117.27076923076936,0,?,N} Beat_255={117.73230769230781,0,?,N} Beat_256={118.19384615384628,1,?,N} Beat_257={118.65538461538475,0,?,N} Beat_258={119.1169230769232,0,?,N} Beat_259={119.57846153846167,0,?,N} Beat_260={120.04000000000013,1,?,N} Beat_261={120.50153846153859,0,?,N} Beat_262={120.96307692307705,0,?,N} Beat_263={121.42461538461552,0,?,N} Beat_264={121.88615384615397,1,?,N} Beat_265={122.34769230769244,0,?,N} Beat_266={122.80923076923089,0,?,N} Beat_267={123.27076923076936,0,?,N} Beat_268={123.73230769230783,1,?,N} Beat_269={124.19384615384628,0,?,N} Beat_270={124.65538461538475,0,?,N} Beat_271={125.11692307692321,0,?,N} Beat_272={125.57846153846167,1,?,N} Beat_273={126.04000000000013,0,?,N} Beat_274={126.5015384615386,0,?,N} Beat_275={126.96307692307705,0,?,N} Beat_276={127.42461538461552,1,?,N} Beat_277={127.88615384615399,0,?,N} Beat_278={128.34769230769243,0,?,N} Beat_279={128.80923076923088,0,?,N} Beat_280={129.27076923076936,1,?,N} Beat_281={129.73230769230781,0,?,N} Beat_282={130.19384615384627,0,?,N} Beat_283={130.65538461538475,0,?,N} Beat_284={131.1169230769232,1,?,N} Beat_285={131.57846153846165,0,?,N} Beat_286={132.04000000000013,0,?,N} Beat_287={132.50153846153859,0,?,N} Beat_288={132.96307692307704,1,?,N} Beat_289={133.42461538461552,0,?,N} Beat_290={133.88615384615397,0,?,N} Beat_291={134.34769230769243,0,?,N} Beat_292={134.80923076923091,1,?,N} Beat_293={135.27076923076936,0,?,N} Beat_294={135.73230769230781,0,?,N} Beat_295={136.1938461538463,0,?,N} Beat_296={136.65538461538475,1,?,N} Beat_297={137.1169230769232,0,?,N} Beat_298={137.57846153846168,0,?,N} Beat_299={138.04000000000013,0,?,N} Beat_300={138.50153846153859,1,?,N} Beat_301={138.96307692307707,0,?,N} Beat_302={139.42461538461552,0,?,N} Beat_303={139.88615384615397,0,?,N} Beat_304={140.34769230769246,1,?,N} Beat_305={140.80923076923091,0,?,N} Beat_306={141.27076923076936,0,?,N} Beat_307={141.73230769230784,0,?,N} Beat_308={142.1938461538463,1,?,N} Beat_309={142.65538461538475,0,?,N} Beat_310={143.11692307692323,0,?,N} Beat_311={143.57846153846168,0,?,N} Beat_312={144.04000000000013,1,?,N} Beat_313={144.50153846153859,0,?,N} Beat_314={144.96307692307707,0,?,N} Beat_315={145.42461538461552,0,?,N} Beat_316={145.88615384615397,1,?,N} Beat_317={146.34769230769246,0,?,N} Beat_318={146.80923076923091,0,?,N} Beat_319={147.27076923076936,0,?,N} Beat_320={147.73230769230784,1,?,N} Beat_321={148.1938461538463,0,?,N} Beat_322={148.65538461538475,0,?,N} Beat_323={149.11692307692323,0,?,N} Beat_324={149.57846153846168,1,?,N} Beat_325={150.04000000000013,0,?,N} Beat_326={150.50153846153862,0,?,N} Beat_327={150.96307692307707,0,?,N} Beat_328={151.42461538461552,1,?,N} Beat_329={151.886153846154,0,?,N} Beat_330={152.34769230769246,0,?,N} Beat_331={152.80923076923091,0,?,N} Beat_332={153.27076923076939,1,?,N} Beat_333={153.73230769230784,0,?,N} Beat_334={154.1938461538463,0,?,N} Beat_335={154.65538461538478,0,?,N} Beat_336={155.11692307692323,1,?,N} Beat_337={155.57846153846168,0,?,N} Beat_338={156.04000000000016,0,?,N} Beat_339={156.50153846153862,0,?,N} Beat_340={156.96307692307707,1,?,N} Beat_341={157.42461538461555,0,?,N} Beat_342={157.886153846154,0,?,N} Beat_343={158.34769230769246,0,?,N} Beat_344={158.80923076923094,1,?,N} Beat_345={159.27076923076939,0,?,N} Beat_346={159.73230769230784,0,?,N} Beat_347={160.19384615384632,0,?,N} Beat_348={160.65538461538478,1,?,N} Beat_349={161.11692307692323,0,?,N} Beat_350={161.57846153846168,0,?,N} Beat_351={162.04000000000016,0,?,N} Beat_352={162.50153846153862,1,?,N} Beat_353={162.96307692307707,0,?,N} Beat_354={163.42461538461555,0,?,N} Beat_355={163.886153846154,0,?,N} Beat_356={164.34769230769246,1,?,N} Beat_357={164.80923076923094,0,?,N} Beat_358={165.27076923076939,0,?,N} Beat_359={165.73230769230784,0,?,N} Beat_360={166.19384615384632,1,?,N} Beat_361={166.65538461538478,0,?,N} Beat_362={167.11692307692323,0,?,N} Beat_363={167.57846153846171,0,?,N} Beat_364={168.04000000000016,1,?,N} Beat_365={168.50153846153862,0,?,N} Beat_366={168.9630769230771,0,?,N} Beat_367={169.42461538461555,0,?,N} Beat_368={169.886153846154,1,?,N} Beat_369={170.34769230769248,0,?,N} Beat_370={170.80923076923094,0,?,N} Beat_371={171.27076923076939,0,?,N} Beat_372={171.73230769230787,1,?,N} Beat_373={172.19384615384632,0,?,N} Beat_374={172.65538461538478,0,?,N} Beat_375={173.11692307692326,0,?,N} Beat_376={173.57846153846171,1,?,N} Beat_377={174.04000000000016,0,?,N} Beat_378={174.50153846153864,0,?,N} Beat_379={174.9630769230771,0,?,N} Beat_380={175.42461538461555,1,?,N} Beat_381={175.88615384615403,0,?,N} Beat_382={176.34769230769248,0,?,N} Beat_383={176.80923076923094,0,?,N} Beat_384={177.27076923076939,1,?,N} Beat_385={177.73230769230787,0,?,N} Beat_386={178.19384615384632,0,?,N} Beat_387={178.65538461538478,0,?,N} Beat_388={179.11692307692326,1,?,N} Beat_389={179.57846153846171,0,?,N} Beat_390={180.04000000000016,0,?,N} Beat_391={180.50153846153864,0,?,N} Beat_392={180.9630769230771,1,?,N} Beat_393={181.42461538461555,0,?,N} Beat_394={181.88615384615403,0,?,N} Beat_395={182.34769230769248,0,?,N} Beat_396={182.80923076923094,1,?,N} Beat_397={183.27076923076942,0,?,N} Beat_398={183.73230769230787,0,?,N} Beat_399={184.19384615384632,0,?,N} Beat_400={184.6553846153848,1,?,N} Beat_401={185.11692307692326,0,?,N} Beat_402={185.57846153846171,0,?,N} Beat_403={186.04000000000019,0,?,N} Beat_404={186.50153846153864,1,?,N} ",12155,True,4717.247377877516,median " include w2.inc include noxport.inc include consts.inc include structs.inc include newexe.inc createSeg _INT3F,int3f,byte,public,CODE ; ; struct OFSTRUCT definition ; cBytesOfstruct equ [byte ptr 00000h] fFixedDiskOfstruct equ [byte ptr 00001h] nErrCodeOfstruct equ [word ptr 00002h] reservedOfstruct equ [byte ptr 00004h] szPathNameOfstruct equ [byte ptr 00008h] cbOfstruct equ 00080h ; ; struct MAPDEF definition ; map_ptrMapdef equ [word ptr 00000h] lsaMapdef equ [word ptr 00002h] pgm_entMapdef equ [word ptr 00004h] abs_cntMapdef equ [word ptr 00006h] abs_ptrMapdef equ [word ptr 00008h] seg_cntMapdef equ [word ptr 0000Ah] seg_ptrMapdef equ [word ptr 0000Ch] nam_maxMapdef equ [byte ptr 0000Eh] nam_lenMapdef equ [byte ptr 0000Fh] cbMapdef equ 00010h ; ; struct SEGDEF definition ; nxt_segSegdef equ [word ptr 00000h] sym_cntSegdef equ [word ptr 00002h] sym_ptrSegdef equ [word ptr 00004h] seg_lsaSegdef equ [word ptr 00006h] seg_in0Segdef equ [word ptr 00008h] seg_in1Segdef equ [word ptr 0000Ah] seg_in2Segdef equ [word ptr 0000Ch] seg_in3Segdef equ [word ptr 0000Eh] seg_linSegdef equ [word ptr 00010h] seg_lddSegdef equ [byte ptr 00012h] seg_cinSegdef equ [byte ptr 00013h] nam_lenSegdef equ [byte ptr 00014h] cbSegdef equ 00015h ; ; struct SYMDEF definition ; sym_valSymdef equ [word ptr 00000h] nam_lenSymdef equ [byte ptr 00002h] cbSymdef equ 00003h SEGI STRUC ;* result of GetCodeInfo sectorSegi DW ? ; logical sector number in file of start of segment cbFileSegi DW ? ; number bytes in file flagsSegi DW ? ; segment flags cbRamSegi DW ? ; minimum number bytes to allocate for segment hSegi DW ? ; Handle to segment (0 if not loaded) cbAlignSegi DW ? ; Alignment shift count for segment data SEGI ENDS PCODE_HEADER struc ph_code db 3 dup(?) ph_enMacReg db ? ph_snReg dw ? ph_rReg dw ? ph_mpenbpc dw ? PCODE_HEADER ends chLF equ 00Ah chCR equ 00Dh ichMaxFile equ 67 ; EXPORTED LABELS ; EXTERNAL FUNCTIONS externFP externFP externFP externFP externFP ; EXTERNAL DATA sBegin data globalW hInt3FCode,0 externW $q_mpsnpfn externW mptlbxpfn externW Result0 externW Result2 externW Result4 sEnd data ; CODE SEGMENT _INT3F sBegin int3f assumes cs,int3f assumes ds,dgroup assume es:nothing assumes ss,dgroup ;------------------------------------------------------------------------- ; Int3FHandler( ) ;------------------------------------------------------------------------- ;/* I N T 3 F H A N D L E R */ ; %%Function:Int3FHandler %%Owner:BRADV PUBLIC Int3FHandler Int3FHandler: mov wptr (cs:[spInt3Fhandler]),sp pushf push wptr (cs:Int3FAddress+2) push wptr (cs:Int3FAddress) sti ; Save all registers ; NOTE: there is no point in saving es because swapping due to ; calls by Int3FHandler may invalidate it anyway. But this should ; be no problem since the caller may not assume that es is valid ; after a far call. But I will save it anyway because it looks like ; the windows int 3F handler does. push ax push bx push cx push dx push si push di push ds push es cld mov bx,wptr (cs:[spInt3Fhandler]) les si,ss:[bx+6] mov ax,wptr (es:[si]) mov wptr (cs:[wCallersCode]),ax les si,ss:[bx] mov al,bptr (es:[si]) mov bptr (cs:[fNotReturnThunk]),al cCall LN_DumpSwapInfo,<> mov bx,wptr (cs:[spInt3Fhandler]) les si,ss:[bx+6] mov ax,wptr (es:[si]) cmp wptr (cs:[wCallersCode]),ax je I3FH02 int 3 db 'BV1' I3FH02: les si,ss:[bx] ;point to the code after the interrupt mov ax,es:[si-2] ;get the code before the return sub ax,03FCDh ;is it still an int 3F? je I3FH03 sub wptr (ss:[bx]),2 I3FH03: push ax ; let's get outta this interrupt pop ax or ax,ax pop es pop ds pop di pop si pop dx pop cx pop bx pop ax je I3FH04 add sp,6 ;forget the windows int 3F handler, ;the int 3f was removed when we weren't looking. I3FH04: iret ; End of Int3FHandler CSVariables: Int3FAddress: dd 0 snMac: dw 0 tlbxMac: dw 0 Off_hExeHead: dw 0 fNotReturnThunk: db 0 bTraceFlags: db 0 maskfPcallLocal equ 1 maskfPcodeLocal equ 2 maskfIretAddLocal equ 4 spInt3Fhandler: dw 0 wCallersCode: dw 0 pRetCurrent: dw 0 RetSeg: dw 0 RetOffset: dw 0 iSegCaller: dw 0 pBuff: dw 0 ;always points into pBuff BuffStart: db 80 dup (0) chOutBuff: db 0 hDbgScreen: dw 0 segiSwap: db SIZE SEGI DUP (0) MapDefSwap: db cbMapdef DUP (0) SegDefSwap: db cbSegdef DUP (0) SymDefSwap: db cbSymdef DUP (0) prev_SymDef: db cbSymdef DUP (0) szSegName: db 128 DUP (0) pDiskBuff: dw 0 cbDiskBuff: dw 0 LO_posCur: dw 0 HI_posCur: dw 0 DiskBuff: db 1024 DUP (0) fBufferFlags: dw 0 maskfUsedForStructLocal equ 1 maskfUsedStraightLocal equ 2 szSymFile: db 66 dup (0) cbSzSymFile equ $ - offset szSymFile ofStruct: db cbOfstruct DUP (0) szFileCur: dw 0 cbCSVariables equ $ - CSVariables doshndCur: dw -1 ;* * * String pool stOPUS: db 4,'OPUS' szKernelSym: db 'kernel.sym',0 szOpusSym: db 'opus.sym',0 szPcodeMap: db 'pcodemap.txt',0 szToolbox: db 'toolbox.h',0 szInt3F: DB ""INT 3F| "", 0 szCRLF: DB 0dh, 0ah, 0 szReturnThunk: DB ""Return Thunk Encountered"", 0 szPCODE: DB 'PCODE!',0 szNoSegNoOff: DB '?' szNoOffset: DB ':?',0 szNoSegment: DB '?:',0 szLoaded: DB "" loaded "", 0 szMsDosExe: DB 'msdos.exe',0 szHEXEHEAD: DB 'HEXEHEAD',0 rgchTLBX: DB 'TLBX(' cbTLBX equ $ - offset rgchTLBX rgchtlbxMac: DB 'tlbxMac ' cbtlbxMac equ $ - offset rgchtlbxMac szCom1: DB 'com1',0 szCALL0: DB 'CALL0',0 cbCALL0 equ $ - offset szCALL0 rgchRetNative: DB 'RetNative' cbRetNative equ $ - offset rgchRetNative rgchRetToolbox: DB 'RetToolbox' cbRetToolbox equ $ - offset rgchRetToolbox szDotSym: DB '.sym',0 cbDotSym equ $ - offset szDotSym assumes ds,int3f ;------------------------------------------------------------------------- ; LN_DumpSwapInfo() ;------------------------------------------------------------------------- LN_DumpSwapInfo: push cs pop ds push cs pop es ; maintain assumption es == ds == cs ; init locals call LN_HOpenDbgScreen ; enable printing to the debug screen? mov wptr ([hDbgScreen]),ax ; save handle to debug screen cmp ax,-1 ; legal handle? jne LN_DSI01 ; yes - skip ret LN_DSI01: mov bptr ([bTraceFlags]),0 mov si,offset szInt3F call LN_PrintSz ; output ""INT 3F - "" cmp bptr ([fNotReturnThunk]),fFalse jne LN_DSI02 mov si,offset szReturnThunk call LN_PrintSz ; output ""Return Thunk Encountered"" jmp LN_DSI11 ; we're done. LN_DSI02: mov bx,wptr ([spInt3FHandler]) add bx,4 mov wptr ([pRetCurrent]),bx LN_DSI03: mov ax,offset [BuffStart] ; get address of start of strings mov wptr ([pBuff]),ax ; and save it mov bx,wptr ([pRetCurrent]) mov ax,ss:[bx+2] ; get offset part of ret addr mov dx,ss:[bx+4] ; get segment part mov wptr ([RetOffset]),ax ; save address for later... mov wptr ([RetSeg]),dx ; are we looking at the iret address? test bptr ([bTraceFlags]),maskfIretAddLocal jz LN_DSI036 ; no - try to print name ; were we called from the interpreter? test bptr ([bTraceFlags]),maskfPcodeLocal jz LN_DSI034 ; no - see if the toolbox was called ; was it pcode calling pcode? test bptr ([bTraceFlags]),maskfPcallLocal jz LN_DSI034 ; no - must have been a toolbox call. push ss:[Result4] call LN_FPrintPcodeAddress ; yes - print the address jmp short LN_DSI042 LN_DSI034: call LN_FPrintToolboxName ; print toolbox name if possible jmp short LN_DSI042 LN_DSI036: test bptr ([bTraceFlags]),maskfPcodeLocal ; is this a real bp? jz LN_DSI04 ; yes - far frame mov ax,0FFFFh push ax call LN_FPrintPcodeAddress jmp short LN_DSI042 LN_DSI04: push wptr ([RetSeg]) ; pass the segment to look up call LN_FFindSeg ; find the segment LN_DSI042: or ax,ax ; successful? jnz LN_DSI046 ; yes - skip push ax call LN_PrintSegOff ; no - print segment:offset pop ax LN_DSI046: ; did we call FFindSeg? test bptr ([bTraceFlags]),maskfIretAddLocal+maskfPcodeLocal jne LN_DSI047 ; no - move on or ax,ax ; were we successful? jne LN_DSI05 ; yes - continue processing LN_DSI047: jmp LN_DSI10 LN_DSI05: mov dx,offset [szSymFile] ; LN_FOpenFcb takes a pointer to an sz in [ds:dx] and returns ; zero if opening the file failed, and not zero if it succeeded. ; The disk transfer address is also set to [DiskBuff+512] ; ax is 0 upon return iff opening failed, no other registers altered. call LN_FOpenFcb je LN_DSI057 push wptr ([iSegCaller]) cCall LN_FGetSegSymb,<> or ax,ax ; successful? je LN_DSI055 ; no - close file and move on mov di,offset szSegName mov si,di mov al,0 mov cx,0FFFFh repne scasb ; compute length of sz in szSegName mov cx,di sub cx,si mov di,wptr ([pBuff]) ; transfer sz into Buff rep movsb mov byte ptr [di-1],':' ; save seperator in string mov wptr ([pBuff]),di push wptr ([RetOffset]) ; pass the offset to lookup push wptr ([pBuff]) ; pass the place to put the offset symbol call LN_FGetSymbol ; get the symbol LN_DSI055: ; LN_CloseFcb closes doshndCur. No registers are altered. call LN_CloseFcb or ax,ax ; successful? jnz LN_DSI06 ; yes - see if we have a pcode frame LN_DSI057: mov si,offset szNoSegNoOff call LN_PrintSegOff ; no - just print segment:offset jmp short LN_DSI10 LN_DSI06: ;* * look for interpreter calls ;* * possibly ""RetNative?"" mov si,wptr ([pBuff]) ; get the pointer to the buffer mov di,offset rgchRetNative mov cx,cbRetNative repe cmpsb je LN_DSI07 ;* * possibly ""RetToolbox?"" mov si,wptr ([pBuff]) ; get the pointer to the buffer mov di,offset rgchRetToolbox mov cx,cbRetToolbox repe cmpsb jne LN_DSI075 LN_DSI07: cmp bptr [si],'0' jb LN_DSI075 cmp bptr [si],'3' ja LN_DSI075 cmp bptr [si+1],0 je LN_DSI08 LN_DSI075: ;* * possibly ""CALL0"" mov si,wptr ([pBuff]) ; get the pointer to the buffer mov di,offset szCALL0 mov cx,cbCALL0 repe cmpsb jne LN_DSI09 or bptr ([bTraceFlags]),maskfPcallLocal+maskfPcodeLocal mov ax,ss:[Result2] mov dx,ss:[Result0] mov wptr ([RetOffset]),ax ; save address for later... mov wptr ([RetSeg]),dx mov ax,offset [BuffStart] ; get address of start of strings mov wptr ([pBuff]),ax ; and save it mov ax,0FFFFh push ax call LN_FPrintPcodeAddress jmp LN_DSI042 ;* * Start of Pcode frame LN_DSI08: or bptr ([bTraceFlags]),maskfPcodeLocal mov wptr ([pRetCurrent]),bp jmp LN_DSI03 ; skip to pcode frame... LN_DSI09: call LN_PrintNativeAddress LN_DSI10: test bptr ([bTraceFlags]),maskfIretAddLocal jne LN_DSI11 mov si,offset szLoaded call LN_PrintSz ; output "" loaded "" mov bx,wptr ([spInt3FHandler]) sub bx,2 mov wptr ([pRetCurrent]),bx ; point to iret return address or bptr ([bTraceFlags]),maskfIretAddLocal jmp LN_DSI03 LN_DSI11: mov si,offset szCRLF call LN_PrintSz ; output mov bx,offset [hDbgScreen] call LN_CloseOutFile ; close the debug screen ret ;------------------------------------------------------------------------- ; LN_PrintNativeAddress() ;------------------------------------------------------------------------- LN_PrintNativeAddress: mov di,offset [szSymFile] ; point to sym file name mov cx,0FFFFh mov al,0 repne scasb mov cx,di mov di,offset [szSymFile] ; point to sym file name sub cx,di mov al,'.' ; find file extension repne scasb dec di mov bptr [di],0 ; end string here push di ; save pointer to string end mov si,offset [szSymFile] ; point to sym file name call LN_PrintSz ; print the map name pop di ; point to where we ended the string mov bptr [di],'.' ; restore the extension mov al,'!' ; seperator between map name and seg name call LN_Dout mov si,offset [BuffStart] ; point to seg and symbol names call LN_PrintSz ; print the map name mov cx,wptr ([RetOffset]) ; get offset sub cx,wptr ([SymDefSwap.sym_valSymdef]) ; calc offset from start of proc jcxz LN_DSI10 ; skip if no offset mov al,'+' ; seperator between symbol name and offset call LN_Dout mov ax,cx ; output the offset call LN_DoutHex ret ;------------------------------------------------------------------------- ; LN_FPrintPcodeAddress( wSnProc ) ;------------------------------------------------------------------------- ; %%Function:LN_FPrintPcodeAddress %%Owner:BRADV cProc LN_FPrintPcodeAddress,,<> ParmW wSnProc LocalW fResult cBegin mov [fResult],0FFFFh mov si,offset szPCODE call LN_PrintSz mov ax,[wSnProc] cmp ax,0FFFFh je LN_PPA01 mov al,ah xor ah,ah mov wptr ([RetSeg]),ax LN_PPA01: push wptr ([RetSeg]) ; pass sn call LN_FGetPcodeSegName or ax,ax ; seg name found? jnz LN_PPA02 ; yes - continue with true name mov al,'?' call LN_Dout mov al,':' call LN_Dout jmp short LN_PPA08 ; no - skip LN_PPA02: mov si,offset [szSegName] call LN_PrintSz mov al,':' call LN_Dout mov dx,[wSnProc] inc dx jne LN_PPA05 push wptr ([RetSeg]) ; get sn call LN_GetPsOfSn ; get physical address of pcode seg or ax,ax ; swapped out? jz LN_PPA08 ; yes - exit mov es,ax ; in memory - put seg in es mov bx,offset ph_mpenbpc ; point to mpenbpc table xor cx,cx mov cl,es:[ph_enMacReg] ; get count of procs mov dx,0 ; init proc counter LN_PPA03: mov ax,es:[bx] ; get the next entry point cmp ax,wptr ([RetOffset]) ; is this one past the one we want? ja LN_PPA04 ; yes - skip inc bx ; point to next entry inc bx inc dx ; bump proc counter loop LN_PPA03 ; and loop LN_PPA04: mov bx,es:[bx-2] ; save start of the proc push cs pop es LN_PPA05: push bx dec dx ; set proc number back mov dh,bptr ([RetSeg]) ; get seg in dh, proc # in dl push dx mov ax,offset szOpusSym push ax push wptr ([pBuff]) ; point to buffer call LN_FGetConstSymb pop dx ; get back start of proc offset or ax,ax ; OK? jnz LN_PPA09 ; no - exit LN_PPA08: mov [fResult],00000h mov al,'?' call LN_Dout jmp short LN_PPA10 LN_PPA09: mov si,offset [BuffStart] ; point to seg and symbol names call LN_PrintSz ; print the map name cmp [wSnProc],0FFFFh jne LN_PPA10 mov cx,wptr ([RetOffset]) ; get offset sub cx,dx ; calc offset from start of proc dec cx dec cx jcxz LN_PPA10 ; skip if no offset mov al,'+' ; seperator between symbol name and offset call LN_Dout mov ax,cx ; output the offset call LN_DoutHex LN_PPA10: mov ax,[fResult] cEnd ;------------------------------------------------------------------------- ; LN_FPrintToolboxName() ;------------------------------------------------------------------------- ; %%Function:LN_FPrintToolboxName %%Owner:BRADV cProc LN_FPrintToolboxName,,<> LocalW wToolboxNumber LocalW fResult cBegin mov [fResult],00000h mov dx,offset szToolbox ; LN_FOpenFcb takes a pointer to an sz in [ds:dx] and returns ; zero if opening the file failed, and not zero if it succeeded. ; The disk transfer address is also set to [DiskBuff+512] ; ax is 0 upon return iff opening failed, no other registers altered. call LN_FOpenFcb jne Ltemp002 jmp LN_PTN13 Ltemp002: mov dx,wptr ([RetSeg]) mov bx,wptr ([RetOffset]) sub bx,7 ;Assume that if we got here (we found a call from the pcode ;interpreter to the int3f), then ss must be the interpreter ss. mov si,offset DGROUP:mptlbxpfn mov di,si mov cx,wptr ([tlbxMac]) push ss pop ds LN_PTN01: lodsw cmp ax,bx lodsw jne LN_PTN02 cmp ax,dx LN_PTN02: loopnz LN_PTN01 push cs pop ds jne Ltemp003 sub si,di shr si,1 shr si,1 dec si mov [wToolboxNumber],si ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. call LN_FReadFcb jne Ltemp004 Ltemp003: mov si,wptr ([pBuff]) mov wptr [si],(256 * 0) + '?' jmp LN_PTN12 Ltemp004: mov dx,512 LN_PTN04: or dx,dx jle Ltemp003 push dx ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. call LN_FReadFcb pop cx mov dx,0 je LN_PTN05 mov dx,512 LN_PTN05: mov di,offset [DiskBuff] LN_PTN06: mov al,'#' ;look for the beginning of '#define' repne scasb jne LN_PTN04 push cx push dx push di dec di inc cx add cx,dx sub cx,cbTLBX + 5 ; after 'TLBX(' must not have junk jl LN_PTN10 LN_PTN07: mov al,bptr ([rgchTLBX]) repne scasb jne LN_PTN10 mov dx,cx mov bx,di dec di mov cx,cbTLBX mov si,offset rgchTLBX repe cmpsb mov cx,dx xchg bx,di jne LN_PTN07 ; found '#...TLBX(' and have whole thing in buffer xor ax,ax cwd mov si,bx LN_PTN08: lodsb sub al,'0' cmp al,10 jae LN_PTN09 shl dx,1 mov cx,dx shl dx,1 shl dx,1 add dx,cx add dx,ax xor cx,cx jmp short LN_PTN08 LN_PTN09: cmp dx,[wToolboxNumber] je LN_PTN11 LN_PTN10: pop di pop dx pop cx jmp short LN_PTN06 LN_PTN11: ; found '#...TLBX(' ; and have the whole thing in buffer pop si ; beginning of '#...TLBX(' pop dx pop cx mov cx,0FFFFh mov al,'#' std repne scasb ; look for last '#' before 'TLBX(' cld inc di mov al,' ' ; look for space after '#define' repne scasb mov si,di ; pointer to beginning of toolbox name mov al,'(' repne scasb mov bptr [di-1],0 mov [fResult],0FFFFh LN_PTN12: push si mov si,offset szNoSegment call LN_PrintSz pop si call LN_PrintSz ; LN_CloseFcb closes doshndCur. No registers are altered. call LN_CloseFcb mov ax,[fResult] LN_PTN13: cEnd ;------------------------------------------------------------------------- ; LN_PrintSegOff() ;------------------------------------------------------------------------- ; ; Print return address in form: ; ; : ; LN_PrintSegOff: mov al,'(' call LN_Dout mov ax,wptr ([RetSeg]) call LN_DoutHex mov al,':' call LN_Dout mov ax,wptr ([RetOffset]) call LN_DoutHex mov al,')' call LN_Dout ret ;------------------------------------------------------------------------- ; LN_PrintSz() ;------------------------------------------------------------------------- ;* ;* PrintSz : DS:SI = ""sz"" string ;* ;* print string LN_PrintSz: push ax ; save regs jmp short LN_PS04 ; loop LN_PS02: call LN_Dout ; output the char LN_PS04: lodsb ; get a char cmp al,0 ; end of string? jnz LN_PS02 ; yes - exit pop ax ret ;------------------------------------------------------------------------- ; LN_DoutHex() ;------------------------------------------------------------------------- ; print out a 16 bit unsigned in 4 hex digit format LN_DoutHex: push cx ; save environment mov cx,00404h LN_DH01: rol ax,cl push ax and al,00Fh add al,'0' cmp al,'9' jbe LN_DH02 add al,'A' - '0' - 10 LN_DH02: call LN_Dout pop ax dec ch ja LN_DH01 pop cx ; restore environment ret ;------------------------------------------------------------------------- ; LN_Dout() ;------------------------------------------------------------------------- ; print out a char LN_Dout: push bx ; save environment mov bx,offset [hDbgScreen] ; get handle of debug screen to print to call LN_Doutfile pop bx ; restore environment ret ;------------------------------------------------------------------------- ; LN_DoutFile() ;------------------------------------------------------------------------- ; print out a char to the opened file LN_Doutfile: cmp bx,0ffffh ; exit if file not open je LN_DF03 push ax ; save environment push cx push dx push bx ; save file handle mov bx,offset [chOutBuff] mov [bx],al mov dx,bx pop bx ; restore file handle push bx ; save file handle mov bx,[bx] mov cx,1 ; mov bx,[doshnd] ; lds dx,[lpchBuffer] ; mov cx,[bytes] mov ah,040h int 21h jnc LN_DF01 neg ax ; error: return the negative of the error code LN_DF01: or ax,ax jnz LN_DF02 pop bx ; restore file handle push bx ; save file handle call LN_CloseOutFile LN_DF02: pop bx ; restore file handle pop dx ; restore environment pop cx pop ax LN_DF03: ret ;------------------------------------------------------------------------- ; LN_CloseOutFile() ;------------------------------------------------------------------------- ; close the output file LN_CloseOutFile: cmp [bx],0ffffh je LN_COF02 push ax ; save environment push cx push dx push bx mov bx,[bx] mov ah,03Eh ;Close file int 21h mov ax,00000h jc LN_COF01 ; error, leave a zero in ax inc ax LN_COF01: pop bx mov [bx],0ffffh pop dx ; restore environment pop cx pop ax LN_COF02: ret LGlobalAlloc: cCall GlobalAlloc,<> ;------------------------------------------------------------------------- ; LN_FFindSeg( CSvalue ) ;------------------------------------------------------------------------- ; %%Function:LN_FFindSeg %%Owner:BRADV cProc LN_FFindSeg,,<> ParmW CSvalue LocalW hExe cBegin mov bx,wptr ([Off_hExeHead]) mov es,wptr ([LGlobalAlloc + 3]) mov ax,wptr (es:[bx]) push cs pop es mov [hExe],ax jmp short LN_FFS02 LN_FFS01: ;#define NE_PNEXTEXE(x) (WORD)(x).ne_cbenttab mov es,[hExe] mov ax,es:[ne_cbenttab] mov [hExe],ax LN_FFS02: push cs pop es xor ax,ax cmp [hExe],0 je LN_FFS04 mov es,[hExe] test es:[ne_flags],NENOTP ;can look at segments if library jne LN_FFS03 mov di,es:[ne_restab] mov si,offset stOPUS mov cl,[si] xor ch,ch inc cx repe cmpsb ;or if it is OPUS jne LN_FFS01 LN_FFS03: mov si,es:[ne_segtab] mov wptr ([iSegCaller]),00001h jmp short LN_FFS06 LN_FFS04: jmp short LN_FFS10 LN_FFS05: inc wptr ([iSegCaller]) add si,SIZE New_seg1 LN_FFS06: mov ax,wptr ([iSegCaller]) mov es,[hExe] cmp ax,es:[ne_cseg] ja LN_FFS01 push es:[si.ns_handle] ;#define MyLock(ps) HIWORD(GlobalHandle(ps)) cCall GlobalHandle,<> push cs pop ds cmp dx,[CSvalue] jne LN_FFS05 mov es,[hExe] mov si,es:[ne_restab] mov ds,[hExe] lodsb xor ah,ah mov cx,ax mov di,offset [szSymFile] push cs pop es LN_FFS07: lodsb cmp al,'.' je LN_FFS08 stosb loop LN_FFS07 LN_FFS08: push cs pop ds mov si,offset szDotSym mov cx,cbDotSym rep movsb cmp di,offset [szSymFile] + cbSzSymFile jb LN_FFS09 int 3 db 'BV3' LN_FFS09: mov ax,0FFFFh LN_FFS10: cEnd ;------------------------------------------------------------------------- ; LN_FGetSegSymb( Seg ) ;------------------------------------------------------------------------- ; %%Function:LN_FGetSegSymb %%Owner:BRADV cProc LN_FGetSegSymb,,<> ParmW SegArg LocalW iSeg cBegin mov di,offset MapDefSwap mov cx,cbMapdef ; LN_ReadRgch reads cx bytes into [ds:di] and returns not zero if cx ; bytes have been read. ; only ax and di are altered. call LN_ReadRgch jz LN_FGSS04 mov ax,[SegArg] dec ax cmp ax,wptr ([MapDefSwap.seg_cntMapdef]) mov ax,0 jae LN_FGSS04 mov [iSeg],00001h mov ax,wptr ([MapDefSwap.seg_ptrMapdef]) mov wptr ([SegDefSwap.nxt_segSegdef]),ax LN_FGSS01: mov ax,[iSeg] cmp ax,[SegArg] ja LN_FGSS03 cmp wptr ([SegDefSwap.nxt_segSegdef]),0 mov ax,0 je LN_FGSS04 mov bx,wptr ([SegDefSwap.nxt_segSegdef]) mov cl,4 rol bx,cl mov dx,0000Fh and dx,bx and bl,0F0h mov cl,0 ; mov dx,[SEG_dwSeekpos] ; mov bx,[OFF_dwSeekpos] ; mov cl,[bSeekfrom] cCall LN_DwSeekDw,<> jz LN_FGSS04 mov di,offset SegDefSwap mov cx,cbSegdef ; LN_ReadRgch reads cx bytes into [ds:di] and returns not zero if cx ; bytes have been read. ; only ax and di are altered. call LN_ReadRgch jz LN_FGSS04 inc [iSeg] jmp short LN_FGSS01 LN_FGSS03: mov di,offset [szSegName] mov cl,bptr ([SegdefSwap.nam_lenSegdef]) xor ch,ch ; LN_ReadSz reads cx bytes into [ds:di], zero terminates the sz, ; and returns not zero if cx bytes have been read. ; only ax and di are altered. call LN_ReadSz LN_FGSS04: cEnd ;------------------------------------------------------------------------- ; LN_FGetSymbol(Offset, szSymbol) ;------------------------------------------------------------------------- ; %%Function:LN_FGetSymbol %%Owner:BRADV cProc LN_FGetSymbol,,<> ParmW OffsetArg ParmW szSymbol LocalW iSym cBegin mov [iSym],00000h mov di,offset SymDefSwap mov cx,cbSymdef ; LN_ReadRgch reads cx bytes into [ds:di] and returns not zero if cx ; bytes have been read. ; only ax and di are altered. call LN_ReadRgch jz LN_FGS03 mov di,[szSymbol] mov cl,bptr ([SymDefSwap.nam_lenSymdef]) xor ch,ch ; LN_ReadSz reads cx bytes into [ds:di], zero terminates the sz, ; and returns not zero if cx bytes have been read. ; only ax and di are altered. call LN_ReadSz jz LN_FGS03 mov cl,bptr ([SymDefSwap]+2) mov ax,wptr ([SymDefSwap]) mov wptr ([prev_Symdef]),AX mov bptr ([prev_Symdef]+2),cl mov [iSym],00001h LN_FGS01: mov ax,[iSym] cmp ax,wptr ([SegDefSwap.sym_cntSegdef]) jg LN_FGS02 mov di,offset SymdefSwap mov cx,cbSymdef ; LN_ReadRgch reads cx bytes into [ds:di] and returns not zero if cx ; bytes have been read. ; only ax and di are altered. call LN_ReadRgch jz LN_FGS03 mov ax,wptr ([SymDefSwap.sym_valSymdef]) cmp ax,[OffsetArg] ja LN_FGS02 mov di,[szSymbol] mov cl,bptr ([SymdefSwap.nam_lenSymdef]) xor ch,ch ; LN_ReadSz reads cx bytes into [ds:di], zero terminates the sz, ; and returns not zero if cx bytes have been read. ; only ax and di are altered. call LN_ReadSz jz LN_FGS03 mov cl,bptr ([SymDefSwap]+2) mov ax,wptr ([SymDefSwap]) mov wptr ([prev_Symdef]),ax mov bptr ([prev_Symdef]+2),cl inc [iSym] jmp short LN_FGS01 LN_FGS02: mov cl,bptr ([prev_Symdef]+2) mov ax,wptr ([prev_Symdef]) mov wptr ([SymDefSwap]),ax mov bptr ([SymDefSwap]+2),cl mov ax,0FFFFh LN_FGS03: cEnd ;------------------------------------------------------------------------- ; LN_GetPsOfSn() ;------------------------------------------------------------------------- ;* entry : sn = Pcode segment # ;* * find physical segment of Pcode segment (if resident) ;* exit : AX = ps (or 0 if not resident) ; %%Function:LN_GetPsOfSn %%Owner:BRADV cProc LN_GetPsOfSn,,<> ParmW sn cBegin mov bx,sn shl bx,1 ;* Make into word pointer shl bx,1 ;* DWORD ptr add bx,OFFSET DGROUP:$q_mpsnpfn ;* DS:BX => table ;Assume that if we got here (we found a call from the pcode ;interpreter to the int3f), then ss must be the interpreter ss. push wptr ss:[BX+2] ;* segment push wptr ss:[BX] ;* offset (lpthunk on stack) mov bx,offset [segiSwap] ;* address of buffer cCall GetCodeInfo, ;* lpthunk, lpsegi push cs pop ds push cs pop es or ax,ax jz LN_GPOS01 ;* error - assume non-resident ;* * good segment info, see if segment resident mov ax,wptr ([segiSwap.hSegi]) ;* handle or ps if fixed test ax,1 jnz LN_GPOS01 ;* ax = ps cCall GlobalHandle, ;* get handle info push cs pop ds push cs pop es mov ax,dx ;* ps (or 0 if not loaded) LN_GPOS01: cEnd ;------------------------------------------------------------------------- ; LN_FGetPcodeSegName(iPcodeSeg, szSegName) ;------------------------------------------------------------------------- ; %%Function:LN_FGetPcodeSegName %%Owner:BRADV cProc LN_FGetPcodeSegName,,<> ParmW iPcodeSeg LocalW hSegFile cBegin mov dx,offset szPcodeMap ; LN_FOpenFcb takes a pointer to an sz in [ds:dx] and returns ; zero if opening the file failed, and not zero if it succeeded. ; The disk transfer address is also set to [DiskBuff+512] ; ax is 0 upon return iff opening failed, no other registers altered. call LN_FOpenFcb je LN_FGPSN06 xor bx,bx ;iSn mov di,offset [DiskBuff+1024] mov si,di LN_FGPSN01: ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. call LN_FReadFcb je LN_FGPSN05 mov cx,512 sub si,cx sub di,cx LN_FGPSN02: mov al,chCR repne scasb jne LN_FGPSN01 cmp bx,[iPcodeSeg] je LN_FGPSN04 inc bx mov si,di jcxz LN_FGPSN01 jmp short LN_FGPSN02 LN_FGPSN04: inc si ;move past the chLF mov cx,di sub cx,si dec cx mov di,offset [szSegName] rep movsb mov bptr [di],0 mov ax,0FFFFh LN_FGPSN05: ; LN_CloseFcb closes doshndCur. No registers are altered. call LN_CloseFcb LN_FGPSN06: cEnd ;------------------------------------------------------------------------- ; LN_FGetConstSymb(Const, szFile, szConstName) ;------------------------------------------------------------------------- ; %%Function:LN_FGetConstSymb %%Owner:BRADV cProc LN_FGetConstSymb,,<> ParmW Const ParmW szFile ParmW szConstName LocalW iConst cBegin mov dx,[szFile] ; LN_FOpenFcb takes a pointer to an sz in [ds:dx] and returns ; zero if opening the file failed, and not zero if it succeeded. ; The disk transfer address is also set to [DiskBuff+512] ; ax is 0 upon return iff opening failed, no other registers altered. call LN_FOpenFcb jne LN_FGCS01 jmp LN_FGCS08 LN_FGCS01: mov di,offset MapDefSwap mov cx,cbMapdef ; LN_ReadRgch reads cx bytes into [ds:di] and returns not zero if cx ; bytes have been read. ; only ax and di are altered. call LN_ReadRgch jz LN_FGCS07 mov bl,bptr ([MapDefSwap.nam_lenMapdef]) xor bh,bh add bx,cbMapdef inc bx xor dx,dx mov cl,0 ; mov dx,[SEG_dwSeekpos] ; mov bx,[OFF_dwSeekpos] ; mov cl,[bSeekfrom] cCall LN_DwSeekDw,<> jz LN_FGCS07 mov [iConst],00000h LN_FGCS02: xor ax,ax mov cx,[iConst] cmp cx,wptr ([MapDefSwap.abs_cntMapdef]) jge LN_FGCS07 mov di,offset SymDefSwap mov cx,cbSymdef ; LN_ReadRgch reads cx bytes into [ds:di] and returns not zero if cx ; bytes have been read. ; only ax and di are altered. call LN_ReadRgch jz LN_FGCS07 mov ax,wptr ([SymDefSwap.sym_valSymdef]) cmp ax,[Const] jne LN_FGCS05 mov di,[szConstName] mov cl,bptr ([SymDefSwap.nam_lenSymdef]) xor ch,ch ; LN_ReadSz reads cx bytes into [ds:di], zero terminates the sz, ; and returns not zero if cx bytes have been read. ; only ax and di are altered. call LN_ReadSz jz LN_FGCS07 mov bx,[szConstName] cmp bptr [bx],'@' jne LN_FGCS04 mov cl,bptr ([SymDefSwap.nam_lenSymdef]) xor ch,ch mov di,[szConstName] lea si,[di+1] rep movsb LN_FGCS04: mov ax,0FFFFh jmp short LN_FGCS07 LN_FGCS05: mov bl,bptr ([SymdefSwap.nam_lenSymdef]) xor bh,bh xor dx,dx mov cl,001h ; mov dx,[SEG_dwSeekpos] ; mov bx,[OFF_dwSeekpos] ; mov cl,[bSeekfrom] cCall LN_DwSeekDw,<> jz LN_FGCS07 LN_FGCS06: inc [iConst] jmp short LN_FGCS02 LN_FGCS07: ; LN_CloseFcb closes doshndCur. No registers are altered. call LN_CloseFcb LN_FGCS08: cEnd ;------------------------------------------------------------------------- ; LN_FOpenFcb() ;------------------------------------------------------------------------- ; LN_FOpenFcb takes a pointer to an sz in [ds:dx] and returns ; zero if opening the file failed, and not zero if it succeeded. ; The disk transfer address is also set to [DiskBuff+512] ; ax is 0 upon return iff opening failed, no other registers altered. LN_FOpenFcb: cmp wptr ([doshndCur]),0FFFFh je LN_FOF01 int 3 db 'BV4' LN_FOF01: mov wptr ([szFileCur]),dx push bx push cx push dx push ds push dx ;&sz mov ax,offset ofStruct push ds push ax ;&ofStruct xor ax,ax push ax ;OF_READ cCall OpenFile,<> push cs pop ds push cs pop es pop dx pop cx pop bx inc ax je LN_FOF02 dec ax mov wptr ([doshndCur]),ax xor ax,ax mov wptr ([pDiskBuff]),offset [DiskBuff+1024] mov wptr ([cbDiskBuff]),ax mov wptr ([fBufferFlags]),ax mov wptr ([LO_posCur]),ax mov wptr ([HI_posCur]),ax not ax LN_FOF02: or ax,ax ret ;------------------------------------------------------------------------- ; LN_ReadSz() ;------------------------------------------------------------------------- ; LN_ReadSz reads cx bytes into [ds:di], zero terminates the sz, ; and returns not zero if cx bytes have been read. ; only ax and di are altered. LN_ReadSz: call LN_ReadRgch mov bptr [di],000h ret ;------------------------------------------------------------------------- ; LN_ReadRgch() ;------------------------------------------------------------------------- ; LN_ReadRgch reads cx bytes into [ds:di] and returns not zero if cx ; bytes have been read. ; only ax and di are altered. LN_ReadRgch: or wptr ([fBufferFlags]),maskfUsedForStructLocal push wptr ([fBufferFlags]) mov ax,0FFFFh ; default return success cmp wptr ([cbDiskBuff]),cx jae LN_RR01 ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. call LN_FReadFcb je LN_RR02 add wptr ([cbDiskBuff]),512 sub wptr ([pDiskBuff]),512 LN_RR01: sub wptr ([cbDiskBuff]),cx push si mov si,wptr ([pDiskBuff]) rep movsb mov wptr ([pDiskBuff]),si pop si LN_RR02: pop wptr ([fBufferFlags]) or ax,ax ret ;------------------------------------------------------------------------- ; LN_DwSeekDw() ;------------------------------------------------------------------------- ; LN_DwSeekDw takes cb in dx:bx and fReadFromEnd in cl. ; If cl is false upon entry *doshndCur is closed and opened, otherwise ; *doshndCur is left at the current file position. Then dx:bx ; bytes are skipped in the file. LN_DwSeekDw: or wptr ([fBufferFlags]),maskfUsedForStructLocal push wptr ([fBufferFlags]) mov ax,0FFFFh ; default return success or cl,cl jne LN_DSD01 push ax push cx push dx push bx mov ax,wptr ([pDiskBuff]) sub ax,offset [DiskBuff+1024] cwd add ax,wptr ([LO_posCur]) adc dx,wptr ([HI_posCur]) mov cx,dx ; actual fc pointed to by pDiskBuff in cx:ax pop bx pop dx mov si,bx mov di,dx sub bx,ax sbb dx,cx ; do we want to move to a position beyond fc pop cx pop ax jge LN_DSD01 ; yes - just read some more mov bx,si mov dx,di ; no - close file and read from beginning push dx ; save high cb ; LN_CloseFcb closes doshndCur. No registers are altered. call LN_CloseFcb mov dx,wptr ([szFileCur]) ; LN_FOpenFcb takes a pointer to an sz in [ds:dx] and returns ; zero if opening the file failed, and not zero if it succeeded. ; The disk transfer address is also set to [DiskBuff+512] ; ax is 0 upon return iff opening failed, no other registers altered. call LN_FOpenFcb pop dx ;restore high cb je LN_DSD02 LN_DSD01: jmp short LN_DSD03 LN_DSD02: ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. call LN_FReadFcb je LN_DSD05 sub bx,512 sbb dx,0 LN_DSD03: or dx,dx ja LN_DSD02 cmp bx,512 ja LN_DSD02 cmp wptr ([cbDiskBuff]),bx jae LN_DSD04 ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. call LN_FReadFcb je LN_DSD05 add wptr ([cbDiskBuff]),512 sub wptr ([pDiskBuff]),512 LN_DSD04: sub wptr ([cbDiskBuff]),bx add wptr ([pDiskBuff]),bx LN_DSD05: pop wptr ([fBufferFlags]) or ax,ax ret ;------------------------------------------------------------------------- ; LN_FReadFcb() ;------------------------------------------------------------------------- ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. LN_FReadFcb: or wptr ([fBufferFlags]),maskfUsedStraightLocal push cx push si push di mov si,offset [DiskBuff+512] mov di,offset [DiskBuff] mov cx,256 rep movsw pop di pop si pop cx push dx push bx push cx mov bx,wptr ([doshndCur]) mov dx,offset [DiskBuff+512] mov cx,512 mov ah,03Fh ;Sequential disk read int 21h mov dx,00000h pop cx pop bx jc LN_FRF02 or ax,ax jle LN_FRF02 cmp ax,512 jbe LN_FRF01 int 3 db 'BV5' LN_FRF01: add wptr ([LO_posCur]),512 adc wptr ([HI_posCur]),0 push di push cx mov di,offset [DiskBuff+1024] mov cx,512 sub cx,ax sub di,cx mov al,000h rep stosb not dx pop cx pop di LN_FRF02: xchg ax,dx pop dx or ax,ax ret ;------------------------------------------------------------------------- ; LN_CloseFcb() ;------------------------------------------------------------------------- ; LN_CloseFcb closes doshndCur. No registers are altered. LN_CloseFcb: cmp wptr ([doshndCur]),0FFFFh jne LN_CF01 int 3 db 'BV6' LN_CF01: cmp wptr ([fBufferFlags]),maskfUsedForStructLocal + maskfUsedStraightLocal jne LN_CF02 int 3 db 'BV7' LN_CF02: push bx push ax mov bx,0FFFFh xchg bx,wptr ([doshndCur]) mov ah,03Eh ;Close file int 21h pop ax pop bx ret ;------------------------------------------------------------------------- ; LN_HOpenDbgScreen() ;------------------------------------------------------------------------- ; %%Function:LN_HOpenDbgScreen %%Owner:BRADV cProc LN_HOpenDbgScreen,,<> cBegin ; Don't look at vdbs in this version because we're not DEBUG PUSH CS MOV AX,offset szCom1 PUSH AX mov AX,offset [BuffStart] PUSH DS PUSH AX MOV CX,00001h ;OF_WRITE PUSH CX cCall OpenFile,<> push cs pop ds push cs pop es cEnd EndOfFixedCode: ;------------------------------------------------------------------------- ; LN_ClearCSVariables() ;------------------------------------------------------------------------- ; %%Function:LN_ClearCSVariables %%Owner:BRADV cProc LN_ClearCSVariables,,<> cBegin push es push di push cx push ax push cs pop es mov di,offset CSVariables mov al,000h mov cx,cbCSVariables rep stosb cmp wptr (cs:[doshndCur]),-1 je LN_CCSV01 int 3 db 'BV2' LN_CCSV01: pop ax pop cx pop di pop es cEnd ;------------------------------------------------------------------------- ; LN_GetSnMac() ;------------------------------------------------------------------------- ; %%Function:LN_GetSnMac %%Owner:BRADV cProc LN_GetSnMac,,<> cBegin mov dx,offset szPcodeMap ; LN_FOpenFcb takes a pointer to an sz in [ds:dx] and returns ; zero if opening the file failed, and not zero if it succeeded. ; The disk transfer address is also set to [DiskBuff+512] ; ax is 0 upon return iff opening failed, no other registers altered. call LN_FOpenFcb je LN_GSM07 xor si,si ;iSn LN_GSM02: ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. call LN_FReadFcb je LN_GSM06 mov di,offset [DiskBuff+512] mov al,chLF mov cx,512 LN_GSM03: repne scasb jne LN_GSM02 inc si ;iSn jcxz LN_GSM02 jmp short LN_GSM03 LN_GSM06: ; LN_CloseFcb closes doshndCur. No registers are altered. call LN_CloseFcb xchg ax,si ;iSn LN_GSM07: mov wptr ([snMac]),ax cEnd ;------------------------------------------------------------------------- ; LN_GetTlbxMac() ;------------------------------------------------------------------------- ; %%Function:LN_GetTlbxMac %%Owner:BRADV cProc LN_GetTlbxMac,,<> cBegin mov dx,offset szToolbox ; LN_FOpenFcb takes a pointer to an sz in [ds:dx] and returns ; zero if opening the file failed, and not zero if it succeeded. ; The disk transfer address is also set to [DiskBuff+512] ; ax is 0 upon return iff opening failed, no other registers altered. call LN_FOpenFcb je LN_GTM11 LN_GTM01: ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. call LN_FReadFcb je LN_GTM10 mov dx,512 LN_GTM02: mov ax,0FFFFh or dx,dx jle LN_GTM10 push dx ; LN_FReadFcb takes a pointer to an sz in [ds:doshndCur] and returns ; zero if reading the file failed, and not zero if it succeeded. ; ax is 0 upon return iff reading failed, no other registers altered. call LN_FReadFcb pop cx mov dx,0 je LN_GTM03 mov dx,512 LN_GTM03: mov di,offset [DiskBuff] LN_GTM04: mov al,bptr [rgchtlbxMac] repne scasb jne LN_GTM02 push cx push di add cx,dx cmp cx,cbtlbxMac+5 ; after 'tlbxMac ' must not have junk jl LN_GTM057 LN_GTM053: dec di mov cx,cbtlbxMac mov si,offset rgchtlbxMac repe cmpsb je LN_GTM06 LN_GTM057: pop di pop cx jmp short LN_GTM04 LN_GTM06: xor ax,ax cwd mov si,di LN_GTM07: lodsb sub al,'0' cmp al,10 jae LN_GTM08 shl dx,1 mov cx,dx shl dx,1 shl dx,1 add dx,cx add dx,ax jmp short LN_GTM07 LN_GTM08: xchg ax,dx pop di pop cx LN_GTM10: ; LN_CloseFcb closes doshndCur. No registers are altered. call LN_CloseFcb LN_GTM11: mov wptr ([tlbxMac]),ax cEnd ;------------------------------------------------------------------------- ; LN_GetExeHead() ;------------------------------------------------------------------------- ; %%Function:LN_GetExeHead %%Owner:BRADV cProc LN_GetExeHead,,<> cBegin mov dx,offset szKernelSym ; LN_FOpenFcb takes a pointer to an sz in [ds:dx] and returns ; zero if opening the file failed, and not zero if it succeeded. ; The disk transfer address is also set to [DiskBuff+512] ; ax is 0 upon return iff opening failed, no other registers altered. call LN_FOpenFcb je LN_GEH03 mov ax,offset szHEXEHEAD push ax cCall LN_FFindSymbName,<> or ax,ax je LN_GEH02 LN_GEH01: mov bx,wptr ([SymDefSwap.sym_valSymdef]) mov wptr ([Off_hExeHead]),bx LN_GEH02: ; LN_CloseFcb closes doshndCur. No registers are altered. call LN_CloseFcb LN_GEH03: cEnd ;------------------------------------------------------------------------- ; LN_FFindSymbName( szSymbol ) ;------------------------------------------------------------------------- ; %%Function:LN_FFindSymbName %%Owner:BRADV cProc LN_FFindSymbName,,<> ParmW szSymbol LocalW iSeg LocalW iSym LocalW cbsz cBegin mov di,[szSymbol] mov cx,0FFFFh mov al,0 repne scasb dec di sub di,[szSymbol] mov [cbsz],di mov [iSeg],00001h LN_FFSN03: push [iSeg] cCall LN_FGetSegSymb,<> or ax,ax je LN_FFSN07 mov [iSym],00000h LN_FFSN04: mov ax,[iSym] cmp ax,wptr ([SegDefSwap.sym_cntSegdef]) jge LN_FFSN06 mov di,offset SymDefSwap mov cx,cbSymdef ; LN_ReadRgch reads cx bytes into [ds:di] and returns not zero if cx ; bytes have been read. ; only ax and di are altered. call LN_ReadRgch jz LN_FFSN07 mov di,offset [szSegName] mov cl,bptr ([SymDefSwap.nam_lenSymdef]) xor ch,ch ; LN_ReadRgch reads cx bytes into [ds:di] and returns not zero if cx ; bytes have been read. ; only ax and di are altered. call LN_ReadRgch jz LN_FFSN07 mov al,bptr ([SymDefSwap.nam_lenSymdef]) xor ah,ah cmp AX,[cbsz] jne LN_FFSN05 mov si,offset [szSegName] mov di,[szSymbol] mov cx,[cbsz] repe cmpsb ;FNeRgch mov ax,0FFFFh je LN_FFSN07 LN_FFSN05: inc [iSym] jmp short LN_FFSN04 LN_FFSN06: inc [iSeg] jmp short LN_FFSN03 LN_FFSN07: cEnd assumes ds,dgroup ;------------------------------------------------------------------------- ; InstallInt3FHandler( ) ;------------------------------------------------------------------------- ;/* I N S T A L L I N T 3 F H A N D L E R */ ; %%Function:InstallInt3FHandler %%Owner:BRADV cProc InstallInt3FHandler,,<> cBegin cmp wptr (ss:[hInt3FCode]),fFalse jne II3H02 push ds push es db 060h ;push all push cs pop ds push cs pop es call LN_GetSnMac or ax,ax je II3H01 call LN_GetTlbxMac or ax,ax je II3H01 call LN_GetExeHead or ax,ax je II3H01 mov ax,offset EndOfFixedCode cwd mov bx,GMEM_NOT_BANKED cCall GlobalAlloc, ;get fixed segment for int3fcode cmp ax,NULL je II3H01 ;return if segment non-existant mov wptr (ss:[hInt3fCode]),ax push cs pop ds mov es,ax mov cx,offset EndOfFixedCode xor si,si xor di,di rep movsb ;copy new int3f code in xor ax,ax mov ds,ax mov si,3Fh*4 mov di,offset Int3fAddress movsw movsw ;copy old int3f into handler mov bx,3fh*4 mov wptr ([bx]),offset Int3fHandler mov wptr ([bx+2]),es II3H01: call LN_ClearCSVariables db 061h ;pop all pop es pop ds jmp short II3H03 II3H02: push ds push es db 060h ;push all xor ax,ax mov es,ax mov ds,wptr (ss:[hInt3fCode]) mov si,offset Int3fAddress mov di,3Fh*4 movsw movsw cCall GlobalFree, db 061h ;pop all pop es pop ds II3H03: cEnd ; End of InstallInt3FHandler sEnd int3f end ",16268,True,3389.6191006076083,median "[MusicConfig] Location=535272 Orange Heart(cv-Honda Mariko) Neptune(cv-Tanaka Rie) - Mousou Katharsis/audio.mp3 Extension=mp3 MD5=b4‌​79‌​54‌​cd‌​e2‌​f1‌​ac‌​e3‌​fe‌​c6‌​fa‌​aa‌​6d‌​1c‌​f4‌​8e Source=OSU MetreNumber=4 Title=Mousou Katharsis [TagConfig] Tagger=Carra Time=2017/1/19 13:55:20 Confidence=4 [MiscConfig] LinkedFile=535272 Orange Heart(cv-Honda Mariko) Neptune(cv-Tanaka Rie) - Mousou Katharsis/Orange Heart(cvHonda Mariko) Neptune(cvTanaka Rie) - Mousou Katharsis (Shurelia) [Hard].osu osuMapID=535272 [BeatInfo] Count=379 Beat_0={0.511,1,Eb Maj,Ab} Beat_1={1.2427073170731711,0,Eb Maj,Ab} Beat_2={1.974414634146342,0,Eb Maj,Eb} Beat_3={2.7061219512195129,0,Eb Maj,Eb} Beat_4={3.4378292682926839,1,Eb Maj,Bb} Beat_5={4.1695365853658553,0,Eb Maj,Bb} Beat_6={4.9012439024390266,0,Eb Maj,Cm} Beat_7={5.632951219512198,0,Eb Maj,Cm} Beat_8={6.3646585365853694,1,Eb Maj,Ab} Beat_9={7.0963658536585408,0,Eb Maj,Ab} Beat_10={7.8280731707317122,0,Eb Maj,Eb} Beat_11={8.5597804878048827,0,Eb Maj,Eb} Beat_12={9.291487804878054,1,Eb Maj,Bb} Beat_13={10.023195121951225,0,Eb Maj,Bb} Beat_14={10.754902439024397,0,Eb Maj,Cm} Beat_15={11.486609756097568,0,Eb Maj,Cm} Beat_16={12.21831707317074,1,Eb Maj,Ab} Beat_17={12.950024390243911,0,Eb Maj,Ab} Beat_18={13.681731707317082,0,Eb Maj,Eb} Beat_19={14.413439024390254,0,Eb Maj,Eb} Beat_20={15.145146341463425,1,Eb Maj,Bb} Beat_21={15.876853658536597,0,Eb Maj,Bb} Beat_22={16.608560975609766,0,Eb Maj,Cm} Beat_23={17.340268292682936,0,Eb Maj,Cm} Beat_24={18.071975609756105,1,Eb Maj,Ab} Beat_25={18.803682926829275,0,Eb Maj,Ab} Beat_26={19.535390243902444,0,Eb Maj,Eb} Beat_27={20.267097560975614,0,Eb Maj,Eb} Beat_28={20.998804878048784,1,Eb Maj,Bb} Beat_29={21.730512195121953,0,Eb Maj,Bb} Beat_30={22.462219512195123,0,Eb Maj,Bb} Beat_31={23.193926829268293,0,Eb Maj,Bb} Beat_32={23.925634146341462,1,Eb Maj,Ab} Beat_33={24.657341463414632,0,Eb Maj,Ab} Beat_34={25.3890487804878,0,Eb Maj,Eb} Beat_35={26.120756097560971,0,Eb Maj,Eb} Beat_36={26.852463414634141,1,Eb Maj,Bb} Beat_37={27.58417073170731,0,Eb Maj,Bb} Beat_38={28.31587804878048,0,Eb Maj,Cm} Beat_39={29.047585365853649,0,Eb Maj,Cm} Beat_40={29.779292682926819,1,Eb Maj,Ab} Beat_41={30.510999999999989,0,Eb Maj,Ab} Beat_42={31.242707317073158,0,Eb Maj,Eb} Beat_43={31.974414634146328,0,Eb Maj,Eb} Beat_44={32.7061219512195,1,Eb Maj,Bb} Beat_45={33.437829268292674,0,Eb Maj,Bb} Beat_46={34.169536585365847,0,Eb Maj,Cm} Beat_47={34.90124390243902,0,Eb Maj,Cm} Beat_48={35.632951219512194,1,Eb Maj,Ab} Beat_49={36.364658536585367,0,Eb Maj,Ab} Beat_50={37.09636585365854,0,Eb Maj,Eb} Beat_51={37.828073170731713,0,Eb Maj,Eb} Beat_52={38.559780487804886,1,Eb Maj,Bb} Beat_53={39.291487804878059,0,Eb Maj,Bb} Beat_54={40.023195121951233,0,Eb Maj,Cm} Beat_55={40.754902439024406,0,Eb Maj,Cm} Beat_56={41.486609756097579,1,Eb Maj,Fm} Beat_57={42.218317073170752,0,Eb Maj,Fm} Beat_58={42.950024390243925,0,Eb Maj,Fm} Beat_59={43.6817317073171,0,Eb Maj,Fm} Beat_60={44.413439024390271,1,Eb Maj,Bb} Beat_61={45.145146341463445,0,Eb Maj,Bb} Beat_62={45.876853658536618,0,Eb Maj,Bb} Beat_63={46.608560975609791,0,Eb Maj,Bb} Beat_64={47.340268292682964,1,Eb Maj,Ab} Beat_65={48.071975609756137,0,Eb Maj,Ab} Beat_66={48.80368292682931,0,Eb Maj,Eb} Beat_67={49.535390243902484,0,Eb Maj,Eb} Beat_68={50.267097560975657,1,Eb Maj,Bb} Beat_69={50.99880487804883,0,Eb Maj,Bb} Beat_70={51.730512195122,0,Eb Maj,Cm} Beat_71={52.462219512195176,0,Eb Maj,Cm} Beat_72={53.193926829268349,1,Eb Maj,Ab} Beat_73={53.925634146341523,0,Eb Maj,Ab} Beat_74={54.657341463414696,0,Eb Maj,Eb} Beat_75={55.389048780487869,0,Eb Maj,Eb} Beat_76={56.120756097561042,1,Eb Maj,Bb} Beat_77={56.852463414634215,0,Eb Maj,Bb} Beat_78={57.584170731707388,0,Eb Maj,Cm} Beat_79={58.315878048780561,0,Eb Maj,Cm} Beat_80={59.047585365853735,1,Eb Maj,Ab} Beat_81={59.779292682926908,0,Eb Maj,Ab} Beat_82={60.511000000000081,0,Eb Maj,Eb} Beat_83={61.242707317073254,0,Eb Maj,Eb} Beat_84={61.974414634146427,1,Eb Maj,Bb} Beat_85={62.7061219512196,0,Eb Maj,Bb} Beat_86={63.437829268292774,0,Eb Maj,Cm} Beat_87={64.169536585365947,0,Eb Maj,Cm} Beat_88={64.90124390243912,1,Eb Maj,Ab} Beat_89={65.6329512195123,0,Eb Maj,Ab} Beat_90={66.364658536585466,0,Eb Maj,Eb} Beat_91={67.096365853658639,0,Eb Maj,Eb} Beat_92={67.828073170731813,1,Eb Maj,Bb} Beat_93={68.559780487804986,0,Eb Maj,Bb} Beat_94={69.291487804878159,0,Eb Maj,Cm} Beat_95={70.023195121951332,0,Eb Maj,Cm} Beat_96={70.7549024390245,1,Eb Maj,Ab} Beat_97={71.486609756097678,0,Eb Maj,Ab} Beat_98={72.218317073170851,0,Eb Maj,Eb} Beat_99={72.950024390244025,0,Eb Maj,Eb} Beat_100={73.6817317073172,1,Eb Maj,Eb} Beat_101={74.413439024390371,0,Eb Maj,Eb} Beat_102={75.145146341463544,0,Eb Maj,Eb} Beat_103={75.876853658536717,0,Eb Maj,Eb} Beat_104={76.60856097560989,1,Eb Maj,Bbsus4} Beat_105={77.340268292683064,0,Eb Maj,Bbsus4} Beat_106={78.071975609756237,0,Eb Maj,Bbsus4} Beat_107={78.80368292682941,0,Eb Maj,Bbsus4} Beat_108={79.535390243902583,1,Eb Maj,Bb} Beat_109={80.267097560975756,0,Eb Maj,Bb} Beat_110={80.998804878048929,0,Eb Maj,Bb} Beat_111={81.7305121951221,0,Eb Maj,Bb} Beat_112={82.462219512195276,1,Eb Maj,Ab} Beat_113={83.193926829268449,0,Eb Maj,Ab} Beat_114={83.925634146341622,0,Eb Maj,Eb} Beat_115={84.6573414634148,0,Eb Maj,Eb} Beat_116={85.389048780487968,1,Eb Maj,Bb} Beat_117={86.120756097561141,0,Eb Maj,Bb} Beat_118={86.852463414634315,0,Eb Maj,Cm} Beat_119={87.584170731707488,0,Eb Maj,Cm} Beat_120={88.315878048780661,1,Eb Maj,Ab} Beat_121={89.047585365853834,0,Eb Maj,Ab} Beat_122={89.779292682927007,0,Eb Maj,Eb} Beat_123={90.51100000000018,0,Eb Maj,Eb} Beat_124={91.242707317073354,1,Eb Maj,Bb} Beat_125={91.974414634146527,0,Eb Maj,Bb} Beat_126={92.7061219512197,0,Eb Maj,Cm} Beat_127={93.437829268292873,0,Eb Maj,Cm} Beat_128={94.169536585366046,1,Eb Maj,Ab} Beat_129={94.901243902439219,0,Eb Maj,Ab} Beat_130={95.632951219512393,0,Eb Maj,Eb} Beat_131={96.364658536585566,0,Eb Maj,Eb} Beat_132={97.096365853658739,1,Eb Maj,Bb} Beat_133={97.828073170731912,0,Eb Maj,Bb} Beat_134={98.559780487805085,0,Eb Maj,Cm} Beat_135={99.291487804878258,0,Eb Maj,Cm} Beat_136={100.02319512195143,1,Eb Maj,Fm} Beat_137={100.75490243902461,0,Eb Maj,Fm} Beat_138={101.48660975609778,0,Eb Maj,Fm} Beat_139={102.21831707317095,0,Eb Maj,Fm} Beat_140={102.95002439024412,1,Eb Maj,Bb} Beat_141={103.6817317073173,0,Eb Maj,Bb} Beat_142={104.41343902439047,0,Eb Maj,Bb} Beat_143={105.14514634146364,0,Eb Maj,Bb} Beat_144={105.87685365853682,1,Eb Maj,Bb} Beat_145={106.608,1,Eb Maj,Ab} Beat_146={107.33970731707318,0,Eb Maj,Ab} Beat_147={108.07141463414635,0,Eb Maj,Eb} Beat_148={108.80312195121952,0,Eb Maj,Eb} Beat_149={109.5348292682927,1,Eb Maj,Bb} Beat_150={110.26653658536587,0,Eb Maj,Bb} Beat_151={110.99824390243904,0,Eb Maj,Cm} Beat_152={111.72995121951222,0,Eb Maj,Cm} Beat_153={112.46165853658539,1,Eb Maj,Ab} Beat_154={113.19336585365856,0,Eb Maj,Ab} Beat_155={113.92507317073174,0,Eb Maj,Eb} Beat_156={114.65678048780491,0,Eb Maj,Eb} Beat_157={115.38848780487808,1,Eb Maj,Bb} Beat_158={116.12019512195126,0,Eb Maj,Bb} Beat_159={116.85190243902443,0,Eb Maj,Cm} Beat_160={117.5836097560976,0,Eb Maj,Cm} Beat_161={118.31531707317078,1,Eb Maj,Ab} Beat_162={119.04702439024395,0,Eb Maj,Ab} Beat_163={119.77873170731712,0,Eb Maj,Eb} Beat_164={120.51043902439029,0,Eb Maj,Eb} Beat_165={121.24214634146347,1,Eb Maj,Bb} Beat_166={121.97385365853664,0,Eb Maj,Bb} Beat_167={122.70556097560981,0,Eb Maj,Cm} Beat_168={123.43726829268299,0,Eb Maj,Cm} Beat_169={124.16897560975616,1,Eb Maj,Ab} Beat_170={124.90068292682933,0,Eb Maj,Ab} Beat_171={125.63239024390251,0,Eb Maj,Eb} Beat_172={126.36409756097568,0,Eb Maj,Eb} Beat_173={127.09580487804885,1,Eb Maj,Bb} Beat_174={127.82751219512203,0,Eb Maj,Bb} Beat_175={128.5592195121952,0,Eb Maj,Cm} Beat_176={129.29092682926836,0,Eb Maj,Cm} Beat_177={130.02263414634152,1,Eb Maj,C#} Beat_178={130.75434146341468,0,Eb Maj,C#} Beat_179={131.48604878048784,0,Eb Maj,C#} Beat_180={132.217756097561,0,Eb Maj,C#} Beat_181={132.94946341463415,1,Eb Maj,Eb} Beat_182={133.68117073170731,0,Eb Maj,Eb} Beat_183={134.41287804878047,0,Eb Maj,Eb} Beat_184={135.14458536585363,0,Eb Maj,Eb} Beat_185={135.87629268292679,1,Eb Maj,C#} Beat_186={136.60799999999995,0,Eb Maj,C#} Beat_187={137.33970731707311,0,Eb Maj,C#} Beat_188={138.07141463414627,0,Eb Maj,C#} Beat_189={138.80312195121942,1,Eb Maj,Eb} Beat_190={139.53482926829258,0,Eb Maj,Eb} Beat_191={140.26653658536574,0,Eb Maj,Eb} Beat_192={140.9982439024389,0,Eb Maj,Eb} Beat_193={141.72995121951206,1,Eb Maj,C#} Beat_194={142.46165853658522,0,Eb Maj,C#} Beat_195={143.19336585365838,0,Eb Maj,C#} Beat_196={143.92507317073154,0,Eb Maj,C#} Beat_197={144.6567804878047,1,Eb Maj,Eb} Beat_198={145.38848780487786,0,Eb Maj,Eb} Beat_199={146.120195121951,0,Eb Maj,Eb} Beat_200={146.85190243902417,0,Eb Maj,Eb} Beat_201={147.58360975609733,1,Eb Maj,C#} Beat_202={148.31531707317049,0,Eb Maj,C#} Beat_203={149.04702439024365,0,Eb Maj,C#} Beat_204={149.77873170731681,0,Eb Maj,C#} Beat_205={150.51043902438997,1,Eb Maj,C} Beat_206={151.24214634146313,0,Eb Maj,C} Beat_207={151.97385365853629,0,Eb Maj,C} Beat_208={152.70556097560944,0,Eb Maj,C} Beat_209={153.4372682926826,1,F Maj,Bb} Beat_210={154.16897560975576,0,F Maj,Bb} Beat_211={154.90068292682892,0,F Maj,Am} Beat_212={155.63239024390208,0,F Maj,Am} Beat_213={156.36409756097524,1,F Maj,Gm} Beat_214={157.0958048780484,0,F Maj,Gm} Beat_215={157.82751219512156,0,F Maj,F} Beat_216={158.55921951219472,0,F Maj,F} Beat_217={159.29092682926788,1,F Maj,Bb} Beat_218={160.02263414634103,0,F Maj,Bb} Beat_219={160.75434146341419,0,F Maj,C} Beat_220={161.48604878048735,0,F Maj,C} Beat_221={162.21775609756051,1,F Maj,Dm} Beat_222={162.94946341463367,0,F Maj,Dm} Beat_223={163.68117073170683,0,F Maj,F} Beat_224={164.41287804878,0,F Maj,F} Beat_225={165.14458536585315,1,F Maj,Bb} Beat_226={165.87629268292631,0,F Maj,Bb} Beat_227={166.60799999999946,0,F Maj,Am} Beat_228={167.33970731707262,0,F Maj,Am} Beat_229={168.07141463414578,1,F Maj,Gm} Beat_230={168.80312195121894,0,F Maj,Gm} Beat_231={169.5348292682921,0,F Maj,F} Beat_232={170.26653658536526,0,F Maj,F} Beat_233={170.99824390243842,1,F Maj,Bb} Beat_234={171.72995121951158,0,F Maj,Bb} Beat_235={172.46165853658474,0,F Maj,Bb} Beat_236={173.1933658536579,0,F Maj,Bb} Beat_237={173.92507317073105,1,F Maj,G} Beat_238={174.65678048780421,0,F Maj,G} Beat_239={175.38848780487737,0,F Maj,G} Beat_240={176.12019512195053,0,F Maj,G} Beat_241={176.85190243902369,1,F Maj,G} Beat_242={177.58360975609685,0,F Maj,G} Beat_243={178.315,1,Eb Maj,Ab} Beat_244={179.04670731707316,0,Eb Maj,Ab} Beat_245={179.77841463414632,0,Eb Maj,Eb} Beat_246={180.51012195121948,0,Eb Maj,Eb} Beat_247={181.24182926829263,1,Eb Maj,Bb} Beat_248={181.97353658536579,0,Eb Maj,Bb} Beat_249={182.70524390243895,0,Eb Maj,Cm} Beat_250={183.43695121951211,0,Eb Maj,Cm} Beat_251={184.16865853658527,1,Eb Maj,Ab} Beat_252={184.90036585365843,0,Eb Maj,Ab} Beat_253={185.63207317073159,0,Eb Maj,Eb} Beat_254={186.36378048780475,0,Eb Maj,Eb} Beat_255={187.09548780487791,1,Eb Maj,Bb} Beat_256={187.82719512195106,0,Eb Maj,Bb} Beat_257={188.55890243902422,0,Eb Maj,Cm} Beat_258={189.29060975609738,0,Eb Maj,Cm} Beat_259={190.02231707317054,1,Eb Maj,Ab} Beat_260={190.7540243902437,0,Eb Maj,Ab} Beat_261={191.48573170731686,0,Eb Maj,Eb} Beat_262={192.21743902439002,0,Eb Maj,Eb} Beat_263={192.94914634146318,1,Eb Maj,Bb} Beat_264={193.68085365853634,0,Eb Maj,Bb} Beat_265={194.4125609756095,0,Eb Maj,Cm} Beat_266={195.14426829268265,0,Eb Maj,Cm} Beat_267={195.87597560975581,1,Eb Maj,Ab} Beat_268={196.60768292682897,0,Eb Maj,Ab} Beat_269={197.33939024390213,0,Eb Maj,Eb} Beat_270={198.07109756097529,0,Eb Maj,Eb} Beat_271={198.80280487804845,1,Eb Maj,Bb} Beat_272={199.53451219512161,0,Eb Maj,Bb} Beat_273={200.26621951219477,0,Eb Maj,Cm} Beat_274={200.99792682926793,0,Eb Maj,Cm} Beat_275={201.72963414634108,1,Eb Maj,Ab} Beat_276={202.46134146341424,0,Eb Maj,Ab} Beat_277={203.1930487804874,0,Eb Maj,Eb} Beat_278={203.92475609756056,0,Eb Maj,Eb} Beat_279={204.65646341463372,1,Eb Maj,Bb} Beat_280={205.38817073170688,0,Eb Maj,Bb} Beat_281={206.11987804878004,0,Eb Maj,Cm} Beat_282={206.8515853658532,0,Eb Maj,Cm} Beat_283={207.58329268292636,1,Eb Maj,Ab} Beat_284={208.31499999999952,0,Eb Maj,Ab} Beat_285={209.04670731707267,0,Eb Maj,Eb} Beat_286={209.77841463414583,0,Eb Maj,Eb} Beat_287={210.510121951219,1,Eb Maj,Bb} Beat_288={211.24182926829215,0,Eb Maj,Bb} Beat_289={211.97353658536531,0,Eb Maj,Cm} Beat_290={212.70524390243847,0,Eb Maj,Cm} Beat_291={213.43695121951163,1,Eb Maj,Ab} Beat_292={214.16865853658479,0,Eb Maj,Ab} Beat_293={214.90036585365795,0,Eb Maj,Eb} Beat_294={215.6320731707311,0,Eb Maj,Eb} Beat_295={216.36378048780426,1,Eb Maj,Bb} Beat_296={217.09548780487742,0,Eb Maj,Bb} Beat_297={217.82719512195058,0,Eb Maj,Cm} Beat_298={218.55890243902374,0,Eb Maj,Cm} Beat_299={219.2906097560969,1,Eb Maj,Ab} Beat_300={220.02231707317006,0,Eb Maj,Ab} Beat_301={220.75402439024322,0,Eb Maj,Eb} Beat_302={221.48573170731638,0,Eb Maj,Eb} Beat_303={222.21743902438954,1,Eb Maj,Bb} Beat_304={222.94914634146269,0,Eb Maj,Bb} Beat_305={223.68085365853585,0,Eb Maj,Cm} Beat_306={224.412560975609,0,Eb Maj,Cm} Beat_307={225.14426829268217,1,Eb Maj,Ab} Beat_308={225.87597560975533,0,Eb Maj,Ab} Beat_309={226.60768292682849,0,Eb Maj,Eb} Beat_310={227.33939024390165,0,Eb Maj,Eb} Beat_311={228.07109756097481,1,Eb Maj,Bb} Beat_312={228.80280487804797,0,Eb Maj,Bb} Beat_313={229.53451219512112,0,Eb Maj,Cm} Beat_314={230.26621951219428,0,Eb Maj,Cm} Beat_315={230.99792682926744,1,Eb Maj,Ab} Beat_316={231.7296341463406,0,Eb Maj,Ab} Beat_317={232.46134146341376,0,Eb Maj,Eb} Beat_318={233.19304878048692,0,Eb Maj,Eb} Beat_319={233.92475609756008,1,Eb Maj,Bb} Beat_320={234.65646341463324,0,Eb Maj,Bb} Beat_321={235.3881707317064,0,Eb Maj,Cm} Beat_322={236.11987804877956,0,Eb Maj,Cm} Beat_323={236.85158536585271,1,Eb Maj,Ab} Beat_324={237.58329268292587,0,Eb Maj,Ab} Beat_325={238.31499999999903,0,Eb Maj,Eb} Beat_326={239.04670731707219,0,Eb Maj,Eb} Beat_327={239.77841463414535,1,Eb Maj,Bb} Beat_328={240.51012195121851,0,Eb Maj,Bb} Beat_329={241.24182926829167,0,Eb Maj,Cm} Beat_330={241.97353658536483,0,Eb Maj,Cm} Beat_331={242.70524390243799,1,Eb Maj,Ab} Beat_332={243.43695121951114,0,Eb Maj,Ab} Beat_333={244.1686585365843,0,Eb Maj,Eb} Beat_334={244.90036585365746,0,Eb Maj,Eb} Beat_335={245.63207317073062,1,Eb Maj,Bb} Beat_336={246.36378048780378,0,Eb Maj,Bb} Beat_337={247.09548780487694,0,Eb Maj,Cm} Beat_338={247.8271951219501,0,Eb Maj,Cm} Beat_339={248.55890243902326,1,Eb Maj,Ab} Beat_340={249.29060975609642,0,Eb Maj,Ab} Beat_341={250.02231707316958,0,Eb Maj,Eb} Beat_342={250.75402439024273,0,Eb Maj,Eb} Beat_343={251.48573170731589,1,Eb Maj,Bb} Beat_344={252.21743902438905,0,Eb Maj,Bb} Beat_345={252.94914634146221,0,Eb Maj,Cm} Beat_346={253.68085365853537,0,Eb Maj,Cm} Beat_347={254.41256097560853,1,Eb Maj,Ab} Beat_348={255.14426829268169,0,Eb Maj,Ab} Beat_349={255.87597560975485,0,Eb Maj,Eb} Beat_350={256.60768292682803,0,Eb Maj,Eb} Beat_351={257.33939024390122,1,Eb Maj,Bb} Beat_352={258.07109756097441,0,Eb Maj,Bb} Beat_353={258.8028048780476,0,Eb Maj,Cm} Beat_354={259.53451219512078,0,Eb Maj,Cm} Beat_355={260.26621951219397,1,Eb Maj,Ab} Beat_356={260.99792682926716,0,Eb Maj,Ab} Beat_357={261.72963414634035,0,Eb Maj,Eb} Beat_358={262.46134146341353,0,Eb Maj,Eb} Beat_359={263.19304878048672,1,Eb Maj,Bb} Beat_360={263.92475609755991,0,Eb Maj,Bb} Beat_361={264.65646341463309,0,Eb Maj,Cm} Beat_362={265.38817073170628,0,Eb Maj,Cm} Beat_363={266.11987804877947,1,Eb Maj,Ab} Beat_364={266.85158536585266,0,Eb Maj,Ab} Beat_365={267.58329268292584,0,Eb Maj,Eb} Beat_366={268.31499999999903,0,Eb Maj,Eb} Beat_367={269.04670731707222,1,Eb Maj,Bb} Beat_368={269.77841463414541,0,Eb Maj,Bb} Beat_369={270.51012195121859,0,Eb Maj,Cm} Beat_370={271.24182926829178,0,Eb Maj,Cm} Beat_371={271.97353658536497,1,Eb Maj,N} Beat_372={272.70524390243816,0,Eb Maj,N} Beat_373={273.43695121951134,0,Eb Maj,N} Beat_374={274.16865853658453,0,Eb Maj,N} Beat_375={274.90036585365772,1,Eb Maj,N} Beat_376={275.63207317073091,0,Eb Maj,N} Beat_377={276.36378048780409,0,Eb Maj,N} Beat_378={277.09548780487728,0,Eb Maj,N} ",12112,True,4114.649039708009,median "#include #include // didn't help: #define FASTLED_ALLOW_INTERRUPTS 0 // totally broken: #define FASTLED_INTERRUPT_RETRY_COUNT 1 #include #include ""fadeController.h"" #define WIFI 1 const char compileDate[] = __DATE__ "" "" __TIME__; /* Andrew Stone 2021 A simple web server that lets you blink an LED via the web. This sketch will print the IP address of your WiFi Shield (once connected) to the Serial monitor. From there, you can open that address in a web browser to turn on and off the LED on pin 5. If the IP address of your shield is yourAddress: http://yourAddress/H turns the LED on http://yourAddress/L turns it off This example is written for a network using WPA encryption. For WEP or WPA, change the Wifi.begin() call accordingly. Circuit: * WiFi shield attached * LED attached to pin 5 created for arduino 25 Nov 2012 by Tom Igoe ported for sparkfun esp32 31.01.2017 by Jan Hendrik Berlin Based on Modifications Copyright (c) 2017-2019 Martin F. Falatic Based on public domain code created 19 Nov 2016 by Chris Osborn xttp://insentricity.com */ /* * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the ""Software""), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #define COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) const int LedCtrlPort = 1225; const int LedCtrlMaxClients = 2; const String ssid = ""ChristmasCoder""; const String password = """"; // Change this to configure what the minimum signal strength you are willing to connect to is const int MinRssi = -75; const int OnboardLed = 2; const int LevelShiftEnable = 32; #pragma GCC diagnostic pop const int MIN_CNXN_FILL_INTERVAL = 1000; #define DEFAULT_NUM_STRANDS 3 // COUNT_OF(strands); #define NUM_LEDS_PER_STRAND 300 //#define NUM_LEDS (DEFAULT_NUM_STRANDS * NUM_LEDS_PER_STRAND) size_t NumLeds = 0; WiFiServer server(LedCtrlPort, LedCtrlMaxClients); WiFiClient clients[LedCtrlMaxClients]; // Define the array of leds CRGB *leds = nullptr; FadeController *fader = nullptr; bool FLon = true; // Turn off LED driving int64_t lastDelay = 0; typedef struct { unsigned int magic; unsigned int numStrands; unsigned int ledsPerStrand; char boardName[32]; } ConfigData; ConfigData configData; //************************************************************************** //extern volatile uint64_t fastLEDlastFillDuration; //extern volatile uint64_t fastLEDfillDuration; //extern volatile uint32_t fastLEDnumFills; void dumpSysInfo() { esp_chip_info_t sysinfo; esp_chip_info(&sysinfo); Serial.print(""ESP32 Model: ""); Serial.print((int)sysinfo.model); Serial.print(""; Features: 0x""); Serial.print((int)sysinfo.features, HEX); Serial.print(""; Cores: ""); Serial.print((int)sysinfo.cores); Serial.print(""; Revision: r""); Serial.println((int)sysinfo.revision); } void AdvertiseServices(const char *MyName) { if (MDNS.begin(MyName)) { Serial.println(F(""mDNS responder started"")); Serial.print(F(""I am: "")); Serial.println(MyName); // Add service to MDNS-SD MDNS.addService(""xmascoder"", ""tcp"", LedCtrlPort); } else { while (1) { Serial.println(F(""Error setting up MDNS responder"")); delay(1000); } } } /* void logWiFis() { // Set WiFi to station mode and disconnect from an AP if it was previously connected WiFi.mode(WIFI_STA); WiFi.disconnect(); delay(100); int n = WiFi.scanNetworks(); Serial.println(""scan done""); if (n == 0) { Serial.println(""no networks found""); } else { Serial.print(n); Serial.println("" networks found""); for (int i = 0; i < n; ++i) { // Print SSID and RSSI for each network found Serial.print(i + 1); Serial.print("": ""); Serial.print(WiFi.SSID(i)); Serial.print("" (""); Serial.print(WiFi.RSSI(i)); Serial.print("")""); Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?"" "":""*""); delay(10); } } } */ // Prints what WiFis I can hear. Returns the strongest open network, unless the preferred is available and above the minimum. // DISCONNECTS from WIFI!!! String AnalyzeWiFis(String preferred = String()) { // Set WiFi to station mode and disconnect from an AP if it was previously connected WiFi.mode(WIFI_STA); WiFi.disconnect(); delay(100); int n = WiFi.scanNetworks(); Serial.println(""scan done""); if (n == 0) { Serial.println(""no networks found""); } else { Serial.print(n); Serial.println("" networks found""); int preferredIdx = -1; int maxRssiIdx = -1; for (int i = 0; i < n; ++i) { if (WiFi.SSID(i) == preferred) preferredIdx = i; // Find the strongest open network if (WiFi.encryptionType(i) == WIFI_AUTH_OPEN) if ((maxRssiIdx==-1) || (WiFi.RSSI(maxRssiIdx) < WiFi.RSSI(i))) maxRssiIdx = i; // Print SSID and RSSI for each network found Serial.print(i); Serial.print("": ""); Serial.print(WiFi.SSID(i)); Serial.print("" (""); Serial.print(WiFi.RSSI(i)); Serial.print("")""); Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?"" "":""*""); } // If our preferred is available and strong enough, return it. if ((preferredIdx >= 0) && WiFi.RSSI(preferredIdx) >= MinRssi) return preferred; // Otherwise return the strongest open connection if (maxRssiIdx != -1) return WiFi.SSID(maxRssiIdx); } return String(); } void WiFiConnector() { if (WiFi.status() != WL_CONNECTED) { Serial.println(WiFi.status()); Serial.print(""I am ""); Serial.println(configData.boardName); String connectTo = AnalyzeWiFis(String(ssid)); if (connectTo != """") { if ((connectTo == ssid)&&(password != """")) WiFi.begin(ssid.c_str(), password.c_str()); else WiFi.begin(connectTo.c_str()); Serial.print(""Connecting to ""); Serial.println(connectTo); size_t tries = 0; while ((WiFi.status() != WL_CONNECTED) && (tries < 100)) { digitalWrite(OnboardLed,tries&1); delay(100); Serial.print("".""); if (tries&127 == 0) Serial.print(""\\n""); tries++; } if (WiFi.status() == WL_CONNECTED) { Serial.println(""""); Serial.println(""WiFi connected.""); Serial.println(""IP address: ""); Serial.println(WiFi.localIP()); AdvertiseServices(BoardName()); server.setNoDelay(true); server.begin(); } else Serial.println(""WiFi cannot connect""); } else { Debug.print(DBG_INFO,""No WiFi candidates""); } } } bool initStrands() { NumLeds = configData.numStrands * configData.ledsPerStrand; Debug.print(DBG_INFO,""%d Strands, %d LEDs per strand, %d total"", configData.numStrands, configData.ledsPerStrand, NumLeds); leds = new CRGB[NumLeds]; if (FLon) { if (configData.numStrands > 0) { FastLED.addLeds(leds, 0 * configData.ledsPerStrand, configData.ledsPerStrand); Debug.print(DBG_INFO,""Initialized strand 0 at pin 13 with %d LEDs"", configData.ledsPerStrand); } if (configData.numStrands > 1) { FastLED.addLeds(leds, 1 * configData.ledsPerStrand, configData.ledsPerStrand); Debug.print(DBG_INFO,""Initialized strand 1 at pin 14 with %d LEDs"", configData.ledsPerStrand); } if (configData.numStrands > 2) { FastLED.addLeds(leds, 2 * configData.ledsPerStrand, configData.ledsPerStrand); Debug.print(DBG_INFO,""Initialized strand 2 at pin 15 with %d LEDs"", configData.ledsPerStrand); } if (configData.numStrands > 3) { FastLED.addLeds(leds, 3 * configData.ledsPerStrand, configData.ledsPerStrand); Debug.print(DBG_INFO,""Initialized strand 3 at pin 16 with %d LEDs"", configData.ledsPerStrand); } if (configData.numStrands > 4) { FastLED.addLeds(leds, 4 * configData.ledsPerStrand, configData.ledsPerStrand); Debug.print(DBG_INFO,""Initialized strand 3 at pin 17 with %d LEDs"", configData.ledsPerStrand); } if (configData.numStrands > 5) { FastLED.addLeds(leds, 5 * configData.ledsPerStrand, configData.ledsPerStrand); Debug.print(DBG_INFO,""Initialized strand 3 at pin 18 with %d LEDs"", configData.ledsPerStrand); } if (configData.numStrands > 6) { FastLED.addLeds(leds, 6 * configData.ledsPerStrand, configData.ledsPerStrand); Debug.print(DBG_INFO,""Initialized strand 3 at pin 21 with %d LEDs"", configData.ledsPerStrand); } if (configData.numStrands > 7) { FastLED.addLeds(leds, 7 * configData.ledsPerStrand, configData.ledsPerStrand); Debug.print(DBG_INFO,""Initialized strand 3 at pin 22 with %d LEDs"", configData.ledsPerStrand); } } return true; } uint16_t GetDeviceId() { #if defined(ARDUINO_ARCH_ESP32) return ESP.getEfuseMac(); #else return ESP.getChipId(); #endif } const void WriteEEPROM() { configData.magic = 7227; unsigned char* ptr = (unsigned char*) &configData; for (int i = 0; i< sizeof(ConfigData); i++) { EEPROM.write(i, *(ptr+i)); } EEPROM.commit(); } const void ReadEEPROM() { unsigned char* ptr = (unsigned char*) &configData; for (int i = 0; i< sizeof(ConfigData); i++) { *(ptr+i) = EEPROM.read(i); } } const char* BoardName() { if (configData.magic != 7227) return ""rudolf""; else return configData.boardName; } void faderLoopTask(void * parameter) { while(1) { if (fader) fader->loop(); if (FLon) FastLED.show(); vTaskDelay(10 / portTICK_PERIOD_MS); } } void LoopTask(void * parameter); void setup() { pinMode(LevelShiftEnable, OUTPUT); digitalWrite(LevelShiftEnable,HIGH); // Disable Serial.begin(115200); //Serial.begin(57600); Serial.print(""\\n\\nChristmas Coder | G. Andrew Stone\\nBuild ""); Serial.println(compileDate); EEPROM.begin(sizeof(ConfigData)); ReadEEPROM(); Debug.setDebugLevel(DBG_VERBOSE); Debug.timestampOn(); Debug.setDebugOutputStream(&Serial); pinMode(OnboardLed,OUTPUT); digitalWrite(OnboardLed,HIGH); dumpSysInfo(); if (configData.magic != 7227) { strcpy(configData.boardName, ""prancer""); configData.numStrands = DEFAULT_NUM_STRANDS; configData.ledsPerStrand = NUM_LEDS_PER_STRAND; WriteEEPROM(); Debug.print(DBG_INFO, ""Overwrote EEPROM with defaults""); } // Init LEDs if (!initStrands()) { Serial.println(""LED init FAILURE: halting""); while (true) { delay(100); } } digitalWrite(LevelShiftEnable, LOW); if (FLon) FastLED.show(); // Somehow if we don't show right away, all strands go permanently white progress(); //halloween(); //quickTest(); delay(10); fader = new FadeController(leds, NumLeds); fader->init(); digitalWrite(OnboardLed,LOW); // Indicate that boot is over by turning off the blue LED xTaskCreate(faderLoopTask, ""FaderLoop"", 5000, NULL, 1, NULL); xTaskCreate(LoopTask, ""Loop"", 20000, NULL, 1, NULL); } int cmdCount=0; bool onboardLedState=0; void toggleOnboardLed() { onboardLedState=!onboardLedState; digitalWrite(OnboardLed, onboardLedState); } unsigned int parseUint(String& s, int& pos) { if (pos < 0) return 0; // return 0 if position is illegal if (pos >= s.length()) { pos = -pos; return 0; } // Too far int end = pos; while (end < s.length() && (s[end] >= '0' && s[end] <= '9')) end++; String p = s.substring(pos,end+1); int ret = p.toInt(); pos=end; if (pos >= s.length()) pos = -pos; // Too far return ret; } void handleHttpLine(String& line) { if (line.startsWith(""GET /SHOW"")) { toggleOnboardLed(); //CVT digitalLeds_drawPixels(strands, STRANDCNT); Debug.print(DBG_INFO, ""showing leds""); } if (line.startsWith(""GET /SET"")) { toggleOnboardLed(); cmdCount++; Debug.print(DBG_INFO,""command #: %d: %s"", cmdCount, line.c_str()); // Parse out the numbers int pos = 8; unsigned int strandIdx = parseUint(line, pos); if (pos < 0) { Debug.print(DBG_ERROR, ""bad # for strand: %d"", pos); return; } pos++; unsigned int offset = parseUint(line, pos); if (pos < 0) { Debug.print(DBG_ERROR, ""bad # for offset: %s"", pos); return; } pos++; unsigned int red = parseUint(line, pos); if (pos < 0) { Debug.print(DBG_ERROR, ""bad # for red: %d"", pos); return; } pos++; unsigned int green = parseUint(line, pos); if (pos < 0) { Debug.print(DBG_ERROR, ""bad # for green: %d"", pos); return; } pos++; unsigned int blue = parseUint(line, pos); if (pos < 0) { Debug.print(DBG_ERROR, ""bad # for blue: %d"", pos); return; } if (pos>0) { Debug.print(DBG_INFO, ""Set %d:%d to R%d G%d B%d"", strandIdx, offset, red, green, blue); //CVT strands[strandIdx]->pixels[offset] = pixelFromRGB(red,green,blue); } else { Debug.print(DBG_ERROR, ""Parse error at: %d of %s"", -1*pos, line.c_str()); } } // Check to see if the client request was ""GET /H"" or ""GET /L"": else if (line.startsWith(""GET /H"")) { digitalWrite(OnboardLed, HIGH); // GET /H turns the LED on } else if (line.startsWith(""GET /L"")) { digitalWrite(OnboardLed, LOW); // GET /L turns the LED off } } // Binary protocol: /* connect, send command (1st command byte cannot be 'A' through 'Z') Common Fields: LEDindex (16 bits, big endian): MSB 4 bits, 0xF = all strands, otherwise 0-7 indicates which strand LSB 12 bits, led index count (16 bits, big endian): 0xFFFF means all LEDs, otherwise # of leds (does not wrap) cmds: bit 0x80 = display (flush LEDs from buffer to actual lights) 0 = NOP (so 0x80 means just display) 1 = DONE 2 = SETNLED, LEDindex, count, uint8_t r, uint8_t g, uint8_t b 3 = SETLEDS, LEDindex, count, uint8_t r0, uint8_t g0, uint8_t b0,uint8_t r1, uint8_t g1, uint8_t b1, ... uint8_t b(count-1) 4 = delay (microseconds) 5 = delayUntil 6 = sync (write a byte back) */ enum { CMD_NOP = 0, CMD_DONE = 1, CMD_SETNLED = 2, CMD_SETLEDS = 3, CMD_DELAY = 4, CMD_DELAYUNTIL = 5, CMD_SYNC = 6, CMD_FADENLED = 7, CMD_FADELEDS = 8, CMD_YANKNLED = 9, }; /* uint8_t readByte(WiFiClient& client, bool& aborted, int timeout=10000) { uint16_t ret=0; int cnt = sizeof(uint16_t); while(client.connected()) { if (client.available()) { ret = client.read(); return ret; } } aborted=true; return 0; } uint16_t readShort(WiFiClient& client, bool& aborted, int timeout=10000) { uint16_t ret=0; int cnt = sizeof(uint16_t); while(client.connected()) { if (client.available()) { ret |= client.read(); cnt--; if (cnt==0) return ret; ret <<= 8; } } aborted=true; return 0; } */ int64_t micros64() { static int64_t rolls = 0; static uint32_t lastmicros = 0; uint32_t n = micros(); //uint32_t p = n; n += 0xFC000000UL; //Debug.print(DBG_INFO, ""micros64 n:%lu -> %lu lastmicros: %lld"", p, n, lastmicros); if (n < lastmicros) { rolls += 0x100000000UL; // Debug.print(DBG_INFO, ""Rolled 0x%llx"", rolls); } lastmicros = n; int64_t now = n; return (now+rolls); } unsigned char readWait(WiFiClient& client) { uint32_t start = millis(); while (!client.available()) { if (!client.connected()) { Debug.print(DBG_INFO, ""Client disconnect in readWait()""); return 0; } vTaskDelay(1 / portTICK_PERIOD_MS); } return client.read(); } size_t readWait(WiFiClient& client, uint8_t* buf, size_t total) { size_t got=0; while(got < total) { while ((!client.available()) && client.connected()) { delayMicroseconds(1); } if (!client.connected()) { Debug.print(DBG_INFO, ""Client disconnect in readWait(...)""); return 0; } int amtRead = client.read(buf+got, total-got); if (amtRead < 0) { Debug.print(DBG_INFO, ""Read failure in readWait(...)""); client.stop(); return got; } got += amtRead; } return got; } void handleBinaryProtocol(WiFiClient& client, unsigned char cmd) { uint32_t start = millis(); //client.setNoDelay(true); //client.setTimeout(5); // 5 second timeout bool done = false; //Debug.print(DBG_INFO, ""Binary mode""); if (1) // while (!done && client.connected()) { /* if (!client.available()) { continue; } */ //unsigned char cmd = readWait(client); unsigned char flush = cmd&0x80; cmd = cmd&0x7f; unsigned char dirtyStrand = 0xff; //Debug.print(DBG_INFO, ""CMD %d"", cmd); switch (cmd) { case CMD_NOP: //Debug.print(DBG_INFO, ""NOP""); break; case CMD_DONE: { uint32_t magic; if (4 != readWait(client, (uint8_t*) &magic, 4)) { Debug.print(DBG_INFO, ""Received BAD done - not enough read""); } if (magic != 0xb1eb1e) { Debug.print(DBG_INFO, ""Received BAD done %u"", magic); } else { Debug.print(DBG_INFO,""Received DONE""); done = true; } } break; case CMD_SETNLED: // SETNLED { //Debug.print(DBG_INFO, ""set N led""); bool aborted = false; uint16_t ledIdx; if (2 != readWait(client, (uint8_t*) &ledIdx, 2)) { Debug.print(DBG_INFO, ""SETNLED bad index read ""); return; } uint8_t strandIdx = ledIdx >> 12; ledIdx &= (1<<12)-1; uint16_t count; if (2 != readWait(client, (uint8_t*) &count, 2)) { Debug.print(DBG_INFO, ""SETNLED bad count read""); return; } uint8_t red = readWait(client); uint8_t grn = readWait(client); uint8_t blu = readWait(client); auto col = CRGB(red,grn,blu); //Debug.print(DBG_INFO, ""SETNLED count: %d, start %d:%d"", count, strandIdx, ledIdx); if (strandIdx == 0xf) // linear map of LEDs { for (size_t j=ledIdx;(j0);j++,count--) { if (fader) fader->set(j, col); else leds[j] = col; } } else // Indexed by strand and pixed index. All counts remain within the strand { if (strandIdx < configData.numStrands) { dirtyStrand = strandIdx; count = min(ledIdx+count, (int) configData.ledsPerStrand) - ledIdx; ledIdx += strandIdx*configData.ledsPerStrand; //Debug.print(DBG_INFO, ""Set %d:%d - %d to R%d G%d B%d"", strandIdx, ledIdx, count, red, grn, blu); for (int j=ledIdx;(jset(j, col); else leds[j] = col; } } } } break; case CMD_SETLEDS: { //Debug.print(DBG_INFO, ""set leds""); uint16_t ledIdx; if (2 != readWait(client, (uint8_t*) &ledIdx, 2)) { Debug.print(DBG_INFO, ""bad read""); return; } uint8_t strandIdx = ledIdx >> 12; ledIdx &= (1<<12)-1; uint16_t count; if (2 != readWait(client,(uint8_t*) &count, 2)) { Debug.print(DBG_INFO, ""bad read""); return; } if (count > NumLeds) { Debug.print(DBG_INFO, ""bad count""); } bool oneStrand = true; unsigned int strandStartLed=0; if (strandIdx != 0xf) // linear map of LEDs { ledIdx += strandIdx*configData.ledsPerStrand; } //Debug.print(DBG_INFO, ""SETLEDS count: %d, start %d:%d (%s)"", count, strandIdx, ledIdx, oneStrand ? ""one strand"":""all strands"" ); for (uint16_t c = 0; cset(ledIdx, col); else leds[ledIdx] = col; ledIdx++; // TODO if strandIdx != 0xf, don't cross strand gap } } } break; case CMD_YANKNLED: { bool aborted = false; uint16_t ledIdx; if (2 != readWait(client, (uint8_t*) &ledIdx, 2)) { Debug.print(DBG_INFO, ""YANKNLED bad index read ""); return; } uint8_t strandIdx = ledIdx >> 12; ledIdx &= (1<<12)-1; uint16_t count; if (2 != readWait(client, (uint8_t*) &count, 2)) { Debug.print(DBG_INFO, ""YANKNLED bad count read""); return; } uint16_t stride; if (2 != readWait(client, (uint8_t*) &stride, 2)) { Debug.print(DBG_INFO, ""YANKNLED bad stride read""); return; } if (stride == 0) stride = 1; // don't allow infinite loop uint8_t red = readWait(client); uint8_t grn = readWait(client); uint8_t blu = readWait(client); auto col = CRGB(red,grn,blu); //Debug.print(DBG_INFO, ""YANKNLED count: %d, start %d:%d, color: (%d,%d,%d)"", count, strandIdx, ledIdx, red,grn,blu); if (strandIdx == 0xf) // linear map of LEDs { for (size_t j=ledIdx;(j0);j+=stride,count--) { if (fader) fader->yank(j, col); } } else // Indexed by strand and pixed index. All counts remain within the strand { if (strandIdx < configData.numStrands) { dirtyStrand = strandIdx; count = min(ledIdx+count, (int) configData.ledsPerStrand) - ledIdx; ledIdx += strandIdx*configData.ledsPerStrand; //Debug.print(DBG_INFO, ""Set %d:%d - %d to R%d G%d B%d"", strandIdx, ledIdx, count, red, grn, blu); for (int j=ledIdx;(j0);j+=stride, count--) { if (fader) fader->yank(j, col); } } } } break; case CMD_FADENLED: { //Debug.print(DBG_INFO, ""set N led""); bool aborted = false; uint16_t ledIdx; if (2 != readWait(client, (uint8_t*) &ledIdx, 2)) { Debug.print(DBG_INFO, ""FADENLED bad index read ""); return; } uint8_t strandIdx = ledIdx >> 12; ledIdx &= (1<<12)-1; uint16_t count; if (2 != readWait(client, (uint8_t*) &count, 2)) { Debug.print(DBG_INFO, ""FADENLED bad count read""); return; } uint16_t fadeCount; if (2 != readWait(client, (uint8_t*) &fadeCount, 2)) { Debug.print(DBG_INFO, ""FADENLED bad fadeCount read""); return; } uint16_t stride; if (2 != readWait(client, (uint8_t*) &stride, 2)) { Debug.print(DBG_INFO, ""FADENLED bad stride read""); return; } if (stride == 0) stride = 1; // don't allow infinite loop uint8_t red = readWait(client); uint8_t grn = readWait(client); uint8_t blu = readWait(client); auto col = CRGB(red,grn,blu); Debug.print(DBG_INFO, ""FADENLED count: %d, fadeCount: %d, start %d:%d, color: (%d,%d,%d)"", count, fadeCount, strandIdx, ledIdx, red,grn,blu); if (strandIdx == 0xf) // linear map of LEDs { for (size_t j=ledIdx;(j0);j+=stride,count--) { if (fader) fader->fade(j, fadeCount, col); } } else // Indexed by strand and pixed index. All counts remain within the strand { if (strandIdx < configData.numStrands) { dirtyStrand = strandIdx; count = min(ledIdx+count, (int) configData.ledsPerStrand) - ledIdx; ledIdx += strandIdx*configData.ledsPerStrand; //Debug.print(DBG_INFO, ""Set %d:%d - %d to R%d G%d B%d"", strandIdx, ledIdx, count, red, grn, blu); for (int j=ledIdx;(j0);j+=stride, count--) { if (fader) fader->fade(j, fadeCount, col); } } } } break; case CMD_FADELEDS: { //Debug.print(DBG_INFO, ""set leds""); uint16_t ledIdx; if (2 != readWait(client, (uint8_t*) &ledIdx, 2)) { Debug.print(DBG_INFO, ""bad read""); return; } uint8_t strandIdx = ledIdx >> 12; ledIdx &= (1<<12)-1; uint16_t count; if (2 != readWait(client,(uint8_t*) &count, 2)) { Debug.print(DBG_INFO, ""bad read""); return; } if (count > NumLeds) { Debug.print(DBG_INFO, ""bad count""); } uint16_t fadeCount; if (2 != readWait(client, (uint8_t*) &fadeCount, 2)) { Debug.print(DBG_INFO, ""FADENLED bad fadeCount read""); return; } uint16_t stride; if (2 != readWait(client, (uint8_t*) &stride, 2)) { Debug.print(DBG_INFO, ""FADENLED bad stride read""); return; } bool oneStrand = true; unsigned int strandStartLed=0; if (strandIdx != 0xf) // linear map of LEDs { ledIdx += strandIdx*configData.ledsPerStrand; } //Debug.print(DBG_INFO, ""SETLEDS count: %d, start %d:%d (%s)"", count, strandIdx, ledIdx, oneStrand ? ""one strand"":""all strands"" ); for (uint16_t c = 0; cfade(ledIdx, fadeCount, col); ledIdx+=stride; // TODO if strandIdx != 0xf, don't cross strand gap } } } break; case CMD_DELAY: // Implemented after the flush break; case CMD_SYNC: { static unsigned char cur = 0; Debug.print(DBG_INFO, ""SYNC %d"", cur); size_t written = 0; do { written = client.write(cur); if (written != 0) { Debug.print(DBG_INFO, ""blocked %d"", written); } } while (written != 1); Debug.print(DBG_INFO, ""SYNC %d DONE"", cur); cur++; } break; } if (flush) { //if (dirtyStrand == 0xff) // I don't know which is dirty, or > 1, so flush all //Debug.print(DBG_INFO, ""flush""); //if (fader) fader->loop(); //if (FLon) FastLED.show(); //else // digitalLeds_drawPixels(&strands[dirtyStrand], 1); } if (cmd == CMD_DELAY) { uint32_t c; if (4 != readWait(client, (uint8_t*) &c, 4)) { Debug.print(DBG_INFO, ""delay error""); return; } // Delay imagines that all other operations take 0 time. // So each delay waits relative to the previous delay or delayuntil int64_t count = c; int64_t delayUntil = count + lastDelay; Debug.print(DBG_INFO, ""DELAY: %lld (%lld + %lld))"", delayUntil, count, lastDelay); int64_t now = micros64(); size_t faderMoves = 0; if (now > delayUntil) { if (count > 0) Debug.print(DBG_INFO, ""way slow""); lastDelay = now; } else { while (now < delayUntil) { if (false) // (fader) // IDK how long this will take { fader->loop(); if (FLon && now > -10000) FastLED.show(); // If we fall too far behind, skip one faderMoves+=1; } now += 10000; // where we want to be int64_t delta = now - micros64(); // where we want to be - where we are if (delta > 0) delayMicroseconds(delta); else Debug.print(DBG_INFO, ""slow""); } lastDelay = delayUntil; } // Make up any missing int64_t expectedFaderMoves = count/10000; if (false) //faderMoves < expectedFaderMoves) { for(auto k = faderMoves; kloop(); if (FLon) FastLED.show(); } } else if (cmd == CMD_DELAYUNTIL) { uint32_t synctime; if (4 != readWait(client, (uint8_t*) &synctime, 4)) { Debug.print(DBG_INFO, ""Received BAD synctime - not enough read""); return; } uint32_t now = millis() - start; Debug.print(DBG_INFO, ""SYNCTIME until %d, currently %d"", synctime, now); while (now < synctime) { if (!client.connected()) break; delay(min((uint32_t)20, synctime - now )); if (fader) { fader->loop(); if (FLon) FastLED.show(); } now = millis() - start; } lastDelay = micros64(); Debug.print(DBG_INFO, ""SYNCTIME done at %d"", now); } } //Debug.print(DBG_INFO, ""Binary mode finished done=%d connected=%d"", done, client.connected()); } unsigned int qtPos = 0; void quickTest() { int r=0; int g=0; int b=0; Serial.println(""Quick Test""); for (int32_t j=0;j<20;j++) { for (int32_t i=0;i<100;i++) { //leds[(i+j)%NumLeds] = CRGB(r,g,b); //if ((i+j)&1U==0U) leds[i] = CRGB(0x00,0x80,0x20); //else leds[i] = CRGB(0x40,0x00,0x80); if ((qtPos&7)==0) leds[i] = CRGB(0x00,0x40,0x10); else if ((qtPos&7)==1) leds[i] = CRGB(0x00,0x00,0xff); else if ((qtPos&7)==2) leds[i] = CRGB(0x00,0x00,0x60); else if ((qtPos&7)==3) leds[i] = CRGB(0x00,0x40,0x90); else leds[i] = CRGB(0x0,0x0,0x00); //leds[i] = CRGB(0x0,0x0,0x01); qtPos++; //tree.Delay(delayTime); //r+=3; //g+=5; //b+=7; //if (r>255) r=0; //if (g>255) g=0; //if (b>255) b=0; } qtPos++; // move them along the strand by changing qtPos relative to the start of the loop if (FLon) FastLED.show(); delayMicroseconds(200000); Serial.print(""-""); if ((qtPos&127) == 0) Serial.print(""\\n""); } } void progress() // And strand signal integrity test { //size_t count = 0; Serial.println(""Progress Test""); for (int32_t k=0;k<4;k++) { for (int32_t j=0;j<256;j+=2) { for (int32_t i=0;i maxx) { red=maxx; radd = -(rand()%8) - 1; } if (grn > maxx) { grn=maxx; gadd = -(rand()%7) - 1; } if (blu > maxx) { blu=maxx; badd = -(rand()%6) - 1; } // Always setting the lowest bit causes any insertion into the bitstream to shift a 1 into the highest brightness of the next color, causing a flash auto col = CRGB(red|1,grn|1,blu|1); // hide the flash effect //auto col = CRGB(red&0xfe,grn&0xfe,blu&0xfe); //auto col = CRGB(0,0,1); //if (j&1 == 1) col = CRGB(0,1,0); for (int i=0;ifade(i, fadeLength, CRGB(random(0,255),random(0,255),random(0,255))); } count = 0; //fadeLength; } vTaskDelay(1000 / portTICK_PERIOD_MS); if (false) { // Just do a few moves before looping for (int i=0;i<10; i++) { count--; fader->loop(); if (FLon) FastLED.show(); delayMicroseconds(1000); if (count == 0) break; // Time to retarget -- quit this loop } } } void faderTest() { Debug.print(DBG_INFO, ""Fader Test""); if (fader == nullptr) return; CRGB col = CRGB(255,0,0); int fadeLength=100; for (int i=0;ifade(i, fadeLength, col); } for (int i=0;iloop(); if (FLon) FastLED.show(); delayMicroseconds(1000); } col = CRGB(0,255,0); fadeLength *= 2; for (int i=0;ifade(i, fadeLength, col); } Debug.print(DBG_INFO, ""Fade to Green with yanking""); for (int i=0;iloop(); fader->yank((i*2)%NumLeds, CRGB(255,0,255)); if (FLon) FastLED.show(); delayMicroseconds(1000); } col = CRGB(0,0,255); //fadeLength /= 2; for (int i=0;ifade(i, fadeLength, col); } Debug.print(DBG_INFO, ""Fade to Blue but redirect every other to green-blue""); for (int i=0;iloop(); fader->redirect((1+(i*2))%NumLeds, CRGB(0,40,60)); if (FLon) FastLED.show(); delayMicroseconds(1000); } } boolean fillNewClient() { WiFiClient c = server.available(); if (c) { for (int cidx=0; cidx < LedCtrlMaxClients; cidx++) { if (clients[cidx] && (clients[cidx].fd()==c.fd())) return false; // Not something new } for (int cidx=0; cidx < LedCtrlMaxClients; cidx++) { if (!clients[cidx]) { IPAddress ip = c.remoteIP(); Debug.print(DBG_INFO, ""New client in slot %d fd %d coming from %d.%d.%d.%d"", cidx, c.fd(), ip[0], ip[1], ip[2], ip[3] ); clients[cidx] = c; clients[cidx].setNoDelay(true); lastDelay = micros64(); return true; } } } return false; } unsigned long lastFill = 0; void loop() { } void LoopTask(void * parameter) { while(1) { noConnectionAnimation(); } //Debug.print(DBG_INFO, ""Loop""); WiFiConnector(); int emptySlots = LedCtrlMaxClients; int somethingHappened=0; //Debug.print(DBG_INFO, ""stats: numFills: %d, last fill: %llu avg fill clock ticks: %llu"", fastLEDnumFills, fastLEDlastFillDuration, fastLEDfillDuration/fastLEDnumFills); #if WIFI for (int cidx=0; cidx < LedCtrlMaxClients; cidx++) { //Debug.print(DBG_INFO, ""client Loop %d"", cidx); if (clients[cidx] && clients[cidx].connected()) // Fill an empty slot with a new client { emptySlots--; WiFiClient& client = clients[cidx]; String currentLine = """"; // make a String to hold incoming data from the client //if (client.available()) // Debug.print(DBG_INFO, ""client %d is alive, %s data"", client.fd(), client.available() ? ""has"" : ""no""); while (client.available() && client.connected()) // if there's bytes to read from the client, { somethingHappened++; char c = readWait(client); // read a byte, then if ((currentLine.length()==0)&&((c<'A') || (c>'Z'))) // Binary protocol handling // Its the beginning of the line, and the line doesn't begin wtih GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, or TRACE { //Debug.print(DBG_INFO, ""binary protocol""); toggleOnboardLed(); handleBinaryProtocol(client, c); //Debug.print(DBG_INFO, ""binary protocol done""); } else // HTTP handling { Serial.write(c); // print it out the serial monitor if (c == '\\n') // if the byte is a newline character { // if the current line is blank, you got two newline characters in a row. // that's the end of the client HTTP request, so send a response: if (currentLine.length() == 0) { // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK) // and a content-type so the client knows what's coming, then a blank line: client.println(""HTTP/1.1 200 OK""); client.println(""Content-type:text/html""); client.println(); // the content of the HTTP response follows the header: client.print(""Click here to turn the LED on pin 5 on.
""); client.print(""Click here to turn the LED on pin 5 off.
""); // The HTTP response ends with another blank line: client.println(); // break out of the while loop: //break; } else // if you got a newline, then clear currentLine: { handleHttpLine(currentLine); currentLine = """"; } } if (c != '\\r') // if you got anything else but a carriage return character, { currentLine += c; // add it to the end of the currentLine } } } if (!client.connected()) { // close the connection: //client.stop(); Debug.print(DBG_INFO, ""Client %d idx %d Disconnected."", client.fd(), cidx); } } } unsigned long now = millis(); if ((somethingHappened==0)&&(now > lastFill + MIN_CNXN_FILL_INTERVAL)) { lastFill = now; if (fillNewClient()) somethingHappened++; } #endif if (!somethingHappened) { if (emptySlots == LedCtrlMaxClients) { //halloween(); //faderTest(); noConnectionAnimation(); } else { //Debug.print(DBG_INFO, ""Nuthin' happenin' delay...""); delay(1); } } } ",12259,False,2098.6164202167042,median "/* AYE AYE -__- */ /*CODING INI DIBUAT OLEH RAYOCTA303*/ /*Facebook : www.facebook.com/rayocta303 */ /*E-mail : OctaZoneID@gmail.com*/ /*INDONESIAN CODER*/ #include #include #include #include #include ""PrayerTimes.h"" #include #include #include #include #include #include char weekDay[][7] = {""SENIN"" , ""SELASA"", ""RABU"", ""KAMIS"", ""JUM'AT"", ""SABTU"", ""MINGGU"",""SENIN"" , }; // array hari, dihitung mulai dari senin, hari senin angka nya =0, int langkah; int lama_tampilnya; boolean Waduh_Setting = false; // DEFINISI TOMBOL SETTING RTC // #define Jam_bUP A1 // Tombol setting sesuaikan dengan PIN di arduino anda mana klo ini terhubung dengan PIN 3 Digital #define tombol_bOK A2 // Tombol OK sesuaikan dengan PIN di arduino anda mana klo ini terhubung dengan PIN 5 Digital #define Jam_bDN A3 //tombol setting sesuaikan dengan PIN di arduino anda mana klo ini terhubung dengan PIN 4 Digital ///////////////////koding ini untuk setting rtc sesuai dengan laptop//// ///// //year, month, date, hour, min, sec and week-day(starts from 0 and goes to 6) //writing any non-existent time-data may interfere with normal operation of the RTC. //Take care of week-day also. //DateTime dt(2017, 5, 4, 15, 11, 0, 4); /* * PIN YANG DISAMBUNG * Arduino P-10 * -D6 -> -A * -D7 -> -B * -D8 -> -SCLK * -D9 -> -OE * -D11 -> -DATA * -D13 -> -CLK * -GND -> -GND */ DMD dmd(1, 1); //untuk mengatur jumlah panel yang kamu pakai double times[sizeof(TimeName) / sizeof(char*)]; void ScanDMD() { dmd.scanDisplayBySPI(); } void setup() { pinMode(2, OUTPUT);//----pin 2 untuk alarm adzan maghrib ---hubungkan dengan buzzer langkah = 0; rtc.begin(); //rtc.setDateTime(dt); //Adjust date-time as defined 'dt' above (ini untuk setting jam) Wire.begin(); Timer1.initialize( 500 ); Timer1.attachInterrupt( ScanDMD ); dmd.clearScreen( true ); pinMode(tombol_bOK, INPUT_PULLUP); // Mode Pin Sebagai Input dengan Pull Up Internal pinMode(Jam_bUP, INPUT_PULLUP); // Mode Pin Sebagai Input dengan Pull Up Internal pinMode(Jam_bDN, INPUT_PULLUP); // Mode Pin Sebagai Input dengan Pull Up Internal attachInterrupt(0, Setting, FALLING); } // FUNGSI LOOPING // void loop() { if (Waduh_Setting) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } mulai(); } /*CODING INI DIBUAT OLEH RAYOCTA303*/ /*Facebook : www.facebook.com/rayocta303 */ /*E-mail : OctaZoneID@gmail.com*/ /*INDONESIAN CODER*/ // Interrupt Button Setting // void Setting() { Waduh_Setting = true; // Aktifkan Menu Setting } // Fungsi Menu Setting // void MenuSetting() { DateTime now = rtc.now(); String Teks; int tgl = now.date(); //Tanggal int bln = now.month(); //Bulan int thn = now.year(); //Tahun int hours, minutes; //jam dan menit jawdwal sholat int jame = now.hour(); //jam int menit_e = now.minute(); //menit int harin_e = harin_e; //hari detachInterrupt(0);// Matikan interrupt ""0"" delay(500); // SETTING JAM & MENIT // int kasus = 0; setTimes: // Setting Times (Jam & Menit) if (digitalRead(Jam_bUP) == LOW ) { // Tombol Setting Menit delay(10); menit_e++; // Delay Tombol & Tambah Nilai Menit if (menit_e >= 60) { menit_e = 0; // Batas Nilai Menit Lebih dari 59 Kembali ke 0 } while (digitalRead(Jam_bUP) == LOW) {} // Kunci Tombol Setting Menit Sampai Lepas Tombol } if (digitalRead(Jam_bDN) == LOW) { // Tombol Setting Menit delay(10); jame++; // Delay Tombol & Tambah Nilai Jam if (jame >= 24) { jame = 0; // Batas Nilai Jam Lebih dari 23 Kembali ke 0 } while (digitalRead(Jam_bDN) == LOW) {} // Kunci Tombol Setting Jam Sampai Lepas Tombol } setTgl: // Setting tanggal if (digitalRead(Jam_bUP) == LOW ) { // Tombol Setting tanggal delay(10); tgl++; if (tgl >= 32) { tgl = 1; // Batas Nilai tgl Lebih dari 31 Kembali ke 1 } while (digitalRead(Jam_bUP) == LOW) {} // Kunci Tombol Setting tgl Sampai Lepas Tombol } if (digitalRead(Jam_bDN) == LOW) { // Tombol Setting bln delay(10); bln++; // Delay Tombol & Tambah Nilai bln if (bln >= 13) { bln = 1; // Batas Nilai bln Lebih dari 12 Kembali ke 1 } while (digitalRead(Jam_bDN) == LOW) {} // Kunci Tombol Setting blnSampai Lepas Tombol } /*CODING INI DIBUAT OLEH RAYOCTA303*/ /*Facebook : www.facebook.com/rayocta303 */ /*E-mail : OctaZoneID@gmail.com*/ /*INDONESIAN CODER*/ // SETTING TAHUN // setThn: // Setting thn if (digitalRead(Jam_bUP) == LOW ) { // Tombol Setting thn delay(10); thn++; // Delay Tombol & Tambah Nilai thn if (thn >= 9999) { thn = 0; // Batas Nilai Menit Lebih dari 9999 Kembali ke 0 } while (digitalRead(Jam_bUP) == LOW) {} // Kunci Tombol Setting thn Sampai Lepas Tombol } if (digitalRead(Jam_bDN) == LOW) { // Tombol Setting thn delay(10); thn--; // Delay Tombol & Tambah Nilai thn if (thn <= 0) { thn = 0; // Batas Nilai kurang dari 0 Kembali ke 0 } while (digitalRead(Jam_bDN) == LOW) {} // Kunci Tombol Setting thn Sampai Lepas Tombol } /*CODING INI DIBUAT OLEH RAYOCTA303*/ /*Facebook : www.facebook.com/rayocta303 */ /*E-mail : OctaZoneID@gmail.com*/ /*INDONESIAN CODER*/ // SETTING HARI // //hitungan hari mulai dari 0,1,2,3,4,5,6 = senin, selasa, rabu, kamis, jumat, sabtu, minggu setHari: // Setting Times hari if (digitalRead(Jam_bUP) == LOW ) { // Tombol Setting hari harin_e = harin_e; delay(10); harin_e++; // Delay Tombol & Tambah Nilai hari, if (harin_e >= 7) { harin_e = 0; // Batas Nilai Menit Lebih dari 6 Kembali ke 0 } while (digitalRead(Jam_bUP) == LOW) {} // Kunci Tombol Setting hariSampai Lepas Tombol } if (digitalRead(Jam_bDN) == LOW) { // Tombol Setting hari harin_e = harin_e; delay(10); harin_e--; // Delay Tombol & Tambah Nilai hari if (harin_e <= 0) { harin_e = 0; // Batas Nilai kurang dari 0 Kembali ke 0 } while (digitalRead(Jam_bDN) == LOW) {} // Kunci Tombol Setting hari Sampai Lepas Tombol } // TOMBOL / BUTTON OK // if (digitalRead(tombol_bOK) == LOW) { // Tombol Selesai Setting kasus = kasus + 1; dmd.clearScreen(true); // Hapus Tampilan P10 DateTime dt(thn, bln, tgl, jame, menit_e, 0, harin_e); // DateTime dt(2017, 5, 4, 15, 11, 0, 4); rtc.setDateTime(dt); //Adjust date-time as defined 'dt' above while (digitalRead(tombol_bOK) == LOW) {} delay(500); // SETTING KASUS JAM // } if (kasus == 1) { //kasus seting jam dmd.clearScreen(true); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 0, ""set-J"", 5, 0); String xjam = Konversi(jame) + "":"" + Konversi(menit_e) ; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); delay (100); goto setTimes; //lari ke fungsi seting jam } if (kasus == 2) { //kasus seting tanggal dmd.clearScreen(true); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 0, ""Tgl"", 3, 0); String xjam = Konversi(tgl) + ""/"" + Konversi(bln) ; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); delay (100); goto setTgl;//lari ke fungsi setting tanggal } if (kasus == 3) { ///kasus seting tahun dmd.clearScreen(true); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 0, ""Thn"", 3, 0); String xjam = Konversi(thn) ; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); delay (100); goto setThn; //lari ke fungsi setting tahun } if (kasus == 4) { //kasus seting hari dmd.clearScreen(true); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 0, ""Hari"", 4, 0); String xjam = Konversi(harin_e) ; if (harin_e == 0) { xjam = ""SEN""; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); } if (harin_e == 1) { xjam = ""SEL""; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); } if (harin_e == 2) { xjam = ""RAB""; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); } if (harin_e == 3) { xjam = ""KAM""; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); } if (harin_e == 4) { xjam = ""JUM""; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); } if (harin_e == 5) { xjam = ""SAB""; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); } if (harin_e == 6) { xjam = ""MIN""; int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(0, 9, sjam, pjg, 0); } delay (100); goto setHari; //lari ke seting hari } if (kasus == 5) { //kasus wis Rampung dmd.clearScreen(true); goto endSetting; delay(500); } endSetting: // Label End Setting attachInterrupt(0, Setting, FALLING); // Interrupt Tombol OK Waduh_Setting = false; kasus = 0; } // PROGRAM JAM NYA EA // int menite = 1; ///waktu iqomah lamanya void mulai() { dmd.clearScreen( true ); long mulai = millis(); while (millis() - mulai < 3000) { DateTime now = rtc.now(); String Teks; ///pengaturan koordinat - gunakan gps android untuk menentukan posisi anda double lintang = -7.0667; //Latitude double bujur = 110.4; //Longitude int Z = 7 ; //Zona Waktu GMT WIB biasanya 7 int tgl = now.date(); //Tanggal int bln = now.month(); //Bulan int thn = now.year(); //Tahun int hours, minutes; //jam sholat dan menit sholat long mulai = millis(); set_calc_method(ISNA); //Methode perhitungan mengikuti ISNA set_asr_method(Shafii); //Pendapat Imam Syafi'i set_high_lats_adjust_method(AngleBased); set_fajr_angle(20); //Sudut Waktu Subuh set_isha_angle(18); ////Sudut Waktu Isya get_prayer_times(thn, bln, tgl, lintang, bujur, Z, times); ///jam--besar/// dmd.clearScreen( true ); dmd.selectFont(angka6x13); int menit_e = now.minute(); int jame = now.hour(); String xjam = Konversi(jame) ; //tampilan jam int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.drawString(1, 0, sjam, pjg, 0); /////menit/// String xxjam = Konversi(now.minute()) ; //tampilan menit int xpjg = xxjam.length() + 1; char xsjam[xpjg]; xxjam.toCharArray(xsjam, xpjg); dmd.drawString(18, 0, xsjam, xpjg, 0); ///titik dua : dmd.selectFont(SystemFont5x7); dmd.drawChar( 14, 4, ':', GRAPHICS_NOR ); // clock colon overlay on delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_OR ); // clock colon overlay off delay( 1000 ); //interupsi tombol menu if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// dmd.selectFont(SystemFont5x7); dmd.drawChar( 14, 4, ':', GRAPHICS_NOR ); // clock colon overlay on delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_OR ); // clock colon overlay off delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_NOR ); // clock colon overlay on delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_OR ); // clock colon overlay off delay( 1000 ); ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// dmd.selectFont(SystemFont5x7); dmd.drawChar( 14, 4, ':', GRAPHICS_NOR ); // clock colon overlay on delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_OR ); // clock colon overlay off delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_NOR ); // clock colon overlay on delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_OR ); // clock colon overlay off delay( 1000 ); dmd.selectFont(SystemFont5x7); dmd.drawChar( 14, 4, ':', GRAPHICS_NOR ); // clock colon overlay on delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_OR ); // clock colon overlay off delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_NOR ); // clock colon overlay on delay( 1000 ); dmd.drawChar( 14, 4, ':', GRAPHICS_OR ); // clock colon overlay off delay( 1000 ); dmd.selectFont(SystemFont5x7); dmd.drawChar( 14, 4, ':', GRAPHICS_NOR ); // clock colon overlay on delay( 1000 ); ////subuh dmd.clearScreen( true ); get_float_time_parts(times[0], hours, minutes); Teks = ""SUBUH ""; //baris atas char pj = Teks.length() + 1; char tampil[pj]; Teks.toCharArray(tampil, pj); dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.drawString(5, -2, tampil, pj, 0); //koordinat tampilan Teks = Konversi(hours) + "":"" + Konversi(minutes); //baris kedua pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, tampil, pj, 0); //koordinat tampilan delay(2000); ///////// // interupsi tombol menu if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// ////dzuhur dmd.clearScreen( true ); get_float_time_parts(times[2], hours, minutes); Teks = ""DZUHUR ""; //baris atas pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(Font3x5); dmd.drawString(4, -2, tampil, pj, 0); //koordinat tampilan Teks = Konversi(hours) + "":"" + Konversi(minutes); //baris kedua pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, tampil, pj, 0); //koordinat tampilan delay(2000); ///////// ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// ////Asar dmd.clearScreen( true ); get_float_time_parts(times[3], hours, minutes); Teks = ""ASHAR ""; //baris atas pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(Font3x5); dmd.drawString(5, -2, tampil, pj, 0); //koordinat tampilan Teks = Konversi(hours) + "":"" + Konversi(minutes); //baris kedua pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, tampil, pj, 0); //koordinat tampilan delay(2000); ///////// ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// ////Maghrib dmd.clearScreen( true ); get_float_time_parts(times[4], hours, minutes); Teks = ""MAGHRIB ""; //baris atas pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(Font3x5); dmd.drawString(2, -2, tampil, pj, 0); //koordinat tampilan Teks = Konversi(hours) + "":"" + Konversi(minutes); //baris kedua pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, tampil, pj, 0); //koordinat tampilan delay(2000); ///////// ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// ///Isya' dmd.clearScreen( true ); get_float_time_parts(times[6], hours, minutes); Teks = ""ISYA' ""; //baris atas pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(Font3x5); dmd.drawString(7, -2, tampil, pj, 0); //koordinat tampilan Teks = Konversi(hours) + "":"" + Konversi(minutes); //baris kedua pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, tampil, pj, 0); //koordinat tampilan delay(2000); ///////// ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// //imsak dmd.clearScreen( true ); get_float_time_parts(times[0], hours, minutes); if (minutes < 11) { minutes = 60 - minutes; hours --; } else { minutes = minutes - 10 ; } Teks = ""IMSAK ""; //baris atas pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(Font3x5); dmd.drawString(4, -2, tampil, pj, 0); //koordinat tampilan Teks = Konversi(hours) + "":"" + Konversi(minutes); //baris kedua pj = Teks.length() + 1; tampil[pj]; Teks.toCharArray(tampil, pj); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, tampil, pj, 0); //koordinat tampilan delay(2000); ///TOMBOL SET JAM// if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } } ///=============================PROGRAM ADZAN DAN IQOMAH=================== //jam adzan Subuh---------------------------------------------------------- int hours; int minutes; dmd.clearScreen( true ); while (millis() - mulai < 28000) { /////////////////////// DateTime now = rtc.now(); String hariku = Konversi(now.date()) + ""/"" + Konversi(now.month()) ; //tampilan tanggal int dowo = hariku.length() + 1; char detikanku[dowo]; hariku.toCharArray(detikanku, dowo); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 0, detikanku, dowo, 0); dmd.selectFont(Font3x5); dmd.drawString(5, 6, (weekDay[now.dayOfWeek()]), 7, 0); //tampilan hari ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// get_float_time_parts(times[0], hours, minutes); if ((now.hour() == hours && now.minute() == minutes) || (now.hour() == hours && now.minute() == minutes + 1) || (now.hour() == hours && now.minute() == minutes + 2) || (now.hour() == hours && now.minute() == minutes + 3) || (now.hour() == hours && now.minute() == minutes + 4) || (now.hour() == hours && now.minute() == minutes + 5)) { digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); dmd.clearScreen( true ); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 0, ""ADZAN "", 5, 0); //koordinat tampilan dmd.selectFont(Font3x5); dmd.drawString(3, 7, ""SUBUH"", 5, 0); //koordinat tampilan delay(150000); //iqomah---------------------------------- int langkah; int waktu_iqomah; int panjang_iqomah; int iqomah; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.clearScreen( true ); dmd.drawString(3, -2, ""IQOMAH"", 6, 0); //koordinat tampilan int tampil; int detik = 60, menit = 10; for (detik = 60; detik >= 0; detik--) { delay(1000); String iqomah = Konversi(menit) + "":"" + Konversi(detik); int panjang_iqomah = iqomah.length() + 1; char waktu_iqomah[panjang_iqomah]; iqomah.toCharArray(waktu_iqomah, panjang_iqomah); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 9, waktu_iqomah, panjang_iqomah, 0); if (detik <= 0) { detik = 60; menit = menit - 1; } if (menit <= 0 && detik <= 1) { for (tampil = 0; tampil < 300 ; tampil++) { menit = 0; detik = 0; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.drawString(1, -2, ""SHOLAT"", 6, 0); //koordinat tampilan /////////////////////// now = rtc.now(); String xjam = Konversi(now.hour()) + "":"" + Konversi(now.minute()) ; //tampilan jam int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, sjam, pjg, 0); ///////////////////// delay (1000); } } } } } //jam adzan Dzuhur-------------------WAKTU DZUHUR MODIFIED-------------------------------------- dmd.clearScreen( true ); while (millis() - mulai <29000) { /////////////////////// DateTime now = rtc.now(); String hariku = Konversi(now.date()) + ""/"" + Konversi(now.month()) ; //tampilan tanggal int dowo = hariku.length() + 1; char detikanku[dowo]; hariku.toCharArray(detikanku, dowo); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 0, detikanku, dowo, 0); dmd.selectFont(Font3x5); dmd.drawString(5, 6, (weekDay[now.dayOfWeek()]), 7, 0); //tampilan hari ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// int harin_e = now.dayOfWeek(); get_float_time_parts(times[2], hours, minutes); if ((now.hour() == hours && now.minute() == minutes && harin_e != 4 ) || (now.hour() == hours && now.minute() == minutes + 1 && harin_e != 4 ) || (now.hour() == hours && now.minute() == minutes + 2 && harin_e != 4 ) || (now.hour() == hours && now.minute() == minutes + 3 && harin_e != 4 ) || (now.hour() == hours && now.minute() == minutes + 4 && harin_e != 4 ) || (now.hour() == hours && now.minute() == minutes + 5 && harin_e != 4 )) { digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); dmd.clearScreen( true ); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 0, ""ADZAN "", 5, 0); //koordinat tampilan dmd.selectFont(Font3x5); dmd.drawString(2, 6, ""DZUHUR"", 6, 0); //koordinat tampilan delay(150000); //iqomah---------------------------------- int langkah; int waktu_iqomah; int panjang_iqomah; int iqomah; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.clearScreen( true ); dmd.drawString(3, -2, ""IQOMAH"", 6, 0); //koordinat tampilan int tampil; int detik = 60, menit = 10; for (detik = 60; detik >= 0; detik--) { delay(1000); String iqomah = Konversi(menit) + "":"" + Konversi(detik); int panjang_iqomah = iqomah.length() + 1; char waktu_iqomah[panjang_iqomah]; iqomah.toCharArray(waktu_iqomah, panjang_iqomah); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 9, waktu_iqomah, panjang_iqomah, 0); if (detik <= 0) { detik = 60; menit = menit - 1; } if (menit <= 0 && detik <= 1) { for (tampil = 0; tampil < 300 ; tampil++) { menit = 0; detik = 0; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.drawString(1, -2, ""SHOLAT"", 6, 0); //koordinat tampilan /////////////////////// now = rtc.now(); String xjam = Konversi(now.hour()) + "":"" + Konversi(now.minute()) ; //tampilan jam int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, sjam, pjg, 0); ///////////////////// /////////////////////// delay (1000); } } } } } //---------------------------------------------------------------------- //jam hari Jum'at----JUM'AT--------JUM'AT--------JUM'AT----JUM'AT----JUM'AT----JUM'AT----JUM'AT----JUM'AT----JUM'AT------------------------------------------ dmd.clearScreen( true ); while (millis() - mulai < 30000) { /////////////////////// DateTime now = rtc.now(); String hariku = Konversi(now.date()) + ""/"" + Konversi(now.month()) ; //tampilan tanggal int dowo = hariku.length() + 1; char detikanku[dowo]; hariku.toCharArray(detikanku, dowo); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 0, detikanku, dowo, 0); dmd.selectFont(Font3x5); dmd.drawString(5, 6, (weekDay[now.dayOfWeek()]), 7, 0); //tampilan hari ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// int harin_e = now.dayOfWeek(); get_float_time_parts(times[2], hours, minutes); if ((now.hour() == hours && now.minute() == minutes && harin_e == 4) || (now.hour() == hours && now.minute() == minutes + 1 && harin_e == 4) || (now.hour() == hours && now.minute() == minutes + 2 && harin_e == 4) || (now.hour() == hours && now.minute() == minutes + 3 && harin_e == 4) || (now.hour() == hours && now.minute() == minutes + 4 && harin_e == 4) || (now.hour() == hours && now.minute() == minutes + 5 && harin_e == 4)) { int tampil; dmd.clearScreen( true ); for (tampil = 0; tampil < 1550 ; tampil++) { dmd.selectFont(Font3x5); dmd.drawString(1, -2, ""Jum'at"", 10, 0); //koordinat tampilan /////////////////////// now = rtc.now(); String xjam = Konversi(now.hour()) + "":"" + Konversi(now.minute()) ; //tampilan jam int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, sjam, pjg, 0); ///////////////////// delay (1000); } } } ////-----AKHIR CODING JIKA HARI JUM'AT----- //---------------------------------------------------------------------- //jam adzan Asar---------------------------------------------------------- dmd.clearScreen( true ); while (millis() - mulai < 31000) { /////////////////////// DateTime now = rtc.now(); String hariku = Konversi(now.date()) + ""/"" + Konversi(now.month()) ; //tampilan tanggal int dowo = hariku.length() + 1; char detikanku[dowo]; hariku.toCharArray(detikanku, dowo); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 0, detikanku, dowo, 0); dmd.selectFont(Font3x5); dmd.drawString(5, 6, (weekDay[now.dayOfWeek()]), 7, 0); //tampilan hari ///////////////////// get_float_time_parts(times[3], hours, minutes); if ((now.hour() == hours && now.minute() == minutes) || (now.hour() == hours && now.minute() == minutes + 1) || (now.hour() == hours && now.minute() == minutes + 2) || (now.hour() == hours && now.minute() == minutes + 3) || (now.hour() == hours && now.minute() == minutes + 4) || (now.hour() == hours && now.minute() == minutes + 5)) { digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); dmd.clearScreen( true ); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 0, ""ADZAN "", 5, 0); //koordinat tampilan dmd.selectFont(Font3x5); dmd.drawString(3, 7, ""ASHAR"", 4, 0); //koordinat tampilan delay(150000); //iqomah---------------------------------- int langkah; int waktu_iqomah; int panjang_iqomah; int iqomah; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.clearScreen( true ); dmd.drawString(3, -2, ""IQOMAH"", 6, 0); //koordinat tampilan int tampil; int detik = 60, menit = 10; for (detik = 60; detik >= 0; detik--) { delay(1000); String iqomah = Konversi(menit) + "":"" + Konversi(detik); int panjang_iqomah = iqomah.length() + 1; char waktu_iqomah[panjang_iqomah]; iqomah.toCharArray(waktu_iqomah, panjang_iqomah); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 9, waktu_iqomah, panjang_iqomah, 0); if (detik <= 0) { detik = 60; menit = menit - 1; } if (menit <= 0 && detik <= 1) { for (tampil = 0; tampil < 300 ; tampil++) { menit = 0; detik = 0; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.drawString(1, -2, ""SHOLAT"", 6, 0); //koordinat tampilan /////////////////////// now = rtc.now(); String xjam = Konversi(now.hour()) + "":"" + Konversi(now.minute()) ; //tampilan jam int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, sjam, pjg, 0); ///////////////////// /////////////////////// delay (1000); } } } } } //---------------------------------------------------------------------- //jam adzan Maghrib---------------------------------------------------------- dmd.clearScreen( true ); while (millis() - mulai <32000) { /////////////////////// DateTime now = rtc.now(); String hariku = Konversi(now.date()) + ""/"" + Konversi(now.month()) ; //tampilan tanggal int dowo = hariku.length() + 1; char detikanku[dowo]; hariku.toCharArray(detikanku, dowo); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 0, detikanku, dowo, 0); dmd.selectFont(Font3x5); dmd.drawString(5, 6, (weekDay[now.dayOfWeek()]), 7, 0); //tampilan hari ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// get_float_time_parts(times[4], hours, minutes); if ((now.hour() == hours && now.minute() == minutes) || (now.hour() == hours && now.minute() == minutes + 1) || (now.hour() == hours && now.minute() == minutes + 2) || (now.hour() == hours && now.minute() == minutes + 3) || (now.hour() == hours && now.minute() == minutes + 4) || (now.hour() == hours && now.minute() == minutes + 5)) { digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); dmd.clearScreen( true ); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 0, ""ADZAN "", 5, 0); //koordinat tampilan dmd.selectFont(Font3x5); dmd.drawString(1, 7, ""MAGHRIB"", 7, 0); //koordinat tampilan delay(150000); //iqomah---------------------------------- int langkah; int waktu_iqomah; int panjang_iqomah; int iqomah; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.clearScreen( true ); dmd.drawString(3, -2, ""IQOMAH"", 6, 0); //koordinat tampilan int tampil; int detik = 60, menit = 10; for (detik = 60; detik >= 0; detik--) { delay(1000); String iqomah = Konversi(menit) + "":"" + Konversi(detik); int panjang_iqomah = iqomah.length() + 1; char waktu_iqomah[panjang_iqomah]; iqomah.toCharArray(waktu_iqomah, panjang_iqomah); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 9, waktu_iqomah, panjang_iqomah, 0); if (detik <= 0) { detik = 60; menit = menit - 1; } if (menit <= 0 && detik <= 1) { for (tampil = 0; tampil < 300 ; tampil++) { menit = 0; detik = 0; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.drawString(1, -2, ""SHOLAT"", 6, 0); //koordinat tampilan /////////////////////// now = rtc.now(); String xjam = Konversi(now.hour()) + "":"" + Konversi(now.minute()) ; //tampilan jam int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, sjam, pjg, 0); ///////////////////// /////////////////////// delay (1000); } } } } } //jam adzan isya---------------------------------------------------------- dmd.clearScreen( true ); while (millis() - mulai < 33000) { /////////////////////// DateTime now = rtc.now(); String hariku = Konversi(now.date()) + ""/"" + Konversi(now.month()) ; //tampilan tanggal int dowo = hariku.length() + 1; char detikanku[dowo]; hariku.toCharArray(detikanku, dowo); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 0, detikanku, dowo, 0); dmd.selectFont(Font3x5); dmd.drawString(5, 6, (weekDay[now.dayOfWeek()]), 7, 0); //tampilan hari ///////////////interupsi tombol menu----------- if (digitalRead(tombol_bOK) == LOW) { MenuSetting(); // Jika Tombol OK/Interrupt ditekan maka masuk menu setting Manual } ///////////////////// get_float_time_parts(times[6], hours, minutes); if ((now.hour() == hours && now.minute() == minutes) || (now.hour() == hours && now.minute() == minutes + 1) || (now.hour() == hours && now.minute() == minutes + 2) || (now.hour() == hours && now.minute() == minutes + 3) || (now.hour() == hours && now.minute() == minutes + 4) || (now.hour() == hours && now.minute() == minutes + 5)) { digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); digitalWrite(2, HIGH);//alarm sholat delay(1000); digitalWrite(2, LOW);//alarm sholat delay(1000); dmd.clearScreen( true ); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 0, ""ADZAN"", 5, 0); //koordinat tampilan dmd.selectFont(Font3x5); dmd.drawString(5, 7, ""ISYA'"", 4, 0); //koordinat tampilan delay(150000); //iqomah---------------------------------- int langkah; int waktu_iqomah; int panjang_iqomah; int iqomah; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.clearScreen( true ); dmd.drawString(3, -2, ""IQOMAH"", 6, 0); //koordinat tampilan int tampil; int detik = 60, menit = 10; for (detik = 60; detik >= 0; detik--) { delay(1000); String iqomah = Konversi(menit) + "":"" + Konversi(detik); int panjang_iqomah = iqomah.length() + 1; char waktu_iqomah[panjang_iqomah]; iqomah.toCharArray(waktu_iqomah, panjang_iqomah); dmd.selectFont(SystemFont5x7); dmd.drawString(0, 9, waktu_iqomah, panjang_iqomah, 0); if (detik <= 0) { detik = 60; menit = menit - 1; } if (menit <= 0 && detik <= 1) { for (tampil = 0; tampil < 300 ; tampil++) { menit = 0; detik = 0; dmd.clearScreen( true ); dmd.selectFont(Font3x5); dmd.drawString(1, -2, ""SHOLAT"", 6, 0); //koordinat tampilan /////////////////////// now = rtc.now(); String xjam = Konversi(now.hour()) + "":"" + Konversi(now.minute()) ; //tampilan jam int pjg = xjam.length() + 1; char sjam[pjg]; xjam.toCharArray(sjam, pjg); dmd.selectFont(SystemFont5x7); dmd.drawString(1, 9, sjam, pjg, 0); ///////////////////// /////////////////////// delay (1000); } } } } } } //---------------------------------------------------------------------- ///konversi angka agar ada nol didepannya jika diawah 10 String Konversi(int sInput) { if (sInput < 10) { return""0"" + String(sInput); } else { return String(sInput); } } // AKHIRNYA SAMPE BAWAH :D // JEMBOOOOTTT ",12231,True,2725.839984011772,median "; ; jidctint.asm - accurate integer IDCT (64-bit SSE2) ; ; Copyright 2009 Pierre Ossman for Cendio AB ; Copyright (C) 2009, 2016, D. R. Commander. ; ; Based on the x86 SIMD extension for IJG JPEG library ; Copyright (C) 1999-2006, MIYASAKA Masaru. ; For conditions of distribution and use, see copyright notice in jsimdext.inc ; ; This file should be assembled with NASM (Netwide Assembler), ; can *not* be assembled with Microsoft's MASM or any compatible ; assembler (including Borland's Turbo Assembler). ; NASM is available from http://nasm.sourceforge.net/ or ; http://sourceforge.net/project/showfiles.php?group_id=6208 ; ; This file contains a slow-but-accurate integer implementation of the ; inverse DCT (Discrete Cosine Transform). The following code is based ; directly on the IJG's original jidctint.c; see the jidctint.c for ; more details. ; ; [TAB8] %include ""jsimdext.inc"" %include ""jdct.inc"" ; -------------------------------------------------------------------------- %define CONST_BITS 13 %define PASS1_BITS 2 %define DESCALE_P1 (CONST_BITS-PASS1_BITS) %define DESCALE_P2 (CONST_BITS+PASS1_BITS+3) %if CONST_BITS == 13 F_0_298 equ 2446 ; FIX(0.298631336) F_0_390 equ 3196 ; FIX(0.390180644) F_0_541 equ 4433 ; FIX(0.541196100) F_0_765 equ 6270 ; FIX(0.765366865) F_0_899 equ 7373 ; FIX(0.899976223) F_1_175 equ 9633 ; FIX(1.175875602) F_1_501 equ 12299 ; FIX(1.501321110) F_1_847 equ 15137 ; FIX(1.847759065) F_1_961 equ 16069 ; FIX(1.961570560) F_2_053 equ 16819 ; FIX(2.053119869) F_2_562 equ 20995 ; FIX(2.562915447) F_3_072 equ 25172 ; FIX(3.072711026) %else ; NASM cannot do compile-time arithmetic on floating-point constants. %define DESCALE(x,n) (((x)+(1<<((n)-1)))>>(n)) F_0_298 equ DESCALE( 320652955, 30-CONST_BITS) ; FIX(0.298631336) F_0_390 equ DESCALE( 418953276, 30-CONST_BITS) ; FIX(0.390180644) F_0_541 equ DESCALE( 581104887, 30-CONST_BITS) ; FIX(0.541196100) F_0_765 equ DESCALE( 821806413, 30-CONST_BITS) ; FIX(0.765366865) F_0_899 equ DESCALE( 966342111, 30-CONST_BITS) ; FIX(0.899976223) F_1_175 equ DESCALE(1262586813, 30-CONST_BITS) ; FIX(1.175875602) F_1_501 equ DESCALE(1612031267, 30-CONST_BITS) ; FIX(1.501321110) F_1_847 equ DESCALE(1984016188, 30-CONST_BITS) ; FIX(1.847759065) F_1_961 equ DESCALE(2106220350, 30-CONST_BITS) ; FIX(1.961570560) F_2_053 equ DESCALE(2204520673, 30-CONST_BITS) ; FIX(2.053119869) F_2_562 equ DESCALE(2751909506, 30-CONST_BITS) ; FIX(2.562915447) F_3_072 equ DESCALE(3299298341, 30-CONST_BITS) ; FIX(3.072711026) %endif ; -------------------------------------------------------------------------- SECTION SEG_CONST alignz 32 global EXTN(jconst_idct_islow_sse2) EXTN(jconst_idct_islow_sse2): PW_F130_F054 times 4 dw (F_0_541+F_0_765), F_0_541 PW_F054_MF130 times 4 dw F_0_541, (F_0_541-F_1_847) PW_MF078_F117 times 4 dw (F_1_175-F_1_961), F_1_175 PW_F117_F078 times 4 dw F_1_175, (F_1_175-F_0_390) PW_MF060_MF089 times 4 dw (F_0_298-F_0_899),-F_0_899 PW_MF089_F060 times 4 dw -F_0_899, (F_1_501-F_0_899) PW_MF050_MF256 times 4 dw (F_2_053-F_2_562),-F_2_562 PW_MF256_F050 times 4 dw -F_2_562, (F_3_072-F_2_562) PD_DESCALE_P1 times 4 dd 1 << (DESCALE_P1-1) PD_DESCALE_P2 times 4 dd 1 << (DESCALE_P2-1) PB_CENTERJSAMP times 16 db CENTERJSAMPLE alignz 32 ; -------------------------------------------------------------------------- SECTION SEG_TEXT BITS 64 ; ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) ; jsimd_idct_islow_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; ; r10 = jpeg_component_info *compptr ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13d = JDIMENSION output_col %define original_rbp rbp+0 %define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 12 align 32 global EXTN(jsimd_idct_islow_sse2) EXTN(jsimd_idct_islow_sse2): push rbp mov rax, rsp ; rax = original rbp sub rsp, byte 4 and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits mov [rsp], rax mov rbp, rsp ; rbp = aligned rbp lea rsp, [wk(0)] collect_args 4 ; ---- Pass 1: process columns from input. mov rdx, r10 ; quantptr mov rsi, r11 ; inptr %ifndef NO_ZERO_COLUMN_TEST_ISLOW_SSE2 mov eax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)] or eax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)] jnz near .columnDCT movdqa xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] por xmm1, xmm0 packsswb xmm1, xmm1 packsswb xmm1, xmm1 movd eax, xmm1 test rax, rax jnz short .columnDCT ; -- AC terms all zero movdqa xmm5, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] pmullw xmm5, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] psllw xmm5, PASS1_BITS movdqa xmm4, xmm5 ; xmm5=in0=(00 01 02 03 04 05 06 07) punpcklwd xmm5, xmm5 ; xmm5=(00 00 01 01 02 02 03 03) punpckhwd xmm4, xmm4 ; xmm4=(04 04 05 05 06 06 07 07) pshufd xmm7, xmm5, 0x00 ; xmm7=col0=(00 00 00 00 00 00 00 00) pshufd xmm6, xmm5, 0x55 ; xmm6=col1=(01 01 01 01 01 01 01 01) pshufd xmm1, xmm5, 0xAA ; xmm1=col2=(02 02 02 02 02 02 02 02) pshufd xmm5, xmm5, 0xFF ; xmm5=col3=(03 03 03 03 03 03 03 03) pshufd xmm0, xmm4, 0x00 ; xmm0=col4=(04 04 04 04 04 04 04 04) pshufd xmm3, xmm4, 0x55 ; xmm3=col5=(05 05 05 05 05 05 05 05) pshufd xmm2, xmm4, 0xAA ; xmm2=col6=(06 06 06 06 06 06 06 06) pshufd xmm4, xmm4, 0xFF ; xmm4=col7=(07 07 07 07 07 07 07 07) movdqa XMMWORD [wk(8)], xmm6 ; wk(8)=col1 movdqa XMMWORD [wk(9)], xmm5 ; wk(9)=col3 movdqa XMMWORD [wk(10)], xmm3 ; wk(10)=col5 movdqa XMMWORD [wk(11)], xmm4 ; wk(11)=col7 jmp near .column_end %endif .columnDCT: ; -- Even part movdqa xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] pmullw xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] pmullw xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] ; (Original) ; z1 = (z2 + z3) * 0.541196100; ; tmp2 = z1 + z3 * -1.847759065; ; tmp3 = z1 + z2 * 0.765366865; ; ; (This implementation) ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065); ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100; movdqa xmm4, xmm1 ; xmm1=in2=z2 movdqa xmm5, xmm1 punpcklwd xmm4, xmm3 ; xmm3=in6=z3 punpckhwd xmm5, xmm3 movdqa xmm1, xmm4 movdqa xmm3, xmm5 pmaddwd xmm4, [rel PW_F130_F054] ; xmm4=tmp3L pmaddwd xmm5, [rel PW_F130_F054] ; xmm5=tmp3H pmaddwd xmm1, [rel PW_F054_MF130] ; xmm1=tmp2L pmaddwd xmm3, [rel PW_F054_MF130] ; xmm3=tmp2H movdqa xmm6, xmm0 paddw xmm0, xmm2 ; xmm0=in0+in4 psubw xmm6, xmm2 ; xmm6=in0-in4 pxor xmm7, xmm7 pxor xmm2, xmm2 punpcklwd xmm7, xmm0 ; xmm7=tmp0L punpckhwd xmm2, xmm0 ; xmm2=tmp0H psrad xmm7, (16-CONST_BITS) ; psrad xmm7,16 & pslld xmm7,CONST_BITS psrad xmm2, (16-CONST_BITS) ; psrad xmm2,16 & pslld xmm2,CONST_BITS movdqa xmm0, xmm7 paddd xmm7, xmm4 ; xmm7=tmp10L psubd xmm0, xmm4 ; xmm0=tmp13L movdqa xmm4, xmm2 paddd xmm2, xmm5 ; xmm2=tmp10H psubd xmm4, xmm5 ; xmm4=tmp13H movdqa XMMWORD [wk(0)], xmm7 ; wk(0)=tmp10L movdqa XMMWORD [wk(1)], xmm2 ; wk(1)=tmp10H movdqa XMMWORD [wk(2)], xmm0 ; wk(2)=tmp13L movdqa XMMWORD [wk(3)], xmm4 ; wk(3)=tmp13H pxor xmm5, xmm5 pxor xmm7, xmm7 punpcklwd xmm5, xmm6 ; xmm5=tmp1L punpckhwd xmm7, xmm6 ; xmm7=tmp1H psrad xmm5, (16-CONST_BITS) ; psrad xmm5,16 & pslld xmm5,CONST_BITS psrad xmm7, (16-CONST_BITS) ; psrad xmm7,16 & pslld xmm7,CONST_BITS movdqa xmm2, xmm5 paddd xmm5, xmm1 ; xmm5=tmp11L psubd xmm2, xmm1 ; xmm2=tmp12L movdqa xmm0, xmm7 paddd xmm7, xmm3 ; xmm7=tmp11H psubd xmm0, xmm3 ; xmm0=tmp12H movdqa XMMWORD [wk(4)], xmm5 ; wk(4)=tmp11L movdqa XMMWORD [wk(5)], xmm7 ; wk(5)=tmp11H movdqa XMMWORD [wk(6)], xmm2 ; wk(6)=tmp12L movdqa XMMWORD [wk(7)], xmm0 ; wk(7)=tmp12H ; -- Odd part movdqa xmm4, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm6, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] pmullw xmm4, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm6, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm1, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] pmullw xmm1, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm5, xmm6 movdqa xmm7, xmm4 paddw xmm5, xmm3 ; xmm5=z3 paddw xmm7, xmm1 ; xmm7=z4 ; (Original) ; z5 = (z3 + z4) * 1.175875602; ; z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; ; z3 += z5; z4 += z5; ; ; (This implementation) ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); movdqa xmm2, xmm5 movdqa xmm0, xmm5 punpcklwd xmm2, xmm7 punpckhwd xmm0, xmm7 movdqa xmm5, xmm2 movdqa xmm7, xmm0 pmaddwd xmm2, [rel PW_MF078_F117] ; xmm2=z3L pmaddwd xmm0, [rel PW_MF078_F117] ; xmm0=z3H pmaddwd xmm5, [rel PW_F117_F078] ; xmm5=z4L pmaddwd xmm7, [rel PW_F117_F078] ; xmm7=z4H movdqa XMMWORD [wk(10)], xmm2 ; wk(10)=z3L movdqa XMMWORD [wk(11)], xmm0 ; wk(11)=z3H ; (Original) ; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; ; tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869; ; tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110; ; z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; ; tmp0 += z1 + z3; tmp1 += z2 + z4; ; tmp2 += z2 + z3; tmp3 += z1 + z4; ; ; (This implementation) ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223; ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447; ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447); ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223); ; tmp0 += z3; tmp1 += z4; ; tmp2 += z3; tmp3 += z4; movdqa xmm2, xmm3 movdqa xmm0, xmm3 punpcklwd xmm2, xmm4 punpckhwd xmm0, xmm4 movdqa xmm3, xmm2 movdqa xmm4, xmm0 pmaddwd xmm2, [rel PW_MF060_MF089] ; xmm2=tmp0L pmaddwd xmm0, [rel PW_MF060_MF089] ; xmm0=tmp0H pmaddwd xmm3, [rel PW_MF089_F060] ; xmm3=tmp3L pmaddwd xmm4, [rel PW_MF089_F060] ; xmm4=tmp3H paddd xmm2, XMMWORD [wk(10)] ; xmm2=tmp0L paddd xmm0, XMMWORD [wk(11)] ; xmm0=tmp0H paddd xmm3, xmm5 ; xmm3=tmp3L paddd xmm4, xmm7 ; xmm4=tmp3H movdqa XMMWORD [wk(8)], xmm2 ; wk(8)=tmp0L movdqa XMMWORD [wk(9)], xmm0 ; wk(9)=tmp0H movdqa xmm2, xmm1 movdqa xmm0, xmm1 punpcklwd xmm2, xmm6 punpckhwd xmm0, xmm6 movdqa xmm1, xmm2 movdqa xmm6, xmm0 pmaddwd xmm2, [rel PW_MF050_MF256] ; xmm2=tmp1L pmaddwd xmm0, [rel PW_MF050_MF256] ; xmm0=tmp1H pmaddwd xmm1, [rel PW_MF256_F050] ; xmm1=tmp2L pmaddwd xmm6, [rel PW_MF256_F050] ; xmm6=tmp2H paddd xmm2, xmm5 ; xmm2=tmp1L paddd xmm0, xmm7 ; xmm0=tmp1H paddd xmm1, XMMWORD [wk(10)] ; xmm1=tmp2L paddd xmm6, XMMWORD [wk(11)] ; xmm6=tmp2H movdqa XMMWORD [wk(10)], xmm2 ; wk(10)=tmp1L movdqa XMMWORD [wk(11)], xmm0 ; wk(11)=tmp1H ; -- Final output stage movdqa xmm5, XMMWORD [wk(0)] ; xmm5=tmp10L movdqa xmm7, XMMWORD [wk(1)] ; xmm7=tmp10H movdqa xmm2, xmm5 movdqa xmm0, xmm7 paddd xmm5, xmm3 ; xmm5=data0L paddd xmm7, xmm4 ; xmm7=data0H psubd xmm2, xmm3 ; xmm2=data7L psubd xmm0, xmm4 ; xmm0=data7H movdqa xmm3, [rel PD_DESCALE_P1] ; xmm3=[rel PD_DESCALE_P1] paddd xmm5, xmm3 paddd xmm7, xmm3 psrad xmm5, DESCALE_P1 psrad xmm7, DESCALE_P1 paddd xmm2, xmm3 paddd xmm0, xmm3 psrad xmm2, DESCALE_P1 psrad xmm0, DESCALE_P1 packssdw xmm5, xmm7 ; xmm5=data0=(00 01 02 03 04 05 06 07) packssdw xmm2, xmm0 ; xmm2=data7=(70 71 72 73 74 75 76 77) movdqa xmm4, XMMWORD [wk(4)] ; xmm4=tmp11L movdqa xmm3, XMMWORD [wk(5)] ; xmm3=tmp11H movdqa xmm7, xmm4 movdqa xmm0, xmm3 paddd xmm4, xmm1 ; xmm4=data1L paddd xmm3, xmm6 ; xmm3=data1H psubd xmm7, xmm1 ; xmm7=data6L psubd xmm0, xmm6 ; xmm0=data6H movdqa xmm1, [rel PD_DESCALE_P1] ; xmm1=[rel PD_DESCALE_P1] paddd xmm4, xmm1 paddd xmm3, xmm1 psrad xmm4, DESCALE_P1 psrad xmm3, DESCALE_P1 paddd xmm7, xmm1 paddd xmm0, xmm1 psrad xmm7, DESCALE_P1 psrad xmm0, DESCALE_P1 packssdw xmm4, xmm3 ; xmm4=data1=(10 11 12 13 14 15 16 17) packssdw xmm7, xmm0 ; xmm7=data6=(60 61 62 63 64 65 66 67) movdqa xmm6, xmm5 ; transpose coefficients(phase 1) punpcklwd xmm5, xmm4 ; xmm5=(00 10 01 11 02 12 03 13) punpckhwd xmm6, xmm4 ; xmm6=(04 14 05 15 06 16 07 17) movdqa xmm1, xmm7 ; transpose coefficients(phase 1) punpcklwd xmm7, xmm2 ; xmm7=(60 70 61 71 62 72 63 73) punpckhwd xmm1, xmm2 ; xmm1=(64 74 65 75 66 76 67 77) movdqa xmm3, XMMWORD [wk(6)] ; xmm3=tmp12L movdqa xmm0, XMMWORD [wk(7)] ; xmm0=tmp12H movdqa xmm4, XMMWORD [wk(10)] ; xmm4=tmp1L movdqa xmm2, XMMWORD [wk(11)] ; xmm2=tmp1H movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(00 10 01 11 02 12 03 13) movdqa XMMWORD [wk(1)], xmm6 ; wk(1)=(04 14 05 15 06 16 07 17) movdqa XMMWORD [wk(4)], xmm7 ; wk(4)=(60 70 61 71 62 72 63 73) movdqa XMMWORD [wk(5)], xmm1 ; wk(5)=(64 74 65 75 66 76 67 77) movdqa xmm5, xmm3 movdqa xmm6, xmm0 paddd xmm3, xmm4 ; xmm3=data2L paddd xmm0, xmm2 ; xmm0=data2H psubd xmm5, xmm4 ; xmm5=data5L psubd xmm6, xmm2 ; xmm6=data5H movdqa xmm7, [rel PD_DESCALE_P1] ; xmm7=[rel PD_DESCALE_P1] paddd xmm3, xmm7 paddd xmm0, xmm7 psrad xmm3, DESCALE_P1 psrad xmm0, DESCALE_P1 paddd xmm5, xmm7 paddd xmm6, xmm7 psrad xmm5, DESCALE_P1 psrad xmm6, DESCALE_P1 packssdw xmm3, xmm0 ; xmm3=data2=(20 21 22 23 24 25 26 27) packssdw xmm5, xmm6 ; xmm5=data5=(50 51 52 53 54 55 56 57) movdqa xmm1, XMMWORD [wk(2)] ; xmm1=tmp13L movdqa xmm4, XMMWORD [wk(3)] ; xmm4=tmp13H movdqa xmm2, XMMWORD [wk(8)] ; xmm2=tmp0L movdqa xmm7, XMMWORD [wk(9)] ; xmm7=tmp0H movdqa xmm0, xmm1 movdqa xmm6, xmm4 paddd xmm1, xmm2 ; xmm1=data3L paddd xmm4, xmm7 ; xmm4=data3H psubd xmm0, xmm2 ; xmm0=data4L psubd xmm6, xmm7 ; xmm6=data4H movdqa xmm2, [rel PD_DESCALE_P1] ; xmm2=[rel PD_DESCALE_P1] paddd xmm1, xmm2 paddd xmm4, xmm2 psrad xmm1, DESCALE_P1 psrad xmm4, DESCALE_P1 paddd xmm0, xmm2 paddd xmm6, xmm2 psrad xmm0, DESCALE_P1 psrad xmm6, DESCALE_P1 packssdw xmm1, xmm4 ; xmm1=data3=(30 31 32 33 34 35 36 37) packssdw xmm0, xmm6 ; xmm0=data4=(40 41 42 43 44 45 46 47) movdqa xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 01 11 02 12 03 13) movdqa xmm2, XMMWORD [wk(1)] ; xmm2=(04 14 05 15 06 16 07 17) movdqa xmm4, xmm3 ; transpose coefficients(phase 1) punpcklwd xmm3, xmm1 ; xmm3=(20 30 21 31 22 32 23 33) punpckhwd xmm4, xmm1 ; xmm4=(24 34 25 35 26 36 27 37) movdqa xmm6, xmm0 ; transpose coefficients(phase 1) punpcklwd xmm0, xmm5 ; xmm0=(40 50 41 51 42 52 43 53) punpckhwd xmm6, xmm5 ; xmm6=(44 54 45 55 46 56 47 57) movdqa xmm1, xmm7 ; transpose coefficients(phase 2) punpckldq xmm7, xmm3 ; xmm7=(00 10 20 30 01 11 21 31) punpckhdq xmm1, xmm3 ; xmm1=(02 12 22 32 03 13 23 33) movdqa xmm5, xmm2 ; transpose coefficients(phase 2) punpckldq xmm2, xmm4 ; xmm2=(04 14 24 34 05 15 25 35) punpckhdq xmm5, xmm4 ; xmm5=(06 16 26 36 07 17 27 37) movdqa xmm3, XMMWORD [wk(4)] ; xmm3=(60 70 61 71 62 72 63 73) movdqa xmm4, XMMWORD [wk(5)] ; xmm4=(64 74 65 75 66 76 67 77) movdqa XMMWORD [wk(6)], xmm2 ; wk(6)=(04 14 24 34 05 15 25 35) movdqa XMMWORD [wk(7)], xmm5 ; wk(7)=(06 16 26 36 07 17 27 37) movdqa xmm2, xmm0 ; transpose coefficients(phase 2) punpckldq xmm0, xmm3 ; xmm0=(40 50 60 70 41 51 61 71) punpckhdq xmm2, xmm3 ; xmm2=(42 52 62 72 43 53 63 73) movdqa xmm5, xmm6 ; transpose coefficients(phase 2) punpckldq xmm6, xmm4 ; xmm6=(44 54 64 74 45 55 65 75) punpckhdq xmm5, xmm4 ; xmm5=(46 56 66 76 47 57 67 77) movdqa xmm3, xmm7 ; transpose coefficients(phase 3) punpcklqdq xmm7, xmm0 ; xmm7=col0=(00 10 20 30 40 50 60 70) punpckhqdq xmm3, xmm0 ; xmm3=col1=(01 11 21 31 41 51 61 71) movdqa xmm4, xmm1 ; transpose coefficients(phase 3) punpcklqdq xmm1, xmm2 ; xmm1=col2=(02 12 22 32 42 52 62 72) punpckhqdq xmm4, xmm2 ; xmm4=col3=(03 13 23 33 43 53 63 73) movdqa xmm0, XMMWORD [wk(6)] ; xmm0=(04 14 24 34 05 15 25 35) movdqa xmm2, XMMWORD [wk(7)] ; xmm2=(06 16 26 36 07 17 27 37) movdqa XMMWORD [wk(8)], xmm3 ; wk(8)=col1 movdqa XMMWORD [wk(9)], xmm4 ; wk(9)=col3 movdqa xmm3, xmm0 ; transpose coefficients(phase 3) punpcklqdq xmm0, xmm6 ; xmm0=col4=(04 14 24 34 44 54 64 74) punpckhqdq xmm3, xmm6 ; xmm3=col5=(05 15 25 35 45 55 65 75) movdqa xmm4, xmm2 ; transpose coefficients(phase 3) punpcklqdq xmm2, xmm5 ; xmm2=col6=(06 16 26 36 46 56 66 76) punpckhqdq xmm4, xmm5 ; xmm4=col7=(07 17 27 37 47 57 67 77) movdqa XMMWORD [wk(10)], xmm3 ; wk(10)=col5 movdqa XMMWORD [wk(11)], xmm4 ; wk(11)=col7 .column_end: ; -- Prefetch the next coefficient block prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32] ; ---- Pass 2: process rows from work array, store into output array. mov rax, [original_rbp] mov rdi, r12 ; (JSAMPROW *) mov eax, r13d ; -- Even part ; xmm7=col0, xmm1=col2, xmm0=col4, xmm2=col6 ; (Original) ; z1 = (z2 + z3) * 0.541196100; ; tmp2 = z1 + z3 * -1.847759065; ; tmp3 = z1 + z2 * 0.765366865; ; ; (This implementation) ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065); ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100; movdqa xmm6, xmm1 ; xmm1=in2=z2 movdqa xmm5, xmm1 punpcklwd xmm6, xmm2 ; xmm2=in6=z3 punpckhwd xmm5, xmm2 movdqa xmm1, xmm6 movdqa xmm2, xmm5 pmaddwd xmm6, [rel PW_F130_F054] ; xmm6=tmp3L pmaddwd xmm5, [rel PW_F130_F054] ; xmm5=tmp3H pmaddwd xmm1, [rel PW_F054_MF130] ; xmm1=tmp2L pmaddwd xmm2, [rel PW_F054_MF130] ; xmm2=tmp2H movdqa xmm3, xmm7 paddw xmm7, xmm0 ; xmm7=in0+in4 psubw xmm3, xmm0 ; xmm3=in0-in4 pxor xmm4, xmm4 pxor xmm0, xmm0 punpcklwd xmm4, xmm7 ; xmm4=tmp0L punpckhwd xmm0, xmm7 ; xmm0=tmp0H psrad xmm4, (16-CONST_BITS) ; psrad xmm4,16 & pslld xmm4,CONST_BITS psrad xmm0, (16-CONST_BITS) ; psrad xmm0,16 & pslld xmm0,CONST_BITS movdqa xmm7, xmm4 paddd xmm4, xmm6 ; xmm4=tmp10L psubd xmm7, xmm6 ; xmm7=tmp13L movdqa xmm6, xmm0 paddd xmm0, xmm5 ; xmm0=tmp10H psubd xmm6, xmm5 ; xmm6=tmp13H movdqa XMMWORD [wk(0)], xmm4 ; wk(0)=tmp10L movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=tmp10H movdqa XMMWORD [wk(2)], xmm7 ; wk(2)=tmp13L movdqa XMMWORD [wk(3)], xmm6 ; wk(3)=tmp13H pxor xmm5, xmm5 pxor xmm4, xmm4 punpcklwd xmm5, xmm3 ; xmm5=tmp1L punpckhwd xmm4, xmm3 ; xmm4=tmp1H psrad xmm5, (16-CONST_BITS) ; psrad xmm5,16 & pslld xmm5,CONST_BITS psrad xmm4, (16-CONST_BITS) ; psrad xmm4,16 & pslld xmm4,CONST_BITS movdqa xmm0, xmm5 paddd xmm5, xmm1 ; xmm5=tmp11L psubd xmm0, xmm1 ; xmm0=tmp12L movdqa xmm7, xmm4 paddd xmm4, xmm2 ; xmm4=tmp11H psubd xmm7, xmm2 ; xmm7=tmp12H movdqa XMMWORD [wk(4)], xmm5 ; wk(4)=tmp11L movdqa XMMWORD [wk(5)], xmm4 ; wk(5)=tmp11H movdqa XMMWORD [wk(6)], xmm0 ; wk(6)=tmp12L movdqa XMMWORD [wk(7)], xmm7 ; wk(7)=tmp12H ; -- Odd part movdqa xmm6, XMMWORD [wk(9)] ; xmm6=col3 movdqa xmm3, XMMWORD [wk(8)] ; xmm3=col1 movdqa xmm1, XMMWORD [wk(11)] ; xmm1=col7 movdqa xmm2, XMMWORD [wk(10)] ; xmm2=col5 movdqa xmm5, xmm6 movdqa xmm4, xmm3 paddw xmm5, xmm1 ; xmm5=z3 paddw xmm4, xmm2 ; xmm4=z4 ; (Original) ; z5 = (z3 + z4) * 1.175875602; ; z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; ; z3 += z5; z4 += z5; ; ; (This implementation) ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); movdqa xmm0, xmm5 movdqa xmm7, xmm5 punpcklwd xmm0, xmm4 punpckhwd xmm7, xmm4 movdqa xmm5, xmm0 movdqa xmm4, xmm7 pmaddwd xmm0, [rel PW_MF078_F117] ; xmm0=z3L pmaddwd xmm7, [rel PW_MF078_F117] ; xmm7=z3H pmaddwd xmm5, [rel PW_F117_F078] ; xmm5=z4L pmaddwd xmm4, [rel PW_F117_F078] ; xmm4=z4H movdqa XMMWORD [wk(10)], xmm0 ; wk(10)=z3L movdqa XMMWORD [wk(11)], xmm7 ; wk(11)=z3H ; (Original) ; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; ; tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869; ; tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110; ; z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; ; tmp0 += z1 + z3; tmp1 += z2 + z4; ; tmp2 += z2 + z3; tmp3 += z1 + z4; ; ; (This implementation) ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223; ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447; ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447); ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223); ; tmp0 += z3; tmp1 += z4; ; tmp2 += z3; tmp3 += z4; movdqa xmm0, xmm1 movdqa xmm7, xmm1 punpcklwd xmm0, xmm3 punpckhwd xmm7, xmm3 movdqa xmm1, xmm0 movdqa xmm3, xmm7 pmaddwd xmm0, [rel PW_MF060_MF089] ; xmm0=tmp0L pmaddwd xmm7, [rel PW_MF060_MF089] ; xmm7=tmp0H pmaddwd xmm1, [rel PW_MF089_F060] ; xmm1=tmp3L pmaddwd xmm3, [rel PW_MF089_F060] ; xmm3=tmp3H paddd xmm0, XMMWORD [wk(10)] ; xmm0=tmp0L paddd xmm7, XMMWORD [wk(11)] ; xmm7=tmp0H paddd xmm1, xmm5 ; xmm1=tmp3L paddd xmm3, xmm4 ; xmm3=tmp3H movdqa XMMWORD [wk(8)], xmm0 ; wk(8)=tmp0L movdqa XMMWORD [wk(9)], xmm7 ; wk(9)=tmp0H movdqa xmm0, xmm2 movdqa xmm7, xmm2 punpcklwd xmm0, xmm6 punpckhwd xmm7, xmm6 movdqa xmm2, xmm0 movdqa xmm6, xmm7 pmaddwd xmm0, [rel PW_MF050_MF256] ; xmm0=tmp1L pmaddwd xmm7, [rel PW_MF050_MF256] ; xmm7=tmp1H pmaddwd xmm2, [rel PW_MF256_F050] ; xmm2=tmp2L pmaddwd xmm6, [rel PW_MF256_F050] ; xmm6=tmp2H paddd xmm0, xmm5 ; xmm0=tmp1L paddd xmm7, xmm4 ; xmm7=tmp1H paddd xmm2, XMMWORD [wk(10)] ; xmm2=tmp2L paddd xmm6, XMMWORD [wk(11)] ; xmm6=tmp2H movdqa XMMWORD [wk(10)], xmm0 ; wk(10)=tmp1L movdqa XMMWORD [wk(11)], xmm7 ; wk(11)=tmp1H ; -- Final output stage movdqa xmm5, XMMWORD [wk(0)] ; xmm5=tmp10L movdqa xmm4, XMMWORD [wk(1)] ; xmm4=tmp10H movdqa xmm0, xmm5 movdqa xmm7, xmm4 paddd xmm5, xmm1 ; xmm5=data0L paddd xmm4, xmm3 ; xmm4=data0H psubd xmm0, xmm1 ; xmm0=data7L psubd xmm7, xmm3 ; xmm7=data7H movdqa xmm1, [rel PD_DESCALE_P2] ; xmm1=[rel PD_DESCALE_P2] paddd xmm5, xmm1 paddd xmm4, xmm1 psrad xmm5, DESCALE_P2 psrad xmm4, DESCALE_P2 paddd xmm0, xmm1 paddd xmm7, xmm1 psrad xmm0, DESCALE_P2 psrad xmm7, DESCALE_P2 packssdw xmm5, xmm4 ; xmm5=data0=(00 10 20 30 40 50 60 70) packssdw xmm0, xmm7 ; xmm0=data7=(07 17 27 37 47 57 67 77) movdqa xmm3, XMMWORD [wk(4)] ; xmm3=tmp11L movdqa xmm1, XMMWORD [wk(5)] ; xmm1=tmp11H movdqa xmm4, xmm3 movdqa xmm7, xmm1 paddd xmm3, xmm2 ; xmm3=data1L paddd xmm1, xmm6 ; xmm1=data1H psubd xmm4, xmm2 ; xmm4=data6L psubd xmm7, xmm6 ; xmm7=data6H movdqa xmm2, [rel PD_DESCALE_P2] ; xmm2=[rel PD_DESCALE_P2] paddd xmm3, xmm2 paddd xmm1, xmm2 psrad xmm3, DESCALE_P2 psrad xmm1, DESCALE_P2 paddd xmm4, xmm2 paddd xmm7, xmm2 psrad xmm4, DESCALE_P2 psrad xmm7, DESCALE_P2 packssdw xmm3, xmm1 ; xmm3=data1=(01 11 21 31 41 51 61 71) packssdw xmm4, xmm7 ; xmm4=data6=(06 16 26 36 46 56 66 76) packsswb xmm5, xmm4 ; xmm5=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) packsswb xmm3, xmm0 ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) movdqa xmm6, XMMWORD [wk(6)] ; xmm6=tmp12L movdqa xmm2, XMMWORD [wk(7)] ; xmm2=tmp12H movdqa xmm1, XMMWORD [wk(10)] ; xmm1=tmp1L movdqa xmm7, XMMWORD [wk(11)] ; xmm7=tmp1H movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) movdqa XMMWORD [wk(1)], xmm3 ; wk(1)=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) movdqa xmm4, xmm6 movdqa xmm0, xmm2 paddd xmm6, xmm1 ; xmm6=data2L paddd xmm2, xmm7 ; xmm2=data2H psubd xmm4, xmm1 ; xmm4=data5L psubd xmm0, xmm7 ; xmm0=data5H movdqa xmm5, [rel PD_DESCALE_P2] ; xmm5=[rel PD_DESCALE_P2] paddd xmm6, xmm5 paddd xmm2, xmm5 psrad xmm6, DESCALE_P2 psrad xmm2, DESCALE_P2 paddd xmm4, xmm5 paddd xmm0, xmm5 psrad xmm4, DESCALE_P2 psrad xmm0, DESCALE_P2 packssdw xmm6, xmm2 ; xmm6=data2=(02 12 22 32 42 52 62 72) packssdw xmm4, xmm0 ; xmm4=data5=(05 15 25 35 45 55 65 75) movdqa xmm3, XMMWORD [wk(2)] ; xmm3=tmp13L movdqa xmm1, XMMWORD [wk(3)] ; xmm1=tmp13H movdqa xmm7, XMMWORD [wk(8)] ; xmm7=tmp0L movdqa xmm5, XMMWORD [wk(9)] ; xmm5=tmp0H movdqa xmm2, xmm3 movdqa xmm0, xmm1 paddd xmm3, xmm7 ; xmm3=data3L paddd xmm1, xmm5 ; xmm1=data3H psubd xmm2, xmm7 ; xmm2=data4L psubd xmm0, xmm5 ; xmm0=data4H movdqa xmm7, [rel PD_DESCALE_P2] ; xmm7=[rel PD_DESCALE_P2] paddd xmm3, xmm7 paddd xmm1, xmm7 psrad xmm3, DESCALE_P2 psrad xmm1, DESCALE_P2 paddd xmm2, xmm7 paddd xmm0, xmm7 psrad xmm2, DESCALE_P2 psrad xmm0, DESCALE_P2 movdqa xmm5, [rel PB_CENTERJSAMP] ; xmm5=[rel PB_CENTERJSAMP] packssdw xmm3, xmm1 ; xmm3=data3=(03 13 23 33 43 53 63 73) packssdw xmm2, xmm0 ; xmm2=data4=(04 14 24 34 44 54 64 74) movdqa xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) movdqa xmm1, XMMWORD [wk(1)] ; xmm1=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) packsswb xmm6, xmm2 ; xmm6=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74) packsswb xmm3, xmm4 ; xmm3=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75) paddb xmm7, xmm5 paddb xmm1, xmm5 paddb xmm6, xmm5 paddb xmm3, xmm5 movdqa xmm0, xmm7 ; transpose coefficients(phase 1) punpcklbw xmm7, xmm1 ; xmm7=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71) punpckhbw xmm0, xmm1 ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77) movdqa xmm2, xmm6 ; transpose coefficients(phase 1) punpcklbw xmm6, xmm3 ; xmm6=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73) punpckhbw xmm2, xmm3 ; xmm2=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75) movdqa xmm4, xmm7 ; transpose coefficients(phase 2) punpcklwd xmm7, xmm6 ; xmm7=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33) punpckhwd xmm4, xmm6 ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73) movdqa xmm5, xmm2 ; transpose coefficients(phase 2) punpcklwd xmm2, xmm0 ; xmm2=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37) punpckhwd xmm5, xmm0 ; xmm5=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77) movdqa xmm1, xmm7 ; transpose coefficients(phase 3) punpckldq xmm7, xmm2 ; xmm7=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17) punpckhdq xmm1, xmm2 ; xmm1=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37) movdqa xmm3, xmm4 ; transpose coefficients(phase 3) punpckldq xmm4, xmm5 ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57) punpckhdq xmm3, xmm5 ; xmm3=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77) pshufd xmm6, xmm7, 0x4E ; xmm6=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07) pshufd xmm0, xmm1, 0x4E ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27) pshufd xmm2, xmm4, 0x4E ; xmm2=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47) pshufd xmm5, xmm3, 0x4E ; xmm5=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67) mov rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+2*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm7 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm1 mov rdx, JSAMPROW [rdi+4*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+6*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3 mov rdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0 mov rdx, JSAMPROW [rdi+5*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+7*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm2 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm5 uncollect_args 4 mov rsp, rbp ; rsp <- aligned rbp pop rsp ; rsp <- original rbp pop rbp ret ; For some reason, the OS X linker does not honor the request to align the ; segment unless we do this. align 32 ",16182,True,4058.834115177169,median "COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: Config MODULE: FILE: penCode.asm AUTHOR: Andrew Wilson, Feb 14, 1992 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- atw 2/14/92 Initial revision DESCRIPTION: Contains code to handle pen support for text object $Id: penCode.asm,v 1.1 97/04/07 11:21:27 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PenCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisTextSetHWRFilter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sets the text filters for handwriting recognition. This is done via a method so app writers can subclass this. CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 2/27/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisTextSetHWRFilter proc far class VisTextClass libHandle local hptr .enter ; Ensure we disable character ranges if either a VisTextFilter ; or custom filter has been provided. mov di, ds:[si] add di, ds:[di].VisText_offset mov cl, ds:[di].VTI_filters tst cl ;If any filter are present jnz disable ;then we have ranges to diaable mov ax, ATTR_VIS_TEXT_CUSTOM_FILTER call ObjVarFindData jnc exit disable: ; Disable the ranges appropriate for this filter call UserGetHWRLibraryHandle mov libHandle, ax call DisableTextRanges ; Set up a callback to filter out inappropriate characters (disabling ; char ranges may not be enough, or may not have been possible for ; certain filters). FXIP< mov ax, SEGMENT_CS > FXIP< push ax > mov ax, offset FilterChar FXIP< push ax > NOFXIP< pushdw csax > push ds:[LMBH_handle], si ;Save ptr to object data CallHWRLibrary HWRR_SET_CHAR_FILTER_CALLBACK exit: .leave Destroy ax, cx, dx, bp ret VisTextSetHWRFilter endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FilterChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This routine is called by the HWR code - it gets a bunch of data, and returns a character that it chooses from the data. CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 9/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; ; Set the code convention to be pascal, by default. ; SetGeosConvention FilterChar proc far numChoices:word, firstPoint:word, lastPoint:word, charChoices:fptr.word, callbackData:optr ForceRef firstPoint ForceRef lastPoint uses es, ds, si, di .enter movdw bxsi, callbackData call MemDerefDS ;*DS:SI <- VisTextObject EC < call T_AssertIsVisText > mov cx, numChoices jcxz noChoices EC < cmp cx, 200 > EC < ERROR_A TOO_MANY_CHAR_CHOICES > les di, charChoices ; Scan through char choices until we find one that isn't filtered. nextChar: mov ax, es:[di] call TF_CheckIfCharFiltered jnc exit add di, size word loop nextChar noChoices: clr ax ;No valid character choices exit: .leave ret FilterChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DisableTextRanges %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Disables the text ranges associated with the passed filter CALLED BY: GLOBAL PASS: cl - VisTextFilter RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 9/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DisableTextRanges proc near .enter inherit VisTextSetHWRFilter test cl, mask VTF_NO_SPACES jz noDisableSpaces push cx mov ax, C_SPACE push ax push ax CallHWRLibrary HWRR_DISABLE_CHAR_RANGE pop cx noDisableSpaces: test cl, mask VTF_NO_TABS jz noDisableTabs push cx mov ax, C_TAB push ax push ax CallHWRLibrary HWRR_DISABLE_CHAR_RANGE pop cx noDisableTabs: andnf cl, mask VTF_FILTER_CLASS clr ch ; For most of the filters, it is not practical (or possible?) to disable ; every character that would be filtered out. Our goal is to disable ; some subset of the characters to help out the recognizer, not to ; provide a perfect filter. mov_tr ax, cx ;AX <- VisTextFilterClass mov di, offset filters segmov es, cs mov cx, length filters repne scasw jne noCall ;Branch if no handler for the class call cs:[di][filterRouts-(filters+2)] noCall: mov ax, ATTR_VIS_TEXT_CUSTOM_FILTER call ObjVarFindData jnc exit ; ; Scan through the array of VisTextCustomFilterData structures, and ; disable the associated ranges. ; mov bx, ds:[bx] mov bx, ds:[bx] ;DS:BX <- array ChunkSizePtr ds, bx, dx ;DX <- # bytes in item .assert size VisTextCustomFilterData eq 4 shr dx shr dx ;DX <- # items in table. jz exit ;If no items, exit (no filter) loopTop: push bx, dx push ds:[bx].VTCFD_startOfRange push ds:[bx].VTCFD_endOfRange CallHWRLibrary HWRR_DISABLE_CHAR_RANGE pop bx, dx add bx, size VisTextCustomFilterData dec dx jnz loopTop exit: .leave ret DisableTextRanges endp filters word \\ VTFC_ALPHA, VTFC_NUMERIC, VTFC_SIGNED_NUMERIC, VTFC_SIGNED_DECIMAL, VTFC_FLOAT_DECIMAL filterRouts nptr \\ DisableNonAlpha, DisableNonNumeric, DisableNonSignedNumeric, DisableNonSignedDecimal, DisableNonFloat .assert length filterRouts eq length filters .assert size filterRouts eq size filters COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DisableNonAlpha %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Disables non-alpha chars. CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 9/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DisableNonAlpha proc near .enter inherit DisableTextRanges ; Disable all but A-Z, a-z, and extended chars. mov ax, C_SPACE+1 push ax mov ax, 'A'-1 push ax CallHWRLibrary HWRR_DISABLE_CHAR_RANGE mov ax, 'Z'+1 push ax mov ax, 'a'-1 push ax CallHWRLibrary HWRR_DISABLE_CHAR_RANGE mov ax, 'z'+1 push ax mov ax, 0x7f push ax CallHWRLibrary HWRR_DISABLE_CHAR_RANGE .leave ret DisableNonAlpha endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DisableNonNumeric %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Disable non numeric range CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 9/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DisableNonNumeric proc near .enter inherit DisableTextRanges mov ax, C_SPACE+1 push ax mov ax, '0'-1 push ax CallHWRLibrary HWRR_DISABLE_CHAR_RANGE mov ax, '9'+1 push ax mov ax, 0xff push ax CallHWRLibrary HWRR_DISABLE_CHAR_RANGE .leave ret DisableNonNumeric endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DisableNonSignedNumeric %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Disable all but numerals and +- CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 9/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DisableNonSignedNumeric proc near .enter inherit DisableTextRanges call DisableNonNumeric ; Disable all but 0-9, -, + mov ax, '-' push ax push ax CallHWRLibrary HWRR_ENABLE_CHAR_RANGE mov ax, '+' push ax push ax CallHWRLibrary HWRR_ENABLE_CHAR_RANGE .leave ret DisableNonSignedNumeric endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DisableNonSignedDecimal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Disables non-numerics and decimals CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 9/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DisableNonSignedDecimal proc near .enter inherit DisableTextRanges call DisableNonSignedNumeric call LocalGetNumericFormat push cx ;Enable the decimal point push cx CallHWRLibrary HWRR_ENABLE_CHAR_RANGE .leave ret DisableNonSignedDecimal endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DisableNonFloat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Disables non-numerics and decimals CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 9/18/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DisableNonFloat proc near .enter inherit DisableTextRanges call DisableNonSignedDecimal mov cx, 'e' ;Enable E/e (scientific notation shme) push cx push cx CallHWRLibrary HWRR_ENABLE_CHAR_RANGE mov cx, 'E' push cx push cx CallHWRLibrary HWRR_ENABLE_CHAR_RANGE .leave ret DisableNonFloat endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DoHWR %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This routine takes a handle to a block of ink, and converts it into text, and returns this text in a block CALLED BY: GLOBAL PASS: bx - block with Ink cx - VisTextHWRFlags *ds:si - ptr to VisText object es:di - ptr to context (not used unless VTHWRF_USE_PASSED_CONTEXT set in CX) RETURN: cx - block with text or 0 if nothing recognized or -1 if it was a gesture DX - GestureType bx - unchanged DESTROYED: dx, di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 12/12/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DoHWR proc near uses ax, es, bp class VisTextClass context local fptr.HWRContext \\ push es, di blockHandle local hptr \\ push bx flags local VisTextHWRFlags \\ push cx libHandle local hptr ;Used by CallHWRLibrary macro .enter EC < test cx, not mask VisTextHWRFlags > EC < ERROR_NZ BAD_VIS_TEXT_HWR_FLAGS > ; Begin the interaction with the HWR library call UserGetHWRLibraryHandle tst ax ;Exit if no HWR library loaded LONG jz errorExit ; (not in pen mode?) mov libHandle, ax CallHWRLibrary HWRR_BEGIN_INTERACTION tst ax LONG jnz errorExit ;If error, exit CallHWRLibrary HWRR_RESET test flags, mask VTHWRF_NO_CONTEXT jnz noContext test flags, mask VTHWRF_USE_PASSED_CONTEXT jz defaultContext ; Use the context that has been passed in pushdw context CallHWRLibrary HWRR_SET_CONTEXT jmp noContext defaultContext: push bp mov ax, MSG_VIS_TEXT_SET_HWR_CONTEXT call ObjCallInstanceNoLock pop bp noContext: ; Setup the filter push bp mov ax, MSG_VIS_TEXT_SET_HWR_FILTER call ObjCallInstanceNoLock pop bp ; Pass the points off to the HWR library mov bx, blockHandle call MemLock mov es, ax push es:[IH_count] mov di, offset IH_data ;ES:DI <- ptr to Ink data pushdw esdi CallHWRLibrary HWRR_ADD_POINTS mov bx, blockHandle call MemUnlock CallHWRLibrary HWRR_DO_MULTIPLE_CHAR_RECOGNITION mov_tr cx, ax ;CX <- handle of block with string ; End the interaction with the HWR library push cx, dx CallHWRLibrary HWRR_END_INTERACTION pop cx, dx exit: .leave ret errorExit: clr cx jmp exit DoHWR endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EnsureRangeValid %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Ensure that the passed range is valid by padding it with spaces, if necessary. CALLED BY: GLOBAL PASS: ss:bp - VisTextRange *ds:si - text object RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 10/22/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ EnsureRangeValid proc near uses dx .enter call TS_GetTextSize subdw dxax, ss:[bp].VTR_start jc getNumSpaces clr ax exit: .leave ret getNumSpaces: neg ax ;AX = # spaces to add jmp exit EnsureRangeValid endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AppendSpaces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Appends spaces to the text CALLED BY: GLOBAL PASS: *ds:si - VisText object cx - # spaces to append RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 4/27/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AppendSpaces proc near uses ax, cx, dx, bp, es, di .enter EC < cmp cx, 50 > EC < ERROR_AE APPENDING_TOO_MANY_SPACES > sub sp, cx segmov es, ss mov di, sp push cx, di mov al, C_SPACE rep stosb pop cx, di ; Add the spaces to the object push cx sub sp, size VisTextReplaceParameters mov bp, sp ; ss:bp <- frame movdw ss:[bp].VTRP_range.VTR_start, TEXT_ADDRESS_PAST_END movdw ss:[bp].VTRP_range.VTR_end, TEXT_ADDRESS_PAST_END clr ss:[bp].VTRP_insCount.high mov ss:[bp].VTRP_insCount.low, cx mov ss:[bp].VTRP_flags, mask VTRF_FILTER or \\ mask VTRF_USER_MODIFICATION or \\ mask VTRF_DO_NOT_SEND_CONTEXT_UPDATE mov ss:[bp].VTRP_textReference.TR_type, TRT_POINTER movdw ss:[bp].VTRP_pointerReference,esdi mov ax, MSG_VIS_TEXT_REPLACE_TEXT call ObjCallInstanceNoLock add sp, size VisTextReplaceParameters pop cx add sp, cx .leave ret AppendSpaces endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisTextNotifyWithDataBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This routine handles ink blocks sent from the application. CALLED BY: GLOBAL PASS: ds:di - VisText object bp handle to data block dx notification type RETURN: nada DESTROYED: ax, bx, cx, dx, bp, di, si PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 12/ 6/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisTextNotifyWithDataBlock proc far class VisTextClass push ax, cx, dx, bp mov bx, bp ;BX <- data block cmp cx, MANUFACTURER_ID_GEOWORKS jne callSuper cmp dx, GWNT_TEXT_REPLACE_GESTURE je doGestureReplace cmp dx, GWNT_TEXT_REPLACE_WITH_HWR je doInkReplace cmp dx, GWNT_INK je cont cmp dx, GWNT_INK_GESTURE jne callSuper cont: EC < test ds:[di].VTI_state, mask VTS_EDITABLE > EC < ERROR_Z INK_RECEIVED_BY_NON_EDITABLE_OBJECT > mov di, 800 call ThreadBorrowStackSpace push di call TextMakeFocusAndTarget cmp dx, GWNT_INK_GESTURE jne cont2 call InsertGesture jmp restoreStack cont2: ; Mark the application as busy while we do HWR processing mov ax, MSG_GEN_APPLICATION_MARK_APP_COMPLETELY_BUSY call UserCallApplication call MemIncRefCount ;Inc the ref count so the block won't get freed ; until the MSG_VIS_TEXT_DO_HWR frees it. sub sp, size VisTextReplaceWithHWRParams mov bp, sp mov ss:[bp].VTRWHWRP_range.VTR_start.high, VIS_TEXT_RANGE_SELECTION clr ss:[bp].VTRWHWRP_flags mov ss:[bp].VTRWHWRP_ink, bx mov ax, MSG_VIS_TEXT_REPLACE_WITH_HWR call ObjCallInstanceNoLock add sp, size VisTextReplaceWithHWRParams markNotBusy:: mov ax, MSG_GEN_APPLICATION_MARK_APP_NOT_COMPLETELY_BUSY call UserCallApplication restoreStack: pop di call ThreadReturnStackSpace callSuper: pop ax, cx, dx, bp mov di, offset VisTextClass GOTO ObjCallSuperNoLock doGestureReplace: call DoGestureReplace jmp callSuper doInkReplace: mov di, 800 call ThreadBorrowStackSpace push di push es call MemIncRefCount call MemLock mov es, ax mov di, es:[IH_count] .assert size InkPoint eq 4 shl di shl di add di, size InkHeader ;ES:DI <- ptr to ReplaceWithHWRData sub sp, size VisTextReplaceWithHWRParams mov bp, sp movdw ss:[bp].VTRWHWRP_range.VTR_start, es:[di].RWHWRD_range.VTR_start, ax movdw ss:[bp].VTRWHWRP_range.VTR_end, es:[di].RWHWRD_range.VTR_end, ax mov ss:[bp].VTRWHWRP_ink, bx mov ss:[bp].VTRWHWRP_flags, mask VTHWRF_USE_PASSED_CONTEXT push ds, si segmov ds, es segmov es, ss lea si, ds:[di].RWHWRD_context lea di, es:[bp].VTRWHWRP_context mov cx, size HWRContext rep movsb pop ds, si call EnsureRangeValid ;If the range starts beyond the text ; append spaces to make it valid call VisTextReplaceWithHWR add sp, size VisTextReplaceWithHWRParams pop es jmp restoreStack VisTextNotifyWithDataBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisTextReplaceWithHWR %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Performs HWR on the passed ink block CALLED BY: GLOBAL PASS: *ds:si - VisText object ss:bp - VisTextReplaceWithHWRParams ax - # spaces to insert, *or* MSG_VIS_TEXT_REPLACE_WITH_HWR RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 2/12/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisTextReplaceWithHWR proc far ;MSG_VIS_TEXT_REPLACE_WITH_HWR class VisTextClass mov bx, ss:[bp].VTRWHWRP_ink ;BX <- handle of ink mov cx, ss:[bp].VTRWHWRP_flags push bx mov di, ds:[si] add di, ds:[di].VisText_offset test ds:[di].VTI_state, mask VTS_EDITABLE jz doExit ; Call Handwriting Recognition code here: segmov es, ss lea di, ss:[bp].VTRWHWRP_context call DoHWR jcxz giveBeepAndExit ; mov bx, cx mov_tr cx, ax call MemLock mov es, ax tst {byte}es:[0] jnz addText call MemFree ;Free the text block giveBeepAndExit: ;Beep, to inform the user that no chars mov ax, SST_NOTIFY ; were recognized. call UserStandardSound doExit: pop bx GOTO MemDecRefCount addText: ; Replace the selection with the recognized text ; CX <- # spaces to append before doing HWR ; (or MSG_VIS_TEXT_REPLACE_WITH_HWR) ; SS:BP - VisTextReplaceWithHWRParams mov ax, offset InkString call TU_StartChainIfUndoable sub sp, size VisTextReplaceParameters mov di, sp ; ss:di <- frame movdw ss:[di].VTRP_range.VTR_start, ss:[bp].VTRWHWRP_range.VTR_start, ax movdw ss:[di].VTRP_range.VTR_end, ss:[bp].VTRWHWRP_range.VTR_end, ax mov bp, di ;SS:BP <- frame jcxz noAppendSpaces cmp cx, MSG_VIS_TEXT_REPLACE_WITH_HWR je noAppendSpaces call AppendSpaces movdw ss:[bp].VTRP_range.VTR_start, TEXT_ADDRESS_PAST_END movdw ss:[bp].VTRP_range.VTR_end, TEXT_ADDRESS_PAST_END noAppendSpaces: mov ss:[bp].VTRP_insCount.high, INSERT_COMPUTE_TEXT_LENGTH mov ss:[bp].VTRP_insCount.low, 0 mov ss:[bp].VTRP_flags, mask VTRF_FILTER or \\ mask VTRF_USER_MODIFICATION mov ss:[bp].VTRP_textReference.TR_type, TRT_POINTER mov ss:[bp].VTRP_pointerReference.segment,es clr ss:[bp].VTRP_pointerReference.offset mov ax, MSG_VIS_TEXT_REPLACE_TEXT call ObjCallInstanceNoLock add sp, size VisTextReplaceParameters call TU_EndChainIfUndoable call MemFree ;Free up the recognized text jmp doExit VisTextReplaceWithHWR endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DoGestureReplace %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This procedure deals with a gesture replace message from the HWR grid. It takes the the text range passed in the ReplaceWithGestureData and replaces it with the data passed in ReplaceWithGestureData CALLED BY: PASS: bx - handle to ReplaceWithGestureData RETURN: nothing DESTROYED: si, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/18/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DoGestureReplace proc near uses ax,bx,dx,es,bp .enter call MemLock jc exit mov es, ax mov dx, es:[RWGD_gestureType] push bx mov bx, dx EC < cmp bx, GestureType > EC < ERROR_A VIS_TEXT_INVALID_GESTURE > shl bx, 1 ; index into our nptr table call cs:[handleGestureReplaceTable][bx] pop bx call MemUnlock exit: .leave ret DoGestureReplace endp ; ; these procedures can destroy the following regesters: ; ax, bx, cx, dx, si, di ; handleGestureReplaceTable nptr \\ GestureReplaceNull, ; GT_NO_GESTURE GestureReplaceNull, ; GT_DELETE_CHARS GestureReplaceNull, ; GT_SELECT_CHARS GestureReplaceNull, ; GT_V_CROSSOUT GestureReplaceNull, ; GT_H_CROSSOUT GestureReplaceNull, ; GT_BACKSPACE GestureReplaceChar, ; GT_CHAR GestureReplaceNull, ; GT_STRING_MACRO GestureReplaceNull, ; GT_IGNORE_GESTURE GestureReplaceNull, ; GT_COPY GestureReplaceNull, ; GT_PASTE GestureReplaceNull, ; GT_CUT GestureReplaceChar, ; GT_MODE_CHAR GestureReplaceReplaceLastChar ; GT_REPLACE_LAST_CHAR .assert( (length handleGestureReplaceTable) eq GestureType ) COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureReplaceNull %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: function place holder until handler for gestures from the hwr grid for this gesture type are implemented. CALLED BY: PASS: RETURN: DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 6/29/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureReplaceNull proc near .enter .leave ret GestureReplaceNull endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureReplaceChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: replaces the passed range with the passed char. If the gesture type is GT_MODE_CHAR, then it supresses filtering CALLED BY: (PRIVATE)DoGestureReplace PASS: es:0 - prt to ReplaceWithGestureData *ds:si = VisTextObject RETURN: nothing DESTROYED: ax,bx,cx,dx,si,di,bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/19/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureReplaceChar proc near .enter mov ax, offset InkString call TU_StartChainIfUndoable sub sp, size VisTextReplaceParameters mov bp, sp ; ss:di <- frame ; ; do not filter this modification if it is a mode char ; cmp es:[RWGD_gestureType], GT_MODE_CHAR mov ss:[bp].VTRP_flags, mask VTRF_USER_MODIFICATION je noFilter or ss:[bp].VTRP_flags, mask VTRF_FILTER noFilter: movdw ss:[bp].VTRP_range.VTR_start, es:[RWGD_range].VTR_start, ax movdw ss:[bp].VTRP_range.VTR_end, es:[RWGD_range].VTR_end, ax call EnsureRangeValid ; ax <- number of spaces to ; append mov cx, ax jcxz noAppendSpaces call AppendSpaces movdw ss:[bp].VTRP_range.VTR_start, TEXT_ADDRESS_PAST_END movdw ss:[bp].VTRP_range.VTR_end, TEXT_ADDRESS_PAST_END noAppendSpaces: mov ss:[bp].VTRP_insCount.high, 0 mov ss:[bp].VTRP_insCount.low, 1 mov ss:[bp].VTRP_textReference.TR_type, TRT_POINTER mov ss:[bp].VTRP_pointerReference.segment, es mov ss:[bp].VTRP_pointerReference.offset, offset RWGD_data mov ax, MSG_VIS_TEXT_REPLACE_TEXT call ObjCallInstanceNoLock ; ; set the selection point to the end of the text that we just ; entered ; lea bp, ss:[bp].VTRP_range ; ; if start and end are the same, then the character was ; inserted after end, and we need to inc the selection point ; by one ; cmpdw ss:[bp].VTR_start, ss:[bp].VTR_end, ax jne doNotInc incdw ss:[bp].VTR_end doNotInc: movdw ss:[bp].VTR_start, ss:[bp].VTR_end, ax mov ax, MSG_VIS_TEXT_SELECT_RANGE call ObjCallInstanceNoLock add sp, size VisTextReplaceParameters call TU_EndChainIfUndoable .leave ret GestureReplaceChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureReplaceReplaceLastChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Backspace one and then replace the character with the passed character CALLED BY: (PRIVATE)DoGestureReplace PASS: es:0 - prt to ReplaceWithGestureData *ds:si VisTextObject RETURN: nothing DESTROYED: ax,bx,cx,dx,si,di,bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 6/29/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureReplaceReplaceLastChar proc near .enter mov ax, MSG_VIS_TEXT_DO_KEY_FUNCTION mov cx, VTKF_DELETE_BACKWARD_CHAR call ObjCallInstanceNoLock mov di, offset RWGD_data ; ; if there is no character then the HWR library just wanted to ; clean up the mode character it returned earlier. ; tst {word}es:[di] jz exit mov cx, TRUE ; filter this character call InsertChar exit: .leave ret GestureReplaceReplaceLastChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InsertGesture %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: calls the appropriate gesture function to deal with the gesture recieved CALLED BY: VistTextNotifyWithDataBlock PASS: *ds:si VisTextObject bx handle to gesture data block dx notification type, should be GWNT_INK_GESTURE RETURN: DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/15/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InsertGesture proc near uses ax,bx,cx,dx,es,bp,di .enter cmp dx, GWNT_INK_GESTURE jne exit call MemLock jc exit mov es, ax mov dx,es:[GH_gestureType] call MemUnlock mov ax, bx mov bx, dx shl bx, 1 EC < cmp bx, eGestureTab-gestureTab > EC < ERROR_A VIS_TEXT_INVALID_GESTURE > call cs:[gestureTab-2][bx] exit: .leave ret InsertGesture endp gestureTab nptr GestureDelete ;GT_DELETE_CHARS nptr GestureNull ;GT_SELECT_CHARS nptr GestureHCrossout ;GT_V_CROSSOUT nptr GestureHCrossout ;GT_H_CROSSOUT nptr GestureBackspace ;GT_BACKSPACE nptr GestureChar ;GT_CHAR nptr GestureStringMacro ;GT_STRING_MACRO nptr GestureNull ;GT_IGNORE_GESTURE nptr GestureCopy ;GT_COPY nptr GesturePaste ;GT_PASTE nptr GestureCut ;GT_CUT nptr GestureModeChar ;GT_MODE_CHAR nptr GestureReplaceLastChar ;GT_REPLACE_LAST_CHAR EC EC < .assert (eGestureTab - gestureTab)/(size nptr) eq GestureType-1 > COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureNull %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This is a placeholder routine until the various gesture handlers can be written. CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 12/16/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureNull proc near ret GestureNull endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureHCrossout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Delete the text under the rectangle of this gesture. This gesture comes with the handle to the rectangle bounding it. We delete the range of characters across the middle of that rectangle. CALLED BY: InsertGesture PASS: *ds:si VistTextObject ax handle to gesture data (GestureHeader) RETURN: nothing DESTROYED: ax, bx, cx, dx, es, di PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 6/30/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureHCrossout proc near class VisTextClass delPoint local PointDWFixed delRange local VisTextRange .enter mov bx, ax call MemLock push bx mov es, ax call TextGStateCreate mov di, ds:[si] add di, ds:[di].Vis_offset mov di, ds:[di].VTI_gstate ; ; es:GH_data = Rectangle data passed with gesture ; mov bx, ({Rectangle}es:[GH_data]).R_top add bx, ({Rectangle}es:[GH_data]).R_bottom shr bx, 1 ; bx = (top+bottom)/2; mov ax, ({Rectangle}es:[GH_data]).R_left push bx ; save y coord, since it is ; the same for both ends call GetRegionCoord jnc noProb pop bx popMemHandle: pop bx call MemUnlock .leave ret noProb: clr cx clrdwf ss:[delPoint].PDF_x, cx clrdwf ss:[delPoint].PDF_y, cx mov ss:[delPoint].PDF_x.DWF_int.low, ax mov ss:[delPoint].PDF_y.DWF_int.low, bx ; ; get the text postition of the beggining of the range to delete ; push bp lea bp, ss:[delPoint] mov ax, MSG_VIS_TEXT_GET_TEXT_POSITION_FROM_COORD call ObjCallInstanceNoLock pop bp movdw ss:[delRange].VTR_start, dxax ; ; put the point at the middle of the right hand side of the ; rectangle ; mov ax, ({Rectangle}es:[GH_data]).R_right pop bx call GetRegionCoord jnc noProb2 jmp popMemHandle noProb2: clr cx clrdwf ss:[delPoint].PDF_x, cx clrdwf ss:[delPoint].PDF_y, cx mov ss:[delPoint].PDF_x.DWF_int.low, ax mov ss:[delPoint].PDF_y.DWF_int.low, bx push bp lea bp, ss:[delPoint] ; ; get the text postition at the end of the range to delete ; mov ax, MSG_VIS_TEXT_GET_TEXT_POSITION_FROM_COORD call ObjCallInstanceNoLock pop bp movdw ss:[delRange].VTR_end, dxax ; ; need to make sure the start is before or equal to the end ; cmpdw ss:[delRange].VTR_end, ss:[delRange].VTR_start, ax jge ok movdw ss:[delRange].VTR_start, ss:[delRange].VTR_end, ax ok: ; ; Delete the range of chars ; push bp lea bp, ss:[delRange] mov ax, MSG_META_DELETE_RANGE_OF_CHARS call ObjCallInstanceNoLock pop bp call TextGStateDestroy jmp popMemHandle GestureHCrossout endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetRegionCoord %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get the document coord given a screen coord and the gstate of the text object. CALLED BY: (PRIVATE)GestureHCrossout PASS: *ds:si = VistTextObject es:0 = ptr to GestureHeader di = gstate of text object ax = x coord bx = y coord RETURN: ax = x coord bx = y coord carry if the transformation will cause an overflow DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 7/ 1/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetRegionCoord proc near class VisTextClass uses di .enter call GrUntransform jc exit ; ; Move the x coord to document coord ; mov di, ds:[si] add di, ds:[di].Vis_offset ; ; change x to document coord ; add ax, ds:[di].VI_bounds.R_left ; ax <- X translation add al, ds:[di].VTI_lrMargin adc ah, 0 ; ; change y to document coord ; add bx, ds:[di].VI_bounds.R_top ; ax <- X translation add bl, ds:[di].VTI_tbMargin adc bh, 0 ; ; change to position relative to this region ; exit: .leave ret GetRegionCoord endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Insert take the char located in the data portion of the GestureHeader and insert it into the VisTextObject CALLED BY: InsertGesture PASS: *ds:si VistTextObject ax handle to gesture data (GestureHeader) RETURN: nothing DESTROYED: ax, bx, cx, dx, es, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/11/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureChar proc near .enter mov bx, ax call MemLock jc exit mov es, ax mov di, offset GH_data mov cx, TRUE ; filter this char call InsertChar call MemUnlock exit: .leave ret GestureChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureReplaceLastChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Replace the last character entered. Backspace 1 and then insert the character. CALLED BY: InsertGesture PASS: *ds:si VistTextObject ax handle to gesture data (GestureHeader) RETURN: nothing DESTROYED: ax, bx, cx, dx, es, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 6/28/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureReplaceLastChar proc near .enter push ax, bp mov ax, MSG_VIS_TEXT_DO_KEY_FUNCTION mov cx, VTKF_DELETE_BACKWARD_CHAR call ObjCallInstanceNoLock pop ax, bp mov bx, ax call MemLock jc exit mov es, ax mov di, offset GH_data ; ; if there is no character, then we the hwr just wanted to ; clean up the mode char that was inserted. ; tst {word}es:[di] jz exit mov cx, TRUE ; filter this character call InsertChar call MemUnlock exit: .leave ret GestureReplaceLastChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureModeChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Take the char located in the data portion of the GestureHeader and insert it into the VisTextObject. This is a mode char and represents a change in mode indicated by the hwr, and should not be filtered. CALLED BY: InsertGesture PASS: *ds:si VistTextObject ax handle to gesture data (GestureHeader) RETURN: nothing DESTROYED: ax, bx, cx, dx, es, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/11/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureModeChar proc near .enter mov bx, ax call MemLock jc exit mov es, ax mov di, offset GH_data mov cx, FALSE ; do not filter this character call InsertChar call MemUnlock exit: .leave ret GestureModeChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureCut %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: send the text object MSG_META_CLIPBOARD_CUT CALLED BY: PASS *ds:si - ptr to VisTextObject RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 6/21/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureCut proc near .enter mov ax, MSG_META_CLIPBOARD_CUT call ObjCallInstanceNoLock .leave ret GestureCut endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureCopy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: send the text object MSG_META_CLIPBOARD_COPY CALLED BY: PASS *ds:si - ptr to VisTextObject RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 6/21/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureCopy proc near .enter mov ax, MSG_META_CLIPBOARD_COPY call ObjCallInstanceNoLock .leave ret GestureCopy endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GesturePaste %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: send the text object MSG_META_CLIPBOARD_PASTE CALLED BY: PASS *ds:si - ptr to VisTextObject RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 6/21/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GesturePaste proc near .enter mov ax, MSG_META_CLIPBOARD_PASTE call ObjCallInstanceNoLock .leave ret GesturePaste endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InsertChar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Insert a char into the text object CALLED BY: PRIVATE PASS: es:di = ptr to character to insert *ds:si = ptr to VisTextObject cx = 0 if should not filter this character. RETURN: nothing DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/15/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InsertChar proc near class VisTextClass uses ax, bx, cx, dx, bp, si, di .enter mov ax, offset InkString call TU_StartChainIfUndoable sub sp, size VisTextReplaceParameters mov bp, sp ; ss:bp <- frame mov ss:[bp].VTRP_insCount.high, 0 mov ss:[bp].VTRP_insCount.low, 1 mov ss:[bp].VTRP_flags, mask VTRF_USER_MODIFICATION jcxz noFilter or ss:[bp].VTRP_flags, mask VTRF_FILTER noFilter: mov ss:[bp].VTRP_textReference.TR_type, TRT_POINTER mov ss:[bp].VTRP_pointerReference.segment, es mov ss:[bp].VTRP_pointerReference.offset, di ; ; Set the range... ; ; If we are *not* in overstrike mode then we use the selection ; as the range to replace. ; ; Assume not in overstrike mode ; mov ss:[bp].VTRP_range.VTR_start.high, VIS_TEXT_RANGE_SELECTION mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].VTI_state, mask VTS_OVERSTRIKE_MODE jz doReplace ; ; We are in overstrike mode. If the selected range is a cursor, then ; we want to delete the character following the cursor, unless of ; course we are at the end of the text. ; call TSL_SelectGetSelectionStart ; dx.ax <- start ; carry set if range jc doReplace ; Branch if selection is range ; ; The selection is a cursor, check for at the end of the text ; movdw cxbx, dxax ; Save start of selection call TS_GetTextSize ; dx.ax <- end of text cmpdw cxbx, dxax ; Check for cursor at end je doReplace ; Branch if it is ; ; The selection is a cursor and is not at the end of the text. ; Save a range of one character into the range to replace. ; movdw ss:[bp].VTRP_range.VTR_start, cxbx incdw cxbx movdw ss:[bp].VTRP_range.VTR_end, cxbx doReplace: mov ax, MSG_VIS_TEXT_REPLACE_TEXT call ObjCallInstanceNoLock add sp, size VisTextReplaceParameters call TU_EndChainIfUndoable .leave ret InsertChar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DoVisTextFunction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: performs the VisTextKeyFunction pointed to by es:di CALLED BY: (PRIVATE) GestureStringMacro PASS: ax - VisTextKeyFunction *ds:si- ptr to VisTextObject RETURN: nothing DESTROYED: ax, bx, dx SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/15/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DoVisTextFunction proc near uses si, di, es, bp, cx .enter mov cx, ax clr bp mov ax, MSG_VIS_TEXT_DO_KEY_FUNCTION call ObjCallInstanceNoLock .leave ret DoVisTextFunction endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureStringMacro %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Take the data in the GestureHeader and treat it as a StringMacro. How the data is processed is described below in the strategy field. CALLED BY: (PRIVATE) InsertGesture PASS: *ds:si- VistTextObject ax - handle to gesture data (GestureHeader) RETURN: DESTROYED: ax, bx, cx, dx, di, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: send of as many back spaces as are specified in the deleteCount field loop through the array of elements if element = HWR_STRING_ESCAPE_VALUE send the next element off as a VisTextKeyFunction to the VisTextObject(*ds:si) else insert the element as a character into the VisTextObject(*ds:si) REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/11/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureStringMacro proc near call GestureStringMacroFar ret GestureStringMacro endp GestureStringMacroFar proc far uses si, es .enter mov bx, ax call MemLock jc exit mov es, ax mov di, offset GH_data mov cx, es:[di][HWRSM_deleteCount] ; ; perform as many VTKF_DELETE_BACKWARD_CHAR as is neccessary ; to delete HWRSM_deleteCount characters backwards in the text ; deleteLoop: jcxz endDeleteLoop mov ax, VTKF_DELETE_BACKWARD_CHAR call DoVisTextFunction loop deleteLoop endDeleteLoop: ; ; go through the array of elements and either insert them in ; the text if they are characters or if there is a ; HWR_STRING_ESCAPE_VALUE treat the next element as a ; VisTextKeyFunction and perform that function ; add di, offset HWRSM_string elementLoop: mov cx, es:[di] jcxz endElementLoop cmp cx, HWR_STRING_ESCAPE_VALUE jne cont ; ; perform embeded vis text function ; inc di inc di mov ax, es:[di] call DoVisTextFunction jmp nextElement ; ; insert character ; cont: call InsertChar nextElement: inc di inc di jmp elementLoop endElementLoop: exit: .leave ret GestureStringMacroFar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureBackspace %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Deletes the last character. CALLED BY: GLOBAL PASS: *ds:si - VisText object RETURN: nada DESTROYED: ax, cx, dx, bp PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 3/17/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureBackspace proc near mov ax, MSG_VIS_TEXT_DO_KEY_FUNCTION mov cx, VTKF_DELETE_BACKWARD_CHAR call ObjCallInstanceNoLock ret GestureBackspace endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GestureDelete %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Deletes the selection in the passed text object CALLED BY: GLOBAL PASS: *ds:si - VisText object ax - handle to gesture data block RETURN: nada DESTROYED: ax, cx, dx, bp PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 12/12/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GestureDelete proc near mov ax, MSG_META_DELETE ; (sets user-modified) call ObjCallInstanceNoLock ret GestureDelete endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisTextQueryIfPressIsInk %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: This method handler returns whether or not presses in the text object should be ink or not. In this case, presses should be ink unless the user clicks and holds for a certain amount of time. CALLED BY: GLOBAL PASS: ds:di - ink object RETURN: ax - InkReturnValue bp - 0 or InkDestinationInfo DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 12/16/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisTextQueryIfPressIsInk proc far class VisTextClass .enter if _TEXT_NO_INK ; ; If we don't accept ink, then return IRV_NO_INK. ; mov ax, IRV_NO_INK clr bp ;No ink-destination info .leave ret else ; ; For non-editable object, no ink ; ; For editable objects, set the destination to be the ink object ; ; For selectable objects, set the ink type to ink w/standard override, ; otherwise, just ink clr bp test ds:[di].VTI_state, mask VTS_EDITABLE je noInk ;If not editable, branch mov ax, ATTR_VIS_TEXT_DOES_NOT_ACCEPT_INK call ObjVarFindData jc noInk clr bp ;BP <- gstate to draw through clr ax ;Default width/height mov cx, ds:[LMBH_handle] ;^lCX:DX - object to send ink to mov dx, si push di mov bx, vseg CheckIfTextGesture mov di, offset CheckIfTextGesture call UserCreateInkDestinationInfo pop di ; If error allocating block exit w/no ink tst bp jnz wantsInk noInk: mov ax, IRV_NO_INK clr bp ;No ink-destination info exit: .leave ret wantsInk: mov ax, IRV_DESIRES_INK ; test ds:[di].VTI_state, mask VTS_SELECTABLE jz exit mov ax, IRV_INK_WITH_STANDARD_OVERRIDE jmp exit endif ; _TEXT_NO_INK VisTextQueryIfPressIsInk endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% StrokeEnum %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: enumerate throught the strokes CALLED BY: CheckIfTextGesture PASS: es:di - ptr to buffer of points cx - num points total RETURN: bx - total number of points recognized as part of - a gesture DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: while all strokes not checked while not the last point in a stroke inc the number of points in this stroke goto the next point call routine to deal with this stroke and check to see if it is a gesture If it is not a gesture then quit If it is a gesture add the number of points in this stroke to the total of all points that are part of a stroke return the total of all points that were part of a stroke REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/11/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ StrokeEnum proc near uses ax,cx,dx,si,di .enter mov si, di sub si, size Point clr bx loopStrokes: clr dx jcxz exit loopPoints: inc dx ; # of points in stroke add si, size Point test es:[si], mask IXC_TERMINATE_STROKE loopz loopPoints endLoopPoints:: ; ; found end of stroke, call function ; push bx, cx, dx mov cx, dx call CheckIfGesture pop bx, cx, dx ; ; if this stroke is not a gesture then leave ; tst ax jz endLoopStrokes add bx, dx ; bx += num points in this ; stroke mov di, si add di, size Point jmp loopStrokes endLoopStrokes: exit: .leave ret StrokeEnum endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckIfTextGesture %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks to see if the passed code is a gesture or not. CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 1/18/93 Initial version IP 5/15/94 changed for new HWR interface %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SetGeosConvention CheckIfTextGesture proc far points:fptr, numPoints:word, numStrokes:word .enter ; If this is not the first call to the gesture callback routine, just ; exit, because if it wasn't a gesture before, it sure won't be one ; now... clr ax test numStrokes, mask GCF_FIRST_CALL jnz cont cmp numStrokes, 1 jne exit cont: les di, points mov cx, numPoints call StrokeEnum mov ax, bx exit: .leave ret CheckIfTextGesture endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CheckIfGesture %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Checks to see if the passed ink is any sort of gesture. If it is a gesture calls the routine associated with that gesture. CALLED BY: GLOBAL PASS: es:di - ptr to strokes cx - # points RETURN: carry set if gesture (AX = GestureType) DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 05/16/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CheckIfGesture proc near uses bx, cx, dx, bp, di, si, es numPoints local word push cx libHandle local hptr ;Used by CallHWRLibrary macro points local fptr .enter movdw points, esdi call UserGetHWRLibraryHandle tst ax ;Exit if no HWR library LONG jz error mov libHandle, ax CallHWRLibrary HWRR_BEGIN_INTERACTION tst ax jnz error ;If error, exit CallHWRLibrary HWRR_RESET ; Send the ink points to the HWR recognizer push numPoints pushdw points CallHWRLibrary HWRR_ADD_POINTS CallHWRLibrary HWRR_DO_GESTURE_RECOGNITION ;Returns AX = GestureType ;Returns dx = extra gesture info push ax, dx CallHWRLibrary HWRR_END_INTERACTION pop ax, dx cmp ax, GT_NO_GESTURE jnz isGesture error: clc exit: .leave ret isGesture: mov bx, ax shl bx, 1 EC < cmp bx, eHandleGestureTab-handleGestureTab > EC < ERROR_A VIS_TEXT_INVALID_GESTURE > push ax, bp call cs:[handleGestureTab-2][bx] pop ax, bp stc jmp exit CheckIfGesture endp handleGestureTab nptr SendGestureToFlow ;GT_DELETE_CHARS nptr HandleGestureNull ;GT_SELECT_CHARS nptr HandleGestureHCrossout ;GT_V_CROSSOUT nptr HandleGestureHCrossout ;GT_H_CROSSOUT nptr SendGestureToFlow ;GT_BACKSPACE nptr SendGestureToFlow ;GT_CHAR nptr HandleGestureStringMacro ;GT_STRING_MACRO nptr HandleGestureNull ;GT_IGNORE_GESTURE nptr SendGestureToFlow ;GT_COPY nptr SendGestureToFlow ;GT_PASTE nptr SendGestureToFlow ;GT_CUT nptr SendGestureToFlow ;GT_MODE_CHAR nptr SendGestureToFlow ;GT_REPLACE_LAST_CHAR EC EC <.assert(eHandleGestureTab - handleGestureTab)/(size nptr) eq GestureType-1> COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HandleGestureHCrossout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sends GT_H_CROSSOUT to the flow object along with the Rectangle bounds CALLED BY: CheckIfGesture PASS: dx - handle to Rectangle RETURN: nothing DESTROYED: bx, cx, dx, di, si, es SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 6/30/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HandleGestureHCrossout proc near uses ds .enter mov bx, dx call MemLock mov ds, ax clr si mov ax, size GestureHeader add ax, size Rectangle mov cx, ALLOC_DYNAMIC_LOCK or mask HF_SHARABLE call MemAlloc push bx mov es, ax mov es:[GH_gestureType], GT_H_CROSSOUT mov di, offset GH_data CheckHack <((((size Rectangle)/2)*2) eq (size Rectangle))> mov cx, (size Rectangle)/2 rep movsw ; copy the block ; passed from the hwr ; library mov bx, dx call MemFree ; free the block ; passed from the hwr ; library pop bx call MemUnlock call SendGestureWithDataToFlow .leave ret HandleGestureHCrossout endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HandleGestureStringMacro %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sends GT_STRING_MACRO to the flow object along with the string data CALLED BY: CheckIfGesture PASS: dx - handle to HWRStringMacro RETURN: nothing DESTROYED: ax, bx, cx, dx, di, si, es SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/16/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HandleGestureStringMacro proc near uses ds .enter mov bx, dx mov ax, MGIT_SIZE call MemGetInfo mov bp, ax ; save size of block add ax, size GestureHeader mov cx, ALLOC_DYNAMIC_LOCK or mask HF_SHARABLE call MemAlloc jc exit mov es, ax mov es:[GH_gestureType], GT_STRING_MACRO mov di, offset GH_data push bx ; save handle to new block mov bx, dx ; lock block from HWR library call MemLock jc lockError mov ds, ax clr si mov cx, bp ; copy data returned by the rep movsb ; hwr library to a new block ; to send to the flow call MemFree ; free the block from the HWR ; library pop bx call MemUnlock ; unlock the block to send off call SendGestureWithDataToFlow exit: .leave ret lockError: pop bx call MemFree jmp exit HandleGestureStringMacro endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SendGestureToFlow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sends the Gesture in ax, to the flow object. Assumes that no data will be sent with the GestureType CALLED BY: (PRIVATE) HandleGestureDelete HandleGestureCopy HandleGesturePaste HandleGestureCut PASS: ax = GestureType dx = word of data to go with gesture RETURN: carry set if could not allocated GestureHeader DESTROYED: ax,bx,cx,dx,si,es SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 6/21/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SendGestureToFlow proc near .enter push ax mov ax, size GestureHeader add ax, size word mov cx, ALLOC_DYNAMIC_LOCK or mask HF_SHARABLE call MemAlloc mov es, ax pop ax jc exit mov es:[GH_gestureType], ax mov es:[GH_data], dx call MemUnlock GOTO SendGestureWithDataToFlow exit: .leave ret SendGestureToFlow endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SendGestureWithDataToFlow %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sends the passed data along to the Flow, with notification type GWNT_INK_GESTURE CALLED BY: (PRIVATE)SendGestureToFlow, HandleGestureHCrossout, HandleGestureStringMacro PASS: bx = handle to data RETURN: ax, cx, dx, bp, di DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 7/ 5/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SendGestureWithDataToFlow proc near .enter mov ax, 1 call MemInitRefCount mov ax, MSG_META_NOTIFY_WITH_DATA_BLOCK mov cx, MANUFACTURER_ID_GEOWORKS mov dx, GWNT_INK_GESTURE mov bp, bx mov di, mask MF_FORCE_QUEUE or mask MF_FIXUP_DS call UserCallFlow .leave ret SendGestureWithDataToFlow endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HandleGestureNull %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Function place holder until the complete functions are implemented for a given gesture CALLED BY: PASS: RETURN: DESTROYED: nothing SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- IP 5/13/94 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HandleGestureNull proc near .enter .leave ret HandleGestureNull endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisTextHandlesInkReply %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Query if object handles ink. CALLED BY: GLOBAL PASS: nada RETURN: nada DESTROYED: nada PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- atw 2/14/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisTextHandlesInkReply proc far class VisTextClass .enter test ds:[di].VTI_state, mask VTS_EDITABLE jz exit push ax mov ax, ATTR_VIS_TEXT_DOES_NOT_ACCEPT_INK call ObjVarFindData pop ax jc exit call VisObjectHandlesInkReply exit: .leave ret VisTextHandlesInkReply endp PenCode ends ",16140,True,3588.5549945654407,median "// ********************************************************************************************************************************************* // // // VU meter and LED effects code for ESP32 WROOM module // @morten's lab 2021 // // Please link, like,comment and subscribe here : https://www.youtube.com/user/moffe1234 // // ********************************************************************************************************************************************* #include #include ""water_torture.h"" #define PIN 18 #define N_PIXELS 59 #define BG 0 #define COLOR_ORDER RBG // Try mixing up the letters (RGB, GBR, BRG, etc) for a whole new world of color combinations #define BRIGHTNESS 255 // 0-255, higher number is brighter. #define LED_TYPE WS2812B #define MIC_PIN 15 // Microphone is attached to this analog pin #define DC_OFFSET 1250 // DC offset in mic signal - if unusure, leave 0 #define NOISE 150 // Noise/hum/interference in mic signal #define SAMPLES 60 // Length of buffer for dynamic level adjustment #define TOP (N_PIXELS + 2) // Allow dot to go slightly off scale #define TOP2 (N_PIXELS + 1) // Allow dot to go slightly off scale #define LAST_PIXEL_OFFSET N_PIXELS-1 #define PEAK_FALL 20 // Rate of peak falling dot #define PEAK_FALL_MILLIS 10 // Rate of peak falling dot #define N_PIXELS_HALF (N_PIXELS/2) #define GRAVITY -9.81 // Downward (negative) acceleration of gravity in m/s^2 #define h0 1 // Starting height, in meters, of the ball (strip length) #define NUM_BALLS 3 // Number of bouncing balls you want (recommend < 7, but 20 is fun in its own way) #define SPEED .20 // Amount to increment RGB color by each cycle // Modes enum { } MODE; bool reverse2 = true; int BRIGHTNESS_MAX = 255; int brightness = 120; // cycle variables int CYCLE_MIN_MILLIS = 2; int CYCLE_MAX_MILLIS = 1000; int cycleMillis = 20; bool paused = false; long lastTime = 0; bool boring = true; bool gReverseDirection = false; float greenOffset = 30, blueOffset = 150; byte peak = 0, // Used for falling dot dotCount = 0, // Frame counter for delaying dot-falling speed volCount = 0; // Frame counter for storing past volume data int vol[SAMPLES], // Collection of prior volume samples lvl = 10, // Current ""dampened"" audio level minLvlAvg = 0, // For dynamic adjustment of graph low & high maxLvlAvg = 512; int brightnessValue, prevBrightnessValue; int sensorDeviationBrightness = 1; int sensitivityValue = 228; // 0 - 255, initial value (value read from the potentiometer if useSensorValues = true) int maxSensitivity = 2 * 255; // let the 'volume' go up to 200%! int ledBrightness = 255; // 0 - 255, initial value (value read from the potentiometer if useSensorValues = true) int val; int time_cnt=0; int x=0; int global_j=0; Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_PIXELS, PIN, NEO_GRB + NEO_KHZ800); // Water torture WaterTorture water_torture = WaterTorture(&strip); // FOR SYLON ETC uint8_t thisbeat = 23; uint8_t thatbeat = 28; uint8_t thisfade = 2; // How quickly does it fade? Lower = slower fade rate. uint8_t thissat = 255; // The saturation, where 255 = brilliant colours. uint8_t thisbri = 255; //FOR JUGGLE uint8_t numdots = 4; // Number of dots in use. uint8_t faderate = 2; // How long should the trails be. Very low value = longer trails. uint8_t hueinc = 16; // Incremental change in hue between each dot. uint8_t thishue = 0; // Starting hue. uint8_t curhue = 0; uint8_t thisbright = 255; // How bright should the LED/display be. uint8_t basebeat = 5; uint8_t max_bright = 255; // Twinkle float redStates[N_PIXELS]; float blueStates[N_PIXELS]; float greenStates[N_PIXELS]; float Fade = 0.96; unsigned int sample; int myhue = 0; int buttonPushCounter=0; //Ripple variables int color; int center = 0; int step = -1; int maxSteps = 8; float fadeRate = 0.80; int diff; //background color uint32_t currentBg = random(256); uint32_t nextBg = currentBg; //******************************************************************************************************************* // // TOUCH STUFF // //******************************************************************************************************************* int mode_keycnt=0; int bright_keycnt=20; int onoff_keycnt=0; int mode_lowdet=0; int brightUP_lowdet=0; int brightDN_lowdet=0; int onoff_lowdet=0; int onoff=-1; const int TOUCH_NUM_READINGS = 3; // number of positive read for switch on int touchReadIndex = 0; const int touchPin_MO = 12; // MODE T5 const int touchPin_ON = 13; // ON/OFF T4 const int touchPin_UP = 32; // BRIGHTNESS UP T9 const int touchPin_DN = 14; // BRIGHTNESS DN T6 const int ledPin_1 = 22; // Led connected to GPIO 22 // variable for storing the touch pin value int touchValue_ON; int touchValue_MO; int touchValue_UP; int touchValue_DN; volatile int interruptCounter; int totalInterruptCounter; hw_timer_t * timer = NULL; portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED; void IRAM_ATTR onTimer() { portENTER_CRITICAL_ISR(&timerMux); interruptCounter++; portEXIT_CRITICAL_ISR(&timerMux); } void setup() { pinMode(touchPin_ON, INPUT); pinMode(touchPin_MO, INPUT); pinMode(touchPin_DN, INPUT); pinMode(touchPin_UP, INPUT); Serial.begin(115200); timer = timerBegin(0, 80, true); timerAttachInterrupt(timer, &onTimer, true); timerAlarmWrite(timer, 50000, true); timerAlarmEnable(timer); delay(2000); // give me time to bring up serial monitor // initialize the LED pins as an output: pinMode (ledPin_1, OUTPUT); digitalWrite(ledPin_1, HIGH); //******************************************************************************************************************* // VU meter //******************************************************************************************************************* strip.begin(); // strip.setPixelColor(1,strip.Color(255, 0,0)); // strip.setPixelColor(2,strip.Color(255, 0,0)); strip.show(); // Initialize all pixels to 'off' //analogReference(EXTERNAL); memset(vol, 0, sizeof(vol)); // colorWipe(strip.Color(255, 0, 0), 20); // A Black delay(2000); colorWipe(strip.Color(0, 0, 0), 0); delay(200); colorWipe(strip.Color(255, 0, 0), 0); delay(100); colorWipe(strip.Color(0, 0, 0), 0); delay(200); colorWipe(strip.Color(255, 0, 0), 0); delay(100); colorWipe(strip.Color(0, 0, 0), 0); delay(200); colorWipe(strip.Color(255, 0, 0), 0); delay(100); colorWipe(strip.Color(0, 0, 0), 0); delay(100); touchAttachInterrupt(T4, gotTouch, 20); touchAttachInterrupt(T5, gotTouch, 20); touchAttachInterrupt(T6, gotTouch, 20); touchAttachInterrupt(T9, gotTouch, 20); Serial.println(""morten's lab was here in 2021 :-)""); Serial.println(""enjoy!""); Serial.println(""ready .... \\n""); } void gotTouch(){ Serial.println(""Touched\\n""); x=1; } void loop() { global_j++; if (global_j>255) global_j=0; if (interruptCounter > 0) { portENTER_CRITICAL(&timerMux); interruptCounter--; portEXIT_CRITICAL(&timerMux); totalInterruptCounter++; int touchValue_MO = runningMedian(touchPin_MO); int touchValue_ON = runningMedian(touchPin_ON); int touchValue_DN = runningMedian(touchPin_DN); int touchValue_UP = runningMedian(touchPin_UP); //************************************************************************************* // // ON / OFF // //************************************************************************************* if (touchValue_ON>20 && onoff_lowdet==1) { onoff_keycnt=onoff_keycnt+1; onoff_lowdet=0; if (onoff_keycnt>10) { onoff_keycnt=1; } Serial.println("" ONOFF keypressed""); onoff=~onoff; Serial.println(onoff); } if (touchValue_ON<20) { onoff_lowdet=1; } if (onoff==-1) { setAll(0,0,0); buttonPushCounter=0; mode_keycnt=0; } if (onoff==0) { //************************************************************************************* // // MODE // //************************************************************************************* if (touchValue_MO>20 && mode_lowdet==1) { mode_keycnt=mode_keycnt+1; mode_lowdet=0; if (mode_keycnt>16) { mode_keycnt=1; } Serial.println("" MODE keypressed""); Serial.println(mode_keycnt); } if (touchValue_MO<20) { mode_lowdet=1; } //************************************************************************************* // // BRIGHT UP // //************************************************************************************* if (touchValue_UP>20 && brightUP_lowdet==1) { bright_keycnt=bright_keycnt+1; brightUP_lowdet=0; if (bright_keycnt>20) { bright_keycnt=1; } Serial.println("" BRIGHT keypressed""); Serial.println(bright_keycnt); } if (touchValue_UP<20) { brightUP_lowdet=1; } //************************************************************************************* // // BRIGHT DN // //************************************************************************************* if (touchValue_DN>20 && brightDN_lowdet==1) { bright_keycnt=bright_keycnt-1; brightDN_lowdet=0; if (bright_keycnt<1) { bright_keycnt=20; } Serial.println("" BRIGHT keypressed""); Serial.println(bright_keycnt); } if (touchValue_DN<20) { brightDN_lowdet=1; } //************************************************************************************* } } if (onoff==0) { if (brightDN_lowdet==1 || brightUP_lowdet==1 || mode_lowdet==1) digitalWrite(ledPin_1, HIGH); else digitalWrite(ledPin_1, LOW); } else digitalWrite(ledPin_1, HIGH); // ***************************************************************************************************************************** // // VU meter stuff main loop // // ***************************************************************************************************************************** brightnessValue = map(bright_keycnt, 1, 20, 0, 255); strip.setBrightness(brightnessValue); //for mic uint8_t i; uint16_t minLvl, maxLvl; int n, height; // end mic buttonPushCounter=mode_keycnt; switch (buttonPushCounter){ case 0: // STANDBY buttonPushCounter==0; { break;} case 1: // STANDARD RAINBOW buttonPushCounter==1; { vu1(); break;} case 2: // STANDARD CENTER buttonPushCounter==2; { vu2(); break;} case 3: // STANDARD CHANGING COLOR buttonPushCounter==3; { Vu3(); break;} case 4: // COLOR CENTER CHANGING buttonPushCounter==4; { Vu4(); break;} case 5: // SHOOTING STAR buttonPushCounter==5; { Vu5(); break;} case 6: // FALLING STAR buttonPushCounter==6; { Vu6(); break;} case 7: // SNOW FLAKES buttonPushCounter==7; { SnowSparkle(0x10, 0x10, 0x10, 20, random(100,1000)); break;} case 8: // RIPPLE buttonPushCounter==8; { ripple2(); break;} case 9: // RIPPLE WITH BACKGROUND buttonPushCounter==9; { ripple(); break;} case 10: // TWINKLE buttonPushCounter==10; { Twinkle(); break;} case 11: // TWINKLE RANDOM COLORS buttonPushCounter==11; { TwinkleRandom(40, 100, false); break;} case 12: // FIRE buttonPushCounter==12; { Fire(55,120,15); break;} case 13: // RAINBOW buttonPushCounter==13; { rainbow(20); break;} case 14: // WATER DROPS buttonPushCounter==14; { Drip(); break;} case 15: // BOUNCING BALLS buttonPushCounter==15; { Ball(0xff,0,0,3); // break;} case 16: // ALL WHITE buttonPushCounter==16; { setAll(255,255,255); delay(50); break;} } } int runningMedian(int pin) { const int sampleSize = 3; int samples[sampleSize]; int temp; for (int i = 0; i < sampleSize; i++) { samples[i] = touchRead(pin); } for (int i = 0; i < sampleSize - 1; i++) { for (int j = 0; j < sampleSize - 1 - i; j++) { if (samples[j] < samples[j + 1]) { temp = samples[j]; samples[j] = samples[j + 1]; samples[j + 1] = samples[j]; } } } return samples[sampleSize / 2 + 1]; } //******************************************************************************************************************************* // // // VU meter functions // // //******************************************************************************************************************************* void TwinkleRandom(int Count, int SpeedDelay, boolean OnlyOne) { time_cnt++; delay(1); if (time_cnt>100) { setPixel(random(N_PIXELS),random(0,255),random(0,255),random(0,255)); strip.show(); time_cnt=0; } } void SnowSparkle(byte red, byte green, byte blue, int SparkleDelay, int SpeedDelay) { setAll(red,green,blue); int Pixel = random(N_PIXELS); setPixel(Pixel,0xff,0xff,0xff); strip.show(); delay(SparkleDelay); setPixel(Pixel,red,green,blue); strip.show(); delay(SpeedDelay); } void Fire(int Cooling, int Sparking, int SpeedDelay) { static byte heat[N_PIXELS]; int cooldown; for( int i = 0; i < N_PIXELS; i++) { cooldown = random(0, ((Cooling * 10) / N_PIXELS) + 2); if(cooldown>heat[i]) { heat[i]=0; } else { heat[i]=heat[i]-cooldown; }} for( int k= N_PIXELS - 1; k >= 2; k--) { heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2]) / 3; } if( random(255) < Sparking ) { int y = random(7); heat[y] = heat[y] + random(160,255); //heat[y] = random(160,255); } for( int j = 0; j < N_PIXELS; j++) { setPixelHeatColor(j, heat[j] ); } strip.show(); delay(SpeedDelay); } void setPixel(int Pixel, byte red, byte green, byte blue) { strip.setPixelColor(Pixel, strip.Color(red, green, blue)); } void setPixelHeatColor (int Pixel, byte temperature) { byte t192 = round((temperature/255.0)*191); byte heatramp = t192 & 0x3F; // 0..63 heatramp <<= 2; // scale up to 0..252 if( t192 > 0x80) { // hottest setPixel(Pixel, 255, 255, heatramp); } else if( t192 > 0x40 ) { // middle setPixel(Pixel, 255, heatramp, 0); } else { // coolest setPixel(Pixel, heatramp, 0, 0); } } void Drip() { MODE_WATER_TORTURE: if (cycle()) { strip.setBrightness(255); // off limits water_torture.animate(reverse2); strip.show(); //strip.setBrightness(brightness); // back to limited } } bool cycle() { if (paused) { return false; } if (millis() - lastTime >= cycleMillis) { lastTime = millis(); return true; } return false; } void Vu5() { uint8_t i; uint16_t minLvl, maxLvl; int n, height; val=513; val= map(val, 0, 4095, -10, 6); n = analogRead(MIC_PIN); // Raw reading from mic n = abs(n - 0 - DC_OFFSET); // Center on zero n = (n <= NOISE) ? 0 : (n - NOISE); // Remove noise/hum if(val<0){ n=n/(val*(-1)); } if(val>0){ n=n*val; } lvl = ((lvl * 7) + n) >> 3; // ""Dampened"" reading (else looks twitchy) // Calculate bar height based on dynamic min/max levels (fixed point): height = TOP2 * (lvl - minLvlAvg) / (long)(maxLvlAvg - minLvlAvg); if(height < 0L) height = 0; // Clip output else if(height > TOP2) height = TOP2; if(height > peak) peak = height; // Keep 'peak' dot at top #ifdef CENTERED // Color pixels based on rainbow gradient for(i=0; i<(N_PIXELS/2); i++) { if(((N_PIXELS/2)+i) >= height) { strip.setPixelColor(((N_PIXELS/2) + i), 0, 0, 0); strip.setPixelColor(((N_PIXELS/2) - i), 0, 0, 0); } else { strip.setPixelColor(((N_PIXELS/2) + i),Wheel(map(((N_PIXELS/2) + i),0,strip.numPixels()-1,30,150))); strip.setPixelColor(((N_PIXELS/2) - i),Wheel(map(((N_PIXELS/2) - i),0,strip.numPixels()-1,30,150))); } } // Draw peak dot if(peak > 0 && peak <= LAST_PIXEL_OFFSET) { strip.setPixelColor(((N_PIXELS/2) + peak),255,255,255); // (peak,Wheel(map(peak,0,strip.numPixels()-1,30,150))); strip.setPixelColor(((N_PIXELS/2) - peak),255,255,255); // (peak,Wheel(map(peak,0,strip.numPixels()-1,30,150))); } #else // Color pixels based on rainbow gradient for(i=0; i= height) { strip.setPixelColor(i, 0, 0, 0); } else { strip.setPixelColor(i,Wheel(map(i,0,strip.numPixels()-1,30,150))); } } // Draw peak dot if(peak > 0 && peak <= LAST_PIXEL_OFFSET) { strip.setPixelColor(peak,255,255,255); // (peak,Wheel(map(peak,0,strip.numPixels()-1,30,150))); } #endif // Every few frames, make the peak pixel drop by 1: if (millis() - lastTime >= PEAK_FALL_MILLIS) { lastTime = millis(); strip.show(); // Update strip //fall rate if(peak > 0) peak--; } vol[volCount] = n; // Save sample for dynamic leveling if(++volCount >= SAMPLES) volCount = 0; // Advance/rollover sample counter // Get volume range of prior frames minLvl = maxLvl = vol[0]; for(i=1; i maxLvl) maxLvl = vol[i]; } // minLvl and maxLvl indicate the volume range over prior frames, used // for vertically scaling the output graph (so it looks interesting // regardless of volume level). If they're too close together though // (e.g. at very low volume levels) the graph becomes super coarse // and 'jumpy'...so keep some minimum distance between them (this // also lets the graph go to zero when no sound is playing): if((maxLvl - minLvl) < TOP2) maxLvl = minLvl + TOP2; minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6; // Dampen min/max levels maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6; // (fake rolling average) } void Vu6() { uint8_t i; uint16_t minLvl, maxLvl; int n, height; val=513; val= map(val, 0, 4095, -10, 6); n = analogRead(MIC_PIN); // Raw reading from mic n = abs(n - 9 - DC_OFFSET); // Center on zero n = (n <= NOISE) ? 0 : (n - NOISE); // Remove noise/hum if(val<0){ n=n/(val*(-1)); } if(val>0){ n=n*val; } lvl = ((lvl * 7) + n) >> 3; // ""Dampened"" reading (else looks twitchy) // Calculate bar height based on dynamic min/max levels (fixed point): height = TOP2 * (lvl - minLvlAvg) / (long)(maxLvlAvg - minLvlAvg); if(height < 0L) height = 0; // Clip output else if(height > TOP2) height = TOP2; if(height > peak) peak = height; // Keep 'peak' dot at top #ifdef CENTERED // Draw peak dot if(peak > 0 && peak <= LAST_PIXEL_OFFSET) { strip.setPixelColor(((N_PIXELS/2) + peak),255,255,255); // (peak,Wheel(map(peak,0,strip.numPixels()-1,30,150))); strip.setPixelColor(((N_PIXELS/2) - peak),255,255,255); // (peak,Wheel(map(peak,0,strip.numPixels()-1,30,150))); } #else // Color pixels based on rainbow gradient for(i=0; i= height) { strip.setPixelColor(i, 0, 0, 0); } else { } } // Draw peak dot if(peak > 0 && peak <= LAST_PIXEL_OFFSET) { strip.setPixelColor(peak,0,0,255); // (peak,Wheel(map(peak,0,strip.numPixels()-1,30,150))); } #endif // Every few frames, make the peak pixel drop by 1: if (millis() - lastTime >= PEAK_FALL_MILLIS) { lastTime = millis(); strip.show(); // Update strip //fall rate if(peak > 0) peak--; } vol[volCount] = n; // Save sample for dynamic leveling if(++volCount >= SAMPLES) volCount = 0; // Advance/rollover sample counter // Get volume range of prior frames minLvl = maxLvl = vol[0]; for(i=1; i maxLvl) maxLvl = vol[i]; } // minLvl and maxLvl indicate the volume range over prior frames, used // for vertically scaling the output graph (so it looks interesting // regardless of volume level). If they're too close together though // (e.g. at very low volume levels) the graph becomes super coarse // and 'jumpy'...so keep some minimum distance between them (this // also lets the graph go to zero when no sound is playing): if((maxLvl - minLvl) < TOP2) maxLvl = minLvl + TOP2; minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6; // Dampen min/max levels maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6; // (fake rolling average) } void Ball(byte red, byte green, byte blue, int BallCount) { float Gravity = -9.81; int StartHeight = 1; float Height[BallCount]; float ImpactVelocityStart = sqrt( -2 * Gravity * StartHeight ); float ImpactVelocity[BallCount]; float TimeSinceLastBounce[BallCount]; int Position[BallCount]; long ClockTimeSinceLastBounce[BallCount]; float Dampening[BallCount]; for (int i = 0 ; i < BallCount ; i++) { ClockTimeSinceLastBounce[i] = millis(); Height[i] = StartHeight; Position[i] = 0; ImpactVelocity[i] = ImpactVelocityStart; TimeSinceLastBounce[i] = 0; Dampening[i] = 0.90 - float(i)/pow(BallCount,2); } while (true) { for (int i = 0 ; i < BallCount ; i++) { TimeSinceLastBounce[i] = millis() - ClockTimeSinceLastBounce[i]; Height[i] = 0.5 * Gravity * pow( TimeSinceLastBounce[i]/1000 , 2.0 ) + ImpactVelocity[i] * TimeSinceLastBounce[i]/1000; if ( Height[i] < 0 ) { Height[i] = 0; ImpactVelocity[i] = Dampening[i] * ImpactVelocity[i]; ClockTimeSinceLastBounce[i] = millis(); if ( ImpactVelocity[i] < 0.01 ) { ImpactVelocity[i] = ImpactVelocityStart; } } Position[i] = round( Height[i] * (N_PIXELS - 1) / StartHeight); } for (int i = 0 ; i < BallCount ; i++) { //setPixel(,red,green,blue); if (i==0) strip.setPixelColor(Position[i], strip.Color(255, 0,0)); // Red if (i==1) strip.setPixelColor(Position[i], strip.Color(255, 255,0)); // Yellow if (i==2) strip.setPixelColor(Position[i], strip.Color(0, 0,255)); // Blue } strip.show(); setAll(0,0,0); if (x==1) { x=0; return; } } } void setAll(byte red, byte green, byte blue) { for(int i = 0; i < N_PIXELS; i++ ) { strip.setPixelColor(i, strip.Color(red, green, blue)); } strip.show(); } void colorWipe(uint32_t c, uint8_t wait) { for(uint16_t i=0; i0){ n=n*val; } lvl = ((lvl * 7) + n) >> 3; // ""Dampened"" reading (else looks twitchy) // Calculate bar height based on dynamic min/max levels (fixed point): height = TOP * (lvl - minLvlAvg) / (long)(maxLvlAvg - minLvlAvg); if(height < 0L) height = 0; // Clip output else if(height > TOP) height = TOP; if(height > peak) peak = height; // Keep 'peak' dot at top greenOffset += SPEED; blueOffset += SPEED; if (greenOffset >= 255) greenOffset = 0; if (blueOffset >= 255) blueOffset = 0; // Color pixels based on rainbow gradient for(i=0; i= height) { strip.setPixelColor(N_PIXELS_HALF-i-1, 0, 0, 0); strip.setPixelColor(N_PIXELS_HALF+i, 0, 0, 0); } else { uint32_t color = Wheel(map(i,0,N_PIXELS_HALF-1,(int)greenOffset, (int)blueOffset)); strip.setPixelColor(N_PIXELS_HALF-i-1,color); strip.setPixelColor(N_PIXELS_HALF+i,color); } } // Draw peak dot if(peak > 0 && peak <= N_PIXELS_HALF-1) { uint32_t color = Wheel(map(peak,0,N_PIXELS_HALF-1,30,150)); strip.setPixelColor(N_PIXELS_HALF-peak-1,color); strip.setPixelColor(N_PIXELS_HALF+peak,color); } strip.show(); // Update strip // Every few frames, make the peak pixel drop by 1: if(++dotCount >= PEAK_FALL) { //fall rate if(peak > 0) peak--; dotCount = 0; } vol[volCount] = n; // Save sample for dynamic leveling if(++volCount >= SAMPLES) volCount = 0; // Advance/rollover sample counter // Get volume range of prior frames minLvl = maxLvl = vol[0]; for(i=1; i maxLvl) maxLvl = vol[i]; } // minLvl and maxLvl indicate the volume range over prior frames, used // for vertically scaling the output graph (so it looks interesting // regardless of volume level). If they're too close together though // (e.g. at very low volume levels) the graph becomes super coarse // and 'jumpy'...so keep some minimum distance between them (this // also lets the graph go to zero when no sound is playing): if((maxLvl - minLvl) < TOP) maxLvl = minLvl + TOP; minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6; // Dampen min/max levels maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6; // (fake rolling average) } void Vu3() { uint8_t i; uint16_t minLvl, maxLvl; int n, height; // val = (analogRead(potPin)); val=512; val= map(val, 0, 4095, -10, 6); n = analogRead(MIC_PIN); // Raw reading from mic n = abs(n - 0 - DC_OFFSET); // Center on zero n = (n <= NOISE) ? 0 : (n - NOISE); // Remove noise/hum if(val<0){ n=n/(val*(-1)); } if(val>0){ n=n*val; } lvl = ((lvl * 7) + n) >> 3; // ""Dampened"" reading (else looks twitchy) // Calculate bar height based on dynamic min/max levels (fixed point): height = TOP * (lvl - minLvlAvg) / (long)(maxLvlAvg - minLvlAvg); if (height < 0L) height = 0; // Clip output else if (height > TOP) height = TOP; if (height > peak) peak = height; // Keep 'peak' dot at top greenOffset += SPEED; blueOffset += SPEED; if (greenOffset >= 255) greenOffset = 0; if (blueOffset >= 255) blueOffset = 0; // Color pixels based on rainbow gradient for (i = 0; i < N_PIXELS; i++) { if (i >= height) { strip.setPixelColor(i, 0, 0, 0); } else { strip.setPixelColor(i, Wheel( map(i, 0, strip.numPixels() - 1, (int)greenOffset, (int)blueOffset) )); } } // Draw peak dot if(peak > 0 && peak <= N_PIXELS-1) strip.setPixelColor(peak,Wheel(map(peak,0,strip.numPixels()-1,30,150))); strip.show(); // Update strip // Every few frames, make the peak pixel drop by 1: if(++dotCount >= PEAK_FALL) { //fall rate if(peak > 0) peak--; dotCount = 0; } strip.show(); // Update strip vol[volCount] = n; if (++volCount >= SAMPLES) { volCount = 0; } // Get volume range of prior frames minLvl = maxLvl = vol[0]; for (i = 1; i < SAMPLES; i++) { if (vol[i] < minLvl) { minLvl = vol[i]; } else if (vol[i] > maxLvl) { maxLvl = vol[i]; } } // minLvl and maxLvl indicate the volume range over prior frames, used // for vertically scaling the output graph (so it looks interesting // regardless of volume level). If they're too close together though // (e.g. at very low volume levels) the graph becomes super coarse // and 'jumpy'...so keep some minimum distance between them (this // also lets the graph go to zero when no sound is playing): if ((maxLvl - minLvl) < TOP) { maxLvl = minLvl + TOP; } minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6; // Dampen min/max levels maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6; // (fake rolling average) } // Slightly different, this makes the rainbow equally distributed throughout void rainbowCycle(uint8_t wait) { uint16_t i, j; int temp_key; temp_key=mode_keycnt; for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel for(i=0; i< strip.numPixels(); i++) { strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255)); } strip.show(); if( mode_keycnt != temp_key) return; delay(wait); } } void vu1() { uint8_t i; uint16_t minLvl, maxLvl; int n, height; // val = (analogRead(potPin)); val=512; val= map(val, 0, 4095, -10, 6); n = analogRead(MIC_PIN); // Raw reading from mic n = abs(n - 0 - DC_OFFSET); // Center on zero n = (n <= NOISE) ? 0 : (n - NOISE); // Remove noise/hum if(val<0){ n=n/(val*(-1)); } if(val>0){ n=n*val; } lvl = ((lvl * 7) + n) >> 3; // ""Dampened"" reading (else looks twitchy) // Calculate bar height based on dynamic min/max levels (fixed point): height = TOP * (lvl - minLvlAvg) / (long)(maxLvlAvg - minLvlAvg); if(height < 0L) height = 0; // Clip output else if(height > TOP) height = TOP; if(height > peak) peak = height; // Keep 'peak' dot at top // Color pixels based on rainbow gradient for(i=0; i= height) strip.setPixelColor(i, 0, 0, 0); else strip.setPixelColor(i,Wheel(map(i,0,strip.numPixels()-1,30,150))); } // Draw peak dot if(peak > 0 && peak <= N_PIXELS-1) strip.setPixelColor(peak,Wheel(map(peak,0,strip.numPixels()-1,30,150))); strip.show(); // Update strip // Every few frames, make the peak pixel drop by 1: if(++dotCount >= PEAK_FALL) { //fall rate if(peak > 0) peak--; dotCount = 0; } vol[volCount] = n; // Save sample for dynamic leveling if(++volCount >= SAMPLES) volCount = 0; // Advance/rollover sample counter // Get volume range of prior frames minLvl = maxLvl = vol[0]; for(i=1; i maxLvl) maxLvl = vol[i]; } // minLvl and maxLvl indicate the volume range over prior frames, used // for vertically scaling the output graph (so it looks interesting // regardless of volume level). If they're too close together though // (e.g. at very low volume levels) the graph becomes super coarse // and 'jumpy'...so keep some minimum distance between them (this // also lets the graph go to zero when no sound is playing): if((maxLvl - minLvl) < TOP) maxLvl = minLvl + TOP; minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6; // Dampen min/max levels maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6; // (fake rolling average) } // Input a value 0 to 255 to get a color value. // The colors are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { if(WheelPos < 85) { return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } else if(WheelPos < 170) { WheelPos -= 85; return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); } else { WheelPos -= 170; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); } } void vu2() { uint8_t i; uint16_t minLvl, maxLvl; int n, height; // val = (analogRead(potPin)); val= 1351; val= map(val, 0, 4095, -10, 6); n = analogRead(MIC_PIN); // Raw reading from mic n = abs(n - 0 - DC_OFFSET); // Center on zero n = (n <= NOISE) ? 0 : (n - NOISE); // Remove noise/hum if(val<0){ n=n/(val*(-1)); } if(val>0){ n=n*val; } lvl = ((lvl * 7) + n) >> 3; // ""Dampened"" reading (else looks twitchy) // Calculate bar height based on dynamic min/max levels (fixed point): height = TOP * (lvl - minLvlAvg) / (long)(maxLvlAvg - minLvlAvg); if(height < 0L) height = 0; // Clip output else if(height > TOP) height = TOP; if(height > peak) peak = height; // Keep 'peak' dot at top // Color pixels based on rainbow gradient for(i=0; i= height) { strip.setPixelColor(N_PIXELS_HALF-i-1, 0, 0, 0); strip.setPixelColor(N_PIXELS_HALF+i, 0, 0, 0); } else { uint32_t color = Wheel(map(i,0,N_PIXELS_HALF-1,30,150)); strip.setPixelColor(N_PIXELS_HALF-i-1,color); strip.setPixelColor(N_PIXELS_HALF+i,color); } } // Draw peak dot if(peak > 0 && peak <= N_PIXELS_HALF-1) { uint32_t color = Wheel(map(peak,0,N_PIXELS_HALF-1,30,150)); strip.setPixelColor(N_PIXELS_HALF-peak-1,color); strip.setPixelColor(N_PIXELS_HALF+peak,color); } strip.show(); // Update strip // Every few frames, make the peak pixel drop by 1: if(++dotCount >= PEAK_FALL) { //fall rate if(peak > 0) peak--; dotCount = 0; } vol[volCount] = n; // Save sample for dynamic leveling if(++volCount >= SAMPLES) volCount = 0; // Advance/rollover sample counter // Get volume range of prior frames minLvl = maxLvl = vol[0]; for(i=1; i maxLvl) maxLvl = vol[i]; } // minLvl and maxLvl indicate the volume range over prior frames, used // for vertically scaling the output graph (so it looks interesting // regardless of volume level). If they're too close together though // (e.g. at very low volume levels) the graph becomes super coarse // and 'jumpy'...so keep some minimum distance between them (this // also lets the graph go to zero when no sound is playing): if((maxLvl - minLvl) < TOP) maxLvl = minLvl + TOP; minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6; // Dampen min/max levels maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6; // (fake rolling average) } void ripple() { if (currentBg == nextBg) { nextBg = random(256); } else if (nextBg > currentBg) { currentBg++; } else { currentBg--; } for(uint16_t l = 0; l < N_PIXELS; l++) { strip.setPixelColor(l, Wheel(currentBg, 0.1)); } if (step == -1) { center = random(N_PIXELS); color = random(256); step = 0; } if (step == 0) { strip.setPixelColor(center, Wheel(color, 1)); step ++; } else { if (step < maxSteps) { Serial.println(pow(fadeRate,step)); strip.setPixelColor(wrap(center + step), Wheel(color, pow(fadeRate, step))); strip.setPixelColor(wrap(center - step), Wheel(color, pow(fadeRate, step))); if (step > 3) { strip.setPixelColor(wrap(center + step - 3), Wheel(color, pow(fadeRate, step - 2))); strip.setPixelColor(wrap(center - step + 3), Wheel(color, pow(fadeRate, step - 2))); } step ++; } else { step = -1; } } strip.show(); delay(25); } int wrap(int step) { if(step < 0) return N_PIXELS + step; if(step > N_PIXELS - 1) return step - N_PIXELS; return step; } void ripple2() { if (BG){ if (currentBg == nextBg) { nextBg = random(256); } else if (nextBg > currentBg) { currentBg++; } else { currentBg--; } for(uint16_t l = 0; l < N_PIXELS; l++) { strip.setPixelColor(l, Wheel(currentBg, 0.1)); } } else { for(uint16_t l = 0; l < N_PIXELS; l++) { strip.setPixelColor(l, 0, 0, 0); } } if (step == -1) { center = random(N_PIXELS); color = random(256); step = 0; } if (step == 0) { strip.setPixelColor(center, Wheel(color, 1)); step ++; } else { if (step < maxSteps) { strip.setPixelColor(wrap(center + step), Wheel(color, pow(fadeRate, step))); strip.setPixelColor(wrap(center - step), Wheel(color, pow(fadeRate, step))); if (step > 3) { strip.setPixelColor(wrap(center + step - 3), Wheel(color, pow(fadeRate, step - 2))); strip.setPixelColor(wrap(center - step + 3), Wheel(color, pow(fadeRate, step - 2))); } step ++; } else { step = -1; } } strip.show(); delay(25); } // Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos, float opacity) { if(WheelPos < 85) { return strip.Color((WheelPos * 3) * opacity, (255 - WheelPos * 3) * opacity, 0); } else if(WheelPos < 170) { WheelPos -= 85; return strip.Color((255 - WheelPos * 3) * opacity, 0, (WheelPos * 3) * opacity); } else { WheelPos -= 170; return strip.Color(0, (WheelPos * 3) * opacity, (255 - WheelPos * 3) * opacity); } } void Twinkle () { if (random(25) == 1) { uint16_t i = random(N_PIXELS); if (redStates[i] < 1 && greenStates[i] < 1 && blueStates[i] < 1) { redStates[i] = random(256); greenStates[i] = random(256); blueStates[i] = random(256); } } for(uint16_t l = 0; l < N_PIXELS; l++) { if (redStates[l] > 1 || greenStates[l] > 1 || blueStates[l] > 1) { strip.setPixelColor(l, redStates[l], greenStates[l], blueStates[l]); if (redStates[l] > 1) { redStates[l] = redStates[l] * Fade; } else { redStates[l] = 0; } if (greenStates[l] > 1) { greenStates[l] = greenStates[l] * Fade; } else { greenStates[l] = 0; } if (blueStates[l] > 1) { blueStates[l] = blueStates[l] * Fade; } else { blueStates[l] = 0; } } else { strip.setPixelColor(l, 0, 0, 0); } } strip.show(); delay(10); } void rainbow(uint8_t wait) { uint16_t i, j; int temp_key; temp_key=mode_keycnt; // for(j=0; j<256; j++) { for(i=0; i //Library to simplify interacting with the LED strand #ifdef __AVR__ #include //Includes the library for power reduction registers if your chip supports them. #endif //More info: http://www.nongnu.org/avr-libc/user-manual/group__avr__power.htlm //Constants (change these as necessary) #define LED_PIN 7 //Pin for the pixel tube strand. Can be analog or digital. #define grille_LED_PIN 13 //Pin for the pixel grille strand. Can be analog or digital. #define LED_TOTAL 36 //Change this to the number of LEDs in your strand #define grille_LED_TOTAL 22 //Change this to the number of LEDs in your grille strand. #define LED_HALF LED_TOTAL/2 #define grille_LED_HALF grille_LED_TOTAL/2 #define VISUALS 6 //Change this accordingly if you add/remove a visual in the switch-case in Visualize() #define AUDIO_PIN A5 //Pin for the envelope of the sound detector //#define KNOB_PIN A1 //Pin for the trimpot 10K #define BUTTON_1 6 //Button 1 cycles color palettes #define BUTTON_2 5 //Button 2 cycles visualization modes #define BUTTON_3 4 //Button 3 sw_poss shuffle mode (automated changing of color and visual) ////////// // These values either need to be remembered from the last pass of loop() or // need to be accessed by several functions in one pass, so they need to be global. // strand = outer ""neon"" tubes, used for music visualization // strand2 = inner ""grille_LED"" tubes, constanly changing patterns. Not in sync with music Adafruit_NeoPixel strand = Adafruit_NeoPixel(LED_TOTAL, LED_PIN, NEO_GRB + NEO_KHZ800); //LED strand objects Adafruit_NeoPixel grille_LED_strand = Adafruit_NeoPixel(grille_LED_TOTAL, grille_LED_PIN, NEO_GRB + NEO_KHZ800); //LED grille strand objects uint16_t gradient = 0; //Used to iterate and loop through each color palette gradually //IMPORTANT: // This array holds the ""threshold"" of each color function (i.e. the largest number they take before repeating). // The values are in the same order as in ColorPalette()'s switch case (Rainbow() is first, etc). This is simply to // keep ""gradient"" from overflowing, the color functions themselves can take any positive value. For example, the // largest value Rainbow() takes before looping is 1529, so ""gradient"" should reset after 1529, as listed. // Make sure you add/remove values accordingly if you add/remove a color function in the switch-case in ColorPalette(). uint16_t thresholds[] = {1529, 1019, 764, 764, 764, 1274}; uint8_t palette = 0; //Holds the current color palette. uint8_t visual = 0; //Holds the current visual being displayed. uint8_t volume = 0; //Holds the volume level read from the sound detector. uint8_t last = 0; //Holds the value of volume from the previous loop() pass. float maxVol = 15; //Holds the largest volume recorded thus far to proportionally adjust the visual's responsiveness. //float knob = 1023.0; //Holds the percentage of how twisted the trimpot is. Used for adjusting the max brightness. float avgBump = 0; //Holds the ""average"" volume-change to trigger a ""bump."" float avgVol = 0; //Holds the ""average"" volume-level to proportionally adjust the visual experience. float shuffleTime = 0; //Holds how many seconds of runtime ago the last shuffle was (if shuffle mode is on). //////////////////////////////////////////////////////////////////////////////////////////////////////////////// //NOTE: The reason ""average"" is quoted is because it is not a true mathematical average. This is because I have // found what I call a ""sequenced average"" is more successful in execution than a real average. The difference // is that the sequenced average doesn't use the pool of all values recorded thus far, but rather averages the // last average and the current value received (in sequence). Concretely: // // True average: (1 + 2 + 3) / 3 = 2 // Sequenced: (1 + 2) / 2 = 1.5 --> (1.5 + 3) / 2 = 2.25 (if 1, 2, 3 was the order the values were received) // // All ""averages"" in the program operate this way. The difference is subtle, but the reason is that sequenced // averages are more adaptive to changes in the overall volume. In other words, if you went from loud to quiet, // the sequenced average is more likely to show an accurate and proportional adjustment more fluently. //////////////////////////////////////////////////////////////////////////////////////////////////////////////// //bool shuffle = false; //sw_poss shuffle mode. bool shuffle = true; //sw_poss shuffle mode. bool bump = false; //Used to pass if there was a ""bump"" in volume //For Traffic() visual int8_t pos[LED_TOTAL] = { -2}; //Stores a population of color ""dots"" to iterate across the LED strand. uint8_t rgb[LED_TOTAL][3] = {0}; //Stores each dot's specific RGB values. //For Snake() visual bool left = false; //Determines the direction of iteration. Recycled in PaletteDance() int8_t dotPos = 0; //Holds which LED in the strand the dot is positioned at. Recycled in most other visuals. float timeBump = 0; //Holds the time (in runtime seconds) the last ""bump"" occurred. float avgTime = 0; //Holds the ""average"" amount of time between each ""bump"" (used for pacing the dot's movement). ////////// ////////// // Selection Switch Pin Number int sw_pos1 = 2; //uses lights to music Visualizer routines int sw_pos2 = 4; //uses animated lights that don't react to music int switch_choice; //whether switch is in 1, 2, or Off (== 0, center position) void setup() { //Like it's named, this gets ran before any other function. // Note: Following code works directly on Arduino Uno, // but on Micro, different behavior //Serial.begin(9600); //Sets data rate for serial data transmission. //Serial.println(""Program Starting...""); //Defines the buttons pins to be input. pinMode(BUTTON_1, INPUT); pinMode(BUTTON_2, INPUT); pinMode(BUTTON_3, INPUT); //Write a ""HIGH"" value to the button pins. digitalWrite(BUTTON_1, HIGH); digitalWrite(BUTTON_2, HIGH); digitalWrite(BUTTON_3, HIGH); strand.begin(); //Initialize the LED strand object. strand.show(); //Show a blank strand, just to get the LED's ready for use. grille_LED_strand.begin(); //Initialize the LED grille_LED_stran object. grille_LED_strand.show(); //Show a blank stran around grille_LED, just to get the LED's ready for use. pinMode(sw_pos1, INPUT_PULLUP); pinMode(sw_pos2, INPUT_PULLUP); // Startup Routine for Grille Lights // Some example procedures showing how to display to the pixels: //StrandtheaterChaseRainbow(50); /* colorWipe(grille_LED_strand.Color(255, 0, 0), 50); // Red colorWipe(grille_LED_strand.Color(0, 255, 0), 50); // Green colorWipe(grille_LED_strand.Color(0, 0, 255), 50); // Blue //colorWipe(grille_LED_strand.Color(0, 0, 0, 255), 50); // White RGBW // Send a theater pixel chase in... theaterChase(grille_LED_strand.Color(127, 127, 127), 50); // White theaterChase(grille_LED_strand.Color(127, 0, 0), 50); // Red theaterChase(grille_LED_strand.Color(0, 0, 127), 50); // Blue */ // The following functions will run and leave the grille LEDs on //rainbow(20); SrainbowCycle(20); } void loop() { check_sw_position(); if (switch_choice == 1) { lights_to_music(); } if (switch_choice == 2) { lights_to_patterns(); } // NO outside tube LEDs on if (switch_choice == 3) { for(int i=0; i< strand.numPixels(); i++) { strand.setPixelColor(i, 0,0,0); } strand.show(); } } void check_sw_position() { // Internal pullup on sw_pos1 and sw_pos2 means their default value is HIGH // sw_pos1 HIGH = switch position 1 selected // sw_pos2 HIGH = switch position 2 selected // sw_pos1 HIGH and sw_pos2 HIGH = switch position OFF/CENTER if (digitalRead(sw_pos1) == HIGH && digitalRead(sw_pos2) == LOW) //if sw_pos2 == LOW, use Visualizer routines { switch_choice = 1; } else if (digitalRead(sw_pos2) == HIGH && digitalRead(sw_pos1) == LOW) //else if sw_pos1 == LOW, use animation routines that don't react to music { switch_choice = 2; } else { switch_choice = 3; for(int i=0; i< strand.numPixels(); i++) { strand.setPixelColor(i, 0,0,0); } strand.show(); } } void lights_to_music() { //This is where the magic happens. This loop produces each frame of the visual. volume = analogRead(AUDIO_PIN); //Record the volume level from the sound detector //knob = analogRead(KNOB_PIN) / 1023.0; //Record how far the trimpot is twisted //Sets a threshold for volume. // In practice I've found noise can get up to 15, so if it's lower, the visual thinks it's silent. // Also if the volume is less than average volume / 2 (essentially an average with 0), it's considered silent. if (volume < avgVol / 2.0 || volume < 15) volume = 0; else avgVol = (avgVol + volume) / 2.0; //If non-zeo, take an ""average"" of volumes. //If the current volume is larger than the loudest value recorded, overwrite if (volume > maxVol) maxVol = volume; //Check the Cycle* functions for specific instructions if you didn't include buttons in your design. //////////////////////////////////////////////////////////////////////////////////////////////////// CyclePalette(); //Changes palette for shuffle mode or button press. CycleVisual(); //Changes visualization for shuffle mode or button press. //sw_posShuffle(); //sw_poss shuffle mode. Delete this if you didn't use buttons. //////////////////////////////////////////////////////////////////////////////////////////////////// //This is where ""gradient"" is modulated to prevent overflow. if (gradient > thresholds[palette]) { gradient %= thresholds[palette] + 1; //Everytime a palette gets completed is a good time to readjust ""maxVol,"" just in case // the song gets quieter; we also don't want to lose brightness intensity permanently // because of one stray loud sound. maxVol = (maxVol + volume) / 2.0; } //If there is a decent change in volume since the last pass, average it into ""avgBump"" if (volume - last > 10) avgBump = (avgBump + (volume - last)) / 2.0; //If there is a notable change in volume, trigger a ""bump"" // avgbump is lowered just a little for comparing to make the visual slightly more sensitive to a beat. bump = (volume - last > avgBump * .9); //If a ""bump"" is triggered, average the time between bumps if (bump) { avgTime = (((millis() / 1000.0) - timeBump) + avgTime) / 2.0; timeBump = millis() / 1000.0; } Visualize(); //Calls the appropriate visualization to be displayed with the globals as they are. gradient++; //Increments gradient last = volume; //Records current volume for next pass delay(30); //Paces visuals so they aren't too fast to be enjoyable } ////////// // Fill the dots one after the other with a color void colorWipe(uint32_t c, uint8_t wait) { for(uint16_t i=0; i //This function calls the appropriate visualization based on the value of ""visual"" void Visualize() { switch (visual) { case 0: return Pulse(); case 1: return PalettePulse(); case 2: return Traffic(); case 3: return Snake(); case 4: return PaletteDance(); case 5: return Glitter(); case 6: return Paintball(); default: return Pulse(); } } ////////////////////////////////////////////////////////////////////////////////////////////////////////// //NOTE: The strand displays RGB values as a 32 bit unsigned integer (uint32_t), which is why ColorPalette() // and all associated color functions' return types are uint32_t. This value is a composite of 3 // unsigned 8bit integer (uint8_t) values (0-255 for each of red, blue, and green). You'll notice the // function split() (listed below) is used to dissect these 8bit values from the 32-bit color value. ////////////////////////////////////////////////////////////////////////////////////////////////////////// //This function calls the appropriate color palette based on ""palette"" // If a negative value is passed, returns the appropriate palette withe ""gradient"" passed. // Otherwise returns the color palette with the passed value (useful for fitting a whole palette on the strand). uint32_t ColorPalette(float num) { switch (palette) { case 0: return (num < 0) ? Rainbow(gradient) : Rainbow(num); case 1: return (num < 0) ? Sunset(gradient) : Sunset(num); case 2: return (num < 0) ? Ocean(gradient) : Ocean(num); case 3: return (num < 0) ? PinaColada(gradient) : PinaColada(num); case 4: return (num < 0) ? Sulfur(gradient) : Sulfur(num); case 5: return (num < 0) ? NoGreen(gradient) : NoGreen(num); default: return Rainbow(gradient); } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// //NOTE: All of these visualizations feature some aspect that affects brightness based on the volume relative to // maxVol, so that louder = brighter. Initially, I did simple proportions (volume/maxvol), but I found this // to be visually indistinct. I then tried an exponential method (raising the value to the power of // volume/maxvol). While this was more visually satisfying, I've opted for a balance between the two. You'll // notice something like pow(volume/maxVol, 2.0) in the functions below. This simply squares the ratio of // volume to maxVol to get a more exponential curve, but not as exaggerated as an actual exponential curve. // In essence, this makes louder volumes brighter, and lower volumes dimmer, to be more visually distinct. /////////////////////////////////////////////////////////////////////////////////////////////////////////////// //PULSE //Pulse from center of the strand void Pulse() { fade(0.75); //Listed below, this function simply dims the colors a little bit each pass of loop() //Advances the palette to the next noticeable color if there is a ""bump"" if (bump) gradient += thresholds[palette] / 24; //If it's silent, we want the fade effect to take over, hence this if-statement if (volume > 0) { uint32_t col = ColorPalette(-1); //Our retrieved 32-bit color //These variables determine where to start and end the pulse since it starts from the middle of the strand. // The quantities are stored in variables so they only have to be computed once (plus we use them in the loop). int start = LED_HALF - (LED_HALF * (volume / maxVol)); int finish = LED_HALF + (LED_HALF * (volume / maxVol)) + strand.numPixels() % 2; //Listed above, LED_HALF is simply half the number of LEDs on your strand. ↑ this part adjusts for an odd quantity. for (int i = start; i < finish; i++) { //""damp"" creates the fade effect of being dimmer the farther the pixel is from the center of the strand. // It returns a value between 0 and 1 that peaks at 1 at the center of the strand and 0 at the ends. float damp = sin((i - start) * PI / float(finish - start)); //Squaring damp creates more distinctive brightness. damp = pow(damp, 2.0); //Fetch the color at the current pixel so we can see if it's dim enough to overwrite. uint32_t col2 = strand.getPixelColor(i); //Takes advantage of one for loop to do the following: // Appropriatley adjust the brightness of this pixel using location, volume, and ""knob"" // Take the average RGB value of the intended color and the existing color, for comparison uint8_t colors[3]; float avgCol = 0, avgCol2 = 0; for (int k = 0; k < 3; k++) { //colors[k] = split(col, k) * damp * knob * pow(volume / maxVol, 2); colors[k] = split(col, k) * damp * pow(volume / maxVol, 2); avgCol += colors[k]; avgCol2 += split(col2, k); } avgCol /= 3.0, avgCol2 /= 3.0; //Compare the average colors as ""brightness"". Only overwrite dim colors so the fade effect is more apparent. if (avgCol > avgCol2) strand.setPixelColor(i, strand.Color(colors[0], colors[1], colors[2])); } } //This command actually shows the lights. If you make a new visualization, don't forget this! strand.show(); } //PALETTEPULSE //Same as Pulse(), but colored the entire pallet instead of one solid color void PalettePulse() { fade(0.75); if (bump) gradient += thresholds[palette] / 24; if (volume > 0) { int start = LED_HALF - (LED_HALF * (volume / maxVol)); int finish = LED_HALF + (LED_HALF * (volume / maxVol)) + strand.numPixels() % 2; for (int i = start; i < finish; i++) { float damp = sin((i - start) * PI / float(finish - start)); damp = pow(damp, 2.0); //This is the only difference from Pulse(). The color for each pixel isn't the same, but rather the // entire gradient fitted to the spread of the pulse, with some shifting from ""gradient"". int val = thresholds[palette] * (i - start) / (finish - start); val += gradient; uint32_t col = ColorPalette(val); uint32_t col2 = strand.getPixelColor(i); uint8_t colors[3]; float avgCol = 0, avgCol2 = 0; for (int k = 0; k < 3; k++) { //colors[k] = split(col, k) * damp * knob * pow(volume / maxVol, 2); colors[k] = split(col, k) * damp * pow(volume / maxVol, 2); avgCol += colors[k]; avgCol2 += split(col2, k); } avgCol /= 3.0, avgCol2 /= 3.0; if (avgCol > avgCol2) strand.setPixelColor(i, strand.Color(colors[0], colors[1], colors[2])); } } strand.show(); } //TRAFFIC //Dots racing into each other void Traffic() { //fade() actually creates the trail behind each dot here, so it's important to include. fade(0.8); //Create a dot to be displayed if a bump is detected. if (bump) { //This mess simply checks if there is an open position (-2) in the pos[] array. int8_t slot = 0; for (slot; slot < sizeof(pos); slot++) { if (pos[slot] < -1) break; else if (slot + 1 >= sizeof(pos)) { slot = -3; break; } } //If there is an open slot, set it to an initial position on the strand. if (slot != -3) { //Evens go right, odds go left, so evens start at 0, odds at the largest position. pos[slot] = (slot % 2 == 0) ? -1 : strand.numPixels(); //Give it a color based on the value of ""gradient"" during its birth. uint32_t col = ColorPalette(-1); gradient += thresholds[palette] / 24; for (int j = 0; j < 3; j++) { rgb[slot][j] = split(col, j); } } } //Again, if it's silent we want the colors to fade out. if (volume > 0) { //If there's sound, iterate each dot appropriately along the strand. for (int i = 0; i < sizeof(pos); i++) { //If a dot is -2, that means it's an open slot for another dot to take over eventually. if (pos[i] < -1) continue; //As above, evens go right (+1) and odds go left (-1) pos[i] += (i % 2) ? -1 : 1; //Odds will reach -2 by subtraction, but if an even dot goes beyond the LED grille_LED_strand, it'll be purged. if (pos[i] >= strand.numPixels()) pos[i] = -2; //Set the dot to its new position and respective color. // I's old position's color will gradually fade out due to fade(), leaving a trail behind it. strand.setPixelColor( pos[i], strand.Color( //float(rgb[i][0]) * pow(volume / maxVol, 2.0) * knob, //float(rgb[i][1]) * pow(volume / maxVol, 2.0) * knob, //float(rgb[i][2]) * pow(volume / maxVol, 2.0) * knob) float(rgb[i][0]) * pow(volume / maxVol, 2.0), float(rgb[i][1]) * pow(volume / maxVol, 2.0), float(rgb[i][2]) * pow(volume / maxVol, 2.0)) ); } } strand.show(); //Again, don't forget to actually show the lights! } //SNAKE //Dot sweeping back and forth to the beat void Snake() { if (bump) { //Change color a little on a bump gradient += thresholds[palette] / 30; //Change the direction the dot is going to create the illusion of ""dancing."" left = !left; } fade(0.975); //Leave a trail behind the dot. uint32_t col = ColorPalette(-1); //Get the color at current ""gradient."" //The dot should only be moved if there's sound happening. // Otherwise if noise starts and it's been moving, it'll appear to teleport. if (volume > 0) { //Sets the dot to appropriate color and intensity strand.setPixelColor(dotPos, strand.Color( //float(split(col, 0)) * pow(volume / maxVol, 1.5) * knob, //float(split(col, 1)) * pow(volume / maxVol, 1.5) * knob, //float(split(col, 2)) * pow(volume / maxVol, 1.5) * knob) float(split(col, 0)) * pow(volume / maxVol, 1.5), float(split(col, 1)) * pow(volume / maxVol, 1.5), float(split(col, 2)) * pow(volume / maxVol, 1.5) ) ); //This is where ""avgTime"" comes into play. // That variable is the ""average"" amount of time between each ""bump"" detected. // So we can use that to determine how quickly the dot should move so it matches the tempo of the music. // The dot moving at normal loop speed is pretty quick, so it's the max speed if avgTime < 0.15 seconds. // Slowing it down causes the color to update, but only change position every other amount of loops. if (avgTime < 0.15) dotPos += (left) ? -1 : 1; else if (avgTime >= 0.15 && avgTime < 0.5 && gradient % 2 == 0) dotPos += (left) ? -1 : 1; else if (avgTime >= 0.5 && avgTime < 1.0 && gradient % 3 == 0) dotPos += (left) ? -1 : 1; else if (gradient % 4 == 0) dotPos += (left) ? -1 : 1; } strand.show(); // Display the lights //Check if dot position is out of bounds. if (dotPos < 0) dotPos = strand.numPixels() - 1; else if (dotPos >= strand.numPixels()) dotPos = 0; } //PALETTEDANCE //Projects a whole palette which oscillates to the beat, similar to the snake but a whole gradient instead of a dot void PaletteDance() { //This is the most calculation-intensive visual, which is why it doesn't need delayed. if (bump) left = !left; //Change direction of iteration on bump //Only show if there's sound. if (volume > avgVol) { //This next part is convoluted, here's a summary of what's happening: // First, a sin wave function is introduced to change the brightness of all the pixels (stored in ""sinVal"") // This is to make the dancing effect more obvious. The trick is to shift the sin wave with the color so it all appears // to be the same object, one ""hump"" of color. ""dotPos"" is added here to achieve this effect. // Second, the entire current palette is proportionally fitted to the length of the LED strand (stored in ""val"" each pixel). // This is done by multiplying the ratio of position and the total amount of LEDs to the palette's threshold. // Third, the palette is then ""shifted"" (what color is displayed where) by adding ""dotPos."" // ""dotPos"" is added to the position before dividing, so it's a mathematical shift. However, ""dotPos""'s range is not // the same as the range of position values, so the function map() is used. It's basically a built in proportion adjuster. // Lastly, it's all multiplied together to get the right color, and intensity, in the correct spot. // ""gradient"" is also added to slowly shift the colors over time. for (int i = 0; i < strand.numPixels(); i++) { float sinVal = abs(sin( (i + dotPos) * (PI / float(strand.numPixels() / 1.25) ) )); sinVal *= sinVal; sinVal *= volume / maxVol; //sinVal *= knob; unsigned int val = float(thresholds[palette] + 1) //map takes a value between -LED_TOTAL and +LED_TOTAL and returns one between 0 and LED_TOTAL * (float(i + map(dotPos, -1 * (strand.numPixels() - 1), strand.numPixels() - 1, 0, strand.numPixels() - 1)) / float(strand.numPixels())) + (gradient); val %= thresholds[palette]; //make sure ""val"" is within range of the palette uint32_t col = ColorPalette(val); //get the color at ""val"" strand.setPixelColor(i, strand.Color( float(split(col, 0))*sinVal, float(split(col, 1))*sinVal, float(split(col, 2))*sinVal) ); } //After all that, appropriately reposition ""dotPos."" dotPos += (left) ? -1 : 1; } //If there's no sound, fade. else fade(0.8); strand.show(); //Show lights. //Loop ""dotPos"" if it goes out of bounds. if (dotPos < 0) dotPos = strand.numPixels() - strand.numPixels() / 6; else if (dotPos >= strand.numPixels() - strand.numPixels() / 6) dotPos = 0; } //GLITTER //Creates white sparkles on a color palette to the beat void Glitter() { //This visual also fits a whole palette on the entire grille_LED_strand // This just makes the palette cycle more quickly so it's more visually pleasing gradient += thresholds[palette] / 204; //""val"" is used again as the proportional value to pass to ColorPalette() to fit the whole palette. for (int i = 0; i < strand.numPixels(); i++) { unsigned int val = float(thresholds[palette] + 1) * (float(i) / float(strand.numPixels())) + (gradient); val %= thresholds[palette]; uint32_t col = ColorPalette(val); //We want the sparkles to be obvious, so we dim the background color. strand.setPixelColor(i, strand.Color( //split(col, 0) / 6.0 * knob, //split(col, 1) / 6.0 * knob, //split(col, 2) / 6.0 * knob) split(col, 0) / 6.0 , split(col, 1) / 6.0, split(col, 2) / 6.0 ) ); } //Create sparkles every bump if (bump) { //Random generator needs a seed, and micros() gives a large range of values. // micros() is the amount of microseconds since the program started running. randomSeed(micros()); //Pick a random spot on the strand. dotPos = random(strand.numPixels() - 1); //Draw sparkle at the random position, with appropriate brightness. strand.setPixelColor(dotPos, strand.Color( ///255.0 * pow(volume / maxVol, 2.0) * knob, ///255.0 * pow(volume / maxVol, 2.0) * knob, ///255.0 * pow(volume / maxVol, 2.0) * knob 255.0 * pow(volume / maxVol, 2.0) , 255.0 * pow(volume / maxVol, 2.0) , 255.0 * pow(volume / maxVol, 2.0) )); } bleed(dotPos); strand.show(); //Show the lights. } //PAINTBALL //Recycles Glitter()'s random positioning; simulates ""paintballs"" of // color splattering randomly on the strand and bleeding together. void Paintball() { //If it's been twice the average time for a ""bump"" since the last ""bump,"" start fading. if ((millis() / 1000.0) - timeBump > avgTime * 2.0) fade(0.99); //Bleeds colors together. Operates similarly to fade. For more info, see its definition below bleed(dotPos); //Create a new paintball if there's a bump (like the sparkles in Glitter()) if (bump) { //Random generator needs a seed, and micros() gives a large range of values. // micros() is the amount of microseconds since the program started running. randomSeed(micros()); //Pick a random spot on the grille_LED_strand. Random was already reseeded above, so no real need to do it again. dotPos = random(strand.numPixels() - 1); //Grab a random color from our palette. uint32_t col = ColorPalette(random(thresholds[palette])); //Array to hold final RGB values uint8_t colors[3]; //Relates brightness of the color to the relative volume and potentiometer value. //for (int i = 0; i < 3; i++) colors[i] = split(col, i) * pow(volume / maxVol, 2.0) * knob; for (int i = 0; i < 3; i++) colors[i] = split(col, i) * pow(volume / maxVol, 2.0) ; //Splatters the ""paintball"" on the random position. strand.setPixelColor(dotPos, strand.Color(colors[0], colors[1], colors[2])); //This next part places a less bright version of the same color next to the left and right of the // original position, so that the bleed effect is stronger and the colors are more vibrant. for (int i = 0; i < 3; i++) colors[i] *= .8; strand.setPixelColor(dotPos - 1, strand.Color(colors[0], colors[1], colors[2])); strand.setPixelColor(dotPos + 1, strand.Color(colors[0], colors[1], colors[2])); } strand.show(); //Show lights. } ///////////////////////////////////////////////////////////////////////////////////////////////////// //DEBUG CYCLE //No reaction to sound, merely to see gradient progression of color palettes //NOT implemented in code as is, but is easily includable in the switch-case. void Cycle() { for (int i = 0; i < strand.numPixels(); i++) { float val = float(thresholds[palette]) * (float(i) / float(strand.numPixels())) + (gradient); val = int(val) % thresholds[palette]; strand.setPixelColor(i, ColorPalette(val)); } strand.show(); gradient += 32; } ///////////////////////////////////////////////////////////////////////////////////////////////////// ////////// ////////// void CyclePalette() { //IMPORTANT: Delete this whole if-block if you didn't use buttons////////////////////////////////// /* //If a button is pushed, it sends a ""false"" reading if (!digitalRead(BUTTON_1)) { palette++; //This is this button's purpose, to change the color palette. //If palette is larger than the population of thresholds[], start back at 0 // This is why it's important you add a threshold to the array if you add a // palette, or the program will cylce back to Rainbow() before reaching it. if (palette >= sizeof(thresholds) / 2) palette = 0; gradient %= thresholds[palette]; //Modulate gradient to prevent any overflow that may occur. //The button is close to the microphone on my setup, so the sound of pushing it is // relatively loud to the sound detector. This causes the visual to think a loud noise // happened, so the delay simply allows the sound of the button to pass unabated. delay(350); maxVol = avgVol; //Set max volume to average for a fresh experience. } /////////////////////////////////////////////////////////////////////////////////////////////////// */ //If shuffle mode is on, and it's been 30 seconds since the last shuffle, and then a modulo // of gradient to get a random decision between palette or visualization shuffle if (shuffle && millis() / 1000.0 - shuffleTime > 30 && gradient % 2) { shuffleTime = millis() / 1000.0; //Record the time this shuffle happened. palette++; if (palette >= sizeof(thresholds) / 2) palette = 0; gradient %= thresholds[palette]; maxVol = avgVol; //Set the max volume to average for a fresh experience. } } void CycleVisual() { /* //IMPORTANT: Delete this whole if-block if you didn't use buttons////////////////////////////////// if (!digitalRead(BUTTON_2)) { visual++; //The purpose of this button: change the visual mode gradient = 0; //Prevent overflow //Resets ""visual"" if there are no more visuals to cycle through. if (visual > VISUALS) visual = 0; //This is why you should change ""VISUALS"" if you add a visual, or the program loop over it. //Resets the positions of all dots to nonexistent (-2) if you cycle to the Traffic() visual. if (visual == 1) memset(pos, -2, sizeof(pos)); //Gives Snake() and PaletteDance() visuals a random starting point if cycled to. if (visual == 2 || visual == 3) { randomSeed(analogRead(0)); dotPos = random(strand.numPixels()); } //Like before, this delay is to prevent a button press from affecting ""maxVol."" delay(350); maxVol = avgVol; //Set max volume to average for a fresh experience } /////////////////////////////////////////////////////////////////////////////////////////////////// */ //If shuffle mode is on, and it's been 30 seconds since the last shuffle, and then a modulo // of gradient WITH INVERTED LOGIC to get a random decision between what to shuffle. // This guarantees one and only one of these shuffles will occur. if (shuffle && millis() / 1000.0 - shuffleTime > 30 && !(gradient % 2)) { shuffleTime = millis() / 1000.0; //Record the time this shuffle happened. visual++; gradient = 0; if (visual > VISUALS) visual = 0; if (visual == 1) memset(pos, -2, sizeof(pos)); if (visual == 2 || visual == 3) { randomSeed(analogRead(0)); dotPos = random(strand.numPixels()); } maxVol = avgVol; } } /* //IMPORTANT: Delete this function if you didn't use buttons.///////////////////////////////////////// void sw_posShuffle() { if (!digitalRead(BUTTON_3)) { shuffle = !shuffle; //This button's purpose: sw_pos shuffle mode. //This delay is to prevent the button from taking another reading while you're pressing it delay(500); //Reset these things for a fresh experience. maxVol = avgVol; avgBump = 0; } } ////////////////////////////////////////////////////////////////////////////////////////////////////// */ //Fades lights by multiplying them by a value between 0 and 1 each pass of loop(). void fade(float damper) { //""damper"" must be between 0 and 1, or else you'll end up brightening the lights or doing nothing. for (int i = 0; i < strand.numPixels(); i++) { //Retrieve the color at the current position. uint32_t col = strand.getPixelColor(i); //If it's black, you can't fade that any further. if (col == 0) continue; float colors[3]; //Array of the three RGB values //Multiply each value by ""damper"" for (int j = 0; j < 3; j++) colors[j] = split(col, j) * damper; //Set the dampened colors back to their spot. strand.setPixelColor(i, strand.Color(colors[0] , colors[1], colors[2])); } } //""Bleeds"" colors currently in the strand by averaging from a designated ""Point"" void bleed(uint8_t Point) { for (int i = 1; i < strand.numPixels(); i++) { //Starts by look at the pixels left and right of ""Point"" // then slowly works its way out int sides[] = {Point - i, Point + i}; for (int i = 0; i < 2; i++) { //For each of Point+i and Point-i, the pixels to the left and right, plus themselves, are averaged together. // Basically, it's setting one pixel to the average of it and its neighbors, starting on the left and right // of the starting ""Point,"" and moves to the ends of the strand int point = sides[i]; uint32_t colors[] = {strand.getPixelColor(point - 1), strand.getPixelColor(point), strand.getPixelColor(point + 1) }; //Sets the new average values to just the central point, not the left and right points. strand.setPixelColor(point, strand.Color( float( split(colors[0], 0) + split(colors[1], 0) + split(colors[2], 0) ) / 3.0, float( split(colors[0], 1) + split(colors[1], 1) + split(colors[2], 1) ) / 3.0, float( split(colors[0], 2) + split(colors[1], 2) + split(colors[2], 2) ) / 3.0) ); } } } //As mentioned above, split() gives you one 8-bit color value //from the composite 32-bit value that the NeoPixel deals with. //This is accomplished with the right bit shift operator, "">>"" uint8_t split(uint32_t color, uint8_t i ) { //0 = Red, 1 = Green, 2 = Blue if (i == 0) return color >> 16; if (i == 1) return color >> 8; if (i == 2) return color >> 0; return -1; } ////////// ////////// //These functions simply take a value and return a gradient color // in the form of an unsigned 32-bit integer //The gradients return a different, changing color for each multiple of 255 // This is because the max value of any of the 3 RGB values is 255, so it's // an intuitive cutoff for the next color to start appearing. // Gradients should also loop back to their starting color so there's no jumps in color. uint32_t Rainbow(unsigned int i) { if (i > 1529) return Rainbow(i % 1530); if (i > 1274) return strand.Color(255, 0, 255 - (i % 255)); //violet -> red if (i > 1019) return strand.Color((i % 255), 0, 255); //blue -> violet if (i > 764) return strand.Color(0, 255 - (i % 255), 255); //aqua -> blue if (i > 509) return strand.Color(0, 255, (i % 255)); //green -> aqua if (i > 255) return strand.Color(255 - (i % 255), 255, 0); //yellow -> green return strand.Color(255, i, 0); //red -> yellow } uint32_t Sunset(unsigned int i) { if (i > 1019) return Sunset(i % 1020); if (i > 764) return strand.Color((i % 255), 0, 255 - (i % 255)); //blue -> red if (i > 509) return strand.Color(255 - (i % 255), 0, 255); //purple -> blue if (i > 255) return strand.Color(255, 128 - (i % 255) / 2, (i % 255)); //orange -> purple return strand.Color(255, i / 2, 0); //red -> orange } uint32_t Ocean(unsigned int i) { if (i > 764) return Ocean(i % 765); if (i > 509) return strand.Color(0, i % 255, 255 - (i % 255)); //blue -> green if (i > 255) return strand.Color(0, 255 - (i % 255), 255); //aqua -> blue return strand.Color(0, 255, i); //green -> aqua } uint32_t PinaColada(unsigned int i) { if (i > 764) return PinaColada(i % 765); if (i > 509) return strand.Color(255 - (i % 255) / 2, (i % 255) / 2, (i % 255) / 2); //red -> half white if (i > 255) return strand.Color(255, 255 - (i % 255), 0); //yellow -> red return strand.Color(128 + (i / 2), 128 + (i / 2), 128 - i / 2); //half white -> yellow } uint32_t Sulfur(unsigned int i) { if (i > 764) return Sulfur(i % 765); if (i > 509) return strand.Color(i % 255, 255, 255 - (i % 255)); //aqua -> yellow if (i > 255) return strand.Color(0, 255, i % 255); //green -> aqua return strand.Color(255 - i, 255, 0); //yellow -> green } uint32_t NoGreen(unsigned int i) { if (i > 1274) return NoGreen(i % 1275); if (i > 1019) return strand.Color(255, 0, 255 - (i % 255)); //violet -> red if (i > 764) return strand.Color((i % 255), 0, 255); //blue -> violet if (i > 509) return strand.Color(0, 255 - (i % 255), 255); //aqua -> blue if (i > 255) return strand.Color(255 - (i % 255), 255, i % 255); //yellow -> aqua return strand.Color(255, i, 0); //red -> yellow } //NOTE: This is an example of a non-gradient palette: you will get straight red, white, or blue // This works fine, but there is no gradient effect, this was merely included as an example. // If you wish to include it, put it in the switch-case in ColorPalette() and add its // threshold (764) to thresholds[] at the top. uint32_t USA(unsigned int i) { if (i > 764) return USA(i % 765); if (i > 509) return strand.Color(0, 0, 255); //blue if (i > 255) return strand.Color(128, 128, 128); //white return strand.Color(255, 0, 0); //red } ////////// ",12342,False,2156.8818072175472,median " float arr[1000] = {-194.7293734,-228.7205774,-241.1012313,-274.3287909,-258.4301079,-244.645154,-267.9013166,-246.6050094,-242.4746091,-262.6250468,-238.1975294,-221.7994023,-235.1426569,-242.8932457,-247.5878307,-218.1253556,-237.4591843,-229.5916635,-223.2165116,-205.5867448,-237.778965,-201.5138842,-197.2634399,-218.4651907,-226.9375835,-199.6628832,-240.0012574,-222.3782983,-204.4144371,-223.0221878,-215.5507942,-204.6482212,-222.0696607,-221.5406628,-233.7575657,-207.3931737,-213.1469816,-256.4251654,-248.644363,-238.4953193,-243.4652311,-206.2320692,-236.7459641,-259.4415915,-262.9389297,-203.4735393,-189.4905604,-150.4684017,-144.7423112,-108.8224312,-50.3437065,-42.48394314,-9.313541237,2.282074465,60.61253926,58.58308399,43.99462444,45.23633906,5.781279205,12.42652926,-6.064931748,-37.43559123,-73.84242875,-54.06086811,-103.7524177,-137.3311552,-154.8714495,-145.8669742,-163.164842,-213.1969349,-188.3772464,-180.3718886,-190.6680207,-182.8992434,-208.5555581,-227.0501279,-223.9086697,-203.6115081,-225.0068371,-249.7099086,-270.430942,-247.9083576,-221.4759624,-271.2626802,-256.0717227,-240.2203343,-211.4446914,-201.1415653,-198.7572259,-207.5827723,-233.1128712,-178.8934831,-190.8283584,-189.2946002,-194.2929802,-194.1054383,-198.4310706,-188.7845077,-210.9275443,-197.1196525,-185.5335141,-233.2417639,-222.0488999,-223.1010373,-237.2142258,-227.1844383,-224.8237316,-227.1231129,-225.6844486,-188.4712173,-212.9535228,-238.0921159,-246.9258376,-229.913049,-268.1904491,-257.5908872,-235.2382047,-196.0882206,-174.4861493,-144.3613337,-121.5747288,-89.66203045,-65.1663977,-40.2986104,24.53192862,53.25129558,69.48466659,46.26462118,54.09895211,16.29032903,5.228029817,-20.74642039,-40.2574299,-80.06059097,-85.14764361,-101.1609156,-130.8264169,-110.7740027,-172.6491102,-190.6556797,-150.7838331,-178.8338841,-209.2648121,-206.1178525,-210.4814517,-214.1269824,-222.1505692,-230.3364431,-229.1243872,-251.8032432,-250.9595267,-235.0004413,-232.6200981,-235.0745491,-204.5328354,-212.59826,-211.1507703,-207.7587466,-234.7991683,-192.0878764,-222.6905045,-202.4615363,-204.2220413,-225.1243183,-216.3029391,-191.6984828,-185.4856592,-182.9473139,-177.8998202,-183.2392524,-208.2415824,-212.0286206,-169.3541698,-210.5412575,-231.0118891,-249.5577641,-208.3705454,-204.5434279,-214.5228903,-228.7358685,-241.2009769,-235.1017173,-218.3852069,-213.7527006,-227.4889893,-223.6288157,-228.9916498,-207.5219466,-190.493554,-154.5865093,-116.0024558,-63.17772296,-51.8002069,-7.546116619,-14.39880211,32.98183203,63.20752025,64.41857886,59.71544681,32.10101235,-17.70912436,-7.631012085,-51.8776306,-55.95033776,-69.06182035,-111.8571389,-104.4989893,-126.9390643,-163.5667602,-151.7080535,-187.5999,-219.4481594,-206.2992725,-207.0990868,-222.7266564,-222.5792183,-210.542429,-238.9541618,-240.7254286,-243.3493466,-258.2009352,-241.234409,-225.2101582,-243.213891,-246.0856964,-238.4527187,-219.1768319,-227.3266325,-213.8079106,-225.8201055,-222.0041483,-210.3261814,-205.7475302,-206.0668604,-222.6182256,-200.8885429,-206.1334318,-218.22569,-186.0937162,-226.4895114,-221.4281832,-191.3548204,-200.6006756,-211.0800005,-213.9486458,-203.0680747,-190.9419471,-221.7923004,-201.7018474,-215.4770913,-246.7618175,-228.9328285,-232.0936364,-240.3352165,-230.6981949,-224.9568539,-199.9779163,-212.2616482,-173.7521828,-176.9408848,-119.7392093,-103.6798485,-89.81041289,-67.57551054,-10.67998311,9.749239444,32.13123786,16.27966092,34.40986469,15.91874671,13.97345217,3.402896188,5.590464863,-45.38323666,-65.65860722,-95.44303348,-98.91854576,-98.15341909,-131.3000653,-135.7003976,-192.0801184,-189.0861504,-164.4095092,-156.1325791,-193.5525884,-184.7028529,-229.651036,-223.1013635,-187.5059762,-190.6580371,-168.5168179,-171.8102238,-214.0656828,-206.2208193,-183.5450934,-190.8589567,-182.7666905,-178.6198467,-180.509724,-175.642094,-172.8580103,-167.8244064,-196.979952,-186.2138905,-168.0834867,-167.8570434,-169.5713098,-203.7577476,-173.624489,-189.6457655,-186.161929,-178.6140261,-186.2081834,-203.8580852,-174.0582505,-218.2507178,-214.4790238,-204.6601377,-193.1434548,-234.4722219,-246.5686757,-185.7564607,-217.201683,-225.3845411,-179.1924198,-162.6436219,-164.680583,-145.8246757,-131.3135381,-107.2424073,-96.60282967,-66.09455088,-39.12388801,-10.4655626,18.43708564,25.39622555,19.70363064,29.50104014,24.65377861,9.065353235,7.800289078,-9.481016435,-32.44722798,-8.425000643,-42.09591755,-84.85431968,-65.23416939,-83.26647469,-88.61872226,-94.31984595,-135.5122422,-96.24493259,-130.6101087,-164.2159095,-163.8014595,-161.2911478,-146.1628098,-143.8038188,-165.9456815,-162.9975622,-186.5376742,-163.928964,-208.4947079,-163.6350835,-143.1139405,-179.8374228,-161.6782426,-170.9720761,-153.9010512,-159.7300558,-169.2543883,-125.3209033,-166.0480624,-190.0647723,-164.8502403,-176.244536,-176.7593197,-141.0916485,-191.6808102,-175.8716194,-179.0655926,-213.334729,-157.4868359,-146.8128336,-176.2284353,-192.1630524,-171.753249,-184.7194487,-190.6521523,-176.2414561,-225.7463566,-181.2578951,-170.1268263,-168.2026363,-136.5319892,-137.8841734,-97.44384241,-96.24254779,-62.94615628,-3.930067195,8.360604156,30.9113395,57.224556,60.38299552,71.4775984,37.93360244,30.25482625,-10.96794785,43.9548974,8.275507057,-5.505276016,-42.18418284,-41.53852257,-38.19401138,-9.988135433,-73.23986505,-82.37523151,-92.49459774,-119.2384522,-117.1943554,-142.7418834,-134.5810715,-155.6807706,-170.4483921,-162.0791537,-121.3606511,-135.2956761,-158.4504113,-177.587806,-191.5341681,-170.2470434,-164.0494494,-169.9082233,-152.4201734,-138.1347796,-151.0786031,-145.2001118,-153.4814199,-183.4935886,-153.946237,-152.2658373,-185.4743658,-160.4133792,-149.8470445,-199.958043,-173.5824841,-170.6156591,-165.6102076,-151.9477062,-183.3851466,-189.1947611,-190.5126042,-178.451038,-232.1975489,-209.617863,-181.0558565,-195.2786295,-195.4491857,-191.063771,-209.1130301,-241.5632851,-171.2830079,-205.2558494,-199.4252494,-171.0996064,-135.2528671,-120.0398883,-86.35313349,-58.75543608,-31.63496181,15.61749277,21.53029518,52.80680223,37.94167304,38.60237186,39.1940536,41.07783215,29.45936977,20.05054327,-8.013389731,16.79412285,-7.969302978,-59.9582873,-64.72356939,-88.95088436,-76.4041469,-98.53033607,-99.11610762,-67.75720734,-95.97143121,-96.68185726,-126.6121091,-105.5375604,-102.3703775,-133.2714074,-131.1305721,-131.4514406,-111.0579924,-136.3332306,-117.5234052,-120.694585,-82.60431528,-108.3972289,-101.9762479,-132.7979261,-94.75065491,-124.2930794,-110.4378804,-138.6506348,-123.5289038,-131.5299734,-132.8438586,-122.8304073,-120.7581867,-100.7386637,-149.5780713,-161.4928199,-157.7717813,-152.1336241,-145.7094938,-159.1026831,-102.0334835,-160.1400191,-153.7176046,-171.7580939,-157.3400312,-166.8574939,-194.2379129,-177.1002617,-134.1092309,-161.9593411,-141.7789387,-142.6961662,-161.7180284,-108.7803143,-101.1193168,-118.6115166,-91.42120803,-70.22670377,-62.88077846,-31.97668856,-6.215203813,-5.233143328,-44.56281787,-21.68037513,-45.79143414,8.989530097,-33.15079614,-21.48894064,-33.49492773,-29.2493369,-41.52894652,-75.47306377,-68.38486974,-74.77386162,-115.0927022,-70.91988867,-114.6172291,-102.9498024,-106.6596287,-125.8687341,-130.0565056,-112.7060226,-114.066016,-144.0590352,-139.9082732,-79.15096988,-122.8808231,-123.1155945,-106.5493839,-95.2442839,-84.61336782,-91.78075471,-81.91146491,-86.01301159,-74.34770941,-57.81595852,-105.2189274,-89.36945358,-78.90219237,-86.36036927,-87.60490458,-82.61198278,-90.23936768,-111.8892024,-119.0173669,-99.10710747,-72.20035121,-105.0562126,-97.31112661,-108.4746315,-124.6542035,-85.76581803,-92.86040155,-109.1004347,-121.3621172,-100.9174347,-142.4731285,-130.0011933,-119.4201213,-139.370153,-121.6220649,-87.52025165,-60.4602173,-39.90009249,-14.47723731,28.08235515,47.0560563,120.2148031,107.0469654,115.7527706,136.7052646,118.2185203,121.9294065,84.74510753,96.10309817,64.47610982,38.05916544,13.27418373,-32.23912655,-36.78391247,-25.11066914,-61.15777398,-98.29203929,-68.59806904,-99.0657737,-87.29964824,-102.3767133,-125.4705793,-135.8394233,-148.0103686,-121.5531103,-140.2008691,-127.8816079,-142.15461,-130.3117346,-142.8451429,-136.1119731,-128.1150761,-181.7599915,-135.3870371,-129.2560956,-137.0686169,-112.1668674,-118.3244947,-88.19945937,-115.5759744,-137.0163441,-85.11711793,-121.9576238,-140.4228662,-144.3353992,-127.470473,-121.8499143,-155.2375142,-141.0241809,-137.4376575,-116.4224465,-156.3159578,-159.9703768,-153.0455255,-116.8784562,-158.7746494,-159.2404272,-146.5092559,-145.9024473,-135.9718693,-149.2638179,-136.4628664,-153.8788251,-138.2996744,-129.7350719,-122.8989196,-69.96569523,-42.6188645,-26.6727897,42.75270977,80.38748068,85.15990593,144.2246011,114.0285993,135.0663365,118.77368,108.4004485,79.29920395,53.47504442,51.4568911,15.51504004,2.820147023,-17.76931482,-29.5342018,-76.86515899,-93.52672611,-92.36201603,-106.8546262,-99.42868777,-128.2335362,-141.4652213,-149.7667769,-173.7089838,-162.7297406,-153.9823947,-157.7649799,-169.7695429,-136.117979,-190.0099192,-171.0138731,-153.8969602,-131.3825889,-132.4775054,-144.8328747,-119.4553937,-118.461819,-152.2870008,-123.99986,-109.9679708,-107.7218485,-134.425985,-108.5528276,-122.931492,-144.3043608,-123.9151892,-136.0427895,-138.2686626,-125.487269,-132.3539958,-138.2329971,-139.939367,-171.8562663,-119.2203833,-148.7311304,-130.8654556,-132.1708188,-140.651656,-146.8004431,-161.7175614,-141.8975887,-204.1681909,-181.4347946,-169.794193,-181.3817571,-163.1939391,-181.9440958,-141.4159902,-161.3779616,-142.8835639,-92.83279682,-87.82929402,-67.63583459,-45.72687899,-18.59988298,-23.8363,3.608611204,1.818248803,-8.739289403,-21.57494524,-41.33157434,-29.03713358,-20.99940689,-50.0813837,-21.99804201,-74.39428105,-76.39698718,-78.44490173,-98.33019493,-107.645843,-99.10440428,-124.3985889,-130.8573096,-163.2159422,-142.4553406,-159.944714,-148.9434037,-160.8869971,-184.5980749,-155.1405424,-146.5041614,-156.7679863,-182.9961263,-180.3384162,-141.9037962,-143.0601834,-164.0363091,-146.9603389,-152.7834731,-164.5475811,-127.676256,-157.8642206,-151.1628084,-166.7477876,-167.5465739,-154.2128082,-171.8941133,-168.0392262,-121.3123974,-145.018166,-204.3435584,-182.2026828,-149.4854941,-183.9677767,-183.512187,-166.1788482,-167.4555169,-173.1731897,-180.8263172,-170.8577042,-177.8208421,-180.3912373,-180.5553552,-195.928325,-196.1781535,-190.0243037,-184.3042068,-191.4410315,-151.0294216,-149.9720078,-127.1330296,-90.14556331,-34.01657424,-24.09053284,-19.20488983,10.32673427,26.05205325,15.75123511,41.96615392,14.59800579,-13.62332522,-21.03076268,-30.02105683,-41.17833452,-77.18028379,-96.99706135,-127.306131,-132.4580054,-134.9024561,-152.8904973,-176.0369535,-161.986251,-138.455779,-201.3283425,-208.3465867,-200.7438402,-205.9870668,-219.1445998,-192.2587361,-176.9577506,-210.0107858,-208.2073254,-174.0554183,-189.1968548,-168.2189224,-154.2706031,-126.5548643,-135.7245765,-173.113575,-139.4801769,-150.9201739,-157.1746172,-125.409453,-152.7137791,-170.3718494,-157.5132698,-166.5706996,-203.1650381,-182.003685,-160.8451871,-150.3803736,-156.9948784,-172.4977517,-201.7729783,-169.2198307,-186.9477502,-174.2955725,-174.2682879,-193.5521213,-164.0675421,-193.5597176,-180.4292896,-190.882491,-229.4133228,-207.9229962,-210.5044907,-176.0909394,-216.6674227,-143.3847579,-135.8177249,-94.8520075,-55.29308187,-8.596819711,7.964483205,28.48459718,44.78772264,17.27301549,25.115108,0.829013092,4.966635828,-32.97422792,-55.44387968,-38.01791022,-66.97019754,-80.10909905,-133.6043384,-122.9867923,-158.0198585,-168.7119192,-162.1761282,-193.2111663,-202.4715106,-215.1658819,-205.3750362,-182.2905731,-219.30705,-200.7479717,-204.8469231,-209.0812153,-211.6547947,-204.1270669,-226.8917176,-192.2647367,-192.0937077,-149.1202258,-178.2079718,-153.9820205,-160.0980568,-143.4038851,-160.9962075,-152.194965,-144.7864218,-152.6499076,-161.0921342,-146.3687844,-133.3138354,-157.2481451,-168.1529119,-177.2414936,-175.869606,-163.9159113,-167.8363622,-171.5562753,-176.8878957,-184.8272099,-173.231631,-189.1954342,-186.7880633,-198.419782,-198.4993576,-205.7931514,-225.0244529,-217.432668,-225.6304254,-208.4727153,-196.0858998,-179.7989551,-180.135508,-107.6521441,-84.49460718,-57.79385363,-5.432363826,-7.905866213,7.415821868,38.71482905,49.74463987,38.91135793,38.58460628,16.72865935,-6.29901565,-32.45669955,-70.16222148,-105.1041477,-100.6433214,-130.2641923,-128.9636693,-174.105794,-178.0473545,-205.6339688,-235.4556809,-201.4454861,-241.9226402,-217.5838268,-244.6654605,-264.975986,-235.3203644,-194.1459558,-224.5232334,-192.4564951,-196.1291018,-186.0265871,-162.9354431,-185.5400986,-178.1149615,-150.0574549,-160.1466649,-154.5837003,-137.2761693,-141.4914396,-123.2661691,-148.2682616,-144.4504403,-139.3705715,-155.2151228}; float z = 0; int num_of_data = 1000; void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: for (int i = 0; i< 1000; i++) { z = 0; // Second Order Difference if (i < 2) { z = arr[i]; } else { z = arr[i] - arr[i-2]; } Serial.print(arr[i]); Serial.print(','); Serial.print(z); } } ",12052,True,3693.3413241108806,median "/* DebounceU8x8.ino Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/) Copyright (c) 2016, olikraus@gmail.com 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. 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. */ #include #include #include /* Preconditions: Uno with DOGS102 Shield */ // Please UNCOMMENT one of the contructor lines below // U8x8 Contructor List // The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8x8setupcpp // Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected //U8X8_NULL u8x8; // null device, a 8x8 pixel display which does nothing //U8X8_SSD1306_128X64_NONAME_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 6, /* dc=*/ 4, /* reset=*/ 12); // Arduboy (DevKit) //U8X8_SSD1306_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 12, /* dc=*/ 4, /* reset=*/ 6); // Arduboy 10 (Production, Kickstarter Edition) //U8X8_SSD1306_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_3W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_3W_HW_SPI u8x8(/* cs=*/ 10, /* reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ 2, /* data=*/ 0, /* reset=*/ U8X8_PIN_NONE); // Digispark ATTiny85 //U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // OLEDs without Reset of the Display //U8X8_SSD1306_128X64_VCOMH0_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8X8_SSD1306_128X64_ALT0_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8X8_SSD1306_102X64_EA_OLEDS102_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8X8_SH1106_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1106_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SH1106_128X64_VCOMH0_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8X8_SH1106_128X64_WINSTAR_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but uses updated SH1106 init sequence //U8X8_SH1106_128X32_VISIONOX_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SH1106_128X32_VISIONOX_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1106_72X40_WISE_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1107_64X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1107_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1107_128X128_HW_I2C u8x8(/* reset=*/ 8); //U8X8_SH1107_PIMORONI_128X128_HW_I2C u8x8(/* reset=*/ 8); //U8X8_SH1107_SEEED_128X128_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); //U8X8_SH1107_SEEED_128X128_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SH1107_SEEED_96X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1108_160X160_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1306_128X32_UNIVISION_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather ESP8266/32u4 Boards + FeatherWing OLED //U8X8_SSD1306_128X32_UNIVISION_SW_I2C u8x8(/* clock=*/ 21, /* data=*/ 20, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather M0 Basic Proto + FeatherWing OLED //U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // Adafruit ESP8266/32u4/ARM Boards + FeatherWing OLED //U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA); // pin remapping with ESP8266 HW I2C //U8X8_SSD1306_128X32_WINSTAR_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA); // pin remapping with ESP8266 HW I2C //U8X8_SSD1306_64X48_ER_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // EastRising 0.66"" OLED breakout board, Uno: A4=SDA, A5=SCL, 5V powered //U8X8_SSD1306_48X64_WINSTAR_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SSD1306_64X32_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SSD1306_64X32_1F_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SSD1306_96X16_ER_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // EastRising 0.69"" //U8X8_SSD1306_72X40_ER_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // EastRising 0.42"" //U8X8_SSD1306_128X64_NONAME_6800 u8x8(13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_8080 u8x8(13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8X8_SSD1309_128X64_NONAME0_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1309_128X64_NONAME0_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1309_128X64_NONAME2_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1309_128X64_NONAME2_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1316_128X32_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1316_128X32_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1317_96X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // not tested, not confirmed //U8X8_SSD1317_96X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // not tested, not confirmed //U8X8_SSD1318_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1318_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1320_160X132_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1320_160X132_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1322_NHD_256X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1322_NHD_256X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1322_NHD_128X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1322_NHD_128X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1325_NHD_128X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1325_NHD_128X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD0323_OS128064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD0323_OS128064_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1326_ER_256X32_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // experimental driver for ER-OLED018-1 //U8X8_SSD1327_SEEED_96X96_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8X8_SSD1327_SEEED_96X96_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8X8_SSD1327_EA_W128128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_EA_W128128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_MIDAS_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_MIDAS_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_WS_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_WS_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_VISIONOX_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_VISIONOX_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_128X96_NONAME_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_128X96_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_96X96_NONAME_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_96X96_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_96X96_NONAME_4W_HW_SPI u8x8(/* cs=*/ A4, /* dc=*/ A2, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather 32u4 Basic Proto //U8X8_SSD1305_128X32_NONAME_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X32_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X32_ADAFRUIT_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X32_ADAFRUIT_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X64_ADAFRUIT_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X64_ADAFRUIT_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X64_RAYSTAR_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X64_RAYSTAR_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_KS0108_128X64 u8x8(8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ U8X8_PIN_NONE, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8X8_KS0108_ERM19264 u8x8(8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ 16, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8X8_HD44102_100X64 u8x8(4, 5, 6, 7, 8, 9, 10, 11, /*enable=*/ 2, /*dc=*/ 3, /*cs0=*/ A0, /*cs1=*/ A1, /*cs2=*/ A2, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8X8_T7932_150X32 u8x8(4, 5, 6, 7, 8, 9, 10, 11, /*enable=*/ 2, /*dc=*/ 3, /*cs0=*/ A0, /*cs1=*/ A1, /*cs2=*/ A2, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8X8_UC1701_EA_DOGS102_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1701_EA_DOGS102_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_PCD8544_84X48_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8X8_PCD8544_84X48_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8X8_PCF8812_96X65_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8X8_PCF8812_96X65_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8X8_HX1230_96X68_3W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8X8_HX1230_96X68_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7528_ERC16064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7528_ERC16064_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_EA_DOGM128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_EA_DOGM128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_64128N_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_64128N_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_EA_DOGM132_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8X8_ST7565_EA_DOGM132_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8X8_ST7565_ZOLEN_128X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_ZOLEN_128X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_LM6059_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8X8_ST7565_LM6059_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8X8_ST7565_KS0713_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // KS0713 controller //U8X8_ST7565_KS0713_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // KS0713 controller //U8X8_ST7565_LX12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_LX12864_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_ERC12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_ERC12864_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_ERC12864_ALT_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // contrast improved version for ERC12864 //U8X8_ST7565_ERC12864_ALT_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // contrast improved version for ERC12864 //U8X8_ST7565_NHD_C12832_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_NHD_C12832_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_NHD_C12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_NHD_C12864_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_JLX12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_JLX12864_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_PI_132X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8X8_ST7567_PI_132X64_4W_HW_SPI u8x8(/* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8X8_ST7567_JLX12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_JLX12864_4W_HW_SPI u8x8(/* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_OS12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_OS12864_4W_HW_SPI u8x8(/* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_ENH_DG128064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_ENH_DG128064_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_ENH_DG128064I_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_ENH_DG128064I_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_64X32_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_ST7567_HEM6432_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_ST7571_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7571_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7571_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7571_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX172104_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX172104_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX19296_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX19296_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256128_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_WO256X128_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_WO256X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160M_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160M_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160_ALT_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160_ALT_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX240160_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX240160_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX25664_2ND_HW_I2C u8x8(/* reset=*/ 8); // Due, 2nd I2C //U8X8_ST75320_JLX320240_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75320_JLX320240_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_NT7534_TG12864R_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_NT7534_TG12864R_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7588_JLX12864_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ 5); //U8X8_ST7588_JLX12864_HW_I2C u8x8(/* reset=*/ 5); //U8X8_IST3020_ERC19264_6800 u8x8(44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 28, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect WR pin with GND //U8X8_IST3020_ERC19264_8080 u8x8(44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 29, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect RD pin with 3.3V //U8X8_IST3020_ERC19264_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_IST7920_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Round display //U8X8_IST7920_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Round display //U8X8_UC1601_128X32_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1601_128X32_3W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8X8_UC1601_128X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1604_JLX19264_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1604_JLX19264_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1608_ERC24064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Due, SW SPI, ERC24064-1 Test Board //U8X8_UC1608_DEM240064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Due, SW SPI, ERC24064-1 Test Board //U8X8_UC1608_ERC240120_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1608_240X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1610_EA_DOGXL160_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8X8_UC1610_EA_DOGXL160_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8X8_UC1611_EA_DOGM240_2ND_HW_I2C u8x8(/* reset=*/ 8); // Due, 2nd I2C, DOGM240 Test Board //U8X8_UC1611_EA_DOGM240_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board //U8X8_UC1611_EA_DOGXL240_2ND_HW_I2C u8x8(/* reset=*/ 8); // Due, 2nd I2C, DOGXL240 Test Board //U8X8_UC1611_EA_DOGXL240_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board //U8X8_UC1611_IDS4073_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1611_IDS4073_4W_HW_SPI u8x8( /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1611_EW50850_8080 u8x8(8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 3, /*dc=*/ 16, /*reset=*/ 17); // 240x160, Connect RD/WR1 pin with 3.3V, CS is aktive high //U8X8_UC1611_CG160160_8080 u8x8(8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 3, /*dc=*/ 16, /*reset=*/ 17); // Connect WR1 and CD1 pin with 3.3V, connect CS0 with cs, WR0 with enable, CD with dc //U8X8_UC1617_JLX128128_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1617_JLX128128_4W_HW_SPI u8x8( /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1638_192X96_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1638_192X96_4W_HW_SPI u8x8( /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1638_192X96_SW_I2C u8x8(/* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8); // u8g2 test board: I2C clock/data is same as SPI, I2C default address is 0x78 //U8X8_SSD1606_172X72_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display //U8X8_SSD1607_200X200_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display, original LUT from embedded artists //U8X8_SSD1607_GS_200X200_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Good Display //U8X8_SSD1607_WS_200X200_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Waveshare //U8X8_IL3820_296X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display, original LUT //U8X8_IL3820_V2_296X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display, optimized (lesser screen flicker) //U8X8_ST7511_AVD_320X240_8080 u8x8(13, 11, 2, 3, 4, 5, 6, A4, /*enable/WR=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); // Connect RD pin with 3.3V/5V //U8X8_S1D15721_240X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_S1D15721_240X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); ",12156,True,3780.8947132749395,median "/* Aquarium Project Pasquale */ char monthNames[][3] = { ""Jan"", ""Feb"", ""Mar"", ""Apr"", ""May"", ""Jun"", ""Jul"", ""Aug"", ""Sep"", ""Oct"", ""Nov"", ""Dec"" }; char waitingString[15] = ""Waiting...""; int rowItem = 0, colItem = 0, rowItemMainMenu = 0, rowItemManualMenu = 0, rowItemSettingMenu = 0; void initMessages(void) { display.clearDisplay(); display.setTextSize(2); // Normal 2x pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,20); display.println(F(""AQUARIUM"")); display.setCursor(65,41); display.println(F(""PIA12"")); display.display(); // Scroll from left to right, only one string with (0x00, 0x04) display.startscrollright(0x00, 0x04); delay(1500); display.stopscroll(); display.clearDisplay(); display.setCursor(20,20); display.println(F(""AQUARIUM"")); display.setCursor(65,41); display.println(F(""PIA12"")); display.display(); // Scroll from right to left, only second string with (0x05, 0x07) display.startscrollleft(0x05, 0x07); delay(2000); display.stopscroll(); } void drawroundrect(void) { display.clearDisplay(); for(int16_t i=0; i= 4 && rowItem <= 5) { activeMenu = 15; } else { activeMenu = 4; } changingPage = true; rowItemManualMenu = rowItem; rowItem = 0; colItem = 0; } break; case 3: //Serial.println(""Menu Setting...""); manageMenuCursors(keyPad, settingMenuSize, -1, 2); showListMenu(settingMenuSize, rowItem, settingMenu); if (colItem == -1) { setChangingPageVariable(1, rowItemMainMenu); } else if (colItem == 1) { switch (rowItem) { case 0: activeMenu = 6; break; case 1: activeMenu = 6; break; case 2: activeMenu = 6; break; case 3: showInfoWifi(); waitingActionMenu(); connectionStatusPage(connStatus); exitFromMenu(); break; case 4: waitingActionMenu(); reconnectWifi(); exitFromMenu(); case 5: activeMenu = 11; break; case 6: activeMenu = 14; break; case 7: activeMenu = 9; break; case 8: activeMenu = 9; break; case 9: activeMenu = 9; break; case 10: activeMenu = 10; break; case 11: activeMenu = 10; break; case 12: activeMenu = 10; break; default: break; } changingPage = true; rowItemSettingMenu = rowItem; rowItem = 0; colItem = 0; } break; case 4: //Serial.println(""Menu Yes o No for Manual Section...""); manageMenuCursors(keyPad, 1, -1, 2); if (colItem == -1) { setChangingPageVariable(2, rowItemManualMenu); break; } yesOrNoSelection(colItem, rowItemManualMenu, activeMenu, manualMenu); if (keyPad == code[4]) { manageManualSelection(rowItemManualMenu, colItem); break; } else { break; } case 5: //Serial.println(""Menu Yes o No for Main Section...""); manageMenuCursors(keyPad, 1, -1, 2); if (colItem == -1) { setChangingPageVariable(1, rowItemMainMenu); break; } yesOrNoSelection(colItem, rowItemMainMenu, activeMenu, mainMenu); if (keyPad == code[4]) { waitingActionMenu(); manageAutomationProcessAndMaintenance(rowItemMainMenu, colItem); exitFromMenu(); } break; case 6: //Serial.println(""Menu show time...""); manageMenuCursors(keyPad, 1, -1, 2); if (colItem == -1) { setChangingPageVariable(3, rowItemSettingMenu); break; } if (rowItemSettingMenu == 0) { showLightsTimerSetting(); } else if (rowItemSettingMenu == 1) { showTime(); } else { showDate(); } if (colItem == 1) { setChangingPageVariable(7, 0); } break; case 7: //Serial.println(""Menu set start time or real time...""); switch (rowItemSettingMenu) { case 0: manageMenuCursors(keyPad, 4, 1, 1); shiftHourAndMinutesMenu(0, 1, keyPad, ""Start"", ""Time"", rowItem, oraEMinTemp); if (keyPad == code[4]) { if (rowItem == 2) { setChangingPageVariable(8, rowItemSettingMenu); break; } else if (rowItem == 3) { setChangingPageVariable(3, rowItemSettingMenu); break; } } break; case 1: manageMenuCursors(keyPad, 4, 1, 1); shiftHourAndMinutesMenu(0, 1, keyPad, ""Set"", ""Time"", rowItem, oraEMinTimeClockTemp); if (keyPad == code[4]) { if (rowItem == 2) { saveTime(oraEMinTemp); } else if (rowItem == 3) { setChangingPageVariable(3, rowItemSettingMenu); } else { break; } } break; case 2: manageMenuCursors(keyPad, 5, 1, 1); setDateMenu(0, 1, 2, keyPad, rowItem, dateTemp); if (keyPad == code[4]) { if (rowItem == 3) { saveDate(dateTemp); } else if (rowItem == 4) { setChangingPageVariable(3, rowItemSettingMenu); } else { break; } } break; default: break; } break; case 8: //Serial.println(""Menu set end time...""); manageMenuCursors(keyPad, 4, 1, 1); shiftHourAndMinutesMenu(2, 3, keyPad, ""End"", ""Time"", rowItem, oraEMinTemp); if (keyPad == code[4]) { if (rowItem == 2) { saveTimerLights(oraEMinTemp); } else if (rowItem == 3) { setChangingPageVariable(3, rowItemSettingMenu); } else { break; } } break; case 9: //Serial.println(""Menu Settings Sensors activation...""); manageMenuCursors(keyPad, 1, -1, 2); if (colItem == -1) { setChangingPageVariable(3, rowItemSettingMenu); break; } yesOrNoSelection(colItem, rowItemSettingMenu, activeMenu, settingMenu); if (keyPad == code[4]) { waitingActionMenu(); manageSettingsSelections(rowItemSettingMenu, colItem); exitFromMenu(); } break; case 10: //Serial.println(""Menu Yes or No Web Sending...""); manageMenuCursors(keyPad, 1, -1, 2); if (colItem == -1) { setChangingPageVariable(3, rowItemSettingMenu); break; } yesOrNoSelection(colItem, rowItemSettingMenu, activeMenu, settingMenu); if (keyPad == code[4]) { waitingActionMenu(); manageSettingsSelections(rowItemSettingMenu, colItem); exitFromMenu(); } break; case 11: //Serial.println(""Menu show min - max temperature...""); manageMenuCursors(keyPad, 1, -1, 2); if (colItem == -1) { setChangingPageVariable(3, rowItemSettingMenu); break; } showActualTemperatureRange(); if (colItem == 1) { setChangingPageVariable(12, 0); } break; case 12: //Serial.println(""Menu set temperature...""); manageMenuCursors(keyPad, 4, 1, 1); settingNewMinMaxTemperatureRange(keyPad, ""setGrad"", rowItem, temperatureMinAndMaxTemp); if (keyPad == code[4]) { if (rowItem == 2) { saveMinMaxTemperature(temperatureMinAndMaxTemp); } else if (rowItem == 3) { setChangingPageVariable(3, rowItemSettingMenu); } else { break; } } break; case 13: //Serial.println(""Menu set Freq update web...""); manageMenuCursors(keyPad, 5, 1, 1); setFreqUpdateMenu(keyPad, rowItem); if (keyPad == code[4]) { if (rowItem == 3) { saveFreqUpdateWeb(); } else if (rowItem == 4) { setChangingPageVariable(3, rowItemSettingMenu); } else { break; } } break; case 14: //Serial.println(""Menu show WEB rate...""); manageMenuCursors(keyPad, 1, -1, 2); if (colItem == -1) { setChangingPageVariable(3, rowItemSettingMenu); break; } showWebRateSending(); if (colItem == 1) { freqUpdateWebTemperatureIndex = indexNumber(config.freqUpdateWebTemperature); freqUpdateWebECIndex = indexNumber(config.freqUpdateWebEC); freqUpdateWebPHIndex = indexNumber(config.freqUpdateWebPH); setChangingPageVariable(13, 0); } break; case 15: //Serial.println(""Menu show Monitoring EC / PH ...""); manageMenuCursors(keyPad, 1, 1, 1); if(rowItemManualMenu == 4){ monitorEC = true; }else{ monitorPH = true; } if(keyPad == code[4]){ waitingActionMenu(); monitorEC = false; monitorPH = false; setChangingPageVariable(2, rowItemManualMenu); //exitFromMenu(); } break; default: break; } } int indexNumber(int freq) { if (freq == 23) { return indexOf(24, freqNumbber, 8); } else { return indexOf(freq, freqNumbber, 8); } } void setChangingPageVariable(int menuPage, int row) { activeMenu = menuPage; rowItem = row; colItem = 0; changingPage = true; } // Showing row item with selecting symbol in circle way void showListMenu(int listSize, int rowItem, char **listMenu) { int before, after; if(rowItem == 0){ before = listSize - 1; after = rowItem + 1; }else if(rowItem == listSize - 1){ before = rowItem - 1; after = 0; }else{ before = rowItem - 1; after = rowItem + 1; } display.clearDisplay(); display.cp437(true); display.setTextSize(2); display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.println(F(""MENU'"")); display.drawFastHLine(0, 16, 128, WHITE); display.setCursor(8,20); display.write(24); display.setCursor(0,34); display.write(27); display.setCursor(16,34); display.write(26); display.setCursor(8,46); display.write(25); display.setCursor(26,25); display.setTextSize(1); // Draw 1X-scale text display.println(listMenu[before]); display.setCursor(34,38); display.print(listMenu[rowItem]); display.setCursor(26,51); display.println(listMenu[after]); display.display(); } void manageManualSelection(int selectedRow, int colItem) { if (selectedRow < 4) { waitingActionMenu(); manageReleSymbolAndAction(selectedRow, colItem); }else{ switch (selectedRow) { case 6: if (colItem == 0) { manualSendingEC = true; waitingActionMenu();} break; case 7: if (colItem == 0) { manualSendingPH = true; waitingActionMenu();} break; case 8: if (colItem == 0) { manualSendingTemperature = true; waitingActionMenu();} break; default: break; } } exitFromMenu(); } void showMonitoring(char *key, float value, float temperature){ display.clearDisplay(); display.setTextSize(2); display.setTextColor(WHITE ); // Draw white text display.setCursor(0,0); // Start at top-left corner display.println(F(""Monitoring"")); display.drawFastHLine(0, 16, 128, WHITE); display.setCursor(0,28); display.setTextSize(1); // Draw 1X-scale text display.print(F(""Temperature: "")); display.print(temperature); display.print(F("" "")); display.cp437(true); display.write(167); display.println(F(""C"")); display.setCursor(0,45); display.print(key); display.print(F("": "")); display.println(value); display.fillRect(80, 50, 40, 20, WHITE); display.setTextColor(INVERSE); // Draw INVERSE text display.setCursor(88,53); display.println(F(""Exit"")); display.display(); } void exitFromMenu() { rowItem = 0, colItem = 0, rowItemMainMenu = 0, rowItemManualMenu = 0, rowItemSettingMenu = 0; menuOnOff = false; showReleSymbol(); } // Managing the cursor to move inside the menu void manageMenuCursors(int keyPad, int menuSize, int minCol, int maxCol) { switch (keyPad) { case 1: if (colItem != maxCol - 1) { colItem++; } break; case 2: if (colItem != minCol) { colItem--; } break; case 3: if (rowItem == 0) { rowItem = menuSize - 1; } else { rowItem--; } break; case 4: if (rowItem == menuSize - 1) { rowItem = 0; } else { rowItem++; } break; default: break; } } //Showing menu page where there are the options to choose void yesOrNoSelection(int selectedItem, int rowNumber, int idMenu, char **listMenu){ display.clearDisplay(); display.setTextSize(2); display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.println(F(""CHOICE"")); display.drawFastHLine(0, 16, 128, WHITE); if(selectedItem == 0){ showFillButton(13, 43, 36, 21, 14, ""YES""); showVoidButton(60, 43, 36, 21, 67, ""NO""); }else{ showVoidButton(13, 43, 36, 21, 14, ""YES""); showFillButton(60, 43, 36, 21, 67, ""NO""); } if(idMenu == 4 && rowNumber < 4){ showYesNoDispaly(""turn on the "", listMenu, rowNumber); }else if (idMenu == 5){ showYesNoDispaly(""activate "", listMenu, rowNumber); }else if (idMenu == 9){ showYesNoDispaly(""enable "", listMenu, rowNumber); }else if (idMenu == 10){ display.setCursor(1,20); display.setTextSize(1); // Normal 1:1 pixel scale if (rowNumber == 10) { showSendingActivation(config.onOffTemperatureSending); } else if (rowNumber == 11) { showSendingActivation(config.onOffECSending); } else if (rowNumber == 12) { showSendingActivation(config.onOffPhSending); } display.println(F(""?"")); }else{ showYesNoDispaly("" "", listMenu, rowNumber); } display.display(); } void showYesNoDispaly(String verb, char **listMenu, int rowNumber){ display.setCursor(1,20); display.setTextSize(1); // Normal 1:1 pixel scale display.println(F(""Would you like to"")); display.print(verb); display.print(listMenu[rowNumber]); display.println(F(""?"")); } void showVoidButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, String text){ display.drawRect(x0, y0, x1, y1, WHITE); display.setTextColor(WHITE); // Draw INVERSE text display.setCursor(x2, y0 + 3); display.println(text); } void showFillButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t x2, String text){ display.fillRect(x0, y0, x1, y1, WHITE); display.setTextColor(INVERSE); display.setCursor(x2, y0 + 3); display.println(text); } //Used to get the right sensor status void showSendingActivation(bool item) { if (item) { display.print(F(""It is activete "")); display.print(F(""would you like to deactivate"")); } else { display.print(F(""It is inactive "")); display.print(F(""would you like to activate"")); } } //Showing connection status on screen void connectionStatusPage(char* connStatus) { display.clearDisplay(); display.setTextSize(2); display.setCursor(0,0); display.println(F(""Connection"")); display.println(F(""status: "")); display.println(connStatus); display.display(); delay(2000); } //Waiting animation void waitingActionMenu() { display.clearDisplay(); display.setTextSize(2); display.setCursor(20,0); display.println(waitingString); delay(1000); drawroundrect(); delay(1000); display.clearDisplay(); display.setTextSize(2); display.setCursor(10,30); display.println(F(""Done!!!"")); display.display(); delay(1000); // display.drawRect(10, 28, 94, 20, WHITE); // display.cp437(true); // for (int i = 0; i < 10; i++) { // display.setCursor(10 + (i*9), 30); // display.write(178); // display.display(); // delay(4000 / 10); // } } //Check if the becklight of the screen should be on or off. //if keyPad is different from zero, it will turn on the light, set the screenBeckLightOnOff //variable 'true' and will set _timerLightDisplay with the same timerOfLight's parameter //value. When screenBeckLightOnOff is true and _timerLightDisplay is different from zero or //one, this value will count back until _timerLightDisplay will be equal to one in order //to turn off screen backlight and to set screenBeckLightOnOff to false. void checkScreenBeckLight(int keyPad) { if (keyPad != code[6]) { screenBeckLightOnOff = true; display.ssd1306_command(SSD1306_DISPLAYON); _timerLightDisplay = timerOfLight; } else if (screenBeckLightOnOff && _timerLightDisplay == 1) { display.ssd1306_command(SSD1306_DISPLAYOFF); screenBeckLightOnOff = false; _timerLightDisplay--; } else if (screenBeckLightOnOff) { _timerLightDisplay--; } else { return ; } } // Show the rele symbols on screen void showReleSymbol() { display.clearDisplay(); for (int p = 0; p < numRele; p++) { if (releSymbol[p]==0){ display.drawCircle(70 + p*12, 55, 5, WHITE); }else{ display.fillCircle(70 + p*12, 55, 5, INVERSE); } } display.display(); } void showLightsTimerSetting() { oraEMinTemp[0] = config.startHour; oraEMinTemp[1] = config.startMinutes; oraEMinTemp[2] = config.endHour; oraEMinTemp[3] = config.endMinutes; display.clearDisplay(); display.setTextSize(2); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.println(F(""TIMER"")); display.drawFastHLine(0, 16, 128, WHITE); display.setTextSize(1); display.setCursor(0, 21); display.print(F(""Start Timer: "")); showStringNumber(75, 21, config.startHour); display.setCursor(87, 21); display.print(F("":"")); showStringNumber(92, 21, config.startMinutes); display.setCursor(0, 35); display.print(F(""End Timer: "")); showStringNumber(75, 35, config.endHour); display.setCursor (87, 35); display.print(F("":"")); showStringNumber(92, 35, config.endMinutes); foo(); display.display(); } void showWebRateSending() { display.clearDisplay(); display.setTextSize(2); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.println(F(""WEB RATES"")); display.drawFastHLine(0, 16, 128, WHITE); display.setTextSize(1); display.setCursor(0, 19); display.print(F(""Temperature: "")); if (config.freqUpdateWebTemperature == 23) { showStringNumber(75, 20, 1); } else { showStringNumber(75, 20, 24 / config.freqUpdateWebTemperature); } display.setCursor(0, 30); display.print(F(""EC/TDS: "")); if (config.freqUpdateWebEC == 23) { showStringNumber(75, 30, 1); } else { showStringNumber(75, 30, 24 / config.freqUpdateWebEC); } display.setCursor(0, 40); display.print(F(""PH: "")); if (config.freqUpdateWebPH == 23) { showStringNumber(75, 40, 1); } else { showStringNumber(75, 40, 24 / config.freqUpdateWebPH); } foo(); display.display(); } void foo(){ display.setCursor(18,55); display.print(F(""BACK"")); display.setCursor(88,55); display.print(F(""SET"")); display.setTextSize(2); display.setCursor(5,52); display.write(27); display.setCursor(108,52); display.write(26); } void showActualTemperatureRange() { temperatureMinAndMaxTemp[0] = config.tempMin; temperatureMinAndMaxTemp[1] = config.tempMax; display.clearDisplay(); display.setTextSize(2); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.print(F(""RANGE"")); display.print(F("" "")); display.cp437(true); display.write(167); display.println(F(""C"")); display.drawFastHLine(0, 16, 128, WHITE); display.setTextSize(1); display.setCursor(0, 21); display.print(F(""Min degrees: "")); showStringNumber(75, 21, config.tempMin); display.print(F("" "")); display.write(167); display.println(F(""C"")); display.setCursor(0, 35); display.print(F(""Max degrees: "")); showStringNumber(75, 35, config.tempMax); display.print(F("" "")); display.write(167); display.println(F(""C"")); foo(); display.display(); } void showStringNumber(byte i, byte j, int number) { display.setCursor(i, j); if (number < 10) { display.print(F(""0"")); display.setCursor(i + 6, j); display.print(number); } else { display.print(number); } } void showTime() { oraEMinTimeClockTemp[0] = RTC.now().hour(); oraEMinTimeClockTemp[1] = RTC.now().minute(); // Serial.println(RTC.now().hour()); // Serial.println(RTC.now().minute()); // Serial.println(oraEMinTimeClockTemp[0]); // Serial.println(oraEMinTimeClockTemp[1]); display.clearDisplay(); display.setTextSize(2); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.println(F(""TIME"")); display.drawFastHLine(0, 16, 128, WHITE); display.setTextSize(1); display.setCursor(0, 21); display.print(F(""Current time: "")); showStringNumber(45, 35, oraEMinTimeClockTemp[0]); //display.setCursor (57, 35); display.print(F("":"")); showStringNumber(62, 35, oraEMinTimeClockTemp[1]); foo(); display.display(); } void showDate() { dateTemp[0] = RTC.now().day(); dateTemp[1] = RTC.now().month(); dateTemp[2] = RTC.now().year(); Serial.println( RTC.now().day()); Serial.println( RTC.now().month()); Serial.println(dateTemp[0]); Serial.println( dateTemp[1]); Serial.println( dateTemp[2]); Serial.println(RTC.now().year()); display.clearDisplay(); display.setTextSize(2); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.println(F(""DATA"")); display.drawFastHLine(0, 16, 128, WHITE); display.setTextSize(1); display.setCursor(0, 21); display.print(F(""Current Data: "")); showStringNumber(35, 35, dateTemp[0]); display.print(F(""/"")); showStringNumber(52, 35, dateTemp[1]); display.print(F(""/"")); showStringNumber(71, 35, dateTemp[2]); foo(); display.display(); } //Managing the cursor to manage the updating frequence per item void showManageFreqSetting(int row, int t, int e, int p) { display.clearDisplay(); display.setTextSize(2); display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.println(F(""SET RATES"")); display.cp437(true); display.drawFastHLine(0, 16, 128, WHITE); display.setCursor(2,20); display.write(24); display.setCursor(2,40); display.write(25); display.setTextSize(1); display.setCursor(16, 19); display.print(F(""Temperature: "")); display.setCursor(102, 19); display.print(24 / freqNumbber[t]); display.setCursor(16, 29); display.print(F(""EC/TDS: "")); display.setCursor(102, 29); display.print(24 / freqNumbber[e]); display.setCursor(16, 38); display.print(F(""PH: "")); display.setCursor(102, 38); display.print(24 / freqNumbber[p]); if(row == 0){ display.setTextSize(2); display.setCursor(90,16); display.write(27); display.setCursor(114,16); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if(row == 1){ display.setTextSize(2); display.setCursor(90,26); display.write(27); display.setCursor(114,26); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if(row == 2){ display.setTextSize(2); display.setCursor(90,36); display.write(27); display.setCursor(114,36); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if(row == 3){ display.setTextSize(1); showFillButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if (row == 4){ display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showFillButton(73, 49, 31, 14, 78, ""EXIT""); } display.display(); } //Managing the cursor that selects the temperature to manage the termometer void showDateSetting(int row, int y, int m, int d) { display.clearDisplay(); display.setTextSize(2); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.print(F(""NEW DATA"")); display.cp437(true); display.drawFastHLine(0, 16, 128, WHITE); display.setCursor(2,20); display.write(24); display.setCursor(2,40); display.write(25); display.setTextSize(1); display.setCursor(16, 18); display.print(F(""Year: "")); showStringNumber(65, 18, y); display.setCursor(16, 27); display.print(F(""Month: "")); showStringNumber(65, 27, m); display.setCursor(16, 36); display.print(F(""Day: "")); showStringNumber(65, 36, d); if(row == 0){ display.setTextSize(2); display.setCursor(50,15); display.write(27); display.setCursor(91,15); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if(row == 1){ display.setTextSize(2); display.setCursor(52,24); display.write(27); display.setCursor(84,24); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if(row == 2){ display.setTextSize(2); display.setCursor(52,32); display.write(27); display.setCursor(84,32); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if(row == 3){ display.setTextSize(1); showFillButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if (row == 4){ display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showFillButton(73, 49, 31, 14, 78, ""EXIT""); } display.display(); } //Managing the cursor that selects the temperature to manage the termometer void showMinMaxRangeSetting(int row, String one, int h, int m) { display.clearDisplay(); display.setTextSize(2); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.print(F(""NEW RANGE"")); display.cp437(true); display.drawFastHLine(0, 16, 128, WHITE); display.setCursor(2,20); display.write(24); display.setCursor(2,40); display.write(25); display.setTextSize(1); display.setCursor(16, 21); display.print(F(""Min: "")); showStringNumber(58, 21, h); display.print(F("" "")); display.write(167); display.println(""C""); display.setCursor(16, 35); display.print(F(""Max: "")); showStringNumber(58, 36, m); display.print(F("" "")); display.write(167); display.println(""C""); if(row == 0){ display.setTextSize(2); display.setCursor(45,18); display.write(27); display.setCursor(90,18); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if(row == 1){ display.setTextSize(2); display.setCursor(45,30); display.write(27); display.setCursor(90,30); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); } else if(row == 2){ display.setTextSize(1); showFillButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if (row == 3){ display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showFillButton(73, 49, 31, 14, 78, ""EXIT""); } display.display(); } // Managing the cursor to move inside the time selection menu void manageLightsTimerSetting(int row, String one, String two, int h, int m) { display.clearDisplay(); display.setTextSize(2); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.print(one); display.print(F("" "")); display.print(two); display.cp437(true); display.drawFastHLine(0, 16, 128, WHITE); display.setCursor(2,20); display.write(24); display.setCursor(2,40); display.write(25); display.setTextSize(1); display.setCursor(16, 21); display.print(F(""Hours: "")); showStringNumber(82, 21, h); display.setCursor(16, 35); display.print(F(""Minutes: "")); showStringNumber(82, 35, m); if(row == 0){ display.setTextSize(2); display.setCursor(70,18); display.write(27); display.setCursor(96,18); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if(row == 1){ display.setTextSize(2); display.setCursor(70,32); display.write(27); display.setCursor(96,32); display.write(26); display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if(row == 2){ display.setTextSize(1); showFillButton(30, 49, 24, 14, 35, ""OK""); showVoidButton(73, 49, 31, 14, 78, ""EXIT""); }else if (row == 3){ display.setTextSize(1); showVoidButton(30, 49, 24, 14, 35, ""OK""); showFillButton(73, 49, 31, 14, 78, ""EXIT""); } display.display(); } void saveTimerLights(byte *oraEMin) { waitingActionMenu(); config.startHour = oraEMin[0]; config.startMinutes = oraEMin[1]; config.endHour = oraEMin[2]; config.endMinutes = oraEMin[3]; saveConfiguration(filename, config); exitFromMenu(); } void settingNewMinMaxTemperatureRange(int keyPad, String firstS, int row, byte *minMax) { if (row == 0) { minMax[0] = manageMenuRangeNumberCursors(keyPad, row , minMax[0], 0, 99); } else if (row == 1) { minMax[1] = manageMenuRangeNumberCursors(keyPad, row, minMax[1], 0, 99); } showMinMaxRangeSetting(row, firstS, minMax[0], minMax[1]); } void setFreqUpdateMenu(int keyPad, int row) { if (row == 0) { freqUpdateWebTemperatureIndex = manageMenuRangeNumberCursors(keyPad, row , freqUpdateWebTemperatureIndex, 0, 8); } else if (row == 1) { freqUpdateWebECIndex = manageMenuRangeNumberCursors(keyPad, row, freqUpdateWebECIndex, 0, 8); } else if (row == 2) { freqUpdateWebPHIndex = manageMenuRangeNumberCursors(keyPad, row, freqUpdateWebPHIndex, 0, 8); } showManageFreqSetting(row, freqUpdateWebTemperatureIndex, freqUpdateWebECIndex, freqUpdateWebPHIndex); } void shiftHourAndMinutesMenu(int i, int j, int keyPad, String firstS, String secondS, int row, byte *oraEMin) { if (row == 0) { oraEMin[i] = manageMenuRangeNumberCursors(keyPad, row , oraEMin[i], 0, 24); } else if (row == 1) { oraEMin[j] = manageMenuRangeNumberCursors(keyPad, row, oraEMin[j], 0, 60); } manageLightsTimerSetting(row, firstS, secondS, oraEMin[i], oraEMin[j]); } void setDateMenu(byte i, byte j, byte z, int keyPad, int row, int *date) { if (row == 0) { date[z] = manageYearRangeCursor(keyPad, row, date[z], 2060); } else if (row == 1) { date[j] = manageMenuRangeNumberCursors(keyPad, row, date[j], 1, 13); } else { date[i] = manageDayRangeCursor(keyPad, row , date[j], date[z], date[i]); } if (date[i] > _get_max_day(short(date[j] - 1), date[z])) { date[i] = _get_max_day(short(date[j] - 1), date[z]); } showDateSetting(row, date[z], date[j], date[i]); } // Managing the cursor to move inside the menu for year setting int manageYearRangeCursor(int keyPad, int row, int number, int maxItem) { switch (keyPad) { if (number == 0) { number = 2020; } case 1: if (number == maxItem - 1) { return 2020; } else { return ++number; } case 2: if (number == 2020) { return maxItem - 1; } else { return --number; } default: return number; } } // Managing the cursor to move inside the menu for year setting int manageDayRangeCursor(int keyPad, int row, int _month, int _year, int number) { switch (keyPad) { case 1: if (number == _get_max_day((short(_month - 1)), _year)) { return 1; } else { return ++number; } case 2: if (number == 1) { return _get_max_day(short(_month - 1), _year); } else { return --number; } default: return number; } } // Managing the cursor to move inside the menu int manageMenuRangeNumberCursors(int keyPad, int row, int number, int minItem, int maxItem) { switch (keyPad) { case 1: if (number == maxItem - 1) { return minItem; } else { return ++number; } case 2: if (number == minItem) { return maxItem - 1; } else { return --number; } default: return number; } } void saveTime(byte *oraEMin) { waitingActionMenu(); char timeBuffer[8]; char timeBufferSub[8]; char dateBuffer[11]; sprintf(timeBuffer, ""%02d:%02d:00"", oraEMinTimeClockTemp[0], oraEMinTimeClockTemp[1]); sprintf(dateBuffer, ""%s %02d %04d"", monthName(RTC.now().month()), RTC.now().day(), RTC.now().year()); substring(timeBuffer, timeBufferSub, 1,8); //Serial.print(""Time buffer: ""+String(dateBuffer)+ "" ""+String(timeBufferSub)); RTC.adjust(DateTime(dateBuffer, timeBufferSub)); exitFromMenu(); } // C substring function definition void substring(char s[], char sub[], int p, int l) { int c = 0; while (c < l) { sub[c] = s[p+c-1]; c++; } sub[c] = '\\0'; } short _get_max_day(short month, int year) { if (month == 0 || month == 2 || month == 4 || month == 6 || month == 7 || month == 9 || month == 11) return 31; else if (month == 3 || month == 5 || month == 8 || month == 10) return 30; else { if (year % 4 == 0) { if (year % 100 == 0) { if (year % 400 == 0) return 29; return 28; } return 29; } return 28; } } const char *monthName(int m) { switch (m) { case 1: return ""Jan""; case 2: return ""Feb""; case 3: return ""Mar""; case 4: return ""Apr""; case 5: return ""May""; case 6: return ""Jun""; case 7: return ""Jul""; case 8: return ""Aug""; case 9: return ""Sep""; case 10: return ""Oct""; case 11: return ""Nov""; case 12: return ""Dec""; default: return ""Jan""; } } void saveDate(int *date) { waitingActionMenu(); char dateBuffer[11]; char timeBuffer[8]; char timeBufferSub[8]; sprintf(timeBuffer, ""%02d:%02d:00"", RTC.now().hour(), RTC.now().minute()); sprintf(dateBuffer, ""%s %02d %04d"", monthName(date[1]), date[0], date[2]); substring(timeBuffer, timeBufferSub, 1,8); //Serial.println(""Date buffer: "" + String(dateBuffer) + "" "" + String(timeBuffer)); RTC.adjust(DateTime(dateBuffer, timeBufferSub)); exitFromMenu(); } void saveMinMaxTemperature(byte *minMax) { waitingActionMenu(); config.tempMin = minMax[0]; config.tempMax = minMax[1]; saveConfiguration(filename, config); exitFromMenu(); } void saveFreqUpdateWeb() { config.freqUpdateWebTemperature = setFreq(freqUpdateWebTemperatureIndex); config.freqUpdateWebEC = setFreq(freqUpdateWebECIndex); config.freqUpdateWebPH = setFreq(freqUpdateWebPHIndex); waitingActionMenu(); saveConfiguration(filename, config); exitFromMenu(); } int setFreq(int freq) { if (freq == 0) { return 23; } else { return freqNumbber[freq]; } } // Return index of element starting // Return -1 if element is not present int indexOf(const int elm, const int *ar, int ar_cnt) { // decreasing array count till it reaches negative // arr_cnt - 1 to 0 while (ar_cnt--) { // Return array index if current element equals provided element if (ar[ar_cnt] == elm) return ar_cnt; } // Element not present return -1; // Should never reaches this point } ",12165,False,2265.693294834097,median "; /* aes_asm.asm ; * ; * Copyright (C) 2006-2021 wolfSSL Inc. ; * ; * This file is part of wolfSSL. ; * ; * wolfSSL is free software; you can redistribute it and/or modify ; * it under the terms of the GNU General Public License as published by ; * the Free Software Foundation; either version 2 of the License, or ; * (at your option) any later version. ; * ; * wolfSSL 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 General Public License for more details. ; * ; * You should have received a copy of the GNU General Public License ; * along with this program; if not, write to the Free Software ; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA ; */ ; ; ; /* See Intel Advanced Encryption Standard (AES) Instructions Set White Paper ; * by Israel, Intel Mobility Group Development Center, Israel Shay Gueron ; */ ; ; /* This file is in intel asm syntax, see .s for at&t syntax */ ; fips_version = 0 IFDEF HAVE_FIPS fips_version = 1 IFDEF HAVE_FIPS_VERSION fips_version = HAVE_FIPS_VERSION ENDIF ENDIF IF fips_version GE 2 fipsAh SEGMENT ALIAS("".fipsA$h"") 'CODE' ELSE _text SEGMENT ENDIF ; /* ; AES_CBC_encrypt[const ,unsigned char*in ; unsigned ,char*out ; unsigned ,char ivec+16 ; unsigned ,long length ; const ,unsigned char*KS ; int nr] ; */ AES_CBC_encrypt PROC ;# parameter 1: rdi ;# parameter 2: rsi ;# parameter 3: rdx ;# parameter 4: rcx ;# parameter 5: r8 ;# parameter 6: r9d ; save rdi and rsi to rax and r11, restore before ret mov rax,rdi mov r11,rsi ; convert to what we had for att&t convention mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,[rsp+40] mov r9d,[rsp+48] mov r10,rcx shr rcx,4 shl r10,60 je NO_PARTS add rcx,1 NO_PARTS: sub rsi,16 movdqa xmm1,[rdx] LOOP_1: pxor xmm1,[rdi] pxor xmm1,[r8] add rsi,16 add rdi,16 cmp r9d,12 aesenc xmm1,16[r8] aesenc xmm1,32[r8] aesenc xmm1,48[r8] aesenc xmm1,64[r8] aesenc xmm1,80[r8] aesenc xmm1,96[r8] aesenc xmm1,112[r8] aesenc xmm1,128[r8] aesenc xmm1,144[r8] movdqa xmm2,160[r8] jb LAST cmp r9d,14 aesenc xmm1,160[r8] aesenc xmm1,176[r8] movdqa xmm2,192[r8] jb LAST aesenc xmm1,192[r8] aesenc xmm1,208[r8] movdqa xmm2,224[r8] LAST: dec rcx aesenclast xmm1,xmm2 movdqu [rsi],xmm1 jne LOOP_1 ; restore non volatile rdi,rsi mov rdi,rax mov rsi,r11 ret AES_CBC_encrypt ENDP ; void AES_CBC_decrypt_by4(const unsigned char* in, ; unsigned char* out, ; unsigned char ivec[16], ; unsigned long length, ; const unsigned char* KS, ; int nr) AES_CBC_decrypt_by4 PROC ; parameter 1: rdi ; parameter 2: rsi ; parameter 3: rdx ; parameter 4: rcx ; parameter 5: r8 ; parameter 6: r9d ; save rdi and rsi to rax and r11, restore before ret mov rax, rdi mov r11, rsi ; convert to what we had for att&t convention mov rdi, rcx mov rsi, rdx mov rdx, r8 mov rcx,r9 mov r8, [rsp+40] mov r9d, [rsp+48] ; on microsoft xmm6-xmm15 are non volatile, ; let's save on stack and restore at end sub rsp, 8+8*16 ; 8 = align stack , 8 xmm6-12,15 16 bytes each movdqa [rsp+0], xmm6 movdqa [rsp+16], xmm7 movdqa [rsp+32], xmm8 movdqa [rsp+48], xmm9 movdqa [rsp+64], xmm10 movdqa [rsp+80], xmm11 movdqa [rsp+96], xmm12 movdqa [rsp+112], xmm15 ; back to our original code, more or less mov r10, rcx shr rcx, 4 shl r10, 60 je DNO_PARTS_4 add rcx, 1 DNO_PARTS_4: mov r10, rcx shl r10, 62 shr r10, 62 shr rcx, 2 movdqu xmm5, [rdx] je DREMAINDER_4 sub rsi, 64 DLOOP_4: movdqu xmm1, [rdi] movdqu xmm2, 16[rdi] movdqu xmm3, 32[rdi] movdqu xmm4, 48[rdi] movdqa xmm6, xmm1 movdqa xmm7, xmm2 movdqa xmm8, xmm3 movdqa xmm15, xmm4 movdqa xmm9, [r8] movdqa xmm10, 16[r8] movdqa xmm11, 32[r8] movdqa xmm12, 48[r8] pxor xmm1, xmm9 pxor xmm2, xmm9 pxor xmm3, xmm9 pxor xmm4, xmm9 aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 aesdec xmm1, xmm11 aesdec xmm2, xmm11 aesdec xmm3, xmm11 aesdec xmm4, xmm11 aesdec xmm1, xmm12 aesdec xmm2, xmm12 aesdec xmm3, xmm12 aesdec xmm4, xmm12 movdqa xmm9, 64[r8] movdqa xmm10, 80[r8] movdqa xmm11, 96[r8] movdqa xmm12, 112[r8] aesdec xmm1, xmm9 aesdec xmm2, xmm9 aesdec xmm3, xmm9 aesdec xmm4, xmm9 aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 aesdec xmm1, xmm11 aesdec xmm2, xmm11 aesdec xmm3, xmm11 aesdec xmm4, xmm11 aesdec xmm1, xmm12 aesdec xmm2, xmm12 aesdec xmm3, xmm12 aesdec xmm4, xmm12 movdqa xmm9, 128[r8] movdqa xmm10, 144[r8] movdqa xmm11, 160[r8] cmp r9d, 12 aesdec xmm1, xmm9 aesdec xmm2, xmm9 aesdec xmm3, xmm9 aesdec xmm4, xmm9 aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 jb DLAST_4 movdqa xmm9, 160[r8] movdqa xmm10, 176[r8] movdqa xmm11, 192[r8] cmp r9d, 14 aesdec xmm1, xmm9 aesdec xmm2, xmm9 aesdec xmm3, xmm9 aesdec xmm4, xmm9 aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 jb DLAST_4 movdqa xmm9, 192[r8] movdqa xmm10, 208[r8] movdqa xmm11, 224[r8] aesdec xmm1, xmm9 aesdec xmm2, xmm9 aesdec xmm3, xmm9 aesdec xmm4, xmm9 aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 DLAST_4: add rdi, 64 add rsi, 64 dec rcx aesdeclast xmm1, xmm11 aesdeclast xmm2, xmm11 aesdeclast xmm3, xmm11 aesdeclast xmm4, xmm11 pxor xmm1, xmm5 pxor xmm2, xmm6 pxor xmm3, xmm7 pxor xmm4, xmm8 movdqu [rsi], xmm1 movdqu 16[rsi], xmm2 movdqu 32[rsi], xmm3 movdqu 48[rsi], xmm4 movdqa xmm5, xmm15 jne DLOOP_4 add rsi, 64 DREMAINDER_4: cmp r10, 0 je DEND_4 DLOOP_4_2: movdqu xmm1, [rdi] movdqa xmm15, xmm1 add rdi, 16 pxor xmm1, [r8] movdqu xmm2, 160[r8] cmp r9d, 12 aesdec xmm1, 16[r8] aesdec xmm1, 32[r8] aesdec xmm1, 48[r8] aesdec xmm1, 64[r8] aesdec xmm1, 80[r8] aesdec xmm1, 96[r8] aesdec xmm1, 112[r8] aesdec xmm1, 128[r8] aesdec xmm1, 144[r8] jb DLAST_4_2 movdqu xmm2, 192[r8] cmp r9d, 14 aesdec xmm1, 160[r8] aesdec xmm1, 176[r8] jb DLAST_4_2 movdqu xmm2, 224[r8] aesdec xmm1, 192[r8] aesdec xmm1, 208[r8] DLAST_4_2: aesdeclast xmm1, xmm2 pxor xmm1, xmm5 movdqa xmm5, xmm15 movdqu [rsi], xmm1 add rsi, 16 dec r10 jne DLOOP_4_2 DEND_4: ; restore non volatile rdi,rsi mov rdi, rax mov rsi, r11 ; restore non volatile xmms from stack movdqa xmm6, [rsp+0] movdqa xmm7, [rsp+16] movdqa xmm8, [rsp+32] movdqa xmm9, [rsp+48] movdqa xmm10, [rsp+64] movdqa xmm11, [rsp+80] movdqa xmm12, [rsp+96] movdqa xmm15, [rsp+112] add rsp, 8+8*16 ; 8 = align stack , 8 xmm6-12,15 16 bytes each ret AES_CBC_decrypt_by4 ENDP ; void AES_CBC_decrypt_by6(const unsigned char *in, ; unsigned char *out, ; unsigned char ivec[16], ; unsigned long length, ; const unsigned char *KS, ; int nr) AES_CBC_decrypt_by6 PROC ; parameter 1: rdi - in ; parameter 2: rsi - out ; parameter 3: rdx - ivec ; parameter 4: rcx - length ; parameter 5: r8 - KS ; parameter 6: r9d - nr ; save rdi and rsi to rax and r11, restore before ret mov rax, rdi mov r11, rsi ; convert to what we had for att&t convention mov rdi, rcx mov rsi, rdx mov rdx, r8 mov rcx, r9 mov r8, [rsp+40] mov r9d, [rsp+48] ; on microsoft xmm6-xmm15 are non volatile, ; let's save on stack and restore at end sub rsp, 8+9*16 ; 8 = align stack , 9 xmm6-14 16 bytes each movdqa [rsp+0], xmm6 movdqa [rsp+16], xmm7 movdqa [rsp+32], xmm8 movdqa [rsp+48], xmm9 movdqa [rsp+64], xmm10 movdqa [rsp+80], xmm11 movdqa [rsp+96], xmm12 movdqa [rsp+112], xmm13 movdqa [rsp+128], xmm14 ; back to our original code, more or less mov r10, rcx shr rcx, 4 shl r10, 60 je DNO_PARTS_6 add rcx, 1 DNO_PARTS_6: mov r12, rax mov r13, rdx mov r14, rbx mov rdx, 0 mov rax, rcx mov rbx, 6 div rbx mov rcx, rax mov r10, rdx mov rax, r12 mov rdx, r13 mov rbx, r14 cmp rcx, 0 movdqu xmm7, [rdx] je DREMAINDER_6 sub rsi, 96 DLOOP_6: movdqu xmm1, [rdi] movdqu xmm2, 16[rdi] movdqu xmm3, 32[rdi] movdqu xmm4, 48[rdi] movdqu xmm5, 64[rdi] movdqu xmm6, 80[rdi] movdqa xmm8, [r8] movdqa xmm9, 16[r8] movdqa xmm10, 32[r8] movdqa xmm11, 48[r8] pxor xmm1, xmm8 pxor xmm2, xmm8 pxor xmm3, xmm8 pxor xmm4, xmm8 pxor xmm5, xmm8 pxor xmm6, xmm8 aesdec xmm1, xmm9 aesdec xmm2, xmm9 aesdec xmm3, xmm9 aesdec xmm4, xmm9 aesdec xmm5, xmm9 aesdec xmm6, xmm9 aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 aesdec xmm5, xmm10 aesdec xmm6, xmm10 aesdec xmm1, xmm11 aesdec xmm2, xmm11 aesdec xmm3, xmm11 aesdec xmm4, xmm11 aesdec xmm5, xmm11 aesdec xmm6, xmm11 movdqa xmm8, 64[r8] movdqa xmm9, 80[r8] movdqa xmm10, 96[r8] movdqa xmm11, 112[r8] aesdec xmm1, xmm8 aesdec xmm2, xmm8 aesdec xmm3, xmm8 aesdec xmm4, xmm8 aesdec xmm5, xmm8 aesdec xmm6, xmm8 aesdec xmm1, xmm9 aesdec xmm2, xmm9 aesdec xmm3, xmm9 aesdec xmm4, xmm9 aesdec xmm5, xmm9 aesdec xmm6, xmm9 aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 aesdec xmm5, xmm10 aesdec xmm6, xmm10 aesdec xmm1, xmm11 aesdec xmm2, xmm11 aesdec xmm3, xmm11 aesdec xmm4, xmm11 aesdec xmm5, xmm11 aesdec xmm6, xmm11 movdqa xmm8, 128[r8] movdqa xmm9, 144[r8] movdqa xmm10, 160[r8] cmp r9d, 12 aesdec xmm1, xmm8 aesdec xmm2, xmm8 aesdec xmm3, xmm8 aesdec xmm4, xmm8 aesdec xmm5, xmm8 aesdec xmm6, xmm8 aesdec xmm1, xmm9 aesdec xmm2, xmm9 aesdec xmm3, xmm9 aesdec xmm4, xmm9 aesdec xmm5, xmm9 aesdec xmm6, xmm9 jb DLAST_6 movdqa xmm8, 160[r8] movdqa xmm9, 176[r8] movdqa xmm10, 192[r8] cmp r9d, 14 aesdec xmm1, xmm8 aesdec xmm2, xmm8 aesdec xmm3, xmm8 aesdec xmm4, xmm8 aesdec xmm5, xmm8 aesdec xmm6, xmm8 aesdec xmm1, xmm9 aesdec xmm2, xmm9 aesdec xmm3, xmm9 aesdec xmm4, xmm9 aesdec xmm5, xmm9 aesdec xmm6, xmm9 jb DLAST_6 movdqa xmm8, 192[r8] movdqa xmm9, 208[r8] movdqa xmm10, 224[r8] aesdec xmm1, xmm8 aesdec xmm2, xmm8 aesdec xmm3, xmm8 aesdec xmm4, xmm8 aesdec xmm5, xmm8 aesdec xmm6, xmm8 aesdec xmm1, xmm9 aesdec xmm2, xmm9 aesdec xmm3, xmm9 aesdec xmm4, xmm9 aesdec xmm5, xmm9 aesdec xmm6, xmm9 DLAST_6: add rsi, 96 aesdeclast xmm1, xmm10 aesdeclast xmm2, xmm10 aesdeclast xmm3, xmm10 aesdeclast xmm4, xmm10 aesdeclast xmm5, xmm10 aesdeclast xmm6, xmm10 movdqu xmm8, [rdi] movdqu xmm9, 16[rdi] movdqu xmm10, 32[rdi] movdqu xmm11, 48[rdi] movdqu xmm12, 64[rdi] movdqu xmm13, 80[rdi] pxor xmm1, xmm7 pxor xmm2, xmm8 pxor xmm3, xmm9 pxor xmm4, xmm10 pxor xmm5, xmm11 pxor xmm6, xmm12 movdqu xmm7, xmm13 movdqu [rsi], xmm1 movdqu 16[rsi], xmm2 movdqu 32[rsi], xmm3 movdqu 48[rsi], xmm4 movdqu 64[rsi], xmm5 movdqu 80[rsi], xmm6 add rdi, 96 dec rcx jne DLOOP_6 add rsi, 96 DREMAINDER_6: cmp r10, 0 je DEND_6 DLOOP_6_2: movdqu xmm1, [rdi] movdqa xmm10, xmm1 add rdi, 16 pxor xmm1, [r8] movdqu xmm2, 160[r8] cmp r9d, 12 aesdec xmm1, 16[r8] aesdec xmm1, 32[r8] aesdec xmm1, 48[r8] aesdec xmm1, 64[r8] aesdec xmm1, 80[r8] aesdec xmm1, 96[r8] aesdec xmm1, 112[r8] aesdec xmm1, 128[r8] aesdec xmm1, 144[r8] jb DLAST_6_2 movdqu xmm2, 192[r8] cmp r9d, 14 aesdec xmm1, 160[r8] aesdec xmm1, 176[r8] jb DLAST_6_2 movdqu xmm2, 224[r8] aesdec xmm1, 192[r8] aesdec xmm1, 208[r8] DLAST_6_2: aesdeclast xmm1, xmm2 pxor xmm1, xmm7 movdqa xmm7, xmm10 movdqu [rsi], xmm1 add rsi, 16 dec r10 jne DLOOP_6_2 DEND_6: ; restore non volatile rdi,rsi mov rdi, rax mov rsi, r11 ; restore non volatile xmms from stack movdqa xmm6, [rsp+0] movdqa xmm7, [rsp+16] movdqa xmm8, [rsp+32] movdqa xmm9, [rsp+48] movdqa xmm10, [rsp+64] movdqa xmm11, [rsp+80] movdqa xmm12, [rsp+96] movdqa xmm13, [rsp+112] movdqa xmm14, [rsp+128] add rsp, 8+9*16 ; 8 = align stack , 9 xmm6-14 16 bytes each ret AES_CBC_decrypt_by6 ENDP ; void AES_CBC_decrypt_by8(const unsigned char *in, ; unsigned char *out, ; unsigned char ivec[16], ; unsigned long length, ; const unsigned char *KS, ; int nr) AES_CBC_decrypt_by8 PROC ; parameter 1: rdi - in ; parameter 2: rsi - out ; parameter 3: rdx - ivec ; parameter 4: rcx - length ; parameter 5: r8 - KS ; parameter 6: r9d - nr ; save rdi and rsi to rax and r11, restore before ret mov rax, rdi mov r11, rsi ; convert to what we had for att&t convention mov rdi, rcx mov rsi, rdx mov rdx, r8 mov rcx,r9 mov r8, [rsp+40] mov r9d, [rsp+48] ; on microsoft xmm6-xmm15 are non volatile, ; let's save on stack and restore at end sub rsp, 8+8*16 ; 8 = align stack , 8 xmm6-13 16 bytes each movdqa [rsp+0], xmm6 movdqa [rsp+16], xmm7 movdqa [rsp+32], xmm8 movdqa [rsp+48], xmm9 movdqa [rsp+64], xmm10 movdqa [rsp+80], xmm11 movdqa [rsp+96], xmm12 movdqa [rsp+112], xmm13 ; back to our original code, more or less mov r10, rcx shr rcx, 4 shl r10, 60 je DNO_PARTS_8 add rcx, 1 DNO_PARTS_8: mov r10, rcx shl r10, 61 shr r10, 61 shr rcx, 3 movdqu xmm9, [rdx] je DREMAINDER_8 sub rsi, 128 DLOOP_8: movdqu xmm1, [rdi] movdqu xmm2, 16[rdi] movdqu xmm3, 32[rdi] movdqu xmm4, 48[rdi] movdqu xmm5, 64[rdi] movdqu xmm6, 80[rdi] movdqu xmm7, 96[rdi] movdqu xmm8, 112[rdi] movdqa xmm10, [r8] movdqa xmm11, 16[r8] movdqa xmm12, 32[r8] movdqa xmm13, 48[r8] pxor xmm1, xmm10 pxor xmm2, xmm10 pxor xmm3, xmm10 pxor xmm4, xmm10 pxor xmm5, xmm10 pxor xmm6, xmm10 pxor xmm7, xmm10 pxor xmm8, xmm10 aesdec xmm1, xmm11 aesdec xmm2, xmm11 aesdec xmm3, xmm11 aesdec xmm4, xmm11 aesdec xmm5, xmm11 aesdec xmm6, xmm11 aesdec xmm7, xmm11 aesdec xmm8, xmm11 aesdec xmm1, xmm12 aesdec xmm2, xmm12 aesdec xmm3, xmm12 aesdec xmm4, xmm12 aesdec xmm5, xmm12 aesdec xmm6, xmm12 aesdec xmm7, xmm12 aesdec xmm8, xmm12 aesdec xmm1, xmm13 aesdec xmm2, xmm13 aesdec xmm3, xmm13 aesdec xmm4, xmm13 aesdec xmm5, xmm13 aesdec xmm6, xmm13 aesdec xmm7, xmm13 aesdec xmm8, xmm13 movdqa xmm10, 64[r8] movdqa xmm11, 80[r8] movdqa xmm12, 96[r8] movdqa xmm13, 112[r8] aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 aesdec xmm5, xmm10 aesdec xmm6, xmm10 aesdec xmm7, xmm10 aesdec xmm8, xmm10 aesdec xmm1, xmm11 aesdec xmm2, xmm11 aesdec xmm3, xmm11 aesdec xmm4, xmm11 aesdec xmm5, xmm11 aesdec xmm6, xmm11 aesdec xmm7, xmm11 aesdec xmm8, xmm11 aesdec xmm1, xmm12 aesdec xmm2, xmm12 aesdec xmm3, xmm12 aesdec xmm4, xmm12 aesdec xmm5, xmm12 aesdec xmm6, xmm12 aesdec xmm7, xmm12 aesdec xmm8, xmm12 aesdec xmm1, xmm13 aesdec xmm2, xmm13 aesdec xmm3, xmm13 aesdec xmm4, xmm13 aesdec xmm5, xmm13 aesdec xmm6, xmm13 aesdec xmm7, xmm13 aesdec xmm8, xmm13 movdqa xmm10, 128[r8] movdqa xmm11, 144[r8] movdqa xmm12, 160[r8] cmp r9d, 12 aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 aesdec xmm5, xmm10 aesdec xmm6, xmm10 aesdec xmm7, xmm10 aesdec xmm8, xmm10 aesdec xmm1, xmm11 aesdec xmm2, xmm11 aesdec xmm3, xmm11 aesdec xmm4, xmm11 aesdec xmm5, xmm11 aesdec xmm6, xmm11 aesdec xmm7, xmm11 aesdec xmm8, xmm11 jb DLAST_8 movdqa xmm10, 160[r8] movdqa xmm11, 176[r8] movdqa xmm12, 192[r8] cmp r9d, 14 aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 aesdec xmm5, xmm10 aesdec xmm6, xmm10 aesdec xmm7, xmm10 aesdec xmm8, xmm10 aesdec xmm1, xmm11 aesdec xmm2, xmm11 aesdec xmm3, xmm11 aesdec xmm4, xmm11 aesdec xmm5, xmm11 aesdec xmm6, xmm11 aesdec xmm7, xmm11 aesdec xmm8, xmm11 jb DLAST_8 movdqa xmm10, 192[r8] movdqa xmm11, 208[r8] movdqa xmm12, 224[r8] aesdec xmm1, xmm10 aesdec xmm2, xmm10 aesdec xmm3, xmm10 aesdec xmm4, xmm10 aesdec xmm5, xmm10 aesdec xmm6, xmm10 aesdec xmm7, xmm10 aesdec xmm8, xmm10 aesdec xmm1, xmm11 aesdec xmm2, xmm11 aesdec xmm3, xmm11 aesdec xmm4, xmm11 aesdec xmm5, xmm11 aesdec xmm6, xmm11 aesdec xmm7, xmm11 aesdec xmm8, xmm11 DLAST_8: add rsi, 128 aesdeclast xmm1, xmm12 aesdeclast xmm2, xmm12 aesdeclast xmm3, xmm12 aesdeclast xmm4, xmm12 aesdeclast xmm5, xmm12 aesdeclast xmm6, xmm12 aesdeclast xmm7, xmm12 aesdeclast xmm8, xmm12 movdqu xmm10, [rdi] movdqu xmm11, 16[rdi] movdqu xmm12, 32[rdi] movdqu xmm13, 48[rdi] pxor xmm1, xmm9 pxor xmm2, xmm10 pxor xmm3, xmm11 pxor xmm4, xmm12 pxor xmm5, xmm13 movdqu xmm10, 64[rdi] movdqu xmm11, 80[rdi] movdqu xmm12, 96[rdi] movdqu xmm9, 112[rdi] pxor xmm6, xmm10 pxor xmm7, xmm11 pxor xmm8, xmm12 movdqu [rsi], xmm1 movdqu 16[rsi], xmm2 movdqu 32[rsi], xmm3 movdqu 48[rsi], xmm4 movdqu 64[rsi], xmm5 movdqu 80[rsi], xmm6 movdqu 96[rsi], xmm7 movdqu 112[rsi], xmm8 add rdi, 128 dec rcx jne DLOOP_8 add rsi, 128 DREMAINDER_8: cmp r10, 0 je DEND_8 DLOOP_8_2: movdqu xmm1, [rdi] movdqa xmm10, xmm1 add rdi, 16 pxor xmm1, [r8] movdqu xmm2, 160[r8] cmp r9d, 12 aesdec xmm1, 16[r8] aesdec xmm1, 32[r8] aesdec xmm1, 48[r8] aesdec xmm1, 64[r8] aesdec xmm1, 80[r8] aesdec xmm1, 96[r8] aesdec xmm1, 112[r8] aesdec xmm1, 128[r8] aesdec xmm1, 144[r8] jb DLAST_8_2 movdqu xmm2, 192[r8] cmp r9d, 14 aesdec xmm1, 160[r8] aesdec xmm1, 176[r8] jb DLAST_8_2 movdqu xmm2, 224[r8] aesdec xmm1, 192[r8] aesdec xmm1, 208[r8] DLAST_8_2: aesdeclast xmm1, xmm2 pxor xmm1, xmm9 movdqa xmm9, xmm10 movdqu [rsi], xmm1 add rsi, 16 dec r10 jne DLOOP_8_2 DEND_8: ; restore non volatile rdi,rsi mov rdi, rax mov rsi, r11 ; restore non volatile xmms from stack movdqa xmm6, [rsp+0] movdqa xmm7, [rsp+16] movdqa xmm8, [rsp+32] movdqa xmm9, [rsp+48] movdqa xmm10, [rsp+64] movdqa xmm11, [rsp+80] movdqa xmm12, [rsp+96] movdqa xmm13, [rsp+112] add rsp, 8+8*16 ; 8 = align stack , 8 xmm6-13 16 bytes each ret AES_CBC_decrypt_by8 ENDP ; /* ; AES_ECB_encrypt[const ,unsigned char*in ; unsigned ,char*out ; unsigned ,long length ; const ,unsigned char*KS ; int nr] ; */ ; . globl AES_ECB_encrypt AES_ECB_encrypt PROC ;# parameter 1: rdi ;# parameter 2: rsi ;# parameter 3: rdx ;# parameter 4: rcx ;# parameter 5: r8d ; save rdi and rsi to rax and r11, restore before ret mov rax,rdi mov r11,rsi ; convert to what we had for att&t convention mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8d,[rsp+40] ; on microsoft xmm6-xmm15 are non volaitle, let's save on stack and restore at end sub rsp,8+4*16 ; 8 = align stack , 4 xmm9-12, 16 bytes each movdqa [rsp+0], xmm9 movdqa [rsp+16], xmm10 movdqa [rsp+32], xmm11 movdqa [rsp+48], xmm12 mov r10,rdx shr rdx,4 shl r10,60 je EECB_NO_PARTS_4 add rdx,1 EECB_NO_PARTS_4: mov r10,rdx shl r10,62 shr r10,62 shr rdx,2 je EECB_REMAINDER_4 sub rsi,64 EECB_LOOP_4: movdqu xmm1,[rdi] movdqu xmm2,16[rdi] movdqu xmm3,32[rdi] movdqu xmm4,48[rdi] movdqa xmm9,[rcx] movdqa xmm10,16[rcx] movdqa xmm11,32[rcx] movdqa xmm12,48[rcx] pxor xmm1,xmm9 pxor xmm2,xmm9 pxor xmm3,xmm9 pxor xmm4,xmm9 aesenc xmm1,xmm10 aesenc xmm2,xmm10 aesenc xmm3,xmm10 aesenc xmm4,xmm10 aesenc xmm1,xmm11 aesenc xmm2,xmm11 aesenc xmm3,xmm11 aesenc xmm4,xmm11 aesenc xmm1,xmm12 aesenc xmm2,xmm12 aesenc xmm3,xmm12 aesenc xmm4,xmm12 movdqa xmm9,64[rcx] movdqa xmm10,80[rcx] movdqa xmm11,96[rcx] movdqa xmm12,112[rcx] aesenc xmm1,xmm9 aesenc xmm2,xmm9 aesenc xmm3,xmm9 aesenc xmm4,xmm9 aesenc xmm1,xmm10 aesenc xmm2,xmm10 aesenc xmm3,xmm10 aesenc xmm4,xmm10 aesenc xmm1,xmm11 aesenc xmm2,xmm11 aesenc xmm3,xmm11 aesenc xmm4,xmm11 aesenc xmm1,xmm12 aesenc xmm2,xmm12 aesenc xmm3,xmm12 aesenc xmm4,xmm12 movdqa xmm9,128[rcx] movdqa xmm10,144[rcx] movdqa xmm11,160[rcx] cmp r8d,12 aesenc xmm1,xmm9 aesenc xmm2,xmm9 aesenc xmm3,xmm9 aesenc xmm4,xmm9 aesenc xmm1,xmm10 aesenc xmm2,xmm10 aesenc xmm3,xmm10 aesenc xmm4,xmm10 jb EECB_LAST_4 movdqa xmm9,160[rcx] movdqa xmm10,176[rcx] movdqa xmm11,192[rcx] cmp r8d,14 aesenc xmm1,xmm9 aesenc xmm2,xmm9 aesenc xmm3,xmm9 aesenc xmm4,xmm9 aesenc xmm1,xmm10 aesenc xmm2,xmm10 aesenc xmm3,xmm10 aesenc xmm4,xmm10 jb EECB_LAST_4 movdqa xmm9,192[rcx] movdqa xmm10,208[rcx] movdqa xmm11,224[rcx] aesenc xmm1,xmm9 aesenc xmm2,xmm9 aesenc xmm3,xmm9 aesenc xmm4,xmm9 aesenc xmm1,xmm10 aesenc xmm2,xmm10 aesenc xmm3,xmm10 aesenc xmm4,xmm10 EECB_LAST_4: add rdi,64 add rsi,64 dec rdx aesenclast xmm1,xmm11 aesenclast xmm2,xmm11 aesenclast xmm3,xmm11 aesenclast xmm4,xmm11 movdqu [rsi],xmm1 movdqu 16[rsi],xmm2 movdqu 32[rsi],xmm3 movdqu 48[rsi],xmm4 jne EECB_LOOP_4 add rsi,64 EECB_REMAINDER_4: cmp r10,0 je EECB_END_4 EECB_LOOP_4_2: movdqu xmm1,[rdi] add rdi,16 pxor xmm1,[rcx] movdqu xmm2,160[rcx] aesenc xmm1,16[rcx] aesenc xmm1,32[rcx] aesenc xmm1,48[rcx] aesenc xmm1,64[rcx] aesenc xmm1,80[rcx] aesenc xmm1,96[rcx] aesenc xmm1,112[rcx] aesenc xmm1,128[rcx] aesenc xmm1,144[rcx] cmp r8d,12 jb EECB_LAST_4_2 movdqu xmm2,192[rcx] aesenc xmm1,160[rcx] aesenc xmm1,176[rcx] cmp r8d,14 jb EECB_LAST_4_2 movdqu xmm2,224[rcx] aesenc xmm1,192[rcx] aesenc xmm1,208[rcx] EECB_LAST_4_2: aesenclast xmm1,xmm2 movdqu [rsi],xmm1 add rsi,16 dec r10 jne EECB_LOOP_4_2 EECB_END_4: ; restore non volatile rdi,rsi mov rdi,rax mov rsi,r11 ; restore non volatile xmms from stack movdqa xmm9, [rsp+0] movdqa xmm10, [rsp+16] movdqa xmm11, [rsp+32] movdqa xmm12, [rsp+48] add rsp,8+4*16 ; 8 = align stack , 4 xmm9-12 16 bytes each ret AES_ECB_encrypt ENDP ; /* ; AES_ECB_decrypt[const ,unsigned char*in ; unsigned ,char*out ; unsigned ,long length ; const ,unsigned char*KS ; int nr] ; */ ; . globl AES_ECB_decrypt AES_ECB_decrypt PROC ;# parameter 1: rdi ;# parameter 2: rsi ;# parameter 3: rdx ;# parameter 4: rcx ;# parameter 5: r8d ; save rdi and rsi to rax and r11, restore before ret mov rax,rdi mov r11,rsi ; convert to what we had for att&t convention mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8d,[rsp+40] ; on microsoft xmm6-xmm15 are non volaitle, let's save on stack and restore at end sub rsp,8+4*16 ; 8 = align stack , 4 xmm9-12, 16 bytes each movdqa [rsp+0], xmm9 movdqa [rsp+16], xmm10 movdqa [rsp+32], xmm11 movdqa [rsp+48], xmm12 mov r10,rdx shr rdx,4 shl r10,60 je DECB_NO_PARTS_4 add rdx,1 DECB_NO_PARTS_4: mov r10,rdx shl r10,62 shr r10,62 shr rdx,2 je DECB_REMAINDER_4 sub rsi,64 DECB_LOOP_4: movdqu xmm1,[rdi] movdqu xmm2,16[rdi] movdqu xmm3,32[rdi] movdqu xmm4,48[rdi] movdqa xmm9,[rcx] movdqa xmm10,16[rcx] movdqa xmm11,32[rcx] movdqa xmm12,48[rcx] pxor xmm1,xmm9 pxor xmm2,xmm9 pxor xmm3,xmm9 pxor xmm4,xmm9 aesdec xmm1,xmm10 aesdec xmm2,xmm10 aesdec xmm3,xmm10 aesdec xmm4,xmm10 aesdec xmm1,xmm11 aesdec xmm2,xmm11 aesdec xmm3,xmm11 aesdec xmm4,xmm11 aesdec xmm1,xmm12 aesdec xmm2,xmm12 aesdec xmm3,xmm12 aesdec xmm4,xmm12 movdqa xmm9,64[rcx] movdqa xmm10,80[rcx] movdqa xmm11,96[rcx] movdqa xmm12,112[rcx] aesdec xmm1,xmm9 aesdec xmm2,xmm9 aesdec xmm3,xmm9 aesdec xmm4,xmm9 aesdec xmm1,xmm10 aesdec xmm2,xmm10 aesdec xmm3,xmm10 aesdec xmm4,xmm10 aesdec xmm1,xmm11 aesdec xmm2,xmm11 aesdec xmm3,xmm11 aesdec xmm4,xmm11 aesdec xmm1,xmm12 aesdec xmm2,xmm12 aesdec xmm3,xmm12 aesdec xmm4,xmm12 movdqa xmm9,128[rcx] movdqa xmm10,144[rcx] movdqa xmm11,160[rcx] cmp r8d,12 aesdec xmm1,xmm9 aesdec xmm2,xmm9 aesdec xmm3,xmm9 aesdec xmm4,xmm9 aesdec xmm1,xmm10 aesdec xmm2,xmm10 aesdec xmm3,xmm10 aesdec xmm4,xmm10 jb DECB_LAST_4 movdqa xmm9,160[rcx] movdqa xmm10,176[rcx] movdqa xmm11,192[rcx] cmp r8d,14 aesdec xmm1,xmm9 aesdec xmm2,xmm9 aesdec xmm3,xmm9 aesdec xmm4,xmm9 aesdec xmm1,xmm10 aesdec xmm2,xmm10 aesdec xmm3,xmm10 aesdec xmm4,xmm10 jb DECB_LAST_4 movdqa xmm9,192[rcx] movdqa xmm10,208[rcx] movdqa xmm11,224[rcx] aesdec xmm1,xmm9 aesdec xmm2,xmm9 aesdec xmm3,xmm9 aesdec xmm4,xmm9 aesdec xmm1,xmm10 aesdec xmm2,xmm10 aesdec xmm3,xmm10 aesdec xmm4,xmm10 DECB_LAST_4: add rdi,64 add rsi,64 dec rdx aesdeclast xmm1,xmm11 aesdeclast xmm2,xmm11 aesdeclast xmm3,xmm11 aesdeclast xmm4,xmm11 movdqu [rsi],xmm1 movdqu 16[rsi],xmm2 movdqu 32[rsi],xmm3 movdqu 48[rsi],xmm4 jne DECB_LOOP_4 add rsi,64 DECB_REMAINDER_4: cmp r10,0 je DECB_END_4 DECB_LOOP_4_2: movdqu xmm1,[rdi] add rdi,16 pxor xmm1,[rcx] movdqu xmm2,160[rcx] cmp r8d,12 aesdec xmm1,16[rcx] aesdec xmm1,32[rcx] aesdec xmm1,48[rcx] aesdec xmm1,64[rcx] aesdec xmm1,80[rcx] aesdec xmm1,96[rcx] aesdec xmm1,112[rcx] aesdec xmm1,128[rcx] aesdec xmm1,144[rcx] jb DECB_LAST_4_2 cmp r8d,14 movdqu xmm2,192[rcx] aesdec xmm1,160[rcx] aesdec xmm1,176[rcx] jb DECB_LAST_4_2 movdqu xmm2,224[rcx] aesdec xmm1,192[rcx] aesdec xmm1,208[rcx] DECB_LAST_4_2: aesdeclast xmm1,xmm2 movdqu [rsi],xmm1 add rsi,16 dec r10 jne DECB_LOOP_4_2 DECB_END_4: ; restore non volatile rdi,rsi mov rdi,rax mov rsi,r11 ; restore non volatile xmms from stack movdqa xmm9, [rsp+0] movdqa xmm10, [rsp+16] movdqa xmm11, [rsp+32] movdqa xmm12, [rsp+48] add rsp,8+4*16 ; 8 = align stack , 4 xmm9-12 16 bytes each ret AES_ECB_decrypt ENDP ; /* ; void ,AES_128_Key_Expansion[const unsigned char*userkey ; unsigned char*key_schedule]/ ; */ ; . align 16,0x90 ; . globl AES_128_Key_Expansion AES_128_Key_Expansion PROC ;# parameter 1: rdi ;# parameter 2: rsi ; save rdi and rsi to rax and r11, restore before ret mov rax,rdi mov r11,rsi ; convert to what we had for att&t convention mov rdi,rcx mov rsi,rdx mov dword ptr 240[rsi],10 movdqu xmm1,[rdi] movdqa [rsi],xmm1 ASSISTS: aeskeygenassist xmm2,xmm1,1 call PREPARE_ROUNDKEY_128 movdqa 16[rsi],xmm1 aeskeygenassist xmm2,xmm1,2 call PREPARE_ROUNDKEY_128 movdqa 32[rsi],xmm1 aeskeygenassist xmm2,xmm1,4 call PREPARE_ROUNDKEY_128 movdqa 48[rsi],xmm1 aeskeygenassist xmm2,xmm1,8 call PREPARE_ROUNDKEY_128 movdqa 64[rsi],xmm1 aeskeygenassist xmm2,xmm1,16 call PREPARE_ROUNDKEY_128 movdqa 80[rsi],xmm1 aeskeygenassist xmm2,xmm1,32 call PREPARE_ROUNDKEY_128 movdqa 96[rsi],xmm1 aeskeygenassist xmm2,xmm1,64 call PREPARE_ROUNDKEY_128 movdqa 112[rsi],xmm1 aeskeygenassist xmm2,xmm1,80h call PREPARE_ROUNDKEY_128 movdqa 128[rsi],xmm1 aeskeygenassist xmm2,xmm1,1bh call PREPARE_ROUNDKEY_128 movdqa 144[rsi],xmm1 aeskeygenassist xmm2,xmm1,36h call PREPARE_ROUNDKEY_128 movdqa 160[rsi],xmm1 ; restore non volatile rdi,rsi mov rdi,rax mov rsi,r11 ret PREPARE_ROUNDKEY_128: pshufd xmm2,xmm2,255 movdqa xmm3,xmm1 pslldq xmm3,4 pxor xmm1,xmm3 pslldq xmm3,4 pxor xmm1,xmm3 pslldq xmm3,4 pxor xmm1,xmm3 pxor xmm1,xmm2 ret AES_128_Key_Expansion ENDP ; /* ; void ,AES_192_Key_Expansion[const unsigned char*userkey ; unsigned char*key] ; */ ; . globl AES_192_Key_Expansion AES_192_Key_Expansion PROC ;# parameter 1: rdi ;# parameter 2: rsi ; save rdi and rsi to rax and r11, restore before ret mov rax,rdi mov r11,rsi ; convert to what we had for att&t convention mov rdi,rcx mov rsi,rdx ; on microsoft xmm6-xmm15 are non volaitle, let's save on stack and restore at end sub rsp,8+1*16 ; 8 = align stack , 1 xmm6, 16 bytes each movdqa [rsp+0], xmm6 movdqu xmm1,[rdi] movq xmm3,qword ptr 16[rdi] movdqa [rsi],xmm1 movdqa xmm5,xmm3 aeskeygenassist xmm2,xmm3,1h call PREPARE_ROUNDKEY_192 shufpd xmm5,xmm1,0 movdqa 16[rsi],xmm5 movdqa xmm6,xmm1 shufpd xmm6,xmm3,1 movdqa 32[rsi],xmm6 aeskeygenassist xmm2,xmm3,2h call PREPARE_ROUNDKEY_192 movdqa 48[rsi],xmm1 movdqa xmm5,xmm3 aeskeygenassist xmm2,xmm3,4h call PREPARE_ROUNDKEY_192 shufpd xmm5,xmm1,0 movdqa 64[rsi],xmm5 movdqa xmm6,xmm1 shufpd xmm6,xmm3,1 movdqa 80[rsi],xmm6 aeskeygenassist xmm2,xmm3,8h call PREPARE_ROUNDKEY_192 movdqa 96[rsi],xmm1 movdqa xmm5,xmm3 aeskeygenassist xmm2,xmm3,10h call PREPARE_ROUNDKEY_192 shufpd xmm5,xmm1,0 movdqa 112[rsi],xmm5 movdqa xmm6,xmm1 shufpd xmm6,xmm3,1 movdqa 128[rsi],xmm6 aeskeygenassist xmm2,xmm3,20h call PREPARE_ROUNDKEY_192 movdqa 144[rsi],xmm1 movdqa xmm5,xmm3 aeskeygenassist xmm2,xmm3,40h call PREPARE_ROUNDKEY_192 shufpd xmm5,xmm1,0 movdqa 160[rsi],xmm5 movdqa xmm6,xmm1 shufpd xmm6,xmm3,1 movdqa 176[rsi],xmm6 aeskeygenassist xmm2,xmm3,80h call PREPARE_ROUNDKEY_192 movdqa 192[rsi],xmm1 movdqa 208[rsi],xmm3 ; restore non volatile rdi,rsi mov rdi,rax mov rsi,r11 ; restore non volatile xmms from stack movdqa xmm6, [rsp+0] add rsp,8+1*16 ; 8 = align stack , 1 xmm6 16 bytes each ret PREPARE_ROUNDKEY_192: pshufd xmm2,xmm2,55h movdqu xmm4,xmm1 pslldq xmm4,4 pxor xmm1,xmm4 pslldq xmm4,4 pxor xmm1,xmm4 pslldq xmm4,4 pxor xmm1,xmm4 pxor xmm1,xmm2 pshufd xmm2,xmm1,0ffh movdqu xmm4,xmm3 pslldq xmm4,4 pxor xmm3,xmm4 pxor xmm3,xmm2 ret AES_192_Key_Expansion ENDP ; /* ; void ,AES_256_Key_Expansion[const unsigned char*userkey ; unsigned char*key] ; */ ; . globl AES_256_Key_Expansion AES_256_Key_Expansion PROC ;# parameter 1: rdi ;# parameter 2: rsi ; save rdi and rsi to rax and r11, restore before ret mov rax,rdi mov r11,rsi ; convert to what we had for att&t convention mov rdi,rcx mov rsi,rdx movdqu xmm1,[rdi] movdqu xmm3,16[rdi] movdqa [rsi],xmm1 movdqa 16[rsi],xmm3 aeskeygenassist xmm2,xmm3,1h call MAKE_RK256_a movdqa 32[rsi],xmm1 aeskeygenassist xmm2,xmm1,0h call MAKE_RK256_b movdqa 48[rsi],xmm3 aeskeygenassist xmm2,xmm3,2h call MAKE_RK256_a movdqa 64[rsi],xmm1 aeskeygenassist xmm2,xmm1,0h call MAKE_RK256_b movdqa 80[rsi],xmm3 aeskeygenassist xmm2,xmm3,4h call MAKE_RK256_a movdqa 96[rsi],xmm1 aeskeygenassist xmm2,xmm1,0h call MAKE_RK256_b movdqa 112[rsi],xmm3 aeskeygenassist xmm2,xmm3,8h call MAKE_RK256_a movdqa 128[rsi],xmm1 aeskeygenassist xmm2,xmm1,0h call MAKE_RK256_b movdqa 144[rsi],xmm3 aeskeygenassist xmm2,xmm3,10h call MAKE_RK256_a movdqa 160[rsi],xmm1 aeskeygenassist xmm2,xmm1,0h call MAKE_RK256_b movdqa 176[rsi],xmm3 aeskeygenassist xmm2,xmm3,20h call MAKE_RK256_a movdqa 192[rsi],xmm1 aeskeygenassist xmm2,xmm1,0h call MAKE_RK256_b movdqa 208[rsi],xmm3 aeskeygenassist xmm2,xmm3,40h call MAKE_RK256_a movdqa 224[rsi],xmm1 ; restore non volatile rdi,rsi mov rdi,rax mov rsi,r11 ret AES_256_Key_Expansion ENDP MAKE_RK256_a: pshufd xmm2,xmm2,0ffh movdqa xmm4,xmm1 pslldq xmm4,4 pxor xmm1,xmm4 pslldq xmm4,4 pxor xmm1,xmm4 pslldq xmm4,4 pxor xmm1,xmm4 pxor xmm1,xmm2 ret MAKE_RK256_b: pshufd xmm2,xmm2,0aah movdqa xmm4,xmm3 pslldq xmm4,4 pxor xmm3,xmm4 pslldq xmm4,4 pxor xmm3,xmm4 pslldq xmm4,4 pxor xmm3,xmm4 pxor xmm3,xmm2 ret IF fips_version GE 2 fipsAh ENDS ELSE _text ENDS ENDIF END ",16226,True,4109.2525853175575,median "TITLE ../openssl/crypto/ripemd/asm/rmd-586.asm IF @Version LT 800 ECHO MASM version 8.00 or later is strongly recommended. ENDIF .586 .MODEL FLAT OPTION DOTNAME IF @Version LT 800 .text$ SEGMENT PAGE 'CODE' ELSE .text$ SEGMENT ALIGN(64) 'CODE' ENDIF ALIGN 16 _ripemd160_block_asm_data_order PROC PUBLIC $L_ripemd160_block_asm_data_order_begin:: mov edx,DWORD PTR 4[esp] mov eax,DWORD PTR 8[esp] push esi mov ecx,DWORD PTR [edx] push edi mov esi,DWORD PTR 4[edx] push ebp mov edi,DWORD PTR 8[edx] push ebx sub esp,108 $L000start: ; mov ebx,DWORD PTR [eax] mov ebp,DWORD PTR 4[eax] mov DWORD PTR [esp],ebx mov DWORD PTR 4[esp],ebp mov ebx,DWORD PTR 8[eax] mov ebp,DWORD PTR 12[eax] mov DWORD PTR 8[esp],ebx mov DWORD PTR 12[esp],ebp mov ebx,DWORD PTR 16[eax] mov ebp,DWORD PTR 20[eax] mov DWORD PTR 16[esp],ebx mov DWORD PTR 20[esp],ebp mov ebx,DWORD PTR 24[eax] mov ebp,DWORD PTR 28[eax] mov DWORD PTR 24[esp],ebx mov DWORD PTR 28[esp],ebp mov ebx,DWORD PTR 32[eax] mov ebp,DWORD PTR 36[eax] mov DWORD PTR 32[esp],ebx mov DWORD PTR 36[esp],ebp mov ebx,DWORD PTR 40[eax] mov ebp,DWORD PTR 44[eax] mov DWORD PTR 40[esp],ebx mov DWORD PTR 44[esp],ebp mov ebx,DWORD PTR 48[eax] mov ebp,DWORD PTR 52[eax] mov DWORD PTR 48[esp],ebx mov DWORD PTR 52[esp],ebp mov ebx,DWORD PTR 56[eax] mov ebp,DWORD PTR 60[eax] mov DWORD PTR 56[esp],ebx mov DWORD PTR 60[esp],ebp mov eax,edi mov ebx,DWORD PTR 12[edx] mov ebp,DWORD PTR 16[edx] ; 0 xor eax,ebx mov edx,DWORD PTR [esp] xor eax,esi add ecx,edx rol edi,10 add ecx,eax mov eax,esi rol ecx,11 add ecx,ebp ; 1 xor eax,edi mov edx,DWORD PTR 4[esp] xor eax,ecx add ebp,eax mov eax,ecx rol esi,10 add ebp,edx xor eax,esi rol ebp,14 add ebp,ebx ; 2 mov edx,DWORD PTR 8[esp] xor eax,ebp add ebx,edx rol ecx,10 add ebx,eax mov eax,ebp rol ebx,15 add ebx,edi ; 3 xor eax,ecx mov edx,DWORD PTR 12[esp] xor eax,ebx add edi,eax mov eax,ebx rol ebp,10 add edi,edx xor eax,ebp rol edi,12 add edi,esi ; 4 mov edx,DWORD PTR 16[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,5 add esi,ecx ; 5 xor eax,ebx mov edx,DWORD PTR 20[esp] xor eax,esi add ecx,eax mov eax,esi rol edi,10 add ecx,edx xor eax,edi rol ecx,8 add ecx,ebp ; 6 mov edx,DWORD PTR 24[esp] xor eax,ecx add ebp,edx rol esi,10 add ebp,eax mov eax,ecx rol ebp,7 add ebp,ebx ; 7 xor eax,esi mov edx,DWORD PTR 28[esp] xor eax,ebp add ebx,eax mov eax,ebp rol ecx,10 add ebx,edx xor eax,ecx rol ebx,9 add ebx,edi ; 8 mov edx,DWORD PTR 32[esp] xor eax,ebx add edi,edx rol ebp,10 add edi,eax mov eax,ebx rol edi,11 add edi,esi ; 9 xor eax,ebp mov edx,DWORD PTR 36[esp] xor eax,edi add esi,eax mov eax,edi rol ebx,10 add esi,edx xor eax,ebx rol esi,13 add esi,ecx ; 10 mov edx,DWORD PTR 40[esp] xor eax,esi add ecx,edx rol edi,10 add ecx,eax mov eax,esi rol ecx,14 add ecx,ebp ; 11 xor eax,edi mov edx,DWORD PTR 44[esp] xor eax,ecx add ebp,eax mov eax,ecx rol esi,10 add ebp,edx xor eax,esi rol ebp,15 add ebp,ebx ; 12 mov edx,DWORD PTR 48[esp] xor eax,ebp add ebx,edx rol ecx,10 add ebx,eax mov eax,ebp rol ebx,6 add ebx,edi ; 13 xor eax,ecx mov edx,DWORD PTR 52[esp] xor eax,ebx add edi,eax mov eax,ebx rol ebp,10 add edi,edx xor eax,ebp rol edi,7 add edi,esi ; 14 mov edx,DWORD PTR 56[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,9 add esi,ecx ; 15 xor eax,ebx mov edx,DWORD PTR 60[esp] xor eax,esi add ecx,eax mov eax,-1 rol edi,10 add ecx,edx mov edx,DWORD PTR 28[esp] rol ecx,8 add ecx,ebp ; 16 add ebp,edx mov edx,esi sub eax,ecx and edx,ecx and eax,edi or edx,eax mov eax,DWORD PTR 16[esp] rol esi,10 lea ebp,DWORD PTR 1518500249[edx*1+ebp] mov edx,-1 rol ebp,7 add ebp,ebx ; 17 add ebx,eax mov eax,ecx sub edx,ebp and eax,ebp and edx,esi or eax,edx mov edx,DWORD PTR 52[esp] rol ecx,10 lea ebx,DWORD PTR 1518500249[eax*1+ebx] mov eax,-1 rol ebx,6 add ebx,edi ; 18 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 4[esp] rol ebp,10 lea edi,DWORD PTR 1518500249[edx*1+edi] mov edx,-1 rol edi,8 add edi,esi ; 19 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 40[esp] rol ebx,10 lea esi,DWORD PTR 1518500249[eax*1+esi] mov eax,-1 rol esi,13 add esi,ecx ; 20 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 24[esp] rol edi,10 lea ecx,DWORD PTR 1518500249[edx*1+ecx] mov edx,-1 rol ecx,11 add ecx,ebp ; 21 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,DWORD PTR 60[esp] rol esi,10 lea ebp,DWORD PTR 1518500249[eax*1+ebp] mov eax,-1 rol ebp,9 add ebp,ebx ; 22 add ebx,edx mov edx,ecx sub eax,ebp and edx,ebp and eax,esi or edx,eax mov eax,DWORD PTR 12[esp] rol ecx,10 lea ebx,DWORD PTR 1518500249[edx*1+ebx] mov edx,-1 rol ebx,7 add ebx,edi ; 23 add edi,eax mov eax,ebp sub edx,ebx and eax,ebx and edx,ecx or eax,edx mov edx,DWORD PTR 48[esp] rol ebp,10 lea edi,DWORD PTR 1518500249[eax*1+edi] mov eax,-1 rol edi,15 add edi,esi ; 24 add esi,edx mov edx,ebx sub eax,edi and edx,edi and eax,ebp or edx,eax mov eax,DWORD PTR [esp] rol ebx,10 lea esi,DWORD PTR 1518500249[edx*1+esi] mov edx,-1 rol esi,7 add esi,ecx ; 25 add ecx,eax mov eax,edi sub edx,esi and eax,esi and edx,ebx or eax,edx mov edx,DWORD PTR 36[esp] rol edi,10 lea ecx,DWORD PTR 1518500249[eax*1+ecx] mov eax,-1 rol ecx,12 add ecx,ebp ; 26 add ebp,edx mov edx,esi sub eax,ecx and edx,ecx and eax,edi or edx,eax mov eax,DWORD PTR 20[esp] rol esi,10 lea ebp,DWORD PTR 1518500249[edx*1+ebp] mov edx,-1 rol ebp,15 add ebp,ebx ; 27 add ebx,eax mov eax,ecx sub edx,ebp and eax,ebp and edx,esi or eax,edx mov edx,DWORD PTR 8[esp] rol ecx,10 lea ebx,DWORD PTR 1518500249[eax*1+ebx] mov eax,-1 rol ebx,9 add ebx,edi ; 28 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 56[esp] rol ebp,10 lea edi,DWORD PTR 1518500249[edx*1+edi] mov edx,-1 rol edi,11 add edi,esi ; 29 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 44[esp] rol ebx,10 lea esi,DWORD PTR 1518500249[eax*1+esi] mov eax,-1 rol esi,7 add esi,ecx ; 30 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 32[esp] rol edi,10 lea ecx,DWORD PTR 1518500249[edx*1+ecx] mov edx,-1 rol ecx,13 add ecx,ebp ; 31 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1518500249[eax*1+ebp] sub edx,ecx rol ebp,12 add ebp,ebx ; 32 mov eax,DWORD PTR 12[esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[edx*1+ebx] sub eax,ebp rol ebx,11 add ebx,edi ; 33 mov edx,DWORD PTR 40[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1859775393[eax*1+edi] sub edx,ebx rol edi,13 add edi,esi ; 34 mov eax,DWORD PTR 56[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1859775393[edx*1+esi] sub eax,edi rol esi,6 add esi,ecx ; 35 mov edx,DWORD PTR 16[esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1859775393[eax*1+ecx] sub edx,esi rol ecx,7 add ecx,ebp ; 36 mov eax,DWORD PTR 36[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1859775393[edx*1+ebp] sub eax,ecx rol ebp,14 add ebp,ebx ; 37 mov edx,DWORD PTR 60[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[eax*1+ebx] sub edx,ebp rol ebx,9 add ebx,edi ; 38 mov eax,DWORD PTR 32[esp] or edx,ebx add edi,eax xor edx,ecx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 1859775393[edx*1+edi] sub eax,ebx rol edi,13 add edi,esi ; 39 mov edx,DWORD PTR 4[esp] or eax,edi add esi,edx xor eax,ebp mov edx,-1 rol ebx,10 lea esi,DWORD PTR 1859775393[eax*1+esi] sub edx,edi rol esi,15 add esi,ecx ; 40 mov eax,DWORD PTR 8[esp] or edx,esi add ecx,eax xor edx,ebx mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1859775393[edx*1+ecx] sub eax,esi rol ecx,14 add ecx,ebp ; 41 mov edx,DWORD PTR 28[esp] or eax,ecx add ebp,edx xor eax,edi mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1859775393[eax*1+ebp] sub edx,ecx rol ebp,8 add ebp,ebx ; 42 mov eax,DWORD PTR [esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[edx*1+ebx] sub eax,ebp rol ebx,13 add ebx,edi ; 43 mov edx,DWORD PTR 24[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1859775393[eax*1+edi] sub edx,ebx rol edi,6 add edi,esi ; 44 mov eax,DWORD PTR 52[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1859775393[edx*1+esi] sub eax,edi rol esi,5 add esi,ecx ; 45 mov edx,DWORD PTR 44[esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1859775393[eax*1+ecx] sub edx,esi rol ecx,12 add ecx,ebp ; 46 mov eax,DWORD PTR 20[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1859775393[edx*1+ebp] sub eax,ecx rol ebp,7 add ebp,ebx ; 47 mov edx,DWORD PTR 48[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1859775393[eax*1+ebx] mov eax,ecx rol ebx,5 add ebx,edi ; 48 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 4[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,11 add edi,esi ; 49 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 36[esp] rol ebx,10 lea esi,DWORD PTR 2400959708[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,12 add esi,ecx ; 50 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 44[esp] rol edi,10 lea ecx,DWORD PTR 2400959708[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,14 add ecx,ebp ; 51 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 40[esp] rol esi,10 lea ebp,DWORD PTR 2400959708[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,15 add ebp,ebx ; 52 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR [esp] rol ecx,10 lea ebx,DWORD PTR 2400959708[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,14 add ebx,edi ; 53 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 32[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,15 add edi,esi ; 54 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 48[esp] rol ebx,10 lea esi,DWORD PTR 2400959708[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,9 add esi,ecx ; 55 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 16[esp] rol edi,10 lea ecx,DWORD PTR 2400959708[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,8 add ecx,ebp ; 56 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 52[esp] rol esi,10 lea ebp,DWORD PTR 2400959708[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,9 add ebp,ebx ; 57 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 12[esp] rol ecx,10 lea ebx,DWORD PTR 2400959708[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,14 add ebx,edi ; 58 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 28[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,5 add edi,esi ; 59 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 60[esp] rol ebx,10 lea esi,DWORD PTR 2400959708[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,6 add esi,ecx ; 60 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 56[esp] rol edi,10 lea ecx,DWORD PTR 2400959708[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,8 add ecx,ebp ; 61 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 20[esp] rol esi,10 lea ebp,DWORD PTR 2400959708[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,6 add ebp,ebx ; 62 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 24[esp] rol ecx,10 lea ebx,DWORD PTR 2400959708[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,5 add ebx,edi ; 63 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 8[esp] rol ebp,10 lea edi,DWORD PTR 2400959708[edx*1+edi] mov edx,-1 add edi,eax sub edx,ebp rol edi,12 add edi,esi ; 64 mov eax,DWORD PTR 16[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 2840853838[edx*1+esi] sub eax,ebx rol esi,9 add esi,ecx ; 65 mov edx,DWORD PTR [esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 2840853838[eax*1+ecx] sub edx,edi rol ecx,15 add ecx,ebp ; 66 mov eax,DWORD PTR 20[esp] or edx,esi add ebp,eax xor edx,ecx mov eax,-1 rol esi,10 lea ebp,DWORD PTR 2840853838[edx*1+ebp] sub eax,esi rol ebp,5 add ebp,ebx ; 67 mov edx,DWORD PTR 36[esp] or eax,ecx add ebx,edx xor eax,ebp mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 2840853838[eax*1+ebx] sub edx,ecx rol ebx,11 add ebx,edi ; 68 mov eax,DWORD PTR 28[esp] or edx,ebp add edi,eax xor edx,ebx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 2840853838[edx*1+edi] sub eax,ebp rol edi,6 add edi,esi ; 69 mov edx,DWORD PTR 48[esp] or eax,ebx add esi,edx xor eax,edi mov edx,-1 rol ebx,10 lea esi,DWORD PTR 2840853838[eax*1+esi] sub edx,ebx rol esi,8 add esi,ecx ; 70 mov eax,DWORD PTR 8[esp] or edx,edi add ecx,eax xor edx,esi mov eax,-1 rol edi,10 lea ecx,DWORD PTR 2840853838[edx*1+ecx] sub eax,edi rol ecx,13 add ecx,ebp ; 71 mov edx,DWORD PTR 40[esp] or eax,esi add ebp,edx xor eax,ecx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 2840853838[eax*1+ebp] sub edx,esi rol ebp,12 add ebp,ebx ; 72 mov eax,DWORD PTR 56[esp] or edx,ecx add ebx,eax xor edx,ebp mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 2840853838[edx*1+ebx] sub eax,ecx rol ebx,5 add ebx,edi ; 73 mov edx,DWORD PTR 4[esp] or eax,ebp add edi,edx xor eax,ebx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 2840853838[eax*1+edi] sub edx,ebp rol edi,12 add edi,esi ; 74 mov eax,DWORD PTR 12[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 2840853838[edx*1+esi] sub eax,ebx rol esi,13 add esi,ecx ; 75 mov edx,DWORD PTR 32[esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 2840853838[eax*1+ecx] sub edx,edi rol ecx,14 add ecx,ebp ; 76 mov eax,DWORD PTR 44[esp] or edx,esi add ebp,eax xor edx,ecx mov eax,-1 rol esi,10 lea ebp,DWORD PTR 2840853838[edx*1+ebp] sub eax,esi rol ebp,11 add ebp,ebx ; 77 mov edx,DWORD PTR 24[esp] or eax,ecx add ebx,edx xor eax,ebp mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 2840853838[eax*1+ebx] sub edx,ecx rol ebx,8 add ebx,edi ; 78 mov eax,DWORD PTR 60[esp] or edx,ebp add edi,eax xor edx,ebx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 2840853838[edx*1+edi] sub eax,ebp rol edi,5 add edi,esi ; 79 mov edx,DWORD PTR 52[esp] or eax,ebx add esi,edx xor eax,edi mov edx,DWORD PTR 128[esp] rol ebx,10 lea esi,DWORD PTR 2840853838[eax*1+esi] mov DWORD PTR 64[esp],ecx rol esi,6 add esi,ecx mov ecx,DWORD PTR [edx] mov DWORD PTR 68[esp],esi mov DWORD PTR 72[esp],edi mov esi,DWORD PTR 4[edx] mov DWORD PTR 76[esp],ebx mov edi,DWORD PTR 8[edx] mov DWORD PTR 80[esp],ebp mov ebx,DWORD PTR 12[edx] mov ebp,DWORD PTR 16[edx] ; 80 mov edx,-1 sub edx,ebx mov eax,DWORD PTR 20[esp] or edx,edi add ecx,eax xor edx,esi mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[edx*1+ecx] sub eax,edi rol ecx,8 add ecx,ebp ; 81 mov edx,DWORD PTR 56[esp] or eax,esi add ebp,edx xor eax,ecx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1352829926[eax*1+ebp] sub edx,esi rol ebp,9 add ebp,ebx ; 82 mov eax,DWORD PTR 28[esp] or edx,ecx add ebx,eax xor edx,ebp mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1352829926[edx*1+ebx] sub eax,ecx rol ebx,9 add ebx,edi ; 83 mov edx,DWORD PTR [esp] or eax,ebp add edi,edx xor eax,ebx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1352829926[eax*1+edi] sub edx,ebp rol edi,11 add edi,esi ; 84 mov eax,DWORD PTR 36[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1352829926[edx*1+esi] sub eax,ebx rol esi,13 add esi,ecx ; 85 mov edx,DWORD PTR 8[esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[eax*1+ecx] sub edx,edi rol ecx,15 add ecx,ebp ; 86 mov eax,DWORD PTR 44[esp] or edx,esi add ebp,eax xor edx,ecx mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1352829926[edx*1+ebp] sub eax,esi rol ebp,15 add ebp,ebx ; 87 mov edx,DWORD PTR 16[esp] or eax,ecx add ebx,edx xor eax,ebp mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1352829926[eax*1+ebx] sub edx,ecx rol ebx,5 add ebx,edi ; 88 mov eax,DWORD PTR 52[esp] or edx,ebp add edi,eax xor edx,ebx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 1352829926[edx*1+edi] sub eax,ebp rol edi,7 add edi,esi ; 89 mov edx,DWORD PTR 24[esp] or eax,ebx add esi,edx xor eax,edi mov edx,-1 rol ebx,10 lea esi,DWORD PTR 1352829926[eax*1+esi] sub edx,ebx rol esi,7 add esi,ecx ; 90 mov eax,DWORD PTR 60[esp] or edx,edi add ecx,eax xor edx,esi mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[edx*1+ecx] sub eax,edi rol ecx,8 add ecx,ebp ; 91 mov edx,DWORD PTR 32[esp] or eax,esi add ebp,edx xor eax,ecx mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1352829926[eax*1+ebp] sub edx,esi rol ebp,11 add ebp,ebx ; 92 mov eax,DWORD PTR 4[esp] or edx,ecx add ebx,eax xor edx,ebp mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1352829926[edx*1+ebx] sub eax,ecx rol ebx,14 add ebx,edi ; 93 mov edx,DWORD PTR 40[esp] or eax,ebp add edi,edx xor eax,ebx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1352829926[eax*1+edi] sub edx,ebp rol edi,14 add edi,esi ; 94 mov eax,DWORD PTR 12[esp] or edx,ebx add esi,eax xor edx,edi mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1352829926[edx*1+esi] sub eax,ebx rol esi,12 add esi,ecx ; 95 mov edx,DWORD PTR 48[esp] or eax,edi add ecx,edx xor eax,esi mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1352829926[eax*1+ecx] mov eax,edi rol ecx,6 add ecx,ebp ; 96 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 24[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,9 add ebp,ebx ; 97 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 44[esp] rol ecx,10 lea ebx,DWORD PTR 1548603684[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,13 add ebx,edi ; 98 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 12[esp] rol ebp,10 lea edi,DWORD PTR 1548603684[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,15 add edi,esi ; 99 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 28[esp] rol ebx,10 lea esi,DWORD PTR 1548603684[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,7 add esi,ecx ; 100 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR [esp] rol edi,10 lea ecx,DWORD PTR 1548603684[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,12 add ecx,ebp ; 101 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 52[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,8 add ebp,ebx ; 102 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 20[esp] rol ecx,10 lea ebx,DWORD PTR 1548603684[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,9 add ebx,edi ; 103 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 40[esp] rol ebp,10 lea edi,DWORD PTR 1548603684[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,11 add edi,esi ; 104 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 56[esp] rol ebx,10 lea esi,DWORD PTR 1548603684[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,7 add esi,ecx ; 105 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 60[esp] rol edi,10 lea ecx,DWORD PTR 1548603684[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,7 add ecx,ebp ; 106 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 32[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax mov eax,esi rol ebp,12 add ebp,ebx ; 107 sub edx,esi and eax,ebp and edx,ecx or edx,eax mov eax,DWORD PTR 48[esp] rol ecx,10 lea ebx,DWORD PTR 1548603684[edx*1+ebx] mov edx,-1 add ebx,eax mov eax,ecx rol ebx,7 add ebx,edi ; 108 sub edx,ecx and eax,ebx and edx,ebp or edx,eax mov eax,DWORD PTR 16[esp] rol ebp,10 lea edi,DWORD PTR 1548603684[edx*1+edi] mov edx,-1 add edi,eax mov eax,ebp rol edi,6 add edi,esi ; 109 sub edx,ebp and eax,edi and edx,ebx or edx,eax mov eax,DWORD PTR 36[esp] rol ebx,10 lea esi,DWORD PTR 1548603684[edx*1+esi] mov edx,-1 add esi,eax mov eax,ebx rol esi,15 add esi,ecx ; 110 sub edx,ebx and eax,esi and edx,edi or edx,eax mov eax,DWORD PTR 4[esp] rol edi,10 lea ecx,DWORD PTR 1548603684[edx*1+ecx] mov edx,-1 add ecx,eax mov eax,edi rol ecx,13 add ecx,ebp ; 111 sub edx,edi and eax,ecx and edx,esi or edx,eax mov eax,DWORD PTR 8[esp] rol esi,10 lea ebp,DWORD PTR 1548603684[edx*1+ebp] mov edx,-1 add ebp,eax sub edx,ecx rol ebp,11 add ebp,ebx ; 112 mov eax,DWORD PTR 60[esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1836072691[edx*1+ebx] sub eax,ebp rol ebx,9 add ebx,edi ; 113 mov edx,DWORD PTR 20[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1836072691[eax*1+edi] sub edx,ebx rol edi,7 add edi,esi ; 114 mov eax,DWORD PTR 4[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1836072691[edx*1+esi] sub eax,edi rol esi,15 add esi,ecx ; 115 mov edx,DWORD PTR 12[esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1836072691[eax*1+ecx] sub edx,esi rol ecx,11 add ecx,ebp ; 116 mov eax,DWORD PTR 28[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1836072691[edx*1+ebp] sub eax,ecx rol ebp,8 add ebp,ebx ; 117 mov edx,DWORD PTR 56[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,-1 rol ecx,10 lea ebx,DWORD PTR 1836072691[eax*1+ebx] sub edx,ebp rol ebx,6 add ebx,edi ; 118 mov eax,DWORD PTR 24[esp] or edx,ebx add edi,eax xor edx,ecx mov eax,-1 rol ebp,10 lea edi,DWORD PTR 1836072691[edx*1+edi] sub eax,ebx rol edi,6 add edi,esi ; 119 mov edx,DWORD PTR 36[esp] or eax,edi add esi,edx xor eax,ebp mov edx,-1 rol ebx,10 lea esi,DWORD PTR 1836072691[eax*1+esi] sub edx,edi rol esi,14 add esi,ecx ; 120 mov eax,DWORD PTR 44[esp] or edx,esi add ecx,eax xor edx,ebx mov eax,-1 rol edi,10 lea ecx,DWORD PTR 1836072691[edx*1+ecx] sub eax,esi rol ecx,12 add ecx,ebp ; 121 mov edx,DWORD PTR 32[esp] or eax,ecx add ebp,edx xor eax,edi mov edx,-1 rol esi,10 lea ebp,DWORD PTR 1836072691[eax*1+ebp] sub edx,ecx rol ebp,13 add ebp,ebx ; 122 mov eax,DWORD PTR 48[esp] or edx,ebp add ebx,eax xor edx,esi mov eax,-1 rol ecx,10 lea ebx,DWORD PTR 1836072691[edx*1+ebx] sub eax,ebp rol ebx,5 add ebx,edi ; 123 mov edx,DWORD PTR 8[esp] or eax,ebx add edi,edx xor eax,ecx mov edx,-1 rol ebp,10 lea edi,DWORD PTR 1836072691[eax*1+edi] sub edx,ebx rol edi,14 add edi,esi ; 124 mov eax,DWORD PTR 40[esp] or edx,edi add esi,eax xor edx,ebp mov eax,-1 rol ebx,10 lea esi,DWORD PTR 1836072691[edx*1+esi] sub eax,edi rol esi,13 add esi,ecx ; 125 mov edx,DWORD PTR [esp] or eax,esi add ecx,edx xor eax,ebx mov edx,-1 rol edi,10 lea ecx,DWORD PTR 1836072691[eax*1+ecx] sub edx,esi rol ecx,13 add ecx,ebp ; 126 mov eax,DWORD PTR 16[esp] or edx,ecx add ebp,eax xor edx,edi mov eax,-1 rol esi,10 lea ebp,DWORD PTR 1836072691[edx*1+ebp] sub eax,ecx rol ebp,7 add ebp,ebx ; 127 mov edx,DWORD PTR 52[esp] or eax,ebp add ebx,edx xor eax,esi mov edx,DWORD PTR 32[esp] rol ecx,10 lea ebx,DWORD PTR 1836072691[eax*1+ebx] mov eax,-1 rol ebx,5 add ebx,edi ; 128 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 24[esp] rol ebp,10 lea edi,DWORD PTR 2053994217[edx*1+edi] mov edx,-1 rol edi,15 add edi,esi ; 129 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 16[esp] rol ebx,10 lea esi,DWORD PTR 2053994217[eax*1+esi] mov eax,-1 rol esi,5 add esi,ecx ; 130 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 4[esp] rol edi,10 lea ecx,DWORD PTR 2053994217[edx*1+ecx] mov edx,-1 rol ecx,8 add ecx,ebp ; 131 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,DWORD PTR 12[esp] rol esi,10 lea ebp,DWORD PTR 2053994217[eax*1+ebp] mov eax,-1 rol ebp,11 add ebp,ebx ; 132 add ebx,edx mov edx,ecx sub eax,ebp and edx,ebp and eax,esi or edx,eax mov eax,DWORD PTR 44[esp] rol ecx,10 lea ebx,DWORD PTR 2053994217[edx*1+ebx] mov edx,-1 rol ebx,14 add ebx,edi ; 133 add edi,eax mov eax,ebp sub edx,ebx and eax,ebx and edx,ecx or eax,edx mov edx,DWORD PTR 60[esp] rol ebp,10 lea edi,DWORD PTR 2053994217[eax*1+edi] mov eax,-1 rol edi,14 add edi,esi ; 134 add esi,edx mov edx,ebx sub eax,edi and edx,edi and eax,ebp or edx,eax mov eax,DWORD PTR [esp] rol ebx,10 lea esi,DWORD PTR 2053994217[edx*1+esi] mov edx,-1 rol esi,6 add esi,ecx ; 135 add ecx,eax mov eax,edi sub edx,esi and eax,esi and edx,ebx or eax,edx mov edx,DWORD PTR 20[esp] rol edi,10 lea ecx,DWORD PTR 2053994217[eax*1+ecx] mov eax,-1 rol ecx,14 add ecx,ebp ; 136 add ebp,edx mov edx,esi sub eax,ecx and edx,ecx and eax,edi or edx,eax mov eax,DWORD PTR 48[esp] rol esi,10 lea ebp,DWORD PTR 2053994217[edx*1+ebp] mov edx,-1 rol ebp,6 add ebp,ebx ; 137 add ebx,eax mov eax,ecx sub edx,ebp and eax,ebp and edx,esi or eax,edx mov edx,DWORD PTR 8[esp] rol ecx,10 lea ebx,DWORD PTR 2053994217[eax*1+ebx] mov eax,-1 rol ebx,9 add ebx,edi ; 138 add edi,edx mov edx,ebp sub eax,ebx and edx,ebx and eax,ecx or edx,eax mov eax,DWORD PTR 52[esp] rol ebp,10 lea edi,DWORD PTR 2053994217[edx*1+edi] mov edx,-1 rol edi,12 add edi,esi ; 139 add esi,eax mov eax,ebx sub edx,edi and eax,edi and edx,ebp or eax,edx mov edx,DWORD PTR 36[esp] rol ebx,10 lea esi,DWORD PTR 2053994217[eax*1+esi] mov eax,-1 rol esi,9 add esi,ecx ; 140 add ecx,edx mov edx,edi sub eax,esi and edx,esi and eax,ebx or edx,eax mov eax,DWORD PTR 28[esp] rol edi,10 lea ecx,DWORD PTR 2053994217[edx*1+ecx] mov edx,-1 rol ecx,12 add ecx,ebp ; 141 add ebp,eax mov eax,esi sub edx,ecx and eax,ecx and edx,edi or eax,edx mov edx,DWORD PTR 40[esp] rol esi,10 lea ebp,DWORD PTR 2053994217[eax*1+ebp] mov eax,-1 rol ebp,5 add ebp,ebx ; 142 add ebx,edx mov edx,ecx sub eax,ebp and edx,ebp and eax,esi or edx,eax mov eax,DWORD PTR 56[esp] rol ecx,10 lea ebx,DWORD PTR 2053994217[edx*1+ebx] mov edx,-1 rol ebx,15 add ebx,edi ; 143 add edi,eax mov eax,ebp sub edx,ebx and eax,ebx and edx,ecx or edx,eax mov eax,ebx rol ebp,10 lea edi,DWORD PTR 2053994217[edx*1+edi] xor eax,ebp rol edi,8 add edi,esi ; 144 mov edx,DWORD PTR 48[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,8 add esi,ecx ; 145 xor eax,ebx mov edx,DWORD PTR 60[esp] xor eax,esi add ecx,eax mov eax,esi rol edi,10 add ecx,edx xor eax,edi rol ecx,5 add ecx,ebp ; 146 mov edx,DWORD PTR 40[esp] xor eax,ecx add ebp,edx rol esi,10 add ebp,eax mov eax,ecx rol ebp,12 add ebp,ebx ; 147 xor eax,esi mov edx,DWORD PTR 16[esp] xor eax,ebp add ebx,eax mov eax,ebp rol ecx,10 add ebx,edx xor eax,ecx rol ebx,9 add ebx,edi ; 148 mov edx,DWORD PTR 4[esp] xor eax,ebx add edi,edx rol ebp,10 add edi,eax mov eax,ebx rol edi,12 add edi,esi ; 149 xor eax,ebp mov edx,DWORD PTR 20[esp] xor eax,edi add esi,eax mov eax,edi rol ebx,10 add esi,edx xor eax,ebx rol esi,5 add esi,ecx ; 150 mov edx,DWORD PTR 32[esp] xor eax,esi add ecx,edx rol edi,10 add ecx,eax mov eax,esi rol ecx,14 add ecx,ebp ; 151 xor eax,edi mov edx,DWORD PTR 28[esp] xor eax,ecx add ebp,eax mov eax,ecx rol esi,10 add ebp,edx xor eax,esi rol ebp,6 add ebp,ebx ; 152 mov edx,DWORD PTR 24[esp] xor eax,ebp add ebx,edx rol ecx,10 add ebx,eax mov eax,ebp rol ebx,8 add ebx,edi ; 153 xor eax,ecx mov edx,DWORD PTR 8[esp] xor eax,ebx add edi,eax mov eax,ebx rol ebp,10 add edi,edx xor eax,ebp rol edi,13 add edi,esi ; 154 mov edx,DWORD PTR 52[esp] xor eax,edi add esi,edx rol ebx,10 add esi,eax mov eax,edi rol esi,6 add esi,ecx ; 155 xor eax,ebx mov edx,DWORD PTR 56[esp] xor eax,esi add ecx,eax mov eax,esi rol edi,10 add ecx,edx xor eax,edi rol ecx,5 add ecx,ebp ; 156 mov edx,DWORD PTR [esp] xor eax,ecx add ebp,edx rol esi,10 add ebp,eax mov eax,ecx rol ebp,15 add ebp,ebx ; 157 xor eax,esi mov edx,DWORD PTR 12[esp] xor eax,ebp add ebx,eax mov eax,ebp rol ecx,10 add ebx,edx xor eax,ecx rol ebx,13 add ebx,edi ; 158 mov edx,DWORD PTR 36[esp] xor eax,ebx add edi,edx rol ebp,10 add edi,eax mov eax,ebx rol edi,11 add edi,esi ; 159 xor eax,ebp mov edx,DWORD PTR 44[esp] xor eax,edi add esi,eax rol ebx,10 add esi,edx mov edx,DWORD PTR 128[esp] rol esi,11 add esi,ecx mov eax,DWORD PTR 4[edx] add ebx,eax mov eax,DWORD PTR 72[esp] add ebx,eax mov eax,DWORD PTR 8[edx] add ebp,eax mov eax,DWORD PTR 76[esp] add ebp,eax mov eax,DWORD PTR 12[edx] add ecx,eax mov eax,DWORD PTR 80[esp] add ecx,eax mov eax,DWORD PTR 16[edx] add esi,eax mov eax,DWORD PTR 64[esp] add esi,eax mov eax,DWORD PTR [edx] add edi,eax mov eax,DWORD PTR 68[esp] add edi,eax mov eax,DWORD PTR 136[esp] mov DWORD PTR [edx],ebx mov DWORD PTR 4[edx],ebp mov DWORD PTR 8[edx],ecx sub eax,1 mov DWORD PTR 12[edx],esi mov DWORD PTR 16[edx],edi jle $L001get_out mov DWORD PTR 136[esp],eax mov edi,ecx mov eax,DWORD PTR 132[esp] mov ecx,ebx add eax,64 mov esi,ebp mov DWORD PTR 132[esp],eax jmp $L000start $L001get_out: add esp,108 pop ebx pop ebp pop edi pop esi ret _ripemd160_block_asm_data_order ENDP .text$ ENDS END ",16325,True,5967.1299677626075,median "############################################################################### # Copyright 2019 Intel Corporation # All Rights Reserved. # # If this software was obtained under the Intel Simplified Software License, # the following terms apply: # # The source code, information and material (""Material"") contained herein is # owned by Intel Corporation or its suppliers or licensors, and title to such # Material remains with Intel Corporation or its suppliers or licensors. The # Material contains proprietary information of Intel or its suppliers and # licensors. The Material is protected by worldwide copyright laws and treaty # provisions. No part of the Material may be used, copied, reproduced, # modified, published, uploaded, posted, transmitted, distributed or disclosed # in any way without Intel's prior express written permission. No license under # any patent, copyright or other intellectual property rights in the Material # is granted to or conferred upon you, either expressly, by implication, # inducement, estoppel or otherwise. Any license under such intellectual # property rights must be express and approved by Intel in writing. # # Unless otherwise agreed by Intel in writing, you may not remove or alter this # notice or any other notice embedded in Materials by Intel or Intel's # suppliers or licensors in any way. # # # If this software was obtained under the Apache License, Version 2.0 (the # ""License""), the following terms apply: # # 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. ############################################################################### .text .p2align 4, 0x90 POLY: .quad 0x1, 0xC200000000000000 TWOONE: .quad 0x1, 0x100000000 SHUF_CONST: .quad 0x8090a0b0c0d0e0f, 0x1020304050607 MASK1: .quad 0xffffffffffffffff, 0x0 MASK2: .quad 0x0, 0xffffffffffffffff INC_1: .quad 1,0 .p2align 4, 0x90 .globl _y8_AesGcmPrecompute_avx _y8_AesGcmPrecompute_avx: movdqu (%rsi), %xmm0 pshufb SHUF_CONST(%rip), %xmm0 movdqa %xmm0, %xmm4 psllq $(1), %xmm0 psrlq $(63), %xmm4 movdqa %xmm4, %xmm3 pslldq $(8), %xmm4 psrldq $(8), %xmm3 por %xmm4, %xmm0 pshufd $(36), %xmm3, %xmm4 pcmpeqd TWOONE(%rip), %xmm4 pand POLY(%rip), %xmm4 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm1 pshufd $(78), %xmm1, %xmm5 pshufd $(78), %xmm0, %xmm3 pxor %xmm1, %xmm5 pxor %xmm0, %xmm3 pclmulqdq $(0), %xmm3, %xmm5 movdqa %xmm1, %xmm4 pclmulqdq $(0), %xmm0, %xmm1 pxor %xmm3, %xmm3 pclmulqdq $(17), %xmm0, %xmm4 pxor %xmm1, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm3 pslldq $(8), %xmm5 pxor %xmm3, %xmm4 pxor %xmm5, %xmm1 movdqa %xmm1, %xmm3 movdqa %xmm1, %xmm5 movdqa %xmm1, %xmm15 psllq $(63), %xmm3 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm3 pxor %xmm15, %xmm3 movdqa %xmm3, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm3 pxor %xmm5, %xmm1 pxor %xmm3, %xmm4 movdqa %xmm1, %xmm5 psrlq $(5), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm1 pxor %xmm4, %xmm1 movdqa %xmm1, %xmm2 pshufd $(78), %xmm2, %xmm5 pshufd $(78), %xmm1, %xmm3 pxor %xmm2, %xmm5 pxor %xmm1, %xmm3 pclmulqdq $(0), %xmm3, %xmm5 movdqa %xmm2, %xmm4 pclmulqdq $(0), %xmm1, %xmm2 pxor %xmm3, %xmm3 pclmulqdq $(17), %xmm1, %xmm4 pxor %xmm2, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm3 pslldq $(8), %xmm5 pxor %xmm3, %xmm4 pxor %xmm5, %xmm2 movdqa %xmm2, %xmm3 movdqa %xmm2, %xmm5 movdqa %xmm2, %xmm15 psllq $(63), %xmm3 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm3 pxor %xmm15, %xmm3 movdqa %xmm3, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm3 pxor %xmm5, %xmm2 pxor %xmm3, %xmm4 movdqa %xmm2, %xmm5 psrlq $(5), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm2 pxor %xmm4, %xmm2 movdqu %xmm0, (%rdi) movdqu %xmm1, (16)(%rdi) movdqu %xmm2, (32)(%rdi) ret .p2align 4, 0x90 .globl _y8_AesGcmMulGcm_avx _y8_AesGcmMulGcm_avx: movdqa (%rdi), %xmm0 pshufb SHUF_CONST(%rip), %xmm0 movdqa (%rsi), %xmm1 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 movdqa %xmm0, %xmm4 movdqa %xmm0, %xmm15 psllq $(63), %xmm2 psllq $(62), %xmm4 psllq $(57), %xmm15 pxor %xmm4, %xmm2 pxor %xmm15, %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 pshufb SHUF_CONST(%rip), %xmm0 movdqa %xmm0, (%rdi) ret .p2align 4, 0x90 .globl _y8_AesGcmAuth_avx _y8_AesGcmAuth_avx: movdqa (%rdi), %xmm0 pshufb SHUF_CONST(%rip), %xmm0 movdqa (%rcx), %xmm1 movslq %edx, %rdx .p2align 4, 0x90 .Lauth_loopgas_3: movdqu (%rsi), %xmm2 pshufb SHUF_CONST(%rip), %xmm2 add $(16), %rsi pxor %xmm2, %xmm0 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 movdqa %xmm0, %xmm4 movdqa %xmm0, %xmm15 psllq $(63), %xmm2 psllq $(62), %xmm4 psllq $(57), %xmm15 pxor %xmm4, %xmm2 pxor %xmm15, %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 sub $(16), %rdx jnz .Lauth_loopgas_3 pshufb SHUF_CONST(%rip), %xmm0 movdqa %xmm0, (%rdi) ret .p2align 4, 0x90 .globl _y8_AesGcmEnc_avx _y8_AesGcmEnc_avx: push %rbx sub $(128), %rsp mov (152)(%rsp), %rax mov (160)(%rsp), %rbx mov (144)(%rsp), %rcx movdqa SHUF_CONST(%rip), %xmm4 movdqu (%rax), %xmm0 movdqu (%rbx), %xmm1 movdqu (%rcx), %xmm2 pshufb %xmm4, %xmm0 movdqa %xmm0, (%rsp) movdqa %xmm1, (16)(%rsp) pshufb %xmm4, %xmm2 pxor %xmm1, %xmm1 movdqa %xmm2, (32)(%rsp) movdqa %xmm1, (48)(%rsp) movdqa %xmm1, (64)(%rsp) movdqa %xmm1, (80)(%rsp) mov (168)(%rsp), %rbx movdqa (32)(%rbx), %xmm10 pshufd $(78), %xmm10, %xmm9 pxor %xmm10, %xmm9 movdqa %xmm9, (96)(%rsp) movslq %edx, %rdx mov %r9, %rcx mov %rdx, %rax and $(63), %rax and $(-64), %rdx jz .Lsingle_block_procgas_4 .p2align 4, 0x90 .Lblks4_loopgas_4: movdqa INC_1(%rip), %xmm6 movdqa SHUF_CONST(%rip), %xmm5 movdqa %xmm0, %xmm1 paddd %xmm6, %xmm1 movdqa %xmm1, %xmm2 paddd %xmm6, %xmm2 movdqa %xmm2, %xmm3 paddd %xmm6, %xmm3 movdqa %xmm3, %xmm4 paddd %xmm6, %xmm4 movdqa %xmm4, (%rsp) movdqa (%rcx), %xmm0 mov %rcx, %r10 pshufb %xmm5, %xmm1 pshufb %xmm5, %xmm2 pshufb %xmm5, %xmm3 pshufb %xmm5, %xmm4 pxor %xmm0, %xmm1 pxor %xmm0, %xmm2 pxor %xmm0, %xmm3 pxor %xmm0, %xmm4 movdqa (16)(%r10), %xmm0 add $(16), %r10 mov %r8d, %r11d sub $(1), %r11 .p2align 4, 0x90 .Lcipher4_loopgas_4: aesenc %xmm0, %xmm1 aesenc %xmm0, %xmm2 aesenc %xmm0, %xmm3 aesenc %xmm0, %xmm4 movdqa (16)(%r10), %xmm0 add $(16), %r10 dec %r11 jnz .Lcipher4_loopgas_4 aesenclast %xmm0, %xmm1 aesenclast %xmm0, %xmm2 aesenclast %xmm0, %xmm3 aesenclast %xmm0, %xmm4 movdqa (16)(%rsp), %xmm0 movdqa %xmm4, (16)(%rsp) movdqu (%rsi), %xmm4 movdqu (16)(%rsi), %xmm5 movdqu (32)(%rsi), %xmm6 movdqu (48)(%rsi), %xmm7 add $(64), %rsi pxor %xmm4, %xmm0 movdqu %xmm0, (%rdi) pshufb SHUF_CONST(%rip), %xmm0 pxor (32)(%rsp), %xmm0 pxor %xmm5, %xmm1 movdqu %xmm1, (16)(%rdi) pshufb SHUF_CONST(%rip), %xmm1 pxor (48)(%rsp), %xmm1 pxor %xmm6, %xmm2 movdqu %xmm2, (32)(%rdi) pshufb SHUF_CONST(%rip), %xmm2 pxor (64)(%rsp), %xmm2 pxor %xmm7, %xmm3 movdqu %xmm3, (48)(%rdi) pshufb SHUF_CONST(%rip), %xmm3 pxor (80)(%rsp), %xmm3 add $(64), %rdi cmp $(64), %rdx je .Lcombine_hashgas_4 movdqa MASK1(%rip), %xmm14 pshufd $(78), %xmm0, %xmm6 movdqa %xmm0, %xmm5 pxor %xmm0, %xmm6 pclmulqdq $(0), %xmm10, %xmm0 pshufd $(78), %xmm1, %xmm13 movdqa %xmm1, %xmm12 pxor %xmm1, %xmm13 pclmulqdq $(17), %xmm10, %xmm5 pclmulqdq $(0), %xmm9, %xmm6 pxor %xmm0, %xmm6 pxor %xmm5, %xmm6 pshufd $(78), %xmm6, %xmm4 movdqa %xmm4, %xmm6 pand MASK2(%rip), %xmm4 pand %xmm14, %xmm6 pxor %xmm4, %xmm0 pxor %xmm6, %xmm5 movdqa %xmm0, %xmm4 psllq $(1), %xmm0 pclmulqdq $(0), %xmm10, %xmm1 pxor %xmm4, %xmm0 psllq $(5), %xmm0 pxor %xmm4, %xmm0 psllq $(57), %xmm0 pshufd $(78), %xmm0, %xmm6 movdqa %xmm6, %xmm0 pclmulqdq $(17), %xmm10, %xmm12 pand %xmm14, %xmm6 pand MASK2(%rip), %xmm0 pxor %xmm4, %xmm0 pxor %xmm6, %xmm5 movdqa %xmm0, %xmm6 psrlq $(5), %xmm0 pclmulqdq $(0), %xmm9, %xmm13 pxor %xmm6, %xmm0 psrlq $(1), %xmm0 pxor %xmm6, %xmm0 psrlq $(1), %xmm0 pxor %xmm6, %xmm0 pxor %xmm5, %xmm0 pxor %xmm1, %xmm13 pxor %xmm12, %xmm13 pshufd $(78), %xmm13, %xmm11 movdqa %xmm11, %xmm13 pand MASK2(%rip), %xmm11 pand %xmm14, %xmm13 pxor %xmm11, %xmm1 pxor %xmm13, %xmm12 movdqa %xmm1, %xmm11 movdqa %xmm1, %xmm13 movdqa %xmm1, %xmm15 psllq $(63), %xmm11 psllq $(62), %xmm13 psllq $(57), %xmm15 pxor %xmm13, %xmm11 pxor %xmm15, %xmm11 movdqa %xmm11, %xmm13 pslldq $(8), %xmm13 psrldq $(8), %xmm11 pxor %xmm13, %xmm1 pxor %xmm11, %xmm12 movdqa %xmm1, %xmm13 psrlq $(5), %xmm13 pxor %xmm1, %xmm13 psrlq $(1), %xmm13 pxor %xmm1, %xmm13 psrlq $(1), %xmm13 pxor %xmm13, %xmm1 pxor %xmm12, %xmm1 pshufd $(78), %xmm2, %xmm6 movdqa %xmm2, %xmm5 pxor %xmm2, %xmm6 pclmulqdq $(0), %xmm10, %xmm2 pshufd $(78), %xmm3, %xmm13 movdqa %xmm3, %xmm12 pxor %xmm3, %xmm13 pclmulqdq $(17), %xmm10, %xmm5 pclmulqdq $(0), %xmm9, %xmm6 pxor %xmm2, %xmm6 pxor %xmm5, %xmm6 pshufd $(78), %xmm6, %xmm4 movdqa %xmm4, %xmm6 pand MASK2(%rip), %xmm4 pand %xmm14, %xmm6 pxor %xmm4, %xmm2 pxor %xmm6, %xmm5 movdqa %xmm2, %xmm4 psllq $(1), %xmm2 pclmulqdq $(0), %xmm10, %xmm3 pxor %xmm4, %xmm2 psllq $(5), %xmm2 pxor %xmm4, %xmm2 psllq $(57), %xmm2 pshufd $(78), %xmm2, %xmm6 movdqa %xmm6, %xmm2 pclmulqdq $(17), %xmm10, %xmm12 pand %xmm14, %xmm6 pand MASK2(%rip), %xmm2 pxor %xmm4, %xmm2 pxor %xmm6, %xmm5 movdqa %xmm2, %xmm6 psrlq $(5), %xmm2 pclmulqdq $(0), %xmm9, %xmm13 pxor %xmm6, %xmm2 psrlq $(1), %xmm2 pxor %xmm6, %xmm2 psrlq $(1), %xmm2 pxor %xmm6, %xmm2 pxor %xmm5, %xmm2 pxor %xmm3, %xmm13 pxor %xmm12, %xmm13 pshufd $(78), %xmm13, %xmm11 movdqa %xmm11, %xmm13 pand MASK2(%rip), %xmm11 pand %xmm14, %xmm13 pxor %xmm11, %xmm3 pxor %xmm13, %xmm12 movdqa %xmm3, %xmm11 movdqa %xmm3, %xmm13 movdqa %xmm3, %xmm15 psllq $(63), %xmm11 psllq $(62), %xmm13 psllq $(57), %xmm15 pxor %xmm13, %xmm11 pxor %xmm15, %xmm11 movdqa %xmm11, %xmm13 pslldq $(8), %xmm13 psrldq $(8), %xmm11 pxor %xmm13, %xmm3 pxor %xmm11, %xmm12 movdqa %xmm3, %xmm13 psrlq $(5), %xmm13 pxor %xmm3, %xmm13 psrlq $(1), %xmm13 pxor %xmm3, %xmm13 psrlq $(1), %xmm13 pxor %xmm13, %xmm3 pxor %xmm12, %xmm3 movdqa %xmm0, (32)(%rsp) movdqa %xmm1, (48)(%rsp) movdqa %xmm2, (64)(%rsp) movdqa %xmm3, (80)(%rsp) sub $(64), %rdx movdqa (%rsp), %xmm0 cmp $(64), %rdx jge .Lblks4_loopgas_4 .Lcombine_hashgas_4: movdqa (%rbx), %xmm8 movdqa (16)(%rbx), %xmm9 pshufd $(78), %xmm0, %xmm5 pshufd $(78), %xmm10, %xmm6 pxor %xmm0, %xmm5 pxor %xmm10, %xmm6 pclmulqdq $(0), %xmm6, %xmm5 movdqa %xmm0, %xmm4 pclmulqdq $(0), %xmm10, %xmm0 pxor %xmm6, %xmm6 pclmulqdq $(17), %xmm10, %xmm4 pxor %xmm0, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm6 pslldq $(8), %xmm5 pxor %xmm6, %xmm4 pxor %xmm5, %xmm0 movdqa %xmm0, %xmm6 movdqa %xmm0, %xmm5 movdqa %xmm0, %xmm15 psllq $(63), %xmm6 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm6 pxor %xmm15, %xmm6 movdqa %xmm6, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm6 pxor %xmm5, %xmm0 pxor %xmm6, %xmm4 movdqa %xmm0, %xmm5 psrlq $(5), %xmm5 pxor %xmm0, %xmm5 psrlq $(1), %xmm5 pxor %xmm0, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm0 pxor %xmm4, %xmm0 pshufd $(78), %xmm1, %xmm5 pshufd $(78), %xmm9, %xmm6 pxor %xmm1, %xmm5 pxor %xmm9, %xmm6 pclmulqdq $(0), %xmm6, %xmm5 movdqa %xmm1, %xmm4 pclmulqdq $(0), %xmm9, %xmm1 pxor %xmm6, %xmm6 pclmulqdq $(17), %xmm9, %xmm4 pxor %xmm1, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm6 pslldq $(8), %xmm5 pxor %xmm6, %xmm4 pxor %xmm5, %xmm1 movdqa %xmm1, %xmm6 movdqa %xmm1, %xmm5 movdqa %xmm1, %xmm15 psllq $(63), %xmm6 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm6 pxor %xmm15, %xmm6 movdqa %xmm6, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm6 pxor %xmm5, %xmm1 pxor %xmm6, %xmm4 movdqa %xmm1, %xmm5 psrlq $(5), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm1 pxor %xmm4, %xmm1 pshufd $(78), %xmm2, %xmm5 pshufd $(78), %xmm8, %xmm6 pxor %xmm2, %xmm5 pxor %xmm8, %xmm6 pclmulqdq $(0), %xmm6, %xmm5 movdqa %xmm2, %xmm4 pclmulqdq $(0), %xmm8, %xmm2 pxor %xmm6, %xmm6 pclmulqdq $(17), %xmm8, %xmm4 pxor %xmm2, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm6 pslldq $(8), %xmm5 pxor %xmm6, %xmm4 pxor %xmm5, %xmm2 movdqa %xmm2, %xmm6 movdqa %xmm2, %xmm5 movdqa %xmm2, %xmm15 psllq $(63), %xmm6 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm6 pxor %xmm15, %xmm6 movdqa %xmm6, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm6 pxor %xmm5, %xmm2 pxor %xmm6, %xmm4 movdqa %xmm2, %xmm5 psrlq $(5), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm2 pxor %xmm4, %xmm2 pxor %xmm1, %xmm3 pxor %xmm2, %xmm3 pshufd $(78), %xmm3, %xmm5 pshufd $(78), %xmm8, %xmm6 pxor %xmm3, %xmm5 pxor %xmm8, %xmm6 pclmulqdq $(0), %xmm6, %xmm5 movdqa %xmm3, %xmm4 pclmulqdq $(0), %xmm8, %xmm3 pxor %xmm6, %xmm6 pclmulqdq $(17), %xmm8, %xmm4 pxor %xmm3, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm6 pslldq $(8), %xmm5 pxor %xmm6, %xmm4 pxor %xmm5, %xmm3 movdqa %xmm3, %xmm6 movdqa %xmm3, %xmm5 movdqa %xmm3, %xmm15 psllq $(63), %xmm6 psllq $(62), %xmm5 psllq $(57), %xmm15 pxor %xmm5, %xmm6 pxor %xmm15, %xmm6 movdqa %xmm6, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm6 pxor %xmm5, %xmm3 pxor %xmm6, %xmm4 movdqa %xmm3, %xmm5 psrlq $(5), %xmm5 pxor %xmm3, %xmm5 psrlq $(1), %xmm5 pxor %xmm3, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm3 pxor %xmm4, %xmm3 pxor %xmm0, %xmm3 movdqa %xmm3, (32)(%rsp) .Lsingle_block_procgas_4: test %rax, %rax jz .Lquitgas_4 .p2align 4, 0x90 .Lblk_loopgas_4: movdqa (%rsp), %xmm0 movdqa %xmm0, %xmm1 paddd INC_1(%rip), %xmm1 movdqa %xmm1, (%rsp) movdqa (%rcx), %xmm0 mov %rcx, %r10 pshufb SHUF_CONST(%rip), %xmm1 pxor %xmm0, %xmm1 movdqa (16)(%r10), %xmm0 add $(16), %r10 mov %r8d, %r11d sub $(1), %r11 .p2align 4, 0x90 .Lcipher_loopgas_4: aesenc %xmm0, %xmm1 movdqa (16)(%r10), %xmm0 add $(16), %r10 dec %r11 jnz .Lcipher_loopgas_4 aesenclast %xmm0, %xmm1 movdqa (16)(%rsp), %xmm0 movdqa %xmm1, (16)(%rsp) movdqu (%rsi), %xmm1 add $(16), %rsi pxor %xmm1, %xmm0 movdqu %xmm0, (%rdi) add $(16), %rdi pshufb SHUF_CONST(%rip), %xmm0 pxor (32)(%rsp), %xmm0 movdqa (%rbx), %xmm1 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 movdqa %xmm0, %xmm4 movdqa %xmm0, %xmm15 psllq $(63), %xmm2 psllq $(62), %xmm4 psllq $(57), %xmm15 pxor %xmm4, %xmm2 pxor %xmm15, %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 movdqa %xmm0, (32)(%rsp) sub $(16), %rax jg .Lblk_loopgas_4 .Lquitgas_4: movdqa (%rsp), %xmm0 movdqa (16)(%rsp), %xmm1 movdqa (32)(%rsp), %xmm2 mov (152)(%rsp), %rax mov (160)(%rsp), %rbx mov (144)(%rsp), %rcx pshufb SHUF_CONST(%rip), %xmm0 movdqu %xmm0, (%rax) movdqu %xmm1, (%rbx) pshufb SHUF_CONST(%rip), %xmm2 movdqu %xmm2, (%rcx) add $(128), %rsp pop %rbx ret .p2align 4, 0x90 .globl _y8_AesGcmDec_avx _y8_AesGcmDec_avx: push %rbx sub $(128), %rsp mov (152)(%rsp), %rax mov (160)(%rsp), %rbx mov (144)(%rsp), %rcx movdqa SHUF_CONST(%rip), %xmm4 movdqu (%rax), %xmm0 movdqu (%rbx), %xmm1 movdqu (%rcx), %xmm2 pshufb %xmm4, %xmm0 movdqa %xmm0, (%rsp) movdqa %xmm1, (16)(%rsp) pshufb %xmm4, %xmm2 pxor %xmm1, %xmm1 movdqa %xmm2, (32)(%rsp) movdqa %xmm1, (48)(%rsp) movdqa %xmm1, (64)(%rsp) movdqa %xmm1, (80)(%rsp) mov (168)(%rsp), %rbx movdqa (32)(%rbx), %xmm10 pshufd $(78), %xmm10, %xmm9 pxor %xmm10, %xmm9 movdqa %xmm9, (96)(%rsp) movslq %edx, %rdx mov %r9, %rcx mov %rdx, %rax and $(63), %rax and $(-64), %rdx jz .Lsingle_block_procgas_5 .p2align 4, 0x90 .Lblks4_loopgas_5: movdqa INC_1(%rip), %xmm6 movdqa SHUF_CONST(%rip), %xmm5 movdqa %xmm0, %xmm1 paddd INC_1(%rip), %xmm1 movdqa %xmm1, %xmm2 paddd INC_1(%rip), %xmm2 movdqa %xmm2, %xmm3 paddd INC_1(%rip), %xmm3 movdqa %xmm3, %xmm4 paddd INC_1(%rip), %xmm4 movdqa %xmm4, (%rsp) movdqa (%rcx), %xmm0 mov %rcx, %r10 pshufb %xmm5, %xmm1 pshufb %xmm5, %xmm2 pshufb %xmm5, %xmm3 pshufb %xmm5, %xmm4 pxor %xmm0, %xmm1 pxor %xmm0, %xmm2 pxor %xmm0, %xmm3 pxor %xmm0, %xmm4 movdqa (16)(%r10), %xmm0 add $(16), %r10 mov %r8d, %r11d sub $(1), %r11 .p2align 4, 0x90 .Lcipher4_loopgas_5: aesenc %xmm0, %xmm1 aesenc %xmm0, %xmm2 aesenc %xmm0, %xmm3 aesenc %xmm0, %xmm4 movdqa (16)(%r10), %xmm0 add $(16), %r10 dec %r11 jnz .Lcipher4_loopgas_5 aesenclast %xmm0, %xmm1 aesenclast %xmm0, %xmm2 aesenclast %xmm0, %xmm3 aesenclast %xmm0, %xmm4 movdqa (16)(%rsp), %xmm0 movdqa %xmm4, (16)(%rsp) movdqu (%rsi), %xmm4 movdqu (16)(%rsi), %xmm5 movdqu (32)(%rsi), %xmm6 movdqu (48)(%rsi), %xmm7 add $(64), %rsi pxor %xmm4, %xmm0 movdqu %xmm0, (%rdi) pshufb SHUF_CONST(%rip), %xmm4 pxor (32)(%rsp), %xmm4 pxor %xmm5, %xmm1 movdqu %xmm1, (16)(%rdi) pshufb SHUF_CONST(%rip), %xmm5 pxor (48)(%rsp), %xmm5 pxor %xmm6, %xmm2 movdqu %xmm2, (32)(%rdi) pshufb SHUF_CONST(%rip), %xmm6 pxor (64)(%rsp), %xmm6 pxor %xmm7, %xmm3 movdqu %xmm3, (48)(%rdi) pshufb SHUF_CONST(%rip), %xmm7 pxor (80)(%rsp), %xmm7 add $(64), %rdi cmp $(64), %rdx je .Lcombine_hashgas_5 movdqa MASK1(%rip), %xmm14 pshufd $(78), %xmm4, %xmm2 movdqa %xmm4, %xmm1 pxor %xmm4, %xmm2 pclmulqdq $(0), %xmm10, %xmm4 pshufd $(78), %xmm5, %xmm13 movdqa %xmm5, %xmm12 pxor %xmm5, %xmm13 pclmulqdq $(17), %xmm10, %xmm1 pclmulqdq $(0), %xmm9, %xmm2 pxor %xmm4, %xmm2 pxor %xmm1, %xmm2 pshufd $(78), %xmm2, %xmm0 movdqa %xmm0, %xmm2 pand MASK2(%rip), %xmm0 pand %xmm14, %xmm2 pxor %xmm0, %xmm4 pxor %xmm2, %xmm1 movdqa %xmm4, %xmm0 psllq $(1), %xmm4 pclmulqdq $(0), %xmm10, %xmm5 pxor %xmm0, %xmm4 psllq $(5), %xmm4 pxor %xmm0, %xmm4 psllq $(57), %xmm4 pshufd $(78), %xmm4, %xmm2 movdqa %xmm2, %xmm4 pclmulqdq $(17), %xmm10, %xmm12 pand %xmm14, %xmm2 pand MASK2(%rip), %xmm4 pxor %xmm0, %xmm4 pxor %xmm2, %xmm1 movdqa %xmm4, %xmm2 psrlq $(5), %xmm4 pclmulqdq $(0), %xmm9, %xmm13 pxor %xmm2, %xmm4 psrlq $(1), %xmm4 pxor %xmm2, %xmm4 psrlq $(1), %xmm4 pxor %xmm2, %xmm4 pxor %xmm1, %xmm4 pxor %xmm5, %xmm13 pxor %xmm12, %xmm13 pshufd $(78), %xmm13, %xmm11 movdqa %xmm11, %xmm13 pand MASK2(%rip), %xmm11 pand %xmm14, %xmm13 pxor %xmm11, %xmm5 pxor %xmm13, %xmm12 movdqa %xmm5, %xmm11 movdqa %xmm5, %xmm13 movdqa %xmm5, %xmm15 psllq $(63), %xmm11 psllq $(62), %xmm13 psllq $(57), %xmm15 pxor %xmm13, %xmm11 pxor %xmm15, %xmm11 movdqa %xmm11, %xmm13 pslldq $(8), %xmm13 psrldq $(8), %xmm11 pxor %xmm13, %xmm5 pxor %xmm11, %xmm12 movdqa %xmm5, %xmm13 psrlq $(5), %xmm13 pxor %xmm5, %xmm13 psrlq $(1), %xmm13 pxor %xmm5, %xmm13 psrlq $(1), %xmm13 pxor %xmm13, %xmm5 pxor %xmm12, %xmm5 pshufd $(78), %xmm6, %xmm2 movdqa %xmm6, %xmm1 pxor %xmm6, %xmm2 pclmulqdq $(0), %xmm10, %xmm6 pshufd $(78), %xmm7, %xmm13 movdqa %xmm7, %xmm12 pxor %xmm7, %xmm13 pclmulqdq $(17), %xmm10, %xmm1 pclmulqdq $(0), %xmm9, %xmm2 pxor %xmm6, %xmm2 pxor %xmm1, %xmm2 pshufd $(78), %xmm2, %xmm0 movdqa %xmm0, %xmm2 pand MASK2(%rip), %xmm0 pand %xmm14, %xmm2 pxor %xmm0, %xmm6 pxor %xmm2, %xmm1 movdqa %xmm6, %xmm0 psllq $(1), %xmm6 pclmulqdq $(0), %xmm10, %xmm7 pxor %xmm0, %xmm6 psllq $(5), %xmm6 pxor %xmm0, %xmm6 psllq $(57), %xmm6 pshufd $(78), %xmm6, %xmm2 movdqa %xmm2, %xmm6 pclmulqdq $(17), %xmm10, %xmm12 pand %xmm14, %xmm2 pand MASK2(%rip), %xmm6 pxor %xmm0, %xmm6 pxor %xmm2, %xmm1 movdqa %xmm6, %xmm2 psrlq $(5), %xmm6 pclmulqdq $(0), %xmm9, %xmm13 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm2, %xmm6 pxor %xmm1, %xmm6 pxor %xmm7, %xmm13 pxor %xmm12, %xmm13 pshufd $(78), %xmm13, %xmm11 movdqa %xmm11, %xmm13 pand MASK2(%rip), %xmm11 pand %xmm14, %xmm13 pxor %xmm11, %xmm7 pxor %xmm13, %xmm12 movdqa %xmm7, %xmm11 movdqa %xmm7, %xmm13 movdqa %xmm7, %xmm15 psllq $(63), %xmm11 psllq $(62), %xmm13 psllq $(57), %xmm15 pxor %xmm13, %xmm11 pxor %xmm15, %xmm11 movdqa %xmm11, %xmm13 pslldq $(8), %xmm13 psrldq $(8), %xmm11 pxor %xmm13, %xmm7 pxor %xmm11, %xmm12 movdqa %xmm7, %xmm13 psrlq $(5), %xmm13 pxor %xmm7, %xmm13 psrlq $(1), %xmm13 pxor %xmm7, %xmm13 psrlq $(1), %xmm13 pxor %xmm13, %xmm7 pxor %xmm12, %xmm7 movdqa %xmm4, (32)(%rsp) movdqa %xmm5, (48)(%rsp) movdqa %xmm6, (64)(%rsp) movdqa %xmm7, (80)(%rsp) sub $(64), %rdx movdqa (%rsp), %xmm0 cmp $(64), %rdx jge .Lblks4_loopgas_5 .Lcombine_hashgas_5: movdqa (%rbx), %xmm8 movdqa (16)(%rbx), %xmm9 pshufd $(78), %xmm4, %xmm2 pshufd $(78), %xmm10, %xmm0 pxor %xmm4, %xmm2 pxor %xmm10, %xmm0 pclmulqdq $(0), %xmm0, %xmm2 movdqa %xmm4, %xmm1 pclmulqdq $(0), %xmm10, %xmm4 pxor %xmm0, %xmm0 pclmulqdq $(17), %xmm10, %xmm1 pxor %xmm4, %xmm2 pxor %xmm1, %xmm2 palignr $(8), %xmm2, %xmm0 pslldq $(8), %xmm2 pxor %xmm0, %xmm1 pxor %xmm2, %xmm4 movdqa %xmm4, %xmm0 movdqa %xmm4, %xmm2 movdqa %xmm4, %xmm15 psllq $(63), %xmm0 psllq $(62), %xmm2 psllq $(57), %xmm15 pxor %xmm2, %xmm0 pxor %xmm15, %xmm0 movdqa %xmm0, %xmm2 pslldq $(8), %xmm2 psrldq $(8), %xmm0 pxor %xmm2, %xmm4 pxor %xmm0, %xmm1 movdqa %xmm4, %xmm2 psrlq $(5), %xmm2 pxor %xmm4, %xmm2 psrlq $(1), %xmm2 pxor %xmm4, %xmm2 psrlq $(1), %xmm2 pxor %xmm2, %xmm4 pxor %xmm1, %xmm4 pshufd $(78), %xmm5, %xmm2 pshufd $(78), %xmm9, %xmm0 pxor %xmm5, %xmm2 pxor %xmm9, %xmm0 pclmulqdq $(0), %xmm0, %xmm2 movdqa %xmm5, %xmm1 pclmulqdq $(0), %xmm9, %xmm5 pxor %xmm0, %xmm0 pclmulqdq $(17), %xmm9, %xmm1 pxor %xmm5, %xmm2 pxor %xmm1, %xmm2 palignr $(8), %xmm2, %xmm0 pslldq $(8), %xmm2 pxor %xmm0, %xmm1 pxor %xmm2, %xmm5 movdqa %xmm5, %xmm0 movdqa %xmm5, %xmm2 movdqa %xmm5, %xmm15 psllq $(63), %xmm0 psllq $(62), %xmm2 psllq $(57), %xmm15 pxor %xmm2, %xmm0 pxor %xmm15, %xmm0 movdqa %xmm0, %xmm2 pslldq $(8), %xmm2 psrldq $(8), %xmm0 pxor %xmm2, %xmm5 pxor %xmm0, %xmm1 movdqa %xmm5, %xmm2 psrlq $(5), %xmm2 pxor %xmm5, %xmm2 psrlq $(1), %xmm2 pxor %xmm5, %xmm2 psrlq $(1), %xmm2 pxor %xmm2, %xmm5 pxor %xmm1, %xmm5 pshufd $(78), %xmm6, %xmm2 pshufd $(78), %xmm8, %xmm0 pxor %xmm6, %xmm2 pxor %xmm8, %xmm0 pclmulqdq $(0), %xmm0, %xmm2 movdqa %xmm6, %xmm1 pclmulqdq $(0), %xmm8, %xmm6 pxor %xmm0, %xmm0 pclmulqdq $(17), %xmm8, %xmm1 pxor %xmm6, %xmm2 pxor %xmm1, %xmm2 palignr $(8), %xmm2, %xmm0 pslldq $(8), %xmm2 pxor %xmm0, %xmm1 pxor %xmm2, %xmm6 movdqa %xmm6, %xmm0 movdqa %xmm6, %xmm2 movdqa %xmm6, %xmm15 psllq $(63), %xmm0 psllq $(62), %xmm2 psllq $(57), %xmm15 pxor %xmm2, %xmm0 pxor %xmm15, %xmm0 movdqa %xmm0, %xmm2 pslldq $(8), %xmm2 psrldq $(8), %xmm0 pxor %xmm2, %xmm6 pxor %xmm0, %xmm1 movdqa %xmm6, %xmm2 psrlq $(5), %xmm2 pxor %xmm6, %xmm2 psrlq $(1), %xmm2 pxor %xmm6, %xmm2 psrlq $(1), %xmm2 pxor %xmm2, %xmm6 pxor %xmm1, %xmm6 pxor %xmm5, %xmm7 pxor %xmm6, %xmm7 pshufd $(78), %xmm7, %xmm2 pshufd $(78), %xmm8, %xmm0 pxor %xmm7, %xmm2 pxor %xmm8, %xmm0 pclmulqdq $(0), %xmm0, %xmm2 movdqa %xmm7, %xmm1 pclmulqdq $(0), %xmm8, %xmm7 pxor %xmm0, %xmm0 pclmulqdq $(17), %xmm8, %xmm1 pxor %xmm7, %xmm2 pxor %xmm1, %xmm2 palignr $(8), %xmm2, %xmm0 pslldq $(8), %xmm2 pxor %xmm0, %xmm1 pxor %xmm2, %xmm7 movdqa %xmm7, %xmm0 movdqa %xmm7, %xmm2 movdqa %xmm7, %xmm15 psllq $(63), %xmm0 psllq $(62), %xmm2 psllq $(57), %xmm15 pxor %xmm2, %xmm0 pxor %xmm15, %xmm0 movdqa %xmm0, %xmm2 pslldq $(8), %xmm2 psrldq $(8), %xmm0 pxor %xmm2, %xmm7 pxor %xmm0, %xmm1 movdqa %xmm7, %xmm2 psrlq $(5), %xmm2 pxor %xmm7, %xmm2 psrlq $(1), %xmm2 pxor %xmm7, %xmm2 psrlq $(1), %xmm2 pxor %xmm2, %xmm7 pxor %xmm1, %xmm7 pxor %xmm4, %xmm7 movdqa %xmm7, (32)(%rsp) .Lsingle_block_procgas_5: test %rax, %rax jz .Lquitgas_5 .p2align 4, 0x90 .Lblk_loopgas_5: movdqa (%rsp), %xmm0 movdqa %xmm0, %xmm1 paddd INC_1(%rip), %xmm1 movdqa %xmm1, (%rsp) movdqa (%rcx), %xmm0 mov %rcx, %r10 pshufb SHUF_CONST(%rip), %xmm1 pxor %xmm0, %xmm1 movdqa (16)(%r10), %xmm0 add $(16), %r10 mov %r8d, %r11d sub $(1), %r11 .p2align 4, 0x90 .Lcipher_loopgas_5: aesenc %xmm0, %xmm1 movdqa (16)(%r10), %xmm0 add $(16), %r10 dec %r11 jnz .Lcipher_loopgas_5 aesenclast %xmm0, %xmm1 movdqa (16)(%rsp), %xmm0 movdqa %xmm1, (16)(%rsp) movdqu (%rsi), %xmm1 add $(16), %rsi pxor %xmm1, %xmm0 movdqu %xmm0, (%rdi) add $(16), %rdi pshufb SHUF_CONST(%rip), %xmm1 pxor (32)(%rsp), %xmm1 movdqa (%rbx), %xmm0 pshufd $(78), %xmm1, %xmm4 pshufd $(78), %xmm0, %xmm2 pxor %xmm1, %xmm4 pxor %xmm0, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm1, %xmm3 pclmulqdq $(0), %xmm0, %xmm1 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm0, %xmm3 pxor %xmm1, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm1 movdqa %xmm1, %xmm2 movdqa %xmm1, %xmm4 movdqa %xmm1, %xmm15 psllq $(63), %xmm2 psllq $(62), %xmm4 psllq $(57), %xmm15 pxor %xmm4, %xmm2 pxor %xmm15, %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm1 pxor %xmm2, %xmm3 movdqa %xmm1, %xmm4 psrlq $(5), %xmm4 pxor %xmm1, %xmm4 psrlq $(1), %xmm4 pxor %xmm1, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm1 pxor %xmm3, %xmm1 movdqa %xmm1, (32)(%rsp) sub $(16), %rax jg .Lblk_loopgas_5 .Lquitgas_5: movdqa (%rsp), %xmm0 movdqa (16)(%rsp), %xmm1 movdqa (32)(%rsp), %xmm2 mov (152)(%rsp), %rax mov (160)(%rsp), %rbx mov (144)(%rsp), %rcx pshufb SHUF_CONST(%rip), %xmm0 movdqu %xmm0, (%rax) movdqu %xmm1, (%rbx) pshufb SHUF_CONST(%rip), %xmm2 movdqu %xmm2, (%rcx) add $(128), %rsp pop %rbx ret ",16236,True,4895.431159602533,median "// The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp // Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected //U8G2_NULL u8g2(U8G2_R0); // null device, a 8x8 pixel display which does nothing //U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 12, /* dc=*/ 4, /* reset=*/ 6); // Arduboy (Production, Kickstarter Edition) //U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_3W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_128X64_ALT0_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display //U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 16, /* data=*/ 17, /* reset=*/ U8X8_PIN_NONE); // ESP32 Thing, pure SW emulated I2C //U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping //U8G2_SSD1306_128X64_NONAME_1_6800 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_8080 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8G2_SSD1306_128X64_VCOMH0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8G2_SSD1306_128X64_ALT0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8G2_SH1106_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1106_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SH1106_128X64_VCOMH0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8G2_SH1106_128X64_WINSTAR_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but uses updated SH1106 init sequence //U8G2_SH1106_72X40_WISE_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1107_64X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1107_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1107_128X128_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); //U8G2_SH1107_SEEED_96X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1108_160X160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1122_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h //U8G2_SSD1306_128X32_UNIVISION_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 21, /* data=*/ 20, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather M0 Basic Proto + FeatherWing OLED //U8G2_SSD1306_128X32_UNIVISION_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather ESP8266/32u4 Boards + FeatherWing OLED //U8G2_SSD1306_128X32_UNIVISION_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // Adafruit ESP8266/32u4/ARM Boards + FeatherWing OLED //U8G2_SSD1306_128X32_UNIVISION_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA); // pin remapping with ESP8266 HW I2C //U8G2_SSD1306_64X48_ER_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // EastRising 0.66"" OLED breakout board, Uno: A4=SDA, A5=SCL, 5V powered //U8G2_SSD1306_48X64_WINSTAR_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_64X32_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_64X32_1F_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_96X16_ER_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // EastRising 0.69"" OLED //U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h //U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h //U8G2_SSD1322_NHD_128X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1322_NHD_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1325_NHD_128X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1325_NHD_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD0323_OS128064_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD0323_OS128064_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1326_ER_256X32_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // experimental driver for ER-OLED018-1 //U8G2_SSD1327_SEEED_96X96_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8G2_SSD1327_SEEED_96X96_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8G2_SSD1327_EA_W128128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1327_EA_W128128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1327_EA_W128128_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 5, /* data=*/ 4, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1327_EA_W128128_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1327_MIDAS_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1327_MIDAS_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1329_128X96_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1329_128X96_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X32_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X32_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X32_ADAFRUIT_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X32_ADAFRUIT_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X64_ADAFRUIT_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X64_ADAFRUIT_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME0_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME2_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME2_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1317_96X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // not tested, not confirmed //U8G2_SSD1317_96X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // not tested, not confirmed //U8G2_SSD1318_128X96_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1318_128X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_LD7032_60X32_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* cs=*/ 9, /* dc=*/ 10, /* reset=*/ 8); // SW SPI Nano Board //U8G2_LD7032_60X32_1_4W_SW_I2C u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* reset=*/ U8X8_PIN_NONE); // NOT TESTED! //U8G2_UC1701_EA_DOGS102_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1701_EA_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_PCD8544_84X48_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8G2_PCD8544_84X48_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8G2_PCF8812_96X65_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8G2_PCF8812_96X65_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8G2_HX1230_96X68_1_3W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8G2_HX1230_96X68_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_KS0108_128X64_1 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ U8X8_PIN_NONE, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8G2_KS0108_ERM19264_1 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ 16, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8G2_ST7920_192X32_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ U8X8_PIN_NONE, /*dc=*/ 17, /*reset=*/ U8X8_PIN_NONE); //U8G2_ST7920_192X32_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18 /* A4 */ , /* data=*/ 16 /* A2 */, /* CS=*/ 17 /* A3 */, /* reset=*/ U8X8_PIN_NONE); //U8G2_ST7920_128X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18 /* A4 */, /*cs=*/ U8X8_PIN_NONE, /*dc/rs=*/ 17 /* A3 */, /*reset=*/ 15 /* A1 */); // Remember to set R/W to 0 //U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18 /* A4 */ , /* data=*/ 16 /* A2 */, /* CS=*/ 17 /* A3 */, /* reset=*/ U8X8_PIN_NONE); //U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* CS=*/ 10, /* reset=*/ 8); //U8G2_ST7920_128X64_1_HW_SPI u8g2(U8G2_R0, /* CS=*/ 10, /* reset=*/ 8); //U8G2_ST7565_EA_DOGM128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_EA_DOGM128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_64128N_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_64128N_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_EA_DOGM132_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8G2_ST7565_EA_DOGM132_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8G2_ST7565_ZOLEN_128X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_ZOLEN_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_LM6059_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8G2_ST7565_LM6059_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8G2_ST7565_LX12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_LX12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_ERC12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_ERC12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_ERC12864_ALT_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // contrast improved version for ERC12864 //U8G2_ST7565_ERC12864_ALT_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // contrast improved version for ERC12864 //U8G2_ST7565_NHD_C12832_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12832_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_JLX12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_JLX12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_PI_132X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8G2_ST7567_PI_132X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8G2_ST7567_JLX12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_JLX12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_ENH_DG128064_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_ENH_DG128064_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_ENH_DG128064I_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_ENH_DG128064I_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_64X32_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX172104_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX256128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 9, /* data=*/ 8, /* cs=*/ 7, /* dc=*/ 6, /* reset=*/ 5); // MKR Zero, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 7, /* dc=*/ 6, /* reset=*/ 5); // MKR Zero, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256160_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX240160_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX25664_1_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, enable U8g2 16 bit mode for this display //U8G2_NT7534_TG12864R_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_NT7534_TG12864R_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7588_JLX12864_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ 5); //U8G2_ST7588_JLX12864_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ 5); //U8G2_IST3020_ERC19264_1_6800 u8g2(U8G2_R0, 44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 28, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect WR pin with GND //U8G2_IST3020_ERC19264_1_8080 u8g2(U8G2_R0, 44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 29, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect RD pin with 3.3V //U8G2_IST3020_ERC19264_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_LC7981_160X80_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_LC7981_160X160_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_LC7981_240X128_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_LC7981_240X64_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_SED1520_122X32_1 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*dc=*/ A0, /*e1=*/ A3, /*e2=*/ A2, /* reset=*/ A4); // Set R/W to low! //U8G2_T6963_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_T6963_256X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_T6963_160X80_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_T6963_128X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_T6963_128X64_ALT_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable/wr=*/ 17, /*cs/ce=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_SED1330_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect /RD = E with +5V, enable is /WR = RW, FG with GND, 14=Uno Pin A0 //U8G2_SED1330_240X128_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // A0 is dc pin, /WR = RW = GND, enable is /RD = E //U8G2_RA8835_NHD_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect /RD = E with +5V, enable is /WR = RW, FG with GND, 14=Uno Pin A0 //U8G2_RA8835_NHD_240X128_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // A0 is dc pin, /WR = RW = GND, enable is /RD = E //U8G2_UC1601_128X32_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1601_128X32_1_3W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8G2_UC1604_JLX19264_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1604_JLX19264_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1608_ERC24064_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due ERC24064-1 Test Setup //U8G2_UC1608_ERC240120_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1608_240X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due ERC24064-1 Test Setup //U8G2_UC1610_EA_DOGXL160_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8G2_UC1610_EA_DOGXL160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8G2_UC1611_EA_DOGM240_1_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, DOGM240 Test Board //U8G2_UC1611_EA_DOGM240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board //U8G2_UC1611_EA_DOGXL240_1_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, DOGXL240 Test Board //U8G2_UC1611_EA_DOGXL240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board //U8G2_UC1611_EW50850_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 3, /*dc=*/ 16, /*reset=*/ 16); // 240x160, Connect RD/WR1 pin with 3.3V, CS is aktive high //U8G2_UC1638_160X128_1_4W_HW_SPI u8g2(U8G2_R2, /* cs=*/ 2, /* dc=*/ 3, /* reset=*/ 4); // Not tested //U8G2_SSD1606_172X72_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display //U8G2_SSD1607_200X200_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display, original LUT from embedded artists //U8G2_SSD1607_GD_200X200_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Good Display //U8G2_SSD1607_WS_200X200_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Waveshare //U8G2_IL3820_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // WaveShare 2.9 inch eInk/ePaper Display, enable 16 bit mode for this display! //U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // ePaper Display, lesser flickering and faster speed, enable 16 bit mode for this display! //U8G2_LS013B7DH03_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ U8X8_PIN_NONE, /* reset=*/ 8); // there is no DC line for this display //U8G2_LS027B7DH01_400X240_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ U8X8_PIN_NONE, /* reset=*/ 8); // there is no DC line for this display //U8G2_LS013B7DH05_144X168_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ U8X8_PIN_NONE, /* reset=*/ 8); // there is no DC line for this display ",12538,True,3527.0426046597486,median "############################################################################### # Copyright 2018 Intel Corporation # All Rights Reserved. # # If this software was obtained under the Intel Simplified Software License, # the following terms apply: # # The source code, information and material (""Material"") contained herein is # owned by Intel Corporation or its suppliers or licensors, and title to such # Material remains with Intel Corporation or its suppliers or licensors. The # Material contains proprietary information of Intel or its suppliers and # licensors. The Material is protected by worldwide copyright laws and treaty # provisions. No part of the Material may be used, copied, reproduced, # modified, published, uploaded, posted, transmitted, distributed or disclosed # in any way without Intel's prior express written permission. No license under # any patent, copyright or other intellectual property rights in the Material # is granted to or conferred upon you, either expressly, by implication, # inducement, estoppel or otherwise. Any license under such intellectual # property rights must be express and approved by Intel in writing. # # Unless otherwise agreed by Intel in writing, you may not remove or alter this # notice or any other notice embedded in Materials by Intel or Intel's # suppliers or licensors in any way. # # # If this software was obtained under the Apache License, Version 2.0 (the # ""License""), the following terms apply: # # 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. ############################################################################### .text .p2align 5, 0x90 CONST_TABLE: _poly: .quad 0x1, 0xC200000000000000 _twoone: .quad 0x1, 0x100000000 _u128_str: .byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 _mask1: .quad 0xffffffffffffffff, 0x0 _mask2: .quad 0x0, 0xffffffffffffffff _inc1: .quad 1,0 .p2align 5, 0x90 .globl _AesGcmPrecompute_avx _AesGcmPrecompute_avx: push %ebp mov %esp, %ebp push %esi call .L__0000gas_1 .L__0000gas_1: pop %esi sub $(.L__0000gas_1-CONST_TABLE), %esi movl (8)(%ebp), %eax movdqu (%eax), %xmm0 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movdqa %xmm0, %xmm4 psllq $(1), %xmm0 psrlq $(63), %xmm4 movdqa %xmm4, %xmm3 pslldq $(8), %xmm4 psrldq $(8), %xmm3 por %xmm4, %xmm0 pshufd $(36), %xmm3, %xmm4 pcmpeqd ((_twoone-CONST_TABLE))(%esi), %xmm4 pand ((_poly-CONST_TABLE))(%esi), %xmm4 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm1 pshufd $(78), %xmm1, %xmm5 pshufd $(78), %xmm0, %xmm3 pxor %xmm1, %xmm5 pxor %xmm0, %xmm3 pclmulqdq $(0), %xmm3, %xmm5 movdqa %xmm1, %xmm4 pclmulqdq $(0), %xmm0, %xmm1 pxor %xmm3, %xmm3 pclmulqdq $(17), %xmm0, %xmm4 pxor %xmm1, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm3 pslldq $(8), %xmm5 pxor %xmm3, %xmm4 pxor %xmm5, %xmm1 movdqa %xmm1, %xmm3 psllq $(1), %xmm3 pxor %xmm1, %xmm3 psllq $(5), %xmm3 pxor %xmm1, %xmm3 psllq $(57), %xmm3 movdqa %xmm3, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm3 pxor %xmm5, %xmm1 pxor %xmm3, %xmm4 movdqa %xmm1, %xmm5 psrlq $(5), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm1, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm1 pxor %xmm4, %xmm1 movdqa %xmm1, %xmm2 pshufd $(78), %xmm2, %xmm5 pshufd $(78), %xmm1, %xmm3 pxor %xmm2, %xmm5 pxor %xmm1, %xmm3 pclmulqdq $(0), %xmm3, %xmm5 movdqa %xmm2, %xmm4 pclmulqdq $(0), %xmm1, %xmm2 pxor %xmm3, %xmm3 pclmulqdq $(17), %xmm1, %xmm4 pxor %xmm2, %xmm5 pxor %xmm4, %xmm5 palignr $(8), %xmm5, %xmm3 pslldq $(8), %xmm5 pxor %xmm3, %xmm4 pxor %xmm5, %xmm2 movdqa %xmm2, %xmm3 psllq $(1), %xmm3 pxor %xmm2, %xmm3 psllq $(5), %xmm3 pxor %xmm2, %xmm3 psllq $(57), %xmm3 movdqa %xmm3, %xmm5 pslldq $(8), %xmm5 psrldq $(8), %xmm3 pxor %xmm5, %xmm2 pxor %xmm3, %xmm4 movdqa %xmm2, %xmm5 psrlq $(5), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm2, %xmm5 psrlq $(1), %xmm5 pxor %xmm5, %xmm2 pxor %xmm4, %xmm2 movl (12)(%ebp), %eax movdqu %xmm0, (%eax) movdqu %xmm1, (16)(%eax) movdqu %xmm2, (32)(%eax) pop %esi pop %ebp ret .p2align 5, 0x90 .globl _AesGcmMulGcm_avx _AesGcmMulGcm_avx: push %ebp mov %esp, %ebp push %esi push %edi call .L__0001gas_2 .L__0001gas_2: pop %esi sub $(.L__0001gas_2-CONST_TABLE), %esi movl (8)(%ebp), %edi movl (12)(%ebp), %eax movdqa (%edi), %xmm0 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movdqa (%eax), %xmm1 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 psllq $(1), %xmm2 pxor %xmm0, %xmm2 psllq $(5), %xmm2 pxor %xmm0, %xmm2 psllq $(57), %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movdqa %xmm0, (%edi) pop %edi pop %esi pop %ebp ret .p2align 5, 0x90 .globl _AesGcmAuth_avx _AesGcmAuth_avx: push %ebp mov %esp, %ebp push %esi push %edi call .L__0002gas_3 .L__0002gas_3: pop %esi sub $(.L__0002gas_3-CONST_TABLE), %esi movl (8)(%ebp), %edi movdqa (%edi), %xmm0 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movl (20)(%ebp), %eax movdqa (%eax), %xmm1 movl (12)(%ebp), %ecx movl (16)(%ebp), %edx .p2align 5, 0x90 .Lauth_loopgas_3: movdqu (%ecx), %xmm2 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm2 add $(16), %ecx pxor %xmm2, %xmm0 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 psllq $(1), %xmm2 pxor %xmm0, %xmm2 psllq $(5), %xmm2 pxor %xmm0, %xmm2 psllq $(57), %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 sub $(16), %edx jnz .Lauth_loopgas_3 pshufb ((_u128_str-CONST_TABLE))(%esi), %xmm0 movdqa %xmm0, (%edi) pop %edi pop %esi pop %ebp ret .p2align 5, 0x90 .globl _AesGcmEnc_avx _AesGcmEnc_avx: push %ebp mov %esp, %ebp push %ebx push %esi push %edi sub $(152), %esp lea (16)(%esp), %ebx and $(-16), %ebx movl (20)(%ebp), %eax call .L__0003gas_4 .L__0003gas_4: pop %esi sub $(.L__0003gas_4-CONST_TABLE), %esi movdqa ((_u128_str-CONST_TABLE))(%esi), %xmm4 movdqa ((_inc1-CONST_TABLE))(%esi), %xmm5 movl (36)(%ebp), %eax movl (40)(%ebp), %ecx movl (32)(%ebp), %edx movdqu (%eax), %xmm0 movdqu (%ecx), %xmm1 movdqu (%edx), %xmm2 pshufb %xmm4, %xmm0 movdqa %xmm0, (%ebx) movdqa %xmm1, (16)(%ebx) pshufb %xmm4, %xmm2 pxor %xmm1, %xmm1 movdqa %xmm2, (32)(%ebx) movdqa %xmm1, (48)(%ebx) movdqa %xmm1, (64)(%ebx) movdqa %xmm1, (80)(%ebx) movdqa %xmm4, (96)(%ebx) movdqa %xmm5, (112)(%ebx) movl (28)(%ebp), %ecx movl (12)(%ebp), %esi movl (8)(%ebp), %edi movl (16)(%ebp), %eax mov $(63), %edx and %eax, %edx and $(-64), %eax movl %eax, (128)(%ebx) movl %edx, (132)(%ebx) jz .Lsingle_block_procgas_4 .p2align 5, 0x90 .Lblks4_loopgas_4: movdqa (112)(%ebx), %xmm5 movdqa %xmm0, %xmm1 paddd %xmm5, %xmm1 movdqa %xmm1, %xmm2 paddd %xmm5, %xmm2 movdqa %xmm2, %xmm3 paddd %xmm5, %xmm3 movdqa %xmm3, %xmm4 paddd %xmm5, %xmm4 movdqa %xmm4, (%ebx) movdqa (96)(%ebx), %xmm5 movdqa (%ecx), %xmm0 lea (16)(%ecx), %eax pshufb %xmm5, %xmm1 pshufb %xmm5, %xmm2 pshufb %xmm5, %xmm3 pshufb %xmm5, %xmm4 pxor %xmm0, %xmm1 pxor %xmm0, %xmm2 pxor %xmm0, %xmm3 pxor %xmm0, %xmm4 movdqa (%eax), %xmm0 add $(16), %eax movl (24)(%ebp), %edx sub $(1), %edx .p2align 5, 0x90 .Lcipher4_loopgas_4: aesenc %xmm0, %xmm1 aesenc %xmm0, %xmm2 aesenc %xmm0, %xmm3 aesenc %xmm0, %xmm4 movdqa (%eax), %xmm0 add $(16), %eax dec %edx jnz .Lcipher4_loopgas_4 aesenclast %xmm0, %xmm1 aesenclast %xmm0, %xmm2 aesenclast %xmm0, %xmm3 aesenclast %xmm0, %xmm4 movdqa (16)(%ebx), %xmm0 movdqa %xmm4, (16)(%ebx) movdqu (%esi), %xmm4 movdqu (16)(%esi), %xmm5 movdqu (32)(%esi), %xmm6 movdqu (48)(%esi), %xmm7 add $(64), %esi pxor %xmm4, %xmm0 movdqu %xmm0, (%edi) pshufb (96)(%ebx), %xmm0 pxor (32)(%ebx), %xmm0 pxor %xmm5, %xmm1 movdqu %xmm1, (16)(%edi) pshufb (96)(%ebx), %xmm1 pxor (48)(%ebx), %xmm1 pxor %xmm6, %xmm2 movdqu %xmm2, (32)(%edi) pshufb (96)(%ebx), %xmm2 pxor (64)(%ebx), %xmm2 pxor %xmm7, %xmm3 movdqu %xmm3, (48)(%edi) pshufb (96)(%ebx), %xmm3 pxor (80)(%ebx), %xmm3 add $(64), %edi movl (44)(%ebp), %eax movdqa (32)(%eax), %xmm7 cmpl $(64), (128)(%ebx) je .Lcombine_hashgas_4 pshufd $(78), %xmm0, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm0, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm0, %xmm5 pclmulqdq $(0), %xmm7, %xmm0 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm0, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm0 movdqa %xmm0, %xmm4 psllq $(1), %xmm4 pxor %xmm0, %xmm4 psllq $(5), %xmm4 pxor %xmm0, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm0 pxor %xmm4, %xmm5 movdqa %xmm0, %xmm6 psrlq $(5), %xmm6 pxor %xmm0, %xmm6 psrlq $(1), %xmm6 pxor %xmm0, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm0 pxor %xmm5, %xmm0 pshufd $(78), %xmm1, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm1, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm1, %xmm5 pclmulqdq $(0), %xmm7, %xmm1 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm1, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm1 movdqa %xmm1, %xmm4 psllq $(1), %xmm4 pxor %xmm1, %xmm4 psllq $(5), %xmm4 pxor %xmm1, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm1 pxor %xmm4, %xmm5 movdqa %xmm1, %xmm6 psrlq $(5), %xmm6 pxor %xmm1, %xmm6 psrlq $(1), %xmm6 pxor %xmm1, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm1 pxor %xmm5, %xmm1 pshufd $(78), %xmm2, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm2, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm2, %xmm5 pclmulqdq $(0), %xmm7, %xmm2 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm2, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm2 movdqa %xmm2, %xmm4 psllq $(1), %xmm4 pxor %xmm2, %xmm4 psllq $(5), %xmm4 pxor %xmm2, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm2 pxor %xmm4, %xmm5 movdqa %xmm2, %xmm6 psrlq $(5), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm2 pxor %xmm5, %xmm2 pshufd $(78), %xmm3, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm3, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm3, %xmm5 pclmulqdq $(0), %xmm7, %xmm3 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm3, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm3 movdqa %xmm3, %xmm4 psllq $(1), %xmm4 pxor %xmm3, %xmm4 psllq $(5), %xmm4 pxor %xmm3, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm3 pxor %xmm4, %xmm5 movdqa %xmm3, %xmm6 psrlq $(5), %xmm6 pxor %xmm3, %xmm6 psrlq $(1), %xmm6 pxor %xmm3, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm3 pxor %xmm5, %xmm3 movdqa %xmm0, (32)(%ebx) movdqa %xmm1, (48)(%ebx) movdqa %xmm2, (64)(%ebx) movdqa %xmm3, (80)(%ebx) movdqa (%ebx), %xmm0 subl $(64), (128)(%ebx) jge .Lblks4_loopgas_4 .Lcombine_hashgas_4: pshufd $(78), %xmm0, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm0, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm0, %xmm5 pclmulqdq $(0), %xmm7, %xmm0 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm0, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm0 movdqa %xmm0, %xmm4 psllq $(1), %xmm4 pxor %xmm0, %xmm4 psllq $(5), %xmm4 pxor %xmm0, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm0 pxor %xmm4, %xmm5 movdqa %xmm0, %xmm6 psrlq $(5), %xmm6 pxor %xmm0, %xmm6 psrlq $(1), %xmm6 pxor %xmm0, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm0 pxor %xmm5, %xmm0 movdqa (16)(%eax), %xmm7 pshufd $(78), %xmm1, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm1, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm1, %xmm5 pclmulqdq $(0), %xmm7, %xmm1 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm1, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm1 movdqa %xmm1, %xmm4 psllq $(1), %xmm4 pxor %xmm1, %xmm4 psllq $(5), %xmm4 pxor %xmm1, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm1 pxor %xmm4, %xmm5 movdqa %xmm1, %xmm6 psrlq $(5), %xmm6 pxor %xmm1, %xmm6 psrlq $(1), %xmm6 pxor %xmm1, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm1 pxor %xmm5, %xmm1 movdqa (%eax), %xmm7 pshufd $(78), %xmm2, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm2, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm2, %xmm5 pclmulqdq $(0), %xmm7, %xmm2 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm2, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm2 movdqa %xmm2, %xmm4 psllq $(1), %xmm4 pxor %xmm2, %xmm4 psllq $(5), %xmm4 pxor %xmm2, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm2 pxor %xmm4, %xmm5 movdqa %xmm2, %xmm6 psrlq $(5), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm2, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm2 pxor %xmm5, %xmm2 pxor %xmm1, %xmm3 pxor %xmm2, %xmm3 pshufd $(78), %xmm3, %xmm6 pshufd $(78), %xmm7, %xmm4 pxor %xmm3, %xmm6 pxor %xmm7, %xmm4 pclmulqdq $(0), %xmm4, %xmm6 movdqa %xmm3, %xmm5 pclmulqdq $(0), %xmm7, %xmm3 pxor %xmm4, %xmm4 pclmulqdq $(17), %xmm7, %xmm5 pxor %xmm3, %xmm6 pxor %xmm5, %xmm6 palignr $(8), %xmm6, %xmm4 pslldq $(8), %xmm6 pxor %xmm4, %xmm5 pxor %xmm6, %xmm3 movdqa %xmm3, %xmm4 psllq $(1), %xmm4 pxor %xmm3, %xmm4 psllq $(5), %xmm4 pxor %xmm3, %xmm4 psllq $(57), %xmm4 movdqa %xmm4, %xmm6 pslldq $(8), %xmm6 psrldq $(8), %xmm4 pxor %xmm6, %xmm3 pxor %xmm4, %xmm5 movdqa %xmm3, %xmm6 psrlq $(5), %xmm6 pxor %xmm3, %xmm6 psrlq $(1), %xmm6 pxor %xmm3, %xmm6 psrlq $(1), %xmm6 pxor %xmm6, %xmm3 pxor %xmm5, %xmm3 pxor %xmm0, %xmm3 movdqa %xmm3, (32)(%ebx) .Lsingle_block_procgas_4: cmpl $(0), (132)(%ebx) jz .Lquitgas_4 .p2align 5, 0x90 .Lblk_loopgas_4: movdqa (%ebx), %xmm0 movdqa %xmm0, %xmm1 paddd (112)(%ebx), %xmm1 movdqa %xmm1, (%ebx) movdqa (%ecx), %xmm0 lea (16)(%ecx), %eax pshufb (96)(%ebx), %xmm1 pxor %xmm0, %xmm1 movdqa (%eax), %xmm0 add $(16), %eax movl (24)(%ebp), %edx sub $(1), %edx .p2align 5, 0x90 .Lcipher_loopgas_4: aesenc %xmm0, %xmm1 movdqa (%eax), %xmm0 add $(16), %eax dec %edx jnz .Lcipher_loopgas_4 aesenclast %xmm0, %xmm1 movdqa (16)(%ebx), %xmm0 movdqa %xmm1, (16)(%ebx) movdqu (%esi), %xmm1 add $(16), %esi pxor %xmm1, %xmm0 movdqu %xmm0, (%edi) add $(16), %edi movl (44)(%ebp), %eax pshufb (96)(%ebx), %xmm0 pxor (32)(%ebx), %xmm0 movdqa (%eax), %xmm1 pshufd $(78), %xmm0, %xmm4 pshufd $(78), %xmm1, %xmm2 pxor %xmm0, %xmm4 pxor %xmm1, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm0, %xmm3 pclmulqdq $(0), %xmm1, %xmm0 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm1, %xmm3 pxor %xmm0, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm0 movdqa %xmm0, %xmm2 psllq $(1), %xmm2 pxor %xmm0, %xmm2 psllq $(5), %xmm2 pxor %xmm0, %xmm2 psllq $(57), %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm0 pxor %xmm2, %xmm3 movdqa %xmm0, %xmm4 psrlq $(5), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm0, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm0 pxor %xmm3, %xmm0 movdqa %xmm0, (32)(%ebx) subl $(16), (132)(%ebx) jg .Lblk_loopgas_4 .Lquitgas_4: movdqa (96)(%ebx), %xmm4 movdqa (%ebx), %xmm0 movdqa (16)(%ebx), %xmm1 movdqa (32)(%ebx), %xmm2 movl (36)(%ebp), %eax movl (40)(%ebp), %ecx movl (32)(%ebp), %edx pshufb %xmm4, %xmm0 movdqu %xmm0, (%eax) movdqu %xmm1, (%ecx) pshufb %xmm4, %xmm2 movdqu %xmm2, (%edx) add $(152), %esp pop %edi pop %esi pop %ebx pop %ebp ret .p2align 5, 0x90 .globl _AesGcmDec_avx _AesGcmDec_avx: push %ebp mov %esp, %ebp push %ebx push %esi push %edi sub $(152), %esp lea (16)(%esp), %ebx and $(-16), %ebx movl (20)(%ebp), %eax call .L__0004gas_5 .L__0004gas_5: pop %esi sub $(.L__0004gas_5-CONST_TABLE), %esi movdqa ((_u128_str-CONST_TABLE))(%esi), %xmm4 movdqa ((_inc1-CONST_TABLE))(%esi), %xmm5 movl (36)(%ebp), %eax movl (40)(%ebp), %ecx movl (32)(%ebp), %edx movdqu (%eax), %xmm0 movdqu (%ecx), %xmm1 movdqu (%edx), %xmm2 pshufb %xmm4, %xmm0 movdqa %xmm0, (%ebx) movdqa %xmm1, (16)(%ebx) pshufb %xmm4, %xmm2 pxor %xmm1, %xmm1 movdqa %xmm2, (32)(%ebx) movdqa %xmm1, (48)(%ebx) movdqa %xmm1, (64)(%ebx) movdqa %xmm1, (80)(%ebx) movdqa %xmm4, (96)(%ebx) movdqa %xmm5, (112)(%ebx) movl (28)(%ebp), %ecx movl (12)(%ebp), %esi movl (8)(%ebp), %edi movl (16)(%ebp), %eax mov $(63), %edx and %eax, %edx and $(-64), %eax movl %eax, (128)(%ebx) movl %edx, (132)(%ebx) jz .Lsingle_block_procgas_5 .p2align 5, 0x90 .Lblks4_loopgas_5: movdqa (112)(%ebx), %xmm5 movdqa %xmm0, %xmm1 paddd %xmm5, %xmm1 movdqa %xmm1, %xmm2 paddd %xmm5, %xmm2 movdqa %xmm2, %xmm3 paddd %xmm5, %xmm3 movdqa %xmm3, %xmm4 paddd %xmm5, %xmm4 movdqa %xmm4, (%ebx) movdqa (96)(%ebx), %xmm5 movdqa (%ecx), %xmm0 lea (16)(%ecx), %eax pshufb %xmm5, %xmm1 pshufb %xmm5, %xmm2 pshufb %xmm5, %xmm3 pshufb %xmm5, %xmm4 pxor %xmm0, %xmm1 pxor %xmm0, %xmm2 pxor %xmm0, %xmm3 pxor %xmm0, %xmm4 movdqa (%eax), %xmm0 add $(16), %eax movl (24)(%ebp), %edx sub $(1), %edx .p2align 5, 0x90 .Lcipher4_loopgas_5: aesenc %xmm0, %xmm1 aesenc %xmm0, %xmm2 aesenc %xmm0, %xmm3 aesenc %xmm0, %xmm4 movdqa (%eax), %xmm0 add $(16), %eax dec %edx jnz .Lcipher4_loopgas_5 aesenclast %xmm0, %xmm1 aesenclast %xmm0, %xmm2 aesenclast %xmm0, %xmm3 aesenclast %xmm0, %xmm4 movdqa (16)(%ebx), %xmm0 movdqa %xmm4, (16)(%ebx) movdqu (%esi), %xmm4 movdqu (16)(%esi), %xmm5 movdqu (32)(%esi), %xmm6 movdqu (48)(%esi), %xmm7 add $(64), %esi pxor %xmm4, %xmm0 movdqu %xmm0, (%edi) pshufb (96)(%ebx), %xmm4 pxor (32)(%ebx), %xmm4 pxor %xmm5, %xmm1 movdqu %xmm1, (16)(%edi) pshufb (96)(%ebx), %xmm5 pxor (48)(%ebx), %xmm5 pxor %xmm6, %xmm2 movdqu %xmm2, (32)(%edi) pshufb (96)(%ebx), %xmm6 pxor (64)(%ebx), %xmm6 pxor %xmm7, %xmm3 movdqu %xmm3, (48)(%edi) pshufb (96)(%ebx), %xmm7 pxor (80)(%ebx), %xmm7 add $(64), %edi movl (44)(%ebp), %eax movdqa (32)(%eax), %xmm0 cmpl $(64), (128)(%ebx) je .Lcombine_hashgas_5 pshufd $(78), %xmm4, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm4, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm4, %xmm2 pclmulqdq $(0), %xmm0, %xmm4 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm4, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm4 movdqa %xmm4, %xmm1 psllq $(1), %xmm1 pxor %xmm4, %xmm1 psllq $(5), %xmm1 pxor %xmm4, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm4 pxor %xmm1, %xmm2 movdqa %xmm4, %xmm3 psrlq $(5), %xmm3 pxor %xmm4, %xmm3 psrlq $(1), %xmm3 pxor %xmm4, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm4 pxor %xmm2, %xmm4 pshufd $(78), %xmm5, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm5, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm5, %xmm2 pclmulqdq $(0), %xmm0, %xmm5 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm5, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm5 movdqa %xmm5, %xmm1 psllq $(1), %xmm1 pxor %xmm5, %xmm1 psllq $(5), %xmm1 pxor %xmm5, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm5 pxor %xmm1, %xmm2 movdqa %xmm5, %xmm3 psrlq $(5), %xmm3 pxor %xmm5, %xmm3 psrlq $(1), %xmm3 pxor %xmm5, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm5 pxor %xmm2, %xmm5 pshufd $(78), %xmm6, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm6, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm6, %xmm2 pclmulqdq $(0), %xmm0, %xmm6 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm6, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm6 movdqa %xmm6, %xmm1 psllq $(1), %xmm1 pxor %xmm6, %xmm1 psllq $(5), %xmm1 pxor %xmm6, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm6 pxor %xmm1, %xmm2 movdqa %xmm6, %xmm3 psrlq $(5), %xmm3 pxor %xmm6, %xmm3 psrlq $(1), %xmm3 pxor %xmm6, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm6 pxor %xmm2, %xmm6 pshufd $(78), %xmm7, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm7, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm7, %xmm2 pclmulqdq $(0), %xmm0, %xmm7 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm7, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm7 movdqa %xmm7, %xmm1 psllq $(1), %xmm1 pxor %xmm7, %xmm1 psllq $(5), %xmm1 pxor %xmm7, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm7 pxor %xmm1, %xmm2 movdqa %xmm7, %xmm3 psrlq $(5), %xmm3 pxor %xmm7, %xmm3 psrlq $(1), %xmm3 pxor %xmm7, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm7 pxor %xmm2, %xmm7 movdqa %xmm4, (32)(%ebx) movdqa %xmm5, (48)(%ebx) movdqa %xmm6, (64)(%ebx) movdqa %xmm7, (80)(%ebx) movdqa (%ebx), %xmm0 subl $(64), (128)(%ebx) jge .Lblks4_loopgas_5 .Lcombine_hashgas_5: pshufd $(78), %xmm4, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm4, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm4, %xmm2 pclmulqdq $(0), %xmm0, %xmm4 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm4, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm4 movdqa %xmm4, %xmm1 psllq $(1), %xmm1 pxor %xmm4, %xmm1 psllq $(5), %xmm1 pxor %xmm4, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm4 pxor %xmm1, %xmm2 movdqa %xmm4, %xmm3 psrlq $(5), %xmm3 pxor %xmm4, %xmm3 psrlq $(1), %xmm3 pxor %xmm4, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm4 pxor %xmm2, %xmm4 movdqa (16)(%eax), %xmm0 pshufd $(78), %xmm5, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm5, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm5, %xmm2 pclmulqdq $(0), %xmm0, %xmm5 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm5, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm5 movdqa %xmm5, %xmm1 psllq $(1), %xmm1 pxor %xmm5, %xmm1 psllq $(5), %xmm1 pxor %xmm5, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm5 pxor %xmm1, %xmm2 movdqa %xmm5, %xmm3 psrlq $(5), %xmm3 pxor %xmm5, %xmm3 psrlq $(1), %xmm3 pxor %xmm5, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm5 pxor %xmm2, %xmm5 movdqa (%eax), %xmm0 pshufd $(78), %xmm6, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm6, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm6, %xmm2 pclmulqdq $(0), %xmm0, %xmm6 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm6, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm6 movdqa %xmm6, %xmm1 psllq $(1), %xmm1 pxor %xmm6, %xmm1 psllq $(5), %xmm1 pxor %xmm6, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm6 pxor %xmm1, %xmm2 movdqa %xmm6, %xmm3 psrlq $(5), %xmm3 pxor %xmm6, %xmm3 psrlq $(1), %xmm3 pxor %xmm6, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm6 pxor %xmm2, %xmm6 pxor %xmm5, %xmm7 pxor %xmm6, %xmm7 pshufd $(78), %xmm7, %xmm3 pshufd $(78), %xmm0, %xmm1 pxor %xmm7, %xmm3 pxor %xmm0, %xmm1 pclmulqdq $(0), %xmm1, %xmm3 movdqa %xmm7, %xmm2 pclmulqdq $(0), %xmm0, %xmm7 pxor %xmm1, %xmm1 pclmulqdq $(17), %xmm0, %xmm2 pxor %xmm7, %xmm3 pxor %xmm2, %xmm3 palignr $(8), %xmm3, %xmm1 pslldq $(8), %xmm3 pxor %xmm1, %xmm2 pxor %xmm3, %xmm7 movdqa %xmm7, %xmm1 psllq $(1), %xmm1 pxor %xmm7, %xmm1 psllq $(5), %xmm1 pxor %xmm7, %xmm1 psllq $(57), %xmm1 movdqa %xmm1, %xmm3 pslldq $(8), %xmm3 psrldq $(8), %xmm1 pxor %xmm3, %xmm7 pxor %xmm1, %xmm2 movdqa %xmm7, %xmm3 psrlq $(5), %xmm3 pxor %xmm7, %xmm3 psrlq $(1), %xmm3 pxor %xmm7, %xmm3 psrlq $(1), %xmm3 pxor %xmm3, %xmm7 pxor %xmm2, %xmm7 pxor %xmm4, %xmm7 movdqa %xmm7, (32)(%ebx) .Lsingle_block_procgas_5: cmpl $(0), (132)(%ebx) jz .Lquitgas_5 .p2align 5, 0x90 .Lblk_loopgas_5: movdqa (%ebx), %xmm0 movdqa %xmm0, %xmm1 paddd (112)(%ebx), %xmm1 movdqa %xmm1, (%ebx) movdqa (%ecx), %xmm0 lea (16)(%ecx), %eax pshufb (96)(%ebx), %xmm1 pxor %xmm0, %xmm1 movdqa (%eax), %xmm0 add $(16), %eax movl (24)(%ebp), %edx sub $(1), %edx .p2align 5, 0x90 .Lcipher_loopgas_5: aesenc %xmm0, %xmm1 movdqa (%eax), %xmm0 add $(16), %eax dec %edx jnz .Lcipher_loopgas_5 aesenclast %xmm0, %xmm1 movdqa (16)(%ebx), %xmm0 movdqa %xmm1, (16)(%ebx) movdqu (%esi), %xmm1 add $(16), %esi pxor %xmm1, %xmm0 movdqu %xmm0, (%edi) add $(16), %edi movl (44)(%ebp), %eax pshufb (96)(%ebx), %xmm1 pxor (32)(%ebx), %xmm1 movdqa (%eax), %xmm0 pshufd $(78), %xmm1, %xmm4 pshufd $(78), %xmm0, %xmm2 pxor %xmm1, %xmm4 pxor %xmm0, %xmm2 pclmulqdq $(0), %xmm2, %xmm4 movdqa %xmm1, %xmm3 pclmulqdq $(0), %xmm0, %xmm1 pxor %xmm2, %xmm2 pclmulqdq $(17), %xmm0, %xmm3 pxor %xmm1, %xmm4 pxor %xmm3, %xmm4 palignr $(8), %xmm4, %xmm2 pslldq $(8), %xmm4 pxor %xmm2, %xmm3 pxor %xmm4, %xmm1 movdqa %xmm1, %xmm2 psllq $(1), %xmm2 pxor %xmm1, %xmm2 psllq $(5), %xmm2 pxor %xmm1, %xmm2 psllq $(57), %xmm2 movdqa %xmm2, %xmm4 pslldq $(8), %xmm4 psrldq $(8), %xmm2 pxor %xmm4, %xmm1 pxor %xmm2, %xmm3 movdqa %xmm1, %xmm4 psrlq $(5), %xmm4 pxor %xmm1, %xmm4 psrlq $(1), %xmm4 pxor %xmm1, %xmm4 psrlq $(1), %xmm4 pxor %xmm4, %xmm1 pxor %xmm3, %xmm1 movdqa %xmm1, (32)(%ebx) subl $(16), (132)(%ebx) jg .Lblk_loopgas_5 .Lquitgas_5: movdqa (96)(%ebx), %xmm4 movdqa (%ebx), %xmm0 movdqa (16)(%ebx), %xmm1 movdqa (32)(%ebx), %xmm2 movl (36)(%ebp), %eax movl (40)(%ebp), %ecx movl (32)(%ebp), %edx pshufb %xmm4, %xmm0 movdqu %xmm0, (%eax) movdqu %xmm1, (%ecx) pshufb %xmm4, %xmm2 movdqu %xmm2, (%edx) add $(152), %esp pop %edi pop %esi pop %ebx pop %ebp ret ",16283,True,4919.7254539555615,median "; ; jidctint.asm - accurate integer IDCT (64-bit SSE2) ; ; Copyright 2009 Pierre Ossman for Cendio AB ; Copyright (C) 2009, 2016, 2020, D. R. Commander. ; ; Based on the x86 SIMD extension for IJG JPEG library ; Copyright (C) 1999-2006, MIYASAKA Masaru. ; For conditions of distribution and use, see copyright notice in jsimdext.inc ; ; This file should be assembled with NASM (Netwide Assembler), ; can *not* be assembled with Microsoft's MASM or any compatible ; assembler (including Borland's Turbo Assembler). ; NASM is available from http://nasm.sourceforge.net/ or ; http://sourceforge.net/project/showfiles.php?group_id=6208 ; ; This file contains a slower but more accurate integer implementation of the ; inverse DCT (Discrete Cosine Transform). The following code is based ; directly on the IJG's original jidctint.c; see the jidctint.c for ; more details. %include ""jsimdext.inc"" %include ""jdct.inc"" ; -------------------------------------------------------------------------- %define CONST_BITS 13 %define PASS1_BITS 2 %define DESCALE_P1 (CONST_BITS - PASS1_BITS) %define DESCALE_P2 (CONST_BITS + PASS1_BITS + 3) %if CONST_BITS == 13 F_0_298 equ 2446 ; FIX(0.298631336) F_0_390 equ 3196 ; FIX(0.390180644) F_0_541 equ 4433 ; FIX(0.541196100) F_0_765 equ 6270 ; FIX(0.765366865) F_0_899 equ 7373 ; FIX(0.899976223) F_1_175 equ 9633 ; FIX(1.175875602) F_1_501 equ 12299 ; FIX(1.501321110) F_1_847 equ 15137 ; FIX(1.847759065) F_1_961 equ 16069 ; FIX(1.961570560) F_2_053 equ 16819 ; FIX(2.053119869) F_2_562 equ 20995 ; FIX(2.562915447) F_3_072 equ 25172 ; FIX(3.072711026) %else ; NASM cannot do compile-time arithmetic on floating-point constants. %define DESCALE(x, n) (((x) + (1 << ((n) - 1))) >> (n)) F_0_298 equ DESCALE( 320652955, 30 - CONST_BITS) ; FIX(0.298631336) F_0_390 equ DESCALE( 418953276, 30 - CONST_BITS) ; FIX(0.390180644) F_0_541 equ DESCALE( 581104887, 30 - CONST_BITS) ; FIX(0.541196100) F_0_765 equ DESCALE( 821806413, 30 - CONST_BITS) ; FIX(0.765366865) F_0_899 equ DESCALE( 966342111, 30 - CONST_BITS) ; FIX(0.899976223) F_1_175 equ DESCALE(1262586813, 30 - CONST_BITS) ; FIX(1.175875602) F_1_501 equ DESCALE(1612031267, 30 - CONST_BITS) ; FIX(1.501321110) F_1_847 equ DESCALE(1984016188, 30 - CONST_BITS) ; FIX(1.847759065) F_1_961 equ DESCALE(2106220350, 30 - CONST_BITS) ; FIX(1.961570560) F_2_053 equ DESCALE(2204520673, 30 - CONST_BITS) ; FIX(2.053119869) F_2_562 equ DESCALE(2751909506, 30 - CONST_BITS) ; FIX(2.562915447) F_3_072 equ DESCALE(3299298341, 30 - CONST_BITS) ; FIX(3.072711026) %endif ; -------------------------------------------------------------------------- SECTION SEG_CONST alignz 32 GLOBAL_DATA(jconst_idct_islow_sse2) EXTN(jconst_idct_islow_sse2): PW_F130_F054 times 4 dw (F_0_541 + F_0_765), F_0_541 PW_F054_MF130 times 4 dw F_0_541, (F_0_541 - F_1_847) PW_MF078_F117 times 4 dw (F_1_175 - F_1_961), F_1_175 PW_F117_F078 times 4 dw F_1_175, (F_1_175 - F_0_390) PW_MF060_MF089 times 4 dw (F_0_298 - F_0_899), -F_0_899 PW_MF089_F060 times 4 dw -F_0_899, (F_1_501 - F_0_899) PW_MF050_MF256 times 4 dw (F_2_053 - F_2_562), -F_2_562 PW_MF256_F050 times 4 dw -F_2_562, (F_3_072 - F_2_562) PD_DESCALE_P1 times 4 dd 1 << (DESCALE_P1 - 1) PD_DESCALE_P2 times 4 dd 1 << (DESCALE_P2 - 1) PB_CENTERJSAMP times 16 db CENTERJSAMPLE alignz 32 ; -------------------------------------------------------------------------- SECTION SEG_TEXT BITS 64 ; ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) ; jsimd_idct_islow_sse2(void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; ; r10 = jpeg_component_info *compptr ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13d = JDIMENSION output_col %define original_rbp rbp + 0 %define wk(i) rbp - (WK_NUM - (i)) * SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 12 align 32 GLOBAL_FUNCTION(jsimd_idct_islow_sse2) EXTN(jsimd_idct_islow_sse2): push rbp mov rax, rsp ; rax = original rbp sub rsp, byte 4 and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits mov [rsp], rax mov rbp, rsp ; rbp = aligned rbp lea rsp, [wk(0)] collect_args 4 ; ---- Pass 1: process columns from input. mov rdx, r10 ; quantptr mov rsi, r11 ; inptr %ifndef NO_ZERO_COLUMN_TEST_ISLOW_SSE2 mov eax, dword [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)] or eax, dword [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)] jnz near .columnDCT movdqa xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] por xmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] por xmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] por xmm1, xmm0 packsswb xmm1, xmm1 packsswb xmm1, xmm1 movd eax, xmm1 test rax, rax jnz short .columnDCT ; -- AC terms all zero movdqa xmm5, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] pmullw xmm5, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] psllw xmm5, PASS1_BITS movdqa xmm4, xmm5 ; xmm5=in0=(00 01 02 03 04 05 06 07) punpcklwd xmm5, xmm5 ; xmm5=(00 00 01 01 02 02 03 03) punpckhwd xmm4, xmm4 ; xmm4=(04 04 05 05 06 06 07 07) pshufd xmm7, xmm5, 0x00 ; xmm7=col0=(00 00 00 00 00 00 00 00) pshufd xmm6, xmm5, 0x55 ; xmm6=col1=(01 01 01 01 01 01 01 01) pshufd xmm1, xmm5, 0xAA ; xmm1=col2=(02 02 02 02 02 02 02 02) pshufd xmm5, xmm5, 0xFF ; xmm5=col3=(03 03 03 03 03 03 03 03) pshufd xmm0, xmm4, 0x00 ; xmm0=col4=(04 04 04 04 04 04 04 04) pshufd xmm3, xmm4, 0x55 ; xmm3=col5=(05 05 05 05 05 05 05 05) pshufd xmm2, xmm4, 0xAA ; xmm2=col6=(06 06 06 06 06 06 06 06) pshufd xmm4, xmm4, 0xFF ; xmm4=col7=(07 07 07 07 07 07 07 07) movdqa XMMWORD [wk(8)], xmm6 ; wk(8)=col1 movdqa XMMWORD [wk(9)], xmm5 ; wk(9)=col3 movdqa XMMWORD [wk(10)], xmm3 ; wk(10)=col5 movdqa XMMWORD [wk(11)], xmm4 ; wk(11)=col7 jmp near .column_end %endif .columnDCT: ; -- Even part movdqa xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)] movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)] pmullw xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)] pmullw xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] ; (Original) ; z1 = (z2 + z3) * 0.541196100; ; tmp2 = z1 + z3 * -1.847759065; ; tmp3 = z1 + z2 * 0.765366865; ; ; (This implementation) ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065); ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100; movdqa xmm4, xmm1 ; xmm1=in2=z2 movdqa xmm5, xmm1 punpcklwd xmm4, xmm3 ; xmm3=in6=z3 punpckhwd xmm5, xmm3 movdqa xmm1, xmm4 movdqa xmm3, xmm5 pmaddwd xmm4, [rel PW_F130_F054] ; xmm4=tmp3L pmaddwd xmm5, [rel PW_F130_F054] ; xmm5=tmp3H pmaddwd xmm1, [rel PW_F054_MF130] ; xmm1=tmp2L pmaddwd xmm3, [rel PW_F054_MF130] ; xmm3=tmp2H movdqa xmm6, xmm0 paddw xmm0, xmm2 ; xmm0=in0+in4 psubw xmm6, xmm2 ; xmm6=in0-in4 pxor xmm7, xmm7 pxor xmm2, xmm2 punpcklwd xmm7, xmm0 ; xmm7=tmp0L punpckhwd xmm2, xmm0 ; xmm2=tmp0H psrad xmm7, (16-CONST_BITS) ; psrad xmm7,16 & pslld xmm7,CONST_BITS psrad xmm2, (16-CONST_BITS) ; psrad xmm2,16 & pslld xmm2,CONST_BITS movdqa xmm0, xmm7 paddd xmm7, xmm4 ; xmm7=tmp10L psubd xmm0, xmm4 ; xmm0=tmp13L movdqa xmm4, xmm2 paddd xmm2, xmm5 ; xmm2=tmp10H psubd xmm4, xmm5 ; xmm4=tmp13H movdqa XMMWORD [wk(0)], xmm7 ; wk(0)=tmp10L movdqa XMMWORD [wk(1)], xmm2 ; wk(1)=tmp10H movdqa XMMWORD [wk(2)], xmm0 ; wk(2)=tmp13L movdqa XMMWORD [wk(3)], xmm4 ; wk(3)=tmp13H pxor xmm5, xmm5 pxor xmm7, xmm7 punpcklwd xmm5, xmm6 ; xmm5=tmp1L punpckhwd xmm7, xmm6 ; xmm7=tmp1H psrad xmm5, (16-CONST_BITS) ; psrad xmm5,16 & pslld xmm5,CONST_BITS psrad xmm7, (16-CONST_BITS) ; psrad xmm7,16 & pslld xmm7,CONST_BITS movdqa xmm2, xmm5 paddd xmm5, xmm1 ; xmm5=tmp11L psubd xmm2, xmm1 ; xmm2=tmp12L movdqa xmm0, xmm7 paddd xmm7, xmm3 ; xmm7=tmp11H psubd xmm0, xmm3 ; xmm0=tmp12H movdqa XMMWORD [wk(4)], xmm5 ; wk(4)=tmp11L movdqa XMMWORD [wk(5)], xmm7 ; wk(5)=tmp11H movdqa XMMWORD [wk(6)], xmm2 ; wk(6)=tmp12L movdqa XMMWORD [wk(7)], xmm0 ; wk(7)=tmp12H ; -- Odd part movdqa xmm4, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)] movdqa xmm6, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)] pmullw xmm4, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm6, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm1, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)] movdqa xmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)] pmullw xmm1, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] pmullw xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)] movdqa xmm5, xmm6 movdqa xmm7, xmm4 paddw xmm5, xmm3 ; xmm5=z3 paddw xmm7, xmm1 ; xmm7=z4 ; (Original) ; z5 = (z3 + z4) * 1.175875602; ; z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; ; z3 += z5; z4 += z5; ; ; (This implementation) ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); movdqa xmm2, xmm5 movdqa xmm0, xmm5 punpcklwd xmm2, xmm7 punpckhwd xmm0, xmm7 movdqa xmm5, xmm2 movdqa xmm7, xmm0 pmaddwd xmm2, [rel PW_MF078_F117] ; xmm2=z3L pmaddwd xmm0, [rel PW_MF078_F117] ; xmm0=z3H pmaddwd xmm5, [rel PW_F117_F078] ; xmm5=z4L pmaddwd xmm7, [rel PW_F117_F078] ; xmm7=z4H movdqa XMMWORD [wk(10)], xmm2 ; wk(10)=z3L movdqa XMMWORD [wk(11)], xmm0 ; wk(11)=z3H ; (Original) ; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; ; tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869; ; tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110; ; z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; ; tmp0 += z1 + z3; tmp1 += z2 + z4; ; tmp2 += z2 + z3; tmp3 += z1 + z4; ; ; (This implementation) ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223; ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447; ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447); ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223); ; tmp0 += z3; tmp1 += z4; ; tmp2 += z3; tmp3 += z4; movdqa xmm2, xmm3 movdqa xmm0, xmm3 punpcklwd xmm2, xmm4 punpckhwd xmm0, xmm4 movdqa xmm3, xmm2 movdqa xmm4, xmm0 pmaddwd xmm2, [rel PW_MF060_MF089] ; xmm2=tmp0L pmaddwd xmm0, [rel PW_MF060_MF089] ; xmm0=tmp0H pmaddwd xmm3, [rel PW_MF089_F060] ; xmm3=tmp3L pmaddwd xmm4, [rel PW_MF089_F060] ; xmm4=tmp3H paddd xmm2, XMMWORD [wk(10)] ; xmm2=tmp0L paddd xmm0, XMMWORD [wk(11)] ; xmm0=tmp0H paddd xmm3, xmm5 ; xmm3=tmp3L paddd xmm4, xmm7 ; xmm4=tmp3H movdqa XMMWORD [wk(8)], xmm2 ; wk(8)=tmp0L movdqa XMMWORD [wk(9)], xmm0 ; wk(9)=tmp0H movdqa xmm2, xmm1 movdqa xmm0, xmm1 punpcklwd xmm2, xmm6 punpckhwd xmm0, xmm6 movdqa xmm1, xmm2 movdqa xmm6, xmm0 pmaddwd xmm2, [rel PW_MF050_MF256] ; xmm2=tmp1L pmaddwd xmm0, [rel PW_MF050_MF256] ; xmm0=tmp1H pmaddwd xmm1, [rel PW_MF256_F050] ; xmm1=tmp2L pmaddwd xmm6, [rel PW_MF256_F050] ; xmm6=tmp2H paddd xmm2, xmm5 ; xmm2=tmp1L paddd xmm0, xmm7 ; xmm0=tmp1H paddd xmm1, XMMWORD [wk(10)] ; xmm1=tmp2L paddd xmm6, XMMWORD [wk(11)] ; xmm6=tmp2H movdqa XMMWORD [wk(10)], xmm2 ; wk(10)=tmp1L movdqa XMMWORD [wk(11)], xmm0 ; wk(11)=tmp1H ; -- Final output stage movdqa xmm5, XMMWORD [wk(0)] ; xmm5=tmp10L movdqa xmm7, XMMWORD [wk(1)] ; xmm7=tmp10H movdqa xmm2, xmm5 movdqa xmm0, xmm7 paddd xmm5, xmm3 ; xmm5=data0L paddd xmm7, xmm4 ; xmm7=data0H psubd xmm2, xmm3 ; xmm2=data7L psubd xmm0, xmm4 ; xmm0=data7H movdqa xmm3, [rel PD_DESCALE_P1] ; xmm3=[rel PD_DESCALE_P1] paddd xmm5, xmm3 paddd xmm7, xmm3 psrad xmm5, DESCALE_P1 psrad xmm7, DESCALE_P1 paddd xmm2, xmm3 paddd xmm0, xmm3 psrad xmm2, DESCALE_P1 psrad xmm0, DESCALE_P1 packssdw xmm5, xmm7 ; xmm5=data0=(00 01 02 03 04 05 06 07) packssdw xmm2, xmm0 ; xmm2=data7=(70 71 72 73 74 75 76 77) movdqa xmm4, XMMWORD [wk(4)] ; xmm4=tmp11L movdqa xmm3, XMMWORD [wk(5)] ; xmm3=tmp11H movdqa xmm7, xmm4 movdqa xmm0, xmm3 paddd xmm4, xmm1 ; xmm4=data1L paddd xmm3, xmm6 ; xmm3=data1H psubd xmm7, xmm1 ; xmm7=data6L psubd xmm0, xmm6 ; xmm0=data6H movdqa xmm1, [rel PD_DESCALE_P1] ; xmm1=[rel PD_DESCALE_P1] paddd xmm4, xmm1 paddd xmm3, xmm1 psrad xmm4, DESCALE_P1 psrad xmm3, DESCALE_P1 paddd xmm7, xmm1 paddd xmm0, xmm1 psrad xmm7, DESCALE_P1 psrad xmm0, DESCALE_P1 packssdw xmm4, xmm3 ; xmm4=data1=(10 11 12 13 14 15 16 17) packssdw xmm7, xmm0 ; xmm7=data6=(60 61 62 63 64 65 66 67) movdqa xmm6, xmm5 ; transpose coefficients(phase 1) punpcklwd xmm5, xmm4 ; xmm5=(00 10 01 11 02 12 03 13) punpckhwd xmm6, xmm4 ; xmm6=(04 14 05 15 06 16 07 17) movdqa xmm1, xmm7 ; transpose coefficients(phase 1) punpcklwd xmm7, xmm2 ; xmm7=(60 70 61 71 62 72 63 73) punpckhwd xmm1, xmm2 ; xmm1=(64 74 65 75 66 76 67 77) movdqa xmm3, XMMWORD [wk(6)] ; xmm3=tmp12L movdqa xmm0, XMMWORD [wk(7)] ; xmm0=tmp12H movdqa xmm4, XMMWORD [wk(10)] ; xmm4=tmp1L movdqa xmm2, XMMWORD [wk(11)] ; xmm2=tmp1H movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(00 10 01 11 02 12 03 13) movdqa XMMWORD [wk(1)], xmm6 ; wk(1)=(04 14 05 15 06 16 07 17) movdqa XMMWORD [wk(4)], xmm7 ; wk(4)=(60 70 61 71 62 72 63 73) movdqa XMMWORD [wk(5)], xmm1 ; wk(5)=(64 74 65 75 66 76 67 77) movdqa xmm5, xmm3 movdqa xmm6, xmm0 paddd xmm3, xmm4 ; xmm3=data2L paddd xmm0, xmm2 ; xmm0=data2H psubd xmm5, xmm4 ; xmm5=data5L psubd xmm6, xmm2 ; xmm6=data5H movdqa xmm7, [rel PD_DESCALE_P1] ; xmm7=[rel PD_DESCALE_P1] paddd xmm3, xmm7 paddd xmm0, xmm7 psrad xmm3, DESCALE_P1 psrad xmm0, DESCALE_P1 paddd xmm5, xmm7 paddd xmm6, xmm7 psrad xmm5, DESCALE_P1 psrad xmm6, DESCALE_P1 packssdw xmm3, xmm0 ; xmm3=data2=(20 21 22 23 24 25 26 27) packssdw xmm5, xmm6 ; xmm5=data5=(50 51 52 53 54 55 56 57) movdqa xmm1, XMMWORD [wk(2)] ; xmm1=tmp13L movdqa xmm4, XMMWORD [wk(3)] ; xmm4=tmp13H movdqa xmm2, XMMWORD [wk(8)] ; xmm2=tmp0L movdqa xmm7, XMMWORD [wk(9)] ; xmm7=tmp0H movdqa xmm0, xmm1 movdqa xmm6, xmm4 paddd xmm1, xmm2 ; xmm1=data3L paddd xmm4, xmm7 ; xmm4=data3H psubd xmm0, xmm2 ; xmm0=data4L psubd xmm6, xmm7 ; xmm6=data4H movdqa xmm2, [rel PD_DESCALE_P1] ; xmm2=[rel PD_DESCALE_P1] paddd xmm1, xmm2 paddd xmm4, xmm2 psrad xmm1, DESCALE_P1 psrad xmm4, DESCALE_P1 paddd xmm0, xmm2 paddd xmm6, xmm2 psrad xmm0, DESCALE_P1 psrad xmm6, DESCALE_P1 packssdw xmm1, xmm4 ; xmm1=data3=(30 31 32 33 34 35 36 37) packssdw xmm0, xmm6 ; xmm0=data4=(40 41 42 43 44 45 46 47) movdqa xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 01 11 02 12 03 13) movdqa xmm2, XMMWORD [wk(1)] ; xmm2=(04 14 05 15 06 16 07 17) movdqa xmm4, xmm3 ; transpose coefficients(phase 1) punpcklwd xmm3, xmm1 ; xmm3=(20 30 21 31 22 32 23 33) punpckhwd xmm4, xmm1 ; xmm4=(24 34 25 35 26 36 27 37) movdqa xmm6, xmm0 ; transpose coefficients(phase 1) punpcklwd xmm0, xmm5 ; xmm0=(40 50 41 51 42 52 43 53) punpckhwd xmm6, xmm5 ; xmm6=(44 54 45 55 46 56 47 57) movdqa xmm1, xmm7 ; transpose coefficients(phase 2) punpckldq xmm7, xmm3 ; xmm7=(00 10 20 30 01 11 21 31) punpckhdq xmm1, xmm3 ; xmm1=(02 12 22 32 03 13 23 33) movdqa xmm5, xmm2 ; transpose coefficients(phase 2) punpckldq xmm2, xmm4 ; xmm2=(04 14 24 34 05 15 25 35) punpckhdq xmm5, xmm4 ; xmm5=(06 16 26 36 07 17 27 37) movdqa xmm3, XMMWORD [wk(4)] ; xmm3=(60 70 61 71 62 72 63 73) movdqa xmm4, XMMWORD [wk(5)] ; xmm4=(64 74 65 75 66 76 67 77) movdqa XMMWORD [wk(6)], xmm2 ; wk(6)=(04 14 24 34 05 15 25 35) movdqa XMMWORD [wk(7)], xmm5 ; wk(7)=(06 16 26 36 07 17 27 37) movdqa xmm2, xmm0 ; transpose coefficients(phase 2) punpckldq xmm0, xmm3 ; xmm0=(40 50 60 70 41 51 61 71) punpckhdq xmm2, xmm3 ; xmm2=(42 52 62 72 43 53 63 73) movdqa xmm5, xmm6 ; transpose coefficients(phase 2) punpckldq xmm6, xmm4 ; xmm6=(44 54 64 74 45 55 65 75) punpckhdq xmm5, xmm4 ; xmm5=(46 56 66 76 47 57 67 77) movdqa xmm3, xmm7 ; transpose coefficients(phase 3) punpcklqdq xmm7, xmm0 ; xmm7=col0=(00 10 20 30 40 50 60 70) punpckhqdq xmm3, xmm0 ; xmm3=col1=(01 11 21 31 41 51 61 71) movdqa xmm4, xmm1 ; transpose coefficients(phase 3) punpcklqdq xmm1, xmm2 ; xmm1=col2=(02 12 22 32 42 52 62 72) punpckhqdq xmm4, xmm2 ; xmm4=col3=(03 13 23 33 43 53 63 73) movdqa xmm0, XMMWORD [wk(6)] ; xmm0=(04 14 24 34 05 15 25 35) movdqa xmm2, XMMWORD [wk(7)] ; xmm2=(06 16 26 36 07 17 27 37) movdqa XMMWORD [wk(8)], xmm3 ; wk(8)=col1 movdqa XMMWORD [wk(9)], xmm4 ; wk(9)=col3 movdqa xmm3, xmm0 ; transpose coefficients(phase 3) punpcklqdq xmm0, xmm6 ; xmm0=col4=(04 14 24 34 44 54 64 74) punpckhqdq xmm3, xmm6 ; xmm3=col5=(05 15 25 35 45 55 65 75) movdqa xmm4, xmm2 ; transpose coefficients(phase 3) punpcklqdq xmm2, xmm5 ; xmm2=col6=(06 16 26 36 46 56 66 76) punpckhqdq xmm4, xmm5 ; xmm4=col7=(07 17 27 37 47 57 67 77) movdqa XMMWORD [wk(10)], xmm3 ; wk(10)=col5 movdqa XMMWORD [wk(11)], xmm4 ; wk(11)=col7 .column_end: ; -- Prefetch the next coefficient block prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32] prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32] ; ---- Pass 2: process rows from work array, store into output array. mov rax, [original_rbp] mov rdi, r12 ; (JSAMPROW *) mov eax, r13d ; -- Even part ; xmm7=col0, xmm1=col2, xmm0=col4, xmm2=col6 ; (Original) ; z1 = (z2 + z3) * 0.541196100; ; tmp2 = z1 + z3 * -1.847759065; ; tmp3 = z1 + z2 * 0.765366865; ; ; (This implementation) ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065); ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100; movdqa xmm6, xmm1 ; xmm1=in2=z2 movdqa xmm5, xmm1 punpcklwd xmm6, xmm2 ; xmm2=in6=z3 punpckhwd xmm5, xmm2 movdqa xmm1, xmm6 movdqa xmm2, xmm5 pmaddwd xmm6, [rel PW_F130_F054] ; xmm6=tmp3L pmaddwd xmm5, [rel PW_F130_F054] ; xmm5=tmp3H pmaddwd xmm1, [rel PW_F054_MF130] ; xmm1=tmp2L pmaddwd xmm2, [rel PW_F054_MF130] ; xmm2=tmp2H movdqa xmm3, xmm7 paddw xmm7, xmm0 ; xmm7=in0+in4 psubw xmm3, xmm0 ; xmm3=in0-in4 pxor xmm4, xmm4 pxor xmm0, xmm0 punpcklwd xmm4, xmm7 ; xmm4=tmp0L punpckhwd xmm0, xmm7 ; xmm0=tmp0H psrad xmm4, (16-CONST_BITS) ; psrad xmm4,16 & pslld xmm4,CONST_BITS psrad xmm0, (16-CONST_BITS) ; psrad xmm0,16 & pslld xmm0,CONST_BITS movdqa xmm7, xmm4 paddd xmm4, xmm6 ; xmm4=tmp10L psubd xmm7, xmm6 ; xmm7=tmp13L movdqa xmm6, xmm0 paddd xmm0, xmm5 ; xmm0=tmp10H psubd xmm6, xmm5 ; xmm6=tmp13H movdqa XMMWORD [wk(0)], xmm4 ; wk(0)=tmp10L movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=tmp10H movdqa XMMWORD [wk(2)], xmm7 ; wk(2)=tmp13L movdqa XMMWORD [wk(3)], xmm6 ; wk(3)=tmp13H pxor xmm5, xmm5 pxor xmm4, xmm4 punpcklwd xmm5, xmm3 ; xmm5=tmp1L punpckhwd xmm4, xmm3 ; xmm4=tmp1H psrad xmm5, (16-CONST_BITS) ; psrad xmm5,16 & pslld xmm5,CONST_BITS psrad xmm4, (16-CONST_BITS) ; psrad xmm4,16 & pslld xmm4,CONST_BITS movdqa xmm0, xmm5 paddd xmm5, xmm1 ; xmm5=tmp11L psubd xmm0, xmm1 ; xmm0=tmp12L movdqa xmm7, xmm4 paddd xmm4, xmm2 ; xmm4=tmp11H psubd xmm7, xmm2 ; xmm7=tmp12H movdqa XMMWORD [wk(4)], xmm5 ; wk(4)=tmp11L movdqa XMMWORD [wk(5)], xmm4 ; wk(5)=tmp11H movdqa XMMWORD [wk(6)], xmm0 ; wk(6)=tmp12L movdqa XMMWORD [wk(7)], xmm7 ; wk(7)=tmp12H ; -- Odd part movdqa xmm6, XMMWORD [wk(9)] ; xmm6=col3 movdqa xmm3, XMMWORD [wk(8)] ; xmm3=col1 movdqa xmm1, XMMWORD [wk(11)] ; xmm1=col7 movdqa xmm2, XMMWORD [wk(10)] ; xmm2=col5 movdqa xmm5, xmm6 movdqa xmm4, xmm3 paddw xmm5, xmm1 ; xmm5=z3 paddw xmm4, xmm2 ; xmm4=z4 ; (Original) ; z5 = (z3 + z4) * 1.175875602; ; z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; ; z3 += z5; z4 += z5; ; ; (This implementation) ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); movdqa xmm0, xmm5 movdqa xmm7, xmm5 punpcklwd xmm0, xmm4 punpckhwd xmm7, xmm4 movdqa xmm5, xmm0 movdqa xmm4, xmm7 pmaddwd xmm0, [rel PW_MF078_F117] ; xmm0=z3L pmaddwd xmm7, [rel PW_MF078_F117] ; xmm7=z3H pmaddwd xmm5, [rel PW_F117_F078] ; xmm5=z4L pmaddwd xmm4, [rel PW_F117_F078] ; xmm4=z4H movdqa XMMWORD [wk(10)], xmm0 ; wk(10)=z3L movdqa XMMWORD [wk(11)], xmm7 ; wk(11)=z3H ; (Original) ; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; ; tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869; ; tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110; ; z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; ; tmp0 += z1 + z3; tmp1 += z2 + z4; ; tmp2 += z2 + z3; tmp3 += z1 + z4; ; ; (This implementation) ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223; ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447; ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447); ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223); ; tmp0 += z3; tmp1 += z4; ; tmp2 += z3; tmp3 += z4; movdqa xmm0, xmm1 movdqa xmm7, xmm1 punpcklwd xmm0, xmm3 punpckhwd xmm7, xmm3 movdqa xmm1, xmm0 movdqa xmm3, xmm7 pmaddwd xmm0, [rel PW_MF060_MF089] ; xmm0=tmp0L pmaddwd xmm7, [rel PW_MF060_MF089] ; xmm7=tmp0H pmaddwd xmm1, [rel PW_MF089_F060] ; xmm1=tmp3L pmaddwd xmm3, [rel PW_MF089_F060] ; xmm3=tmp3H paddd xmm0, XMMWORD [wk(10)] ; xmm0=tmp0L paddd xmm7, XMMWORD [wk(11)] ; xmm7=tmp0H paddd xmm1, xmm5 ; xmm1=tmp3L paddd xmm3, xmm4 ; xmm3=tmp3H movdqa XMMWORD [wk(8)], xmm0 ; wk(8)=tmp0L movdqa XMMWORD [wk(9)], xmm7 ; wk(9)=tmp0H movdqa xmm0, xmm2 movdqa xmm7, xmm2 punpcklwd xmm0, xmm6 punpckhwd xmm7, xmm6 movdqa xmm2, xmm0 movdqa xmm6, xmm7 pmaddwd xmm0, [rel PW_MF050_MF256] ; xmm0=tmp1L pmaddwd xmm7, [rel PW_MF050_MF256] ; xmm7=tmp1H pmaddwd xmm2, [rel PW_MF256_F050] ; xmm2=tmp2L pmaddwd xmm6, [rel PW_MF256_F050] ; xmm6=tmp2H paddd xmm0, xmm5 ; xmm0=tmp1L paddd xmm7, xmm4 ; xmm7=tmp1H paddd xmm2, XMMWORD [wk(10)] ; xmm2=tmp2L paddd xmm6, XMMWORD [wk(11)] ; xmm6=tmp2H movdqa XMMWORD [wk(10)], xmm0 ; wk(10)=tmp1L movdqa XMMWORD [wk(11)], xmm7 ; wk(11)=tmp1H ; -- Final output stage movdqa xmm5, XMMWORD [wk(0)] ; xmm5=tmp10L movdqa xmm4, XMMWORD [wk(1)] ; xmm4=tmp10H movdqa xmm0, xmm5 movdqa xmm7, xmm4 paddd xmm5, xmm1 ; xmm5=data0L paddd xmm4, xmm3 ; xmm4=data0H psubd xmm0, xmm1 ; xmm0=data7L psubd xmm7, xmm3 ; xmm7=data7H movdqa xmm1, [rel PD_DESCALE_P2] ; xmm1=[rel PD_DESCALE_P2] paddd xmm5, xmm1 paddd xmm4, xmm1 psrad xmm5, DESCALE_P2 psrad xmm4, DESCALE_P2 paddd xmm0, xmm1 paddd xmm7, xmm1 psrad xmm0, DESCALE_P2 psrad xmm7, DESCALE_P2 packssdw xmm5, xmm4 ; xmm5=data0=(00 10 20 30 40 50 60 70) packssdw xmm0, xmm7 ; xmm0=data7=(07 17 27 37 47 57 67 77) movdqa xmm3, XMMWORD [wk(4)] ; xmm3=tmp11L movdqa xmm1, XMMWORD [wk(5)] ; xmm1=tmp11H movdqa xmm4, xmm3 movdqa xmm7, xmm1 paddd xmm3, xmm2 ; xmm3=data1L paddd xmm1, xmm6 ; xmm1=data1H psubd xmm4, xmm2 ; xmm4=data6L psubd xmm7, xmm6 ; xmm7=data6H movdqa xmm2, [rel PD_DESCALE_P2] ; xmm2=[rel PD_DESCALE_P2] paddd xmm3, xmm2 paddd xmm1, xmm2 psrad xmm3, DESCALE_P2 psrad xmm1, DESCALE_P2 paddd xmm4, xmm2 paddd xmm7, xmm2 psrad xmm4, DESCALE_P2 psrad xmm7, DESCALE_P2 packssdw xmm3, xmm1 ; xmm3=data1=(01 11 21 31 41 51 61 71) packssdw xmm4, xmm7 ; xmm4=data6=(06 16 26 36 46 56 66 76) packsswb xmm5, xmm4 ; xmm5=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) packsswb xmm3, xmm0 ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) movdqa xmm6, XMMWORD [wk(6)] ; xmm6=tmp12L movdqa xmm2, XMMWORD [wk(7)] ; xmm2=tmp12H movdqa xmm1, XMMWORD [wk(10)] ; xmm1=tmp1L movdqa xmm7, XMMWORD [wk(11)] ; xmm7=tmp1H movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) movdqa XMMWORD [wk(1)], xmm3 ; wk(1)=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) movdqa xmm4, xmm6 movdqa xmm0, xmm2 paddd xmm6, xmm1 ; xmm6=data2L paddd xmm2, xmm7 ; xmm2=data2H psubd xmm4, xmm1 ; xmm4=data5L psubd xmm0, xmm7 ; xmm0=data5H movdqa xmm5, [rel PD_DESCALE_P2] ; xmm5=[rel PD_DESCALE_P2] paddd xmm6, xmm5 paddd xmm2, xmm5 psrad xmm6, DESCALE_P2 psrad xmm2, DESCALE_P2 paddd xmm4, xmm5 paddd xmm0, xmm5 psrad xmm4, DESCALE_P2 psrad xmm0, DESCALE_P2 packssdw xmm6, xmm2 ; xmm6=data2=(02 12 22 32 42 52 62 72) packssdw xmm4, xmm0 ; xmm4=data5=(05 15 25 35 45 55 65 75) movdqa xmm3, XMMWORD [wk(2)] ; xmm3=tmp13L movdqa xmm1, XMMWORD [wk(3)] ; xmm1=tmp13H movdqa xmm7, XMMWORD [wk(8)] ; xmm7=tmp0L movdqa xmm5, XMMWORD [wk(9)] ; xmm5=tmp0H movdqa xmm2, xmm3 movdqa xmm0, xmm1 paddd xmm3, xmm7 ; xmm3=data3L paddd xmm1, xmm5 ; xmm1=data3H psubd xmm2, xmm7 ; xmm2=data4L psubd xmm0, xmm5 ; xmm0=data4H movdqa xmm7, [rel PD_DESCALE_P2] ; xmm7=[rel PD_DESCALE_P2] paddd xmm3, xmm7 paddd xmm1, xmm7 psrad xmm3, DESCALE_P2 psrad xmm1, DESCALE_P2 paddd xmm2, xmm7 paddd xmm0, xmm7 psrad xmm2, DESCALE_P2 psrad xmm0, DESCALE_P2 movdqa xmm5, [rel PB_CENTERJSAMP] ; xmm5=[rel PB_CENTERJSAMP] packssdw xmm3, xmm1 ; xmm3=data3=(03 13 23 33 43 53 63 73) packssdw xmm2, xmm0 ; xmm2=data4=(04 14 24 34 44 54 64 74) movdqa xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76) movdqa xmm1, XMMWORD [wk(1)] ; xmm1=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77) packsswb xmm6, xmm2 ; xmm6=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74) packsswb xmm3, xmm4 ; xmm3=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75) paddb xmm7, xmm5 paddb xmm1, xmm5 paddb xmm6, xmm5 paddb xmm3, xmm5 movdqa xmm0, xmm7 ; transpose coefficients(phase 1) punpcklbw xmm7, xmm1 ; xmm7=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71) punpckhbw xmm0, xmm1 ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77) movdqa xmm2, xmm6 ; transpose coefficients(phase 1) punpcklbw xmm6, xmm3 ; xmm6=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73) punpckhbw xmm2, xmm3 ; xmm2=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75) movdqa xmm4, xmm7 ; transpose coefficients(phase 2) punpcklwd xmm7, xmm6 ; xmm7=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33) punpckhwd xmm4, xmm6 ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73) movdqa xmm5, xmm2 ; transpose coefficients(phase 2) punpcklwd xmm2, xmm0 ; xmm2=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37) punpckhwd xmm5, xmm0 ; xmm5=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77) movdqa xmm1, xmm7 ; transpose coefficients(phase 3) punpckldq xmm7, xmm2 ; xmm7=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17) punpckhdq xmm1, xmm2 ; xmm1=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37) movdqa xmm3, xmm4 ; transpose coefficients(phase 3) punpckldq xmm4, xmm5 ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57) punpckhdq xmm3, xmm5 ; xmm3=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77) pshufd xmm6, xmm7, 0x4E ; xmm6=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07) pshufd xmm0, xmm1, 0x4E ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27) pshufd xmm2, xmm4, 0x4E ; xmm2=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47) pshufd xmm5, xmm3, 0x4E ; xmm5=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67) mov rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+2*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm7 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm1 mov rdx, JSAMPROW [rdi+4*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+6*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3 mov rdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0 mov rdx, JSAMPROW [rdi+5*SIZEOF_JSAMPROW] mov rsi, JSAMPROW [rdi+7*SIZEOF_JSAMPROW] movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm2 movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm5 uncollect_args 4 mov rsp, rbp ; rsp <- aligned rbp pop rsp ; rsp <- original rbp pop rbp ret ; For some reason, the OS X linker does not honor the request to align the ; segment unless we do this. align 32 ",16200,True,4071.2135162048744,median "// RAWX_Logger V2 // Logs RXM-RAWX, RXM-SFRBX and TIM-TM2 data from u-blox NEO-M8T GNSS to SD card // Changes to a new log file every INTERVAL minutes // Define how long we should log in minutes before changing to a new file // Sensible values are: 5, 10, 15, 20, 30, 60 // Must be <= 60 (or RTC alarm code needs to be updated to match on HHMMSS) const int INTERVAL = 15; // Define how long we should wait in msec (approx.) for residual RAWX data before closing a log file // For a measurement rate of 4Hz (250msec), 300msec is a sensible value. i.e. slightly more than one measurement interval const int dwell = 300; // The RAWX log file has a .ubx suffix instead of .bin // The log filename starts with ""r_"" for the rover and ""b_"" for the static base // Define if this is the static base logger #define STATIC // Comment this line out for the mobile rover logger // This code is written for the Adalogger M0 Feather // https://www.adafruit.com/products/2796 // https://learn.adafruit.com/adafruit-feather-m0-adalogger // GNSS data is provided by Paul's u-blox NEO-M8T FeatherWing // https://github.com/PaulZC/NEO-M8T_GNSS_FeatherWing // Solder the GRESET link so that pressing the reset button // resets the NEO-M8T as well as the Adalogger. // Choose a good quality SD card. Some cheap cards can't handle the write rate. // Ensure the card is formatted as FAT32. // You need to enlarge the serial receive buffer to avoid buffer // overruns while data is being written to the SD card. // For the Adafruit Feather M0 Adalogger (SAMD): // See this post by MartinL: https://forum.arduino.cc/index.php?topic=365220.0 // Under Windows, edit: C:\\Users\\ ...your_user... \\AppData\\Local\\Arduino15\\packages\\adafruit\\hardware\\samd\\1.0.19\\cores\\arduino\\RingBuffer.h // and change: #define SERIAL_BUFFER_SIZE 164 // to: #define SERIAL_BUFFER_SIZE 8192 // Check the reported freeMemory before and after to make sure the change has been successful // (You should find that you've lost twice as much memory as expected! (Tx and Rx buffers both increase in size!)) // Define the GNSS configuration: GPS + Galileo + either GLONASS or BeiDou #define GLONASS // Comment this line out to use BeiDou // Send serial debug messages //#define DEBUG // Comment this line out to disable debug messages // Connect a normally-open push-to-close switch between swPin and GND. // Press it to stop logging and close the log file. #define swPin 15 // Digital Pin 15 (0.2"" away from the GND pin on the Adalogger) // LEDs #define RedLED 13 // The red LED on the Adalogger is connected to Digital Pin 13 #define GreenLED 8 // The green LED on the Adalogger is connected to Digital Pin 8 // Include the Adafruit GPS Library // https://github.com/adafruit/Adafruit_GPS // This is used at the start of the code to establish a fix and // provide the date and time for the RAWX log file filename #include Adafruit_GPS GPS(&Serial1); // M0 hardware serial // Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console // Set to 'true' if you want to debug and listen to the raw GPS sentences #define GPSECHO false // this keeps track of whether we're using the interrupt // off by default! boolean usingInterrupt = false; // Fast SD card logging using Bill Greiman's SdFat // https://github.com/greiman/SdFat // From FatFile.h: // * \\note Data is moved to the cache but may not be written to the // * storage device until sync() is called. #include #include const uint8_t cardSelect = 4; // Adalogger uses D4 as the SD SPI select SdFat sd; SdFile rawx_dataFile; #ifdef STATIC char rawx_filename[] = ""20000000/b_000000.ubx""; // base logfile #else char rawx_filename[] = ""20000000/r_000000.ubx""; // rover logfile #endif char dirname[] = ""20000000""; long bytes_written = 0; // Define packet size, buffer and buffer pointer for SD card writes const size_t SDpacket = 512; uint8_t serBuffer[SDpacket]; size_t bufferPointer = 0; int numBytes; // Michael P. Flaga's MemoryFree: // https://github.com/mpflaga/Arduino-MemoryFree #include ; // Battery voltage float vbat; #define LOWBAT 3.55 // Low battery voltage // Include Real Time Clock support for the M0 // https://github.com/arduino-libraries/RTCZero #include // M0 Real Time Clock RTCZero rtc; // Create an rtc object volatile bool alarmFlag = false; // RTC alarm (interrupt) flag // Count number of valid fixes before starting to log #define maxvalfix 10 // Collect at least this many valid fixes before logging starts int valfix = 0; // Loop Steps #define init 0 #define open_file 1 #define write_file 2 #define close_file 3 int loop_step = init; // Definitions for u-blox M8 UBX-format (binary) messages // The message definitions need to include the 0xB5 and 0x62 sync chars // The message definitions don't contain the checksum bytes - these are calculated and appended by sendUBX // Each message needs to have a length defined // Set Nav Mode to Static static const uint8_t setNavStatic[] = { 0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; static const int len_setNav = 42; // Set Nav Mode to Portable static const uint8_t setNavPortable[] = { 0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Set Nav Mode to Pedestrian static const uint8_t setNavPedestrian[] = { 0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Set Nav Mode to Automotive static const uint8_t setNavAutomotive[] = { 0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Set Nav Mode to Sea static const uint8_t setNavSea[] = { 0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x05, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Set Nav Mode to Airborne <1G static const uint8_t setNavAir[] = { 0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Set NMEA Config // Set trackFilt to 1 to ensure course (COG) is always output // Set Main Talker ID to 'GP' instead of 'GN' static const uint8_t setNMEA[] = { 0xb5, 0x62, 0x06, 0x17, 0x14, 0x00, 0x20, 0x40, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static const int len_setNMEA = 26; // Set GNSS Config (Causes a restart of the M8!) #ifdef GLONASS // GPS + Galileo + GLONASS + SBAS static const uint8_t setGNSS[] = { 0xb5, 0x62, 0x06, 0x3e, 0x3c, 0x00, 0x00, 0x20, 0x20, 0x07, 0x00, 0x08, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0x00, 0x01, 0x00, 0x01, 0x01, 0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01, 0x03, 0x08, 0x10, 0x00, 0x00, 0x00, 0x01, 0x01, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x03, 0x05, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x05, 0x06, 0x08, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x01 }; /* // GPS + Galileo + GLONASS static const uint8_t setGNSS[] = { 0xb5, 0x62, 0x06, 0x3e, 0x3c, 0x00, 0x00, 0x20, 0x20, 0x07, 0x00, 0x08, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01, 0x03, 0x08, 0x10, 0x00, 0x00, 0x00, 0x01, 0x01, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x03, 0x05, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x05, 0x06, 0x08, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x01 }; */ #else // GPS + Galileo + BeiDou + SBAS static const uint8_t setGNSS[] = { 0xb5, 0x62, 0x06, 0x3e, 0x3c, 0x00, 0x00, 0x20, 0x20, 0x07, 0x00, 0x08, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0x00, 0x01, 0x00, 0x01, 0x01, 0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01, 0x03, 0x08, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x03, 0x05, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x05, 0x06, 0x08, 0x0e, 0x00, 0x00, 0x00, 0x01, 0x01 }; /* // GPS + Galileo + BeiDou static const uint8_t setGNSS[] = { 0xb5, 0x62, 0x06, 0x3e, 0x3c, 0x00, 0x00, 0x20, 0x20, 0x07, 0x00, 0x08, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01, 0x03, 0x08, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x03, 0x05, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x05, 0x06, 0x08, 0x0e, 0x00, 0x00, 0x00, 0x01, 0x01 }; */ #endif static const int len_setGNSS = 66; // Set Navigation/Measurement Rate (CFG-RATE): set measRate to 250msec; align to UTC time static const uint8_t setRATE[] = { 0xb5, 0x62, 0x06, 0x08, 0x06, 0x00, 0xfa, 0x00, 0x01, 0x00, 0x00, 0x00 }; // Set Navigation/Measurement Rate (CFG-RATE): set measRate to 250msec; align to GPS time //static const uint8_t setRATE[] = { 0xb5, 0x62, 0x06, 0x08, 0x06, 0x00, 0xfa, 0x00, 0x01, 0x00, 0x01, 0x00 }; // Set Navigation/Measurement Rate (CFG-RATE): set measRate to 1000msec; align to UTC time static const uint8_t setRATE_1Hz[] = { 0xb5, 0x62, 0x06, 0x08, 0x06, 0x00, 0xe8, 0x03, 0x01, 0x00, 0x00, 0x00 }; // Set Navigation/Measurement Rate (CFG-RATE): set measRate to 10000msec; align to UTC time static const uint8_t setRATE_10s[] = { 0xb5, 0x62, 0x06, 0x08, 0x06, 0x00, 0x10, 0x27, 0x01, 0x00, 0x00, 0x00 }; static const uint8_t len_setRATE = 12; // Set RXM-RAWX Message Rate: once per measRate static const uint8_t setRAWX[] = { 0xb5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x02, 0x15, 0x01 }; // Set RXM-RAWX Message Rate: off static const uint8_t setRAWXoff[] = { 0xb5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x02, 0x15, 0x00 }; static const int len_setRAWX = 9; // Set RXM-SFRBX Message Rate: once per measRate static const uint8_t setSFRBX[] = { 0xb5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x02, 0x13, 0x01 }; // Set RXM-SFRBX Message Rate: off static const uint8_t setSFRBXoff[] = { 0xb5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x02, 0x13, 0x00 }; static const int len_setSFRBX = 9; // Set TIM-TM2 Message Rate: once per measRate static const uint8_t setTIM[] = { 0xb5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x0d, 0x03, 0x01 }; // Set TIM-TM2 Message Rate: off static const uint8_t setTIMoff[] = { 0xb5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x0d, 0x03, 0x00 }; static const int len_setTIM = 9; // Set port configuration - disable or enable UBX output messages on the UART static const uint8_t setUBX[] = { 0xb5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x08, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }; static const uint8_t setUBXoff[] = { 0xb5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x08, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 }; static const int len_setUBX = 26; // Send message in u-blox UBX format // Calculates and appends the two checksum bytes // Doesn't add the 0xb5 and 0x62 sync chars (these need to be included at the start of the message) void sendUBX(const uint8_t *message, const int len) { int csum1 = 0; // Checksum bytes int csum2 = 0; #ifdef DEBUG Serial.print(""Sending UBX packet: 0x""); #endif for (int i=0; i= 2) { // Don't include the sync chars in the checksum csum1 = csum1 + message[i]; // Update the checksum bytes csum2 = csum2 + csum1; } } csum1 = csum1 & 0xff; // Limit checksums to 8-bits csum2 = csum2 & 0xff; Serial1.write((uint8_t)csum1); // Send the checksum bytes Serial1.write((uint8_t)csum2); #ifdef DEBUG // DEBUG: print the checksum bytes in HEX format if (csum1 < 16) {Serial.print(""0"");} Serial.print((uint8_t)csum1, HEX); Serial.print("", 0x""); if (csum2 < 16) {Serial.print(""0"");} Serial.println((uint8_t)csum2, HEX); #endif } // RTC alarm interrupt // Must be kept as short as possible. Update the alarm time in the main loop, not here. void alarmMatch() { alarmFlag = true; // Set alarm flag } void setup() { // initialize digital pins RedLED and GreenLED as outputs. pinMode(RedLED, OUTPUT); // Red LED pinMode(GreenLED, OUTPUT); // Green LED // flash red and green LEDs on reset for (int i=0; i <= 4; i++) { digitalWrite(RedLED, HIGH); delay(200); digitalWrite(RedLED, LOW); digitalWrite(GreenLED, HIGH); delay(200); digitalWrite(GreenLED, LOW); } // initialize swPin as an input for the stop switch pinMode(swPin, INPUT_PULLUP); delay(10000); // Allow 10 sec for user to open serial monitor (Comment this line if required) //while (!Serial); // OR Wait for user to run python script or open serial monitor (Comment this line as required) Serial.begin(115200); Serial.println(""RAWX_Logger_2""); Serial.println(""Log GNSS RAWX data to SD card""); Serial.println(""Green LED = Initial GNSS Fix""); Serial.println(""Red LED Flash = SD Write""); Serial.println(""Continuous Red indicates a problem or that logging has been stopped""); Serial.print(""Free Memory: ""); Serial.println(freeMemory(), DEC); // print how much RAM is available. Serial.println(""Initializing GNSS...""); // u-blox M8 Init // 9600 is the default baud rate for u-blox M8 GPS.begin(9600); // Change the NEO-M8T UART Baud rate // (DDC (I2C) and SPI rates can be set independently if required) // Allow both NMEA and UBX protocols (but not RTCM) // Disable autobauding GPS.sendCommand(""$PUBX,41,1,0003,0003,115200,0*1C""); // 115200 baud //GPS.sendCommand(""$PUBX,41,1,0003,0003,230400,0*1E""); // 230400 baud // Allow time for Baud rate change delay(1100); // Restart serial communications GPS.begin(115200); // 115200 baud //GPS.begin(230400); // 230400 baud sendUBX(setRAWXoff, len_setRAWX); // Disable RAWX messages delay(100); sendUBX(setSFRBXoff, len_setSFRBX); // Disable SFRBX messages delay(100); sendUBX(setTIMoff, len_setTIM); // Disable TIM messages delay(100); // Disable all NMEA messages except GGA and RMC GPS.sendCommand(""$PUBX,40,GLL,0,0,0,0*5C""); // Disable GLL delay(100); GPS.sendCommand(""$PUBX,40,ZDA,0,0,0,0*44""); // Disable ZDA delay(100); GPS.sendCommand(""$PUBX,40,VTG,0,0,0,0*5E""); // Disable VTG delay(100); GPS.sendCommand(""$PUBX,40,GSV,0,0,0,0*59""); // Disable GSV delay(100); GPS.sendCommand(""$PUBX,40,GSA,0,0,0,0*4E""); // Disable GSA delay(100); GPS.sendCommand(""$PUBX,40,GGA,0,1,0,0*5B""); // Enable GGA delay(100); GPS.sendCommand(""$PUBX,40,RMC,0,1,0,0*46""); // Enable RMC delay(100); // Wait #ifdef STATIC sendUBX(setNavStatic, len_setNav); // Set Static Navigation Mode (use this for the Base Logger) #else // Select one mode for the mobile Rover Logger sendUBX(setNavPortable, len_setNav); // Set Portable Navigation Mode //sendUBX(setNavPedestrian, len_setNav); // Set Pedestrian Navigation Mode //sendUBX(setNavAutomotive, len_setNav); // Set Automotive Navigation Mode //sendUBX(setNavSea, len_setNav); // Set Sea Navigation Mode //sendUBX(setNavAir, len_setNav); // Set Airborne <1G Navigation Mode #endif delay(100); sendUBX(setNMEA, len_setNMEA); // Set NMEA configuration (use GP prefix instead of GN otherwise parsing will fail) delay(100); sendUBX(setRATE_1Hz, len_setRATE); // Set Navigation/Measurement Rate to 1Hz delay(100); sendUBX(setGNSS, len_setGNSS); // Set GNSS - causes a reset of the M8! delay(3100); while(Serial1.available()){Serial1.read();} // Flush RX buffer so we don't confuse Adafruit_GPS with UBX acknowledgements Serial.println(""GNSS initialized!""); // flash the red LED during SD initialisation digitalWrite(RedLED, HIGH); // Initialise SD card Serial.println(""Initializing SD card...""); // See if the SD card is present and can be initialized if (!sd.begin(cardSelect, SD_SCK_MHZ(50))) { Serial.println(""Panic!! SD Card Init failed, or not present!""); Serial.println(""Waiting for reset...""); // don't do anything more: while(1); } Serial.println(""SD Card initialized!""); bufferPointer = 0; // Make sure bufferPointer is initialised (should be redundant!) // turn red LED off digitalWrite(RedLED, LOW); } void loop() // run over and over again { switch(loop_step) { case init: { // read data from the GNSS char c = GPS.read(); // if you want to debug, this is a good time to do it! if (GPSECHO) if (c) Serial.print(c); // if a sentence is received, we can check the checksum, parse it... if (GPS.newNMEAreceived()) { if (!GPS.parse(GPS.lastNMEA())) // this also sets the newNMEAreceived() flag to false break; // we can fail to parse a sentence in which case we should just wait for another #ifdef DEBUG Serial.print(""\\nTime: ""); Serial.print(GPS.hour, DEC); Serial.print(':'); Serial.print(GPS.minute, DEC); Serial.print(':'); Serial.print(GPS.seconds, DEC); Serial.print('.'); Serial.println(GPS.milliseconds); Serial.print(""Date: ""); Serial.print(GPS.day, DEC); Serial.print('/'); Serial.print(GPS.month, DEC); Serial.print(""/20""); Serial.println(GPS.year, DEC); Serial.print(""Fix: ""); Serial.print((int)GPS.fix); Serial.print("" Quality: ""); Serial.println((int)GPS.fixquality); if (GPS.fix) { Serial.print(""Location: ""); Serial.print(GPS.latitude, 4); Serial.print(GPS.lat); Serial.print("", ""); Serial.print(GPS.longitude, 4); Serial.println(GPS.lon); Serial.print(""Speed (knots): ""); Serial.println(GPS.speed); Serial.print(""Angle: ""); Serial.println(GPS.angle); Serial.print(""Altitude: ""); Serial.println(GPS.altitude); Serial.print(""Satellites: ""); Serial.println((int)GPS.satellites); Serial.print(""HDOP: ""); Serial.println(GPS.HDOP); } #endif // read battery voltage vbat = analogRead(A7) * (2.0 * 3.3 / 1023.0); #ifdef DEBUG Serial.print(""Battery(V): ""); Serial.println(vbat, 2); #endif // turn green LED on to indicate GNSS fix if (GPS.fix) { digitalWrite(GreenLED, HIGH); // increment valfix and cap at maxvalfix // don't do anything fancy in terms of decrementing valfix as we want to keep logging even if the fix is lost valfix += 1; if (valfix > maxvalfix) valfix = maxvalfix; } else { digitalWrite(GreenLED, LOW); } if (valfix == maxvalfix) { // wait until we have enough valid fixes // Set and start the RTC alarmFlag = false; // Make sure alarm flag is clear rtc.begin(); // Start the RTC rtc.setTime(GPS.hour, GPS.minute, GPS.seconds); // Set the time rtc.setDate(GPS.day, GPS.month, GPS.year); // Set the date rtc.setAlarmSeconds(0); // Set RTC Alarm Seconds to zero uint8_t nextAlarmMin = ((GPS.minute+INTERVAL)/INTERVAL)*INTERVAL; // Calculate next alarm minutes nextAlarmMin = nextAlarmMin % 60; // Correct hour rollover rtc.setAlarmMinutes(nextAlarmMin); // Set RTC Alarm Minutes rtc.enableAlarm(rtc.MATCH_MMSS); // Alarm Match on minutes and seconds rtc.attachInterrupt(alarmMatch); // Attach alarm interrupt // check if voltage is > LOWBAT(V), if not then don't try to log any data if (vbat < LOWBAT) { Serial.println(""Low Battery!""); break; } // Disable the GPGGA and GPRMC messages; set the RAWX measurement rate GPS.sendCommand(""$PUBX,40,GGA,0,0,0,0*5A""); // Disable GGA delay(100); GPS.sendCommand(""$PUBX,40,RMC,0,0,0,0*47""); // Disable RMC delay(100); sendUBX(setRATE, len_setRATE); // Set Navigation/Measurement Rate delay(1100); // Wait while(Serial1.available()){Serial1.read();} // Flush RX buffer to clear UBX acknowledgement loop_step = open_file; // start logging rawx data } } } break; // Open the log file case open_file: { // Get the RTC time and date uint8_t RTCseconds = rtc.getSeconds(); uint8_t RTCminutes = rtc.getMinutes(); uint8_t RTChours = rtc.getHours(); uint8_t RTCday = rtc.getDay(); uint8_t RTCmonth = rtc.getMonth(); uint8_t RTCyear = rtc.getYear(); // Do the divides to convert date and time to char char secT = RTCseconds/10 + '0'; char secU = RTCseconds%10 + '0'; char minT = RTCminutes/10 + '0'; char minU = RTCminutes%10 + '0'; char hourT = RTChours/10 + '0'; char hourU = RTChours%10 + '0'; char dayT = RTCday/10 +'0'; char dayU = RTCday%10 +'0'; char monT = RTCmonth/10 +'0'; char monU = RTCmonth%10 +'0'; char yearT = RTCyear/10 +'0'; char yearU = RTCyear%10 +'0'; // filename is limited to 8.3 characters so use format: YYYYMMDD/r_HHMMSS.ubx or YYYYMMDD/b_HHMMSS.ubx rawx_filename[2] = yearT; rawx_filename[3] = yearU; rawx_filename[4] = monT; rawx_filename[5] = monU; rawx_filename[6] = dayT; rawx_filename[7] = dayU; rawx_filename[11] = hourT; rawx_filename[12] = hourU; rawx_filename[13] = minT; rawx_filename[14] = minU; rawx_filename[15] = secT; rawx_filename[16] = secU; dirname[2] = yearT; dirname[3] = yearU; dirname[4] = monT; dirname[5] = monU; dirname[6] = dayT; dirname[7] = dayU; // flash red LED to indicate SD write (leave on if an error occurs) digitalWrite(RedLED, HIGH); // try to create subdirectory (even if it exists already) sd.mkdir(dirname); // Open the rawx file for fast writing if (rawx_dataFile.open(rawx_filename, O_CREAT | O_WRITE | O_EXCL)) { Serial.print(""Logging to ""); Serial.println(rawx_filename); } // if the file isn't open, pop up an error: else { Serial.println(""Panic!! Error opening RAWX file!""); Serial.println(""Waiting for reset...""); // don't do anything more: while(1); } #ifdef DEBUG // Set the log file creation time if (!rawx_dataFile.timestamp(T_CREATE, (RTCyear+2000), RTCmonth, RTCday, RTChours, RTCminutes, RTCseconds)) { Serial.println(""Warning! Could not set file create timestamp!""); } #else rawx_dataFile.timestamp(T_CREATE, (RTCyear+2000), RTCmonth, RTCday, RTChours, RTCminutes, RTCseconds); #endif digitalWrite(RedLED, LOW); // turn red LED off bytes_written = 0; // Clear bytes_written bufferPointer = 0; // (Re)initialise bufferPointer // Start RAWX messages sendUBX(setRAWX, len_setRAWX); // Set RXM-RAWX message rate sendUBX(setSFRBX, len_setSFRBX); // Set RXM-SFRBX message rate sendUBX(setTIM, len_setTIM); // Set TIM-TM2 message rate while (Serial1.available() < 30) { ; } // Wait for three UBX acknowledgements' worth of data (3 x 10 = 30 bytes) for (int x=0;x<3;x++) { // Check ten bytes three times for (int y=0;y<10;y++) { // Get ten bytes serBuffer[bufferPointer] = Serial1.read(); // Add a character to serBuffer bufferPointer++; // Increment the pointer } // Now check if these bytes were an acknowledgement if ((serBuffer[bufferPointer - 10] == 0xB5) and (serBuffer[bufferPointer - 9] == 0x62) and (serBuffer[bufferPointer - 8] == 0x05)) { // This must be an acknowledgement so simply ignore it and decrement bufferPointer by 10 bufferPointer -= 10; } } loop_step = write_file; // start logging rawx data } break; // Stuff bytes into serBuffer and write when we have reached SDpacket case write_file: { if (Serial1.available()) { serBuffer[bufferPointer] = Serial1.read(); bufferPointer++; if (bufferPointer == SDpacket) { bufferPointer = 0; digitalWrite(RedLED, HIGH); // flash red LED numBytes = rawx_dataFile.write(&serBuffer, SDpacket); //rawx_dataFile.sync(); // Sync the file system bytes_written += SDpacket; digitalWrite(RedLED, LOW); #ifdef DEBUG if (numBytes != SDpacket) { Serial.print(""SD write error! Write size was ""); Serial.print(SDpacket); Serial.print("". ""); Serial.print(numBytes); Serial.println("" were written.""); } #endif //#ifdef DEBUG // Serial.print(""SD Write: ""); // Serial.print(SDpacket); // Serial.println("" Bytes""); // Serial.print(bytes_written); // Serial.println("" Bytes written so far""); //#endif } } else { // read battery voltage vbat = analogRead(A7) * (2.0 * 3.3 / 1023.0); // check if the stop button has been pressed or battery is low // or if there has been an RTC alarm and it is time to open a new file if ((digitalRead(swPin) == LOW) or (vbat < LOWBAT) or (alarmFlag == true)) { loop_step = close_file; // now close the file break; } } } break; // Disable RAWX messages, save any residual data and close the file case close_file: { sendUBX(setRAWXoff, len_setRAWX); // Disable messages sendUBX(setSFRBXoff, len_setSFRBX); // Disable messages sendUBX(setTIMoff, len_setTIM); // Disable messages int waitcount = 0; // leave 30 bytes in the serial buffer as this _should_ be the three message acknowledgements (3 x 10 bytes) while (waitcount < dwell) { // Wait for residual data while (Serial1.available() > 30) { // Leave 30 bytes in the serial buffer serBuffer[bufferPointer] = Serial1.read(); // Put extra bytes into serBuffer bufferPointer++; if (bufferPointer == SDpacket) { // Write a full packet bufferPointer = 0; digitalWrite(RedLED, HIGH); // flash red LED numBytes = rawx_dataFile.write(&serBuffer, SDpacket); //rawx_dataFile.sync(); // Sync the file system digitalWrite(RedLED, LOW); bytes_written += SDpacket; #ifdef DEBUG if (numBytes != SDpacket) { Serial.print(""SD write error! Write size was ""); Serial.print(SDpacket); Serial.print("". ""); Serial.print(numBytes); Serial.println("" were written.""); } Serial.print(""SD Write: ""); Serial.print(SDpacket); Serial.println("" Bytes""); Serial.print(bytes_written); Serial.println("" Bytes written so far""); #endif } } waitcount++; delay(1); } // If there is any data left in serBuffer, write it to file if (bufferPointer > 0) { digitalWrite(RedLED, HIGH); // flash red LED numBytes = rawx_dataFile.write(&serBuffer, bufferPointer); // Write remaining data rawx_dataFile.sync(); // Sync the file system bytes_written += bufferPointer; digitalWrite(RedLED, LOW); #ifdef DEBUG if (numBytes != bufferPointer) { Serial.print(""SD write error! Write size was ""); Serial.print(bufferPointer); Serial.print("". ""); Serial.print(numBytes); Serial.println("" were written.""); } Serial.print(""Penultimate/Final SD Write: ""); Serial.print(bufferPointer); Serial.println("" Bytes""); Serial.print(bytes_written); Serial.println("" Bytes written""); #endif bufferPointer = 0; // reset bufferPointer } // We now have exactly 30 bytes left in the buffer. Let's check if they contain acknowledgements or residual data. // If they contain residual data, save it to file. This means we have probably already saved acknowledgement(s) // to file and there's now very little we can do about that except hope that RTKLib knows to ignore them! for (int x=0;x<3;x++) { // Check ten bytes three times for (int y=0;y<10;y++) { // Add ten bytes serBuffer[bufferPointer] = Serial1.read(); // Add a character to serBuffer bufferPointer++; // Increment the pointer } // Now check if these bytes were an acknowledgement if ((serBuffer[bufferPointer - 10] == 0xB5) and (serBuffer[bufferPointer - 9] == 0x62) and (serBuffer[bufferPointer - 8] == 0x05)) { // This must be an acknowledgement so simply ignore it and decrement bufferPointer by 10 bufferPointer -= 10; } } // If the last 30 bytes did contain any data, write it to file now if (bufferPointer > 0) { digitalWrite(RedLED, HIGH); // flash red LED numBytes = rawx_dataFile.write(&serBuffer, bufferPointer); // Write remaining data rawx_dataFile.sync(); // Sync the file system bytes_written += bufferPointer; digitalWrite(RedLED, LOW); #ifdef DEBUG if (numBytes != bufferPointer) { Serial.print(""SD write error! Write size was ""); Serial.print(bufferPointer); Serial.print("". ""); Serial.print(numBytes); Serial.println("" were written.""); } Serial.print(""Final SD Write: ""); Serial.print(bufferPointer); Serial.println("" Bytes""); #endif bufferPointer = 0; // reset bufferPointer } digitalWrite(RedLED, HIGH); // flash red LED // Get the RTC time and date uint8_t RTCseconds = rtc.getSeconds(); uint8_t RTCminutes = rtc.getMinutes(); uint8_t RTChours = rtc.getHours(); uint8_t RTCday = rtc.getDay(); uint8_t RTCmonth = rtc.getMonth(); uint8_t RTCyear = rtc.getYear(); #ifdef DEBUG // Set log file write time if (!rawx_dataFile.timestamp(T_WRITE, (RTCyear+2000), RTCmonth, RTCday, RTChours, RTCminutes, RTCseconds)) { Serial.println(""Warning! Could not set file write timestamp!""); } #else rawx_dataFile.timestamp(T_WRITE, (RTCyear+2000), RTCmonth, RTCday, RTChours, RTCminutes, RTCseconds); #endif #ifdef DEBUG // Set log file access time if (!rawx_dataFile.timestamp(T_ACCESS, (RTCyear+2000), RTCmonth, RTCday, RTChours, RTCminutes, RTCseconds)) { Serial.println(""Warning! Could not set file access timestamp!""); } #else rawx_dataFile.timestamp(T_ACCESS, (RTCyear+2000), RTCmonth, RTCday, RTChours, RTCminutes, RTCseconds); #endif rawx_dataFile.close(); // close the file digitalWrite(RedLED, LOW); #ifdef DEBUG uint32_t filesize = rawx_dataFile.fileSize(); // Get the file size Serial.print(""File size is ""); Serial.println(filesize); Serial.print(""File size should be ""); Serial.println(bytes_written); #endif Serial.println(""File closed!""); if (alarmFlag == true) { // If an RTC alarm was detected, set the RTC alarm time to the next INTERVAL and loop back to open_file. // We only receive an RTC alarm on a minute mark, so it doesn't matter that the RTC seconds will have moved on at this point. alarmFlag = false; // Clear the RTC alarm flag uint8_t rtc_mins = rtc.getMinutes(); // Read the RTC minutes rtc_mins = rtc_mins + INTERVAL; // Add the INTERVAL to the RTC minutes rtc_mins = rtc_mins % 60; // Correct for hour rollover rtc.setAlarmMinutes(rtc_mins); // Set next alarm time (minutes only - hours are ignored) loop_step = open_file; // loop round again and open a new file } else { // Either the battery is low or the user pressed the stop button. So, just wait for a reset. digitalWrite(RedLED, HIGH); // leave the red led on Serial.println(""Waiting for reset...""); while(1); // Wait for reset } } break; } } ",12104,False,2151.1918799121772,median "/* ArduBoy Jet Pac Version 1.1 2nd Feb 2017 by Mike McRoberts (a.k.a. TheArduinoGuy) */ #define SAVELOCATION (/*EEPROM_STORAGE_SPACE_START +*/ 90) #include #include ""bitmaps.h"" #include //#include //#include Arduboy2 arduboy; ArduboyTones sound(arduboy.audio.enabled); byte level = 1; byte gameDifficulty = 2; byte levelStep = 0; byte rocketStep = 0; byte monsterType = 0; byte gameState = 4; byte subState = 0; unsigned long highScore; int8_t lives = 4; unsigned long score = 0; // fuel cells float fuelX; float fuelY = -8; byte fuelPercent=0; // Jet man data float jetManX = 60; float jetManY= 47; float jetManXRate = 0; float jetManYRate = 0; boolean jetManDirection = 1; byte jetManState=0; // rocket data byte topRocketX; float topRocketY; byte middleRocketX; float middleRocketY; byte bottomRocketX; float bottomRocketY; // data for the bonus items byte bonusX; float bonusY; boolean bonusState; byte bonusType; byte cloudIndex = 0; boolean jetPacFired = 0; boolean buttonBPressed = false; byte animToggle; unsigned long frameRate; unsigned long lastPressed; const byte platforms[] PROGMEM = { 2,4,3, 7,5,2, 11,3,3 }; const float rocketParts[] PROGMEM= { 24,24, 60,32, 76,55 }; struct movingObjects { float x; float y; float xRate; float yRate; boolean direction; }; movingObjects monsters[10]; struct cloudObjects { byte state; byte x; byte y; unsigned long time; }; cloudObjects clouds[10]; struct laserObjects { byte x; byte y; byte length; boolean direction; unsigned long time; }; laserObjects laserbeams[20]; byte laserIndex = 0; // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void setup() { //Serial.begin(115200); EEPROM.begin(200); arduboy.boot(); // raw hardware arduboy.blank(); // blank the display //arduboy.flashlight(); // light the RGB LED and screen if UP button is being held. arduboy.systemButtons(); arduboy.bootLogo(); arduboy.audio.on(); arduboy.clear(); //arduboy.begin(); arduboy.initRandomSeed(); arduboy.setFrameRate(60); frameRate = millis(); lastPressed = millis(); initialiseRocket(); arduboy.drawSlowXYBitmap(0, 0, JETPACLOADINGSCREEN, 128, 64); arduboy.display(); delay(5000); EEPROM.get(SAVELOCATION, highScore); } float RANDOMXL(){ return (0-random(64));} float RANDOMXR(){ return (128+random(64));} float RANDOMY(){ return (random(48)+8);} float RANDOMXRATE(){ return (float(0.15+(random(90+(gameDifficulty*5))/100)));} float RANDOMYRATE(){ return ((random(40)/100)-0.2);} float FUELRANDOM(){ return (random(2) ? 16+random(48) : 88+random(16));} // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void initialiseGameState(){ gameState = 1; jetManX=60; jetManY=47; jetManDirection=1; jetManXRate = 0; jetManYRate = 0; for (int index=0; index<9; index++) { clouds[index] = {0,0,0,0}; } for (int index=0; index<19; index++) { laserbeams[index] = {0,0,0,0,0}; } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void createMonsters() { for (int index=0; index < 9; index++) { boolean DIRECTION = (boolean)random(2); monsters[index] = {(DIRECTION ? RANDOMXR() : RANDOMXL()), RANDOMY(), RANDOMXRATE(), RANDOMYRATE(), DIRECTION}; } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void initialiseRocket() { topRocketX = pgm_read_float(&rocketParts[0]); topRocketY = pgm_read_float(&rocketParts[1]); middleRocketX = pgm_read_float(&rocketParts[2]); middleRocketY = pgm_read_float(&rocketParts[3]); bottomRocketX = pgm_read_float(&rocketParts[4]); bottomRocketY = pgm_read_float(&rocketParts[5]); } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void drawPlatforms() { for (byte index = 0; index<9; index=index+3) { byte length = pgm_read_byte(&platforms[index+2]); for (byte row = 0; row < length; row++) { byte platformX = pgm_read_byte(&platforms[index]); platformX = (platformX*8)+(row*8); byte platformY = pgm_read_byte(&platforms[index+1]); platformY = platformY*8; arduboy.drawBitmap(platformX, platformY, PLATFORM, 8, 8); } } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void drawJetMan() { if (jetManState==0) // standing { if (jetManDirection) { arduboy.drawBitmap(jetManX, jetManY, JETMANRIGHTHEAD, 8, 8); if (jetManXRate == 0) arduboy.drawBitmap(jetManX, jetManY+8, JETMANRIGHT1, 8, 8); else{ switch(animToggle) { case 0: arduboy.drawBitmap(jetManX, jetManY+8, JETMANRIGHT1, 8, 8); break; case 1: arduboy.drawBitmap(jetManX, jetManY+8, JETMANRIGHT2, 8, 8); break; case 2: arduboy.drawBitmap(jetManX, jetManY+8, JETMANRIGHT3, 8, 8); break; case 3: arduboy.drawBitmap(jetManX, jetManY+8, JETMANRIGHT2, 8, 8); break; } } } else { arduboy.drawBitmap(jetManX, jetManY, JETMANLEFTHEAD, 8, 8); if (jetManXRate == 0) arduboy.drawBitmap(jetManX, jetManY+8, JETMANLEFT1, 8, 8); else{ switch(animToggle) { case 0: arduboy.drawBitmap(jetManX, jetManY+8, JETMANLEFT1, 8, 8); break; case 1: arduboy.drawBitmap(jetManX, jetManY+8, JETMANLEFT2, 8, 8); break; case 2: arduboy.drawBitmap(jetManX, jetManY+8, JETMANLEFT3, 8, 8); break; case 3: arduboy.drawBitmap(jetManX, jetManY+8, JETMANLEFT2, 8, 8); break; } } } } if (jetManState==1 || jetManState==2) // Rising or falling { if (jetManDirection) { arduboy.drawBitmap(jetManX, jetManY, JETMANRIGHTHEAD, 8, 8); switch(animToggle) { case 0: arduboy.drawBitmap(jetManX, jetManY+8, JETMANRIGHTFLY1, 8, 8); break; case 1: arduboy.drawBitmap(jetManX, jetManY+8, JETMANRIGHTFLY2, 8, 8); break; case 2: arduboy.drawBitmap(jetManX, jetManY+8, JETMANRIGHTFLY3, 8, 8); break; case 3: arduboy.drawBitmap(jetManX, jetManY+8, JETMANRIGHTFLY2, 8, 8); break; } } else { arduboy.drawBitmap(jetManX, jetManY, JETMANLEFTHEAD, 8, 8); switch(animToggle) { case 0: arduboy.drawBitmap(jetManX, jetManY+8, JETMANLEFTFLY1, 8, 8); break; case 1: arduboy.drawBitmap(jetManX, jetManY+8, JETMANLEFTFLY2, 8, 8); break; case 2: arduboy.drawBitmap(jetManX, jetManY+8, JETMANLEFTFLY3, 8, 8); break; case 3: arduboy.drawBitmap(jetManX, jetManY+8, JETMANLEFTFLY2, 8, 8); break; } } } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void drawThings() { for (byte index = 0; index < gameDifficulty; index++) { float x = monsters[index].x; float y = monsters[index].y; boolean direction = monsters[index].direction; if (monsterType==0) { if (direction==1) arduboy.drawBitmap(x, y, (animToggle%2)==0 ? ASTEROIDRIGHT1 : ASTEROIDRIGHT2, 8, 8); else arduboy.drawBitmap(x, y, (animToggle%2)==0 ? ASTEROIDLEFT1 : ASTEROIDLEFT2, 8, 8); } if (monsterType==1) { arduboy.drawBitmap(x, y, (animToggle%2)==0 ? FUZZY1 : FUZZY2, 8, 8); } if (monsterType==2) { arduboy.drawBitmap(x, y, (animToggle%2)==0 ? BALL1 : BALL2, 8, 8); } if (monsterType==3) { if (direction==1) arduboy.drawBitmap(x, y, (animToggle%2)==0 ? PLANE1 : PLANE1, 8, 8); else arduboy.drawBitmap(x, y, (animToggle%2)==0 ? PLANE2 : PLANE2, 8, 8); } if (monsterType==4) { arduboy.drawBitmap(x, y, (animToggle%2)==0 ? CROSS : CROSS, 8, 8); } if (monsterType==5) { if (direction==1) arduboy.drawBitmap(x, y, (animToggle%2)==0 ? FALCON1 : FALCON1, 8, 8); else arduboy.drawBitmap(x, y, (animToggle%2)==0 ? FALCON2 : FALCON2, 8, 8); } if (monsterType==6) { arduboy.drawBitmap(x, y, (animToggle%2)==0 ? UFO1 : UFO2, 8, 8); } if (monsterType==7) { arduboy.drawBitmap(x, y, (animToggle%2)==0 ? JELLY : JELLY, 8, 8); } arduboy.drawBitmap(fuelX, fuelY, FUEL, 8, 8); drawRocket(); if (bonusState !=0) { switch(bonusType) { case 0: arduboy.drawBitmap(bonusX, bonusY, (animToggle%2)==0 ? DIAMOND : BLANK, 8, 8); break; case 1: arduboy.drawBitmap(bonusX, bonusY, (animToggle%2)==0 ? BREAD : BLANK, 8, 8); break; case 2: arduboy.drawBitmap(bonusX, bonusY, (animToggle%2)==0 ? GOLD : BLANK, 8, 8); break; case 3: arduboy.drawBitmap(bonusX, bonusY, (animToggle%2)==0 ? ATOM : BLANK, 8, 8); break; case 4: arduboy.drawBitmap(bonusX, bonusY, (animToggle%2)==0 ? NUKE : BLANK, 8, 8); break; } } } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void drawRocket() { switch(rocketStep) { case 0: arduboy.drawBitmap(topRocketX, topRocketY, TOPROCKET, 8, 8); arduboy.drawBitmap(middleRocketX, middleRocketY, MIDDLEROCKET, 8, 8); arduboy.drawBitmap(bottomRocketX, bottomRocketY, BOTTOMROCKET, 8, 8); break; case 1: arduboy.drawBitmap(topRocketX, topRocketY, TOPSHUTTLE, 8, 8); arduboy.drawBitmap(middleRocketX, middleRocketY, MIDDLESHUTTLE, 8, 8); arduboy.drawBitmap(bottomRocketX, bottomRocketY, BOTTOMSHUTTLE, 8, 8); break; case 2: arduboy.drawBitmap(topRocketX, topRocketY, TOPFAT, 8, 8); arduboy.drawBitmap(middleRocketX, middleRocketY, MIDDLEFAT, 8, 8); arduboy.drawBitmap(bottomRocketX, bottomRocketY, BOTTOMFAT, 8, 8); break; case 3: arduboy.drawBitmap(topRocketX, topRocketY, TOPFUTURE, 8, 8); arduboy.drawBitmap(middleRocketX, middleRocketY, MIDDLEFUTURE, 8, 8); arduboy.drawBitmap(bottomRocketX, bottomRocketY, BOTTOMFUTURE, 8, 8); break; } if (subState==11) { arduboy.drawBitmap(bottomRocketX, bottomRocketY+8, (animToggle%2)==0 ? THRUST1 : THRUST2, 8, 8); topRocketY -= 0.2; middleRocketY -= 0.2; bottomRocketY -= 0.2; jetManY = -20; if(bottomRocketY<-8) gameState = 3; explosionFX(); } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void rocketLand() { do { arduboy.clear(); switch(rocketStep) { case 0: arduboy.drawBitmap(topRocketX, topRocketY, TOPROCKET, 8, 8); arduboy.drawBitmap(middleRocketX, middleRocketY, MIDDLEROCKET, 8, 8); arduboy.drawBitmap(bottomRocketX, bottomRocketY, BOTTOMROCKET, 8, 8); break; case 1: arduboy.drawBitmap(topRocketX, topRocketY, TOPSHUTTLE, 8, 8); arduboy.drawBitmap(middleRocketX, middleRocketY, MIDDLESHUTTLE, 8, 8); arduboy.drawBitmap(bottomRocketX, bottomRocketY, BOTTOMSHUTTLE, 8, 8); break; case 2: arduboy.drawBitmap(topRocketX, topRocketY, TOPFAT, 8, 8); arduboy.drawBitmap(middleRocketX, middleRocketY, MIDDLEFAT, 8, 8); arduboy.drawBitmap(bottomRocketX, bottomRocketY, BOTTOMFAT, 8, 8); break; case 3: arduboy.drawBitmap(topRocketX, topRocketY, TOPFUTURE, 8, 8); arduboy.drawBitmap(middleRocketX, middleRocketY, MIDDLEFUTURE, 8, 8); arduboy.drawBitmap(bottomRocketX, bottomRocketY, BOTTOMFUTURE, 8, 8); break; } arduboy.drawBitmap(bottomRocketX, bottomRocketY+8, (animToggle%2)==0 ? THRUST1 : THRUST2, 8, 8); topRocketY += 0.2; middleRocketY += 0.2; bottomRocketY += 0.2; jetManY = -20; arduboy.drawFastHLine(0, 63, 128); // ground drawPlatforms(); arduboy.display(); explosionFX(); if ((millis()-frameRate)>50) { animToggle++; if (animToggle>3) animToggle=0; frameRate=millis(); } //Serial.write(arduboy.getBuffer(), 128 * 64 / 8); delay(1); } while (bottomRocketY<=55); clouds[cloudIndex].state = 1; clouds[cloudIndex].x = bottomRocketX; clouds[cloudIndex].y = bottomRocketY+4; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; clouds[cloudIndex].state = 1; clouds[cloudIndex].x = bottomRocketX-4; clouds[cloudIndex].y = bottomRocketY; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; clouds[cloudIndex].state = 1; clouds[cloudIndex].x = bottomRocketX+4; clouds[cloudIndex].y = bottomRocketY; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; jetManX=60; jetManY=47; gameState=1; fuelPercent = 0; fuelX = FUELRANDOM(); fuelY =-8; } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void drawClouds() { for (byte index=0; index<9; index++) { if (clouds[index].state >0) { switch(clouds[index].state) { case 1: arduboy.drawBitmap(clouds[index].x,clouds[index].y, CLOUD1, 8, 8); break; case 2: arduboy.drawBitmap(clouds[index].x-4,clouds[index].y-4, CLOUD2, 16, 16); break; case 3: arduboy.drawBitmap(clouds[index].x-4,clouds[index].y-4, CLOUD3, 16, 16); break; } if ((millis()-clouds[index].time)>100) { clouds[index].state++; if (clouds[index].state>3) clouds[index].state = 0; clouds[index].time = millis(); } } } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void drawlasers() { for (byte index = 0; index < 20; index++) { if(laserbeams[index].length != 0) { byte beamLength = laserbeams[index].length; if (beamLength>8) beamLength = 8; for (byte multiplier=0; multiplier4) && multiplier<4) arduboy.drawBitmap(laserbeams[index].x+((8*multiplier)*(laserbeams[index].direction ? 1 : -1)),laserbeams[index].y, LASER2, 8, 8); else arduboy.drawBitmap(laserbeams[index].x+((8*multiplier)*(laserbeams[index].direction ? 1 : -1)),laserbeams[index].y, LASER1, 8, 8); checkForHit(laserbeams[index].x+((8*multiplier)*(laserbeams[index].direction ? 1 : -1)), laserbeams[index].y); } if ((millis()-laserbeams[index].time)>20) { laserbeams[index].length +=1; if (laserbeams[index].length>8) laserbeams[index].x +=(8*(laserbeams[index].direction ? 1 : -1)); if (laserbeams[index].length>16) laserbeams[index].length = 0; laserbeams[index].time = millis(); } } } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void moveThings() { for (byte index = 0; index < gameDifficulty; index++) { boolean direction = monsters[index].direction; float xRate = monsters[index].xRate; float yRate = monsters[index].yRate; monsters[index].x = monsters[index].x + (direction ? +xRate : -xRate); monsters[index].y = monsters[index].y + yRate; byte topA = monsters[index].y; byte bottomA = monsters[index].y+7; byte leftA = monsters[index].x; byte rightA = monsters[index].x+7; // get the bounding boxes of the platforms and monsters for (byte platformIndex = 0; platformIndex<9; platformIndex=platformIndex+3) { byte length = pgm_read_byte(&platforms[platformIndex+2]); byte leftB = pgm_read_byte(&platforms[platformIndex]); leftB = (leftB*8); byte topB = pgm_read_byte(&platforms[platformIndex+1]); topB = topB*8; byte rightB = leftB+(8*length); byte bottomB = topB+3; // check if object A (monster) has hit object B (platform) if (topA <= bottomB && bottomA >= topB && leftA <= rightB && rightA >= leftB) { if (monsterType==0) { clouds[cloudIndex].state = 1; clouds[cloudIndex].x = leftA; clouds[cloudIndex].y = topA; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; boolean DIRECTION = (boolean)random(2); monsters[index] = {(DIRECTION ? RANDOMXR() : RANDOMXL()), RANDOMY(), RANDOMXRATE(), RANDOMYRATE(), DIRECTION}; } else { // horizontal collision if (leftA < leftB || rightA > rightB) { monsters[index].direction = !(monsters[index].direction); } // vertical collision if (bottomA > bottomB || topA < topB) { monsters[index].yRate = -yRate; } } } } if ((monsters[index].x > 127) || (monsters[index].x < -7.0)) { monsters[index].x = direction ? -7 : 127; monsters[index].xRate = RANDOMXRATE(); } if ((monsters[index].y > 57) || (monsters[index].y < 7)) { monsters[index].yRate = -(monsters[index].yRate); } if (random(3000) == 1500 && monsterType != 0) monsters[index].direction = !monsters[index].direction; if (random(1000) == 500 && monsterType != 0) monsters[index].yRate = RANDOMYRATE(); } if (bonusState==1) { for (byte index = 0; index<9; index=index+3) { byte length = pgm_read_byte(&platforms[index+2]); byte platformX = pgm_read_byte(&platforms[index] ); platformX = (platformX*8); byte platformY = pgm_read_byte(&platforms[index+1] ); platformY = platformY*8; byte platformEnd = platformX+(8*length); if ( ((byte)bonusY==(platformY-8)) && (((bonusX+6)>=platformX) && ((bonusX+2)<=platformEnd)) ) { bonusY = platformY-8; bonusState = 2; // landed } else bonusY += 0.1; if (bonusY>55) { bonusY = 55; bonusState = 2; // landed } } } switch(subState) { case 1: // picked up middle rocket section middleRocketX = jetManX; middleRocketY = jetManY+8; if ((jetManX==bottomRocketX)) { subState=2; } break; case 2: // middle section falling middleRocketY += 0.2; if (middleRocketY >= 47) { middleRocketY =47; subState = 3; } break; case 4: // picked up top section topRocketX = jetManX; topRocketY = jetManY+8; if ((jetManX==bottomRocketX)) { subState=5; } break; case 5: // top section falling topRocketY += 0.2; if (topRocketY >= 39) { topRocketY =39; fuelX = FUELRANDOM(); fuelY=-8; subState = 6; } break; case 6: // fuel falling for (byte index = 0; index<9; index=index+3) { byte length = pgm_read_byte(&platforms[index+2]); byte platformX = pgm_read_byte(&platforms[index] ); platformX = (platformX*8); byte platformY = pgm_read_byte(&platforms[index+1] ); platformY = platformY*8; byte platformEnd = platformX+(8*length); if ( ((byte)fuelY==(platformY-8)) && (((fuelX+6)>=platformX) && ((fuelX+2)<=platformEnd)) ) { fuelY = platformY-8; subState = 7; } else fuelY += 0.1; if (fuelY>55) { fuelY = 55; subState = 7; } } break; case 8: // jet man carrying fuel fuelX = jetManX; fuelY = jetManY+8; if ((jetManX==bottomRocketX)) { subState=9; } break; case 9: // fuel falling onto rocket fuelY += 0.2; if (fuelY >= 55) { fuelX=FUELRANDOM(); fuelY=-8; fuelPercent += 25; subState = 6; if (fuelPercent>=100) subState = 10; } break; } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void moveJetMan() { jetManX = jetManX + (jetManDirection ? +jetManXRate : -jetManXRate); jetManY = jetManY + jetManYRate; if (jetManX > 119) { jetManXRate = 0; jetManX = 119; } if (jetManX < 0) { jetManXRate = 0; jetManX = 0; } if (jetManY <0) { jetManYRate = 0; jetManY = 0; } if (jetManY >=47) { jetManYRate = 0; jetManY = 47; jetManState = 0; // Standing } for (byte index = 0; index<9; index=index+3) { byte length = pgm_read_byte(&platforms[index+2]); byte platformX = pgm_read_byte(&platforms[index] ); platformX = (platformX*8); byte platformY = pgm_read_byte(&platforms[index+1] ); platformY = platformY*8; byte platformEnd = platformX+(8*length); if (((jetManState == 0) && (jetManY<47)) && ((jetManX+6platformEnd)) ) { jetManState = 2; jetManYRate = 0.5; } if ((((jetManX+6)>=platformX) && ((jetManX+4)<=platformEnd)) && (jetManY==platformY-16)) { jetManState = 0; jetManY = platformY-16; jetManXRate = 0; jetManYRate = 0; break; } } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void checkButtons() { if( arduboy.pressed(A_BUTTON) == true || arduboy.pressed(UP_BUTTON) == true) { jetPacFire(); } if( arduboy.pressed(A_BUTTON) == false && arduboy.pressed(UP_BUTTON) == false) { jetPacRelease(); } if( arduboy.notPressed(RIGHT_BUTTON) == true ) { jetManXRate = 0; } if( arduboy.notPressed(LEFT_BUTTON) == true ) { jetManXRate = 0; } if( arduboy.pressed(RIGHT_BUTTON) == true ) { jetManXRate = 1; jetManDirection = 1; } if( arduboy.pressed(LEFT_BUTTON) == true ) { jetManXRate = 1; jetManDirection = 0; } if((subState<11) && (arduboy.pressed(B_BUTTON) == true || arduboy.pressed(DOWN_BUTTON) == true) && ((millis()-lastPressed)>100)) { laserbeams[laserIndex].x = jetManX + (jetManDirection ? 10 : -10); laserbeams[laserIndex].length = 1; laserbeams[laserIndex].y = jetManY+9; laserbeams[laserIndex].direction = jetManDirection; laserbeams[laserIndex].time = millis(); laserIndex++; if (laserIndex>19) laserIndex=0; for (int start = 50; start < 125; start = start + 1) { digitalWrite(D3, HIGH); //positive square wave //digitalWrite(5, LOW); //positive square wavedelayMicroseconds(start); //192uS delayMicroseconds(start); digitalWrite(D3, LOW); //neutral square wave //digitalWrite(5, HIGH); //positive square wave delayMicroseconds(start); //192uS } lastPressed = millis(); } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void jetPacFire() { jetManState = 1; // rising; jetManYRate = -1; if (jetPacFired == false) { clouds[cloudIndex].state = 1; clouds[cloudIndex].x = jetManX; clouds[cloudIndex].y = jetManY+8; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; } jetPacFired = true; } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void jetPacRelease() { if (jetManState == 1) { jetManState = 2; // falling; jetManYRate = 0.5; } jetPacFired = false; } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void checkForHit(byte laserX, byte laserY) { for (byte index=0; index= y && laserY <=y+7) && (laserX>=x && laserX<=x+7)) { hit = true; } if (hit==true) { clouds[cloudIndex].state = 1; explosionFX(); explosionFX(); clouds[cloudIndex].x = x; clouds[cloudIndex].y = y; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; score=score+25; boolean DIRECTION = (boolean)random(2); monsters[index] = {DIRECTION ? RANDOMXR() : RANDOMXL(), RANDOMY(),RANDOMXRATE(),RANDOMYRATE(),DIRECTION}; } } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void checkJetManHit() { for (byte index=0; index=manX+1 && x<=manX+6) && (y>=manY+1 && y<=manY+14)) || ((x+7>=manX+1 && x+7<=manX+6) && (y+7>=manY+1 && y+7<=manY+14))) { hit = true; } if (hit==true) { if (subState==8) subState = 6; explosionFX(); explosionFX(); explosionFX(); explosionFX(); clouds[cloudIndex].state = 1; clouds[cloudIndex].x = manX; clouds[cloudIndex].y = manY+4; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; clouds[cloudIndex].state = 1; clouds[cloudIndex].x = manX-4; clouds[cloudIndex].y = manY; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; clouds[cloudIndex].state = 1; clouds[cloudIndex].x = manX+4; clouds[cloudIndex].y = manY; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; gameState=0; jetManX=60; jetManY=47; jetManDirection=1; jetManXRate = 0; jetManYRate = 0; lives=lives-1; if (lives<0) gameState = 2; sound.tone(800,200, 600, 200, 200, 400); for (int x=0; x<300; x++) { arduboy.clear(); arduboy.drawFastHLine(0, 63, 128); // ground drawPlatforms(); drawThings(); drawClouds(); drawlasers(); //Serial.write(arduboy.getBuffer(), 128 * 64 / 8); arduboy.display(); } } } } //#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void explosionFX() { // Explosion sound for (int start = 0; start < 25; start = start + 1) { digitalWrite(D3, HIGH); //digitalWrite(5, LOW); delayMicroseconds(random(100)); digitalWrite(D3, LOW); //digitalWrite(5, HIGH); delayMicroseconds(random(100)); } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void gameOn() { arduboy.drawFastHLine(0, 63, 128); // ground if (fuelPercent>0 && subState<11) { if (((animToggle%2)==0) && (fuelPercent==100)) arduboy.drawFastHLine(0,0,1.28*fuelPercent); if (fuelPercent<100) arduboy.drawFastHLine(0,0,1.28*fuelPercent); } drawPlatforms(); drawThings(); if (subState<11) { drawJetMan(); checkJetManHit(); } drawClouds(); drawlasers(); pickUpItem(); checkButtons(); moveJetMan(); moveThings(); if (subState>6 && bonusState==0 && random(500)==250) { bonusX = FUELRANDOM(); bonusY=-8; bonusState = 1; // item created bonusType = random(5); } if ((millis()-frameRate)>50) { animToggle++; if (animToggle>3) animToggle=0; frameRate=millis(); } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void gameOver() { if (score > highScore) { EEPROM.put(SAVELOCATION, score); EEPROM.commit(); } delay(100); arduboy.clear(); arduboy.setTextSize(2); arduboy.setCursor(8, 40); arduboy.print(""GAME OVER ""); arduboy.setTextSize(1); arduboy.setCursor(22, 2); if (score > highScore) arduboy.print(""NEW HIGH SCORE""); else { arduboy.setCursor(48, 2); arduboy.print(""SCORE""); } byte len = floor (log10 (abs (score))) + 1; arduboy.setCursor(60-(2*len),18); arduboy.print(score); arduboy.display(); //Serial.write(arduboy.getBuffer(), 128 * 64 / 8); delay(5000); level = 1; gameDifficulty = 2; levelStep = 0; rocketStep = 0; monsterType = 0; gameState = 0; subState = 0; lives = 4; score = 0; fuelY = -8; fuelPercent=0; jetManX = 60; jetManY= 47; jetManXRate = 0; jetManYRate = 0; jetManDirection = 1; jetManState=0; cloudIndex = 0; jetPacFired = 0; buttonBPressed = false; initialiseGameState(); initialiseRocket(); createMonsters(); levelStart(); } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void levelStart() { EEPROM.get(SAVELOCATION, highScore); arduboy.clear(); arduboy.setTextSize(1); arduboy.setCursor(1,1); arduboy.print(""Score: ""); arduboy.setCursor(70,1); arduboy.print(score); arduboy.setCursor(1,14); arduboy.print(""High Score: ""); arduboy.setCursor(70,14); if (score>highScore) arduboy.print(score); else arduboy.print(highScore); arduboy.drawBitmap(1,27, LITTLEMAN, 8, 8); arduboy.setCursor(12, 27); arduboy.print(lives); arduboy.setTextSize(2); arduboy.setCursor(12, 46); arduboy.print(""LEVEL ""); arduboy.print(level); arduboy.display(); //Serial.write(arduboy.getBuffer(), 128 * 64 / 8); do { delay(5); //Serial.write(arduboy.getBuffer(), 128 * 64 / 8); } while(arduboy.notPressed(A_BUTTON) && arduboy.notPressed(B_BUTTON)); sound.tone(1000, 200); delay(500); createMonsters(); gameState=1; bonusState=0; } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void levelComplete() { initialiseGameState(); subState = 0; level = level + 1; monsterType = monsterType + 1; if (monsterType==8) { monsterType = 0; gameDifficulty = gameDifficulty + 1; if (gameDifficulty>10) gameDifficulty=10; } levelStart(); levelStep++; if (levelStep!=5) { rocketLand(); subState=6; } else { initialiseRocket(); subState=0; levelStep=0; rocketStep++; if(rocketStep==4) rocketStep=0; } fuelPercent = 0; arduboy.initRandomSeed(); } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void pickUpItem() { byte topJ = jetManY+8; byte bottomJ = jetManY+15; byte leftJ = jetManX; byte rightJ = jetManX+7; if (bonusState!=0) // pick up the bonus item { byte topR = bonusY; byte bottomR = bonusY+7; byte leftR = bonusX; byte rightR = bonusX+7; if (topJ <= bottomR && bottomJ >= topR && leftJ <= rightR && rightJ >= leftR) { bonusState=0; score += 250; sound.tone(NOTE_A5,50,NOTE_A6,50,NOTE_A7,100); } } if (subState==0) // pick up the middle rocket section { byte topR = middleRocketY; byte bottomR = middleRocketY+7; byte leftR = middleRocketX; byte rightR = middleRocketX+7; if (topJ <= bottomR && bottomJ >= topR && leftJ <= rightR && rightJ >= leftR) { subState=1; score += 100; sound.tone(NOTE_A4,50,NOTE_A5,50,NOTE_A6,100); } } if (subState==3) // pick up the top rocket section { byte topR = topRocketY; byte bottomR = topRocketY+7; byte leftR = topRocketX; byte rightR = topRocketX+7; if (topJ <= bottomR && bottomJ >= topR && leftJ <= rightR && rightJ >= leftR) { subState=4; score += 100; sound.tone(NOTE_A4,50,NOTE_A5,50,NOTE_A6,100); } } if (subState==6 || subState==7) // pick up fuel cell { byte topR = fuelY; byte bottomR = fuelY+7; byte leftR = fuelX; byte rightR = fuelX+7; if (topJ <= bottomR && bottomJ >= topR && leftJ <= rightR && rightJ >= leftR) { subState=8; score += 100; sound.tone(NOTE_A4,50,NOTE_A5,50,NOTE_A6,100); } } if (subState==10) // Walk into the rocket { byte topR = bottomRocketY; byte bottomR = bottomRocketY+7; byte leftR = bottomRocketX; byte rightR = bottomRocketX+7; if (topJ <= bottomR && bottomJ >= topR && leftJ <= rightR && rightJ >= leftR) { subState=11; clouds[cloudIndex].state = 1; clouds[cloudIndex].x = bottomRocketX; clouds[cloudIndex].y = bottomRocketY+4; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; clouds[cloudIndex].state = 1; clouds[cloudIndex].x = bottomRocketX-4; clouds[cloudIndex].y = bottomRocketY; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; clouds[cloudIndex].state = 1; clouds[cloudIndex].x = bottomRocketX+4; clouds[cloudIndex].y = bottomRocketY; clouds[cloudIndex].time = millis(); cloudIndex++; if (cloudIndex>9) cloudIndex=0; sound.tone(NOTE_A4,50,NOTE_A5,50,NOTE_A6,100); score += 500; } } } void menu() { boolean up = true; while (1) { if( arduboy.pressed(UP_BUTTON) == true ) { up = true; arduboy.clear(); } if( arduboy.pressed(DOWN_BUTTON) == true) { up = false; arduboy.clear(); } if (up == true) { arduboy.fillCircle(13,23,3); } else { arduboy.fillCircle(13,43,3); } if( arduboy.pressed(A_BUTTON) == true ) { if (up == true) { delay(150); gameState=0; break; } else { delay(150); eraseEEPROM(); gameState=0; break; } } arduboy.setCursor(20,20); arduboy.print(""NEW GAME""); arduboy.setCursor(20,40); arduboy.print(""RESET HIGH SCORE""); arduboy.display(); delay(1); } } void eraseEEPROM() { arduboy.clear(); boolean up = false; while (1) { if( arduboy.pressed(UP_BUTTON) == true ) { up = true; arduboy.clear(); } if( arduboy.pressed(DOWN_BUTTON) == true) { up = false; arduboy.clear(); } if (up == true) { arduboy.fillCircle(13,23,3); } else { arduboy.fillCircle(13,43,3); } if( arduboy.pressed(A_BUTTON) == true ) { if (up == true) { delay(150); highScore = 0; // First time run of program only then comment out and reload EEPROM.put(SAVELOCATION, highScore); // First time run of program only EEPROM.commit(); gameState=0; break; } else { delay(150); gameState=0; break; } } arduboy.setCursor(20,00); arduboy.print(""ARE YOU SURE?""); arduboy.setCursor(20,20); arduboy.print(""YES""); arduboy.setCursor(20,40); arduboy.print(""NO""); arduboy.display(); delay(1); } } // #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#= void loop() { if (!arduboy.nextFrame()) {delay(1); return;} // Keep frame rate at 60fps arduboy.clear(); switch(gameState) { case 0: levelStart(); break; case 1: gameOn(); break; case 2: gameOver(); break; case 3: levelComplete(); break; case 4: menu(); break; } delay(1); //Serial.write(arduboy.getBuffer(), 128 * 64 / 8); arduboy.display(); } ",12512,True,2706.0672959565613,median " ; Don't even think of reading this code ; It was automatically generated by sha1-586.pl ; Which is a perl program used to generate the x86 assember for ; any of ELF, a.out, COFF, Win32, ... ; eric ; TITLE sha1-386.asm .486 .model FLAT _TEXT$ SEGMENT PAGE 'CODE' PUBLIC _sha1_block_asm_data_order USEBWAP_no EQU define IFDEF USEBWAP bwapman MACRO REGSWAP bswap REGSWAP ENDM ELSE bwapman MACRO REGSWAP mov ebx, REGSWAP mov edx, REGSWAP shl edx, 16 ; 00000010H and REGSWAP, 65280 ; 0000ff00H or REGSWAP, edx mov edx, ebx and edx, 16711680 ; 00ff0000H shr ebx, 16 ; 00000010H or edx, ebx shl REGSWAP, 8 shr edx, 8 or REGSWAP, edx ENDM ENDIF IFDEF BSWAPNEW BSWAPEAX macro xor edx, edx mov dh, al mov ebx, eax shr eax, 16 ; 00000010H mov dl, bh xor ebx, ebx mov bh, al movzx eax, ah shl edx, 16 ; 00000010H movzx ebx, bx or edx, ebx or eax, edx ENDM BSWAPECX macro xor edx, edx mov dh, cl mov ebx, ecx shr ecx, 16 ; 00000010H mov dl, bh xor ebx, ebx mov bh, cl movzx ecx, ch shl edx, 16 ; 00000010H movzx ebx, bx or edx, ebx or ecx, edx ENDM ELSE BSWAPEAX MACRO bwapman eax ENDM BSWAPECX MACRO bwapman ecx ENDM ENDIF MULSWAP MACRO dep mov eax, DWORD PTR (0+dep)[esi] mov BYTE PTR (2+dep)[esp],ah mov BYTE PTR (3+dep)[esp],al mov ecx, DWORD PTR (4+dep)[esi] shr eax,16 mov BYTE PTR (6+dep)[esp],ch mov BYTE PTR (7+dep)[esp],cl mov BYTE PTR (0+dep)[esp],ah shr ecx,16 mov BYTE PTR (1+dep)[esp],al mov BYTE PTR (4+dep)[esp],ch mov BYTE PTR (5+dep)[esp],cl ENDM _sha1_block_asm_data_order PROC NEAR mov ecx, DWORD PTR 12[esp] push esi shl ecx, 6 mov esi, DWORD PTR 12[esp] push ebp add ecx, esi push ebx mov ebp, DWORD PTR 16[esp] push edi mov edx, DWORD PTR 12[ebp] sub esp, 108 mov edi, DWORD PTR 16[ebp] mov ebx, DWORD PTR 8[ebp] mov DWORD PTR 68[esp],ecx ; First we need to setup the X array $L000start: ; First, load the words onto the stack in network byte order mov [esp-8],ebx mov [esp-4],edx MULSWAP (0) MULSWAP (8) MULSWAP (16) MULSWAP (24) MULSWAP (32) MULSWAP (40) MULSWAP (48) MULSWAP (56) ; We now have the X array on the stack ; starting at sp-4 mov DWORD PTR 132[esp],esi mov ebx,[esp-8] mov edx,[esp-4] $L001shortcut:: ; ; Start processing mov eax, DWORD PTR [ebp] mov ecx, DWORD PTR 4[ebp] ; 00_15 0 mov esi, ebx mov ebp, eax rol ebp, 5 xor esi, edx and esi, ecx add ebp, edi mov edi, DWORD PTR [esp] xor esi, edx ror ecx, 2 lea ebp, DWORD PTR 1518500249[edi*1+ebp] add ebp, esi ; 00_15 1 mov edi, ecx mov esi, ebp rol ebp, 5 xor edi, ebx and edi, eax add ebp, edx mov edx, DWORD PTR 4[esp] xor edi, ebx ror eax, 2 lea ebp, DWORD PTR 1518500249[edx*1+ebp] add ebp, edi ; 00_15 2 mov edx, eax mov edi, ebp rol ebp, 5 xor edx, ecx and edx, esi add ebp, ebx mov ebx, DWORD PTR 8[esp] xor edx, ecx ror esi, 2 lea ebp, DWORD PTR 1518500249[ebx*1+ebp] add ebp, edx ; 00_15 3 mov ebx, esi mov edx, ebp rol ebp, 5 xor ebx, eax and ebx, edi add ebp, ecx mov ecx, DWORD PTR 12[esp] xor ebx, eax ror edi, 2 lea ebp, DWORD PTR 1518500249[ecx*1+ebp] add ebp, ebx ; 00_15 4 mov ecx, edi mov ebx, ebp rol ebp, 5 xor ecx, esi and ecx, edx add ebp, eax mov eax, DWORD PTR 16[esp] xor ecx, esi ror edx, 2 lea ebp, DWORD PTR 1518500249[eax*1+ebp] add ebp, ecx ; 00_15 5 mov eax, edx mov ecx, ebp rol ebp, 5 xor eax, edi and eax, ebx add ebp, esi mov esi, DWORD PTR 20[esp] xor eax, edi ror ebx, 2 lea ebp, DWORD PTR 1518500249[esi*1+ebp] add ebp, eax ; 00_15 6 mov esi, ebx mov eax, ebp rol ebp, 5 xor esi, edx and esi, ecx add ebp, edi mov edi, DWORD PTR 24[esp] xor esi, edx ror ecx, 2 lea ebp, DWORD PTR 1518500249[edi*1+ebp] add ebp, esi ; 00_15 7 mov edi, ecx mov esi, ebp rol ebp, 5 xor edi, ebx and edi, eax add ebp, edx mov edx, DWORD PTR 28[esp] xor edi, ebx ror eax, 2 lea ebp, DWORD PTR 1518500249[edx*1+ebp] add ebp, edi ; 00_15 8 mov edx, eax mov edi, ebp rol ebp, 5 xor edx, ecx and edx, esi add ebp, ebx mov ebx, DWORD PTR 32[esp] xor edx, ecx ror esi, 2 lea ebp, DWORD PTR 1518500249[ebx*1+ebp] add ebp, edx ; 00_15 9 mov ebx, esi mov edx, ebp rol ebp, 5 xor ebx, eax and ebx, edi add ebp, ecx mov ecx, DWORD PTR 36[esp] xor ebx, eax ror edi, 2 lea ebp, DWORD PTR 1518500249[ecx*1+ebp] add ebp, ebx ; 00_15 10 mov ecx, edi mov ebx, ebp rol ebp, 5 xor ecx, esi and ecx, edx add ebp, eax mov eax, DWORD PTR 40[esp] xor ecx, esi ror edx, 2 lea ebp, DWORD PTR 1518500249[eax*1+ebp] add ebp, ecx ; 00_15 11 mov eax, edx mov ecx, ebp rol ebp, 5 xor eax, edi and eax, ebx add ebp, esi mov esi, DWORD PTR 44[esp] xor eax, edi ror ebx, 2 lea ebp, DWORD PTR 1518500249[esi*1+ebp] add ebp, eax ; 00_15 12 mov esi, ebx mov eax, ebp rol ebp, 5 xor esi, edx and esi, ecx add ebp, edi mov edi, DWORD PTR 48[esp] xor esi, edx ror ecx, 2 lea ebp, DWORD PTR 1518500249[edi*1+ebp] add ebp, esi ; 00_15 13 mov edi, ecx mov esi, ebp rol ebp, 5 xor edi, ebx and edi, eax add ebp, edx mov edx, DWORD PTR 52[esp] xor edi, ebx ror eax, 2 lea ebp, DWORD PTR 1518500249[edx*1+ebp] add ebp, edi ; 00_15 14 mov edx, eax mov edi, ebp rol ebp, 5 xor edx, ecx and edx, esi add ebp, ebx mov ebx, DWORD PTR 56[esp] xor edx, ecx ror esi, 2 lea ebp, DWORD PTR 1518500249[ebx*1+ebp] add ebp, edx ; 00_15 15 mov ebx, esi mov edx, ebp rol ebp, 5 xor ebx, eax and ebx, edi add ebp, ecx mov ecx, DWORD PTR 60[esp] xor ebx, eax ror edi, 2 lea ebp, DWORD PTR 1518500249[ecx*1+ebp] add ebx, ebp ; 16_19 16 mov ecx, DWORD PTR 8[esp] mov ebp, edi xor ecx, DWORD PTR [esp] xor ebp, esi xor ecx, DWORD PTR 32[esp] and ebp, edx ror edx, 2 xor ecx, DWORD PTR 52[esp] rol ecx, 1 xor ebp, esi mov DWORD PTR [esp],ecx lea ecx, DWORD PTR 1518500249[eax*1+ecx] mov eax, ebx rol eax, 5 add ecx, ebp add ecx, eax ; 16_19 17 mov eax, DWORD PTR 12[esp] mov ebp, edx xor eax, DWORD PTR 4[esp] xor ebp, edi xor eax, DWORD PTR 36[esp] and ebp, ebx ror ebx, 2 xor eax, DWORD PTR 56[esp] rol eax, 1 xor ebp, edi mov DWORD PTR 4[esp],eax lea eax, DWORD PTR 1518500249[esi*1+eax] mov esi, ecx rol esi, 5 add eax, ebp add eax, esi ; 16_19 18 mov esi, DWORD PTR 16[esp] mov ebp, ebx xor esi, DWORD PTR 8[esp] xor ebp, edx xor esi, DWORD PTR 40[esp] and ebp, ecx ror ecx, 2 xor esi, DWORD PTR 60[esp] rol esi, 1 xor ebp, edx mov DWORD PTR 8[esp],esi lea esi, DWORD PTR 1518500249[edi*1+esi] mov edi, eax rol edi, 5 add esi, ebp add esi, edi ; 16_19 19 mov edi, DWORD PTR 20[esp] mov ebp, ecx xor edi, DWORD PTR 12[esp] xor ebp, ebx xor edi, DWORD PTR 44[esp] and ebp, eax ror eax, 2 xor edi, DWORD PTR [esp] rol edi, 1 xor ebp, ebx mov DWORD PTR 12[esp],edi lea edi, DWORD PTR 1518500249[edx*1+edi] mov edx, esi rol edx, 5 add edi, ebp add edi, edx ; 20_39 20 mov ebp, esi mov edx, DWORD PTR 16[esp] ror esi, 2 xor edx, DWORD PTR 24[esp] xor ebp, eax xor edx, DWORD PTR 48[esp] xor ebp, ecx xor edx, DWORD PTR 4[esp] rol edx, 1 add ebp, ebx mov DWORD PTR 16[esp],edx mov ebx, edi rol ebx, 5 lea edx, DWORD PTR 1859775393[ebp*1+edx] add edx, ebx ; 20_39 21 mov ebp, edi mov ebx, DWORD PTR 20[esp] ror edi, 2 xor ebx, DWORD PTR 28[esp] xor ebp, esi xor ebx, DWORD PTR 52[esp] xor ebp, eax xor ebx, DWORD PTR 8[esp] rol ebx, 1 add ebp, ecx mov DWORD PTR 20[esp],ebx mov ecx, edx rol ecx, 5 lea ebx, DWORD PTR 1859775393[ebp*1+ebx] add ebx, ecx ; 20_39 22 mov ebp, edx mov ecx, DWORD PTR 24[esp] ror edx, 2 xor ecx, DWORD PTR 32[esp] xor ebp, edi xor ecx, DWORD PTR 56[esp] xor ebp, esi xor ecx, DWORD PTR 12[esp] rol ecx, 1 add ebp, eax mov DWORD PTR 24[esp],ecx mov eax, ebx rol eax, 5 lea ecx, DWORD PTR 1859775393[ebp*1+ecx] add ecx, eax ; 20_39 23 mov ebp, ebx mov eax, DWORD PTR 28[esp] ror ebx, 2 xor eax, DWORD PTR 36[esp] xor ebp, edx xor eax, DWORD PTR 60[esp] xor ebp, edi xor eax, DWORD PTR 16[esp] rol eax, 1 add ebp, esi mov DWORD PTR 28[esp],eax mov esi, ecx rol esi, 5 lea eax, DWORD PTR 1859775393[ebp*1+eax] add eax, esi ; 20_39 24 mov ebp, ecx mov esi, DWORD PTR 32[esp] ror ecx, 2 xor esi, DWORD PTR 40[esp] xor ebp, ebx xor esi, DWORD PTR [esp] xor ebp, edx xor esi, DWORD PTR 20[esp] rol esi, 1 add ebp, edi mov DWORD PTR 32[esp],esi mov edi, eax rol edi, 5 lea esi, DWORD PTR 1859775393[ebp*1+esi] add esi, edi ; 20_39 25 mov ebp, eax mov edi, DWORD PTR 36[esp] ror eax, 2 xor edi, DWORD PTR 44[esp] xor ebp, ecx xor edi, DWORD PTR 4[esp] xor ebp, ebx xor edi, DWORD PTR 24[esp] rol edi, 1 add ebp, edx mov DWORD PTR 36[esp],edi mov edx, esi rol edx, 5 lea edi, DWORD PTR 1859775393[ebp*1+edi] add edi, edx ; 20_39 26 mov ebp, esi mov edx, DWORD PTR 40[esp] ror esi, 2 xor edx, DWORD PTR 48[esp] xor ebp, eax xor edx, DWORD PTR 8[esp] xor ebp, ecx xor edx, DWORD PTR 28[esp] rol edx, 1 add ebp, ebx mov DWORD PTR 40[esp],edx mov ebx, edi rol ebx, 5 lea edx, DWORD PTR 1859775393[ebp*1+edx] add edx, ebx ; 20_39 27 mov ebp, edi mov ebx, DWORD PTR 44[esp] ror edi, 2 xor ebx, DWORD PTR 52[esp] xor ebp, esi xor ebx, DWORD PTR 12[esp] xor ebp, eax xor ebx, DWORD PTR 32[esp] rol ebx, 1 add ebp, ecx mov DWORD PTR 44[esp],ebx mov ecx, edx rol ecx, 5 lea ebx, DWORD PTR 1859775393[ebp*1+ebx] add ebx, ecx ; 20_39 28 mov ebp, edx mov ecx, DWORD PTR 48[esp] ror edx, 2 xor ecx, DWORD PTR 56[esp] xor ebp, edi xor ecx, DWORD PTR 16[esp] xor ebp, esi xor ecx, DWORD PTR 36[esp] rol ecx, 1 add ebp, eax mov DWORD PTR 48[esp],ecx mov eax, ebx rol eax, 5 lea ecx, DWORD PTR 1859775393[ebp*1+ecx] add ecx, eax ; 20_39 29 mov ebp, ebx mov eax, DWORD PTR 52[esp] ror ebx, 2 xor eax, DWORD PTR 60[esp] xor ebp, edx xor eax, DWORD PTR 20[esp] xor ebp, edi xor eax, DWORD PTR 40[esp] rol eax, 1 add ebp, esi mov DWORD PTR 52[esp],eax mov esi, ecx rol esi, 5 lea eax, DWORD PTR 1859775393[ebp*1+eax] add eax, esi ; 20_39 30 mov ebp, ecx mov esi, DWORD PTR 56[esp] ror ecx, 2 xor esi, DWORD PTR [esp] xor ebp, ebx xor esi, DWORD PTR 24[esp] xor ebp, edx xor esi, DWORD PTR 44[esp] rol esi, 1 add ebp, edi mov DWORD PTR 56[esp],esi mov edi, eax rol edi, 5 lea esi, DWORD PTR 1859775393[ebp*1+esi] add esi, edi ; 20_39 31 mov ebp, eax mov edi, DWORD PTR 60[esp] ror eax, 2 xor edi, DWORD PTR 4[esp] xor ebp, ecx xor edi, DWORD PTR 28[esp] xor ebp, ebx xor edi, DWORD PTR 48[esp] rol edi, 1 add ebp, edx mov DWORD PTR 60[esp],edi mov edx, esi rol edx, 5 lea edi, DWORD PTR 1859775393[ebp*1+edi] add edi, edx ; 20_39 32 mov ebp, esi mov edx, DWORD PTR [esp] ror esi, 2 xor edx, DWORD PTR 8[esp] xor ebp, eax xor edx, DWORD PTR 32[esp] xor ebp, ecx xor edx, DWORD PTR 52[esp] rol edx, 1 add ebp, ebx mov DWORD PTR [esp],edx mov ebx, edi rol ebx, 5 lea edx, DWORD PTR 1859775393[ebp*1+edx] add edx, ebx ; 20_39 33 mov ebp, edi mov ebx, DWORD PTR 4[esp] ror edi, 2 xor ebx, DWORD PTR 12[esp] xor ebp, esi xor ebx, DWORD PTR 36[esp] xor ebp, eax xor ebx, DWORD PTR 56[esp] rol ebx, 1 add ebp, ecx mov DWORD PTR 4[esp],ebx mov ecx, edx rol ecx, 5 lea ebx, DWORD PTR 1859775393[ebp*1+ebx] add ebx, ecx ; 20_39 34 mov ebp, edx mov ecx, DWORD PTR 8[esp] ror edx, 2 xor ecx, DWORD PTR 16[esp] xor ebp, edi xor ecx, DWORD PTR 40[esp] xor ebp, esi xor ecx, DWORD PTR 60[esp] rol ecx, 1 add ebp, eax mov DWORD PTR 8[esp],ecx mov eax, ebx rol eax, 5 lea ecx, DWORD PTR 1859775393[ebp*1+ecx] add ecx, eax ; 20_39 35 mov ebp, ebx mov eax, DWORD PTR 12[esp] ror ebx, 2 xor eax, DWORD PTR 20[esp] xor ebp, edx xor eax, DWORD PTR 44[esp] xor ebp, edi xor eax, DWORD PTR [esp] rol eax, 1 add ebp, esi mov DWORD PTR 12[esp],eax mov esi, ecx rol esi, 5 lea eax, DWORD PTR 1859775393[ebp*1+eax] add eax, esi ; 20_39 36 mov ebp, ecx mov esi, DWORD PTR 16[esp] ror ecx, 2 xor esi, DWORD PTR 24[esp] xor ebp, ebx xor esi, DWORD PTR 48[esp] xor ebp, edx xor esi, DWORD PTR 4[esp] rol esi, 1 add ebp, edi mov DWORD PTR 16[esp],esi mov edi, eax rol edi, 5 lea esi, DWORD PTR 1859775393[ebp*1+esi] add esi, edi ; 20_39 37 mov ebp, eax mov edi, DWORD PTR 20[esp] ror eax, 2 xor edi, DWORD PTR 28[esp] xor ebp, ecx xor edi, DWORD PTR 52[esp] xor ebp, ebx xor edi, DWORD PTR 8[esp] rol edi, 1 add ebp, edx mov DWORD PTR 20[esp],edi mov edx, esi rol edx, 5 lea edi, DWORD PTR 1859775393[ebp*1+edi] add edi, edx ; 20_39 38 mov ebp, esi mov edx, DWORD PTR 24[esp] ror esi, 2 xor edx, DWORD PTR 32[esp] xor ebp, eax xor edx, DWORD PTR 56[esp] xor ebp, ecx xor edx, DWORD PTR 12[esp] rol edx, 1 add ebp, ebx mov DWORD PTR 24[esp],edx mov ebx, edi rol ebx, 5 lea edx, DWORD PTR 1859775393[ebp*1+edx] add edx, ebx ; 20_39 39 mov ebp, edi mov ebx, DWORD PTR 28[esp] ror edi, 2 xor ebx, DWORD PTR 36[esp] xor ebp, esi xor ebx, DWORD PTR 60[esp] xor ebp, eax xor ebx, DWORD PTR 16[esp] rol ebx, 1 add ebp, ecx mov DWORD PTR 28[esp],ebx mov ecx, edx rol ecx, 5 lea ebx, DWORD PTR 1859775393[ebp*1+ebx] add ebx, ecx ; 40_59 40 mov ecx, DWORD PTR 32[esp] mov ebp, DWORD PTR 40[esp] xor ecx, ebp mov ebp, DWORD PTR [esp] xor ecx, ebp mov ebp, DWORD PTR 20[esp] xor ecx, ebp mov ebp, edx rol ecx, 1 or ebp, edi mov DWORD PTR 32[esp],ecx and ebp, esi lea ecx, DWORD PTR 2400959708[eax*1+ecx] mov eax, edx ror edx, 2 and eax, edi or ebp, eax mov eax, ebx rol eax, 5 add ecx, ebp add ecx, eax ; 40_59 41 mov eax, DWORD PTR 36[esp] mov ebp, DWORD PTR 44[esp] xor eax, ebp mov ebp, DWORD PTR 4[esp] xor eax, ebp mov ebp, DWORD PTR 24[esp] xor eax, ebp mov ebp, ebx rol eax, 1 or ebp, edx mov DWORD PTR 36[esp],eax and ebp, edi lea eax, DWORD PTR 2400959708[esi*1+eax] mov esi, ebx ror ebx, 2 and esi, edx or ebp, esi mov esi, ecx rol esi, 5 add eax, ebp add eax, esi ; 40_59 42 mov esi, DWORD PTR 40[esp] mov ebp, DWORD PTR 48[esp] xor esi, ebp mov ebp, DWORD PTR 8[esp] xor esi, ebp mov ebp, DWORD PTR 28[esp] xor esi, ebp mov ebp, ecx rol esi, 1 or ebp, ebx mov DWORD PTR 40[esp],esi and ebp, edx lea esi, DWORD PTR 2400959708[edi*1+esi] mov edi, ecx ror ecx, 2 and edi, ebx or ebp, edi mov edi, eax rol edi, 5 add esi, ebp add esi, edi ; 40_59 43 mov edi, DWORD PTR 44[esp] mov ebp, DWORD PTR 52[esp] xor edi, ebp mov ebp, DWORD PTR 12[esp] xor edi, ebp mov ebp, DWORD PTR 32[esp] xor edi, ebp mov ebp, eax rol edi, 1 or ebp, ecx mov DWORD PTR 44[esp],edi and ebp, ebx lea edi, DWORD PTR 2400959708[edx*1+edi] mov edx, eax ror eax, 2 and edx, ecx or ebp, edx mov edx, esi rol edx, 5 add edi, ebp add edi, edx ; 40_59 44 mov edx, DWORD PTR 48[esp] mov ebp, DWORD PTR 56[esp] xor edx, ebp mov ebp, DWORD PTR 16[esp] xor edx, ebp mov ebp, DWORD PTR 36[esp] xor edx, ebp mov ebp, esi rol edx, 1 or ebp, eax mov DWORD PTR 48[esp],edx and ebp, ecx lea edx, DWORD PTR 2400959708[ebx*1+edx] mov ebx, esi ror esi, 2 and ebx, eax or ebp, ebx mov ebx, edi rol ebx, 5 add edx, ebp add edx, ebx ; 40_59 45 mov ebx, DWORD PTR 52[esp] mov ebp, DWORD PTR 60[esp] xor ebx, ebp mov ebp, DWORD PTR 20[esp] xor ebx, ebp mov ebp, DWORD PTR 40[esp] xor ebx, ebp mov ebp, edi rol ebx, 1 or ebp, esi mov DWORD PTR 52[esp],ebx and ebp, eax lea ebx, DWORD PTR 2400959708[ecx*1+ebx] mov ecx, edi ror edi, 2 and ecx, esi or ebp, ecx mov ecx, edx rol ecx, 5 add ebx, ebp add ebx, ecx ; 40_59 46 mov ecx, DWORD PTR 56[esp] mov ebp, DWORD PTR [esp] xor ecx, ebp mov ebp, DWORD PTR 24[esp] xor ecx, ebp mov ebp, DWORD PTR 44[esp] xor ecx, ebp mov ebp, edx rol ecx, 1 or ebp, edi mov DWORD PTR 56[esp],ecx and ebp, esi lea ecx, DWORD PTR 2400959708[eax*1+ecx] mov eax, edx ror edx, 2 and eax, edi or ebp, eax mov eax, ebx rol eax, 5 add ecx, ebp add ecx, eax ; 40_59 47 mov eax, DWORD PTR 60[esp] mov ebp, DWORD PTR 4[esp] xor eax, ebp mov ebp, DWORD PTR 28[esp] xor eax, ebp mov ebp, DWORD PTR 48[esp] xor eax, ebp mov ebp, ebx rol eax, 1 or ebp, edx mov DWORD PTR 60[esp],eax and ebp, edi lea eax, DWORD PTR 2400959708[esi*1+eax] mov esi, ebx ror ebx, 2 and esi, edx or ebp, esi mov esi, ecx rol esi, 5 add eax, ebp add eax, esi ; 40_59 48 mov esi, DWORD PTR [esp] mov ebp, DWORD PTR 8[esp] xor esi, ebp mov ebp, DWORD PTR 32[esp] xor esi, ebp mov ebp, DWORD PTR 52[esp] xor esi, ebp mov ebp, ecx rol esi, 1 or ebp, ebx mov DWORD PTR [esp],esi and ebp, edx lea esi, DWORD PTR 2400959708[edi*1+esi] mov edi, ecx ror ecx, 2 and edi, ebx or ebp, edi mov edi, eax rol edi, 5 add esi, ebp add esi, edi ; 40_59 49 mov edi, DWORD PTR 4[esp] mov ebp, DWORD PTR 12[esp] xor edi, ebp mov ebp, DWORD PTR 36[esp] xor edi, ebp mov ebp, DWORD PTR 56[esp] xor edi, ebp mov ebp, eax rol edi, 1 or ebp, ecx mov DWORD PTR 4[esp],edi and ebp, ebx lea edi, DWORD PTR 2400959708[edx*1+edi] mov edx, eax ror eax, 2 and edx, ecx or ebp, edx mov edx, esi rol edx, 5 add edi, ebp add edi, edx ; 40_59 50 mov edx, DWORD PTR 8[esp] mov ebp, DWORD PTR 16[esp] xor edx, ebp mov ebp, DWORD PTR 40[esp] xor edx, ebp mov ebp, DWORD PTR 60[esp] xor edx, ebp mov ebp, esi rol edx, 1 or ebp, eax mov DWORD PTR 8[esp],edx and ebp, ecx lea edx, DWORD PTR 2400959708[ebx*1+edx] mov ebx, esi ror esi, 2 and ebx, eax or ebp, ebx mov ebx, edi rol ebx, 5 add edx, ebp add edx, ebx ; 40_59 51 mov ebx, DWORD PTR 12[esp] mov ebp, DWORD PTR 20[esp] xor ebx, ebp mov ebp, DWORD PTR 44[esp] xor ebx, ebp mov ebp, DWORD PTR [esp] xor ebx, ebp mov ebp, edi rol ebx, 1 or ebp, esi mov DWORD PTR 12[esp],ebx and ebp, eax lea ebx, DWORD PTR 2400959708[ecx*1+ebx] mov ecx, edi ror edi, 2 and ecx, esi or ebp, ecx mov ecx, edx rol ecx, 5 add ebx, ebp add ebx, ecx ; 40_59 52 mov ecx, DWORD PTR 16[esp] mov ebp, DWORD PTR 24[esp] xor ecx, ebp mov ebp, DWORD PTR 48[esp] xor ecx, ebp mov ebp, DWORD PTR 4[esp] xor ecx, ebp mov ebp, edx rol ecx, 1 or ebp, edi mov DWORD PTR 16[esp],ecx and ebp, esi lea ecx, DWORD PTR 2400959708[eax*1+ecx] mov eax, edx ror edx, 2 and eax, edi or ebp, eax mov eax, ebx rol eax, 5 add ecx, ebp add ecx, eax ; 40_59 53 mov eax, DWORD PTR 20[esp] mov ebp, DWORD PTR 28[esp] xor eax, ebp mov ebp, DWORD PTR 52[esp] xor eax, ebp mov ebp, DWORD PTR 8[esp] xor eax, ebp mov ebp, ebx rol eax, 1 or ebp, edx mov DWORD PTR 20[esp],eax and ebp, edi lea eax, DWORD PTR 2400959708[esi*1+eax] mov esi, ebx ror ebx, 2 and esi, edx or ebp, esi mov esi, ecx rol esi, 5 add eax, ebp add eax, esi ; 40_59 54 mov esi, DWORD PTR 24[esp] mov ebp, DWORD PTR 32[esp] xor esi, ebp mov ebp, DWORD PTR 56[esp] xor esi, ebp mov ebp, DWORD PTR 12[esp] xor esi, ebp mov ebp, ecx rol esi, 1 or ebp, ebx mov DWORD PTR 24[esp],esi and ebp, edx lea esi, DWORD PTR 2400959708[edi*1+esi] mov edi, ecx ror ecx, 2 and edi, ebx or ebp, edi mov edi, eax rol edi, 5 add esi, ebp add esi, edi ; 40_59 55 mov edi, DWORD PTR 28[esp] mov ebp, DWORD PTR 36[esp] xor edi, ebp mov ebp, DWORD PTR 60[esp] xor edi, ebp mov ebp, DWORD PTR 16[esp] xor edi, ebp mov ebp, eax rol edi, 1 or ebp, ecx mov DWORD PTR 28[esp],edi and ebp, ebx lea edi, DWORD PTR 2400959708[edx*1+edi] mov edx, eax ror eax, 2 and edx, ecx or ebp, edx mov edx, esi rol edx, 5 add edi, ebp add edi, edx ; 40_59 56 mov edx, DWORD PTR 32[esp] mov ebp, DWORD PTR 40[esp] xor edx, ebp mov ebp, DWORD PTR [esp] xor edx, ebp mov ebp, DWORD PTR 20[esp] xor edx, ebp mov ebp, esi rol edx, 1 or ebp, eax mov DWORD PTR 32[esp],edx and ebp, ecx lea edx, DWORD PTR 2400959708[ebx*1+edx] mov ebx, esi ror esi, 2 and ebx, eax or ebp, ebx mov ebx, edi rol ebx, 5 add edx, ebp add edx, ebx ; 40_59 57 mov ebx, DWORD PTR 36[esp] mov ebp, DWORD PTR 44[esp] xor ebx, ebp mov ebp, DWORD PTR 4[esp] xor ebx, ebp mov ebp, DWORD PTR 24[esp] xor ebx, ebp mov ebp, edi rol ebx, 1 or ebp, esi mov DWORD PTR 36[esp],ebx and ebp, eax lea ebx, DWORD PTR 2400959708[ecx*1+ebx] mov ecx, edi ror edi, 2 and ecx, esi or ebp, ecx mov ecx, edx rol ecx, 5 add ebx, ebp add ebx, ecx ; 40_59 58 mov ecx, DWORD PTR 40[esp] mov ebp, DWORD PTR 48[esp] xor ecx, ebp mov ebp, DWORD PTR 8[esp] xor ecx, ebp mov ebp, DWORD PTR 28[esp] xor ecx, ebp mov ebp, edx rol ecx, 1 or ebp, edi mov DWORD PTR 40[esp],ecx and ebp, esi lea ecx, DWORD PTR 2400959708[eax*1+ecx] mov eax, edx ror edx, 2 and eax, edi or ebp, eax mov eax, ebx rol eax, 5 add ecx, ebp add ecx, eax ; 40_59 59 mov eax, DWORD PTR 44[esp] mov ebp, DWORD PTR 52[esp] xor eax, ebp mov ebp, DWORD PTR 12[esp] xor eax, ebp mov ebp, DWORD PTR 32[esp] xor eax, ebp mov ebp, ebx rol eax, 1 or ebp, edx mov DWORD PTR 44[esp],eax and ebp, edi lea eax, DWORD PTR 2400959708[esi*1+eax] mov esi, ebx ror ebx, 2 and esi, edx or ebp, esi mov esi, ecx rol esi, 5 add eax, ebp add eax, esi ; 20_39 60 mov ebp, ecx mov esi, DWORD PTR 48[esp] ror ecx, 2 xor esi, DWORD PTR 56[esp] xor ebp, ebx xor esi, DWORD PTR 16[esp] xor ebp, edx xor esi, DWORD PTR 36[esp] rol esi, 1 add ebp, edi mov DWORD PTR 48[esp],esi mov edi, eax rol edi, 5 lea esi, DWORD PTR 3395469782[ebp*1+esi] add esi, edi ; 20_39 61 mov ebp, eax mov edi, DWORD PTR 52[esp] ror eax, 2 xor edi, DWORD PTR 60[esp] xor ebp, ecx xor edi, DWORD PTR 20[esp] xor ebp, ebx xor edi, DWORD PTR 40[esp] rol edi, 1 add ebp, edx mov DWORD PTR 52[esp],edi mov edx, esi rol edx, 5 lea edi, DWORD PTR 3395469782[ebp*1+edi] add edi, edx ; 20_39 62 mov ebp, esi mov edx, DWORD PTR 56[esp] ror esi, 2 xor edx, DWORD PTR [esp] xor ebp, eax xor edx, DWORD PTR 24[esp] xor ebp, ecx xor edx, DWORD PTR 44[esp] rol edx, 1 add ebp, ebx mov DWORD PTR 56[esp],edx mov ebx, edi rol ebx, 5 lea edx, DWORD PTR 3395469782[ebp*1+edx] add edx, ebx ; 20_39 63 mov ebp, edi mov ebx, DWORD PTR 60[esp] ror edi, 2 xor ebx, DWORD PTR 4[esp] xor ebp, esi xor ebx, DWORD PTR 28[esp] xor ebp, eax xor ebx, DWORD PTR 48[esp] rol ebx, 1 add ebp, ecx mov DWORD PTR 60[esp],ebx mov ecx, edx rol ecx, 5 lea ebx, DWORD PTR 3395469782[ebp*1+ebx] add ebx, ecx ; 20_39 64 mov ebp, edx mov ecx, DWORD PTR [esp] ror edx, 2 xor ecx, DWORD PTR 8[esp] xor ebp, edi xor ecx, DWORD PTR 32[esp] xor ebp, esi xor ecx, DWORD PTR 52[esp] rol ecx, 1 add ebp, eax mov DWORD PTR [esp],ecx mov eax, ebx rol eax, 5 lea ecx, DWORD PTR 3395469782[ebp*1+ecx] add ecx, eax ; 20_39 65 mov ebp, ebx mov eax, DWORD PTR 4[esp] ror ebx, 2 xor eax, DWORD PTR 12[esp] xor ebp, edx xor eax, DWORD PTR 36[esp] xor ebp, edi xor eax, DWORD PTR 56[esp] rol eax, 1 add ebp, esi mov DWORD PTR 4[esp],eax mov esi, ecx rol esi, 5 lea eax, DWORD PTR 3395469782[ebp*1+eax] add eax, esi ; 20_39 66 mov ebp, ecx mov esi, DWORD PTR 8[esp] ror ecx, 2 xor esi, DWORD PTR 16[esp] xor ebp, ebx xor esi, DWORD PTR 40[esp] xor ebp, edx xor esi, DWORD PTR 60[esp] rol esi, 1 add ebp, edi mov DWORD PTR 8[esp],esi mov edi, eax rol edi, 5 lea esi, DWORD PTR 3395469782[ebp*1+esi] add esi, edi ; 20_39 67 mov ebp, eax mov edi, DWORD PTR 12[esp] ror eax, 2 xor edi, DWORD PTR 20[esp] xor ebp, ecx xor edi, DWORD PTR 44[esp] xor ebp, ebx xor edi, DWORD PTR [esp] rol edi, 1 add ebp, edx mov DWORD PTR 12[esp],edi mov edx, esi rol edx, 5 lea edi, DWORD PTR 3395469782[ebp*1+edi] add edi, edx ; 20_39 68 mov ebp, esi mov edx, DWORD PTR 16[esp] ror esi, 2 xor edx, DWORD PTR 24[esp] xor ebp, eax xor edx, DWORD PTR 48[esp] xor ebp, ecx xor edx, DWORD PTR 4[esp] rol edx, 1 add ebp, ebx mov DWORD PTR 16[esp],edx mov ebx, edi rol ebx, 5 lea edx, DWORD PTR 3395469782[ebp*1+edx] add edx, ebx ; 20_39 69 mov ebp, edi mov ebx, DWORD PTR 20[esp] ror edi, 2 xor ebx, DWORD PTR 28[esp] xor ebp, esi xor ebx, DWORD PTR 52[esp] xor ebp, eax xor ebx, DWORD PTR 8[esp] rol ebx, 1 add ebp, ecx mov DWORD PTR 20[esp],ebx mov ecx, edx rol ecx, 5 lea ebx, DWORD PTR 3395469782[ebp*1+ebx] add ebx, ecx ; 20_39 70 mov ebp, edx mov ecx, DWORD PTR 24[esp] ror edx, 2 xor ecx, DWORD PTR 32[esp] xor ebp, edi xor ecx, DWORD PTR 56[esp] xor ebp, esi xor ecx, DWORD PTR 12[esp] rol ecx, 1 add ebp, eax mov DWORD PTR 24[esp],ecx mov eax, ebx rol eax, 5 lea ecx, DWORD PTR 3395469782[ebp*1+ecx] add ecx, eax ; 20_39 71 mov ebp, ebx mov eax, DWORD PTR 28[esp] ror ebx, 2 xor eax, DWORD PTR 36[esp] xor ebp, edx xor eax, DWORD PTR 60[esp] xor ebp, edi xor eax, DWORD PTR 16[esp] rol eax, 1 add ebp, esi mov DWORD PTR 28[esp],eax mov esi, ecx rol esi, 5 lea eax, DWORD PTR 3395469782[ebp*1+eax] add eax, esi ; 20_39 72 mov ebp, ecx mov esi, DWORD PTR 32[esp] ror ecx, 2 xor esi, DWORD PTR 40[esp] xor ebp, ebx xor esi, DWORD PTR [esp] xor ebp, edx xor esi, DWORD PTR 20[esp] rol esi, 1 add ebp, edi mov DWORD PTR 32[esp],esi mov edi, eax rol edi, 5 lea esi, DWORD PTR 3395469782[ebp*1+esi] add esi, edi ; 20_39 73 mov ebp, eax mov edi, DWORD PTR 36[esp] ror eax, 2 xor edi, DWORD PTR 44[esp] xor ebp, ecx xor edi, DWORD PTR 4[esp] xor ebp, ebx xor edi, DWORD PTR 24[esp] rol edi, 1 add ebp, edx mov DWORD PTR 36[esp],edi mov edx, esi rol edx, 5 lea edi, DWORD PTR 3395469782[ebp*1+edi] add edi, edx ; 20_39 74 mov ebp, esi mov edx, DWORD PTR 40[esp] ror esi, 2 xor edx, DWORD PTR 48[esp] xor ebp, eax xor edx, DWORD PTR 8[esp] xor ebp, ecx xor edx, DWORD PTR 28[esp] rol edx, 1 add ebp, ebx mov DWORD PTR 40[esp],edx mov ebx, edi rol ebx, 5 lea edx, DWORD PTR 3395469782[ebp*1+edx] add edx, ebx ; 20_39 75 mov ebp, edi mov ebx, DWORD PTR 44[esp] ror edi, 2 xor ebx, DWORD PTR 52[esp] xor ebp, esi xor ebx, DWORD PTR 12[esp] xor ebp, eax xor ebx, DWORD PTR 32[esp] rol ebx, 1 add ebp, ecx mov DWORD PTR 44[esp],ebx mov ecx, edx rol ecx, 5 lea ebx, DWORD PTR 3395469782[ebp*1+ebx] add ebx, ecx ; 20_39 76 mov ebp, edx mov ecx, DWORD PTR 48[esp] ror edx, 2 xor ecx, DWORD PTR 56[esp] xor ebp, edi xor ecx, DWORD PTR 16[esp] xor ebp, esi xor ecx, DWORD PTR 36[esp] rol ecx, 1 add ebp, eax mov DWORD PTR 48[esp],ecx mov eax, ebx rol eax, 5 lea ecx, DWORD PTR 3395469782[ebp*1+ecx] add ecx, eax ; 20_39 77 mov ebp, ebx mov eax, DWORD PTR 52[esp] ror ebx, 2 xor eax, DWORD PTR 60[esp] xor ebp, edx xor eax, DWORD PTR 20[esp] xor ebp, edi xor eax, DWORD PTR 40[esp] rol eax, 1 add ebp, esi mov DWORD PTR 52[esp],eax mov esi, ecx rol esi, 5 lea eax, DWORD PTR 3395469782[ebp*1+eax] add eax, esi ; 20_39 78 mov ebp, ecx mov esi, DWORD PTR 56[esp] ror ecx, 2 xor esi, DWORD PTR [esp] xor ebp, ebx xor esi, DWORD PTR 24[esp] xor ebp, edx xor esi, DWORD PTR 44[esp] rol esi, 1 add ebp, edi mov DWORD PTR 56[esp],esi mov edi, eax rol edi, 5 lea esi, DWORD PTR 3395469782[ebp*1+esi] add esi, edi ; 20_39 79 mov ebp, eax mov edi, DWORD PTR 60[esp] ror eax, 2 xor edi, DWORD PTR 4[esp] xor ebp, ecx xor edi, DWORD PTR 28[esp] xor ebp, ebx xor edi, DWORD PTR 48[esp] rol edi, 1 add ebp, edx mov DWORD PTR 60[esp],edi mov edx, esi rol edx, 5 lea edi, DWORD PTR 3395469782[ebp*1+edi] add edi, edx ; End processing ; mov ebp, DWORD PTR 128[esp] mov edx, DWORD PTR 12[ebp] add edx, ecx mov ecx, DWORD PTR 4[ebp] add ecx, esi mov esi, eax mov eax, DWORD PTR [ebp] mov DWORD PTR 12[ebp],edx add eax, edi mov edi, DWORD PTR 16[ebp] add edi, ebx mov ebx, DWORD PTR 8[ebp] add ebx, esi mov DWORD PTR [ebp],eax mov esi, DWORD PTR 132[esp] mov DWORD PTR 8[ebp],ebx add esi, 64 mov eax, DWORD PTR 68[esp] mov DWORD PTR 16[ebp],edi cmp esi, eax mov DWORD PTR 4[ebp],ecx jb $L000start add esp, 108 pop edi pop ebx pop ebp pop esi ret _sha1_block_asm_data_order ENDP _TEXT$ ENDS _TEXT$ SEGMENT PAGE 'CODE' PUBLIC _sha1_block_asm_host_order _sha1_block_asm_host_order PROC NEAR mov ecx, DWORD PTR 12[esp] push esi shl ecx, 6 mov esi, DWORD PTR 12[esp] push ebp add ecx, esi push ebx mov ebp, DWORD PTR 16[esp] push edi mov edx, DWORD PTR 12[ebp] sub esp, 108 mov edi, DWORD PTR 16[ebp] mov ebx, DWORD PTR 8[ebp] mov DWORD PTR 68[esp],ecx ; First we need to setup the X array mov eax, DWORD PTR [esi] mov ecx, DWORD PTR 4[esi] mov DWORD PTR [esp],eax mov DWORD PTR 4[esp],ecx mov eax, DWORD PTR 8[esi] mov ecx, DWORD PTR 12[esi] mov DWORD PTR 8[esp],eax mov DWORD PTR 12[esp],ecx mov eax, DWORD PTR 16[esi] mov ecx, DWORD PTR 20[esi] mov DWORD PTR 16[esp],eax mov DWORD PTR 20[esp],ecx mov eax, DWORD PTR 24[esi] mov ecx, DWORD PTR 28[esi] mov DWORD PTR 24[esp],eax mov DWORD PTR 28[esp],ecx mov eax, DWORD PTR 32[esi] mov ecx, DWORD PTR 36[esi] mov DWORD PTR 32[esp],eax mov DWORD PTR 36[esp],ecx mov eax, DWORD PTR 40[esi] mov ecx, DWORD PTR 44[esi] mov DWORD PTR 40[esp],eax mov DWORD PTR 44[esp],ecx mov eax, DWORD PTR 48[esi] mov ecx, DWORD PTR 52[esi] mov DWORD PTR 48[esp],eax mov DWORD PTR 52[esp],ecx mov eax, DWORD PTR 56[esi] mov ecx, DWORD PTR 60[esi] mov DWORD PTR 56[esp],eax mov DWORD PTR 60[esp],ecx jmp $L001shortcut _sha1_block_asm_host_order ENDP _TEXT$ ENDS END ",16373,True,5723.620541471332,median "/* GraphicsTest.ino Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/) Copyright (c) 2016, olikraus@gmail.com 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. 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. */ #include #include #ifdef U8X8_HAVE_HW_SPI #include #endif #ifdef U8X8_HAVE_HW_I2C #include #endif /* U8glib Example Overview: Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption Page Buffer Examples: firstPage/nextPage. Less RAM usage, should work with all Arduino boards. U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only. */ // Please UNCOMMENT one of the contructor lines below // U8g2 Contructor List (Frame Buffer) // The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp // Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected //U8G2_SSD1306_128X64_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 12, /* dc=*/ 4, /* reset=*/ 6); // Arduboy (Production, Kickstarter Edition) //U8G2_SSD1306_128X64_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_F_3W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_128X64_ALT0_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display //U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ 16, /* data=*/ 17, /* reset=*/ U8X8_PIN_NONE); // ESP32 Thing, pure SW emulated I2C //U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping //U8G2_SSD1306_128X64_NONAME_F_6800 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_F_8080 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8G2_SSD1306_128X64_VCOMH0_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8G2_SSD1306_128X64_ALT0_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8G2_SH1106_128X64_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SH1106_128X64_VCOMH0_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8G2_SH1106_128X64_WINSTAR_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but uses updated SH1106 init sequence //U8G2_SSD1306_128X32_UNIVISION_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ 21, /* data=*/ 20, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather M0 Basic Proto + FeatherWing OLED //U8G2_SSD1306_128X32_UNIVISION_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather ESP8266/32u4 Boards + FeatherWing OLED //U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // Adafruit ESP8266/32u4/ARM Boards + FeatherWing OLED //U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA); // pin remapping with ESP8266 HW I2C //U8G2_SSD1306_64X48_ER_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // EastRising 0.66"" OLED breakout board, Uno: A4=SDA, A5=SCL, 5V powered //U8G2_SSD1306_64X32_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_64X32_1F_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_96X16_ER_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // EastRising 0.69"" OLED //U8G2_SSD1322_NHD_256X64_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h //U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h //U8G2_SSD1325_NHD_128X64_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1325_NHD_128X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1326_ER_256X32_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // experimental driver for ER-OLED018-1 //U8G2_SSD1327_SEEED_96X96_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8G2_SSD1327_SEEED_96X96_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8G2_SSD1327_MIDAS_128X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1327_MIDAS_128X128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1329_128X96_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1329_128X96_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X32_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X32_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME0_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME0_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME2_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME2_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_LD7032_60X32_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* cs=*/ 9, /* dc=*/ 10, /* reset=*/ 8); // SW SPI Nano Board //U8G2_LD7032_60X32_F_4W_SW_I2C u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* reset=*/ U8X8_PIN_NONE); // NOT TESTED! //U8G2_UC1701_EA_DOGS102_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1701_EA_DOGS102_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_PCD8544_84X48_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8G2_PCD8544_84X48_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8G2_PCF8812_96X65_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8G2_PCF8812_96X65_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8G2_KS0108_128X64_F u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ U8X8_PIN_NONE, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8G2_KS0108_ERM19264_F u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ 16, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8G2_ST7920_192X32_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ U8X8_PIN_NONE, /*dc=*/ 17, /*reset=*/ U8X8_PIN_NONE); //U8G2_ST7920_192X32_F_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18 /* A4 */ , /* data=*/ 16 /* A2 */, /* CS=*/ 17 /* A3 */, /* reset=*/ U8X8_PIN_NONE); //U8G2_ST7920_128X64_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18 /* A4 */, /*cs=*/ U8X8_PIN_NONE, /*dc/rs=*/ 17 /* A3 */, /*reset=*/ 15 /* A1 */); // Remember to set R/W to 0 //U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18 /* A4 */ , /* data=*/ 16 /* A2 */, /* CS=*/ 17 /* A3 */, /* reset=*/ U8X8_PIN_NONE); //U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* CS=*/ 10, /* reset=*/ 8); //U8G2_ST7920_128X64_F_HW_SPI u8g2(U8G2_R0, /* CS=*/ 10, /* reset=*/ 8); //U8G2_ST7565_EA_DOGM128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_EA_DOGM128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_64128N_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_64128N_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_EA_DOGM132_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8G2_ST7565_EA_DOGM132_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8G2_ST7565_ZOLEN_128X64_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_ZOLEN_128X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_LM6059_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8G2_ST7565_LM6059_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8G2_ST7565_ERC12864_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_ERC12864_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12832_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12832_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12864_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12864_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_PI_132X64_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8G2_ST7567_PI_132X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8G2_ST7567_JLX12864_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_JLX12864_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX172104_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX172104_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX256128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX25664_F_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, enable U8g2 16 bit mode for this display //U8G2_NT7534_TG12864R_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_NT7534_TG12864R_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7588_JLX12864_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ 5); //U8G2_ST7588_JLX12864_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ 5); //U8G2_IST3020_ERC19264_F_6800 u8g2(U8G2_R0, 44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 28, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect WR pin with GND //U8G2_IST3020_ERC19264_F_8080 u8g2(U8G2_R0, 44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 29, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect RD pin with 3.3V //U8G2_IST3020_ERC19264_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_LC7981_160X80_F_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_LC7981_160X160_F_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_LC7981_240X128_F_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_SED1520_122X32_F u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*dc=*/ A0, /*e1=*/ A3, /*e2=*/ A2, /* reset=*/ A4); // Set R/W to low! //U8G2_T6963_240X128_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_T6963_256X64_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_SED1330_240X128_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FG with GND //U8G2_SED1330_240X128_F_6800 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); // A0 is dc pin! //U8G2_RA8835_NHD_240X128_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect /RD = E with +5V, enable is /WR = RW, FG with GND, 14=Uno Pin A0 //U8G2_RA8835_NHD_240X128_F_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // A0 is dc pin, /WR = RW = GND, enable is /RD = E //U8G2_UC1604_JLX19264_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1604_JLX19264_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1608_ERC24064_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due ERC24064-1 Test Setup //U8G2_UC1608_ERC240120_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1608_240X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due ERC24064-1 Test Setup //U8G2_UC1610_EA_DOGXL160_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8G2_UC1610_EA_DOGXL160_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8G2_UC1611_EA_DOGM240_F_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, DOGM240 Test Board //U8G2_UC1611_EA_DOGM240_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Due, SW SPI, DOGXL240 Test Board //U8G2_UC1611_EA_DOGXL240_F_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, DOGXL240 Test Board //U8G2_UC1611_EA_DOGXL240_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Due, SW SPI, DOGXL240 Test Board //U8G2_UC1611_EW50850_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 3, /*dc=*/ 16, /*reset=*/ 16); // 240x160, Connect RD/WR1 pin with 3.3V, CS is aktive high //U8G2_UC1638_160X128_F_4W_HW_SPI u8g2(U8G2_R2, /* cs=*/ 2, /* dc=*/ 3, /* reset=*/ 4); // Not tested //U8G2_SSD1606_172X72_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display //U8G2_SSD1607_200X200_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display, original LUT from embedded artists //U8G2_IL3820_296X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // WaveShare 2.9 inch eInk/ePaper Display, enable 16 bit mode for this display! //U8G2_IL3820_V2_296X128_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // ePaper Display, lesser flickering and faster speed, enable 16 bit mode for this display! // End of constructor list void u8g2_prepare(void) { u8g2.setFont(u8g2_font_6x10_tf); u8g2.setFontRefHeightExtendedText(); u8g2.setDrawColor(1); u8g2.setFontPosTop(); u8g2.setFontDirection(0); } void u8g2_box_frame(uint8_t a) { u8g2.drawStr( 0, 0, ""drawBox""); u8g2.drawBox(5,10,20,10); u8g2.drawBox(10+a,15,30,7); u8g2.drawStr( 0, 30, ""drawFrame""); u8g2.drawFrame(5,10+30,20,10); u8g2.drawFrame(10+a,15+30,30,7); } void u8g2_disc_circle(uint8_t a) { u8g2.drawStr( 0, 0, ""drawDisc""); u8g2.drawDisc(10,18,9); u8g2.drawDisc(24+a,16,7); u8g2.drawStr( 0, 30, ""drawCircle""); u8g2.drawCircle(10,18+30,9); u8g2.drawCircle(24+a,16+30,7); } void u8g2_r_frame(uint8_t a) { u8g2.drawStr( 0, 0, ""drawRFrame/Box""); u8g2.drawRFrame(5, 10,40,30, a+1); u8g2.drawRBox(50, 10,25,40, a+1); } void u8g2_string(uint8_t a) { u8g2.setFontDirection(0); u8g2.drawStr(30+a,31, "" 0""); u8g2.setFontDirection(1); u8g2.drawStr(30,31+a, "" 90""); u8g2.setFontDirection(2); u8g2.drawStr(30-a,31, "" 180""); u8g2.setFontDirection(3); u8g2.drawStr(30,31-a, "" 270""); } void u8g2_line(uint8_t a) { u8g2.drawStr( 0, 0, ""drawLine""); u8g2.drawLine(7+a, 10, 40, 55); u8g2.drawLine(7+a*2, 10, 60, 55); u8g2.drawLine(7+a*3, 10, 80, 55); u8g2.drawLine(7+a*4, 10, 100, 55); } void u8g2_triangle(uint8_t a) { uint16_t offset = a; u8g2.drawStr( 0, 0, ""drawTriangle""); u8g2.drawTriangle(14,7, 45,30, 10,40); u8g2.drawTriangle(14+offset,7-offset, 45+offset,30-offset, 57+offset,10-offset); u8g2.drawTriangle(57+offset*2,10, 45+offset*2,30, 86+offset*2,53); u8g2.drawTriangle(10+offset,40+offset, 45+offset,30+offset, 86+offset,53+offset); } void u8g2_ascii_1() { char s[2] = "" ""; uint8_t x, y; u8g2.drawStr( 0, 0, ""ASCII page 1""); for( y = 0; y < 6; y++ ) { for( x = 0; x < 16; x++ ) { s[0] = y*16 + x + 32; u8g2.drawStr(x*7, y*10+10, s); } } } void u8g2_ascii_2() { char s[2] = "" ""; uint8_t x, y; u8g2.drawStr( 0, 0, ""ASCII page 2""); for( y = 0; y < 6; y++ ) { for( x = 0; x < 16; x++ ) { s[0] = y*16 + x + 160; u8g2.drawStr(x*7, y*10+10, s); } } } void u8g2_extra_page(uint8_t a) { u8g2.drawStr( 0, 0, ""Unicode""); u8g2.setFont(u8g2_font_unifont_t_symbols); u8g2.setFontPosTop(); u8g2.drawUTF8(0, 24, ""☀ ☁""); switch(a) { case 0: case 1: case 2: case 3: u8g2.drawUTF8(a*3, 36, ""☂""); break; case 4: case 5: case 6: case 7: u8g2.drawUTF8(a*3, 36, ""☔""); break; } } #define cross_width 24 #define cross_height 24 static const unsigned char cross_bits[] U8X8_PROGMEM = { 0x00, 0x18, 0x00, 0x00, 0x24, 0x00, 0x00, 0x24, 0x00, 0x00, 0x42, 0x00, 0x00, 0x42, 0x00, 0x00, 0x42, 0x00, 0x00, 0x81, 0x00, 0x00, 0x81, 0x00, 0xC0, 0x00, 0x03, 0x38, 0x3C, 0x1C, 0x06, 0x42, 0x60, 0x01, 0x42, 0x80, 0x01, 0x42, 0x80, 0x06, 0x42, 0x60, 0x38, 0x3C, 0x1C, 0xC0, 0x00, 0x03, 0x00, 0x81, 0x00, 0x00, 0x81, 0x00, 0x00, 0x42, 0x00, 0x00, 0x42, 0x00, 0x00, 0x42, 0x00, 0x00, 0x24, 0x00, 0x00, 0x24, 0x00, 0x00, 0x18, 0x00, }; #define cross_fill_width 24 #define cross_fill_height 24 static const unsigned char cross_fill_bits[] U8X8_PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x64, 0x00, 0x26, 0x84, 0x00, 0x21, 0x08, 0x81, 0x10, 0x08, 0x42, 0x10, 0x10, 0x3C, 0x08, 0x20, 0x00, 0x04, 0x40, 0x00, 0x02, 0x80, 0x00, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0x80, 0x00, 0x01, 0x40, 0x00, 0x02, 0x20, 0x00, 0x04, 0x10, 0x3C, 0x08, 0x08, 0x42, 0x10, 0x08, 0x81, 0x10, 0x84, 0x00, 0x21, 0x64, 0x00, 0x26, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #define cross_block_width 14 #define cross_block_height 14 static const unsigned char cross_block_bits[] U8X8_PROGMEM = { 0xFF, 0x3F, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0xC1, 0x20, 0xC1, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0xFF, 0x3F, }; void u8g2_bitmap_overlay(uint8_t a) { uint8_t frame_size = 28; u8g2.drawStr(0, 0, ""Bitmap overlay""); u8g2.drawStr(0, frame_size + 12, ""Solid / transparent""); u8g2.setBitmapMode(false /* solid */); u8g2.drawFrame(0, 10, frame_size, frame_size); u8g2.drawXBMP(2, 12, cross_width, cross_height, cross_bits); if(a & 4) u8g2.drawXBMP(7, 17, cross_block_width, cross_block_height, cross_block_bits); u8g2.setBitmapMode(true /* transparent*/); u8g2.drawFrame(frame_size + 5, 10, frame_size, frame_size); u8g2.drawXBMP(frame_size + 7, 12, cross_width, cross_height, cross_bits); if(a & 4) u8g2.drawXBMP(frame_size + 12, 17, cross_block_width, cross_block_height, cross_block_bits); } void u8g2_bitmap_modes(uint8_t transparent) { const uint8_t frame_size = 24; u8g2.drawBox(0, frame_size * 0.5, frame_size * 5, frame_size); u8g2.drawStr(frame_size * 0.5, 50, ""Black""); u8g2.drawStr(frame_size * 2, 50, ""White""); u8g2.drawStr(frame_size * 3.5, 50, ""XOR""); if(!transparent) { u8g2.setBitmapMode(false /* solid */); u8g2.drawStr(0, 0, ""Solid bitmap""); } else { u8g2.setBitmapMode(true /* transparent*/); u8g2.drawStr(0, 0, ""Transparent bitmap""); } u8g2.setDrawColor(0);// Black u8g2.drawXBMP(frame_size * 0.5, 24, cross_width, cross_height, cross_bits); u8g2.setDrawColor(1); // White u8g2.drawXBMP(frame_size * 2, 24, cross_width, cross_height, cross_bits); u8g2.setDrawColor(2); // XOR u8g2.drawXBMP(frame_size * 3.5, 24, cross_width, cross_height, cross_bits); } uint8_t draw_state = 0; void draw(void) { u8g2_prepare(); switch(draw_state >> 3) { case 0: u8g2_box_frame(draw_state&7); break; case 1: u8g2_disc_circle(draw_state&7); break; case 2: u8g2_r_frame(draw_state&7); break; case 3: u8g2_string(draw_state&7); break; case 4: u8g2_line(draw_state&7); break; case 5: u8g2_triangle(draw_state&7); break; case 6: u8g2_ascii_1(); break; case 7: u8g2_ascii_2(); break; case 8: u8g2_extra_page(draw_state&7); break; case 9: u8g2_bitmap_modes(0); break; case 10: u8g2_bitmap_modes(1); break; case 11: u8g2_bitmap_overlay(draw_state&7); break; } } void setup(void) { u8g2.begin(); } void loop(void) { // picture loop u8g2.clearBuffer(); draw(); u8g2.sendBuffer(); // increase the state draw_state++; if ( draw_state >= 12*8 ) draw_state = 0; // deley between each page delay(100); } ",12457,True,2569.004656219761,median "/* Chinese.ino Use the (Arduino compatible) u8g2 function ""print"" to draw a text. Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/) Copyright (c) 2016, olikraus@gmail.com 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. 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. */ #include #include #ifdef U8X8_HAVE_HW_SPI #include #endif #ifdef U8X8_HAVE_HW_I2C #include #endif /* U8glib Example Overview: Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption Page Buffer Examples: firstPage/nextPage. Less RAM usage, should work with all Arduino boards. U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only. This is a page buffer example. */ // Please UNCOMMENT one of the contructor lines below // U8g2 Contructor List (Picture Loop Page Buffer) // The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp // Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected //U8G2_NULL u8g2(U8G2_R0); // null device, a 8x8 pixel display which does nothing //U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 12, /* dc=*/ 4, /* reset=*/ 6); // Arduboy (Production, Kickstarter Edition) //U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_3W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_128X64_ALT0_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display //U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 16, /* data=*/ 17, /* reset=*/ U8X8_PIN_NONE); // ESP32 Thing, pure SW emulated I2C //U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping //U8G2_SSD1306_128X64_NONAME_1_6800 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_8080 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8G2_SSD1306_128X64_VCOMH0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8G2_SSD1306_128X64_ALT0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8G2_SH1106_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1106_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SH1106_128X64_VCOMH0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8G2_SH1106_128X64_WINSTAR_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but uses updated SH1106 init sequence //U8G2_SH1106_72X40_WISE_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1107_64X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1107_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1107_128X128_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); //U8G2_SH1107_SEEED_96X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1108_160X160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SH1122_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h //U8G2_SSD1306_128X32_UNIVISION_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 21, /* data=*/ 20, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather M0 Basic Proto + FeatherWing OLED //U8G2_SSD1306_128X32_UNIVISION_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather ESP8266/32u4 Boards + FeatherWing OLED //U8G2_SSD1306_128X32_UNIVISION_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // Adafruit ESP8266/32u4/ARM Boards + FeatherWing OLED //U8G2_SSD1306_128X32_UNIVISION_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA); // pin remapping with ESP8266 HW I2C //U8G2_SSD1306_64X48_ER_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // EastRising 0.66"" OLED breakout board, Uno: A4=SDA, A5=SCL, 5V powered //U8G2_SSD1306_48X64_WINSTAR_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_64X32_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_64X32_1F_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1306_96X16_ER_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // EastRising 0.69"" OLED //U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h //U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h //U8G2_SSD1322_NHD_128X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1322_NHD_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1325_NHD_128X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1325_NHD_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1326_ER_256X32_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // experimental driver for ER-OLED018-1 //U8G2_SSD1327_SEEED_96X96_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8G2_SSD1327_SEEED_96X96_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8G2_SSD1327_EA_W128128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1327_EA_W128128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1327_EA_W128128_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 5, /* data=*/ 4, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1327_EA_W128128_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); //U8G2_SSD1327_MIDAS_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1327_MIDAS_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1329_128X96_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1329_128X96_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X32_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X32_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X64_ADAFRUIT_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1305_128X64_ADAFRUIT_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME0_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME0_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME2_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1309_128X64_NONAME2_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_LD7032_60X32_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* cs=*/ 9, /* dc=*/ 10, /* reset=*/ 8); // SW SPI Nano Board //U8G2_LD7032_60X32_1_4W_SW_I2C u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* reset=*/ U8X8_PIN_NONE); // NOT TESTED! //U8G2_UC1701_EA_DOGS102_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1701_EA_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_PCD8544_84X48_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8G2_PCD8544_84X48_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8G2_PCF8812_96X65_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8G2_PCF8812_96X65_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8G2_HX1230_96X68_1_3W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8G2_HX1230_96X68_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_KS0108_128X64_1 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ U8X8_PIN_NONE, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8G2_KS0108_ERM19264_1 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ 16, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8G2_ST7920_192X32_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ U8X8_PIN_NONE, /*dc=*/ 17, /*reset=*/ U8X8_PIN_NONE); //U8G2_ST7920_192X32_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18 /* A4 */ , /* data=*/ 16 /* A2 */, /* CS=*/ 17 /* A3 */, /* reset=*/ U8X8_PIN_NONE); //U8G2_ST7920_128X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18 /* A4 */, /*cs=*/ U8X8_PIN_NONE, /*dc/rs=*/ 17 /* A3 */, /*reset=*/ 15 /* A1 */); // Remember to set R/W to 0 //U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 18 /* A4 */ , /* data=*/ 16 /* A2 */, /* CS=*/ 17 /* A3 */, /* reset=*/ U8X8_PIN_NONE); //U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* CS=*/ 10, /* reset=*/ 8); //U8G2_ST7920_128X64_1_HW_SPI u8g2(U8G2_R0, /* CS=*/ 10, /* reset=*/ 8); //U8G2_ST7565_EA_DOGM128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_EA_DOGM128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_64128N_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_64128N_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_EA_DOGM132_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8G2_ST7565_EA_DOGM132_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8G2_ST7565_ZOLEN_128X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_ZOLEN_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_LM6059_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8G2_ST7565_LM6059_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8G2_ST7565_LX12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_LX12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_ERC12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_ERC12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12832_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12832_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_NHD_C12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_JLX12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7565_JLX12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_PI_132X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8G2_ST7567_PI_132X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8G2_ST7567_JLX12864_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_JLX12864_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_ENH_DG128064_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_ENH_DG128064_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_ENH_DG128064I_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7567_ENH_DG128064I_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX172104_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX172104_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX256128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 9, /* data=*/ 8, /* cs=*/ 7, /* dc=*/ 6, /* reset=*/ 5); // MKR Zero, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 7, /* dc=*/ 6, /* reset=*/ 5); // MKR Zero, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256160_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX256160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Uno, Enable U8g2 16 bit mode for this display //U8G2_ST75256_JLX240160_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX240160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST75256_JLX25664_1_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, enable U8g2 16 bit mode for this display //U8G2_NT7534_TG12864R_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_NT7534_TG12864R_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_ST7588_JLX12864_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ 5); //U8G2_ST7588_JLX12864_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ 5); //U8G2_IST3020_ERC19264_1_6800 u8g2(U8G2_R0, 44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 28, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect WR pin with GND //U8G2_IST3020_ERC19264_1_8080 u8g2(U8G2_R0, 44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 29, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect RD pin with 3.3V //U8G2_IST3020_ERC19264_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_LC7981_160X80_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_LC7981_160X160_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_LC7981_240X128_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_LC7981_240X64_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND //U8G2_SED1520_122X32_1 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*dc=*/ A0, /*e1=*/ A3, /*e2=*/ A2, /* reset=*/ A4); // Set R/W to low! //U8G2_T6963_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_T6963_256X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_T6963_160X80_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND //U8G2_SED1330_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect /RD = E with +5V, enable is /WR = RW, FG with GND, 14=Uno Pin A0 //U8G2_SED1330_240X128_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // A0 is dc pin, /WR = RW = GND, enable is /RD = E //U8G2_RA8835_NHD_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect /RD = E with +5V, enable is /WR = RW, FG with GND, 14=Uno Pin A0 //U8G2_RA8835_NHD_240X128_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // A0 is dc pin, /WR = RW = GND, enable is /RD = E //U8G2_UC1601_128X32_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1601_128X32_1_3W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8G2_UC1604_JLX19264_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1604_JLX19264_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1608_ERC24064_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due ERC24064-1 Test Setup //U8G2_UC1608_ERC240120_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1608_240X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due ERC24064-1 Test Setup //U8G2_UC1610_EA_DOGXL160_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8G2_UC1610_EA_DOGXL160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8G2_UC1611_EA_DOGM240_1_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, DOGM240 Test Board //U8G2_UC1611_EA_DOGM240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board //U8G2_UC1611_EA_DOGXL240_1_2ND_HW_I2C u8g2(U8G2_R0, /* reset=*/ 8); // Due, 2nd I2C, DOGXL240 Test Board //U8G2_UC1611_EA_DOGXL240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board //U8G2_UC1611_EW50850_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 3, /*dc=*/ 16, /*reset=*/ 16); // 240x160, Connect RD/WR1 pin with 3.3V, CS is aktive high //U8G2_UC1638_160X128_1_4W_HW_SPI u8g2(U8G2_R2, /* cs=*/ 2, /* dc=*/ 3, /* reset=*/ 4); // Not tested //U8G2_SSD1606_172X72_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display //U8G2_SSD1607_200X200_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display, original LUT from embedded artists //U8G2_SSD1607_GD_200X200_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Good Display //U8G2_IL3820_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // WaveShare 2.9 inch eInk/ePaper Display, enable 16 bit mode for this display! //U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // ePaper Display, lesser flickering and faster speed, enable 16 bit mode for this display! // End of constructor list void setup(void) { u8g2.begin(); u8g2.enableUTF8Print(); // enable UTF8 support for the Arduino print() function } void loop(void) { u8g2.setFont(u8g2_font_unifont_t_chinese2); // use chinese2 for all the glyphs of ""你好世界"" //u8g2.setFont(u8g2_font_b10_t_japanese1); // all the glyphs of ""こんにちは世界"" are already included in japanese1: Lerning Level 1-6 u8g2.setFontDirection(0); u8g2.firstPage(); do { u8g2.setCursor(0, 15); u8g2.print(""Hello World!""); u8g2.setCursor(0, 40); u8g2.print(""你好世界""); // Chinese ""Hello World"" //u8g2.print(""こんにちは世界""); // Japanese ""Hello World"" } while ( u8g2.nextPage() ); delay(1000); } ",12037,True,3675.262160769056,median "/* 16x16Font.ino Demonstration for 16x16 pixel fonts. Several fonts are included in the example. Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/) Copyright (c) 2016, olikraus@gmail.com 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. 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. */ #include #include #ifdef U8X8_HAVE_HW_SPI #include #endif // Please UNCOMMENT one of the contructor lines below // U8x8 Contructor List // The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8x8setupcpp // Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected //U8X8_NULL u8x8; // null device, a 8x8 pixel display which does nothing //U8X8_SSD1306_128X64_NONAME_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 6, /* dc=*/ 4, /* reset=*/ 12); // Arduboy (DevKit) //U8X8_SSD1306_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 12, /* dc=*/ 4, /* reset=*/ 6); // Arduboy 10 (Production, Kickstarter Edition) //U8X8_SSD1306_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_3W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_3W_HW_SPI u8x8(/* cs=*/ 10, /* reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ 2, /* data=*/ 0, /* reset=*/ U8X8_PIN_NONE); // Digispark ATTiny85 //U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // OLEDs without Reset of the Display //U8X8_SSD1306_128X64_VCOMH0_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8X8_SSD1306_128X64_ALT0_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but may solve the ""every 2nd line skipped"" problem //U8X8_SH1106_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1106_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SH1106_128X64_VCOMH0_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but maximizes setContrast() range //U8X8_SH1106_128X64_WINSTAR_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // same as the NONAME variant, but uses updated SH1106 init sequence //U8X8_SH1106_128X32_VISIONOX_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SH1106_128X32_VISIONOX_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1106_72X40_WISE_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1107_64X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1107_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1107_128X128_HW_I2C u8x8(/* reset=*/ 8); //U8X8_SH1107_PIMORONI_128X128_HW_I2C u8x8(/* reset=*/ 8); //U8X8_SH1107_SEEED_128X128_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); //U8X8_SH1107_SEEED_128X128_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SH1107_SEEED_96X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SH1108_160X160_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1306_128X32_UNIVISION_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather ESP8266/32u4 Boards + FeatherWing OLED //U8X8_SSD1306_128X32_UNIVISION_SW_I2C u8x8(/* clock=*/ 21, /* data=*/ 20, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather M0 Basic Proto + FeatherWing OLED //U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // Adafruit ESP8266/32u4/ARM Boards + FeatherWing OLED //U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA); // pin remapping with ESP8266 HW I2C //U8X8_SSD1306_128X32_WINSTAR_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA); // pin remapping with ESP8266 HW I2C //U8X8_SSD1306_64X48_ER_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // EastRising 0.66"" OLED breakout board, Uno: A4=SDA, A5=SCL, 5V powered //U8X8_SSD1306_48X64_WINSTAR_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SSD1306_64X32_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SSD1306_64X32_1F_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_SSD1306_96X16_ER_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // EastRising 0.69"" //U8X8_SSD1306_72X40_ER_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // EastRising 0.42"" //U8X8_SSD1306_128X64_NONAME_6800 u8x8(13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8X8_SSD1306_128X64_NONAME_8080 u8x8(13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8X8_SSD1309_128X64_NONAME0_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1309_128X64_NONAME0_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1309_128X64_NONAME2_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1309_128X64_NONAME2_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1316_128X32_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1316_128X32_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1317_96X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // not tested, not confirmed //U8X8_SSD1317_96X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // not tested, not confirmed //U8X8_SSD1318_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1318_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1320_160X132_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1320_160X132_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1322_NHD_256X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1322_NHD_256X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1322_NHD_128X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1322_NHD_128X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1325_NHD_128X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1325_NHD_128X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD0323_OS128064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD0323_OS128064_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1326_ER_256X32_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // experimental driver for ER-OLED018-1 //U8X8_SSD1327_SEEED_96X96_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8X8_SSD1327_SEEED_96X96_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // Seeedstudio Grove OLED 96x96 //U8X8_SSD1327_EA_W128128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_EA_W128128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_MIDAS_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_MIDAS_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_WS_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_WS_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_VISIONOX_128X96_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1327_VISIONOX_128X96_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_128X96_NONAME_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_128X96_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_96X96_NONAME_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_96X96_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1329_96X96_NONAME_4W_HW_SPI u8x8(/* cs=*/ A4, /* dc=*/ A2, /* reset=*/ U8X8_PIN_NONE); // Adafruit Feather 32u4 Basic Proto //U8X8_SSD1305_128X32_NONAME_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X32_NONAME_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X32_ADAFRUIT_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X32_ADAFRUIT_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X64_ADAFRUIT_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X64_ADAFRUIT_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X64_RAYSTAR_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_SSD1305_128X64_RAYSTAR_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_KS0108_128X64 u8x8(8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ U8X8_PIN_NONE, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8X8_KS0108_ERM19264 u8x8(8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*dc=*/ 17, /*cs0=*/ 14, /*cs1=*/ 15, /*cs2=*/ 16, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8X8_HD44102_100X64 u8x8(4, 5, 6, 7, 8, 9, 10, 11, /*enable=*/ 2, /*dc=*/ 3, /*cs0=*/ A0, /*cs1=*/ A1, /*cs2=*/ A2, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8X8_T7932_150X32 u8x8(4, 5, 6, 7, 8, 9, 10, 11, /*enable=*/ 2, /*dc=*/ 3, /*cs0=*/ A0, /*cs1=*/ A1, /*cs2=*/ A2, /* reset=*/ U8X8_PIN_NONE); // Set R/W to low! //U8X8_UC1701_EA_DOGS102_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1701_EA_DOGS102_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_PCD8544_84X48_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8X8_PCD8544_84X48_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display //U8X8_PCF8812_96X65_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8X8_PCF8812_96X65_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814 //U8X8_HX1230_96X68_3W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8X8_HX1230_96X68_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7528_ERC16064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7528_ERC16064_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_EA_DOGM128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_EA_DOGM128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_64128N_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_64128N_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_EA_DOGM132_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8X8_ST7565_EA_DOGM132_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); // DOGM132 Shield //U8X8_ST7565_ZOLEN_128X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_ZOLEN_128X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_LM6059_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8X8_ST7565_LM6059_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Adafruit ST7565 GLCD //U8X8_ST7565_KS0713_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // KS0713 controller //U8X8_ST7565_KS0713_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // KS0713 controller //U8X8_ST7565_LX12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_LX12864_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_ERC12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_ERC12864_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_ERC12864_ALT_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // contrast improved version for ERC12864 //U8X8_ST7565_ERC12864_ALT_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // contrast improved version for ERC12864 //U8X8_ST7565_NHD_C12832_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_NHD_C12832_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_NHD_C12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_NHD_C12864_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_JLX12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7565_JLX12864_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_PI_132X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8X8_ST7567_PI_132X64_4W_HW_SPI u8x8(/* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); // Pax Instruments Shield, LCD_BL=6 //U8X8_ST7567_JLX12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_JLX12864_4W_HW_SPI u8x8(/* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_OS12864_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_OS12864_4W_HW_SPI u8x8(/* cs=*/ 7, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_ENH_DG128064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_ENH_DG128064_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_ENH_DG128064I_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_ENH_DG128064I_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7567_64X32_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_ST7567_HEM6432_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); //U8X8_ST7571_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7571_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX172104_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX172104_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX19296_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX19296_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256128_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_WO256X128_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_WO256X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160M_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160M_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160_ALT_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX256160_ALT_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX240160_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX240160_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75256_JLX25664_2ND_HW_I2C u8x8(/* reset=*/ 8); // Due, 2nd I2C //U8X8_ST75320_JLX320240_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST75320_JLX320240_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_NT7534_TG12864R_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_NT7534_TG12864R_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_ST7588_JLX12864_SW_I2C u8x8(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ 5); //U8X8_ST7588_JLX12864_HW_I2C u8x8(/* reset=*/ 5); //U8X8_IST3020_ERC19264_6800 u8x8(44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 28, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect WR pin with GND //U8X8_IST3020_ERC19264_8080 u8x8(44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 29, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect RD pin with 3.3V //U8X8_IST3020_ERC19264_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_IST7920_128X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Round display //U8X8_IST7920_128X128_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Round display //U8X8_UC1601_128X32_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1601_128X32_3W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8X8_UC1601_128X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1604_JLX19264_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1604_JLX19264_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1608_ERC24064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Due, SW SPI, ERC24064-1 Test Board //U8X8_UC1608_DEM240064_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Due, SW SPI, ERC24064-1 Test Board //U8X8_UC1608_ERC240120_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1608_240X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1610_EA_DOGXL160_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8X8_UC1610_EA_DOGXL160_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ U8X8_PIN_NONE); //U8X8_UC1611_EA_DOGM240_2ND_HW_I2C u8x8(/* reset=*/ 8); // Due, 2nd I2C, DOGM240 Test Board //U8X8_UC1611_EA_DOGM240_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board //U8X8_UC1611_EA_DOGXL240_2ND_HW_I2C u8x8(/* reset=*/ 8); // Due, 2nd I2C, DOGXL240 Test Board //U8X8_UC1611_EA_DOGXL240_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board //U8X8_UC1611_IDS4073_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1611_IDS4073_4W_HW_SPI u8x8( /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1611_EW50850_8080 u8x8(8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 3, /*dc=*/ 16, /*reset=*/ 17); // 240x160, Connect RD/WR1 pin with 3.3V, CS is aktive high //U8X8_UC1611_CG160160_8080 u8x8(8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 3, /*dc=*/ 16, /*reset=*/ 17); // Connect WR1 and CD1 pin with 3.3V, connect CS0 with cs, WR0 with enable, CD with dc //U8X8_UC1617_JLX128128_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1617_JLX128128_4W_HW_SPI u8x8( /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1638_192X96_4W_SW_SPI u8x8( /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1638_192X96_4W_HW_SPI u8x8( /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_UC1638_192X96_SW_I2C u8x8(/* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8); // u8g2 test board: I2C clock/data is same as SPI, I2C default address is 0x78 //U8X8_SSD1606_172X72_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display //U8X8_SSD1607_200X200_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display, original LUT from embedded artists //U8X8_SSD1607_GS_200X200_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Good Display //U8X8_SSD1607_WS_200X200_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Waveshare //U8X8_IL3820_296X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display, original LUT //U8X8_IL3820_V2_296X128_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display, optimized (lesser screen flicker) //U8X8_ST7511_AVD_320X240_8080 u8x8(13, 11, 2, 3, 4, 5, 6, A4, /*enable/WR=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); // Connect RD pin with 3.3V/5V //U8X8_S1D15721_240X64_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8X8_S1D15721_240X64_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // End of constructor list void setup(void) { /* U8g2 Project: SSD1306 Test Board */ //pinMode(10, OUTPUT); //pinMode(9, OUTPUT); //digitalWrite(10, 0); //digitalWrite(9, 0); /* U8g2 Project: KS0108 Test Board */ //pinMode(16, OUTPUT); //digitalWrite(16, 0); u8x8.begin(); } void loop(void) { u8x8.setFont(u8x8_font_px437wyse700a_2x2_r); u8x8.drawString(0, 0, ""ABC defg""); u8x8.setFont(u8x8_font_px437wyse700b_2x2_r); u8x8.drawString(0, 2, ""ABC defg""); u8x8.refreshDisplay(); // only required for SSD1606/7 delay(2000); } ",12236,True,3701.1483702295386,median "#include ""test_bc_ur.hpp"" using namespace ur_arduino; using namespace std; typedef std::vector ByteVector; void test_rng_1(void) { auto rng = Xoshiro256(""Wolf""); vector numbers; for(int i = 0; i < 100; i++) { numbers.push_back(rng.next() % 100); } vector expected_numbers = {42, 81, 85, 8, 82, 84, 76, 73, 70, 88, 2, 74, 40, 48, 77, 54, 88, 7, 5, 88, 37, 25, 82, 13, 69, 59, 30, 39, 11, 82, 19, 99, 45, 87, 30, 15, 32, 22, 89, 44, 92, 77, 29, 78, 4, 92, 44, 68, 92, 69, 1, 42, 89, 50, 37, 84, 63, 34, 32, 3, 17, 62, 40, 98, 82, 89, 24, 43, 85, 39, 15, 3, 99, 29, 20, 42, 27, 10, 85, 66, 50, 35, 69, 70, 70, 74, 30, 13, 72, 54, 11, 5, 70, 55, 91, 52, 10, 43, 43, 52}; for(int i=0; i < expected_numbers.size(); i++) { serial_assert(expected_numbers.at(i) == numbers.at(i)); } } void test_rng_2() { auto checksum = bytes_to_int(crc32_bytes(string_to_bytes(""Wolf""))); auto rng = Xoshiro256(checksum); vector numbers; for(int i = 0; i < 100; i++) { numbers.push_back(rng.next() % 100); } vector expected_numbers = {88, 44, 94, 74, 0, 99, 7, 77, 68, 35, 47, 78, 19, 21, 50, 15, 42, 36, 91, 11, 85, 39, 64, 22, 57, 11, 25, 12, 1, 91, 17, 75, 29, 47, 88, 11, 68, 58, 27, 65, 21, 54, 47, 54, 73, 83, 23, 58, 75, 27, 26, 15, 60, 36, 30, 21, 55, 57, 77, 76, 75, 47, 53, 76, 9, 91, 14, 69, 3, 95, 11, 73, 20, 99, 68, 61, 3, 98, 36, 98, 56, 65, 14, 80, 74, 57, 63, 68, 51, 56, 24, 39, 53, 80, 57, 51, 81, 3, 1, 30}; for(int i=0; i < expected_numbers.size(); i++) { //serial_assert(expected_numbers.at(i) == numbers.at(i)); std::cout << (uint32_t)numbers.at(i) << ' '; } for(int i=0; i < expected_numbers.size(); i++) { //serial_assert(expected_numbers.at(i) == numbers.at(i)); std::cout << (uint32_t)expected_numbers.at(i) << ' '; } } void test_rng_3() { auto rng = Xoshiro256(""Wolf""); vector numbers; for(int i = 0; i < 100; i++) { numbers.push_back(rng.next_int(1, 10)); } vector expected_numbers = {6, 5, 8, 4, 10, 5, 7, 10, 4, 9, 10, 9, 7, 7, 1, 1, 2, 9, 9, 2, 6, 4, 5, 7, 8, 5, 4, 2, 3, 8, 7, 4, 5, 1, 10, 9, 3, 10, 2, 6, 8, 5, 7, 9, 3, 1, 5, 2, 7, 1, 4, 4, 4, 4, 9, 4, 5, 5, 6, 9, 5, 1, 2, 8, 3, 3, 2, 8, 4, 3, 2, 1, 10, 8, 9, 3, 10, 8, 5, 5, 6, 7, 10, 5, 8, 9, 4, 6, 4, 2, 10, 2, 1, 7, 9, 6, 7, 4, 2, 5}; for(int i=0; i < expected_numbers.size(); i++) { serial_assert(expected_numbers.at(i) == numbers.at(i)); } } void test_find_fragment_length() { serial_assert(FountainEncoder::find_nominal_fragment_length(12345, 1005, 1955) == 1764); serial_assert(FountainEncoder::find_nominal_fragment_length(12345, 1005, 30000) == 12345); } void test_random_sampler() { vector probs = { 1, 2, 4, 8 }; auto sampler = RandomSampler(probs); auto rng = Xoshiro256(""Wolf""); vector samples; auto f = [&](){ return rng.next_double(); }; for(int i = 0; i < 500; i++) { //samples.push_back(sampler.next(f)); samples.push_back(sampler.next(f(), f())); } vector expected_samples = {3, 3, 3, 3, 3, 3, 3, 0, 2, 3, 3, 3, 3, 1, 2, 2, 1, 3, 3, 2, 3, 3, 1, 1, 2, 1, 1, 3, 1, 3, 1, 2, 0, 2, 1, 0, 3, 3, 3, 1, 3, 3, 3, 3, 1, 3, 2, 3, 2, 2, 3, 3, 3, 3, 2, 3, 3, 0, 3, 3, 3, 3, 1, 2, 3, 3, 2, 2, 2, 1, 2, 2, 1, 2, 3, 1, 3, 0, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 1, 3, 3, 2, 0, 2, 2, 3, 1, 1, 2, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 2, 3, 1, 2, 1, 1, 3, 1, 3, 2, 2, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 3, 3, 1, 2, 3, 3, 1, 3, 2, 3, 3, 3, 2, 3, 1, 3, 0, 3, 2, 1, 1, 3, 1, 3, 2, 3, 3, 3, 3, 2, 0, 3, 3, 1, 3, 0, 2, 1, 3, 3, 1, 1, 3, 1, 2, 3, 3, 3, 0, 2, 3, 2, 0, 1, 3, 3, 3, 2, 2, 2, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 2, 0, 2, 3, 3, 3, 3, 2, 1, 1, 1, 2, 1, 3, 3, 3, 2, 2, 3, 3, 1, 2, 3, 0, 3, 2, 3, 3, 3, 3, 0, 2, 2, 3, 2, 2, 3, 3, 3, 3, 1, 3, 2, 3, 3, 3, 3, 3, 2, 2, 3, 1, 3, 0, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 2, 2, 2, 3, 1, 1, 3, 2, 2, 0, 3, 2, 1, 2, 1, 0, 3, 3, 3, 2, 2, 3, 2, 1, 2, 0, 0, 3, 3, 2, 3, 3, 2, 3, 3, 3, 3, 3, 2, 2, 2, 3, 3, 3, 3, 3, 1, 1, 3, 2, 2, 3, 1, 1, 0, 1, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 1, 2, 3, 3, 2, 2, 2, 2, 3, 3, 2, 0, 2, 1, 3, 3, 3, 3, 0, 3, 3, 3, 3, 2, 2, 3, 1, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 2, 1, 3, 3, 3, 3, 2, 2, 0, 1, 2, 3, 2, 0, 3, 3, 3, 3, 3, 3, 1, 3, 3, 2, 3, 2, 2, 3, 3, 3, 3, 3, 2, 2, 3, 3, 2, 2, 2, 1, 3, 3, 3, 3, 1, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 3, 2, 3, 1, 2, 3, 2, 1, 1, 3, 3, 2, 3, 3, 2, 3, 3, 0, 0, 1, 3, 3, 2, 3, 3, 3, 3, 1, 3, 3, 0, 3, 2, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 0, 3, 3, 2}; for(int i=0; i < expected_samples.size(); i++) { serial_assert(expected_samples.at(i) == samples.at(i)); } } static void test_shuffle() { auto rng = Xoshiro256(""Wolf""); vector values = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; vector> result; for(int i = 0; i < 10; i++) { result.push_back(shuffled(values, rng)); } vector> expectedResult = { {6, 4, 9, 3, 10, 5, 7, 8, 1, 2}, {10, 8, 6, 5, 1, 2, 3, 9, 7, 4}, {6, 4, 5, 8, 9, 3, 2, 1, 7, 10}, {7, 3, 5, 1, 10, 9, 4, 8, 2, 6}, {8, 5, 7, 10, 2, 1, 4, 3, 9, 6}, {4, 3, 5, 6, 10, 2, 7, 8, 9, 1}, {5, 1, 3, 9, 4, 6, 2, 10, 7, 8}, {2, 1, 10, 8, 9, 4, 7, 6, 3, 5}, {6, 7, 10, 4, 8, 9, 2, 3, 1, 5}, {10, 2, 1, 7, 9, 5, 6, 3, 4, 8} }; serial_assert(result == expectedResult); } /* bool test_partition_and_join() { auto message = make_message(1024); auto fragment_len = FountainEncoder::find_nominal_fragment_length(message.size(), 10, 100); auto fragments = FountainEncoder::partition_message(message, fragment_len); vector fragments_hex; transform(fragments.begin(), fragments.end(), back_inserter(fragments_hex), [](const ByteVector& b) -> string { return data_to_hex(b); }); vector expected_fragments = { ""916ec65cf77cadf55cd7f9cda1a1030026ddd42e905b77adc36e4f2d3ccba44f7f04f2de44f42d84c374a0e149136f25b01852545961d55f7f7a8cde6d0e2ec43f3b2dcb644a2209e8c9e34af5c4747984a5e873c9cf5f965e25ee29039f"", ""df8ca74f1c769fc07eb7ebaec46e0695aea6cbd60b3ec4bbff1b9ffe8a9e7240129377b9d3711ed38d412fbb4442256f1e6f595e0fc57fed451fb0a0101fb76b1fb1e1b88cfdfdaa946294a47de8fff173f021c0e6f65b05c0a494e50791"", ""270a0050a73ae69b6725505a2ec8a5791457c9876dd34aadd192a53aa0dc66b556c0c215c7ceb8248b717c22951e65305b56a3706e3e86eb01c803bbf915d80edcd64d4d41977fa6f78dc07eecd072aae5bc8a852397e06034dba6a0b570"", ""797c3a89b16673c94838d884923b8186ee2db5c98407cab15e13678d072b43e406ad49477c2e45e85e52ca82a94f6df7bbbe7afbed3a3a830029f29090f25217e48d1f42993a640a67916aa7480177354cc7440215ae41e4d02eae9a1912"", ""33a6d4922a792c1b7244aa879fefdb4628dc8b0923568869a983b8c661ffab9b2ed2c149e38d41fba090b94155adbed32f8b18142ff0d7de4eeef2b04adf26f2456b46775c6c20b37602df7da179e2332feba8329bbb8d727a138b4ba7a5"", ""03215eda2ef1e953d89383a382c11d3f2cad37a4ee59a91236a3e56dcf89f6ac81dd4159989c317bd649d9cbc617f73fe10033bd288c60977481a09b343d3f676070e67da757b86de27bfca74392bac2996f7822a7d8f71a489ec6180390"", ""089ea80a8fcd6526413ec6c9a339115f111d78ef21d456660aa85f790910ffa2dc58d6a5b93705caef1091474938bd312427021ad1eeafbd19e0d916ddb111fabd8dcab5ad6a6ec3a9c6973809580cb2c164e26686b5b98cfb017a337968"", ""c7daaa14ae5152a067277b1b3902677d979f8e39cc2aafb3bc06fcf69160a853e6869dcc09a11b5009f91e6b89e5b927ab1527a735660faa6012b420dd926d940d742be6a64fb01cdc0cff9faa323f02ba41436871a0eab851e7f5782d10"", ""fbefde2a7e9ae9dc1e5c2c48f74f6c824ce9ef3c89f68800d44587bedc4ab417cfb3e7447d90e1e417e6e05d30e87239d3a5d1d45993d4461e60a0192831640aa32dedde185a371ded2ae15f8a93dba8809482ce49225daadfbb0fec629e"", ""23880789bdf9ed73be57fa84d555134630e8d0f7df48349f29869a477c13ccca9cd555ac42ad7f568416c3d61959d0ed568b2b81c7771e9088ad7fd55fd4386bafbf5a528c30f107139249357368ffa980de2c76ddd9ce4191376be0e6b5"", ""170010067e2e75ebe2d2904aeb1f89d5dc98cd4a6f2faaa8be6d03354c990fd895a97feb54668473e9d942bb99e196d897e8f1b01625cf48a7b78d249bb4985c065aa8cd1402ed2ba1b6f908f63dcd84b66425df00000000000000000000"" }; serial_assert(fragments_hex == expected_fragments); auto rejoined_message = FountainDecoder::join_fragments(fragments, message.size()); serial_assert(message == rejoined_message); } */ // Note: this test is quite heavy for MCU (memory problems). Turned off for now. void test_choose_degree() { Serial.println(""test_choose_degree""); auto message = make_message(1024); auto fragment_len = FountainEncoder::find_nominal_fragment_length(message.size(), 10, 100); auto fragments = FountainEncoder::partition_message(message, fragment_len); vector _degrees; char * nonce_str = NULL; string nonce_string; for(int nonce = 1; nonce <= 200; nonce++) { char * nonce_str = (char *)String(nonce).c_str(); nonce_string = nonce_str; auto part_rng = Xoshiro256(""Wolf-"" + nonce_string); _degrees.push_back(choose_degree(fragments.size(), part_rng)); } //for(int i=0; i < degrees.size(); i++) { // Serial.print(degrees.at(i)); //} //Serial.println(""""); vector expected_degrees = {11, 3, 6, 5, 2, 1, 2, 11, 1, 3, 9, 10, 10, 4, 2, 1, 1, 2, 1, 1, 5, 2, 4, 10, 3, 2, 1, 1, 3, 11, 2, 6, 2, 9, 9, 2, 6, 7, 2, 5, 2, 4, 3, 1, 6, 11, 2, 11, 3, 1, 6, 3, 1, 4, 5, 3, 6, 1, 1, 3, 1, 2, 2, 1, 4, 5, 1, 1, 9, 1, 1, 6, 4, 1, 5, 1, 2, 2, 3, 1, 1, 5, 2, 6, 1, 7, 11, 1, 8, 1, 5, 1, 1, 2, 2, 6, 4, 10, 1, 2, 5, 5, 5, 1, 1, 4, 1, 1, 1, 3, 5, 5, 5, 1, 4, 3, 3, 5, 1, 11, 3, 2, 8, 1, 2, 1, 1, 4, 5, 2, 1, 1, 1, 5, 6, 11, 10, 7, 4, 7, 1, 5, 3, 1, 1, 9, 1, 2, 5, 5, 2, 2, 3, 10, 1, 3, 2, 3, 3, 1, 1, 2, 1, 3, 2, 2, 1, 3, 8, 4, 1, 11, 6, 3, 1, 1, 1, 1, 1, 3, 1, 2, 1, 10, 1, 1, 8, 2, 7, 1, 2, 1, 9, 2, 10, 2, 1, 3, 4, 10}; serial_assert(_degrees == expected_degrees); } static void test_choose_fragments() { auto message = make_message(1024); auto checksum = crc32_int(message); auto fragment_len = FountainEncoder::find_nominal_fragment_length(message.size(), 10, 100); auto fragments = FountainEncoder::partition_message(message, fragment_len); vector> fragment_indexes; for(uint32_t seq_num = 1; seq_num <= 30; seq_num++) { auto indexes_set = choose_fragments(seq_num, fragments.size(), checksum); auto indexes = vector(indexes_set.begin(), indexes_set.end()); sort(indexes.begin(), indexes.end()); fragment_indexes.push_back(indexes); } vector> expected_fragment_indexes = { {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {9}, {2, 5, 6, 8, 9, 10}, {8}, {1, 5}, {1}, {0, 2, 4, 5, 8, 10}, {5}, {2}, {2}, {0, 1, 3, 4, 5, 7, 9, 10}, {0, 1, 2, 3, 5, 6, 8, 9, 10}, {0, 2, 4, 5, 7, 8, 9, 10}, {3, 5}, {4}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, {0, 1, 3, 4, 5, 6, 7, 9, 10}, {6}, {5, 6}, {7} }; serial_assert(fragment_indexes == expected_fragment_indexes); } void test_xor() { auto rng = Xoshiro256(""Wolf""); auto data1 = rng.next_data(10); serial_assert(data_to_hex(data1) == ""916ec65cf77cadf55cd7""); auto data2 = rng.next_data(10); serial_assert(data_to_hex(data2) == ""f9cda1a1030026ddd42e""); auto data3 = data1; xor_into(data3, data2); serial_assert(data_to_hex(data3) == ""68a367fdf47c8b2888f9""); xor_into(data3, data1); serial_assert(data3 == data2); } void test_fountain_encoder() { auto message = make_message(256); auto encoder = FountainEncoder(message, 30); StringVector parts; for(int i = 0; i < 20; i++) { parts.push_back(encoder.next_part().description()); } StringVector expected_parts = { ""seqNum:1, seqLen:9, messageLen:256, checksum:23570951, data:916ec65cf77cadf55cd7f9cda1a1030026ddd42e905b77adc36e4f2d3c"", ""seqNum:2, seqLen:9, messageLen:256, checksum:23570951, data:cba44f7f04f2de44f42d84c374a0e149136f25b01852545961d55f7f7a"", ""seqNum:3, seqLen:9, messageLen:256, checksum:23570951, data:8cde6d0e2ec43f3b2dcb644a2209e8c9e34af5c4747984a5e873c9cf5f"", ""seqNum:4, seqLen:9, messageLen:256, checksum:23570951, data:965e25ee29039fdf8ca74f1c769fc07eb7ebaec46e0695aea6cbd60b3e"", ""seqNum:5, seqLen:9, messageLen:256, checksum:23570951, data:c4bbff1b9ffe8a9e7240129377b9d3711ed38d412fbb4442256f1e6f59"", ""seqNum:6, seqLen:9, messageLen:256, checksum:23570951, data:5e0fc57fed451fb0a0101fb76b1fb1e1b88cfdfdaa946294a47de8fff1"", ""seqNum:7, seqLen:9, messageLen:256, checksum:23570951, data:73f021c0e6f65b05c0a494e50791270a0050a73ae69b6725505a2ec8a5"", ""seqNum:8, seqLen:9, messageLen:256, checksum:23570951, data:791457c9876dd34aadd192a53aa0dc66b556c0c215c7ceb8248b717c22"", ""seqNum:9, seqLen:9, messageLen:256, checksum:23570951, data:951e65305b56a3706e3e86eb01c803bbf915d80edcd64d4d0000000000"", ""seqNum:10, seqLen:9, messageLen:256, checksum:23570951, data:330f0f33a05eead4f331df229871bee733b50de71afd2e5a79f196de09"", ""seqNum:11, seqLen:9, messageLen:256, checksum:23570951, data:3b205ce5e52d8c24a52cffa34c564fa1af3fdffcd349dc4258ee4ee828"", ""seqNum:12, seqLen:9, messageLen:256, checksum:23570951, data:dd7bf725ea6c16d531b5f03254783803048ca08b87148daacd1cd7a006"", ""seqNum:13, seqLen:9, messageLen:256, checksum:23570951, data:760be7ad1c6187902bbc04f539b9ee5eb8ea6833222edea36031306c01"", ""seqNum:14, seqLen:9, messageLen:256, checksum:23570951, data:5bf4031217d2c3254b088fa7553778b5003632f46e21db129416f65b55"", ""seqNum:15, seqLen:9, messageLen:256, checksum:23570951, data:73f021c0e6f65b05c0a494e50791270a0050a73ae69b6725505a2ec8a5"", ""seqNum:16, seqLen:9, messageLen:256, checksum:23570951, data:b8546ebfe2048541348910267331c643133f828afec9337c318f71b7df"", ""seqNum:17, seqLen:9, messageLen:256, checksum:23570951, data:23dedeea74e3a0fb052befabefa13e2f80e4315c9dceed4c8630612e64"", ""seqNum:18, seqLen:9, messageLen:256, checksum:23570951, data:d01a8daee769ce34b6b35d3ca0005302724abddae405bdb419c0a6b208"", ""seqNum:19, seqLen:9, messageLen:256, checksum:23570951, data:3171c5dc365766eff25ae47c6f10e7de48cfb8474e050e5fe997a6dc24"", ""seqNum:20, seqLen:9, messageLen:256, checksum:23570951, data:e055c2433562184fa71b4be94f262e200f01c6f74c284b0dc6fae6673f"" }; serial_assert(parts == expected_parts); } static void test_fountain_encoder_cbor() { auto message = make_message(256); auto encoder = FountainEncoder(message, 30); StringVector parts; for(int i = 0; i < 20; i++) { parts.push_back(data_to_hex(encoder.next_part().cbor())); } StringVector expected_parts = { ""8501091901001a0167aa07581d916ec65cf77cadf55cd7f9cda1a1030026ddd42e905b77adc36e4f2d3c"", ""8502091901001a0167aa07581dcba44f7f04f2de44f42d84c374a0e149136f25b01852545961d55f7f7a"", ""8503091901001a0167aa07581d8cde6d0e2ec43f3b2dcb644a2209e8c9e34af5c4747984a5e873c9cf5f"", ""8504091901001a0167aa07581d965e25ee29039fdf8ca74f1c769fc07eb7ebaec46e0695aea6cbd60b3e"", ""8505091901001a0167aa07581dc4bbff1b9ffe8a9e7240129377b9d3711ed38d412fbb4442256f1e6f59"", ""8506091901001a0167aa07581d5e0fc57fed451fb0a0101fb76b1fb1e1b88cfdfdaa946294a47de8fff1"", ""8507091901001a0167aa07581d73f021c0e6f65b05c0a494e50791270a0050a73ae69b6725505a2ec8a5"", ""8508091901001a0167aa07581d791457c9876dd34aadd192a53aa0dc66b556c0c215c7ceb8248b717c22"", ""8509091901001a0167aa07581d951e65305b56a3706e3e86eb01c803bbf915d80edcd64d4d0000000000"", ""850a091901001a0167aa07581d330f0f33a05eead4f331df229871bee733b50de71afd2e5a79f196de09"", ""850b091901001a0167aa07581d3b205ce5e52d8c24a52cffa34c564fa1af3fdffcd349dc4258ee4ee828"", ""850c091901001a0167aa07581ddd7bf725ea6c16d531b5f03254783803048ca08b87148daacd1cd7a006"", ""850d091901001a0167aa07581d760be7ad1c6187902bbc04f539b9ee5eb8ea6833222edea36031306c01"", ""850e091901001a0167aa07581d5bf4031217d2c3254b088fa7553778b5003632f46e21db129416f65b55"", ""850f091901001a0167aa07581d73f021c0e6f65b05c0a494e50791270a0050a73ae69b6725505a2ec8a5"", ""8510091901001a0167aa07581db8546ebfe2048541348910267331c643133f828afec9337c318f71b7df"", ""8511091901001a0167aa07581d23dedeea74e3a0fb052befabefa13e2f80e4315c9dceed4c8630612e64"", ""8512091901001a0167aa07581dd01a8daee769ce34b6b35d3ca0005302724abddae405bdb419c0a6b208"", ""8513091901001a0167aa07581d3171c5dc365766eff25ae47c6f10e7de48cfb8474e050e5fe997a6dc24"", ""8514091901001a0167aa07581de055c2433562184fa71b4be94f262e200f01c6f74c284b0dc6fae6673f"" }; serial_assert(parts == expected_parts); } void test_fountain_encoder_is_complete() { auto message = make_message(256); auto encoder = FountainEncoder(message, 30); size_t generated_parts_count = 0; while(!encoder.is_complete()) { encoder.next_part(); generated_parts_count += 1; } serial_assert(encoder.seq_len() == generated_parts_count); } void test_fountain_cbor() { CborDynamicOutput output; CborWriter writer(output); writer.writeArray(5); writer.writeInt(12); writer.writeInt(8); writer.writeInt(100); writer.writeInt(0x12345678); uint8_t arr[] ={1, 5, 3, 3 ,5}; writer.writeBytes(arr, sizeof(arr)); ByteVector vec(output.getData(), output.getData() + output.getSize()); //auto part = FountainEncoder::Part(12, 8, 100, 0x12345678, {1, 5, 3, 3 ,5}); auto part = FountainEncoder::Part(vec); auto cbor = part.cbor(); auto part2 = FountainEncoder::Part(cbor); auto cbor2 = part2.cbor(); serial_assert(cbor == cbor2); } static void test_ur_encoder() { auto ur = make_message_ur(256); auto encoder = UREncoder(ur, 30); StringVector parts; for(int i = 0; i < 20; i++) { parts.push_back(encoder.next_part()); } StringVector expected_parts = { ""ur:bytes/1-9/lpadascfadaxcywenbpljkhdcahkadaemejtswhhylkepmykhhtsytsnoyoyaxaedsuttydmmhhpktpmsrjtdkgslpgh"", ""ur:bytes/2-9/lpaoascfadaxcywenbpljkhdcagwdpfnsboxgwlbaawzuefywkdplrsrjynbvygabwjldapfcsgmghhkhstlrdcxaefz"", ""ur:bytes/3-9/lpaxascfadaxcywenbpljkhdcahelbknlkuejnbadmssfhfrdpsbiegecpasvssovlgeykssjykklronvsjksopdzmol"", ""ur:bytes/4-9/lpaaascfadaxcywenbpljkhdcasotkhemthydawydtaxneurlkosgwcekonertkbrlwmplssjtammdplolsbrdzcrtas"", ""ur:bytes/5-9/lpahascfadaxcywenbpljkhdcatbbdfmssrkzmcwnezelennjpfzbgmuktrhtejscktelgfpdlrkfyfwdajldejokbwf"", ""ur:bytes/6-9/lpamascfadaxcywenbpljkhdcackjlhkhybssklbwefectpfnbbectrljectpavyrolkzczcpkmwidmwoxkilghdsowp"", ""ur:bytes/7-9/lpatascfadaxcywenbpljkhdcavszmwnjkwtclrtvaynhpahrtoxmwvwatmedibkaegdosftvandiodagdhthtrlnnhy"", ""ur:bytes/8-9/lpayascfadaxcywenbpljkhdcadmsponkkbbhgsoltjntegepmttmoonftnbuoiyrehfrtsabzsttorodklubbuyaetk"", ""ur:bytes/9-9/lpasascfadaxcywenbpljkhdcajskecpmdckihdyhphfotjojtfmlnwmadspaxrkytbztpbauotbgtgtaeaevtgavtny"", ""ur:bytes/10-9/lpbkascfadaxcywenbpljkhdcahkadaemejtswhhylkepmykhhtsytsnoyoyaxaedsuttydmmhhpktpmsrjtwdkiplzs"", ""ur:bytes/11-9/lpbdascfadaxcywenbpljkhdcahelbknlkuejnbadmssfhfrdpsbiegecpasvssovlgeykssjykklronvsjkvetiiapk"", ""ur:bytes/12-9/lpbnascfadaxcywenbpljkhdcarllaluzmdmgstospeyiefmwejlwtpedamktksrvlcygmzemovovllarodtmtbnptrs"", ""ur:bytes/13-9/lpbtascfadaxcywenbpljkhdcamtkgtpknghchchyketwsvwgwfdhpgmgtylctotzopdrpayoschcmhplffziachrfgd"", ""ur:bytes/14-9/lpbaascfadaxcywenbpljkhdcapazewnvonnvdnsbyleynwtnsjkjndeoldydkbkdslgjkbbkortbelomueekgvstegt"", ""ur:bytes/15-9/lpbsascfadaxcywenbpljkhdcaynmhpddpzmversbdqdfyrehnqzlugmjzmnmtwmrouohtstgsbsahpawkditkckynwt"", ""ur:bytes/16-9/lpbeascfadaxcywenbpljkhdcawygekobamwtlihsnpalnsghenskkiynthdzotsimtojetprsttmukirlrsbtamjtpd"", ""ur:bytes/17-9/lpbyascfadaxcywenbpljkhdcamklgftaxykpewyrtqzhydntpnytyisincxmhtbceaykolduortotiaiaiafhiaoyce"", ""ur:bytes/18-9/lpbgascfadaxcywenbpljkhdcahkadaemejtswhhylkepmykhhtsytsnoyoyaxaedsuttydmmhhpktpmsrjtntwkbkwy"", ""ur:bytes/19-9/lpbwascfadaxcywenbpljkhdcadekicpaajootjzpsdrbalpeywllbdsnbinaerkurspbncxgslgftvtsrjtksplcpeo"", ""ur:bytes/20-9/lpbbascfadaxcywenbpljkhdcayapmrleeleaxpasfrtrdkncffwjyjzgyetdmlewtkpktgllepfrltataztksmhkbot"" }; serial_assert(parts == expected_parts); } bool test_bc_ur(void) { test_rng_1(); test_rng_2(); test_rng_3(); test_find_fragment_length(); test_random_sampler(); test_shuffle(); //test_choose_degree(); // @TODO test_choose_fragments(); test_xor(); test_fountain_encoder(); test_fountain_encoder_cbor(); test_fountain_encoder_is_complete(); test_fountain_cbor(); test_ur_encoder(); return true; } ",12221,False,2044.2150261123884,median