max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
wof/lcs/base/304.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
26838
copyright zengfr site:http://github.com/zengfr/romhack 00142A beq $1442 [base+304] 001436 subq.w #1, ($304,A5) [base+2F2] 00143A move.w #$1c, ($2,A1) [base+304] 00151A addq.w #1, ($304,A5) [base+2F2] 00151E move.w #$2, D6 [base+304] 01A806 move.w A6, ($2f2,A5) [base+304] copyright zengfr site:http://github.com/zengfr/romhack
4-high/gel/applet/demo/sprite/drop_box_on_box/launch_drop_box_on_box.adb
charlie5/lace
20
3471
<filename>4-high/gel/applet/demo/sprite/drop_box_on_box/launch_drop_box_on_box.adb with gel.Forge, gel.Window.lumen, gel.Applet.gui_world, gel.Camera, gel.Sprite, physics.Model, openGL.Model.box.colored, openGL.Palette, ada.Text_IO, ada.Exceptions; pragma unreferenced (gel.window.lumen); procedure launch_drop_Box_on_Box -- -- Drops a box onto a box 'terrain'. -- is use gel.Applet, openGL.Model.box, openGL, opengl.Palette, ada.Text_IO; the_Applet : constant gel.Applet.gui_World.view := gel.Forge.new_gui_Applet ("drop Ball on Box"); the_ground_graphics_Model : constant openGL.Model.box.colored.view := openGL.Model.box.colored.new_Box (Size => (10.0, 0.5, 10.0), Faces => (Front => (Colors => (others => (Red, Opaque))), Rear => (Colors => (others => (Blue, Opaque))), Upper => (Colors => (others => (Green, Opaque))), Lower => (Colors => (others => (Yellow, Opaque))), Left => (Colors => (others => (Cyan, Opaque))), Right => (Colors => (others => (Magenta, Opaque))))); the_ground_physics_Model : constant physics.Model.view := physics.Model.Forge.new_physics_Model (shape_Info => (Kind => physics.Model.cube, half_Extents => (5.0, 0.25, 5.0))); the_Ground : constant gel.Sprite.view := gel.Sprite.forge.new_Sprite ("demo.Ground", gel.Sprite.World_view (the_Applet.gui_World), math.Origin_3D, the_ground_graphics_Model, the_ground_physics_Model); the_box_physics_Model : constant physics.Model.view := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.cube, half_Extents => (1.0, 0.5, 1.0)), Mass => 1.0); the_box_graphics_Model : constant openGL.Model.box.colored.view := openGL.Model.box.colored.new_Box (Size => (1.0, 1.0, 1.0), Faces => (Front => (Colors => (others => (Red, Opaque))), Rear => (Colors => (others => (Blue, Opaque))), Upper => (Colors => (others => (dark_Green, Opaque))), Lower => (Colors => (others => (Yellow, Opaque))), Left => (Colors => (others => (Cyan, Opaque))), Right => (Colors => (others => (Magenta, Opaque))))); the_Box : constant gel.Sprite.view := gel.Sprite.forge.new_Sprite ("demo.Box", gel.Sprite.World_view (the_Applet.gui_World), math.Origin_3D, the_box_graphics_Model, the_box_physics_Model); begin new_Line; put_Line ("Use arrow keys and PgUp/PgDn to move the camera."); new_Line; the_Applet.gui_Camera.Site_is ((0.0, 5.0, 15.0)); -- Position the camera. the_Applet.enable_simple_Dolly (1); -- Enable user camera control via keyboards. the_Applet.enable_Mouse (detect_Motion => False); -- Enable the mouse. the_Applet.gui_World.add (the_Ground, and_children => False); -- Add ground. the_Ground.Site_is (math.Origin_3D); the_Applet.gui_World.add (the_Box, and_Children => False); -- Add ball. the_Box.Site_is ((0.0, 10.0, 0.0)); while the_Applet.is_open loop the_Applet.freshen; -- Handle any new events and update the screen. end loop; the_Applet.destroy; exception when E : others => new_Line; put_Line ("Unhandled exception in main thread ..."); put_Line (ada.Exceptions.exception_Information (E)); new_Line; end launch_drop_Box_on_Box;
macrolib.asm
namark/tasm_stuff
1
21668
RD struc x0 dw ? y0 dw ? r dw ? d dw ? x dw ? y dw ? map_size db 0 ; the byte size of the map map_bit db 0 ; size of the last byte in bits map db 256 dup(0) ; the map itself... need to find a way to store it more efficiently, most RDs will need much less than 256 bytes RD ends INCM macro value,count rept count inc value endm endm DECM macro value,count rept count dec value endm endm INCSI macro count rept count inc si endm endm DECSI macro count rept count dec si endm endm shdr macro h, l, count rept count shr h,1 rcr l,1 endm endm shdl macro h, l, count rept count shl l,1 rcl h,1 endm endm set_2d_cord macro rowsize,i,j,value,segm ; segm:(bx+rowsizse*i+j)=value push si ax dx mov ax,i mov dx,rowsize ;inc dx mul dx mov si,ax add si,j mov al, value mov byte ptr segm:[bx+si],al pop dx ax si endm set_2d_cord_w macro rowsize,i,j,value,segm ; segm:(bx+rowsizse*i+j)=value push si ax dx mov ax,i mov dx,rowsize ;inc dx mul dx mov si,ax add si,j mov ax, value mov word ptr segm:[bx+si],ax pop dx ax si endm set_2d_cord_d macro rowsize,i,j,value,segm ; segm:(ebx+rowsizse*i+j)=value push esi eax edx mov eax,i mov edx,rowsize ;inc dx mul edx mov esi,eax add esi,j mov eax, value mov dword ptr segm:[ebx+esi],eax pop edx eax esi endm draw_line macro rowsize, x1, y1, x2, y2, value, segm ; x1, y1 must be a memory, or unused register local skipx, skipy, swap, skip_swap, x, y, go_straightx, go_straighty, go_downy, gone_upy, go_downx, gone_upx, dec_x, inc_x, dec_y, inc_y push bp ax bx cx dx si di xor bx,bx xor dx,dx xor bp,bp mov si,x2 sub si,x1 jge skipx or dl,10b neg si skipx: mov di,y2 sub di,y1 jge skipy or dl,1 neg di skipy: cmp si,di jl swap mov cx,si x: xor bx,bx set_2d_cord rowsize,y1,x1,value,segm add bp,di mov bx,bp shl bx,1 cmp bx,si jl go_straightx ror dl,1 jc go_downy inc y1 jmp gone_upy go_downy: dec y1 gone_upy: rol dl,1 sub bp,si go_straightx: ror dl,2 jc dec_x inc x1 jmp inc_x dec_x: dec x1 inc_x: rol dl,2 loop x jmp skip_swap swap: mov cx,di y: xor bx,bx set_2d_cord rowsize,y1,x1,value,segm add bp,si mov bx,bp shl bx,1 cmp bx,di jl go_straighty ror dl,2 jc go_downx inc x1 jmp gone_upx go_downx: dec x1 gone_upx: rol dl,2 sub bp,di go_straighty: ror dl,1 jc dec_y inc y1 jmp inc_y dec_y: dec y1 inc_y: rol dl,1 loop y skip_swap: xor bx,bx set_2d_cord rowsize,y1,x1,value,segm pop di si dx cx bx ax bp endm draw_circle macro rowsize,x0,y0,r,value,segm local no_dec, cikl, finish push ax dx di cx bp xor ax,ax mov dx,r ;plot mov cx,dx add cx,y0 set_2d_cord rowsize,cx,x0,value,segm mov cx,dx neg cx add cx,y0 set_2d_cord rowsize,cx,x0,value,segm mov cx,dx neg cx add cx,x0 set_2d_cord rowsize,y0,cx,value,segm mov cx,dx add cx,x0 set_2d_cord rowsize,y0,cx,value,segm ; mov di,r shl di,2 neg di add di,5 cikl: jl no_dec inc ax dec dx ;plot mov cx,dx add cx,y0 mov bp,ax add bp,x0 set_2d_cord rowsize,cx,bp,value,segm mov cx,dx neg cx add cx,y0 mov bp,ax neg bp add bp,x0 set_2d_cord rowsize,cx,bp,value,segm mov cx,dx neg cx add cx,y0 mov bp,ax add bp,x0 set_2d_cord rowsize,cx,bp,value,segm mov cx,dx add cx,y0 mov bp,ax neg bp add bp,x0 set_2d_cord rowsize,cx,bp,value,segm mov cx,dx add cx,x0 mov bp,ax add bp,y0 set_2d_cord rowsize,bp,cx,value,segm mov cx,dx neg cx add cx,x0 mov bp,ax neg bp add bp,y0 set_2d_cord rowsize,bp,cx,value,segm mov cx,dx neg cx add cx,x0 mov bp,ax add bp,y0 set_2d_cord rowsize,bp,cx,value,segm mov cx,dx add cx,x0 mov bp,ax neg bp add bp,y0 set_2d_cord rowsize,bp,cx,value,segm ; cmp dx,ax jle finish push dx ax shl dx,3 shl ax,3 add di,ax sub di,dx add di,4 pop ax dx ;p=p+8x+4-8y jmp cikl no_dec: inc ax ;plot mov cx,dx add cx,y0 mov bp,ax add bp,x0 set_2d_cord rowsize,cx,bp,value,segm mov cx,dx neg cx add cx,y0 mov bp,ax neg bp add bp,x0 set_2d_cord rowsize,cx,bp,value,segm mov cx,dx neg cx add cx,y0 mov bp,ax add bp,x0 set_2d_cord rowsize,cx,bp,value,segm mov cx,dx add cx,y0 mov bp,ax neg bp add bp,x0 set_2d_cord rowsize,cx,bp,value,segm mov cx,dx add cx,x0 mov bp,ax add bp,y0 set_2d_cord rowsize,bp,cx,value,segm mov cx,dx neg cx add cx,x0 mov bp,ax neg bp add bp,y0 set_2d_cord rowsize,bp,cx,value,segm mov cx,dx neg cx add cx,x0 mov bp,ax add bp,y0 set_2d_cord rowsize,bp,cx,value,segm mov cx,dx add cx,x0 mov bp,ax neg bp add bp,y0 set_2d_cord rowsize,bp,cx,value,segm ; push ax shl ax,3 add di,ax add di,4 pop ax ;p=p+8x+4 jmp cikl finish: pop bp cx di dx ax endm rot macro A,dir; type of A is RD, see structure above... dir specifice(?) the direction of rotation... need to add some comments below... and a lot of optimization local exit, no_dec, cikl, finish, skip_init, map_bit_ok, map_not_built, dont_use_map, switch_table, case0, case1, case2, case3, case4, case5, case6, case7, exit_switch, skip_dec0, cl_ok0, ch_ok0, skip_dec1, cl_ok1, ch_ok1, skip_dec2, cl_ok2, ch_ok2, skip_dec3, cl_ok3, ch_ok3, skip_dec4, cl_ok4, ch_ok4, skip_dec5, cl_ok5, ch_ok5, skip_dec6, cl_ok6, ch_ok6, skip_dec7, cl_ok7, ch_ok7, not_last0, is_last0, not_last2, is_last2, not_last4, is_last4, not_last6, is_last6 push ax bx dx di cx xor di,di add di,A.d jnz skip_init mov bh,A.map_size mov bl,A.map_bit mov di,A.r xor di,0 jnz dont_use_map xor bx,0 jz dont_use_map mov bx,A.x0 ; A.x0 now holds the case number shl bx,1 ; cases are 2B, i wonder if they would be 4 if i use32 jmp cs:switch_table[bx] switch_table dw case0, case1, case2, case3, case4, case5, case6, case7 case0: mov cx,A.y0 ; low byte of A.y0 now represents the bit coordinate and the high byte the byte coordinate in the map mov ah,1 shl ah,cl xor bx,bx mov bl,ch mov al,A.map[bx] and al,ah jz skip_dec0 ;inc A.x ;inc A.y ;dec A.x dec A.y skip_dec0: ;dec A.y ;dec A.x ;inc A.y inc A.x ;dec cl inc cl cmp ch,A.map_size ; see if we're on the last byte, form here i think optimisation can be done... obviously... for me... i guess jne not_last0 cmp cl,A.map_bit jmp is_last0 not_last0: ;jge cl_ok cmp cl,7 is_last0: jle cl_ok0 ;cmp ch,0 cmp ch,A.map_size jne ch_ok0 ;inc cl dec cl inc A.x0 jmp cl_ok0 ch_ok0: ;dec ch inc ch ;mov cl,7 mov cl,0 cl_ok0: mov A.y0,cx jmp exit_switch case1: mov cx,A.y0 mov ah,1 shl ah,cl xor bx,bx mov bl,ch mov al,A.map[bx] and al,ah jz skip_dec1 inc A.x ;inc A.y ;dec A.x ;dec A.y skip_dec1: dec A.y ;dec A.x ;inc A.y ;inc A.x dec cl ;inc cl jge cl_ok1 ;cmp cl,7 ;jle cl_ok cmp ch,0 ;cmp ch,A.map_size jne ch_ok1 inc cl ;dec cl inc A.x0 jmp cl_ok1 ch_ok1: dec ch ;inc ch mov cl,7 ;mov cl,0 cl_ok1: mov A.y0,cx jmp exit_switch case2: mov cx,A.y0 mov ah,1 shl ah,cl xor bx,bx mov bl,ch mov al,A.map[bx] and al,ah jz skip_dec2 ;inc A.x ;inc A.y dec A.x ;dec A.y skip_dec2: dec A.y ;dec A.x ;inc A.y ;inc A.x ;dec cl inc cl cmp ch,A.map_size jne not_last2 cmp cl,A.map_bit jmp is_last2 not_last2: ;jge cl_ok cmp cl,7 is_last2: jle cl_ok2 ;cmp ch,0 cmp ch,A.map_size jne ch_ok2 ;inc cl dec cl inc A.x0 jmp cl_ok2 ch_ok2: ;dec ch inc ch ;mov cl,7 mov cl,0 cl_ok2: mov A.y0,cx jmp exit_switch case3: mov cx,A.y0 mov ah,1 shl ah,cl xor bx,bx mov bl,ch mov al,A.map[bx] and al,ah jz skip_dec3 ;inc A.x ;inc A.y ;dec A.x dec A.y skip_dec3: ;dec A.y dec A.x ;inc A.y ;inc A.x dec cl ;inc cl jge cl_ok3 ;cmp cl,7 ;jle cl_ok cmp ch,0 ;cmp ch,A.map_size jne ch_ok3 inc cl ;dec cl inc A.x0 jmp cl_ok3 ch_ok3: dec ch ;inc ch mov cl,7 ;mov cl,0 cl_ok3: mov A.y0,cx jmp exit_switch case4: mov cx,A.y0 mov ah,1 shl ah,cl xor bx,bx mov bl,ch mov al,A.map[bx] and al,ah jz skip_dec4 ;inc A.x inc A.y ;dec A.x ;dec A.y skip_dec4: ;dec A.y dec A.x ;inc A.y ;inc A.x ;dec cl inc cl cmp ch,A.map_size jne not_last4 cmp cl,A.map_bit jmp is_last4 not_last4: ;jge cl_ok cmp cl,7 is_last4: jle cl_ok4 ;cmp ch,0 cmp ch,A.map_size jne ch_ok4 ;inc cl dec cl inc A.x0 jmp cl_ok4 ch_ok4: ;dec ch inc ch ;mov cl,7 mov cl,0 cl_ok4: mov A.y0,cx jmp exit_switch case5: mov cx,A.y0 mov ah,1 shl ah,cl xor bx,bx mov bl,ch mov al,A.map[bx] and al,ah jz skip_dec5 ;inc A.x ;inc A.y dec A.x ;dec A.y skip_dec5: ;dec A.y ;dec A.x inc A.y ;inc A.x dec cl ;inc cl jge cl_ok5 ;cmp cl,7 ;jle cl_ok cmp ch,0 ;cmp ch,A.map_size jne ch_ok5 inc cl ;dec cl inc A.x0 jmp cl_ok5 ch_ok5: dec ch ;inc ch mov cl,7 ;mov cl,0 cl_ok5: mov A.y0,cx jmp exit_switch case6: mov cx,A.y0 mov ah,1 shl ah,cl xor bx,bx mov bl,ch mov al,A.map[bx] and al,ah jz skip_dec6 inc A.x ;inc A.y ;dec A.x ;dec A.y skip_dec6: ;dec A.y ;dec A.x inc A.y ;inc A.x ;dec cl inc cl cmp ch,A.map_size jne not_last6 cmp cl,A.map_bit jmp is_last6 not_last6: ;jge cl_ok cmp cl,7 is_last6: jle cl_ok6 ;cmp ch,0 cmp ch,A.map_size jne ch_ok6 ;inc cl dec cl inc A.x0 jmp cl_ok6 ch_ok6: ;dec ch inc ch ;mov cl,7 mov cl,0 cl_ok6: mov A.y0,cx jmp exit_switch case7: mov cx,A.y0 mov ah,1 shl ah,cl xor bx,bx mov bl,ch mov al,A.map[bx] and al,ah jz skip_dec7 ;inc A.x inc A.y ;dec A.x ;dec A.y skip_dec7: ;dec A.y ;dec A.x ;inc A.y inc A.x dec cl ;inc cl jge cl_ok7 ;cmp cl,7 ;jle cl_ok cmp ch,0 ;cmp ch,A.map_size jne ch_ok7 inc cl ;dec cl; mov A.x0,0 jmp cl_ok7 ch_ok7: dec ch ;inc ch mov cl,7 ;mov cl,0 cl_ok7: mov A.y0,cx exit_switch: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; jmp exit dont_use_map: shl di,2 neg di add di,5 skip_init: jl no_dec inc A.x dec A.y mov ax,A.x mov dx,A.y sub ax,A.x0 sub dx,A.y0 mov ch,1 mov cl,A.map_bit shl ch,cl xor bx,bx mov bl,A.map_size or A.map[bx],ch ;push dx ax shl dx,3 shl ax,3 add di,ax sub di,dx add di,4 ;pop ax dx ;p=p+8x+4-8y jmp finish no_dec: inc A.x mov ax,A.x mov dx,A.y sub ax,A.x0 sub dx,A.y0 ;push ax shl ax,3 add di,ax add di,4 ;pop ax ;p=p+8x+4 ;jmp cikl finish: mov ax, A.x mov dx, A.y cmp dx,ax jg map_not_built mov di,0 mov A.r,0 mov A.x0,1 mov ax,A.y0;??? xor ax,ax;??? mov al, A.map_bit mov ah, A.map_size mov A.y0,ax jmp map_bit_ok map_not_built: inc A.map_bit cmp A.map_bit, 7 jbe map_bit_ok mov A.map_bit,0 inc A.map_size map_bit_ok: mov A.d,di exit: pop cx di dx bx ax endm speaker_setT macro ;give T in ax push ax ax mov al, 0B6h out 43h,al ; tell to the comp that we wont to set T for timer 2 pop ax out 42h,al ; give the low byte of T shr ax,8 out 42h,al; give the high byte of T pop ax endm speaker_start macro push ax in al,61h or al,11b out 61h,al pop ax endm speaker_end macro push ax in al,61h and al,11111100b out 61h,al pop ax endm wait_for macro milisec push ax dx cx mov ax,milisec mov dx,1000 mul dx mov cx,dx ; high bite of delay in microseconds mov dx,ax ; low byte of delay in microseconds mov ah,86h ; function wait of int 15h int 15h pop cx dx ax endm
prototyping/adaracer/src/modules/logger.adb
TUM-EI-RCS/StratoX
12
14630
-- Project: StratoX -- Authors: <NAME> (<EMAIL>) -- <NAME> (<EMAIL>) -- -- Description: -- allows logging of structured messages at several logging levels. -- -- Usage: -- Logger.init -- initializes the Logger -- Logger.log_console (Logger.INFO, "Program started.") -- writes log on info level to console -- Logger.log_sd (Logger.INFO, gps_msg) -- writes GPS record to SD card with SDLog; with NVRAM; with Buildinfo; with HIL.Devices; with HIL.UART; with System; with Interfaces; use Interfaces; with Ada.Unchecked_Conversion; with Ada.Real_Time; with ULog; pragma Elaborate_All (ULog); pragma Elaborate_All (SDLog); -- @summary Simultaneously writes to UART, and SD card. package body Logger with SPARK_Mode, Refined_State => (LogState => (queue_ulog, Logging_Task, logger_level, With_SDLog)) is -- the type for the queue buffer type Buffer_Ulog is array (Natural range <>) of ULog.Message; type bufpos is mod LOG_QUEUE_LENGTH; -- if GNATprove crashes with reference to that file, -- then you have run into bug KP-160-P601-005. -- workaround: move decl of protected type to package spec. --------------------- -- LOG QUEUE TYPE --------------------- -- protected type to implement the ULog queue protected type Ulog_Queue_T is procedure New_Msg (msg : in ULog.Message); -- enqueue new message. this is not blocking, except to ensure mutex. -- it is fast (only memcpy), but it can silently fail if buffer is full. -- FIXME: how can we specify a precondition on the private variable? -- for now we put an assertion in the body entry Get_Msg (msg : out ULog.Message); -- try to get new message from buffer. if empty, this is blocking -- until buffer has data, and then returns it. -- FIXME: how can we specify a precondition on the private variable? -- for now we put an assertion in the body function Get_Num_Overflows return Natural; -- query how often the buffer overflowed. If this happens, either increase -- the buffer QUEUE_LENGTH, or increase priority of the logger task. function Get_Length return Natural; -- query number of messages waiting in the logging queue. private Buffer : Buffer_Ulog (0 .. LOG_QUEUE_LENGTH - 1); -- cannot use a discriminant for this (would violate No_Implicit_Heap_Allocations) Num_Queued : Natural := 0; Not_Empty : Boolean := False; -- simple barrier (Ravenscar) Pos_Read : bufpos := 0; Pos_Write : bufpos := 0; Num_Overflows : Natural := 0; -- cannot use a dynamic predicate to etablish relationship, because this requires -- a record. But we cannot have a record, since this would make Not_Empty a -- non-simple barrier (=> Ravenscar violation). end Ulog_Queue_T; -- sporadic logging task waking up when message is enqueued task Logging_Task is pragma Priority (System.Priority'First); -- lowest prio for logging end Logging_Task; ---------------------------- -- PROTOTYPES ---------------------------- subtype Img_String is String (1 .. 3); function Image (level : Log_Level) return Img_String; procedure Write_Bytes_To_SD (len : Natural; buf : HIL.Byte_Array) with Pre => buf'Last >= buf'First and then len <= Natural (Unsigned_16'Last) and then buf'Length >= len; ---------------------------- -- INTERNAL STATES ---------------------------- queue_ulog : Ulog_Queue_T; logger_level : Log_Level := DEBUG; With_SDLog : Boolean := False; ----------------------- -- Write_Bytes_To_SD ----------------------- -- slow procedure! Takes Byte_Array, converts to SD data type and writes procedure Write_Bytes_To_SD (len : Natural; buf : HIL.Byte_Array) is begin if len > 0 then declare subtype Bytes_ULog is HIL.Byte_Array (1 .. len); subtype SD_Data_ULog is SDLog.SDLog_Data (1 .. Unsigned_16 (len)); function To_FileData is new Ada.Unchecked_Conversion (Bytes_ULog, SD_Data_ULog); buf_last : constant Integer := buf'First + len - 1; n_wr : Integer; begin SDLog.Write_Log (To_FileData (buf (buf'First .. buf_last)), n_wr); end; end if; end Write_Bytes_To_SD; -------------- -- LOG TASK -------------- -- the task which logs to SD card in the background task body Logging_Task is msg : ULog.Message; BUFLEN : constant := 512; bytes : HIL.Byte_Array (1 .. BUFLEN); len : Natural; type loginfo_ratio is mod 100; r : loginfo_ratio := 0; begin loop queue_ulog.Get_Msg (msg); -- under mutex, must be fast ULog.Serialize_Ulog (msg, len, bytes); -- this can be slow again Write_Bytes_To_SD (len => len, buf => bytes); -- occasionally log queue state (overflows, num_queued). r := r + 1; if r = 0 then declare m : ULog.Message (ULog.LOG_QUEUE); n_ovf : constant Natural := queue_ulog.Get_Num_Overflows; n_que : constant Natural := queue_ulog.Get_Length; begin m.t := Ada.Real_Time.Clock; if n_ovf > Natural (Unsigned_16'Last) then m.n_overflows := Unsigned_16'Last; else m.n_overflows := Unsigned_16 (n_ovf); end if; if n_que > Natural (Unsigned_8'Last) then m.n_queued := Unsigned_8'Last; else m.n_queued := Unsigned_8 (n_que); end if; ULog.Serialize_Ulog (m, len, bytes); Write_Bytes_To_SD (len => len, buf => bytes); end; end if; end loop; end Logging_Task; -- implementation of the message queue protected body Ulog_Queue_T is procedure New_Msg (msg : in ULog.Message) is begin Buffer (Integer (Pos_Write)) := msg; Pos_Write := Pos_Write + 1; if Num_Queued < Buffer'Last then Num_Queued := Num_Queued + 1; else -- =Buffer'Last Pos_Read := Pos_Read + 1; -- overwrite oldest if Num_Overflows < Natural'Last then Num_Overflows := Num_Overflows + 1; end if; end if; Not_Empty := (Num_Queued > 0); pragma Assert ((Not_Empty and (Num_Queued > 0)) or ((not Not_Empty) and (Num_Queued = 0))); end New_Msg; entry Get_Msg (msg : out ULog.Message) when Not_Empty is begin pragma Assume (Num_Queued > 0); -- via barrier and assert in New_Msg msg := Buffer (Integer (Pos_Read)); Pos_Read := Pos_Read + 1; Num_Queued := Num_Queued - 1; Not_Empty := Num_Queued > 0; pragma Assert ((Not_Empty and (Num_Queued > 0)) or ((not Not_Empty) and (Num_Queued = 0))); end Get_Msg; function Get_Num_Overflows return Natural is (Num_Overflows); function Get_Length return Natural is (Num_Queued); end Ulog_Queue_T; ---------------------------- -- Instantiation / Body -- ---------------------------- -- HAL, only change Adapter to port Code package body Adapter is procedure init (status : out Init_Error_Code) is begin -- HIL.UART.configure; already done in CPU.initialize status := SUCCESS; end init; procedure write (message : Message_Type) is CR : constant Character := Character'Val (13); -- ASCII LF : constant Character := Character'Val (10); begin HIL.UART.write (HIL.Devices.CONSOLE, HIL.UART.toData_Type (message & CR & LF)); end write; end Adapter; -------------- -- Init -------------- procedure Init (status : out Init_Error_Code) is begin SDLog.Init; Adapter.init (status); end Init; ----------- -- Image ----------- function Image (level : Log_Level) return Img_String is begin return (case level is when SENSOR => "S: ", when ERROR => "E: ", when WARN => "W: ", when INFO => "I: ", when DEBUG => "D: ", when TRACE => "T: " ); end Image; ----------------- -- log_console ----------------- procedure log_console (msg_level : Log_Level; message : Message_Type) with SPARK_Mode => Off is begin if Log_Level'Pos (msg_level) <= Log_Level'Pos (logger_level) then Adapter.write (Image (msg_level) & message); end if; end log_console; ---------------- -- log_sd ---------------- procedure log_sd (msg_level : Log_Level; message : ULog.Message) is begin if Log_Level'Pos (msg_level) <= Log_Level'Pos (logger_level) then queue_ulog.New_Msg (message); end if; end log_sd; ------------------- -- set_log_level ------------------- procedure Set_Log_Level (level : Log_Level) is begin logger_level := level; end Set_Log_Level; ------------------- -- Start_SDLog ------------------- procedure Start_SDLog is num_boots : HIL.Byte; begin NVRAM.Load (variable => NVRAM.VAR_BOOTCOUNTER, data => num_boots); declare buildstring : constant String := Buildinfo.Short_Datetime; fname : constant String := HIL.Byte'Image (num_boots) & ".log"; BUFLEN : constant := 128; -- header is around 90 bytes long bytes : HIL.Byte_Array (1 .. BUFLEN); len : Natural; valid : Boolean; Logfile_Started : Boolean; begin With_SDLog := False; SDLog.Start_Logfile (dirname => buildstring, filename => fname, ret => Logfile_Started); if not Logfile_Started then log_console (Logger.ERROR, "Cannot create logfile: " & buildstring & "/" & fname); return; else log_console (Logger.INFO, "Log name: " & buildstring & "/" & fname); With_SDLog := True; end if; -- write file header (ULog message definitions) ULog.Init; Get_Ulog_Defs_Loop : loop ULog.Get_Header_Ulog (bytes, len, valid); exit Get_Ulog_Defs_Loop when not valid; Write_Bytes_To_SD (len => len, buf => bytes); end loop Get_Ulog_Defs_Loop; end; end Start_SDLog; end Logger;
programs/oeis/137/A137688.asm
neoneye/loda
22
246378
<gh_stars>10-100 ; A137688: 2^A003056: 2^n appears n+1 times. ; 1,2,2,4,4,4,8,8,8,8,16,16,16,16,16,32,32,32,32,32,32,64,64,64,64,64,64,64,128,128,128,128,128,128,128,128,256,256,256,256,256,256,256,256,256,512,512,512,512,512,512,512,512,512,512,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,8192,8192,8192,8192,8192,8192,8192,8192,8192 mov $1,1 lpb $0 sub $0,1 mul $1,2 add $2,1 trn $0,$2 lpe mov $0,$1
oeis/278/A278541.asm
neoneye/loda-programs
11
241116
<reponame>neoneye/loda-programs<filename>oeis/278/A278541.asm ; A278541: a(n) = A046523(A209636(n)). ; Submitted by <NAME> ; 1,2,4,2,8,6,2,2,16,12,6,6,2,2,2,2,32,24,12,12,6,6,6,6,2,2,2,2,2,2,2,2,64,48,24,24,12,12,12,12,6,6,6,6,6,6,6,6,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,128,96,48,48,24,24,24,24,12,12,12,12,12,12,12,12,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,2,2,2,2 mov $1,1 lpb $0 lpb $0 dif $0,2 mul $1,2 add $1,1 lpe div $0,2 mov $2,$1 mov $1,2 dif $2,2 lpe mov $0,$2 add $0,1
examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/Monoid.agda
cruhland/agda
1,989
11745
<reponame>cruhland/agda module Logic.Structure.Monoid where import Logic.Equivalence import Logic.Operations as Operations open Logic.Equivalence using (Equivalence; module Equivalence) open Operations.Param data Monoid (A : Set)(Eq : Equivalence A) : Set where monoid : (z : A) (_+_ : A -> A -> A) (leftId : LeftIdentity Eq z _+_) (rightId : RightIdentity Eq z _+_) (assoc : Associative Eq _+_) -> Monoid A Eq -- There should be a simpler way of doing this. Local definitions to data declarations? module Projections where zero : {A : Set}{Eq : Equivalence A} -> Monoid A Eq -> A zero (monoid z _ _ _ _) = z plus : {A : Set}{Eq : Equivalence A} -> Monoid A Eq -> A -> A -> A plus (monoid _ p _ _ _) = p leftId : {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) -> LeftIdentity Eq (zero Mon) (plus Mon) leftId (monoid _ _ li _ _) = li rightId : {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) -> RightIdentity Eq (zero Mon) (plus Mon) rightId (monoid _ _ _ ri _) = ri assoc : {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) -> Associative Eq (plus Mon) assoc (monoid _ _ _ _ a) = a module Monoid {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) where zero = Projections.zero Mon _+_ = Projections.plus Mon leftId = Projections.leftId Mon rightId = Projections.rightId Mon assoc = Projections.assoc Mon
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1640.asm
ljhsiun2/medusa
9
163168
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r14 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x31d2, %rax nop nop nop nop add %rsi, %rsi movups (%rax), %xmm3 vpextrq $1, %xmm3, %r11 nop nop cmp %rdi, %rdi lea addresses_normal_ht+0x11192, %rsi lea addresses_normal_ht+0xf652, %rdi clflush (%rdi) nop and $56735, %r14 mov $53, %rcx rep movsl nop nop and %rsi, %rsi lea addresses_normal_ht+0x10f92, %r11 nop nop nop nop nop and $12361, %r12 mov (%r11), %eax nop nop nop xor %rdi, %rdi lea addresses_A_ht+0x16c32, %rcx nop nop sub $45400, %rax mov $0x6162636465666768, %rdi movq %rdi, %xmm2 vmovups %ymm2, (%rcx) nop nop nop and %rax, %rax lea addresses_WC_ht+0x177b2, %rsi lea addresses_WC_ht+0xaeb2, %rdi nop nop nop nop cmp $2527, %rdx mov $29, %rcx rep movsq nop nop xor %rdi, %rdi lea addresses_WC_ht+0x1b6c4, %r14 nop nop sub $617, %rax and $0xffffffffffffffc0, %r14 movntdqa (%r14), %xmm4 vpextrq $1, %xmm4, %rdi nop nop cmp $56063, %r11 lea addresses_A_ht+0x17592, %rax nop nop nop nop nop add $33130, %rdi movb (%rax), %r11b nop nop nop and %rdi, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r14 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r15 push %rbx push %rcx push %rdi push %rdx // Store lea addresses_D+0x192, %rdi clflush (%rdi) nop nop nop and %rdx, %rdx mov $0x5152535455565758, %r15 movq %r15, %xmm3 vmovups %ymm3, (%rdi) nop add %rdx, %rdx // Faulty Load lea addresses_RW+0x11192, %rcx clflush (%rcx) cmp $36735, %r14 mov (%rcx), %edx lea oracles, %rbx and $0xff, %rdx shlq $12, %rdx mov (%rbx,%rdx,1), %rdx pop %rdx pop %rdi pop %rcx pop %rbx pop %r15 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 1, 'type': 'addresses_RW', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D', 'congruent': 11}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_RW', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 5}} {'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 9}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': True, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 5, 'type': 'addresses_WC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC_ht', 'congruent': 1}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 9}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
HoTT/Identity.agda
andyfreeyy/agda_and_math
2
5453
{-# OPTIONS --without-K --exact-split --safe #-} module Identity where open import Basic_Types -- ------------------------------------ -- the identity type, or path type infix 1 _≡_ data _≡_ {A : Set} : A → A → Set where refl : ∀ (a : A) → a ≡ a {-# BUILTIN EQUALITY _≡_ #-} -- path induction p-ind : ∀ {A : Set} {B : ∀ (x y : A) (p : x ≡ y) → Set} → (∀ (z : A) → B z z (refl z)) → ∀ (x y : A) (p : x ≡ y) → B x y p p-ind f z z (refl z) = f z -- notice here that, in the proof system of agda, the induction principle is -- builtin for a data type, for their constructor is given expicitly. Hence, -- one way to prove identity type is to use p-ind, which is itself proved by -- agda using implicit path induction, or we can use agda's induction expicitly -- which is the case when we construct apd and ass-p -- the groupoid structure of path type concat : ∀ {A : Set} → ∀ (x y : A) (p : x ≡ y) → ∀ (z : A) (q : y ≡ z) → x ≡ z concat {A} x x (refl x) x (refl x) = refl x infix 3 _∙_ _∙_ : ∀ {A : Set} {x y z : A} → ∀ (p : x ≡ y) (q : y ≡ z) → x ≡ z _∙_ {_} {x} {y} {z} p q = concat x y p z q inv : ∀ {A : Set} {x y : A} → ∀ (p : x ≡ y) → y ≡ x inv {_} {x} {x} (refl x) = refl x -- the groupoid structure of identities, viewed as higher paths p-ass : ∀ {A : Set} {x y z w : A} → ∀ (p : x ≡ y) (q : y ≡ z) (r : z ≡ w) → p ∙ (q ∙ r) ≡ (p ∙ q) ∙ r p-ass {_} {x} {x} {x} {x} (refl x) (refl x) (refl x) = refl (((refl x) ∙ (refl x)) ∙ (refl x)) left_unit : ∀ {A : Set} {x y : A} → ∀ (p : x ≡ y) → (refl x) ∙ p ≡ p left_unit {_} {x} {x} (refl x) = refl (refl x) right_unit : ∀ {A : Set} {x y : A} → ∀ (p : x ≡ y) → p ∙ (refl y) ≡ p right_unit {_} {x} {x} (refl x) = refl (refl x) rinv-unit : ∀ {A : Set} {x y : A} → ∀ (p : x ≡ y) → (inv p) ∙ p ≡ refl y rinv-unit {_} {x} {x} (refl x) = refl (refl x) linv-unit : ∀ {A : Set} {x y : A} → ∀ (p : x ≡ y) → p ∙ (inv p) ≡ refl x linv-unit {_} {x} {x} (refl x) = refl (refl x) invinv : ∀ {A : Set} {x y : A} → ∀ (p : x ≡ y) → inv (inv p) ≡ p invinv {_} {x} {x} (refl x) = refl (refl x) -- ------------------------------------ -- loop spaces Ω : ∀ {A : Set} (a : A) → Set Ω {_} a = a ≡ a -- commutativity on 2-dimensional loops -- prove the commutativity by proving a general result in the groupoid pwr : ∀ {A : Set} {a b c : A} {p q : a ≡ b} → ∀ (r : b ≡ c) → ∀ (α : p ≡ q) → p ∙ r ≡ q ∙ r pwr {_} {_} {b} {b} {p} {p} (refl b) (refl p) = refl (p ∙ (refl b)) pwl : ∀ {A : Set} {a b c : A} {q r : b ≡ c} → ∀ (p : a ≡ b) → ∀ (β : q ≡ r) → p ∙ q ≡ p ∙ r pwl {_} {_} {_} {_} {q} {q} p (refl q) = refl (p ∙ q) _*_ : ∀ {A : Set} {a b c : A} {p q : a ≡ b} {r s : b ≡ c} → ∀ (α : p ≡ q) (β : r ≡ s) → p ∙ r ≡ q ∙ s _*_ {_} {_} {_} {_} {p} {q} {r} {s} α β = α∙r ∙ q∙β where α∙r : p ∙ r ≡ q ∙ r α∙r = pwr r α q∙β : q ∙ r ≡ q ∙ s q∙β = pwl q β _*'_ : ∀ {A : Set} {a b c : A} {p q : a ≡ b} {r s : b ≡ c} → ∀ (α : p ≡ q) (β : r ≡ s) → p ∙ r ≡ q ∙ s _*'_ {_} {_} {_} {_} {p} {q} {r} {s} α β = p∙β ∙ α∙s where p∙β : p ∙ r ≡ p ∙ s p∙β = pwl p β α∙s : p ∙ s ≡ q ∙ s α∙s = pwr s α pwr-ru : ∀ {A : Set} {a : A} (p : a ≡ a) (α : refl a ≡ p) → pwr (refl a) α ≡ α ∙ (inv (right_unit p)) pwr-ru {_} {_} (refl a) (refl (refl a)) = refl (refl (refl a)) pwl-lu : ∀ {A : Set} {a : A} (p : a ≡ a) (α : refl a ≡ p) → pwl (refl a) α ≡ α ∙ (inv (left_unit p)) pwl-lu {_} {_} (refl a) (refl (refl a)) = refl (refl (refl a)) *≡*' : ∀ {A : Set} {a b c : A} {p q : a ≡ b} {r s : b ≡ c} → ∀ (α : p ≡ q) (β : r ≡ s) → (α * β) ≡ (α *' β) *≡*' {_} {a} {a} {a} {refl a} {refl a} {refl a} {refl a} (refl (refl a)) (refl (refl a)) = refl ((refl ((refl a) ∙ (refl a))) ∙ (refl ((refl a) ∙ (refl a)))) ∙≡* : ∀ {A : Set} {a : A} → ∀ (α β : Ω (refl a)) → α ∙ β ≡ α * β ∙≡* {_} {a} α β = inv (redua) where redul : α * β ≡ α ∙ (pwl (refl a) β) redul = (pwr (pwl (refl a) β) (pwr-ru (refl a) α)) ∙ (pwr (pwl (refl a) β) (right_unit α)) redua : α * β ≡ α ∙ β redua = (redul ∙ (pwl α (pwl-lu (refl a) β))) ∙ (pwl α (right_unit β)) *'≡∙ : ∀ {A : Set} {a : A} → ∀ (α β : Ω (refl a)) → α *' β ≡ β ∙ α *'≡∙ {_} {a} α β = redua' where redul' : α *' β ≡ β ∙ (pwr (refl a) α) redul' = (pwr (pwr (refl a) α) (pwl-lu (refl a) β)) ∙ (pwr (pwr (refl a) α) (right_unit β)) redua' : α *' β ≡ β ∙ α redua' = redul' ∙ ((pwl β (pwr-ru (refl a) α)) ∙ (pwl β (right_unit α))) -- finally, we are able to prove that the higher path group is commutative Ω²-comm : ∀ {A : Set} {a : A} → ∀ (α β : Ω (refl a)) → α ∙ β ≡ β ∙ α Ω²-comm α β = ((∙≡* α β) ∙ (*≡*' α β)) ∙ (*'≡∙ α β) -- ------------------------------------ -- functions behave functorially -- the action on paths ap : ∀ {A B : Set} {x y : A} → ∀ (f : A → B) (p : x ≡ y) → f x ≡ f y ap {_} {_} {x} {x} f (refl x) = refl (f x) -- ap acts like a functor ap∙ : ∀ {A B : Set} {x y z : A} → ∀ (f : A → B) (p : x ≡ y) (q : y ≡ z) → ap f (p ∙ q) ≡ (ap f p) ∙ (ap f q) ap∙ {_} {_} {x} {x} {x} f (refl x) (refl x) = inv (left_unit (refl (f x))) apinv : ∀ {A B : Set} {x y : A} → ∀ (f : A → B) (p : x ≡ y) → ap f (inv p) ≡ inv (ap f p) apinv {_} {_} {x} {x} f (refl x) = refl (refl (f x)) apcomp : ∀ {A B C : Set} {x y : A} → ∀ (f : A → B) (g : B → C) (p : x ≡ y) → ap g (ap f p) ≡ ap (comp g f) p apcomp {_} {_} {_} {x} {x} f g (refl x) = refl (refl (g (f x))) apid : ∀ {A : Set} {x y : A} → ∀ (p : x ≡ y) → ap id p ≡ p apid {_} {x} {x} (refl x) = refl (refl x) -- the transport action, which is action on dependent types tr : ∀ {A : Set} {B : A → Set} → ∀ {x y : A} → ∀ (p : x ≡ y) → B x → B y tr {A} {B} {x} {x} (refl x) = id <<<<<<< HEAD ======= trc : ∀ {A B : Set} {x y : A} (p : x ≡ y) (b : B) → tr {A} {λ x → B} p b ≡ b trc {_} {_} {x} {x} (refl x) b = refl b >>>>>>> a0dc66dca08059f740d9290f3d1cad1bb007d721 -- If you think about this, this is not obvious from a classical point of view. -- The existence of the transport function tells us that the dependent type -- B : A → Set is always going to be continuous, since whenever we have a path -- in the base A from x to y, and whenever we're given a point in B x, we can -- construct a value in B y, using the path in the base. -- path lifting lift : ∀ {A : Set} {B : A → Set} → ∀ {x y : A} → ∀ (p : x ≡ y) → ∀ (b : B x) → (x , b) ≡ y , (tr {A} {B} p b) lift {A} {B} {x} {x} (refl x) b = refl (x , b) -- the dependent mapping functor <<<<<<< HEAD apd : ∀ {A : Set} {B : A → Set} {x y : A} → ∀ (f : (∀ (a : A) → B a)) → ∀ (p : x ≡ y) → tr {A} {B} {x} {y} p (f x) ≡ f y apd {A} {B} {x} {x} f (refl x) = refl (tr {A} {B} {x} {x} (refl x) (f x)) -- the dependent and non-dependent ap(d) is closely related trc : ∀ {A B : Set} {x y : A} (p : x ≡ y) (b : B) → tr {A} {λ x → B} p b ≡ b trc {_} {_} {x} {x} (refl x) b = refl b -- and now we can prove the following: apd≡ap : ∀ {A B : Set} {x y : A} → ∀ (f : A → B) (p : x ≡ y) → apd f p ≡ trc p (f x) ∙ (ap f p) apd≡ap {_} {_} {x} {x} f (refl x) = refl (refl (f x)) -- some useful properties about transport tr∙ : ∀ {A : Set} {B : A → Set} {x y z : A} → ∀ (p : x ≡ y) (q : y ≡ z) → ∀ (b : B x) → tr {A} {B} q (tr {A} {B} p b) ≡ tr {A} {B} (p ∙ q) b tr∙ {_} {_} {x} {x} {x} (refl x) (refl x) b = refl b trcomp : ∀ {A B : Set} {P : B → Set} {x y : A} → ∀ (f : A → B) (p : x ≡ y) → ∀ (b : P (f x)) → tr {A} {λ a → P (f a)} p b ≡ tr {B} {P} (ap f p) b trcomp {_} {_} {_} {x} {x} f (refl x) b = refl b trhi : ∀ {A : Set} {P Q : A → Set} {x y : A} → ∀ (f : ∀ (x : A) → P x → Q x) → ∀ (p : x ≡ y) (b : P x) → f y (tr {A} {P} p b) ≡ tr {A} {Q} p (f x b) trhi {_} {_} {_} {x} {x} f (refl x) b = refl (f x b) ======= apd : ∀ {A : Set} {B : A → Set} → ∀ (f : (∀ (a : A) → B a)) → ∀ (x y : A) (p : x ≡ y) → tr {A} {B} {x} {y} p (f x) ≡ f y apd {A} {B} f x x (refl x) = refl (tr {A} {B} {x} {x} (refl x) (f x)) -- apd helps to construct a >>>>>>> a0dc66dca08059f740d9290f3d1cad1bb007d721
microbit_v20/read_temperature/src/lsm303agr.adb
KLOC-Karsten/ada_projects
0
6515
-- Copyright (c) 2021, <NAME> (<EMAIL>) -- 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. -- -- 3. Neither the name of the copyright holder nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -- WHETHER IN CONTRACT, STRICT LIABILITY, -- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -- USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- Initial contribution by: -- AdaCore -- Ada Drivers Library (https://github.com/AdaCore/Ada_Drivers_Library) -- Package: MMA8653 with Ada.Unchecked_Conversion; package body LSM303AGR is function Read_Register (This : LSM303AGR_Accelerometer'Class; Addr : Register_Addresss) return UInt8; procedure Write_Register (This : LSM303AGR_Accelerometer'Class; Addr : Register_Addresss; Val : UInt8); ------------------- -- Read_Register -- ------------------- function Read_Register (This : LSM303AGR_Accelerometer'Class; Addr : Register_Addresss) return UInt8 is Data : I2C_Data (1 .. 1); Status : I2C_Status; begin This.Port.Mem_Read (Addr => Device_Address, Mem_Addr => UInt16 (Addr), Mem_Addr_Size => Memory_Size_8b, Data => Data, Status => Status); if Status /= Ok then -- No error handling... raise Program_Error; end if; return Data (Data'First); end Read_Register; -------------------- -- Write_Register -- -------------------- procedure Write_Register (This : LSM303AGR_Accelerometer'Class; Addr : Register_Addresss; Val : UInt8) is Status : I2C_Status; begin This.Port.Mem_Write (Addr => Device_Address, Mem_Addr => UInt16 (Addr), Mem_Addr_Size => Memory_Size_8b, Data => (1 => Val), Status => Status); if Status /= Ok then -- No error handling... raise Program_Error; end if; end Write_Register; procedure Configure (This : in out LSM303AGR_Accelerometer; Dyna_Range : Dynamic_Range; Rate : Data_Rate) is begin -- Place the device into normal (10 bit) mode, with all axes enabled at -- the nearest supported data rate to that requested. Write_Register (This, CTRL_REG1_A, Rate'Enum_Rep + 16#07#); -- Enable the DRDY1 interrupt on INT1 pin. Write_Register (This, CTRL_REG3_A, 16#10#); -- Select the g range to that requested, using little endian data format -- and disable self-test and high rate functions. Write_Register (This, CTRL_REG4_A, 16#80# + Dyna_Range'Enum_Rep); end Configure; --------------------- -- Check_Device_Id -- --------------------- function Check_Device_Id (This : LSM303AGR_Accelerometer) return Boolean is begin return Read_Register (This, Who_Am_I) = Device_Id; exception when Program_Error => return False; end Check_Device_Id; --------------------------------- -- Enable_Temperature_Sensor -- --------------------------------- procedure Enable_Temperature_Sensor (This : LSM303AGR_Accelerometer; Enabled : Boolean) is Val : UInt8 := 0; begin if Enabled then Val := 2#1100_0000#; end if; Write_Register (This, TEMP_CFG_REG_A, Val); end Enable_Temperature_Sensor; function Get_Temp_Config (This : LSM303AGR_Accelerometer) return Uint8 is begin return Read_Register (This, TEMP_CFG_REG_A); end Get_Temp_Config; function Get_Ctrl_Reg_4 (This : LSM303AGR_Accelerometer) return Uint8 is begin return Read_Register (This, CTRL_REG4_A); end Get_Ctrl_Reg_4; ------------------------ -- Read_Temperature -- ------------------------ function To_Temperature is new Ada.Unchecked_Conversion (UInt8, Integer_8); function Read_Temperature (This : LSM303AGR_Accelerometer) return Temp_Celsius is Status : I2C_Status; Data : I2C_Data (1 .. 2); begin This.Port.Mem_Read (Addr => Device_Address, Mem_Addr => UInt16 (OUT_TEMP_L_A + 16#80#), Mem_Addr_Size => Memory_Size_8b, Data => Data, Status => Status); if Status /= Ok then -- No error handling... raise Program_Error; end if; return Temp_Celsius (25 + To_Temperature (Data (2))); end Read_Temperature; --------------- -- Read_Data -- --------------- function To_Axis_Data is new Ada.Unchecked_Conversion (UInt10, Axis_Data); function Read_Data (This : LSM303AGR_Accelerometer) return All_Axes_Data is function Convert (MSB, LSB : UInt8) return Axis_Data; ------------- -- Convert -- ------------- function Convert (MSB, LSB : UInt8) return Axis_Data is Tmp : UInt10; begin Tmp := UInt10 (Shift_Right (LSB, 6)); Tmp := Tmp or UInt10 (MSB) * 2**2; return To_Axis_Data (Tmp); end Convert; Status : I2C_Status; Data : I2C_Data (1 .. 7); Ret : All_Axes_Data; begin This.Port.Mem_Read (Addr => Device_Address, Mem_Addr => UInt16 (DATA_STATUS + 16#80#), Mem_Addr_Size => Memory_Size_8b, Data => Data, Status => Status); if Status /= Ok then -- No error handling... raise Program_Error; end if; Ret.X := Convert (Data (3), Data (2)); Ret.Y := Convert (Data (5), Data (4)); Ret.Z := Convert (Data (7), Data (6)); return Ret; end Read_Data; end LSM303AGR;
src/fastpbkdf2_generic.adb
AntonMeep/fastpbkdf2_ada
0
28274
pragma Ada_2012; with Interfaces; with Interfaces.C; with fastpbkdf2_h_generic; package body Fastpbkdf2_Generic is package fastpbkdf2 is new fastpbkdf2_h_generic (Element, Interfaces.Unsigned_32, Interfaces.C.size_t); use fastpbkdf2; procedure PBKDF2_HMAC_SHA1 (Password : Element_Array; Salt : Element_Array; Iterations : Natural; Output : out Element_Array) is begin fastpbkdf2_hmac_sha1 (Password (Password'First)'Access, Password'Length, Salt (Salt'First)'Access, Salt'Length, Interfaces.Unsigned_32 (Iterations), Output (Output'First)'Access, Output'Length); end PBKDF2_HMAC_SHA1; function PBKDF2_HMAC_SHA1 (Password : Element_Array; Salt : Element_Array; Iterations : Natural) return Element_Array is Output : Element_Array (Index'Max (Index'First, 0) .. Index'Max (Index'First, 0) + 19) := (others => Element'First); begin PBKDF2_HMAC_SHA1 (Password, Salt, Iterations, Output); return Output; end PBKDF2_HMAC_SHA1; procedure PBKDF2_HMAC_SHA256 (Password : Element_Array; Salt : Element_Array; Iterations : Natural; Output : out Element_Array) is begin fastpbkdf2_hmac_sha256 (Password (Password'First)'Access, Password'Length, Salt (Salt'First)'Access, Salt'Length, Interfaces.Unsigned_32 (Iterations), Output (Output'First)'Access, Output'Length); end PBKDF2_HMAC_SHA256; function PBKDF2_HMAC_SHA256 (Password : Element_Array; Salt : Element_Array; Iterations : Natural) return Element_Array is Output : Element_Array (Index'Max (Index'First, 0) .. Index'Max (Index'First, 0) + 31) := (others => Element'First); begin PBKDF2_HMAC_SHA256 (Password, Salt, Iterations, Output); return Output; end PBKDF2_HMAC_SHA256; procedure PBKDF2_HMAC_SHA512 (Password : Element_Array; Salt : Element_Array; Iterations : Natural; Output : out Element_Array) is begin fastpbkdf2_hmac_sha512 (Password (Password'First)'Access, Password'Length, Salt (Salt'First)'Access, Salt'Length, Interfaces.Unsigned_32 (Iterations), Output (Output'First)'Access, Output'Length); end PBKDF2_HMAC_SHA512; function PBKDF2_HMAC_SHA512 (Password : Element_Array; Salt : Element_Array; Iterations : Natural) return Element_Array is Output : Element_Array (Index'Max (Index'First, 0) .. Index'Max (Index'First, 0) + 63) := (others => Element'First); begin PBKDF2_HMAC_SHA512 (Password, Salt, Iterations, Output); return Output; end PBKDF2_HMAC_SHA512; end Fastpbkdf2_Generic;
oeis/181/A181732.asm
neoneye/loda-programs
11
11762
; A181732: Numbers n such that 90n + 1 is prime. ; Submitted by <NAME>(s4) ; 2,3,6,7,9,11,13,17,18,20,24,25,26,28,31,33,34,37,39,41,45,47,51,54,55,62,65,68,69,70,72,73,74,76,84,86,89,90,91,94,96,97,98,100,101,102,107,108,109,110,117,119,121,123,124,125,130,133,136,138,139,140,142,149,151,152,158,160,165,167,168,171,174,179,182,184,185,186,187,188,189,191,195,199,202,205,206,212,216,217,220,221,223,224,226,227,228,229,234,240 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,1 mov $3,$1 mul $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,30 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 mul $4,3 lpe mov $0,$1 div $0,30 sub $0,1
ASM_x86/LinuxAPI_18_fork.asm
XlogicX/Learn
43
86594
; Mostly an example of the fork API, also uses waitpid and execve for better illustration ; API calls found in this example program: ; fork, waitpid, execve, write, exit ; High level description of what theis example program does: ; Forks ; The parent waits for the child and prints a message when done ; prints a message and then executes /bin/ps before returning to parent section .text global _start _start: ; Fork ;------------------------------------------------------------------------------ mov eax, 2 ; fork() int 0x80 ; Return on failure is -1 ; Return is 0 if child ; Return is the pid of child if parent cmp eax, 0 ; Compare to child value jz child ; Go to child process if so parent: ; otherwise your the parent with pid of child in eax ; Wait for child mov ebx, eax ; Get that pid into ebx, we need it mov eax, 7 ; waitpid() int 0x80 ; Let STDOUT know you're the parent mov eax, 4 ; write() mov ebx, 1 ; STDOUT mov ecx, parent_msg ; Message for parent mov edx, 11 ; Message length int 0x80 ; Bail jmp exit child: ; Let STDOUT know you're the child mov eax, 4 ; write() mov ebx, 1 ; STDOUT mov ecx, child_msg ; Message for child mov edx, 10 ; Message length int 0x80 ; Execute a shell command mov eax, 11 ; execve() mov ebx, command ; command to execute mov ecx, args ; arguments (none) mov edx, env ; enviornment (none) int 0x80 ; Bail (but parent waiting on this) jmp exit ; Exit ;------------------------------------------------------------------------------ exit: mov eax, 1 ; exit mov ebx, 0 ; null argument to exit int 0x80 section .data child_msg db 'Ima Child', 0x0a parent_msg db 'Ima Parent', 0x0a command db '/bin/ps', 0x00 args dd command env db 0x00,0x00,0x00,0x00
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/bias/bias.adb
TheSledgeHammer/2.11BSD
3
14342
<gh_stars>1-10 -- Copyright 2019-2020 Free Software Foundation, Inc. -- -- This program 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 3 of the License, or -- (at your option) any later version. -- -- This program 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, see <http://www.gnu.org/licenses/>. with Pck; use Pck; procedure Bias is type Small is range -7 .. -4; for Small'Size use 2; Y : Small := -5; Y1 : Small := -7; type Repeat_Count_T is range 1 .. 2 ** 6; for Repeat_Count_T'Size use 6; X : Repeat_Count_T := 64; X1 : Repeat_Count_T := 1; type Char_Range is range 65 .. 68; for Char_Range'Size use 2; Cval : Char_Range := 65; type Some_Packed_Record is record R: Small; S: Small; end record; pragma Pack (Some_Packed_Record); SPR : Some_Packed_Record := (R => -4, S => -5); type Packed_Array is array (1 .. 3) of Small; pragma pack (Packed_Array); A : Packed_Array := (-7, -5, -4); begin Do_Nothing (Y'Address); -- STOP Do_Nothing (Y1'Address); Do_Nothing (X'Address); Do_Nothing (X1'Address); Do_Nothing (Cval'Address); Do_Nothing (SPR'Address); Do_Nothing (A'Address); end Bias;
programs/oeis/022/A022289.asm
neoneye/loda
22
84266
; A022289: a(n) = n*(31*n + 1)/2. ; 0,16,63,141,250,390,561,763,996,1260,1555,1881,2238,2626,3045,3495,3976,4488,5031,5605,6210,6846,7513,8211,8940,9700,10491,11313,12166,13050,13965,14911,15888,16896,17935,19005,20106,21238,22401,23595,24820,26076,27363,28681,30030,31410,32821,34263,35736,37240,38775,40341,41938,43566,45225,46915,48636,50388,52171,53985,55830,57706,59613,61551,63520,65520,67551,69613,71706,73830,75985,78171,80388,82636,84915,87225,89566,91938,94341,96775,99240,101736,104263,106821,109410,112030,114681,117363,120076,122820,125595,128401,131238,134106,137005,139935,142896,145888,148911,151965 mul $0,-31 bin $0,2 div $0,31
reveal.scpt
thekoc/devonthink-search-launchbar
16
1984
<reponame>thekoc/devonthink-search-launchbar on run argv tell application "DEVONthink 3" local theRecord, theParent set theUuid to item 1 of argv set theRecord to get record with uuid theUuid set theParent to item 1 of (parents of theRecord) set theWindow to open window for record theParent set myList to {theRecord} set theWindow's selection to myList end tell end run
Cubical/HITs/SetTruncation.agda
dan-iel-lee/cubical
0
2126
<filename>Cubical/HITs/SetTruncation.agda {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.SetTruncation where open import Cubical.HITs.SetTruncation.Base public open import Cubical.HITs.SetTruncation.Properties public
oeis/020/A020332.asm
neoneye/loda-programs
11
81189
; A020332: Numbers whose base-4 representation is the juxtaposition of two identical strings. ; 5,10,15,68,85,102,119,136,153,170,187,204,221,238,255,1040,1105,1170,1235,1300,1365,1430,1495,1560,1625,1690,1755,1820,1885,1950,2015,2080,2145,2210,2275,2340,2405,2470,2535,2600,2665,2730,2795,2860,2925,2990,3055,3120,3185,3250,3315,3380,3445,3510,3575,3640,3705,3770,3835,3900,3965,4030,4095,16448,16705,16962,17219,17476,17733,17990,18247,18504,18761,19018,19275,19532,19789,20046,20303,20560,20817,21074,21331,21588,21845,22102,22359,22616,22873,23130,23387,23644,23901,24158,24415,24672,24929 add $0,1 mov $1,$0 mov $2,$0 lpb $1 mul $0,4 div $1,4 lpe add $0,$2
kernel/kernel_entry.asm
bagur/KalioOS
0
91985
<gh_stars>0 ; KalioOS (C) 2020 <NAME> ; ; We are jumping to whatever is at KERNEL_OFFSET and therefore we ; are too dependant on ordering of elements (functions, data etc) ; ; Place this at KERNEL_OFFSET and then we'll always jump to our main code ; The linker will place our call to main, with the correct address (depending ; on where main ends up in the linked file) [bits 32] [extern main] ; Define calling point. Must have same name as kernel.c 'main' function call main ; Calls the C function. The linker will know where it is placed in memory jmp $
programs/oeis/319/A319861.asm
jmorken/loda
1
167680
<filename>programs/oeis/319/A319861.asm ; A319861: Triangle read by rows, 0 <= k <= n: T(n,k) is the numerator of the k-th Bernstein basis polynomial of degree n evaluated at the interval midpoint t = 1/2; denominator is A319862. ; 1,1,1,1,1,1,1,3,3,1,1,1,3,1,1,1,5,5,5,5,1,1,3,15,5,15,3,1,1,7,21,35,35,21,7,1,1,1,7,7,35,7,7,1,1,1,9,9,21,63,63,21,9,9,1,1,5,45,15,105,63,105,15,45,5,1,1,11,55,165,165,231,231,165,165 cal $0,7318 ; Pascal's triangle read by rows: C(n,k) = binomial(n,k) = n!/(k!*(n-k)!), 0 <= k <= n. lpb $0 dif $0,2 lpe mov $1,$0
src/lab-code/cpu-affinity/src/main.adb
hannesb0/rtpl18
0
8956
with Dispatch; with System.Multiprocessors.Dispatching_Domains; use System.Multiprocessors.Dispatching_Domains; procedure Main is begin Set_CPU(1); for i in 1 .. 100 loop delay 1.0; end loop; end Main;
src/fltk-images-rgb-jpeg.ads
micahwelf/FLTK-Ada
1
7829
<reponame>micahwelf/FLTK-Ada package FLTK.Images.RGB.JPEG is type JPEG_Image is new RGB_Image with private; type JPEG_Image_Reference (Data : not null access JPEG_Image'Class) is limited null record with Implicit_Dereference => Data; package Forge is function Create (Filename : in String) return JPEG_Image; end Forge; private type JPEG_Image is new RGB_Image with null record; overriding procedure Finalize (This : in out JPEG_Image); end FLTK.Images.RGB.JPEG;
src/io/include.asm
jhm-ciberman/calculator-asm
2
94118
<reponame>jhm-ciberman/calculator-asm<gh_stars>1-10 include 'InputBufferAddChar.asm' include 'InputBufferRemoveChar.asm' include 'InputBufferClear.asm' include 'InputOnChar.asm' include 'InputOnKeyDown.asm' include 'InputOnMouseWheel.asm' include 'OutputBufferAddString.asm' include 'OutputBufferAddChar.asm' include 'OutputBufferClear.asm'
src/main/fragment/mos6502-common/vbsaa=vbuc1_plus_vbsaa.asm
jbrandwood/kickc
2
22304
<gh_stars>1-10 clc adc #{c1}
tests/covered/exampleEquivalenceLambdaNotations2.agda
andrejtokarcik/agda-semantics
3
12128
module exampleEquivalenceLambdaNotations2 where postulate A : Set g : A -> A g = \x -> x g' : A -> A g' a = a postulate P : (A -> A) -> Set f : P g -> P g' f x = x
PDF List of Quark Files.applescript
AlexanderGalen/applescripts
3
2043
--there's gotta be a better way to do this, I just didn't have time to figure it out. tell application "Finder" set FinishedPath to "HOM:PRODUCTS:CALENDARS:2015 CALENDARS:2015 Calendar Pads:~PRINT FILES CORRECTIONS:" set CalPads to "HOM:PRODUCTS:CALENDARS:2015 CALENDARS:2015 Calendar Pads:" set file7 to CalPads & "7.Fresh and Healthy:2015.FreshandHealthy.qxp" set file8 to CalPads & "8.Cupcakes:2015.Cupcakes.qxp" set file9 to CalPads & "9.Scenic America:2015.Scenic_America.qxp" set file10 to CalPads & "10.HOME QUOTES:2015.HomeQuotes.qxp" set FileList to {file7, file8, file9, file10} as alias list end tell tell application "QuarkXPress" repeat with theItem in FileList open file theItem set theName to name of document 1 set theLength to length of theName set theName to characters 1 thru (theLength - 4) of theName set FinishedPDFName to FinishedPath & theName & ".pdf" export layout space 1 of project 1 in FinishedPDFName as "PDF" PDF output style "No Compression Print" close document 1 without saving end repeat end tell
alloy4fun_models/trashltl/models/17/v6LDLNzgq8vK2g8xp.als
Kaixi26/org.alloytools.alloy
0
1377
<reponame>Kaixi26/org.alloytools.alloy open main pred idv6LDLNzgq8vK2g8xp_prop18 { always all p: Protected | p not in Protected implies before p in Trash } pred __repair { idv6LDLNzgq8vK2g8xp_prop18 } check __repair { idv6LDLNzgq8vK2g8xp_prop18 <=> prop18o }
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/empty_package.ads
ouankou/rose
488
30208
package Empty_Package is end Empty_Package;
programs/oeis/047/A047972.asm
neoneye/loda
22
14084
; A047972: Distance of n-th prime to nearest square. ; 1,1,1,2,2,3,1,3,2,4,5,1,5,6,2,4,5,3,3,7,8,2,2,8,3,1,3,7,9,8,6,10,7,5,5,7,12,6,2,4,10,12,5,3,1,3,14,2,2,4,8,14,15,5,1,7,13,15,12,8,6,4,17,13,11,7,7,13,14,12,8,2,6,12,18,17,11,3,1,9,19,20,10,8,2,2,8,16,20,21,17,5,3,7,15,19,20,8,6,12 seq $0,40 ; The prime numbers. seq $0,53188 ; Distance from n to nearest square.
examples/tactics/ac/List.agda
shlevy/agda
1,989
9583
<filename>examples/tactics/ac/List.agda module List where import Bool open Bool infixr 15 _::_ data List (A : Set) : Set where [] : List A _::_ : A -> List A -> List A module Eq {A : Set}(_=A=_ : A -> A -> Bool) where infix 10 _==_ _==_ : List A -> List A -> Bool [] == [] = true x :: xs == y :: ys = (x =A= y) && xs == ys [] == _ :: _ = false _ :: _ == [] = false module Subst {A : Set}(_=A=_ : A -> A -> Bool) (substA : {x y : A} -> (P : A -> Set) -> IsTrue (x =A= y) -> P x -> P y) where module EqA = Eq _=A=_ open EqA subst : {xs ys : List A} -> (P : List A -> Set) -> IsTrue (xs == ys) -> P xs -> P ys subst {[] } {_ :: _ } _ () _ subst {_ :: _ } {[] } _ () _ subst {[] } {[] } P eq pxs = pxs subst {x :: xs} {y :: ys} P eq pxs = substA (\z -> P (z :: ys)) x==y ( subst (\zs -> P (x :: zs)) xs==ys pxs ) where x==y : IsTrue (x =A= y) x==y = isTrue&&₁ {x =A= y}{xs == ys} eq xs==ys : IsTrue (xs == ys) xs==ys = isTrue&&₂ {x =A= y}{xs == ys} eq
gene_mentions/gm/gmParser.g4
hiplot/pathway-figure-ocr
2
5591
<reponame>hiplot/pathway-figure-ocr<gh_stars>1-10 parser grammar gmParser; options { tokenVocab=gmLexer; } gmentries : gms (NEWLINE gms)* NEWLINE? EOF? ; gms : gm ( ENUMSEP gm )* ; gm : (gm_R1_R2 | gm_range_with_base_repeated | gm_compound) ; // TODO: this doesn't guarantee base1 == base2 gm_range_with_base_repeated : base1=WORD start=INTEGER RANGESEP base2=WORD end=INTEGER ; // like AdipoR1/R2 // TODO: what if it's AdipoA1/R2 ? gm_R1_R2 : base=GM_R1_R2_BASE enum_suffix+=LETTER_UPPER_INTEGER ENUMSEP enum_suffix+=LETTER_UPPER_INTEGER ; gm_compound : base=WORD suffixes* ; suffixes : ((( enum_suffix=enum_suffix_typical ENUMSEP )* range_suffix ( ENUMSEP range_suffix )* ( ENUMSEP enum_suffix=enum_suffix_typical )*)+ | enum_suffix_plus_sep+) ; range_suffix : start=INTEGER RANGESEP end=INTEGER; enum_suffix_plus_sep : (enum_suffix=enum_suffix_typical ENUMSEP?) ; enum_suffix_typical : ((INTEGER WORD+?) | INTEGER | WORD+?) ;
programs/oeis/335/A335115.asm
neoneye/loda
22
80076
<filename>programs/oeis/335/A335115.asm ; A335115: a(2*n) = 2*n - a(n), a(2*n+1) = 2*n + 1. ; 1,1,3,3,5,3,7,5,9,5,11,9,13,7,15,11,17,9,19,15,21,11,23,15,25,13,27,21,29,15,31,21,33,17,35,27,37,19,39,25,41,21,43,33,45,23,47,33,49,25,51,39,53,27,55,35,57,29,59,45,61,31,63,43,65,33,67,51,69,35,71,45,73,37,75,57,77,39,79,55,81,41,83,63,85,43,87,55,89,45,91,69,93,47,95,63,97,49,99,75 add $0,1 mov $2,2 lpb $0 dif $0,$2 add $1,$0 div $0,$2 gcd $2,$1 lpe mov $0,$1
Ada/exception/catch_error.adb
egustafson/sandbox
2
29048
with Ada.Text_IO, Ada.Integer_Text_IO; use Ada.Text_IO, Ada.Integer_Text_IO; procedure Catch_Error is subtype Small_Integer is Integer range 0 .. 1000; Result : Small_Integer; Multiplicand : Small_Integer; begin Multiplicand := 2; -- The following should evaluate to an out of range value -- and thus should raise the Constraint_Error exception. Result := Small_Integer'Last * Multiplicand; Put("The result of multiplying "); Put(Small_Integer'Last); Put(" and "); Put(Multiplicand); Put(" is "); Put(Result); Put_Line("."); exception when Constraint_Error => Put("The result was out of the range "); Put(Small_Integer'First); Put(" .. "); Put(Small_Integer'Last); Put_Line("."); end Catch_Error;
Managers/vdpmanager.asm
SavagePencil/SMSFramework
0
82797
.IFNDEF __VDP_MANAGER_ASM__ .DEFINE __VDP_MANAGER_ASM__ .INCLUDE "Utils/vdp.asm" .INCLUDE "Utils/vdpregisters.asm" ; Maintains a copy of the VDP registers .STRUCT sVDPRegisterShadow .UNION Register0 DB .NEXTU VideoModeControl1 DB ; Interrupts, scroll behavior, etc. .ENDU .UNION Register1 DB .NEXTU VideoModeControl2 DB ; Sprites, display state, etc. .ENDU .UNION Register2 DB .NEXTU NameTableAddress DB ; Where the name table (tilemap) lives .ENDU .UNION Register3 DB .NEXTU ColorTableAddress DB ; Where colors live (no effect) .ENDU .UNION Register4 DB .NEXTU BGPatternAddress DB ; Where BG patterns live (no effect) .ENDU .UNION Register5 DB .NEXTU SpriteTableAddress DB ; Where data on active sprites lives .ENDU .UNION Register6 DB .NEXTU SpriteTileAddress DB ; Where sprite tiles originate .ENDU .UNION Register7 DB .NEXTU OverscanColor DB ; Which sprite pal entry is the overscan .ENDU .UNION Register8 DB .NEXTU ScrollX DB ; Horizontal scroll .ENDU .UNION Register9 DB .NEXTU ScrollY DB ; Vertical scroll .ENDU .UNION Register10 DB .NEXTU HBlankCounter DB ; Line counter for HBlank timing .ENDU .ENDST .STRUCT sVDPPalette BGOnlyPalette DSB 16 ; First palette can only be used by the BG SpritePalette DSB 16 ; Second palette can be used by sprite or BG .ENDST ;============================================================================== ; The VDP Manager maintains a local copy of registers so that code can query ; current state without having to go to VRAM (or when the values themselves ; aren't queryable, as in the case of CRAM). ;============================================================================== .STRUCT sVDPManager ; Maintain a shadow copy of each of the VDP registers Registers INSTANCEOF sVDPRegisterShadow ; Maintain a copy of the palettes, since CRAM can't be read Palette INSTANCEOF sVDPPalette .ENDST .RAMSECTION "VDP Manager" SLOT 3 gVDPManager INSTANCEOF sVDPManager .ENDS .SECTION "VDP Manager Init" FREE ;============================================================================== ; VDPManager_Init ; Initializes the global VDPManager. ; INPUTS: None ; OUTPUTS: None ; Does not preserve any registers. ;============================================================================== VDPManager_Init: ; Initialize the VDP registers with some defaults. ld hl, VDPDefaults_Begin ld b, ( VDPDefaults_End - VDPDefaults_Begin ) / 2 ; Count -: ld e, (hl) inc hl ld a, (hl) inc hl push hl call VDPManager_WriteRegisterImmediate pop hl djnz - ; Clear the VRAM ; Set the VRAM address to the start, $0000, and then mask with the command ; to write to VRAM. xor a out (VDP_CONTROL_PORT), a ; Low byte first ld a, $00 | VDP_COMMAND_MASK_VRAM_WRITE out (VDP_CONTROL_PORT), a ; High bits + command ; Now clear 16K of VRAM. ; Each write to the data port increments the address. xor a ld bc, $0040 -: out (VDP_DATA_PORT), a djnz - dec c jr nz, - ; Clear the palette. ld b, VDP_PALETTE_NUM_PALETTES * VDP_PALETTE_ENTRIES_PER_PALETTE ld c, 0 ; Color 0 -: ld e, b dec e ; Entry is 0..31 call VDPManager_SetPaletteEntryImmediate djnz - ret ; Some VDP defaults. VDPDefaults_Begin: ; R0: Start in standard SMS mode 4. No interrupts. .db VDP_COMMMAND_MASK_REGISTER0, VDP_REGISTER0_REQUIRED_MASK | VDP_REGISTER0_MODE_4_SELECT ; R1: Display is OFF. Regular 256x192 mode. .db VDP_COMMMAND_MASK_REGISTER1, VDP_REGISTER1_REQUIRED_MASK ; R2: Set Name Table to loc specified in VDP Memory Map .db VDP_COMMMAND_MASK_REGISTER2, VDP_REGISTER2_REQUIRED_MASK | ( VDP_NAMETABLE_START_LOC >> 10 ) ; R3: Nothing special .db VDP_COMMMAND_MASK_REGISTER3, VDP_REGISTER3_REQUIRED_MASK ; R4: Nothing special .db VDP_COMMMAND_MASK_REGISTER4, VDP_REGISTER4_REQUIRED_MASK ; R5: SAT at loc indicated from the VDP Memory Map. .db VDP_COMMMAND_MASK_REGISTER5, VDP_REGISTER5_REQUIRED_MASK | ( VDP_SAT_START_LOC >> 7 ) ; R6: Sprite generator at 0x0000. Sprite tiles draw from the lower 8K. .db VDP_COMMMAND_MASK_REGISTER6, VDP_REGISTER6_REQUIRED_MASK | VDP_REGISTER6_SPRITEGENERATOR_0x0000 ; R7: Use Sprite Pal Entry 0 as Overdraw color. .db VDP_COMMMAND_MASK_REGISTER7, VDP_REGISTER7_REQUIRED_MASK ; R8: X Scroll is 0 .db VDP_COMMMAND_MASK_REGISTER8, VDP_REGISTER8_REQUIRED_MASK ; R9: Y Scroll is 0 .db VDP_COMMMAND_MASK_REGISTER9, VDP_REGISTER9_REQUIRED_MASK ; R10: Line interrupt is 0 .db VDP_COMMMAND_MASK_REGISTER10, VDP_REGISTER10_REQUIRED_MASK VDPDefaults_End .ENDS .SECTION "VDP Manager Write Register Immediate" FREE ;============================================================================== ; VDPManager_WriteRegisterImmediate ; Immediately sets a register value, and maintains a shadow copy of it. ; INPUTS: E: Register to set ; A: Value to set ; OUTPUTS: None ; Destroys D, HL, A. ;============================================================================== VDPManager_WriteRegisterImmediate: ; Store to the shadow register first. ld d, 0 ld hl, gVDPManager.Registers add hl, de ld (hl), a jp VDP_WriteRegister .ENDS .SECTION "VDP Manager Set Palette Entry Immediate" FREE ;============================================================================== ; VDPManager_SetPaletteEntryImmediate ; Immediately sets a palette entry, and maintains a shadow copy of it. ; INPUTS: E: Entry to set (0..31) ; C: Color value to set ; OUTPUTS: None ; Destroys A, D, HL. ;============================================================================== VDPManager_SetPaletteEntryImmediate: ; Store to the shadow register first ld d, 0 ld hl, gVDPManager.Palette add hl, de ld (hl), c jp VDP_SetPaletteEntry .ENDS .SECTION "VDP Manager Set Palette Entries Immediate" FREE ;============================================================================== ; VDPManager_SetPaletteEntriesImmediate ; Immediately sets a series of palette entries, and updates shadow entries. ; INPUTS: C: Index of first palette entry to fill ; A: Count of entries to update ; DE: Pointer to palette data ; OUTPUTS: B is 0 ; Destroys A, BC, DE, HL. ;============================================================================== VDPManager_SetPaletteEntriesImmediate ; Get index to shadow registers. ld hl, gVDPManager.Palette ld b, 0 add hl, bc ; HL points to the first shadow register ld b, a ; Prep our counter ; Now output to the VDP ld a, c out (VDP_CONTROL_PORT), a ; Set pal entry in low byte ld a, VDP_COMMAND_MASK_CRAM_WRITE ; The command out (VDP_CONTROL_PORT), a ; Send the command ; Now set the color values. -: ld a, (de) ; Get the color ld (hl), a ; Set the shadow register out (VDP_DATA_PORT), a inc de inc hl djnz - ret .ENDS .ENDIF ;__VDP_MANAGER_ASM__
audio/sfx/battle_2a.asm
adhi-thirumala/EvoYellow
16
169127
SFX_Battle_2A_Ch1: dutycycle 57 unknownsfx0x20 4, 244, 0, 6 unknownsfx0x20 3, 196, 0, 5 unknownsfx0x20 5, 181, 0, 6 unknownsfx0x20 13, 226, 192, 6 loopchannel 3, SFX_Battle_2A_Ch1 unknownsfx0x20 8, 209, 0, 6 endchannel SFX_Battle_2A_Ch2: dutycycle 141 unknownsfx0x20 5, 228, 224, 5 unknownsfx0x20 4, 180, 224, 4 unknownsfx0x20 6, 165, 232, 5 unknownsfx0x20 14, 209, 160, 6 loopchannel 3, SFX_Battle_2A_Ch2 endchannel SFX_Battle_2A_Ch3: unknownnoise0x20 5, 195, 51 unknownnoise0x20 3, 146, 67 unknownnoise0x20 10, 181, 51 unknownnoise0x20 15, 195, 50 loopchannel 2, SFX_Battle_2A_Ch3 endchannel
src/fltk-widgets-boxes.adb
micahwelf/FLTK-Ada
1
11999
<reponame>micahwelf/FLTK-Ada<gh_stars>1-10 with Interfaces.C, System; use type System.Address; package body FLTK.Widgets.Boxes is procedure box_set_draw_hook (W, D : in System.Address); pragma Import (C, box_set_draw_hook, "box_set_draw_hook"); pragma Inline (box_set_draw_hook); procedure box_set_handle_hook (W, H : in System.Address); pragma Import (C, box_set_handle_hook, "box_set_handle_hook"); pragma Inline (box_set_handle_hook); function new_fl_box (X, Y, W, H : in Interfaces.C.int; Text : in Interfaces.C.char_array) return System.Address; pragma Import (C, new_fl_box, "new_fl_box"); pragma Inline (new_fl_box); procedure free_fl_box (B : in System.Address); pragma Import (C, free_fl_box, "free_fl_box"); pragma Inline (free_fl_box); procedure fl_box_draw (W : in System.Address); pragma Import (C, fl_box_draw, "fl_box_draw"); pragma Inline (fl_box_draw); function fl_box_handle (W : in System.Address; E : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, fl_box_handle, "fl_box_handle"); pragma Inline (fl_box_handle); procedure Finalize (This : in out Box) is begin if This.Void_Ptr /= System.Null_Address and then This in Box'Class then if This.Needs_Dealloc then free_fl_box (This.Void_Ptr); end if; This.Void_Ptr := System.Null_Address; end if; Finalize (Widget (This)); end Finalize; package body Forge is function Create (X, Y, W, H : in Integer; Text : in String) return Box is begin return This : Box do This.Void_Ptr := new_fl_box (Interfaces.C.int (X), Interfaces.C.int (Y), Interfaces.C.int (W), Interfaces.C.int (H), Interfaces.C.To_C (Text)); fl_widget_set_user_data (This.Void_Ptr, Widget_Convert.To_Address (This'Unchecked_Access)); box_set_draw_hook (This.Void_Ptr, Draw_Hook'Address); box_set_handle_hook (This.Void_Ptr, Handle_Hook'Address); end return; end Create; end Forge; procedure Draw (This : in out Box) is begin fl_box_draw (This.Void_Ptr); end Draw; function Handle (This : in out Box; Event : in Event_Kind) return Event_Outcome is begin return Event_Outcome'Val (fl_box_handle (This.Void_Ptr, Event_Kind'Pos (Event))); end Handle; end FLTK.Widgets.Boxes;
test/asset/agda-stdlib-1.0/Function/Reasoning.agda
omega12345/agda-mode
0
11038
------------------------------------------------------------------------ -- The Agda standard library -- -- A module used for creating function pipelines, see -- README.Function.Reasoning for examples ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Function.Reasoning where open import Function using (_∋_) -- Need to give _∋_ a new name as syntax cannot contain underscores infixl 0 ∋-syntax ∋-syntax = _∋_ -- Create ∶ syntax syntax ∋-syntax A a = a ∶ A -- Export pipeline functions open import Function public using (_|>_; _|>′_)
programs/oeis/117/A117590.asm
neoneye/loda
22
87061
<gh_stars>10-100 ; A117590: a(n) = ceiling(x(n)), where x(n) = 3*x(n-1)/2 and x(1) = 1. ; 2,3,5,7,11,16,23,35,52,77,116,173,260,390,584,876,1314,1971,2956,4434,6651,9976,14964,22446,33669,50503,75754,113631,170446,255669,383503,575254,862880,1294320,1941480,2912220,4368329,6552494,9828740,14743110 lpb $0 mov $2,$0 sub $0,1 seq $2,52919 ; a(n) = 1 + 2*3^(n-1) with a(0)=2. add $1,$2 div $1,2 lpe add $1,2 mov $0,$1
Cats/Category.agda
alessio-b-zak/cats
0
6328
module Cats.Category where open import Level import Cats.Category.Base as Base import Cats.Category.Constructions.CCC as CCC import Cats.Category.Constructions.Epi as Epi import Cats.Category.Constructions.Equalizer as Equalizer import Cats.Category.Constructions.Exponential as Exponential import Cats.Category.Constructions.Iso as Iso import Cats.Category.Constructions.Initial as Initial import Cats.Category.Constructions.Mono as Mono import Cats.Category.Constructions.Product as Product import Cats.Category.Constructions.Terminal as Terminal import Cats.Category.Constructions.Unique as Unique Category : ∀ lo la l≈ → Set (suc (lo ⊔ la ⊔ l≈)) Category = Base.Category module Category {lo la l≈} (Cat : Base.Category lo la l≈) where open Base.Category Cat public open Epi.Build Cat public open Equalizer.Build Cat public open Exponential.Build Cat public open Initial.Build Cat public open Iso.Build Cat public open Mono.Build Cat public open Product.Build Cat public open Terminal.Build Cat public open Unique.Build Cat public open CCC public using (IsCCC) open Exponential public using (HasExponentials) open Initial public using (HasInitial) open Product public using ( HasProducts ; HasBinaryProducts ; HasFiniteProducts ; HasProducts→HasBinaryProducts ; HasProducts→HasTerminal ) open Terminal public using (HasTerminal)
content/grammars/antlr/LTLfFormulaParser.g4
marcofavorito/tl-grammars
2
6492
<filename>content/grammars/antlr/LTLfFormulaParser.g4 grammar LTLfFormulaParser; import PropFormulaParser; start : expression EOF ; expression : doubleImplicationTemp ; doubleImplicationTemp : implicationTemp (DOUBLEIMPLY implicationTemp)* ; implicationTemp : xorTemp (IMPLY xorTemp)* ; xorTemp : orTemp (XOR orTemp)* ; orTemp : andTemp (OR andTemp)* ; andTemp : release (AND release)* ; release : weakUntil (WEAKUNTIL weakUntil)* ; weakUntil : strongRelease (RELEASE strongRelease)* ; strongRelease : until (STRONGRELEASE until)* ; until : globally(UNTIL globally)* ; globally : GLOBALLY? eventually ; eventually : EVENTUALLY? weakNext ; weakNext : WEAKNEXT? next_ ; next_ : NEXT? notTemp ; notTemp : ltlfAtom | NOT? LPAREN expression RPAREN ; ltlfAtom : NAME | propositionalFormula ; WEAKUNTIL : ('W'); UNTIL : ('U'); RELEASE : ('R'|'V'); STRONGRELEASE : ('M'); GLOBALLY : ('G'); EVENTUALLY : ('F'); WEAKNEXT : ('X'); NEXT : ('X[!]');
programs/oeis/311/A311196.asm
jmorken/loda
1
28135
<filename>programs/oeis/311/A311196.asm<gh_stars>1-10 ; A311196: Coordination sequence Gal.6.115.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; 1,4,8,12,16,20,25,30,34,38,42,46,50,54,58,62,66,70,75,80,84,88,92,96,100,104,108,112,116,120,125,130,134,138,142,146,150,154,158,162,166,170,175,180,184,188,192,196,200,204 mov $11,$0 mov $13,$0 add $13,1 lpb $13 clr $0,11 mov $0,$11 sub $13,1 sub $0,$13 mov $7,6 add $8,$0 add $6,$8 add $0,$6 add $8,4 lpb $0 mul $7,2 add $7,4 mul $7,2 sub $7,2 mod $8,12 add $8,$7 mov $0,$8 div $0,10 lpe mov $1,$0 add $1,1 add $12,$1 lpe mov $1,$12
Task/Bitmap-B-zier-curves-Quadratic/Ada/bitmap-b-zier-curves-quadratic-1.ada
LaudateCorpus1/RosettaCodeData
1
17646
procedure Quadratic_Bezier ( Picture : in out Image; P1, P2, P3 : Point; Color : Pixel; N : Positive := 20 ) is Points : array (0..N) of Point; begin for I in Points'Range loop declare T : constant Float := Float (I) / Float (N); A : constant Float := (1.0 - T)**2; B : constant Float := 2.0 * T * (1.0 - T); C : constant Float := T**2; begin Points (I).X := Positive (A * Float (P1.X) + B * Float (P2.X) + C * Float (P3.X)); Points (I).Y := Positive (A * Float (P1.Y) + B * Float (P2.Y) + C * Float (P3.Y)); end; end loop; for I in Points'First..Points'Last - 1 loop Line (Picture, Points (I), Points (I + 1), Color); end loop; end Quadratic_Bezier;
data/pokemon/dex_entries/slowpoke.asm
AtmaBuster/pokeplat-gen2
6
244362
<gh_stars>1-10 db "DOPEY@" ; species name db "It is always so" next "absent-minded that" next "it won't react," page "even if its" next "flavorful tail is" next "bitten.@"
programs/oeis/005/A005125.asm
neoneye/loda
22
22357
<gh_stars>10-100 ; A005125: Numbers n such that 8n - 3 is prime. ; 1,2,4,5,7,8,13,14,19,20,22,23,25,29,34,35,37,40,44,47,49,50,53,58,64,68,70,77,82,83,85,88,89,92,95,97,100,103,104,107,110,118,125,127,128,133,134,137,139,140,148,152,154,155,160,163,172,173,179,182,187,194,200,202,203,205,209,212,214,217,218,224,233,235,238,242,244,247,250,254,257,259,268,277,278,280,284,287,289,292,293,295,298,299,305,310,319,320,328,335 mov $1,1 mov $2,$0 pow $2,2 mul $2,2 mov $5,1 lpb $2 add $1,3 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,4 add $1,$5 sub $2,1 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe div $1,2 mul $1,2 sub $1,6 div $1,8 add $1,1 mov $0,$1
programs/oeis/303/A303590.asm
karttu/loda
0
97127
<filename>programs/oeis/303/A303590.asm ; A303590: Floor(n*beta)-1, where 1/alpha+1/beta=1, alpha being the number with continued fraction expansion [1;1,2,3,4,5,...] (A247844). ; 1,3,6,8,11,13,16,18,20,23,25,28,30,33,35,37,40,42,45,47,50,52,54,57,59,62,64,67,69,71,74,76,79,81,84,86,89,91,93,96,98,101,103,106,108,110,113,115,118,120,123,125,127,130,132,135,137,140,142,144,147,149,152,154,157,159,162,164,166,169,171,174,176 mov $3,$0 add $0,6 mov $1,$0 mul $0,2 sub $1,6 add $1,$0 mov $4,6 lpb $0,1 sub $0,1 add $1,5 lpe lpb $4,1 sub $4,1 add $5,5 lpe div $1,$5 sub $1,1 mov $2,$3 mul $2,2 add $1,$2
testsuite/league/normalization_test.adb
svn2github/matreshka
24
11485
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Testsuite Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2009-2011, <NAME> <<EMAIL>> -- -- 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 the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Ada.Command_Line; with League.Application; with League.Strings; with Unicode_Data_File_Parsers; with Unicode_Data_File_Utilities; procedure Normalization_Test is use League.Strings; use Unicode_Data_File_Utilities; Unidata_Directory : constant String := Ada.Command_Line.Argument (1); NormalizationTest_Name : constant String := "NormalizationTest.txt"; type Boolean_Array is array (Natural range <>) of Boolean; for Boolean_Array'Component_Size use Boolean'Size; type Parser is new Unicode_Data_File_Parsers.Unicode_Data_File_Parser with record Chars : Boolean_Array (1 .. 16#10_FFFF#) := (others => False); Part_1 : Boolean := False; end record; overriding procedure Start_Section (Self : in out Parser; Name : String); overriding procedure End_Section (Self : in out Parser); overriding procedure Data (Self : in out Parser; Fields : Unicode_Data_File_Parsers.String_Vectors.Vector); ---------- -- Data -- ---------- overriding procedure Data (Self : in out Parser; Fields : Unicode_Data_File_Parsers.String_Vectors.Vector) is C1 : Universal_String; C2 : Universal_String; C3 : Universal_String; C4 : Universal_String; C5 : Universal_String; begin C1 := To_Universal_String (Parse (Fields.Element (1))); C2 := To_Universal_String (Parse (Fields.Element (2))); C3 := To_Universal_String (Parse (Fields.Element (3))); C4 := To_Universal_String (Parse (Fields.Element (4))); C5 := To_Universal_String (Parse (Fields.Element (5))); -- NFC -- c2 == NFC(c1) == NFC(c2) == NFC(c3) -- c4 == NFC(c4) == NFC(c5) if C2.To_Wide_Wide_String /= C1.To_NFC.To_Wide_Wide_String then raise Program_Error; end if; if C2.To_Wide_Wide_String /= C2.To_NFC.To_Wide_Wide_String then raise Program_Error; end if; if C2.To_Wide_Wide_String /= C3.To_NFC.To_Wide_Wide_String then raise Program_Error; end if; if C4.To_Wide_Wide_String /= C4.To_NFC.To_Wide_Wide_String then raise Program_Error; end if; if C4.To_Wide_Wide_String /= C5.To_NFC.To_Wide_Wide_String then raise Program_Error; end if; -- NFD -- c3 == NFD(c1) == NFD(c2) == NFD(c3) -- c5 == NFD(c4) == NFD(c5) if C3.To_Wide_Wide_String /= C1.To_NFD.To_Wide_Wide_String then raise Program_Error; end if; if C3.To_Wide_Wide_String /= C2.To_NFD.To_Wide_Wide_String then raise Program_Error; end if; if C3.To_Wide_Wide_String /= C3.To_NFD.To_Wide_Wide_String then raise Program_Error; end if; if C5.To_Wide_Wide_String /= C4.To_NFD.To_Wide_Wide_String then raise Program_Error; end if; if C5.To_Wide_Wide_String /= C5.To_NFD.To_Wide_Wide_String then raise Program_Error; end if; -- NFKC -- c4 == NFKC(c1) == NFKC(c2) == NFKC(c3) == NFKC(c4) == NFKC(c5) if C4.To_Wide_Wide_String /= C1.To_NFKC.To_Wide_Wide_String then raise Program_Error; end if; if C4.To_Wide_Wide_String /= C2.To_NFKC.To_Wide_Wide_String then raise Program_Error; end if; if C4.To_Wide_Wide_String /= C3.To_NFKC.To_Wide_Wide_String then raise Program_Error; end if; if C4.To_Wide_Wide_String /= C4.To_NFKC.To_Wide_Wide_String then raise Program_Error; end if; if C4.To_Wide_Wide_String /= C5.To_NFKC.To_Wide_Wide_String then raise Program_Error; end if; -- NFKD -- c5 == NFKD(c1) == NFKD(c2) == NFKD(c3) == NFKD(c4) == NFKD(c5) if C5.To_Wide_Wide_String /= C1.To_NFKD.To_Wide_Wide_String then raise Program_Error; end if; if C5.To_Wide_Wide_String /= C2.To_NFKD.To_Wide_Wide_String then raise Program_Error; end if; if C5.To_Wide_Wide_String /= C3.To_NFKD.To_Wide_Wide_String then raise Program_Error; end if; if C5.To_Wide_Wide_String /= C4.To_NFKD.To_Wide_Wide_String then raise Program_Error; end if; if C5.To_Wide_Wide_String /= C5.To_NFKD.To_Wide_Wide_String then raise Program_Error; end if; if C1.Length = 0 or C2.Length = 0 or C3.Length = 0 then raise Program_Error; end if; if Self.Part_1 then if C1.Length /= 1 then raise Program_Error; end if; Self.Chars (Wide_Wide_Character'Pos (C1.Element (1).To_Wide_Wide_Character)) := True; end if; end Data; ----------------- -- End_Section -- ----------------- overriding procedure End_Section (Self : in out Parser) is X : Universal_String; Skip : Boolean; begin if Self.Part_1 then for J in Self.Chars'Range loop if not Self.Chars (J) then -- X == NFC(X) == NFD(X) == NFKC(X) == NFKD(X) begin X := To_Universal_String ((1 => Wide_Wide_Character'Val (J))); Skip := False; exception when Constraint_Error => Skip := True; end; if not Skip then if X.To_Wide_Wide_String /= X.To_NFC.To_Wide_Wide_String then raise Program_Error; end if; if X.To_Wide_Wide_String /= X.To_NFD.To_Wide_Wide_String then raise Program_Error; end if; if X.To_Wide_Wide_String /= X.To_NFKC.To_Wide_Wide_String then raise Program_Error; end if; if X.To_Wide_Wide_String /= X.To_NFKD.To_Wide_Wide_String then raise Program_Error; end if; end if; end if; end loop; Self.Part_1 := False; end if; end End_Section; ------------------- -- Start_Section -- ------------------- overriding procedure Start_Section (Self : in out Parser; Name : String) is begin if Name = "Part1" then Self.Part_1 := True; end if; end Start_Section; Test : Parser; begin Test.Open (Unidata_Directory & '/' & NormalizationTest_Name); Test.Parse; Test.Close; end Normalization_Test;
test/Succeed/Issue602-2.agda
cruhland/agda
1,989
13709
<filename>test/Succeed/Issue602-2.agda -- Record projections should be positive in their argument module Issue602-2 where record A : Set₁ where constructor mkA field f : Set unA : A → Set unA (mkA x) = x data B (a : A) : Set where mkB : unA a → B a data D : Set where d : B (mkA D) → D
engine/engine/interrupt/implementation/setup.asm
neomura/atmega328p-cartridge
0
179309
<reponame>neomura/atmega328p-cartridge ldi interrupt_state, INTERRUPT_STATE_POST_BLANK_START clr interrupt_flags ; Configure timer 1. ; - Set "compare match" mode - OC1A will be pulled high on reaching OCR1A, then pulled low on wrapping back to 0. ; - Set "fast PWM" mode. ; - Disable the clock divider. store_immediate TCCR1A, r31, (1 << COM1A1) | (1 << COM1A0) | (1 << WGM11) store_immediate TCCR1B, r31, (1 << WGM12) | (1 << WGM13) | (1 << CS10) ; Use the first channel to output the first HSYNC pulse. store_immediate_16 ICR1L, r31, SCANLINE_CYCLES store_immediate_16 OCR1AL, r31, HSYNC_PULSE_CYCLES ; Use the second channel to trigger an interrupt which fires a little earlier than the end of a HSYNC pulse. store_immediate_16 OCR1BL, r31, INTERRUPT_START_CYCLES store_immediate TIMSK1, r31, 1<<OCIE1B ; Disable the SPI clock divider. store_immediate_16 UBRR0L, r31, 0 ; Enable Master SPI mode. store_immediate UCSR0C, r31, (1<<UMSEL01)|(1<<UMSEL00) ; Set the TX pin as an output. SPI will still work if this isn't done, but ; it will be high during inactivity rather than low. sbi DDRD, DDD1 ; Enable the VSYNC/HSYNC output. sbi DDRB, DDB1 ; Enable the interrupt. sei
libsrc/math/zxmath/asin.asm
grancier/z180
0
16379
; ; ; ZX Maths Routines ; ; 7/12/02 - <NAME> ; ; $Id: asin.asm,v 1.5 2016/06/22 19:59:18 dom Exp $ ; ;double asin(double) ;Number in FA.. IF FORzx INCLUDE "zxfp.def" ENDIF IF FORzx81 INCLUDE "81fp.def" ENDIF IF FORlambda INCLUDE "lambdafp.def" ENDIF SECTION code_fp PUBLIC asin EXTERN fsetup1 EXTERN stkequ .asin call fsetup1 IF FORlambda defb ZXFP_ASN + 128 ELSE defb ZXFP_ASN defb ZXFP_END_CALC ENDIF jp stkequ
libsrc/spectrum/if1_getname.asm
dex4er/deb-z88dk
1
8331
; ; ZX IF1 & Microdrive functions ; ; char* if1_getname(char *location); ; ; Picks a file name from the specified location ; ; $Id: if1_getname.asm,v 1.2 2004/10/08 13:59:32 stefano Exp $ ; XLIB if1_getname tempmdvname: defs 11 if1_getname: pop bc ; ret addr pop hl ; location push hl push bc ld de,tempmdvname push de ld bc,10 ldir push de pop hl previous: dec hl ld a,(hl) cp ' ' jr z,previous inc hl ld (hl),0 pop hl ; pointer to temp name ret
programs/oeis/273/A273322.asm
jmorken/loda
1
163566
<gh_stars>1-10 ; A273322: Wiener index of graphs of f.c.c. unit cells in a line = Sum of distances in face-centered cubic grid unit cells connected in a row. ; 150,536,1336,2712,4826,7840,11916,17216,23902,32136,42080,53896,67746,83792,102196,123120,146726,173176,202632,235256,271210,310656,353756,400672,451566,506600,565936,629736,698162,771376,849540,932816,1021366,1115352,1214936,1320280,1431546,1548896,1672492,1802496,1939070,2082376,2232576,2389832,2554306,2726160,2905556,3092656,3287622,3490616,3701800,3921336,4149386,4386112,4631676,4886240,5149966,5423016,5705552,5997736,6299730,6611696,6933796,7266192,7609046,7962520,8326776,8701976,9088282,9485856,9894860,10315456,10747806,11192072,11648416,12117000,12597986,13091536,13597812,14116976,14649190,15194616,15753416,16325752,16911786,17511680,18125596,18753696,19396142,20053096,20724720,21411176,22112626,22829232,23561156,24308560,25071606,25850456,26645272,27456216,28283450,29127136,29987436,30864512,31758526,32669640,33598016,34543816,35507202,36488336,37487380,38504496,39539846,40593592,41665896,42756920,43866826,44995776,46143932,47311456,48498510,49705256,50931856,52178472,53445266,54732400,56040036,57368336,58717462,60087576,61478840,62891416,64325466,65781152,67258636,68758080,70279646,71823496,73389792,74978696,76590370,78224976,79882676,81563632,83268006,84995960,86747656,88523256,90322922,92146816,93995100,95867936,97765486,99687912,101635376,103608040,105606066,107629616,109678852,111753936,113855030,115982296,118135896,120315992,122522746,124756320,127016876,129304576,131619582,133962056,136332160,138730056,141155906,143609872,146092116,148602800,151142086,153710136,156307112,158933176,161588490,164273216,166987516,169731552,172505486,175309480,178143696,181008296,183903442,186829296,189786020,192773776,195792726,198843032,201924856,205038360,208183706,211361056,214570572,217812416,221086750,224393736,227733536,231106312,234512226,237951440,241424116,244930416,248470502,252044536,255652680,259295096,262971946,266683392,270429596,274210720,278026926,281878376,285765232,289687656,293645810,297639856,301669956,305736272,309838966,313978200,318154136,322366936,326616762,330903776,335228140,339590016,343989566,348426952,352902336,357415880,361967746,366558096,371187092,375854896,380561670,385307576,390092776,394917432,399781706,404685760,409629756,414613856,419638222,424703016 mov $1,$0 mul $1,2 add $1,$0 mov $2,$0 mov $0,$1 mov $3,2 add $3,$1 mov $1,1 add $3,6 add $3,$0 mov $4,$0 add $0,4 lpb $0 sub $0,1 add $4,$3 add $1,$4 lpe add $1,1 lpb $2 add $1,53 sub $2,1 lpe add $1,68
src/compiler-lexer.adb
GLADORG/template-compiler
0
19699
<filename>src/compiler-lexer.adb with Ada.Streams, Ada.Characters.Conversions, Ada.Strings, Ada.Streams.Stream_IO; package body Compiler.Lexer is use Ada.Streams.Stream_IO; use Ada.Streams; use Ada.Characters.Conversions; function Lex (input : Wide_Wide_String) return List is type State is (State_Start, State_Identifier, State_Comment, State_ComplexComment, State_Component); curr_state : State := State_Start; curr_char : Wide_Wide_Character; curr_index : Positive:= 1; token_text : XString := Null_XString; AST : List; function look_ahead return Wide_Wide_Character is l_char : constant Wide_Wide_Character := To_Wide_Wide_Character (ASCII.LF); index : constant Positive := curr_index + 1; begin if index > input'Length then return l_char; else return input (index); end if; end look_ahead; function look_further_ahead return Wide_Wide_Character is l_char : constant Wide_Wide_Character := To_Wide_Wide_Character (ASCII.LF); index : constant Positive := curr_index + 2; begin if index > input'Length then return l_char; else return input (index); end if; end look_further_ahead; procedure next_char is begin curr_index := curr_index + 1; if curr_index > input'Length then raise Stream_IO.End_Error; else curr_char := input (curr_index); end if; end next_char; procedure Add_Token_To_AST(tok : Token) is New_Node : constant Node := (TheToken => tok, TheName => To_XString (""), TheValue => To_XString (""), others => false); begin AST.Append(New_Node); end Add_Token_To_AST; procedure Add_Token_To_AST (tok : Token; text : XString; BlockClosing: Boolean := False; Block: Boolean := False) is New_Node : constant Node := (TheToken => tok, TheValue => text, TheName => To_XString (""), Block => Block, BlockClosing => BlockClosing, others => false); begin AST.Append (New_Node); end Add_Token_To_AST; procedure Add_Nonempty_Token_To_AST (tok : Token; text : XString) is begin if text.Length > 0 and then text.Trim (Ada.Strings.Both).Length > 0 then Add_Token_To_AST (tok, text); end if; end Add_Nonempty_Token_To_AST; procedure Preserve_Text_And_Add_Token(tok1 : Token; text : XString; tok2 : Token; BlockClosing: Boolean := false; Block: Boolean := false) is begin Add_Nonempty_Token_To_AST (tok1, text); Add_Token_To_AST (tok2, To_XString (""), BlockClosing, Block); token_text.Set (""); end Preserve_Text_And_Add_Token; begin curr_char := input(curr_index); loop case curr_state is when State_Start => case curr_char is when '<' => if look_ahead = '/' or look_ahead in Uppercase then Preserve_Text_And_Add_Token (Keyword_Web, token_text, Keyword_Tag_Start, look_ahead = '/'); curr_state := State_Component; else token_text.Append (curr_char); end if; when '{' => if look_ahead = '{' then Preserve_Text_And_Add_Token (Keyword_Web, token_text, Keyword_Identifier_Opening, look_further_ahead = '/', look_further_ahead = '#'); next_char; curr_state := State_Identifier; end if; when others => token_text.Append (curr_char); end case; next_char; when State_Identifier => case curr_char is when '/' | '.' | '-' | '!' | 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' => token_text.Append (curr_char); next_char; when '#' => Add_Token_To_AST (Keyword_Block_Start); next_char; when '|' => Preserve_Text_And_Add_Token(Identifier,token_text, Blockparam_Symbol); next_char; when '=' => Preserve_Text_And_Add_Token(Identifier,token_text, Assignment_Symbol); next_char; when '@' => Add_Token_To_AST (Attribute_Symbol); token_text.Set(""); next_char; when ''' | '"' => Preserve_Text_And_Add_Token(Identifier,token_text, Quotation_Symbol); when '(' => Preserve_Text_And_Add_Token(Identifier,token_text, Parantesis_Open_Symbol); when ')' => Preserve_Text_And_Add_Token(Identifier,token_text, Parantesis_Close_Symbol); when others => if token_text = "!--" then curr_state := State_ComplexComment; Add_Token_To_AST (Keyword_Complex_Comment_Start); token_text.Set(""); elsif token_text = "!" then curr_state := State_Comment; Add_Token_To_AST (Keyword_Simple_Comment_Start); token_text.Set(""); else Add_Token_To_AST (Identifier, token_text); token_text.Set(""); end if; if curr_char = '}' then if look_ahead = '}' then Preserve_Text_And_Add_Token(Identifier,token_text, Keyword_Identifier_Closing); next_char; curr_state := State_Start; else null; -- error.. end if; end if; next_char; end case; when State_Comment => case curr_char is when '}' => if look_ahead = '}' then Add_Token_To_AST (Keyword_Comment, token_text); Add_Token_To_AST (Keyword_Identifier_Closing); token_text.Set(""); next_char; curr_state := State_Start; end if; when others => token_text.Append (curr_char); end case; next_char; when State_ComplexComment => token_text.Append (curr_char); if curr_char = '}' and then token_text.Tail(4) = ("--}}") then Add_Token_To_AST (Keyword_Complex_Comment_End); --Add_Token_To_AST (Keyword_Identifier_Closing); token_text.Set(""); curr_state := State_Start; end if; next_char; when State_Component => case curr_char is when '/' => Add_Nonempty_Token_To_AST (Identifier, token_text); if look_ahead = '>' then next_char; Add_Token_To_AST (Keyword_Tag_Closing_End); token_text.Set(""); curr_state := State_Start; else Add_Token_To_AST (Keyword_Tag_Close); token_text.Set(""); end if; when '>' => Add_Nonempty_Token_To_AST (Identifier, token_text); Add_Token_To_AST (Keyword_Tag_End); token_text.Set(""); curr_state := State_Start; when '|' => Preserve_Text_And_Add_Token(Identifier,token_text, Blockparam_Symbol); when '=' => Preserve_Text_And_Add_Token(Identifier,token_text, Assignment_Symbol); when '@' => Add_Token_To_AST (Attribute_Symbol); token_text.Set(""); when 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' => token_text.Append (curr_char); when ''' | '"' => Preserve_Text_And_Add_Token(Identifier,token_text, Quotation_Symbol); when '(' => Preserve_Text_And_Add_Token(Identifier,token_text, Parantesis_Open_Symbol); when ')' => Preserve_Text_And_Add_Token(Identifier,token_text, Parantesis_Close_Symbol); when '{' => if look_ahead = '{' then Preserve_Text_And_Add_Token(Identifier,token_text, Keyword_Identifier_Opening); next_char; end if; when '}' => if look_ahead = '}' then Preserve_Text_And_Add_Token(Identifier,token_text, Keyword_Identifier_Closing); next_char; end if; when others => declare Element : Node := AST.Last_Element; begin if Element.TheName.Length = 0 then Element.TheName := token_text; else Add_Token_To_AST (Identifier,token_text); end if; end; token_text.Set(""); end case; next_char; end case; end loop; exception when error : Stream_IO.End_Error => --IO.Put_Line (End_of_input'Wide_Wide_Image); return AST; when error : Lexer.Lexer_Error => --IO.Put_Line (Exception_Message (error)); return AST; end Lex; end Compiler.Lexer;
programs/oeis/167/A167375.asm
neoneye/loda
22
101121
; A167375: a(n)=3*a(n-1)-a(n-2) with a(0)=1, a(1)=3, a(2)=11. ; 1,3,11,30,79,207,542,1419,3715,9726,25463,66663,174526,456915,1196219,3131742,8199007,21465279,56196830,147125211,385178803,1008411198,2640054791,6911753175,18095204734,47373861027,124026378347,324705274014,850089443695,2225563057071,5826599727518,15254236125483,39936108648931,104554089821310,273726160814999,716624392623687,1876147017056062,4911816658544499,12859302958577435,33666092217187806,88138973692985983,230750828861770143,604113512892324446,1581589709815203195,4140655616553285139,10840377139844652222,28380475802980671527,74301050269097362359,194522675004311415550,509266974743836884291,1333278249227199237323,3490567772937760827678,9138425069586083245711,23924707435820488909455,62635697237875383482654,163982384277805661538507,429311455595541601132867,1123951982508819141860094,2942544491930915824447415,7703681493283928331482151,20168499987920869169999038,52801818470478679178514963,138236955423515168365545851,361909047800066825918122590,947490187976685309388821919,2480561516129989102248343167,6494194360413281997356207582,17002021565109856889820279579,44511870334916288672104631155,116533589439639009126493613886,305088897984000738707376210503,798733104512363206995635017623,2091110415553088882279528842366,5474598142146903439842951509475,14332684010887621437249325686059,37523453890515960871905025548702,98237677660660261178465750960047,257189579091464822663492227331439,673331059613734206812010931034270,1762803599749737797772540565771371,4615079739635479186505610766279843,12082435619156699761744291733068158,31632227117834620098727264432924631,82814245734347160534437501565705735,216810510085206861504585240264192574,567617284521273423979318219226871987 mov $1,4 lpb $0 sub $0,1 add $2,$1 add $1,1 sub $2,1 add $1,$2 trn $2,4 lpe trn $1,6 add $1,1 mov $0,$1
SCS3211/Excercises/ex04.asm
UdeshUK/UCSC-CS
6
80579
.text la $a0,inst li $v0,4 syscall li $v0,5 syscall move $t0,$v0 la $a0,out li $v0,4 syscall move $a0,$t0 li $v0,1 syscall .data inst: .asciiz "enter an integer:" out: .asciiz "you have entered: "
examples/tmsc.asm
feilipu/TMS9918A
1
170336
; z88dk wrapper for TMS9918A graphics subroutines ; Copyright 2018 <NAME> ; ; 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. SECTION code PUBLIC _tmsintenable PUBLIC _tmsintdisable PUBLIC _tmswrite PUBLIC _tmsfill PUBLIC _tmsbackground PUBLIC _tmstextcolor PUBLIC _tmstextpos PUBLIC _tmsstrout PUBLIC _tmschrrpt PUBLIC _tmschrout PUBLIC _tmspixelop PUBLIC _tmsplotpixel PUBLIC _tmspixelcolor PUBLIC _tmsmulticolor PUBLIC _tmsbitmap PUBLIC _tmstextmode PUBLIC _tmstile include "tms.asm" _tmsintenable: jp tmsintenable _tmsintdisable: jp tmsintdisable _tmswrite: ld hl, 2 add hl, sp ld c, (hl) ; len inc hl ld b, (hl) inc hl ld e, (hl) ; dest inc hl ld d, (hl) inc hl ld a, (hl) ; source inc hl ld h, (hl) ld l, a jp tmswrite _tmsfill: ld hl, 2 add hl, sp ld c, (hl) ; len inc hl ld b, (hl) inc hl ld e, (hl) ; dest inc hl ld d, (hl) inc hl ld a, (hl) ; value ld l, a jp tmsfill _tmsbackground: ld hl, 2 add hl, sp ld a, (hl) ; color jp tmsbackground _tmstextcolor: ld hl, 2 add hl, sp ld a, (hl) ; color jp tmstextcolor _tmstextpos: ld hl, 2 add hl, sp ld a, (hl) ; x inc hl ld e, (hl) ; y jp tmstextpos _tmsstrout: ld hl, 2 add hl, sp ld a, (hl) ; str inc hl ld h, (hl) ld l, a jp tmsstrout _tmschrrpt: ld hl, 2 add hl, sp ld a, (hl) ; chr inc hl inc hl ld b, (hl) ; count jp tmschrrpt _tmschrout: ld hl, 2 add hl, sp ld a, (hl) ; chr jp tmschrout _tmspixelop: ld hl, 2 add hl, sp ld a, (hl) ; operation inc hl ld h, (hl) ld l, a jp tmspixelop _tmsplotpixel: ld hl, 2 add hl, sp ld b, (hl) ; y inc hl inc hl ld c, (hl) ; x jp tmsplotpixel _tmspixelcolor: ld hl, 2 add hl, sp ld b, (hl) ; y inc hl inc hl ld c, (hl) ; x inc hl inc hl ld a, (hl) ; color jp tmspixelcolor _tmsmulticolor: jp tmsmulticolor _tmsbitmap: jp tmsbitmap _tmstextmode: ld hl, 2 add hl, sp ld e, (hl) ; font inc hl ld d, (hl) ex de, hl jp tmstextmode _tmstile: jp tmstile
ta19demo/lib/sla16.asm
hallorant/bitmit
6
164489
; Shift-left of a 16-bit value. ; ; Used: a, hl, d ; ; Entry: hl 16-bit value ; a shift count ; Exit: hl result of hl shifted left by c bits sla16: ld d,a or a __sla16_loop: ret z sla h sla l jr nc,__sla16_cont ld a,1 add a,h ld h,a __sla16_cont: dec d jr __sla16_loop
agda-stdlib-0.9/src/Algebra/Operations.agda
qwe2/try-agda
1
16063
<filename>agda-stdlib-0.9/src/Algebra/Operations.agda ------------------------------------------------------------------------ -- The Agda standard library -- -- Some defined operations (multiplication by natural number and -- exponentiation) ------------------------------------------------------------------------ open import Algebra module Algebra.Operations {s₁ s₂} (S : Semiring s₁ s₂) where open Semiring S renaming (zero to *-zero) open import Data.Nat using (zero; suc; ℕ) renaming (_+_ to _ℕ+_; _*_ to _ℕ*_) open import Data.Product using (module Σ) open import Function open import Relation.Binary open import Relation.Binary.PropositionalEquality as PropEq using (_≡_) import Relation.Binary.EqReasoning as EqR open EqR setoid ------------------------------------------------------------------------ -- Operations -- Multiplication by natural number. infixr 7 _×_ _×_ : ℕ → Carrier → Carrier 0 × x = 0# suc n × x = x + n × x -- A variant that includes a "redundant" case which ensures that 1 × y -- is definitionally equal to y. _×′_ : ℕ → Carrier → Carrier 0 ×′ x = 0# 1 ×′ x = x suc n ×′ x = x + n ×′ x -- Exponentiation. infixr 8 _^_ _^_ : Carrier → ℕ → Carrier x ^ zero = 1# x ^ suc n = x * x ^ n ------------------------------------------------------------------------ -- Some properties -- Unfolding lemma for _×′_. 1+×′ : ∀ n x → suc n ×′ x ≈ x + n ×′ x 1+×′ 0 x = begin x ≈⟨ sym $ Σ.proj₂ +-identity x ⟩ x + 0# ∎ 1+×′ (suc n) x = begin x + suc n ×′ x ≡⟨⟩ x + suc n ×′ x ∎ -- _×_ and _×′_ are extensionally equal (up to the setoid -- equivalence). ×≈×′ : ∀ n x → n × x ≈ n ×′ x ×≈×′ 0 x = begin 0# ∎ ×≈×′ (suc n) x = begin x + n × x ≈⟨ +-cong refl (×≈×′ n x) ⟩ x + n ×′ x ≈⟨ sym $ 1+×′ n x ⟩ suc n ×′ x ∎ -- _×_ is homomorphic with respect to _ℕ+_/_+_. ×-homo-+ : ∀ c m n → (m ℕ+ n) × c ≈ m × c + n × c ×-homo-+ c 0 n = begin n × c ≈⟨ sym $ Σ.proj₁ +-identity (n × c) ⟩ 0# + n × c ∎ ×-homo-+ c (suc m) n = begin c + (m ℕ+ n) × c ≈⟨ +-cong refl (×-homo-+ c m n) ⟩ c + (m × c + n × c) ≈⟨ sym $ +-assoc c (m × c) (n × c) ⟩ c + m × c + n × c ∎ -- _×′_ is homomorphic with respect to _ℕ+_/_+_. ×′-homo-+ : ∀ c m n → (m ℕ+ n) ×′ c ≈ m ×′ c + n ×′ c ×′-homo-+ c m n = begin (m ℕ+ n) ×′ c ≈⟨ sym $ ×≈×′ (m ℕ+ n) c ⟩ (m ℕ+ n) × c ≈⟨ ×-homo-+ c m n ⟩ m × c + n × c ≈⟨ +-cong (×≈×′ m c) (×≈×′ n c) ⟩ m ×′ c + n ×′ c ∎ -- _× 1# is homomorphic with respect to _ℕ*_/_*_. ×1-homo-* : ∀ m n → (m ℕ* n) × 1# ≈ (m × 1#) * (n × 1#) ×1-homo-* 0 n = begin 0# ≈⟨ sym $ Σ.proj₁ *-zero (n × 1#) ⟩ 0# * (n × 1#) ∎ ×1-homo-* (suc m) n = begin (n ℕ+ m ℕ* n) × 1# ≈⟨ ×-homo-+ 1# n (m ℕ* n) ⟩ n × 1# + (m ℕ* n) × 1# ≈⟨ +-cong refl (×1-homo-* m n) ⟩ n × 1# + (m × 1#) * (n × 1#) ≈⟨ sym $ +-cong (Σ.proj₁ *-identity (n × 1#)) refl ⟩ 1# * (n × 1#) + (m × 1#) * (n × 1#) ≈⟨ sym $ Σ.proj₂ distrib (n × 1#) 1# (m × 1#) ⟩ (1# + m × 1#) * (n × 1#) ∎ -- _×′ 1# is homomorphic with respect to _ℕ*_/_*_. ×′1-homo-* : ∀ m n → (m ℕ* n) ×′ 1# ≈ (m ×′ 1#) * (n ×′ 1#) ×′1-homo-* m n = begin (m ℕ* n) ×′ 1# ≈⟨ sym $ ×≈×′ (m ℕ* n) 1# ⟩ (m ℕ* n) × 1# ≈⟨ ×1-homo-* m n ⟩ (m × 1#) * (n × 1#) ≈⟨ *-cong (×≈×′ m 1#) (×≈×′ n 1#) ⟩ (m ×′ 1#) * (n ×′ 1#) ∎ -- _×_ preserves equality. ×-cong : _×_ Preserves₂ _≡_ ⟶ _≈_ ⟶ _≈_ ×-cong {n} {n′} {x} {x′} n≡n′ x≈x′ = begin n × x ≈⟨ reflexive $ PropEq.cong (λ n → n × x) n≡n′ ⟩ n′ × x ≈⟨ ×-congʳ n′ x≈x′ ⟩ n′ × x′ ∎ where ×-congʳ : ∀ n → (_×_ n) Preserves _≈_ ⟶ _≈_ ×-congʳ 0 x≈x′ = refl ×-congʳ (suc n) x≈x′ = x≈x′ ⟨ +-cong ⟩ ×-congʳ n x≈x′ -- _×′_ preserves equality. ×′-cong : _×′_ Preserves₂ _≡_ ⟶ _≈_ ⟶ _≈_ ×′-cong {n} {n′} {x} {x′} n≡n′ x≈x′ = begin n ×′ x ≈⟨ sym $ ×≈×′ n x ⟩ n × x ≈⟨ ×-cong n≡n′ x≈x′ ⟩ n′ × x′ ≈⟨ ×≈×′ n′ x′ ⟩ n′ ×′ x′ ∎ -- _^_ preserves equality. ^-cong : _^_ Preserves₂ _≈_ ⟶ _≡_ ⟶ _≈_ ^-cong {x} {x'} {n} {n'} x≈x' n≡n' = begin x ^ n ≈⟨ reflexive $ PropEq.cong (_^_ x) n≡n' ⟩ x ^ n' ≈⟨ ^-congˡ n' x≈x' ⟩ x' ^ n' ∎ where ^-congˡ : ∀ n → (λ x → x ^ n) Preserves _≈_ ⟶ _≈_ ^-congˡ zero x≈x' = refl ^-congˡ (suc n) x≈x' = x≈x' ⟨ *-cong ⟩ ^-congˡ n x≈x'
awa/plugins/awa-votes/src/model/awa-votes-models.adb
My-Colaborations/ada-awa
81
10395
----------------------------------------------------------------------- -- AWA.Votes.Models -- AWA.Votes.Models ----------------------------------------------------------------------- -- File generated by ada-gen DO NOT MODIFY -- Template used: templates/model/package-body.xhtml -- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095 ----------------------------------------------------------------------- -- Copyright (C) 2020 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Unchecked_Deallocation; with ASF.Events.Faces.Actions; package body AWA.Votes.Models is use type ADO.Objects.Object_Record_Access; use type ADO.Objects.Object_Ref; pragma Warnings (Off, "formal parameter * is not referenced"); function Rating_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => RATING_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Rating_Key; function Rating_Key (Id : in String) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => RATING_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Rating_Key; function "=" (Left, Right : Rating_Ref'Class) return Boolean is begin return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right); end "="; procedure Set_Field (Object : in out Rating_Ref'Class; Impl : out Rating_Access) is Result : ADO.Objects.Object_Record_Access; begin Object.Prepare_Modify (Result); Impl := Rating_Impl (Result.all)'Access; end Set_Field; -- Internal method to allocate the Object_Record instance procedure Allocate (Object : in out Rating_Ref) is Impl : Rating_Access; begin Impl := new Rating_Impl; Impl.Rating := 0; Impl.Vote_Count := 0; Impl.For_Entity_Id := ADO.NO_IDENTIFIER; Impl.For_Entity_Type := 0; ADO.Objects.Set_Object (Object, Impl.all'Access); end Allocate; -- ---------------------------------------- -- Data object: Rating -- ---------------------------------------- procedure Set_Id (Object : in out Rating_Ref; Value : in ADO.Identifier) is Impl : Rating_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value); end Set_Id; function Get_Id (Object : in Rating_Ref) return ADO.Identifier is Impl : constant Rating_Access := Rating_Impl (Object.Get_Object.all)'Access; begin return Impl.Get_Key_Value; end Get_Id; procedure Set_Rating (Object : in out Rating_Ref; Value : in Integer) is Impl : Rating_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Integer (Impl.all, 2, Impl.Rating, Value); end Set_Rating; function Get_Rating (Object : in Rating_Ref) return Integer is Impl : constant Rating_Access := Rating_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Rating; end Get_Rating; procedure Set_Vote_Count (Object : in out Rating_Ref; Value : in Integer) is Impl : Rating_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Integer (Impl.all, 3, Impl.Vote_Count, Value); end Set_Vote_Count; function Get_Vote_Count (Object : in Rating_Ref) return Integer is Impl : constant Rating_Access := Rating_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Vote_Count; end Get_Vote_Count; procedure Set_For_Entity_Id (Object : in out Rating_Ref; Value : in ADO.Identifier) is Impl : Rating_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Identifier (Impl.all, 4, Impl.For_Entity_Id, Value); end Set_For_Entity_Id; function Get_For_Entity_Id (Object : in Rating_Ref) return ADO.Identifier is Impl : constant Rating_Access := Rating_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.For_Entity_Id; end Get_For_Entity_Id; procedure Set_For_Entity_Type (Object : in out Rating_Ref; Value : in ADO.Entity_Type) is Impl : Rating_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Entity_Type (Impl.all, 5, Impl.For_Entity_Type, Value); end Set_For_Entity_Type; function Get_For_Entity_Type (Object : in Rating_Ref) return ADO.Entity_Type is Impl : constant Rating_Access := Rating_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.For_Entity_Type; end Get_For_Entity_Type; -- Copy of the object. procedure Copy (Object : in Rating_Ref; Into : in out Rating_Ref) is Result : Rating_Ref; begin if not Object.Is_Null then declare Impl : constant Rating_Access := Rating_Impl (Object.Get_Load_Object.all)'Access; Copy : constant Rating_Access := new Rating_Impl; begin ADO.Objects.Set_Object (Result, Copy.all'Access); Copy.Copy (Impl.all); Copy.Rating := Impl.Rating; Copy.Vote_Count := Impl.Vote_Count; Copy.For_Entity_Id := Impl.For_Entity_Id; Copy.For_Entity_Type := Impl.For_Entity_Type; end; end if; Into := Result; end Copy; procedure Find (Object : in out Rating_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Impl : constant Rating_Access := new Rating_Impl; begin Impl.Find (Session, Query, Found); if Found then ADO.Objects.Set_Object (Object, Impl.all'Access); else ADO.Objects.Set_Object (Object, null); Destroy (Impl); end if; end Find; procedure Load (Object : in out Rating_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier) is Impl : constant Rating_Access := new Rating_Impl; Found : Boolean; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); raise ADO.Objects.NOT_FOUND; end if; ADO.Objects.Set_Object (Object, Impl.all'Access); end Load; procedure Load (Object : in out Rating_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean) is Impl : constant Rating_Access := new Rating_Impl; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); else ADO.Objects.Set_Object (Object, Impl.all'Access); end if; end Load; procedure Save (Object : in out Rating_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl = null then Impl := new Rating_Impl; ADO.Objects.Set_Object (Object, Impl); end if; if not ADO.Objects.Is_Created (Impl.all) then Impl.Create (Session); else Impl.Save (Session); end if; end Save; procedure Delete (Object : in out Rating_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl /= null then Impl.Delete (Session); end if; end Delete; -- -------------------- -- Free the object -- -------------------- procedure Destroy (Object : access Rating_Impl) is type Rating_Impl_Ptr is access all Rating_Impl; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Rating_Impl, Rating_Impl_Ptr); pragma Warnings (Off, "*redundant conversion*"); Ptr : Rating_Impl_Ptr := Rating_Impl (Object.all)'Access; pragma Warnings (On, "*redundant conversion*"); begin Unchecked_Free (Ptr); end Destroy; procedure Find (Object : in out Rating_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, RATING_DEF'Access); begin Stmt.Execute; if Stmt.Has_Elements then Object.Load (Stmt, Session); Stmt.Next; Found := not Stmt.Has_Elements; else Found := False; end if; end Find; overriding procedure Load (Object : in out Rating_Impl; Session : in out ADO.Sessions.Session'Class) is Found : Boolean; Query : ADO.SQL.Query; Id : constant ADO.Identifier := Object.Get_Key_Value; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("id = ?"); Object.Find (Session, Query, Found); if not Found then raise ADO.Objects.NOT_FOUND; end if; end Load; procedure Save (Object : in out Rating_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Update_Statement := Session.Create_Statement (RATING_DEF'Access); begin if Object.Is_Modified (1) then Stmt.Save_Field (Name => COL_0_1_NAME, -- id Value => Object.Get_Key); Object.Clear_Modified (1); end if; if Object.Is_Modified (2) then Stmt.Save_Field (Name => COL_1_1_NAME, -- rating Value => Object.Rating); Object.Clear_Modified (2); end if; if Object.Is_Modified (3) then Stmt.Save_Field (Name => COL_2_1_NAME, -- vote_count Value => Object.Vote_Count); Object.Clear_Modified (3); end if; if Object.Is_Modified (4) then Stmt.Save_Field (Name => COL_3_1_NAME, -- for_entity_id Value => Object.For_Entity_Id); Object.Clear_Modified (4); end if; if Object.Is_Modified (5) then Stmt.Save_Field (Name => COL_4_1_NAME, -- for_entity_type Value => Object.For_Entity_Type); Object.Clear_Modified (5); end if; if Stmt.Has_Save_Fields then Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); declare Result : Integer; begin Stmt.Execute (Result); if Result /= 1 then if Result /= 0 then raise ADO.Objects.UPDATE_ERROR; end if; end if; end; end if; end Save; procedure Create (Object : in out Rating_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Query : ADO.Statements.Insert_Statement := Session.Create_Statement (RATING_DEF'Access); Result : Integer; begin Session.Allocate (Id => Object); Query.Save_Field (Name => COL_0_1_NAME, -- id Value => Object.Get_Key); Query.Save_Field (Name => COL_1_1_NAME, -- rating Value => Object.Rating); Query.Save_Field (Name => COL_2_1_NAME, -- vote_count Value => Object.Vote_Count); Query.Save_Field (Name => COL_3_1_NAME, -- for_entity_id Value => Object.For_Entity_Id); Query.Save_Field (Name => COL_4_1_NAME, -- for_entity_type Value => Object.For_Entity_Type); Query.Execute (Result); if Result /= 1 then raise ADO.Objects.INSERT_ERROR; end if; ADO.Objects.Set_Created (Object); end Create; procedure Delete (Object : in out Rating_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Delete_Statement := Session.Create_Statement (RATING_DEF'Access); begin Stmt.Set_Filter (Filter => "id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Execute; end Delete; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Rating_Ref; Name : in String) return Util.Beans.Objects.Object is Obj : ADO.Objects.Object_Record_Access; Impl : access Rating_Impl; begin if From.Is_Null then return Util.Beans.Objects.Null_Object; end if; Obj := From.Get_Load_Object; Impl := Rating_Impl (Obj.all)'Access; if Name = "id" then return ADO.Objects.To_Object (Impl.Get_Key); elsif Name = "rating" then return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Rating)); elsif Name = "vote_count" then return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Vote_Count)); elsif Name = "for_entity_id" then return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.For_Entity_Id)); elsif Name = "for_entity_type" then return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.For_Entity_Type)); end if; return Util.Beans.Objects.Null_Object; end Get_Value; -- ------------------------------ -- Load the object from current iterator position -- ------------------------------ procedure Load (Object : in out Rating_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class) is begin Object.Set_Key_Value (Stmt.Get_Identifier (0)); Object.Rating := Stmt.Get_Integer (1); Object.Vote_Count := Stmt.Get_Integer (2); Object.For_Entity_Id := Stmt.Get_Identifier (3); Object.For_Entity_Type := ADO.Entity_Type (Stmt.Get_Integer (4)); ADO.Objects.Set_Created (Object); end Load; function Vote_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => VOTE_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Vote_Key; function Vote_Key (Id : in String) return ADO.Objects.Object_Key is Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER, Of_Class => VOTE_DEF'Access); begin ADO.Objects.Set_Value (Result, Id); return Result; end Vote_Key; function "=" (Left, Right : Vote_Ref'Class) return Boolean is begin return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right); end "="; procedure Set_Field (Object : in out Vote_Ref'Class; Impl : out Vote_Access) is Result : ADO.Objects.Object_Record_Access; begin Object.Prepare_Modify (Result); Impl := Vote_Impl (Result.all)'Access; end Set_Field; -- Internal method to allocate the Object_Record instance procedure Allocate (Object : in out Vote_Ref) is Impl : Vote_Access; begin Impl := new Vote_Impl; Impl.Rating := 0; ADO.Objects.Set_Object (Object, Impl.all'Access); end Allocate; -- ---------------------------------------- -- Data object: Vote -- ---------------------------------------- procedure Set_Rating (Object : in out Vote_Ref; Value : in Integer) is Impl : Vote_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Integer (Impl.all, 1, Impl.Rating, Value); end Set_Rating; function Get_Rating (Object : in Vote_Ref) return Integer is Impl : constant Vote_Access := Vote_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Rating; end Get_Rating; procedure Set_Entity (Object : in out Vote_Ref; Value : in AWA.Votes.Models.Rating_Ref'Class) is Impl : Vote_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Object (Impl.all, 2, Impl.Entity, Value); end Set_Entity; function Get_Entity (Object : in Vote_Ref) return AWA.Votes.Models.Rating_Ref'Class is Impl : constant Vote_Access := Vote_Impl (Object.Get_Load_Object.all)'Access; begin return Impl.Entity; end Get_Entity; procedure Set_User_Id (Object : in out Vote_Ref; Value : in ADO.Identifier) is Impl : Vote_Access; begin Set_Field (Object, Impl); ADO.Objects.Set_Field_Key_Value (Impl.all, 3, Value); end Set_User_Id; function Get_User_Id (Object : in Vote_Ref) return ADO.Identifier is Impl : constant Vote_Access := Vote_Impl (Object.Get_Object.all)'Access; begin return Impl.Get_Key_Value; end Get_User_Id; -- Copy of the object. procedure Copy (Object : in Vote_Ref; Into : in out Vote_Ref) is Result : Vote_Ref; begin if not Object.Is_Null then declare Impl : constant Vote_Access := Vote_Impl (Object.Get_Load_Object.all)'Access; Copy : constant Vote_Access := new Vote_Impl; begin ADO.Objects.Set_Object (Result, Copy.all'Access); Copy.Copy (Impl.all); Copy.Rating := Impl.Rating; Copy.Entity := Impl.Entity; end; end if; Into := Result; end Copy; procedure Find (Object : in out Vote_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Impl : constant Vote_Access := new Vote_Impl; begin Impl.Find (Session, Query, Found); if Found then ADO.Objects.Set_Object (Object, Impl.all'Access); else ADO.Objects.Set_Object (Object, null); Destroy (Impl); end if; end Find; procedure Load (Object : in out Vote_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier) is Impl : constant Vote_Access := new Vote_Impl; Found : Boolean; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("user_id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); raise ADO.Objects.NOT_FOUND; end if; ADO.Objects.Set_Object (Object, Impl.all'Access); end Load; procedure Load (Object : in out Vote_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean) is Impl : constant Vote_Access := new Vote_Impl; Query : ADO.SQL.Query; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("user_id = ?"); Impl.Find (Session, Query, Found); if not Found then Destroy (Impl); else ADO.Objects.Set_Object (Object, Impl.all'Access); end if; end Load; procedure Save (Object : in out Vote_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl = null then Impl := new Vote_Impl; ADO.Objects.Set_Object (Object, Impl); end if; if not ADO.Objects.Is_Created (Impl.all) then Impl.Create (Session); else Impl.Save (Session); end if; end Save; procedure Delete (Object : in out Vote_Ref; Session : in out ADO.Sessions.Master_Session'Class) is Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object; begin if Impl /= null then Impl.Delete (Session); end if; end Delete; -- -------------------- -- Free the object -- -------------------- procedure Destroy (Object : access Vote_Impl) is type Vote_Impl_Ptr is access all Vote_Impl; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Vote_Impl, Vote_Impl_Ptr); pragma Warnings (Off, "*redundant conversion*"); Ptr : Vote_Impl_Ptr := Vote_Impl (Object.all)'Access; pragma Warnings (On, "*redundant conversion*"); begin Unchecked_Free (Ptr); end Destroy; procedure Find (Object : in out Vote_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean) is Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query, VOTE_DEF'Access); begin Stmt.Execute; if Stmt.Has_Elements then Object.Load (Stmt, Session); Stmt.Next; Found := not Stmt.Has_Elements; else Found := False; end if; end Find; overriding procedure Load (Object : in out Vote_Impl; Session : in out ADO.Sessions.Session'Class) is Found : Boolean; Query : ADO.SQL.Query; Id : constant ADO.Identifier := Object.Get_Key_Value; begin Query.Bind_Param (Position => 1, Value => Id); Query.Set_Filter ("user_id = ?"); Object.Find (Session, Query, Found); if not Found then raise ADO.Objects.NOT_FOUND; end if; end Load; procedure Save (Object : in out Vote_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Update_Statement := Session.Create_Statement (VOTE_DEF'Access); begin if Object.Is_Modified (1) then Stmt.Save_Field (Name => COL_0_2_NAME, -- rating Value => Object.Rating); Object.Clear_Modified (1); end if; if Object.Is_Modified (2) then Stmt.Save_Field (Name => COL_1_2_NAME, -- entity_id Value => Object.Entity); Object.Clear_Modified (2); end if; if Object.Is_Modified (3) then Stmt.Save_Field (Name => COL_2_2_NAME, -- user_id Value => Object.Get_Key); Object.Clear_Modified (3); end if; if Stmt.Has_Save_Fields then Stmt.Set_Filter (Filter => "user_id = ? AND entity_id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Add_Param (Value => Object.Entity); declare Result : Integer; begin Stmt.Execute (Result); if Result /= 1 then if Result /= 0 then raise ADO.Objects.UPDATE_ERROR; end if; end if; end; end if; end Save; procedure Create (Object : in out Vote_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Query : ADO.Statements.Insert_Statement := Session.Create_Statement (VOTE_DEF'Access); Result : Integer; begin Query.Save_Field (Name => COL_0_2_NAME, -- rating Value => Object.Rating); Query.Save_Field (Name => COL_1_2_NAME, -- entity_id Value => Object.Entity); Query.Save_Field (Name => COL_2_2_NAME, -- user_id Value => Object.Get_Key); Query.Execute (Result); if Result /= 1 then raise ADO.Objects.INSERT_ERROR; end if; ADO.Objects.Set_Created (Object); end Create; procedure Delete (Object : in out Vote_Impl; Session : in out ADO.Sessions.Master_Session'Class) is Stmt : ADO.Statements.Delete_Statement := Session.Create_Statement (VOTE_DEF'Access); begin Stmt.Set_Filter (Filter => "user_id = ?"); Stmt.Add_Param (Value => Object.Get_Key); Stmt.Execute; end Delete; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Vote_Ref; Name : in String) return Util.Beans.Objects.Object is Obj : ADO.Objects.Object_Record_Access; Impl : access Vote_Impl; begin if From.Is_Null then return Util.Beans.Objects.Null_Object; end if; Obj := From.Get_Load_Object; Impl := Vote_Impl (Obj.all)'Access; if Name = "rating" then return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Rating)); elsif Name = "user_id" then return ADO.Objects.To_Object (Impl.Get_Key); end if; return Util.Beans.Objects.Null_Object; end Get_Value; -- ------------------------------ -- Load the object from current iterator position -- ------------------------------ procedure Load (Object : in out Vote_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class) is begin Object.Rating := Stmt.Get_Integer (0); if not Stmt.Is_Null (1) then Object.Entity.Set_Key_Value (Stmt.Get_Identifier (1), Session); end if; Object.Set_Key_Value (Stmt.Get_Identifier (2)); ADO.Objects.Set_Created (Object); end Load; procedure Op_Vote_Up (Bean : in out Vote_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); procedure Op_Vote_Up (Bean : in out Vote_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Vote_Bean'Class (Bean).Vote_Up (Outcome); end Op_Vote_Up; package Binding_Vote_Bean_1 is new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Vote_Bean, Method => Op_Vote_Up, Name => "vote_up"); procedure Op_Vote_Down (Bean : in out Vote_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); procedure Op_Vote_Down (Bean : in out Vote_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Vote_Bean'Class (Bean).Vote_Down (Outcome); end Op_Vote_Down; package Binding_Vote_Bean_2 is new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Vote_Bean, Method => Op_Vote_Down, Name => "vote_down"); procedure Op_Vote (Bean : in out Vote_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); procedure Op_Vote (Bean : in out Vote_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is begin Vote_Bean'Class (Bean).Vote (Outcome); end Op_Vote; package Binding_Vote_Bean_3 is new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Vote_Bean, Method => Op_Vote, Name => "vote"); Binding_Vote_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array := (1 => Binding_Vote_Bean_1.Proxy'Access, 2 => Binding_Vote_Bean_2.Proxy'Access, 3 => Binding_Vote_Bean_3.Proxy'Access ); -- ------------------------------ -- This bean provides some methods that can be used in a Method_Expression. -- ------------------------------ overriding function Get_Method_Bindings (From : in Vote_Bean) return Util.Beans.Methods.Method_Binding_Array_Access is pragma Unreferenced (From); begin return Binding_Vote_Bean_Array'Access; end Get_Method_Bindings; -- ------------------------------ -- Get the bean attribute identified by the name. -- ------------------------------ overriding function Get_Value (From : in Vote_Bean; Name : in String) return Util.Beans.Objects.Object is begin if Name = "permission" then return Util.Beans.Objects.To_Object (From.Permission); elsif Name = "entity_id" then return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Entity_Id)); elsif Name = "rating" then return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Rating)); elsif Name = "entity_type" then return Util.Beans.Objects.To_Object (From.Entity_Type); elsif Name = "total" then return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Total)); end if; return Util.Beans.Objects.Null_Object; end Get_Value; -- ------------------------------ -- Set the value identified by the name -- ------------------------------ overriding procedure Set_Value (Item : in out Vote_Bean; Name : in String; Value : in Util.Beans.Objects.Object) is begin if Name = "permission" then Item.Permission := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "entity_id" then Item.Entity_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value)); elsif Name = "rating" then Item.Rating := Util.Beans.Objects.To_Integer (Value); elsif Name = "entity_type" then Item.Entity_Type := Util.Beans.Objects.To_Unbounded_String (Value); elsif Name = "total" then Item.Total := Util.Beans.Objects.To_Integer (Value); end if; end Set_Value; end AWA.Votes.Models;
examples/chained_signals/derived_objects.adb
glencornell/ada-object-framework
0
13435
with Ada.Text_Io; package body Derived_Objects is procedure My_Slot (This : in Derived_Object) is begin Ada.Text_Io.Put_Line ("My_Slot called for object with id = " & Natural'Image(This.Id)); end My_Slot; procedure My_Slot (This : in not null Aof.Core.Root_Objects.Access_Object) is begin Access_Derived_Object(This).My_Slot; end My_Slot; end Derived_Objects;
oeis/304/A304615.asm
neoneye/loda-programs
11
84502
<gh_stars>10-100 ; A304615: a(n) = 507*2^n - 273. ; 234,741,1755,3783,7839,15951,32175,64623,129519,259311,518895,1038063,2076399,4153071,8306415,16613103,33226479,66453231,132906735,265813743,531627759,1063255791,2126511855,4253023983,8506048239,17012096751,34024193775,68048387823,136096775919,272193552111,544387104495,1088774209263,2177548418799,4355096837871,8710193676015,17420387352303,34840774704879,69681549410031,139363098820335,278726197640943,557452395282159,1114904790564591,2229809581129455,4459619162259183,8919238324518639 mov $1,2 pow $1,$0 sub $1,1 mul $1,507 add $1,234 mov $0,$1
Source/CreateThread64/executex64.asm
Coder666/Invoke-CreateRemoteThread64
3
25387
;-----------------------------------------------------------------------------; ; Author: <NAME> (stephen_fewer[at]harmonysecurity[dot]com) ; Compatible: Windows 7, 2008, Vista, 2003, XP ; Architecture: wow64 ; Version: 1.0 (Jan 2010) ; Size: 75 bytes ; Build: >build.py executex64 ;-----------------------------------------------------------------------------; ; A simple function to execute native x64 code from a wow64 (x86) process. ; Can be called from C using the following prototype: ; typedef DWORD (WINAPI * EXECUTEX64)( X64FUNCTION pFunction, DWORD dwParameter ); ; The native x64 function you specify must be in the following form (as well as being x64 code): ; typedef BOOL (WINAPI * X64FUNCTION)( DWORD dwParameter ); ; Clobbers: EAX, ECX and EDX (ala the normal stdcall calling convention) ; Un-Clobbered: EBX, ESI, EDI, ESP and EBP can be expected to remain un-clobbered. [BITS 32] WOW64_CODE_SEGMENT EQU 0x23 X64_CODE_SEGMENT EQU 0x33 start: push ebp ; prologue, save EBP... mov ebp, esp ; and create a new stack frame push esi ; save the registers we shouldn't clobber push edi ; ;TOMW - Modified mov edi, [ebp + 8] ; pContext mov esi, [edi] ; ESI = pFunction mov ecx, [edi + 8] ; ECX = dwParameter call delta ; delta: pop eax ; add eax, (native_x64-delta) ; get the address of native_x64 sub esp, 8 ; alloc some space on stack for far jump mov edx, esp ; EDX will be pointer our far jump mov dword [edx+4], X64_CODE_SEGMENT ; set the native x64 code segment mov dword [edx], eax ; set the address we want to jump to (native_x64) call go_all_native ; perform the transition into native x64 and return here when done. mov ax, ds ; fixes an elusive bug on AMD CPUs, http://blog.rewolf.pl/blog/?p=1484 mov ss, ax ; found and fixed by ReWolf, incorporated by RaMMicHaeL add esp, (8+4+8) ; remove the 8 bytes we allocated + the return address which was never popped off + the qword pushed from native_x64 pop edi ; restore the clobbered registers pop esi ; pop ebp ; restore EBP retn (4*2) ; return to caller (cleaning up our two function params) go_all_native: mov edi, [esp] ; EDI is the wow64 return address jmp dword far [edx] ; perform the far jump, which will return to the caller of go_all_native native_x64: [BITS 64] ; we are now executing native x64 code... xor rax, rax ; zero RAX push rdi ; save RDI (EDI being our wow64 return address) call rsi ; call our native x64 function (the param for our native x64 function is allready in RCX) pop rdi ; restore RDI (EDI being our wow64 return address) push rax ; simply push it to alloc some space mov dword [rsp+4], WOW64_CODE_SEGMENT ; set the wow64 code segment mov dword [rsp], edi ; set the address we want to jump to (the return address from the go_all_native call) jmp dword far [rsp] ; perform the far jump back to the wow64 caller...
src/Algebra/Linear/Core.agda
felko/linear-algebra
15
12669
<gh_stars>10-100 {-# OPTIONS --without-K --safe #-} module Algebra.Linear.Core where open import Relation.Binary open import Relation.Nullary using (¬_) open import Level using (_⊔_) open import Data.Fin using (Fin; suc; zero) VectorAddition : ∀ {c} -> Set c -> Set c VectorAddition V = V -> V -> V ScalarMultiplication : ∀ {c k} -> Set k -> Set c -> Set (k ⊔ c) ScalarMultiplication K V = K -> V -> V
libsrc/spectrum/if1_checkblock.asm
dex4er/deb-z88dk
1
90125
; ; ZX IF1 & Microdrive functions ; ; <NAME> - Oct. 2004 ; ; ; if1_checkblock: ; - check the loaded block for integrity ; - other various checks ; ; $Id: if1_checkblock.asm,v 1.1 2004/10/08 12:33:23 stefano Exp $ ; XLIB if1_checkblock LIB if1_checksum XREF mdvbuffer XDEF if1_sect_read XDEF if1_verifymode status: defb 0 if1_sect_read: defb 0 if1_verifymode: defb 0 if1_checkblock: push ix pop hl ld de,43h ; RECFLAG add hl,de ld bc,14 call if1_checksum ld hl,status ; D70E ld (hl),1 ; jr nz,chksector inc (hl) ld a,(ix+43h) ; RECFLG or (ix+46h) ; 2nd byte of RECLEN and 2 jr z,chk1 bit 1,(ix+43h) ; RECFLG jr z,chksector ld a,(ix+47h) ; RECNAM: file name or a jr nz,chksector chk1: ld a,4 jr chk2 chksector: push ix pop hl ld de,52h ; CHDATA add hl,de ld bc,512 ; 512 bytes of data call if1_checksum ; verify checksum ld a,(status) jr nz,chk2 inc a inc a chk2: ld hl,if1_sect_read ; flag for "sector read" cp (hl) ret c ret z ld (hl),a ld b,a ld a,(if1_verifymode) bit 2,a ld a,b ret nz ; Copy microdrive channel to work buffer push ix pop hl ld de,(mdvbuffer) ld bc,595 ldir ret
programs/oeis/040/A040701.asm
neoneye/loda
22
13657
<reponame>neoneye/loda ; A040701: Continued fraction for sqrt(728). ; 26,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52 mov $1,$0 cmp $0,0 sub $1,$0 gcd $1,2 add $1,24 add $0,$1 mul $0,$1 sub $0,624
ada-wide_characters.ads
mgrojo/adalib
15
1536
<filename>ada-wide_characters.ads<gh_stars>10-100 -- Standard Ada library specification -- Copyright (c) 2003-2018 <NAME> <<EMAIL>> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual --------------------------------------------------------------------------- package Ada.Wide_Characters is pragma Pure (Wide_Characters); end Ada.Wide_Characters;
init.asm
danilocapkob/xv6plus
1
172594
_init: file format elf32-i386-freebsd Disassembly of section .text: 00000000 <main>: char *sh_args[] = { "sh", 0 }; int main(void) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl 0xfffffffc(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 51 push %ecx e: 83 ec 24 sub $0x24,%esp int pid, wpid; if(open("console", O_RDWR) < 0){ 11: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp) 18: 00 19: c7 04 24 27 11 00 00 movl $0x1127,(%esp) 20: e8 af 03 00 00 call 3d4 <open> 25: 85 c0 test %eax,%eax 27: 79 30 jns 59 <main+0x59> mknod("console", 1, 1); 29: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 30: 00 31: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 38: 00 39: c7 04 24 27 11 00 00 movl $0x1127,(%esp) 40: e8 97 03 00 00 call 3dc <mknod> open("console", O_RDWR); 45: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp) 4c: 00 4d: c7 04 24 27 11 00 00 movl $0x1127,(%esp) 54: e8 7b 03 00 00 call 3d4 <open> } dup(0); // stdout 59: c7 04 24 00 00 00 00 movl $0x0,(%esp) 60: e8 a7 03 00 00 call 40c <dup> dup(0); // stderr 65: c7 04 24 00 00 00 00 movl $0x0,(%esp) 6c: e8 9b 03 00 00 call 40c <dup> for(;;){ printf(1, "init: starting sh\n"); 71: c7 44 24 04 2f 11 00 movl $0x112f,0x4(%esp) 78: 00 79: c7 04 24 01 00 00 00 movl $0x1,(%esp) 80: e8 1b 05 00 00 call 5a0 <printf> pid = fork(); 85: e8 02 03 00 00 call 38c <fork> 8a: 89 45 f4 mov %eax,0xfffffff4(%ebp) if(pid < 0){ 8d: 83 7d f4 00 cmpl $0x0,0xfffffff4(%ebp) 91: 79 19 jns ac <main+0xac> printf(1, "init: fork failed\n"); 93: c7 44 24 04 42 11 00 movl $0x1142,0x4(%esp) 9a: 00 9b: c7 04 24 01 00 00 00 movl $0x1,(%esp) a2: e8 f9 04 00 00 call 5a0 <printf> exit(); a7: e8 e8 02 00 00 call 394 <exit> } if(pid == 0){ ac: 83 7d f4 00 cmpl $0x0,0xfffffff4(%ebp) b0: 75 2d jne df <main+0xdf> exec("sh", sh_args); b2: c7 44 24 04 88 11 00 movl $0x1188,0x4(%esp) b9: 00 ba: c7 04 24 24 11 00 00 movl $0x1124,(%esp) c1: e8 06 03 00 00 call 3cc <exec> printf(1, "init: exec sh failed\n"); c6: c7 44 24 04 55 11 00 movl $0x1155,0x4(%esp) cd: 00 ce: c7 04 24 01 00 00 00 movl $0x1,(%esp) d5: e8 c6 04 00 00 call 5a0 <printf> exit(); da: e8 b5 02 00 00 call 394 <exit> } while((wpid=wait()) >= 0 && wpid != pid) df: e8 b8 02 00 00 call 39c <wait> e4: 89 45 f8 mov %eax,0xfffffff8(%ebp) e7: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp) eb: 78 84 js 71 <main+0x71> ed: 8b 45 f8 mov 0xfffffff8(%ebp),%eax f0: 3b 45 f4 cmp 0xfffffff4(%ebp),%eax f3: 75 ea jne df <main+0xdf> { #if 0 printf(1, "zombie!\n"); #endif } } f5: e9 77 ff ff ff jmp 71 <main+0x71> fa: 90 nop fb: 90 nop fc: 90 nop fd: 90 nop fe: 90 nop ff: 90 nop 00000100 <strcpy>: #include "user.h" char* strcpy(char *s, char *t) { 100: 55 push %ebp 101: 89 e5 mov %esp,%ebp 103: 83 ec 10 sub $0x10,%esp char *os; os = s; 106: 8b 45 08 mov 0x8(%ebp),%eax 109: 89 45 fc mov %eax,0xfffffffc(%ebp) while((*s++ = *t++) != 0) 10c: 8b 45 0c mov 0xc(%ebp),%eax 10f: 0f b6 10 movzbl (%eax),%edx 112: 8b 45 08 mov 0x8(%ebp),%eax 115: 88 10 mov %dl,(%eax) 117: 8b 45 08 mov 0x8(%ebp),%eax 11a: 0f b6 00 movzbl (%eax),%eax 11d: 84 c0 test %al,%al 11f: 0f 95 c0 setne %al 122: 83 45 08 01 addl $0x1,0x8(%ebp) 126: 83 45 0c 01 addl $0x1,0xc(%ebp) 12a: 84 c0 test %al,%al 12c: 75 de jne 10c <strcpy+0xc> ; return os; 12e: 8b 45 fc mov 0xfffffffc(%ebp),%eax } 131: c9 leave 132: c3 ret 133: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 139: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi 00000140 <strcmp>: int strcmp(const char *p, const char *q) { 140: 55 push %ebp 141: 89 e5 mov %esp,%ebp while(*p && *p == *q) 143: eb 08 jmp 14d <strcmp+0xd> p++, q++; 145: 83 45 08 01 addl $0x1,0x8(%ebp) 149: 83 45 0c 01 addl $0x1,0xc(%ebp) 14d: 8b 45 08 mov 0x8(%ebp),%eax 150: 0f b6 00 movzbl (%eax),%eax 153: 84 c0 test %al,%al 155: 74 10 je 167 <strcmp+0x27> 157: 8b 45 08 mov 0x8(%ebp),%eax 15a: 0f b6 10 movzbl (%eax),%edx 15d: 8b 45 0c mov 0xc(%ebp),%eax 160: 0f b6 00 movzbl (%eax),%eax 163: 38 c2 cmp %al,%dl 165: 74 de je 145 <strcmp+0x5> return (uchar)*p - (uchar)*q; 167: 8b 45 08 mov 0x8(%ebp),%eax 16a: 0f b6 00 movzbl (%eax),%eax 16d: 0f b6 d0 movzbl %al,%edx 170: 8b 45 0c mov 0xc(%ebp),%eax 173: 0f b6 00 movzbl (%eax),%eax 176: 0f b6 c0 movzbl %al,%eax 179: 89 d1 mov %edx,%ecx 17b: 29 c1 sub %eax,%ecx 17d: 89 c8 mov %ecx,%eax } 17f: 5d pop %ebp 180: c3 ret 181: eb 0d jmp 190 <strlen> 183: 90 nop 184: 90 nop 185: 90 nop 186: 90 nop 187: 90 nop 188: 90 nop 189: 90 nop 18a: 90 nop 18b: 90 nop 18c: 90 nop 18d: 90 nop 18e: 90 nop 18f: 90 nop 00000190 <strlen>: uint strlen(char *s) { 190: 55 push %ebp 191: 89 e5 mov %esp,%ebp 193: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 196: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp) 19d: eb 04 jmp 1a3 <strlen+0x13> 19f: 83 45 fc 01 addl $0x1,0xfffffffc(%ebp) 1a3: 8b 45 fc mov 0xfffffffc(%ebp),%eax 1a6: 03 45 08 add 0x8(%ebp),%eax 1a9: 0f b6 00 movzbl (%eax),%eax 1ac: 84 c0 test %al,%al 1ae: 75 ef jne 19f <strlen+0xf> ; return n; 1b0: 8b 45 fc mov 0xfffffffc(%ebp),%eax } 1b3: c9 leave 1b4: c3 ret 1b5: 8d 74 26 00 lea 0x0(%esi),%esi 1b9: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi 000001c0 <memset>: void* memset(void *dst, int c, uint n) { 1c0: 55 push %ebp 1c1: 89 e5 mov %esp,%ebp 1c3: 83 ec 10 sub $0x10,%esp char *d; d = dst; 1c6: 8b 45 08 mov 0x8(%ebp),%eax 1c9: 89 45 fc mov %eax,0xfffffffc(%ebp) while(n-- > 0) 1cc: eb 0e jmp 1dc <memset+0x1c> *d++ = c; 1ce: 8b 45 0c mov 0xc(%ebp),%eax 1d1: 89 c2 mov %eax,%edx 1d3: 8b 45 fc mov 0xfffffffc(%ebp),%eax 1d6: 88 10 mov %dl,(%eax) 1d8: 83 45 fc 01 addl $0x1,0xfffffffc(%ebp) 1dc: 83 6d 10 01 subl $0x1,0x10(%ebp) 1e0: 83 7d 10 ff cmpl $0xffffffff,0x10(%ebp) 1e4: 75 e8 jne 1ce <memset+0xe> return dst; 1e6: 8b 45 08 mov 0x8(%ebp),%eax } 1e9: c9 leave 1ea: c3 ret 1eb: 90 nop 1ec: 8d 74 26 00 lea 0x0(%esi),%esi 000001f0 <strchr>: char* strchr(const char *s, char c) { 1f0: 55 push %ebp 1f1: 89 e5 mov %esp,%ebp 1f3: 83 ec 08 sub $0x8,%esp 1f6: 8b 45 0c mov 0xc(%ebp),%eax 1f9: 88 45 fc mov %al,0xfffffffc(%ebp) for(; *s; s++) 1fc: eb 17 jmp 215 <strchr+0x25> if(*s == c) 1fe: 8b 45 08 mov 0x8(%ebp),%eax 201: 0f b6 00 movzbl (%eax),%eax 204: 3a 45 fc cmp 0xfffffffc(%ebp),%al 207: 75 08 jne 211 <strchr+0x21> return (char*) s; 209: 8b 45 08 mov 0x8(%ebp),%eax 20c: 89 45 f8 mov %eax,0xfffffff8(%ebp) 20f: eb 15 jmp 226 <strchr+0x36> 211: 83 45 08 01 addl $0x1,0x8(%ebp) 215: 8b 45 08 mov 0x8(%ebp),%eax 218: 0f b6 00 movzbl (%eax),%eax 21b: 84 c0 test %al,%al 21d: 75 df jne 1fe <strchr+0xe> return 0; 21f: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp) 226: 8b 45 f8 mov 0xfffffff8(%ebp),%eax } 229: c9 leave 22a: c3 ret 22b: 90 nop 22c: 8d 74 26 00 lea 0x0(%esi),%esi 00000230 <gets>: char* gets(char *buf, int max) { 230: 55 push %ebp 231: 89 e5 mov %esp,%ebp 233: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 236: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp) 23d: eb 46 jmp 285 <gets+0x55> cc = read(0, &c, 1); 23f: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 246: 00 247: 8d 45 f7 lea 0xfffffff7(%ebp),%eax 24a: 89 44 24 04 mov %eax,0x4(%esp) 24e: c7 04 24 00 00 00 00 movl $0x0,(%esp) 255: e8 52 01 00 00 call 3ac <read> 25a: 89 45 fc mov %eax,0xfffffffc(%ebp) if(cc < 1) 25d: 83 7d fc 00 cmpl $0x0,0xfffffffc(%ebp) 261: 7e 2d jle 290 <gets+0x60> break; buf[i++] = c; 263: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 266: 89 c2 mov %eax,%edx 268: 03 55 08 add 0x8(%ebp),%edx 26b: 0f b6 45 f7 movzbl 0xfffffff7(%ebp),%eax 26f: 88 02 mov %al,(%edx) 271: 83 45 f8 01 addl $0x1,0xfffffff8(%ebp) if(c == '\n' || c == '\r') 275: 0f b6 45 f7 movzbl 0xfffffff7(%ebp),%eax 279: 3c 0a cmp $0xa,%al 27b: 74 13 je 290 <gets+0x60> 27d: 0f b6 45 f7 movzbl 0xfffffff7(%ebp),%eax 281: 3c 0d cmp $0xd,%al 283: 74 0b je 290 <gets+0x60> 285: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 288: 83 c0 01 add $0x1,%eax 28b: 3b 45 0c cmp 0xc(%ebp),%eax 28e: 7c af jl 23f <gets+0xf> break; } buf[i] = '\0'; 290: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 293: 03 45 08 add 0x8(%ebp),%eax 296: c6 00 00 movb $0x0,(%eax) return buf; 299: 8b 45 08 mov 0x8(%ebp),%eax } 29c: c9 leave 29d: c3 ret 29e: 89 f6 mov %esi,%esi 000002a0 <stat>: int stat(char *n, struct stat *st) { 2a0: 55 push %ebp 2a1: 89 e5 mov %esp,%ebp 2a3: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 2a6: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 2ad: 00 2ae: 8b 45 08 mov 0x8(%ebp),%eax 2b1: 89 04 24 mov %eax,(%esp) 2b4: e8 1b 01 00 00 call 3d4 <open> 2b9: 89 45 f8 mov %eax,0xfffffff8(%ebp) if(fd < 0) 2bc: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp) 2c0: 79 09 jns 2cb <stat+0x2b> return -1; 2c2: c7 45 ec ff ff ff ff movl $0xffffffff,0xffffffec(%ebp) 2c9: eb 26 jmp 2f1 <stat+0x51> r = fstat(fd, st); 2cb: 8b 45 0c mov 0xc(%ebp),%eax 2ce: 89 44 24 04 mov %eax,0x4(%esp) 2d2: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 2d5: 89 04 24 mov %eax,(%esp) 2d8: e8 0f 01 00 00 call 3ec <fstat> 2dd: 89 45 fc mov %eax,0xfffffffc(%ebp) close(fd); 2e0: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 2e3: 89 04 24 mov %eax,(%esp) 2e6: e8 d1 00 00 00 call 3bc <close> return r; 2eb: 8b 45 fc mov 0xfffffffc(%ebp),%eax 2ee: 89 45 ec mov %eax,0xffffffec(%ebp) 2f1: 8b 45 ec mov 0xffffffec(%ebp),%eax } 2f4: c9 leave 2f5: c3 ret 2f6: 8d 76 00 lea 0x0(%esi),%esi 2f9: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi 00000300 <atoi>: int atoi(const char *s) { 300: 55 push %ebp 301: 89 e5 mov %esp,%ebp 303: 83 ec 10 sub $0x10,%esp int n; n = 0; 306: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp) while('0' <= *s && *s <= '9') 30d: eb 24 jmp 333 <atoi+0x33> n = n*10 + *s++ - '0'; 30f: 8b 55 fc mov 0xfffffffc(%ebp),%edx 312: 89 d0 mov %edx,%eax 314: c1 e0 02 shl $0x2,%eax 317: 01 d0 add %edx,%eax 319: 01 c0 add %eax,%eax 31b: 89 c2 mov %eax,%edx 31d: 8b 45 08 mov 0x8(%ebp),%eax 320: 0f b6 00 movzbl (%eax),%eax 323: 0f be c0 movsbl %al,%eax 326: 8d 04 02 lea (%edx,%eax,1),%eax 329: 83 e8 30 sub $0x30,%eax 32c: 89 45 fc mov %eax,0xfffffffc(%ebp) 32f: 83 45 08 01 addl $0x1,0x8(%ebp) 333: 8b 45 08 mov 0x8(%ebp),%eax 336: 0f b6 00 movzbl (%eax),%eax 339: 3c 2f cmp $0x2f,%al 33b: 7e 0a jle 347 <atoi+0x47> 33d: 8b 45 08 mov 0x8(%ebp),%eax 340: 0f b6 00 movzbl (%eax),%eax 343: 3c 39 cmp $0x39,%al 345: 7e c8 jle 30f <atoi+0xf> return n; 347: 8b 45 fc mov 0xfffffffc(%ebp),%eax } 34a: c9 leave 34b: c3 ret 34c: 8d 74 26 00 lea 0x0(%esi),%esi 00000350 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 350: 55 push %ebp 351: 89 e5 mov %esp,%ebp 353: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 356: 8b 45 08 mov 0x8(%ebp),%eax 359: 89 45 f8 mov %eax,0xfffffff8(%ebp) src = vsrc; 35c: 8b 45 0c mov 0xc(%ebp),%eax 35f: 89 45 fc mov %eax,0xfffffffc(%ebp) while(n-- > 0) 362: eb 13 jmp 377 <memmove+0x27> *dst++ = *src++; 364: 8b 45 fc mov 0xfffffffc(%ebp),%eax 367: 0f b6 10 movzbl (%eax),%edx 36a: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 36d: 88 10 mov %dl,(%eax) 36f: 83 45 f8 01 addl $0x1,0xfffffff8(%ebp) 373: 83 45 fc 01 addl $0x1,0xfffffffc(%ebp) 377: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 37b: 0f 9f c0 setg %al 37e: 83 6d 10 01 subl $0x1,0x10(%ebp) 382: 84 c0 test %al,%al 384: 75 de jne 364 <memmove+0x14> return vdst; 386: 8b 45 08 mov 0x8(%ebp),%eax } 389: c9 leave 38a: c3 ret 38b: 90 nop 0000038c <fork>: 38c: b8 01 00 00 00 mov $0x1,%eax 391: cd 30 int $0x30 393: c3 ret 00000394 <exit>: 394: b8 02 00 00 00 mov $0x2,%eax 399: cd 30 int $0x30 39b: c3 ret 0000039c <wait>: 39c: b8 03 00 00 00 mov $0x3,%eax 3a1: cd 30 int $0x30 3a3: c3 ret 000003a4 <pipe>: 3a4: b8 04 00 00 00 mov $0x4,%eax 3a9: cd 30 int $0x30 3ab: c3 ret 000003ac <read>: 3ac: b8 06 00 00 00 mov $0x6,%eax 3b1: cd 30 int $0x30 3b3: c3 ret 000003b4 <write>: 3b4: b8 05 00 00 00 mov $0x5,%eax 3b9: cd 30 int $0x30 3bb: c3 ret 000003bc <close>: 3bc: b8 07 00 00 00 mov $0x7,%eax 3c1: cd 30 int $0x30 3c3: c3 ret 000003c4 <kill>: 3c4: b8 08 00 00 00 mov $0x8,%eax 3c9: cd 30 int $0x30 3cb: c3 ret 000003cc <exec>: 3cc: b8 09 00 00 00 mov $0x9,%eax 3d1: cd 30 int $0x30 3d3: c3 ret 000003d4 <open>: 3d4: b8 0a 00 00 00 mov $0xa,%eax 3d9: cd 30 int $0x30 3db: c3 ret 000003dc <mknod>: 3dc: b8 0b 00 00 00 mov $0xb,%eax 3e1: cd 30 int $0x30 3e3: c3 ret 000003e4 <unlink>: 3e4: b8 0c 00 00 00 mov $0xc,%eax 3e9: cd 30 int $0x30 3eb: c3 ret 000003ec <fstat>: 3ec: b8 0d 00 00 00 mov $0xd,%eax 3f1: cd 30 int $0x30 3f3: c3 ret 000003f4 <link>: 3f4: b8 0e 00 00 00 mov $0xe,%eax 3f9: cd 30 int $0x30 3fb: c3 ret 000003fc <mkdir>: 3fc: b8 0f 00 00 00 mov $0xf,%eax 401: cd 30 int $0x30 403: c3 ret 00000404 <chdir>: 404: b8 10 00 00 00 mov $0x10,%eax 409: cd 30 int $0x30 40b: c3 ret 0000040c <dup>: 40c: b8 11 00 00 00 mov $0x11,%eax 411: cd 30 int $0x30 413: c3 ret 00000414 <getpid>: 414: b8 12 00 00 00 mov $0x12,%eax 419: cd 30 int $0x30 41b: c3 ret 0000041c <sbrk>: 41c: b8 13 00 00 00 mov $0x13,%eax 421: cd 30 int $0x30 423: c3 ret 00000424 <sleep>: 424: b8 14 00 00 00 mov $0x14,%eax 429: cd 30 int $0x30 42b: c3 ret 0000042c <upmsec>: 42c: b8 15 00 00 00 mov $0x15,%eax 431: cd 30 int $0x30 433: c3 ret 00000434 <socket>: 434: b8 16 00 00 00 mov $0x16,%eax 439: cd 30 int $0x30 43b: c3 ret 0000043c <bind>: 43c: b8 17 00 00 00 mov $0x17,%eax 441: cd 30 int $0x30 443: c3 ret 00000444 <listen>: 444: b8 18 00 00 00 mov $0x18,%eax 449: cd 30 int $0x30 44b: c3 ret 0000044c <accept>: 44c: b8 19 00 00 00 mov $0x19,%eax 451: cd 30 int $0x30 453: c3 ret 00000454 <recv>: 454: b8 1a 00 00 00 mov $0x1a,%eax 459: cd 30 int $0x30 45b: c3 ret 0000045c <recvfrom>: 45c: b8 1b 00 00 00 mov $0x1b,%eax 461: cd 30 int $0x30 463: c3 ret 00000464 <send>: 464: b8 1c 00 00 00 mov $0x1c,%eax 469: cd 30 int $0x30 46b: c3 ret 0000046c <sendto>: 46c: b8 1d 00 00 00 mov $0x1d,%eax 471: cd 30 int $0x30 473: c3 ret 00000474 <shutdown>: 474: b8 1e 00 00 00 mov $0x1e,%eax 479: cd 30 int $0x30 47b: c3 ret 0000047c <getsockopt>: 47c: b8 1f 00 00 00 mov $0x1f,%eax 481: cd 30 int $0x30 483: c3 ret 00000484 <setsockopt>: 484: b8 20 00 00 00 mov $0x20,%eax 489: cd 30 int $0x30 48b: c3 ret 0000048c <sockclose>: 48c: b8 21 00 00 00 mov $0x21,%eax 491: cd 30 int $0x30 493: c3 ret 00000494 <connect>: 494: b8 22 00 00 00 mov $0x22,%eax 499: cd 30 int $0x30 49b: c3 ret 0000049c <getpeername>: 49c: b8 23 00 00 00 mov $0x23,%eax 4a1: cd 30 int $0x30 4a3: c3 ret 000004a4 <getsockname>: 4a4: b8 24 00 00 00 mov $0x24,%eax 4a9: cd 30 int $0x30 4ab: c3 ret 4ac: 90 nop 4ad: 90 nop 4ae: 90 nop 4af: 90 nop 000004b0 <putc>: #include "user.h" void putc(int fd, char c) { 4b0: 55 push %ebp 4b1: 89 e5 mov %esp,%ebp 4b3: 83 ec 18 sub $0x18,%esp 4b6: 8b 45 0c mov 0xc(%ebp),%eax 4b9: 88 45 fc mov %al,0xfffffffc(%ebp) write(fd, &c, 1); 4bc: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 4c3: 00 4c4: 8d 45 fc lea 0xfffffffc(%ebp),%eax 4c7: 89 44 24 04 mov %eax,0x4(%esp) 4cb: 8b 45 08 mov 0x8(%ebp),%eax 4ce: 89 04 24 mov %eax,(%esp) 4d1: e8 de fe ff ff call 3b4 <write> } 4d6: c9 leave 4d7: c3 ret 4d8: 90 nop 4d9: 8d b4 26 00 00 00 00 lea 0x0(%esi),%esi 000004e0 <printint>: static void printint(int fd, int xx, int base, int sgn) { 4e0: 55 push %ebp 4e1: 89 e5 mov %esp,%ebp 4e3: 53 push %ebx 4e4: 83 ec 34 sub $0x34,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 4e7: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp) if(sgn && xx < 0){ 4ee: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 4f2: 74 17 je 50b <printint+0x2b> 4f4: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 4f8: 79 11 jns 50b <printint+0x2b> neg = 1; 4fa: c7 45 f4 01 00 00 00 movl $0x1,0xfffffff4(%ebp) x = -xx; 501: 8b 45 0c mov 0xc(%ebp),%eax 504: f7 d8 neg %eax 506: 89 45 f8 mov %eax,0xfffffff8(%ebp) 509: eb 06 jmp 511 <printint+0x31> } else { x = xx; 50b: 8b 45 0c mov 0xc(%ebp),%eax 50e: 89 45 f8 mov %eax,0xfffffff8(%ebp) } i = 0; 511: c7 45 f0 00 00 00 00 movl $0x0,0xfffffff0(%ebp) do{ buf[i++] = digits[x % base]; 518: 8b 4d f0 mov 0xfffffff0(%ebp),%ecx 51b: 8b 55 10 mov 0x10(%ebp),%edx 51e: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 521: 89 d3 mov %edx,%ebx 523: ba 00 00 00 00 mov $0x0,%edx 528: f7 f3 div %ebx 52a: 89 d0 mov %edx,%eax 52c: 0f b6 80 90 11 00 00 movzbl 0x1190(%eax),%eax 533: 88 44 0d e0 mov %al,0xffffffe0(%ebp,%ecx,1) 537: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp) }while((x /= base) != 0); 53b: 8b 55 10 mov 0x10(%ebp),%edx 53e: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 541: 89 d1 mov %edx,%ecx 543: ba 00 00 00 00 mov $0x0,%edx 548: f7 f1 div %ecx 54a: 89 45 f8 mov %eax,0xfffffff8(%ebp) 54d: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp) 551: 75 c5 jne 518 <printint+0x38> if(neg) 553: 83 7d f4 00 cmpl $0x0,0xfffffff4(%ebp) 557: 74 28 je 581 <printint+0xa1> buf[i++] = '-'; 559: 8b 45 f0 mov 0xfffffff0(%ebp),%eax 55c: c6 44 05 e0 2d movb $0x2d,0xffffffe0(%ebp,%eax,1) 561: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp) while(--i >= 0) 565: eb 1a jmp 581 <printint+0xa1> putc(fd, buf[i]); 567: 8b 45 f0 mov 0xfffffff0(%ebp),%eax 56a: 0f b6 44 05 e0 movzbl 0xffffffe0(%ebp,%eax,1),%eax 56f: 0f be c0 movsbl %al,%eax 572: 89 44 24 04 mov %eax,0x4(%esp) 576: 8b 45 08 mov 0x8(%ebp),%eax 579: 89 04 24 mov %eax,(%esp) 57c: e8 2f ff ff ff call 4b0 <putc> 581: 83 6d f0 01 subl $0x1,0xfffffff0(%ebp) 585: 83 7d f0 00 cmpl $0x0,0xfffffff0(%ebp) 589: 79 dc jns 567 <printint+0x87> } 58b: 83 c4 34 add $0x34,%esp 58e: 5b pop %ebx 58f: 5d pop %ebp 590: c3 ret 591: eb 0d jmp 5a0 <printf> 593: 90 nop 594: 90 nop 595: 90 nop 596: 90 nop 597: 90 nop 598: 90 nop 599: 90 nop 59a: 90 nop 59b: 90 nop 59c: 90 nop 59d: 90 nop 59e: 90 nop 59f: 90 nop 000005a0 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 5a0: 55 push %ebp 5a1: 89 e5 mov %esp,%ebp 5a3: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 5a6: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp) ap = (uint*)(void*)&fmt + 1; 5ad: 8d 45 0c lea 0xc(%ebp),%eax 5b0: 83 c0 04 add $0x4,%eax 5b3: 89 45 fc mov %eax,0xfffffffc(%ebp) for(i = 0; fmt[i]; i++){ 5b6: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp) 5bd: e9 7b 01 00 00 jmp 73d <printf+0x19d> c = fmt[i] & 0xff; 5c2: 8b 55 0c mov 0xc(%ebp),%edx 5c5: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 5c8: 8d 04 02 lea (%edx,%eax,1),%eax 5cb: 0f b6 00 movzbl (%eax),%eax 5ce: 0f be c0 movsbl %al,%eax 5d1: 25 ff 00 00 00 and $0xff,%eax 5d6: 89 45 f0 mov %eax,0xfffffff0(%ebp) if(state == 0){ 5d9: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp) 5dd: 75 2c jne 60b <printf+0x6b> if(c == '%'){ 5df: 83 7d f0 25 cmpl $0x25,0xfffffff0(%ebp) 5e3: 75 0c jne 5f1 <printf+0x51> state = '%'; 5e5: c7 45 f8 25 00 00 00 movl $0x25,0xfffffff8(%ebp) 5ec: e9 48 01 00 00 jmp 739 <printf+0x199> } else { putc(fd, c); 5f1: 8b 45 f0 mov 0xfffffff0(%ebp),%eax 5f4: 0f be c0 movsbl %al,%eax 5f7: 89 44 24 04 mov %eax,0x4(%esp) 5fb: 8b 45 08 mov 0x8(%ebp),%eax 5fe: 89 04 24 mov %eax,(%esp) 601: e8 aa fe ff ff call 4b0 <putc> 606: e9 2e 01 00 00 jmp 739 <printf+0x199> } } else if(state == '%'){ 60b: 83 7d f8 25 cmpl $0x25,0xfffffff8(%ebp) 60f: 0f 85 24 01 00 00 jne 739 <printf+0x199> if(c == 'd'){ 615: 83 7d f0 64 cmpl $0x64,0xfffffff0(%ebp) 619: 75 2d jne 648 <printf+0xa8> printint(fd, *ap, 10, 1); 61b: 8b 45 fc mov 0xfffffffc(%ebp),%eax 61e: 8b 00 mov (%eax),%eax 620: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 627: 00 628: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 62f: 00 630: 89 44 24 04 mov %eax,0x4(%esp) 634: 8b 45 08 mov 0x8(%ebp),%eax 637: 89 04 24 mov %eax,(%esp) 63a: e8 a1 fe ff ff call 4e0 <printint> ap++; 63f: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp) 643: e9 ea 00 00 00 jmp 732 <printf+0x192> } else if(c == 'x' || c == 'p'){ 648: 83 7d f0 78 cmpl $0x78,0xfffffff0(%ebp) 64c: 74 06 je 654 <printf+0xb4> 64e: 83 7d f0 70 cmpl $0x70,0xfffffff0(%ebp) 652: 75 2d jne 681 <printf+0xe1> printint(fd, *ap, 16, 0); 654: 8b 45 fc mov 0xfffffffc(%ebp),%eax 657: 8b 00 mov (%eax),%eax 659: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 660: 00 661: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 668: 00 669: 89 44 24 04 mov %eax,0x4(%esp) 66d: 8b 45 08 mov 0x8(%ebp),%eax 670: 89 04 24 mov %eax,(%esp) 673: e8 68 fe ff ff call 4e0 <printint> ap++; 678: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp) 67c: e9 b1 00 00 00 jmp 732 <printf+0x192> } else if(c == 's'){ 681: 83 7d f0 73 cmpl $0x73,0xfffffff0(%ebp) 685: 75 43 jne 6ca <printf+0x12a> s = (char*)*ap; 687: 8b 45 fc mov 0xfffffffc(%ebp),%eax 68a: 8b 00 mov (%eax),%eax 68c: 89 45 ec mov %eax,0xffffffec(%ebp) ap++; 68f: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp) if(s == 0) 693: 83 7d ec 00 cmpl $0x0,0xffffffec(%ebp) 697: 75 25 jne 6be <printf+0x11e> s = "(null)"; 699: c7 45 ec 6b 11 00 00 movl $0x116b,0xffffffec(%ebp) while(*s != 0){ 6a0: eb 1c jmp 6be <printf+0x11e> putc(fd, *s); 6a2: 8b 45 ec mov 0xffffffec(%ebp),%eax 6a5: 0f b6 00 movzbl (%eax),%eax 6a8: 0f be c0 movsbl %al,%eax 6ab: 89 44 24 04 mov %eax,0x4(%esp) 6af: 8b 45 08 mov 0x8(%ebp),%eax 6b2: 89 04 24 mov %eax,(%esp) 6b5: e8 f6 fd ff ff call 4b0 <putc> s++; 6ba: 83 45 ec 01 addl $0x1,0xffffffec(%ebp) 6be: 8b 45 ec mov 0xffffffec(%ebp),%eax 6c1: 0f b6 00 movzbl (%eax),%eax 6c4: 84 c0 test %al,%al 6c6: 75 da jne 6a2 <printf+0x102> 6c8: eb 68 jmp 732 <printf+0x192> } } else if(c == 'c'){ 6ca: 83 7d f0 63 cmpl $0x63,0xfffffff0(%ebp) 6ce: 75 1d jne 6ed <printf+0x14d> putc(fd, *ap); 6d0: 8b 45 fc mov 0xfffffffc(%ebp),%eax 6d3: 8b 00 mov (%eax),%eax 6d5: 0f be c0 movsbl %al,%eax 6d8: 89 44 24 04 mov %eax,0x4(%esp) 6dc: 8b 45 08 mov 0x8(%ebp),%eax 6df: 89 04 24 mov %eax,(%esp) 6e2: e8 c9 fd ff ff call 4b0 <putc> ap++; 6e7: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp) 6eb: eb 45 jmp 732 <printf+0x192> } else if(c == '%'){ 6ed: 83 7d f0 25 cmpl $0x25,0xfffffff0(%ebp) 6f1: 75 17 jne 70a <printf+0x16a> putc(fd, c); 6f3: 8b 45 f0 mov 0xfffffff0(%ebp),%eax 6f6: 0f be c0 movsbl %al,%eax 6f9: 89 44 24 04 mov %eax,0x4(%esp) 6fd: 8b 45 08 mov 0x8(%ebp),%eax 700: 89 04 24 mov %eax,(%esp) 703: e8 a8 fd ff ff call 4b0 <putc> 708: eb 28 jmp 732 <printf+0x192> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 70a: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 711: 00 712: 8b 45 08 mov 0x8(%ebp),%eax 715: 89 04 24 mov %eax,(%esp) 718: e8 93 fd ff ff call 4b0 <putc> putc(fd, c); 71d: 8b 45 f0 mov 0xfffffff0(%ebp),%eax 720: 0f be c0 movsbl %al,%eax 723: 89 44 24 04 mov %eax,0x4(%esp) 727: 8b 45 08 mov 0x8(%ebp),%eax 72a: 89 04 24 mov %eax,(%esp) 72d: e8 7e fd ff ff call 4b0 <putc> } state = 0; 732: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp) 739: 83 45 f4 01 addl $0x1,0xfffffff4(%ebp) 73d: 8b 55 0c mov 0xc(%ebp),%edx 740: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 743: 8d 04 02 lea (%edx,%eax,1),%eax 746: 0f b6 00 movzbl (%eax),%eax 749: 84 c0 test %al,%al 74b: 0f 85 71 fe ff ff jne 5c2 <printf+0x22> } } } 751: c9 leave 752: c3 ret 753: 90 nop 754: 90 nop 755: 90 nop 756: 90 nop 757: 90 nop 758: 90 nop 759: 90 nop 75a: 90 nop 75b: 90 nop 75c: 90 nop 75d: 90 nop 75e: 90 nop 75f: 90 nop 00000760 <free>: static Header *freep; void free(void *ap) { 760: 55 push %ebp 761: 89 e5 mov %esp,%ebp 763: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*) ap - 1; 766: 8b 45 08 mov 0x8(%ebp),%eax 769: 83 e8 08 sub $0x8,%eax 76c: 89 45 f8 mov %eax,0xfffffff8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 76f: a1 ac 11 00 00 mov 0x11ac,%eax 774: 89 45 fc mov %eax,0xfffffffc(%ebp) 777: eb 24 jmp 79d <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 779: 8b 45 fc mov 0xfffffffc(%ebp),%eax 77c: 8b 00 mov (%eax),%eax 77e: 3b 45 fc cmp 0xfffffffc(%ebp),%eax 781: 77 12 ja 795 <free+0x35> 783: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 786: 3b 45 fc cmp 0xfffffffc(%ebp),%eax 789: 77 24 ja 7af <free+0x4f> 78b: 8b 45 fc mov 0xfffffffc(%ebp),%eax 78e: 8b 00 mov (%eax),%eax 790: 3b 45 f8 cmp 0xfffffff8(%ebp),%eax 793: 77 1a ja 7af <free+0x4f> 795: 8b 45 fc mov 0xfffffffc(%ebp),%eax 798: 8b 00 mov (%eax),%eax 79a: 89 45 fc mov %eax,0xfffffffc(%ebp) 79d: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 7a0: 3b 45 fc cmp 0xfffffffc(%ebp),%eax 7a3: 76 d4 jbe 779 <free+0x19> 7a5: 8b 45 fc mov 0xfffffffc(%ebp),%eax 7a8: 8b 00 mov (%eax),%eax 7aa: 3b 45 f8 cmp 0xfffffff8(%ebp),%eax 7ad: 76 ca jbe 779 <free+0x19> break; if(bp + bp->s.size == p->s.ptr){ 7af: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 7b2: 8b 40 04 mov 0x4(%eax),%eax 7b5: c1 e0 03 shl $0x3,%eax 7b8: 89 c2 mov %eax,%edx 7ba: 03 55 f8 add 0xfffffff8(%ebp),%edx 7bd: 8b 45 fc mov 0xfffffffc(%ebp),%eax 7c0: 8b 00 mov (%eax),%eax 7c2: 39 c2 cmp %eax,%edx 7c4: 75 24 jne 7ea <free+0x8a> bp->s.size += p->s.ptr->s.size; 7c6: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 7c9: 8b 50 04 mov 0x4(%eax),%edx 7cc: 8b 45 fc mov 0xfffffffc(%ebp),%eax 7cf: 8b 00 mov (%eax),%eax 7d1: 8b 40 04 mov 0x4(%eax),%eax 7d4: 01 c2 add %eax,%edx 7d6: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 7d9: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 7dc: 8b 45 fc mov 0xfffffffc(%ebp),%eax 7df: 8b 00 mov (%eax),%eax 7e1: 8b 10 mov (%eax),%edx 7e3: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 7e6: 89 10 mov %edx,(%eax) 7e8: eb 0a jmp 7f4 <free+0x94> } else bp->s.ptr = p->s.ptr; 7ea: 8b 45 fc mov 0xfffffffc(%ebp),%eax 7ed: 8b 10 mov (%eax),%edx 7ef: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 7f2: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 7f4: 8b 45 fc mov 0xfffffffc(%ebp),%eax 7f7: 8b 40 04 mov 0x4(%eax),%eax 7fa: c1 e0 03 shl $0x3,%eax 7fd: 03 45 fc add 0xfffffffc(%ebp),%eax 800: 3b 45 f8 cmp 0xfffffff8(%ebp),%eax 803: 75 20 jne 825 <free+0xc5> p->s.size += bp->s.size; 805: 8b 45 fc mov 0xfffffffc(%ebp),%eax 808: 8b 50 04 mov 0x4(%eax),%edx 80b: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 80e: 8b 40 04 mov 0x4(%eax),%eax 811: 01 c2 add %eax,%edx 813: 8b 45 fc mov 0xfffffffc(%ebp),%eax 816: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 819: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 81c: 8b 10 mov (%eax),%edx 81e: 8b 45 fc mov 0xfffffffc(%ebp),%eax 821: 89 10 mov %edx,(%eax) 823: eb 08 jmp 82d <free+0xcd> } else p->s.ptr = bp; 825: 8b 55 fc mov 0xfffffffc(%ebp),%edx 828: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 82b: 89 02 mov %eax,(%edx) freep = p; 82d: 8b 45 fc mov 0xfffffffc(%ebp),%eax 830: a3 ac 11 00 00 mov %eax,0x11ac } 835: c9 leave 836: c3 ret 837: 89 f6 mov %esi,%esi 839: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi 00000840 <morecore>: static Header* morecore(uint nu) { 840: 55 push %ebp 841: 89 e5 mov %esp,%ebp 843: 83 ec 18 sub $0x18,%esp char *p; Header *hp; int size; #ifdef UMALLOC_DEBUG printf(1, "morecore: %d\n", nu); #endif #ifdef UMALLOC_NOALIGN if(nu < PAGE) nu = PAGE; #else size = nu * sizeof(Header); 846: 8b 45 08 mov 0x8(%ebp),%eax 849: c1 e0 03 shl $0x3,%eax 84c: 89 45 fc mov %eax,0xfffffffc(%ebp) size += PAGE - size % PAGE; 84f: 8b 55 fc mov 0xfffffffc(%ebp),%edx 852: 89 d0 mov %edx,%eax 854: c1 f8 1f sar $0x1f,%eax 857: 89 c1 mov %eax,%ecx 859: c1 e9 14 shr $0x14,%ecx 85c: 8d 04 0a lea (%edx,%ecx,1),%eax 85f: 25 ff 0f 00 00 and $0xfff,%eax 864: 29 c8 sub %ecx,%eax 866: 89 c2 mov %eax,%edx 868: b8 00 10 00 00 mov $0x1000,%eax 86d: 29 d0 sub %edx,%eax 86f: 01 45 fc add %eax,0xfffffffc(%ebp) #endif #ifdef UMALLOC_DEBUG printf(1, "size: %d\n", size); #endif p = sbrk(size); 872: 8b 45 fc mov 0xfffffffc(%ebp),%eax 875: 89 04 24 mov %eax,(%esp) 878: e8 9f fb ff ff call 41c <sbrk> 87d: 89 45 f4 mov %eax,0xfffffff4(%ebp) if(p == (char*) -1) 880: 83 7d f4 ff cmpl $0xffffffff,0xfffffff4(%ebp) 884: 75 09 jne 88f <morecore+0x4f> return 0; 886: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp) 88d: eb 2a jmp 8b9 <morecore+0x79> hp = (Header*)p; 88f: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 892: 89 45 f8 mov %eax,0xfffffff8(%ebp) #ifdef UMALLOC_NOALIGN hp->s.size = nu; #else hp->s.size = size / sizeof(Header); 895: 8b 45 fc mov 0xfffffffc(%ebp),%eax 898: 89 c2 mov %eax,%edx 89a: c1 ea 03 shr $0x3,%edx 89d: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 8a0: 89 50 04 mov %edx,0x4(%eax) #endif free((void*)(hp + 1)); 8a3: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 8a6: 83 c0 08 add $0x8,%eax 8a9: 89 04 24 mov %eax,(%esp) 8ac: e8 af fe ff ff call 760 <free> return freep; 8b1: a1 ac 11 00 00 mov 0x11ac,%eax 8b6: 89 45 ec mov %eax,0xffffffec(%ebp) 8b9: 8b 45 ec mov 0xffffffec(%ebp),%eax } 8bc: c9 leave 8bd: c3 ret 8be: 89 f6 mov %esi,%esi 000008c0 <malloc>: void* malloc(uint nbytes) { 8c0: 55 push %ebp 8c1: 89 e5 mov %esp,%ebp 8c3: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; #ifdef UMALLOC_DEBUG printf(1, "malloc: %d bytes\n", nbytes); printf(1, "size of Header: %d\n", sizeof(Header)); #endif if (PAGE % sizeof(Header)) printf(2, "Warning! align failed! Need UMALLOC_NOALIGN\n"); nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 8c6: 8b 45 08 mov 0x8(%ebp),%eax 8c9: 83 c0 07 add $0x7,%eax 8cc: c1 e8 03 shr $0x3,%eax 8cf: 83 c0 01 add $0x1,%eax 8d2: 89 45 fc mov %eax,0xfffffffc(%ebp) if((prevp = freep) == 0){ 8d5: a1 ac 11 00 00 mov 0x11ac,%eax 8da: 89 45 f8 mov %eax,0xfffffff8(%ebp) 8dd: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp) 8e1: 75 23 jne 906 <malloc+0x46> base.s.ptr = freep = prevp = &base; 8e3: c7 45 f8 a4 11 00 00 movl $0x11a4,0xfffffff8(%ebp) 8ea: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 8ed: a3 ac 11 00 00 mov %eax,0x11ac 8f2: a1 ac 11 00 00 mov 0x11ac,%eax 8f7: a3 a4 11 00 00 mov %eax,0x11a4 base.s.size = 0; 8fc: c7 05 a8 11 00 00 00 movl $0x0,0x11a8 903: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 906: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 909: 8b 00 mov (%eax),%eax 90b: 89 45 f4 mov %eax,0xfffffff4(%ebp) if(p->s.size >= nunits){ 90e: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 911: 8b 40 04 mov 0x4(%eax),%eax 914: 3b 45 fc cmp 0xfffffffc(%ebp),%eax 917: 72 50 jb 969 <malloc+0xa9> if(p->s.size == nunits) 919: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 91c: 8b 40 04 mov 0x4(%eax),%eax 91f: 3b 45 fc cmp 0xfffffffc(%ebp),%eax 922: 75 0c jne 930 <malloc+0x70> prevp->s.ptr = p->s.ptr; 924: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 927: 8b 10 mov (%eax),%edx 929: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 92c: 89 10 mov %edx,(%eax) 92e: eb 26 jmp 956 <malloc+0x96> else { p->s.size -= nunits; 930: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 933: 8b 40 04 mov 0x4(%eax),%eax 936: 89 c2 mov %eax,%edx 938: 2b 55 fc sub 0xfffffffc(%ebp),%edx 93b: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 93e: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 941: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 944: 8b 40 04 mov 0x4(%eax),%eax 947: c1 e0 03 shl $0x3,%eax 94a: 01 45 f4 add %eax,0xfffffff4(%ebp) p->s.size = nunits; 94d: 8b 55 f4 mov 0xfffffff4(%ebp),%edx 950: 8b 45 fc mov 0xfffffffc(%ebp),%eax 953: 89 42 04 mov %eax,0x4(%edx) } freep = prevp; 956: 8b 45 f8 mov 0xfffffff8(%ebp),%eax 959: a3 ac 11 00 00 mov %eax,0x11ac return (void*) (p + 1); 95e: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 961: 83 c0 08 add $0x8,%eax 964: 89 45 ec mov %eax,0xffffffec(%ebp) 967: eb 3a jmp 9a3 <malloc+0xe3> } if(p == freep) 969: a1 ac 11 00 00 mov 0x11ac,%eax 96e: 39 45 f4 cmp %eax,0xfffffff4(%ebp) 971: 75 1d jne 990 <malloc+0xd0> if((p = morecore(nunits)) == 0) 973: 8b 45 fc mov 0xfffffffc(%ebp),%eax 976: 89 04 24 mov %eax,(%esp) 979: e8 c2 fe ff ff call 840 <morecore> 97e: 89 45 f4 mov %eax,0xfffffff4(%ebp) 981: 83 7d f4 00 cmpl $0x0,0xfffffff4(%ebp) 985: 75 09 jne 990 <malloc+0xd0> return 0; 987: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp) 98e: eb 13 jmp 9a3 <malloc+0xe3> 990: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 993: 89 45 f8 mov %eax,0xfffffff8(%ebp) 996: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 999: 8b 00 mov (%eax),%eax 99b: 89 45 f4 mov %eax,0xfffffff4(%ebp) } 99e: e9 6b ff ff ff jmp 90e <malloc+0x4e> 9a3: 8b 45 ec mov 0xffffffec(%ebp),%eax } 9a6: c9 leave 9a7: c3 ret 9a8: 90 nop 9a9: 90 nop 9aa: 90 nop 9ab: 90 nop 9ac: 90 nop 9ad: 90 nop 9ae: 90 nop 9af: 90 nop 000009b0 <lwip_chksum>: static u16_t lwip_chksum(void *dataptr, int len) { 9b0: 55 push %ebp 9b1: 89 e5 mov %esp,%ebp 9b3: 83 ec 18 sub $0x18,%esp u32_t acc; LWIP_DEBUGF(INET_DEBUG, ("lwip_chksum(%p, %d)\n", (void *)dataptr, len)); for(acc = 0; len > 1; len -= 2) { 9b6: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp) 9bd: eb 19 jmp 9d8 <lwip_chksum+0x28> /* acc = acc + *((u16_t *)dataptr)++;*/ acc += *(u16_t *)dataptr; 9bf: 8b 45 08 mov 0x8(%ebp),%eax 9c2: 0f b7 00 movzwl (%eax),%eax 9c5: 0f b7 c0 movzwl %ax,%eax 9c8: 01 45 fc add %eax,0xfffffffc(%ebp) dataptr = (void *)((u16_t *)dataptr + 1); 9cb: 8b 45 08 mov 0x8(%ebp),%eax 9ce: 83 c0 02 add $0x2,%eax 9d1: 89 45 08 mov %eax,0x8(%ebp) 9d4: 83 6d 0c 02 subl $0x2,0xc(%ebp) 9d8: 83 7d 0c 01 cmpl $0x1,0xc(%ebp) 9dc: 7f e1 jg 9bf <lwip_chksum+0xf> } /* add up any odd byte */ if (len == 1) { 9de: 83 7d 0c 01 cmpl $0x1,0xc(%ebp) 9e2: 75 1d jne a01 <lwip_chksum+0x51> acc += htons((u16_t)((*(u8_t *)dataptr) & 0xff) << 8); 9e4: 8b 45 08 mov 0x8(%ebp),%eax 9e7: 0f b6 00 movzbl (%eax),%eax 9ea: 0f b6 c0 movzbl %al,%eax 9ed: c1 e0 08 shl $0x8,%eax 9f0: 0f b7 c0 movzwl %ax,%eax 9f3: 89 04 24 mov %eax,(%esp) 9f6: e8 85 06 00 00 call 1080 <htons> 9fb: 0f b7 c0 movzwl %ax,%eax 9fe: 01 45 fc add %eax,0xfffffffc(%ebp) LWIP_DEBUGF(INET_DEBUG, ("inet: chksum: odd byte %d\n", (unsigned int)(*(u8_t *)dataptr))); } else { LWIP_DEBUGF(INET_DEBUG, ("inet: chksum: no odd byte\n")); } acc = (acc >> 16) + (acc & 0xffffUL); a01: 8b 45 fc mov 0xfffffffc(%ebp),%eax a04: 89 c2 mov %eax,%edx a06: c1 ea 10 shr $0x10,%edx a09: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax a0d: 8d 04 02 lea (%edx,%eax,1),%eax a10: 89 45 fc mov %eax,0xfffffffc(%ebp) if ((acc & 0xffff0000) != 0) { a13: 8b 45 fc mov 0xfffffffc(%ebp),%eax a16: 66 b8 00 00 mov $0x0,%ax a1a: 85 c0 test %eax,%eax a1c: 74 12 je a30 <lwip_chksum+0x80> acc = (acc >> 16) + (acc & 0xffffUL); a1e: 8b 45 fc mov 0xfffffffc(%ebp),%eax a21: 89 c2 mov %eax,%edx a23: c1 ea 10 shr $0x10,%edx a26: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax a2a: 8d 04 02 lea (%edx,%eax,1),%eax a2d: 89 45 fc mov %eax,0xfffffffc(%ebp) } return (u16_t)acc; a30: 8b 45 fc mov 0xfffffffc(%ebp),%eax a33: 0f b7 c0 movzwl %ax,%eax } a36: c9 leave a37: c3 ret a38: 90 nop a39: 8d b4 26 00 00 00 00 lea 0x0(%esi),%esi 00000a40 <inet_chksum_pseudo>: /* inet_chksum_pseudo: * * Calculates the pseudo Internet checksum used by TCP and UDP for a pbuf chain. */ u16_t inet_chksum_pseudo(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t proto, u16_t proto_len) { a40: 55 push %ebp a41: 89 e5 mov %esp,%ebp a43: 83 ec 28 sub $0x28,%esp a46: 8b 45 14 mov 0x14(%ebp),%eax a49: 8b 55 18 mov 0x18(%ebp),%edx a4c: 88 45 ec mov %al,0xffffffec(%ebp) a4f: 66 89 55 e8 mov %dx,0xffffffe8(%ebp) u32_t acc; struct pbuf *q; u8_t swapped; acc = 0; a53: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp) swapped = 0; a5a: c6 45 ff 00 movb $0x0,0xffffffff(%ebp) /* iterate through all pbuf in chain */ for(q = p; q != NULL; q = q->next) { a5e: 8b 45 08 mov 0x8(%ebp),%eax a61: 89 45 f8 mov %eax,0xfffffff8(%ebp) a64: eb 7b jmp ae1 <inet_chksum_pseudo+0xa1> LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n", (void *)q, (void *)q->next)); acc += lwip_chksum(q->payload, q->len); a66: 8b 45 f8 mov 0xfffffff8(%ebp),%eax a69: 0f b7 40 0a movzwl 0xa(%eax),%eax a6d: 0f b7 d0 movzwl %ax,%edx a70: 8b 45 f8 mov 0xfffffff8(%ebp),%eax a73: 8b 40 04 mov 0x4(%eax),%eax a76: 89 54 24 04 mov %edx,0x4(%esp) a7a: 89 04 24 mov %eax,(%esp) a7d: e8 2e ff ff ff call 9b0 <lwip_chksum> a82: 0f b7 c0 movzwl %ax,%eax a85: 01 45 f4 add %eax,0xfffffff4(%ebp) /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%lx \n", acc));*/ while (acc >> 16) { a88: eb 10 jmp a9a <inet_chksum_pseudo+0x5a> acc = (acc & 0xffffUL) + (acc >> 16); a8a: 0f b7 55 f4 movzwl 0xfffffff4(%ebp),%edx a8e: 8b 45 f4 mov 0xfffffff4(%ebp),%eax a91: c1 e8 10 shr $0x10,%eax a94: 8d 04 02 lea (%edx,%eax,1),%eax a97: 89 45 f4 mov %eax,0xfffffff4(%ebp) a9a: 8b 45 f4 mov 0xfffffff4(%ebp),%eax a9d: c1 e8 10 shr $0x10,%eax aa0: 85 c0 test %eax,%eax aa2: 75 e6 jne a8a <inet_chksum_pseudo+0x4a> } if (q->len % 2 != 0) { aa4: 8b 45 f8 mov 0xfffffff8(%ebp),%eax aa7: 0f b7 40 0a movzwl 0xa(%eax),%eax aab: 0f b7 c0 movzwl %ax,%eax aae: 83 e0 01 and $0x1,%eax ab1: 84 c0 test %al,%al ab3: 74 24 je ad9 <inet_chksum_pseudo+0x99> swapped = 1 - swapped; ab5: b8 01 00 00 00 mov $0x1,%eax aba: 2a 45 ff sub 0xffffffff(%ebp),%al abd: 88 45 ff mov %al,0xffffffff(%ebp) acc = ((acc & 0xff) << 8) | ((acc & 0xff00UL) >> 8); ac0: 0f b6 45 f4 movzbl 0xfffffff4(%ebp),%eax ac4: 89 c2 mov %eax,%edx ac6: c1 e2 08 shl $0x8,%edx ac9: 8b 45 f4 mov 0xfffffff4(%ebp),%eax acc: 25 00 ff 00 00 and $0xff00,%eax ad1: c1 e8 08 shr $0x8,%eax ad4: 09 d0 or %edx,%eax ad6: 89 45 f4 mov %eax,0xfffffff4(%ebp) ad9: 8b 45 f8 mov 0xfffffff8(%ebp),%eax adc: 8b 00 mov (%eax),%eax ade: 89 45 f8 mov %eax,0xfffffff8(%ebp) ae1: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp) ae5: 0f 85 7b ff ff ff jne a66 <inet_chksum_pseudo+0x26> } /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%lx \n", acc));*/ } if (swapped) { aeb: 80 7d ff 00 cmpb $0x0,0xffffffff(%ebp) aef: 74 19 je b0a <inet_chksum_pseudo+0xca> acc = ((acc & 0xff) << 8) | ((acc & 0xff00UL) >> 8); af1: 0f b6 45 f4 movzbl 0xfffffff4(%ebp),%eax af5: 89 c2 mov %eax,%edx af7: c1 e2 08 shl $0x8,%edx afa: 8b 45 f4 mov 0xfffffff4(%ebp),%eax afd: 25 00 ff 00 00 and $0xff00,%eax b02: c1 e8 08 shr $0x8,%eax b05: 09 d0 or %edx,%eax b07: 89 45 f4 mov %eax,0xfffffff4(%ebp) } acc += (src->addr & 0xffffUL); b0a: 8b 45 0c mov 0xc(%ebp),%eax b0d: 8b 00 mov (%eax),%eax b0f: 25 ff ff 00 00 and $0xffff,%eax b14: 01 45 f4 add %eax,0xfffffff4(%ebp) acc += ((src->addr >> 16) & 0xffffUL); b17: 8b 45 0c mov 0xc(%ebp),%eax b1a: 8b 00 mov (%eax),%eax b1c: c1 e8 10 shr $0x10,%eax b1f: 25 ff ff 00 00 and $0xffff,%eax b24: 01 45 f4 add %eax,0xfffffff4(%ebp) acc += (dest->addr & 0xffffUL); b27: 8b 45 10 mov 0x10(%ebp),%eax b2a: 8b 00 mov (%eax),%eax b2c: 25 ff ff 00 00 and $0xffff,%eax b31: 01 45 f4 add %eax,0xfffffff4(%ebp) acc += ((dest->addr >> 16) & 0xffffUL); b34: 8b 45 10 mov 0x10(%ebp),%eax b37: 8b 00 mov (%eax),%eax b39: c1 e8 10 shr $0x10,%eax b3c: 25 ff ff 00 00 and $0xffff,%eax b41: 01 45 f4 add %eax,0xfffffff4(%ebp) acc += (u32_t)htons((u16_t)proto); b44: 0f b6 45 ec movzbl 0xffffffec(%ebp),%eax b48: 89 04 24 mov %eax,(%esp) b4b: e8 30 05 00 00 call 1080 <htons> b50: 0f b7 c0 movzwl %ax,%eax b53: 01 45 f4 add %eax,0xfffffff4(%ebp) acc += (u32_t)htons(proto_len); b56: 0f b7 45 e8 movzwl 0xffffffe8(%ebp),%eax b5a: 89 04 24 mov %eax,(%esp) b5d: e8 1e 05 00 00 call 1080 <htons> b62: 0f b7 c0 movzwl %ax,%eax b65: 01 45 f4 add %eax,0xfffffff4(%ebp) while (acc >> 16) { b68: eb 10 jmp b7a <inet_chksum_pseudo+0x13a> acc = (acc & 0xffffUL) + (acc >> 16); b6a: 0f b7 55 f4 movzwl 0xfffffff4(%ebp),%edx b6e: 8b 45 f4 mov 0xfffffff4(%ebp),%eax b71: c1 e8 10 shr $0x10,%eax b74: 8d 04 02 lea (%edx,%eax,1),%eax b77: 89 45 f4 mov %eax,0xfffffff4(%ebp) b7a: 8b 45 f4 mov 0xfffffff4(%ebp),%eax b7d: c1 e8 10 shr $0x10,%eax b80: 85 c0 test %eax,%eax b82: 75 e6 jne b6a <inet_chksum_pseudo+0x12a> } LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%lx\n", acc)); return ~(acc & 0xffffUL); b84: 8b 45 f4 mov 0xfffffff4(%ebp),%eax b87: f7 d0 not %eax b89: 0f b7 c0 movzwl %ax,%eax } b8c: c9 leave b8d: c3 ret b8e: 89 f6 mov %esi,%esi 00000b90 <inet_chksum>: /* inet_chksum: * * Calculates the Internet checksum over a portion of memory. Used primarely for IP * and ICMP. */ u16_t inet_chksum(void *dataptr, u16_t len) { b90: 55 push %ebp b91: 89 e5 mov %esp,%ebp b93: 83 ec 28 sub $0x28,%esp b96: 8b 45 0c mov 0xc(%ebp),%eax b99: 66 89 45 ec mov %ax,0xffffffec(%ebp) u32_t acc; acc = lwip_chksum(dataptr, len); b9d: 0f b7 45 ec movzwl 0xffffffec(%ebp),%eax ba1: 89 44 24 04 mov %eax,0x4(%esp) ba5: 8b 45 08 mov 0x8(%ebp),%eax ba8: 89 04 24 mov %eax,(%esp) bab: e8 00 fe ff ff call 9b0 <lwip_chksum> bb0: 0f b7 c0 movzwl %ax,%eax bb3: 89 45 fc mov %eax,0xfffffffc(%ebp) while (acc >> 16) { bb6: eb 10 jmp bc8 <inet_chksum+0x38> acc = (acc & 0xffff) + (acc >> 16); bb8: 0f b7 55 fc movzwl 0xfffffffc(%ebp),%edx bbc: 8b 45 fc mov 0xfffffffc(%ebp),%eax bbf: c1 e8 10 shr $0x10,%eax bc2: 8d 04 02 lea (%edx,%eax,1),%eax bc5: 89 45 fc mov %eax,0xfffffffc(%ebp) bc8: 8b 45 fc mov 0xfffffffc(%ebp),%eax bcb: c1 e8 10 shr $0x10,%eax bce: 85 c0 test %eax,%eax bd0: 75 e6 jne bb8 <inet_chksum+0x28> } return ~(acc & 0xffff); bd2: 8b 45 fc mov 0xfffffffc(%ebp),%eax bd5: f7 d0 not %eax bd7: 0f b7 c0 movzwl %ax,%eax } bda: c9 leave bdb: c3 ret bdc: 8d 74 26 00 lea 0x0(%esi),%esi 00000be0 <inet_chksum_pbuf>: u16_t inet_chksum_pbuf(struct pbuf *p) { be0: 55 push %ebp be1: 89 e5 mov %esp,%ebp be3: 83 ec 18 sub $0x18,%esp u32_t acc; struct pbuf *q; u8_t swapped; acc = 0; be6: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp) swapped = 0; bed: c6 45 ff 00 movb $0x0,0xffffffff(%ebp) for(q = p; q != NULL; q = q->next) { bf1: 8b 45 08 mov 0x8(%ebp),%eax bf4: 89 45 f8 mov %eax,0xfffffff8(%ebp) bf7: eb 69 jmp c62 <inet_chksum_pbuf+0x82> acc += lwip_chksum(q->payload, q->len); bf9: 8b 45 f8 mov 0xfffffff8(%ebp),%eax bfc: 0f b7 40 0a movzwl 0xa(%eax),%eax c00: 0f b7 d0 movzwl %ax,%edx c03: 8b 45 f8 mov 0xfffffff8(%ebp),%eax c06: 8b 40 04 mov 0x4(%eax),%eax c09: 89 54 24 04 mov %edx,0x4(%esp) c0d: 89 04 24 mov %eax,(%esp) c10: e8 9b fd ff ff call 9b0 <lwip_chksum> c15: 0f b7 c0 movzwl %ax,%eax c18: 01 45 f4 add %eax,0xfffffff4(%ebp) while (acc >> 16) { c1b: eb 10 jmp c2d <inet_chksum_pbuf+0x4d> acc = (acc & 0xffffUL) + (acc >> 16); c1d: 0f b7 55 f4 movzwl 0xfffffff4(%ebp),%edx c21: 8b 45 f4 mov 0xfffffff4(%ebp),%eax c24: c1 e8 10 shr $0x10,%eax c27: 8d 04 02 lea (%edx,%eax,1),%eax c2a: 89 45 f4 mov %eax,0xfffffff4(%ebp) c2d: 8b 45 f4 mov 0xfffffff4(%ebp),%eax c30: c1 e8 10 shr $0x10,%eax c33: 85 c0 test %eax,%eax c35: 75 e6 jne c1d <inet_chksum_pbuf+0x3d> } if (q->len % 2 != 0) { c37: 8b 45 f8 mov 0xfffffff8(%ebp),%eax c3a: 0f b7 40 0a movzwl 0xa(%eax),%eax c3e: 0f b7 c0 movzwl %ax,%eax c41: 83 e0 01 and $0x1,%eax c44: 84 c0 test %al,%al c46: 74 12 je c5a <inet_chksum_pbuf+0x7a> swapped = 1 - swapped; c48: b8 01 00 00 00 mov $0x1,%eax c4d: 2a 45 ff sub 0xffffffff(%ebp),%al c50: 88 45 ff mov %al,0xffffffff(%ebp) acc = (acc & 0x00ffUL << 8) | (acc & 0xff00UL >> 8); c53: 81 65 f4 ff ff 00 00 andl $0xffff,0xfffffff4(%ebp) c5a: 8b 45 f8 mov 0xfffffff8(%ebp),%eax c5d: 8b 00 mov (%eax),%eax c5f: 89 45 f8 mov %eax,0xfffffff8(%ebp) c62: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp) c66: 75 91 jne bf9 <inet_chksum_pbuf+0x19> } } if (swapped) { c68: 80 7d ff 00 cmpb $0x0,0xffffffff(%ebp) c6c: 74 19 je c87 <inet_chksum_pbuf+0xa7> acc = ((acc & 0x00ffUL) << 8) | ((acc & 0xff00UL) >> 8); c6e: 0f b6 45 f4 movzbl 0xfffffff4(%ebp),%eax c72: 89 c2 mov %eax,%edx c74: c1 e2 08 shl $0x8,%edx c77: 8b 45 f4 mov 0xfffffff4(%ebp),%eax c7a: 25 00 ff 00 00 and $0xff00,%eax c7f: c1 e8 08 shr $0x8,%eax c82: 09 d0 or %edx,%eax c84: 89 45 f4 mov %eax,0xfffffff4(%ebp) } return ~(acc & 0xffffUL); c87: 8b 45 f4 mov 0xfffffff4(%ebp),%eax c8a: f7 d0 not %eax c8c: 0f b7 c0 movzwl %ax,%eax } c8f: c9 leave c90: c3 ret c91: eb 0d jmp ca0 <inet_addr> c93: 90 nop c94: 90 nop c95: 90 nop c96: 90 nop c97: 90 nop c98: 90 nop c99: 90 nop c9a: 90 nop c9b: 90 nop c9c: 90 nop c9d: 90 nop c9e: 90 nop c9f: 90 nop 00000ca0 <inet_addr>: /* Here for now until needed in other places in lwIP */ #ifndef isascii #define in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up) #define isascii(c) in_range(c, 0x20, 0x7f) #define isdigit(c) in_range(c, '0', '9') #define isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F')) #define islower(c) in_range(c, 'a', 'z') #define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v') #endif /* * Ascii internet address interpretation routine. * The value returned is in network order. */ /* */ /* inet_addr */ u32_t inet_addr(const char *cp) { ca0: 55 push %ebp ca1: 89 e5 mov %esp,%ebp ca3: 83 ec 28 sub $0x28,%esp struct in_addr val; if (inet_aton(cp, &val)) { ca6: 8d 45 fc lea 0xfffffffc(%ebp),%eax ca9: 89 44 24 04 mov %eax,0x4(%esp) cad: 8b 45 08 mov 0x8(%ebp),%eax cb0: 89 04 24 mov %eax,(%esp) cb3: e8 18 00 00 00 call cd0 <inet_aton> cb8: 85 c0 test %eax,%eax cba: 74 08 je cc4 <inet_addr+0x24> return (val.s_addr); cbc: 8b 45 fc mov 0xfffffffc(%ebp),%eax cbf: 89 45 ec mov %eax,0xffffffec(%ebp) cc2: eb 07 jmp ccb <inet_addr+0x2b> } return (INADDR_NONE); cc4: c7 45 ec ff ff ff ff movl $0xffffffff,0xffffffec(%ebp) ccb: 8b 45 ec mov 0xffffffec(%ebp),%eax } cce: c9 leave ccf: c3 ret 00000cd0 <inet_aton>: /* * Check whether "cp" is a valid ascii representation * of an Internet address and convert to a binary address. * Returns 1 if the address is valid, 0 if not. * This replaces inet_addr, the return value from which * cannot distinguish between failure and a local broadcast address. */ /* */ /* inet_aton */ int inet_aton(const char *cp, struct in_addr *addr) { cd0: 55 push %ebp cd1: 89 e5 mov %esp,%ebp cd3: 83 ec 48 sub $0x48,%esp u32_t val; int base, n; char c; u32_t parts[4]; u32_t* pp = parts; cd6: 8d 45 dc lea 0xffffffdc(%ebp),%eax cd9: 89 45 fc mov %eax,0xfffffffc(%ebp) c = *cp; cdc: 8b 45 08 mov 0x8(%ebp),%eax cdf: 0f b6 00 movzbl (%eax),%eax ce2: 88 45 fb mov %al,0xfffffffb(%ebp) for (;;) { /* * Collect number up to ``.''. * Values are specified as for C: * 0x=hex, 0=octal, isdigit=decimal. */ if (!isdigit(c)) ce5: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax ce9: 3c 2f cmp $0x2f,%al ceb: 76 08 jbe cf5 <inet_aton+0x25> ced: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax cf1: 3c 39 cmp $0x39,%al cf3: 76 0c jbe d01 <inet_aton+0x31> return (0); cf5: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp) cfc: e9 78 02 00 00 jmp f79 <inet_aton+0x2a9> val = 0; base = 10; d01: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp) d08: c7 45 f0 0a 00 00 00 movl $0xa,0xfffffff0(%ebp) if (c == '0') { d0f: 80 7d fb 30 cmpb $0x30,0xfffffffb(%ebp) d13: 75 36 jne d4b <inet_aton+0x7b> c = *++cp; d15: 83 45 08 01 addl $0x1,0x8(%ebp) d19: 8b 45 08 mov 0x8(%ebp),%eax d1c: 0f b6 00 movzbl (%eax),%eax d1f: 88 45 fb mov %al,0xfffffffb(%ebp) if (c == 'x' || c == 'X') d22: 80 7d fb 78 cmpb $0x78,0xfffffffb(%ebp) d26: 74 06 je d2e <inet_aton+0x5e> d28: 80 7d fb 58 cmpb $0x58,0xfffffffb(%ebp) d2c: 75 16 jne d44 <inet_aton+0x74> base = 16, c = *++cp; d2e: c7 45 f0 10 00 00 00 movl $0x10,0xfffffff0(%ebp) d35: 83 45 08 01 addl $0x1,0x8(%ebp) d39: 8b 45 08 mov 0x8(%ebp),%eax d3c: 0f b6 00 movzbl (%eax),%eax d3f: 88 45 fb mov %al,0xfffffffb(%ebp) d42: eb 07 jmp d4b <inet_aton+0x7b> else base = 8; d44: c7 45 f0 08 00 00 00 movl $0x8,0xfffffff0(%ebp) } for (;;) { if (isascii(c) && isdigit(c)) { d4b: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax d4f: 3c 1f cmp $0x1f,%al d51: 76 3b jbe d8e <inet_aton+0xbe> d53: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp) d57: 78 35 js d8e <inet_aton+0xbe> d59: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax d5d: 3c 2f cmp $0x2f,%al d5f: 76 2d jbe d8e <inet_aton+0xbe> d61: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax d65: 3c 39 cmp $0x39,%al d67: 77 25 ja d8e <inet_aton+0xbe> val = (val * base) + (c - '0'); d69: 8b 45 f0 mov 0xfffffff0(%ebp),%eax d6c: 89 c2 mov %eax,%edx d6e: 0f af 55 ec imul 0xffffffec(%ebp),%edx d72: 0f be 45 fb movsbl 0xfffffffb(%ebp),%eax d76: 8d 04 02 lea (%edx,%eax,1),%eax d79: 83 e8 30 sub $0x30,%eax d7c: 89 45 ec mov %eax,0xffffffec(%ebp) c = *++cp; d7f: 83 45 08 01 addl $0x1,0x8(%ebp) d83: 8b 45 08 mov 0x8(%ebp),%eax d86: 0f b6 00 movzbl (%eax),%eax d89: 88 45 fb mov %al,0xfffffffb(%ebp) d8c: eb bd jmp d4b <inet_aton+0x7b> } else if (base == 16 && isascii(c) && isxdigit(c)) { d8e: 83 7d f0 10 cmpl $0x10,0xfffffff0(%ebp) d92: 0f 85 99 00 00 00 jne e31 <inet_aton+0x161> d98: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax d9c: 3c 1f cmp $0x1f,%al d9e: 0f 86 8d 00 00 00 jbe e31 <inet_aton+0x161> da4: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp) da8: 0f 88 83 00 00 00 js e31 <inet_aton+0x161> dae: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax db2: 3c 2f cmp $0x2f,%al db4: 76 08 jbe dbe <inet_aton+0xee> db6: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax dba: 3c 39 cmp $0x39,%al dbc: 76 20 jbe dde <inet_aton+0x10e> dbe: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax dc2: 3c 60 cmp $0x60,%al dc4: 76 08 jbe dce <inet_aton+0xfe> dc6: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax dca: 3c 66 cmp $0x66,%al dcc: 76 10 jbe dde <inet_aton+0x10e> dce: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax dd2: 3c 40 cmp $0x40,%al dd4: 76 5b jbe e31 <inet_aton+0x161> dd6: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax dda: 3c 46 cmp $0x46,%al ddc: 77 53 ja e31 <inet_aton+0x161> val = (val << 4) | dde: 8b 45 ec mov 0xffffffec(%ebp),%eax de1: 89 c2 mov %eax,%edx de3: c1 e2 04 shl $0x4,%edx de6: 89 55 c4 mov %edx,0xffffffc4(%ebp) de9: 0f be 45 fb movsbl 0xfffffffb(%ebp),%eax ded: 83 c0 0a add $0xa,%eax df0: 89 45 c8 mov %eax,0xffffffc8(%ebp) df3: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax df7: 3c 60 cmp $0x60,%al df9: 76 11 jbe e0c <inet_aton+0x13c> dfb: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax dff: 3c 7a cmp $0x7a,%al e01: 77 09 ja e0c <inet_aton+0x13c> e03: c7 45 cc 61 00 00 00 movl $0x61,0xffffffcc(%ebp) e0a: eb 07 jmp e13 <inet_aton+0x143> e0c: c7 45 cc 41 00 00 00 movl $0x41,0xffffffcc(%ebp) e13: 8b 45 c8 mov 0xffffffc8(%ebp),%eax e16: 2b 45 cc sub 0xffffffcc(%ebp),%eax e19: 0b 45 c4 or 0xffffffc4(%ebp),%eax e1c: 89 45 ec mov %eax,0xffffffec(%ebp) (c + 10 - (islower(c) ? 'a' : 'A')); c = *++cp; e1f: 83 45 08 01 addl $0x1,0x8(%ebp) e23: 8b 45 08 mov 0x8(%ebp),%eax e26: 0f b6 00 movzbl (%eax),%eax e29: 88 45 fb mov %al,0xfffffffb(%ebp) } else break; } e2c: e9 1a ff ff ff jmp d4b <inet_aton+0x7b> if (c == '.') { e31: 80 7d fb 2e cmpb $0x2e,0xfffffffb(%ebp) e35: 75 35 jne e6c <inet_aton+0x19c> /* * Internet format: * a.b.c.d * a.b.c (with c treated as 16 bits) * a.b (with b treated as 24 bits) */ if (pp >= parts + 3) e37: 8d 45 dc lea 0xffffffdc(%ebp),%eax e3a: 83 c0 0c add $0xc,%eax e3d: 3b 45 fc cmp 0xfffffffc(%ebp),%eax e40: 77 0c ja e4e <inet_aton+0x17e> return (0); e42: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp) e49: e9 2b 01 00 00 jmp f79 <inet_aton+0x2a9> *pp++ = val; e4e: 8b 55 fc mov 0xfffffffc(%ebp),%edx e51: 8b 45 ec mov 0xffffffec(%ebp),%eax e54: 89 02 mov %eax,(%edx) e56: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp) c = *++cp; e5a: 83 45 08 01 addl $0x1,0x8(%ebp) e5e: 8b 45 08 mov 0x8(%ebp),%eax e61: 0f b6 00 movzbl (%eax),%eax e64: 88 45 fb mov %al,0xfffffffb(%ebp) } else break; } e67: e9 79 fe ff ff jmp ce5 <inet_aton+0x15> /* * Check for trailing characters. */ if (c != '\0' && (!isascii(c) || !isspace(c))) e6c: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp) e70: 74 3e je eb0 <inet_aton+0x1e0> e72: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax e76: 3c 1f cmp $0x1f,%al e78: 76 2a jbe ea4 <inet_aton+0x1d4> e7a: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp) e7e: 78 24 js ea4 <inet_aton+0x1d4> e80: 80 7d fb 20 cmpb $0x20,0xfffffffb(%ebp) e84: 74 2a je eb0 <inet_aton+0x1e0> e86: 80 7d fb 0c cmpb $0xc,0xfffffffb(%ebp) e8a: 74 24 je eb0 <inet_aton+0x1e0> e8c: 80 7d fb 0a cmpb $0xa,0xfffffffb(%ebp) e90: 74 1e je eb0 <inet_aton+0x1e0> e92: 80 7d fb 0d cmpb $0xd,0xfffffffb(%ebp) e96: 74 18 je eb0 <inet_aton+0x1e0> e98: 80 7d fb 09 cmpb $0x9,0xfffffffb(%ebp) e9c: 74 12 je eb0 <inet_aton+0x1e0> e9e: 80 7d fb 0b cmpb $0xb,0xfffffffb(%ebp) ea2: 74 0c je eb0 <inet_aton+0x1e0> return (0); ea4: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp) eab: e9 c9 00 00 00 jmp f79 <inet_aton+0x2a9> /* * Concoct the address according to * the number of parts specified. */ n = pp - parts + 1; eb0: 8b 55 fc mov 0xfffffffc(%ebp),%edx eb3: 8d 45 dc lea 0xffffffdc(%ebp),%eax eb6: 89 d1 mov %edx,%ecx eb8: 29 c1 sub %eax,%ecx eba: 89 c8 mov %ecx,%eax ebc: c1 f8 02 sar $0x2,%eax ebf: 83 c0 01 add $0x1,%eax ec2: 89 45 f4 mov %eax,0xfffffff4(%ebp) switch (n) { ec5: 83 7d f4 04 cmpl $0x4,0xfffffff4(%ebp) ec9: 0f 87 8b 00 00 00 ja f5a <inet_aton+0x28a> ecf: 8b 45 f4 mov 0xfffffff4(%ebp),%eax ed2: c1 e0 02 shl $0x2,%eax ed5: 8b 80 74 11 00 00 mov 0x1174(%eax),%eax edb: ff e0 jmp *%eax case 0: return (0); /* initial nondigit */ edd: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp) ee4: e9 90 00 00 00 jmp f79 <inet_aton+0x2a9> case 1: /* a -- 32 bits */ break; case 2: /* a.b -- 8.24 bits */ if (val > 0xffffff) ee9: 81 7d ec ff ff ff 00 cmpl $0xffffff,0xffffffec(%ebp) ef0: 76 09 jbe efb <inet_aton+0x22b> return (0); ef2: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp) ef9: eb 7e jmp f79 <inet_aton+0x2a9> val |= parts[0] << 24; efb: 8b 45 dc mov 0xffffffdc(%ebp),%eax efe: c1 e0 18 shl $0x18,%eax f01: 09 45 ec or %eax,0xffffffec(%ebp) break; f04: eb 54 jmp f5a <inet_aton+0x28a> case 3: /* a.b.c -- 8.8.16 bits */ if (val > 0xffff) f06: 81 7d ec ff ff 00 00 cmpl $0xffff,0xffffffec(%ebp) f0d: 76 09 jbe f18 <inet_aton+0x248> return (0); f0f: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp) f16: eb 61 jmp f79 <inet_aton+0x2a9> val |= (parts[0] << 24) | (parts[1] << 16); f18: 8b 45 dc mov 0xffffffdc(%ebp),%eax f1b: 89 c2 mov %eax,%edx f1d: c1 e2 18 shl $0x18,%edx f20: 8b 45 e0 mov 0xffffffe0(%ebp),%eax f23: c1 e0 10 shl $0x10,%eax f26: 09 d0 or %edx,%eax f28: 09 45 ec or %eax,0xffffffec(%ebp) break; f2b: eb 2d jmp f5a <inet_aton+0x28a> case 4: /* a.b.c.d -- 8.8.8.8 bits */ if (val > 0xff) f2d: 81 7d ec ff 00 00 00 cmpl $0xff,0xffffffec(%ebp) f34: 76 09 jbe f3f <inet_aton+0x26f> return (0); f36: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp) f3d: eb 3a jmp f79 <inet_aton+0x2a9> val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); f3f: 8b 45 dc mov 0xffffffdc(%ebp),%eax f42: 89 c2 mov %eax,%edx f44: c1 e2 18 shl $0x18,%edx f47: 8b 45 e0 mov 0xffffffe0(%ebp),%eax f4a: c1 e0 10 shl $0x10,%eax f4d: 09 c2 or %eax,%edx f4f: 8b 45 e4 mov 0xffffffe4(%ebp),%eax f52: c1 e0 08 shl $0x8,%eax f55: 09 d0 or %edx,%eax f57: 09 45 ec or %eax,0xffffffec(%ebp) break; } if (addr) f5a: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) f5e: 74 12 je f72 <inet_aton+0x2a2> addr->s_addr = htonl(val); f60: 8b 45 ec mov 0xffffffec(%ebp),%eax f63: 89 04 24 mov %eax,(%esp) f66: e8 65 01 00 00 call 10d0 <htonl> f6b: 89 c2 mov %eax,%edx f6d: 8b 45 0c mov 0xc(%ebp),%eax f70: 89 10 mov %edx,(%eax) return (1); f72: c7 45 c0 01 00 00 00 movl $0x1,0xffffffc0(%ebp) f79: 8b 45 c0 mov 0xffffffc0(%ebp),%eax } f7c: c9 leave f7d: c3 ret f7e: 89 f6 mov %esi,%esi 00000f80 <inet_ntoa>: /* Convert numeric IP address into decimal dotted ASCII representation. * returns ptr to static buffer; not reentrant! */ char *inet_ntoa(struct in_addr addr) { f80: 55 push %ebp f81: 89 e5 mov %esp,%ebp f83: 53 push %ebx f84: 83 ec 24 sub $0x24,%esp static char str[16]; u32_t s_addr = addr.s_addr; f87: 8b 45 08 mov 0x8(%ebp),%eax f8a: 89 45 ec mov %eax,0xffffffec(%ebp) char inv[3]; char *rp; char *ap; u8_t rem; u8_t n; u8_t i; rp = str; f8d: c7 45 f0 b0 11 00 00 movl $0x11b0,0xfffffff0(%ebp) ap = (u8_t *)&s_addr; f94: 8d 45 ec lea 0xffffffec(%ebp),%eax f97: 89 45 f4 mov %eax,0xfffffff4(%ebp) for(n = 0; n < 4; n++) { f9a: c6 45 fa 00 movb $0x0,0xfffffffa(%ebp) f9e: e9 af 00 00 00 jmp 1052 <inet_ntoa+0xd2> i = 0; fa3: c6 45 fb 00 movb $0x0,0xfffffffb(%ebp) do { rem = *ap % (u8_t)10; fa7: 8b 45 f4 mov 0xfffffff4(%ebp),%eax faa: 0f b6 08 movzbl (%eax),%ecx fad: b8 67 00 00 00 mov $0x67,%eax fb2: f6 e9 imul %cl fb4: 66 c1 e8 08 shr $0x8,%ax fb8: 89 c2 mov %eax,%edx fba: c0 fa 02 sar $0x2,%dl fbd: 89 c8 mov %ecx,%eax fbf: c0 f8 07 sar $0x7,%al fc2: 89 d3 mov %edx,%ebx fc4: 28 c3 sub %al,%bl fc6: 88 5d db mov %bl,0xffffffdb(%ebp) fc9: 0f b6 45 db movzbl 0xffffffdb(%ebp),%eax fcd: c1 e0 02 shl $0x2,%eax fd0: 02 45 db add 0xffffffdb(%ebp),%al fd3: 01 c0 add %eax,%eax fd5: 89 ca mov %ecx,%edx fd7: 28 c2 sub %al,%dl fd9: 88 55 db mov %dl,0xffffffdb(%ebp) fdc: 0f b6 5d db movzbl 0xffffffdb(%ebp),%ebx fe0: 88 5d f9 mov %bl,0xfffffff9(%ebp) *ap /= (u8_t)10; fe3: 8b 45 f4 mov 0xfffffff4(%ebp),%eax fe6: 0f b6 08 movzbl (%eax),%ecx fe9: b8 67 00 00 00 mov $0x67,%eax fee: f6 e9 imul %cl ff0: 66 c1 e8 08 shr $0x8,%ax ff4: 89 c2 mov %eax,%edx ff6: c0 fa 02 sar $0x2,%dl ff9: 89 c8 mov %ecx,%eax ffb: c0 f8 07 sar $0x7,%al ffe: 28 c2 sub %al,%dl 1000: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 1003: 88 10 mov %dl,(%eax) inv[i++] = '0' + rem; 1005: 0f b6 55 fb movzbl 0xfffffffb(%ebp),%edx 1009: 0f b6 45 f9 movzbl 0xfffffff9(%ebp),%eax 100d: 83 c0 30 add $0x30,%eax 1010: 88 44 15 e9 mov %al,0xffffffe9(%ebp,%edx,1) 1014: 80 45 fb 01 addb $0x1,0xfffffffb(%ebp) } while(*ap); 1018: 8b 45 f4 mov 0xfffffff4(%ebp),%eax 101b: 0f b6 00 movzbl (%eax),%eax 101e: 84 c0 test %al,%al 1020: 75 85 jne fa7 <inet_ntoa+0x27> while(i--) 1022: eb 12 jmp 1036 <inet_ntoa+0xb6> *rp++ = inv[i]; 1024: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax 1028: 0f b6 54 05 e9 movzbl 0xffffffe9(%ebp,%eax,1),%edx 102d: 8b 45 f0 mov 0xfffffff0(%ebp),%eax 1030: 88 10 mov %dl,(%eax) 1032: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp) 1036: 80 6d fb 01 subb $0x1,0xfffffffb(%ebp) 103a: 80 7d fb ff cmpb $0xff,0xfffffffb(%ebp) 103e: 75 e4 jne 1024 <inet_ntoa+0xa4> *rp++ = '.'; 1040: 8b 45 f0 mov 0xfffffff0(%ebp),%eax 1043: c6 00 2e movb $0x2e,(%eax) 1046: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp) ap++; 104a: 83 45 f4 01 addl $0x1,0xfffffff4(%ebp) 104e: 80 45 fa 01 addb $0x1,0xfffffffa(%ebp) 1052: 80 7d fa 03 cmpb $0x3,0xfffffffa(%ebp) 1056: 0f 86 47 ff ff ff jbe fa3 <inet_ntoa+0x23> } *--rp = 0; 105c: 83 6d f0 01 subl $0x1,0xfffffff0(%ebp) 1060: 8b 45 f0 mov 0xfffffff0(%ebp),%eax 1063: c6 00 00 movb $0x0,(%eax) return str; 1066: b8 b0 11 00 00 mov $0x11b0,%eax } 106b: 83 c4 24 add $0x24,%esp 106e: 5b pop %ebx 106f: 5d pop %ebp 1070: c3 ret 1071: eb 0d jmp 1080 <htons> 1073: 90 nop 1074: 90 nop 1075: 90 nop 1076: 90 nop 1077: 90 nop 1078: 90 nop 1079: 90 nop 107a: 90 nop 107b: 90 nop 107c: 90 nop 107d: 90 nop 107e: 90 nop 107f: 90 nop 00001080 <htons>: #ifndef BYTE_ORDER #error BYTE_ORDER is not defined #endif #if BYTE_ORDER == LITTLE_ENDIAN u16_t htons(u16_t n) { 1080: 55 push %ebp 1081: 89 e5 mov %esp,%ebp 1083: 83 ec 04 sub $0x4,%esp 1086: 8b 45 08 mov 0x8(%ebp),%eax 1089: 66 89 45 fc mov %ax,0xfffffffc(%ebp) return ((n & 0xff) << 8) | ((n & 0xff00) >> 8); 108d: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax 1091: 25 ff 00 00 00 and $0xff,%eax 1096: c1 e0 08 shl $0x8,%eax 1099: 89 c2 mov %eax,%edx 109b: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax 109f: 25 00 ff 00 00 and $0xff00,%eax 10a4: c1 f8 08 sar $0x8,%eax 10a7: 09 d0 or %edx,%eax 10a9: 0f b7 c0 movzwl %ax,%eax } 10ac: c9 leave 10ad: c3 ret 10ae: 89 f6 mov %esi,%esi 000010b0 <ntohs>: u16_t ntohs(u16_t n) { 10b0: 55 push %ebp 10b1: 89 e5 mov %esp,%ebp 10b3: 83 ec 08 sub $0x8,%esp 10b6: 8b 45 08 mov 0x8(%ebp),%eax 10b9: 66 89 45 fc mov %ax,0xfffffffc(%ebp) return htons(n); 10bd: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax 10c1: 89 04 24 mov %eax,(%esp) 10c4: e8 b7 ff ff ff call 1080 <htons> 10c9: 0f b7 c0 movzwl %ax,%eax } 10cc: c9 leave 10cd: c3 ret 10ce: 89 f6 mov %esi,%esi 000010d0 <htonl>: u32_t htonl(u32_t n) { 10d0: 55 push %ebp 10d1: 89 e5 mov %esp,%ebp return ((n & 0xff) << 24) | 10d3: 0f b6 45 08 movzbl 0x8(%ebp),%eax 10d7: 89 c2 mov %eax,%edx 10d9: c1 e2 18 shl $0x18,%edx 10dc: 8b 45 08 mov 0x8(%ebp),%eax 10df: 25 00 ff 00 00 and $0xff00,%eax 10e4: c1 e0 08 shl $0x8,%eax 10e7: 09 c2 or %eax,%edx 10e9: 8b 45 08 mov 0x8(%ebp),%eax 10ec: 25 00 00 ff 00 and $0xff0000,%eax 10f1: c1 e8 08 shr $0x8,%eax 10f4: 09 c2 or %eax,%edx 10f6: 8b 45 08 mov 0x8(%ebp),%eax 10f9: 25 00 00 00 ff and $0xff000000,%eax 10fe: c1 e8 18 shr $0x18,%eax 1101: 09 d0 or %edx,%eax ((n & 0xff00) << 8) | ((n & 0xff0000) >> 8) | ((n & 0xff000000) >> 24); } 1103: 5d pop %ebp 1104: c3 ret 1105: 8d 74 26 00 lea 0x0(%esi),%esi 1109: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi 00001110 <ntohl>: u32_t ntohl(u32_t n) { 1110: 55 push %ebp 1111: 89 e5 mov %esp,%ebp 1113: 83 ec 04 sub $0x4,%esp return htonl(n); 1116: 8b 45 08 mov 0x8(%ebp),%eax 1119: 89 04 24 mov %eax,(%esp) 111c: e8 af ff ff ff call 10d0 <htonl> } 1121: c9 leave 1122: c3 ret
oeis/266/A266707.asm
neoneye/loda-programs
11
80198
; A266707: Coefficient of x^2 in minimal polynomial of the continued fraction [1^n,tau,1,1,1,...], where 1^n means n ones and tau = golden ratio = (1 + sqrt(5))/2. ; Submitted by <NAME>(s3) ; 1,5,4,19,41,116,295,781,2036,5339,13969,36580,95759,250709,656356,1718371,4498745,11777876,30834871,80726749,211345364,553309355,1448582689,3792438724,9928733471,25993761701,68052551620,178163893171,466439127881,1221153490484,3197021343559,8369910540205,21912710277044,57368220290939,150191950595761,393207631496356,1029430943893295,2695085200183541,7055824656657316,18472388769788419,48361341652707929,126611636188335380,331473566912298199,867809064548559229,2271953626733379476,5948051815651579211 mov $2,3 mov $4,-4 lpb $0 sub $0,1 mov $2,$1 add $3,$1 add $1,$3 add $2,2 add $4,1 mov $5,$4 mov $4,$1 sub $4,3 sub $5,$2 add $1,$5 lpe sub $2,$1 mov $0,$2 sub $0,2
Merit.g4
merideum/merideum-antlr
0
5049
<reponame>merideum/merideum-antlr<gh_stars>0 grammar Merit; parse: block EOF; block: (importDependency)* WS* (statement)*; importDependency: IMPORT WS* IDENTIFIER WS* COLON WS* (dependencyPathIdentifier)? (DEPENDENCY_NAME); statement : variableAssignment | outputAssignment ; outputAssignment : OUTPUT WS* simpleIdentifier WS* assignment? ; variableAssignment : variableModifier? WS* simpleIdentifier WS* assignment? ; assignment : (ASSIGN WS* expression) ; expression : INTEGER # integerExpression ; variableModifier : CONST | VAR ; dependencyPathIdentifier : simpleIdentifier (WS* DOT simpleIdentifier)* DOT ; simpleIdentifier : IDENTIFIER ; IMPORT: 'import'; ASSIGN: '='; DOT: '.'; OUTPUT: 'output'; CONST: 'const'; VAR: 'var'; DEPENDENCY_NAME: (CAPITAL_LETTER) (LETTER | '_' | DIGIT)*; IDENTIFIER: (LETTER | '_') (LETTER | '_' | DIGIT)*; COLON: ':'; CAPITAL_LETTER: [A-Z]; LETTER: [a-zA-Z]; INTEGER: [1-9] DIGIT* | '0'; fragment DIGIT: [0-9]; WS: [ \t\r\n]+ -> skip;
experiments/distinct.agda
crypto-agda/explore
2
8840
<filename>experiments/distinct.agda {-# OPTIONS --without-K #-} module distinct where open import Type open import Type.Identities open import Algebra.FunctionProperties.Eq renaming (Injective to is-injective) open import Function.NP open import Function.Extensionality open import Data.Fin.NP using (Fin; Fin▹ℕ; _==_) open import Data.Vec.NP open import Data.Vec.Properties open import Data.Product renaming (proj₁ to fst; proj₂ to snd) hiding (map) open import Data.Zero open import Data.One open import Data.Two hiding (_==_) open import Data.Sum hiding (map) open import Data.Nat.NP hiding (_==_) open import Data.Nat.Properties import Data.List as L import Data.List.Properties as LP open L using (List; []; _∷_) open import Relation.Binary.PropositionalEquality.NP open import HoTT open Equivalences --open import Explore.Fin is-distinct : {A : Set}{n : ℕ} → Vec A n → Set is-distinct {n = n} v = is-injective (_‼_ v) -- is-distinct {n = n} v = {p q : Fin n}(e : v ‼ p ≡ v ‼ q) → p ≡ q Distinct : (A : Set)(n : ℕ) → Set Distinct A n = Σ (Vec A n) is-distinct Injection : (A B : Set) → Set Injection A B = Σ (A → B) is-injective Auto : (A : Set) → Set Auto A = Injection A A Perm : (n : ℕ) → Set Perm n = Distinct (Fin n) n module _ {n} {{_ : FunExt}} where Perm→Auto : Perm n → Auto (Fin n) Perm→Auto (v , v-dist) = _‼_ v , v-dist tabulate-dist : (f : Fin n → Fin n) (f-inj : Injective f) → is-distinct tabulate-dist f f-inj e = f-inj (! lookup∘tabulate f _ ∙ e ∙ lookup∘tabulate f _) Auto→Perm : Auto (Fin n) → Perm n Auto→Perm (f , f-inj) = tabulate f , λ e → f-inj (! lookup∘tabulate f _ ∙ e ∙ lookup∘tabulate f _) Goal: tr is-injective (λ= (lookup∘tabulate f)) (snd (Auto→Perm (f , f-inj))) ≡ f-inj Perm→Auto→Perm : ∀ a → Perm→Auto (Auto→Perm a) ≡ a Perm→Auto→Perm (f , f-inj) = pair= (λ= (lookup∘tabulate f)) {!!} Auto→Perm→Auto : ∀ π → Auto→Perm (Perm→Auto π) ≡ π Auto→Perm→Auto (v , v-dist) = pair= (tabulate∘lookup v) {!!} Perm≃Auto : Perm n ≃ Auto (Fin n) Perm≃Auto = equiv Perm→Auto Auto→Perm Perm→Auto→Perm Auto→Perm→Auto Arr : (n : ℕ) → Set Arr n = Vec (Fin n) n Sum : Set → Set Sum A = (A → ℕ) → ℕ Prod = Sum postulate sumFin : (n : ℕ) → Sum (Fin n) prodFin : (n : ℕ) → Prod (Fin n) -- sumVec : (A : Set)(n : ℕ) (f : Vec A n → ℕ) → ℕ sumArr : (n : ℕ) → Sum (Arr n) prodFinEq : {n : ℕ}(x y : Fin n) → Prod (x ≡ y) distinctℕ : (n : ℕ) → (sumArr n λ v → prodFin n λ p → prodFin n λ q → prodFinEq p q λ e → 𝟚▹ℕ (p == q)) ≡ {!!} distinctℕ = {!!} {- ℕ< : ℕ → Set ℕ< n = Σ ℕ λ x → x < n sum< : (n : ℕ) (f : ℕ< n → ℕ) → ℕ sum< n f = {!!} prod< : (n : ℕ) (f : ℕ< n → ℕ) → ℕ prod< n f = {!!} {- foo : ∀ n a x → sumFin n λ i → a i * x ^ i foo = ? bar : ∀ n a x → sumFin n λ i → a i * x ^ i bar = ? -} baz : ∀ n (u : ℕ< n → ℕ) → (sum< n λ { (i , p) → prod< i (λ { (j , q) → u (j , <-trans q p) }) }) ≡ {!!} baz = {!!} module _ n (u : ℕ< n → Set) {{_ : UA}} {{_ : FunExt}} where open ≡-Reasoning Baz : _ ≡ _ Baz = (Σ (ℕ< n) λ { (i , p) → Π (ℕ< i) λ { (j , q) → u (j , <-trans q p) } }) ≡⟨ ! Σ-assoc ⟩ (Σ ℕ λ i → Σ (i < n) λ p → Π (ℕ< i) λ { (j , q) → u (j , <-trans q p) }) ≡⟨ Σ=′ ℕ (λ i → Σ=′ (i < n) λ p → ΠΣ-curry) ⟩ (Σ ℕ λ i → Σ (i < n) λ p → Π ℕ λ j → Π (j < i) λ q → u (j , <-trans q p)) ∎ module DataVersion (A : ★) where open import Data.Tree.Binary data T : BinTree A → ★ where empty : T empty _⊕_ : ∀ {t u} → (𝟙 ⊎ T t × T u) → T (fork t u) module TypeVersion where ε = 𝟙 _⊕_ : ★ → ★ → ★ _⊕_ = λ u z → ε ⊎ u × z module ListVersion where open L open ≡-Reasoning map-∘ = LP.map-compose sum-lin : ∀ k xs → sum (map (_*_ k) xs) ≡ k * sum xs sum-lin k [] = ℕ°.*-comm 0 k sum-lin k (x ∷ xs) = k * x + sum (map (_*_ k) xs) ≡⟨ ap (_+_ (k * x)) (sum-lin k xs) ⟩ k * x + k * sum xs ≡⟨ ! fst ℕ°.distrib k x (sum xs) ⟩ k * (x + sum xs) ∎ lemma : ∀ x xss → sum (map product (map (_∷_ x) xss)) ≡ x * sum (map product xss) lemma x xss = sum (map product (map (_∷_ x) xss)) ≡⟨ ap sum (! map-∘ xss) ⟩ sum (map (product ∘ _∷_ x) xss) ≡⟨by-definition⟩ sum (map (_*_ x ∘ product) xss) ≡⟨ ap sum (map-∘ xss) ⟩ sum (map (_*_ x) (map product xss)) ≡⟨ sum-lin x (map product xss) ⟩ x * sum (map product xss) ∎ ε = 1 _⊕_ = λ u z → ε + u * z t3 = ∀ xs → sum (map product (inits xs)) ≡ foldr _⊕_ ε xs t4 : t3 t4 [] = refl t4 (x ∷ xs) = ap suc (lemma x (inits xs) ∙ ap (_*_ x) (t4 xs)) -- -} -- -} -- -} -- -} -- -}
test/succeed/SubtermTermination.agda
asr/agda-kanso
1
6954
-- Check that the termination checker can handle recursive -- calls on subterms which aren't simply variables. module SubtermTermination where data N : Set where zero : N suc : N → N f : N → N f (suc zero) = f zero f _ = zero data One? : N → Set where one : One? (suc zero) other : ∀ {n} → One? n -- Should work for dot patterns as well f′ : (n : N) → One? n → N f′ (suc .zero) one = f′ zero other f′ _ _ = zero f″ : (n : N) → One? n → N f″ ._ one = f″ zero other f″ _ _ = zero data D : Set where c₁ : D c₂ : D → D c₃ : D → D → D g : D → D g (c₃ (c₂ x) y) = g (c₂ x) g _ = c₁ {- Andreas, 2011-07-07 subterm is not complete does not work with postulates or definitions postulate i : {A : Set} → A → A data NAT : N → Set where Zero : NAT zero Suc : ∀ n → NAT (i n) → NAT (suc (i n)) h : (n : N) -> NAT n -> Set h .zero Zero = N h .(suc (i n)) (Suc n m) = h (i n) (i m) -}
programs/oeis/239/A239352.asm
karttu/loda
1
240112
<gh_stars>1-10 ; A239352: van Heijst's upper bound on the number of squares inscribed by a real algebraic curve in R^2 of degree n, if the number is finite. ; 0,0,1,12,48,130,285,546,952,1548,2385,3520,5016,6942,9373,12390,16080,20536,25857,32148,39520,48090,57981,69322,82248,96900,113425,131976,152712,175798,201405,229710,260896,295152,332673,373660,418320,466866,519517,576498,638040,704380,775761,852432,934648,1022670,1116765,1217206,1324272,1438248,1559425,1688100,1824576,1969162,2122173,2283930,2454760,2634996,2824977,3025048,3235560,3456870,3689341,3933342,4189248,4457440,4738305,5032236,5339632,5660898,5996445,6346690,6712056,7092972,7489873,7903200,8333400,8780926,9246237,9729798,10232080,10753560,11294721,11856052,12438048,13041210,13666045,14313066,14982792,15675748,16392465,17133480,17899336,18690582,19507773,20351470,21222240,22120656,23047297,24002748,24987600,26002450,27047901,28124562,29233048,30373980,31547985,32755696,33997752,35274798,36587485,37936470,39322416,40745992,42207873,43708740,45249280,46830186,48452157,50115898,51822120,53571540,55364881,57202872,59086248,61015750,62992125,65016126,67088512,69210048,71381505,73603660,75877296,78203202,80582173,83015010,85502520,88045516,90644817,93301248,96015640,98788830,101621661,104514982,107469648,110486520,113566465,116710356,119919072,123193498,126534525,129943050,133419976,136966212,140582673,144270280,148029960,151862646,155769277,159750798,163808160,167942320,172154241,176444892,180815248,185266290,189799005,194414386,199113432,203897148,208766545,213722640,218766456,223899022,229121373,234434550,239839600,245337576,250929537,256616548,262399680,268280010,274258621,280336602,286515048,292795060,299177745,305664216,312255592,318952998,325757565,332670430,339692736,346825632,354070273,361427820,368899440,376486306,384189597,392010498,399950200,408009900,416190801,424494112,432921048,441472830,450150685,458955846,467889552,476953048,486147585,495474420,504934816,514530042,524261373,534130090,544137480,554284836,564573457,575004648,585579720,596299990,607166781,618181422,629345248,640659600,652125825,663745276,675519312,687449298,699536605,711782610,724188696,736756252,749486673,762381360,775441720,788669166,802065117,815630998,829368240,843278280,857362561,871622532,886059648,900675370,915471165,930448506,945608872,960953748 mov $1,$0 bin $0,2 add $1,$0 sub $1,2 mul $1,$0
hex2bin.asm
suriya-1403/Assemble-language
0
241998
<reponame>suriya-1403/Assemble-language ASSUME CS:CODE,DS:DATA DATA SEGMENT STR DB 'BINARY NUMBER: $' BSTR DB 20 DUP('$') RSTR DB 20 DUP('$') NL DB 13,10,'$' CNT DB 0 N DB 2 H DB 16 D DB 10H NUM DB ? SNUM DB ? HNUM DB 19H DATA ENDS CODE SEGMENT START: MOV AX,DATA MOV DS,AX MOV CX,0000 MOV DX,0000 L1: MOV AX,00 MOV AL,HNUM DIV D MOV HNUM,AL MOV BX,AX MOV CL,CNT MOV AX,1 L2: CMP CL,00 JE L3 MUL H SUB CL,1 JMP L2 L3: MUL BH ADD DX,AX ADD CNT,1 CMP HNUM,0 JG L1 MOV NUM,DL LEA SI,BSTR LEA DI,RSTR L4: MOV AX,00 MOV AL,NUM DIV N ADD AH,30H MOV BYTE PTR[SI],AH INC SI MOV NUM,AL CMP AL,0 JG L4 DEC SI L5: MOV BL,BYTE PTR[SI] MOV BYTE PTR[DI],BL DEC SI INC DI CMP SI,0 JNE L5 MOV AH,09H LEA DX,STR INT 21H MOV AH,09H LEA DX,RSTR INT 21H HLT CODE ENDS END START
libsrc/_DEVELOPMENT/string/c/sccz80/strcasecmp_callee.asm
teknoplop/z88dk
8
105037
<gh_stars>1-10 ; int strcasecmp(const char *s1, const char *s2) SECTION code_clib SECTION code_string PUBLIC strcasecmp_callee EXTERN asm_strcasecmp strcasecmp_callee: pop af pop hl pop de push af jp asm_strcasecmp
Projects/PJZ2/InterferenceBobs/Script.asm
jonathanbennett73/amiga-pjz-planet-disco-balls
21
86097
<filename>Projects/PJZ2/InterferenceBobs/Script.asm ***************************************************************************** * Included at the end of the code section (for (pc) data) ***************************************************************************** ; Values must match .jmptable in Controller_ReadCommands ; Using rs.l as the values will be used in a .l jmptable rsreset FX_END_FLAG rs.l 1 FX_PAUSE_FLAG rs.l 1 FX_START_MASTERFRAME_FLAG rs.l 1 FX_GET_MASTERFRAME_FLAG rs.l 1 FX_ISMASTERFRAMEOVER_FLAG rs.l 1 FX_ISFRAMEOVER_FLAG rs.l 1 FX_SCRIPTJMP_FLAG rs.l 1 FX_PALETTE_FLAG rs.l 1 FX_NEXT_PHASE_FLAG rs.l 1 FX_MUSICSYNCMASK_FLAG rs.l 1 FX_MUSICSYNCMASKWAIT_FLAG rs.l 1 FX_USERVAL_FLAG rs.l 1 FX_USERVALWAIT_FLAG rs.l 1 FX_SINE_SET_FLAG rs.l 1 FX_END MACRO dc.w FX_END_FLAG ENDM FX_PAUSE MACRO dc.w FX_PAUSE_FLAG dc.w \1 ;frames to pause ENDM FX_START_MASTERFRAME MACRO dc.w FX_START_MASTERFRAME_FLAG dc.w \1 ;frames wait for (global timing) ENDM FX_GET_MASTERFRAME MACRO dc.w FX_GET_MASTERFRAME_FLAG ENDM FX_ISMASTERFRAMEOVER MACRO dc.w FX_ISMASTERFRAMEOVER_FLAG dc.w \1 ;frames wait for (global timing) ENDM FX_ISFRAMEOVER MACRO dc.w FX_ISFRAMEOVER_FLAG dc.w \1 ;frames wait for (local timing) ENDM FX_SCRIPTJMP MACRO dc.w FX_SCRIPTJMP_FLAG dc.l \1 ;new script address ENDM FX_PALETTE MACRO dc.w FX_PALETTE_FLAG dc.w \1 ;speed dc.w \2 ;new palette OFFSET ENDM FX_NEXT_PHASE MACRO dc.w FX_NEXT_PHASE_FLAG ENDM FX_MUSICSYNCMASK MACRO dc.w FX_MUSICSYNCMASK_FLAG dc.w \1 ;mask 0-$ff ENDM FX_MUSICSYNCMASKWAIT MACRO dc.w FX_MUSICSYNCMASKWAIT_FLAG dc.w \1 ;mask 0-$ff ENDM FX_USERVAL MACRO dc.w FX_USERVAL_FLAG dc.w \1 ;Offset to a CTRL_xxx variable dc.w \2 ;value to write ENDM FX_USERVALWAIT MACRO dc.w FX_USERVALWAIT_FLAG dc.w \1 ;Offset to a CTRL_xxx variable dc.w \2 ;value to wait for ENDM FX_SINE_SET MACRO dc.w FX_SINE_SET_FLAG ;Note most routines require even values to avoid the need to add.w d0,d0 for table lookups dc.w \1 ;change speed dc.w \2,\3,\4 ;offset (-1 leaves alone), speed, step dc.w \5 ;offset of sine variables in Controller_Info ENDM ***************************************************************************** ;1,2,4,8 - dim ;3,5,6,9,10,12 - brighter ;7,11,13,14 - brightest ;15 ;0001 - bpl1 ;0010 - 2 ;0011 - 1+2 ;0100 - 1 ;0101 - 1+1 ;0110 - 1+2 ;0111 - 1+1+2 ;1000 - 2 ;1001 - 2+1 ;1010 - 2+2 ;1011 - 2+2+1 ;1100 - 2+1 ;1101 - 2+1+1 ;1110 - 2+1+2 ;1111 - 2+2+1+1 PAL_PaletteStart: ;for offsets ; All black and white palettes used for fades/lightsources PAL_AllBlack: dcb.w PAL_NUMCOLS_MAIN,0 ;main colours dcb.w PAL_NUMCOLS_ALT,0 ;dark/reflection colours PAL_ALLBLACK equ PAL_AllBlack-PAL_PaletteStart ;PAL_AllWhite: dcb.w PAL_NUMCOLS_MAIN,$fff ;main colours ; dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours ;PAL_ALLWHITE equ PAL_AllWhite-PAL_PaletteStart ; Just lots of colors for testing ;PAL_Default: dc.w $000 ; dc.w $fff,$0f0,$00f,$ff0,$0ff,$f0f ; dc.w $f77,$7f7,$77f,$ff7,$7ff,$f7f ; dc.w $f73,$3f7,$37f,$ff3,$7ff,$f3f ; dc.w $f00,$7f4,$fff,$ff9,$9ff,$f9f ; dcb.w PAL_NUMCOLS_MAIN-1,$fff ;main colours ; dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours c1 set $505 c2 set $f5f c3 set $faf c4 set $fff s1 set $000 s2 set $f55 s3 set $fff PAL_Purple: dc.w $101,c1,c1,c2,c1,c2,c2,c3 ;bpl dc.w c1,c2,c2,c3,c2,c3,c3,c4 ;bpl dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours PAL_PURPLE equ PAL_Purple-PAL_PaletteStart c1 set $500 c2 set $f55 c3 set $faa c4 set $fff s1 set $000 s2 set $ff5 s3 set $fff PAL_Red: dc.w $101,c1,c1,c2,c1,c2,c2,c3 dc.w c1,c2,c2,c3,c2,c3,c3,c4 dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours PAL_RED equ PAL_Red-PAL_PaletteStart c1 set $f00 c2 set $ff5 c3 set $ffa c4 set $fff s1 set $000 s2 set $ff5 s3 set $fff PAL_Flame: dc.w $101,c1,c1,c2,c1,c2,c2,c3 dc.w c1,c2,c2,c3,c2,c3,c3,c4 dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours PAL_FLAME equ PAL_Flame-PAL_PaletteStart c1 set $550 c2 set $ff5 c3 set $ffa c4 set $fff s1 set $000 s2 set $35f s3 set $fff ;PAL_Yellow: dc.w $101,c1,c1,c2,c1,c2,c2,c3 ; dc.w c1,c2,c2,c3,c2,c3,c3,c4 ; dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours c1 set $005 c2 set $35f c3 set $3af c4 set $3ff s1 set $000 s2 set $5f5 s3 set $fff PAL_Blue: dc.w $101,c1,c1,c2,c1,c2,c2,c3 dc.w c1,c2,c2,c3,c2,c3,c3,c4 dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours PAL_BLUE equ PAL_Blue-PAL_PaletteStart c1 set $050 c2 set $5f5 c3 set $afa c4 set $fff s1 set $000 s2 set $5ff s3 set $fff PAL_Green: dc.w $101,c1,c1,c2,c1,c2,c2,c3 dc.w c1,c2,c2,c3,c2,c3,c3,c4 dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dc.w 0,s1,s2,s3,0,s1,s2,s3 ;spr dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours PAL_GREEN equ PAL_Green-PAL_PaletteStart c1 set $055 c2 set $5ff c3 set $aff c4 set $fff s1 set $000 s2 set $5ff s3 set $fff ;PAL_Cyan: dc.w $101,c1,c1,c2,c1,c2,c2,c3 ; dc.w c1,c2,c2,c3,c2,c3,c3,c4 ; dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours PAL_Blank: dcb.w PAL_NUMCOLS_MAIN,$101 dcb.w PAL_NUMCOLS_ALT,$fff ;dark/reflection colours PAL_BLANK equ PAL_Blank-PAL_PaletteStart ***************************************************************************** ControllerScript: ;During init will run everything up to first FX_PAUSE/FX_STARTWAIT_MASTERFRAME ;before loading the IRQ/Copper. ;Better to use FX_STARTWAIT_MASTERFRAME with 0 or higher to sync A500 with ;faster machines numbobs set 30 numbobsloop set (BOB_SINE_NUMENTRIES*2)/numbobs ;Init ;---- FX_PALETTE 0,PAL_ALLBLACK FX_MUSICSYNCMASK $00 FX_USERVAL CTRL_NUMBOBS,numbobs FX_USERVAL CTRL_BOB_CURRENT,0 ;Square FX_USERVAL CTRL_SPRITE_CURRENT,0 ;Optic FX_START_MASTERFRAME $1087 ;Run ;---- ;FX_USERVALWAIT CTRL_USERVAL1,$ffff ;FX_PALETTE 0,PAL_AllBlack ;FX_MUSICSYNCMASKWAIT $0f ;FX_PALETTE 0,PAL_AllBlack ;FX_SINE_SET 0,0,10*4,0,CTRL_SINE_X3 ;FX_SINE_SET 0,0,8*4,0,CTRL_SINE_X4 ;FX_SINE_SET 0,0,4*4,0,CTRL_SINE_Y3 ;FX_SINE_SET 0,0,12*4,0,CTRL_SINE_Y3 ;Circle pattern 1 numbobs set 28 numbobsloop set (BOB_SINE_NUMENTRIES*2)/numbobs ; FX_USERVAL CTRL_NUMBOBS,numbobs ; FX_USERVAL CTRL_BOB_CURRENT,0 ;Circle ; FX_SINE_SET 0,0,8*4,numbobsloop,CTRL_SINE_X1 ; FX_SINE_SET 0,0,8*4,numbobsloop,CTRL_SINE_X2 ; FX_SINE_SET 0,0,12*4,numbobsloop,CTRL_SINE_Y1 ; FX_SINE_SET 0,BOB_SINE_NUMENTRIES/2,12*4,numbobsloop,CTRL_SINE_Y2 ; FX_PAUSE 4 ; FX_PALETTE 2,PAL_FLAME ; FX_PAUSE 4*16 ; FX_PALETTE 4,PAL_BLUE ; FX_PAUSE 4*16 ; FX_PALETTE 4,PAL_GREEN ; FX_PAUSE 4*16 ; FX_PALETTE 4,PAL_PURPLE ; FX_PAUSE 4*16 ; FX_PALETTE 4,PAL_RED ; FX_PAUSE 4*16 ; FX_PALETTE 2,PAL_BLANK ; FX_PAUSE 2*16 ;Square pattern 2 numbobs set 28 numbobsloop set (BOB_SINE_NUMENTRIES*2)/numbobs FX_USERVAL CTRL_NUMBOBS,numbobs FX_USERVAL CTRL_BOB_CURRENT,4 ;Square FX_USERVAL CTRL_SPRITE_CURRENT,0 ;Optic FX_SINE_SET 0,0,6*4,numbobsloop,CTRL_SINE_X1 FX_SINE_SET 0,0,6*4,numbobsloop,CTRL_SINE_X2 FX_SINE_SET 0,0,4*4,numbobsloop,CTRL_SINE_Y1 FX_SINE_SET 0,0,4*4,numbobsloop,CTRL_SINE_Y2 FX_SINE_SET 0,0,8*4,0,CTRL_SINE_X3 FX_SINE_SET 0,0,6*4,0,CTRL_SINE_X4 FX_SINE_SET 0,0,2*4,0,CTRL_SINE_Y3 FX_SINE_SET 0,0,10*4,0,CTRL_SINE_Y3 FX_PAUSE 1 FX_PALETTE 4,PAL_FLAME FX_PAUSE 6*15 FX_MUSICSYNCMASK $ff FX_PALETTE 6,PAL_BLUE FX_PAUSE 6*15 FX_PALETTE 6,PAL_GREEN FX_PAUSE 6*15 FX_PALETTE 6,PAL_PURPLE FX_PAUSE 6*15 FX_PALETTE 6,PAL_RED FX_PAUSE 6*15 FX_PALETTE 2,PAL_BLANK FX_MUSICSYNCMASK $00 FX_PAUSE 2*15 ;Circle changing sizes numbobs set 28 numbobsloop set (BOB_SINE_NUMENTRIES*2)/numbobs ; FX_USERVAL CTRL_NUMBOBS,numbobs ; FX_USERVAL CTRL_BOB_CURRENT,0 ;Circle ; FX_SINE_SET 0,0,6*4,numbobsloop,CTRL_SINE_X1 ; FX_SINE_SET 0,0,10*4,numbobsloop,CTRL_SINE_X2 ; FX_SINE_SET 0,BOB_SINE_NUMENTRIES/2,16*4,numbobsloop,CTRL_SINE_Y1 ; FX_SINE_SET 0,BOB_SINE_NUMENTRIES/2,10*4,numbobsloop,CTRL_SINE_Y2 ; FX_PAUSE 4 ; FX_PALETTE 2,PAL_FLAME ; FX_PAUSE 4*16 ; FX_PALETTE 4,PAL_BLUE ; FX_PAUSE 4*16 ; FX_PALETTE 4,PAL_GREEN ; FX_PAUSE 4*16 ; FX_PALETTE 4,PAL_PURPLE ; FX_PAUSE 4*16 ; FX_PALETTE 4,PAL_RED ; FX_PAUSE 4*16 ; FX_PALETTE 2,PAL_BLANK ; FX_PAUSE 2*16 ;Square pattern 1 numbobs set 28 numbobsloop set (BOB_SINE_NUMENTRIES*2)/numbobs FX_USERVAL CTRL_NUMBOBS,numbobs FX_USERVAL CTRL_BOB_CURRENT,0 ;Square FX_USERVAL CTRL_SPRITE_CURRENT,4 ;Tecon FX_SINE_SET 0,0,4*4,numbobsloop,CTRL_SINE_X1 FX_SINE_SET 0,0,4*4,numbobsloop,CTRL_SINE_X2 FX_SINE_SET 0,0,6*4,numbobsloop,CTRL_SINE_Y1 FX_SINE_SET 0,0,6*4,numbobsloop,CTRL_SINE_Y2 FX_SINE_SET 0,0,10*4,0,CTRL_SINE_X3 FX_SINE_SET 0,0,2*4,0,CTRL_SINE_X4 FX_SINE_SET 0,0,4*4,0,CTRL_SINE_Y3 FX_SINE_SET 0,0,6*4,0,CTRL_SINE_Y3 FX_PAUSE 1 FX_PALETTE 2,PAL_FLAME FX_PAUSE 6*15 FX_MUSICSYNCMASK $ff FX_PALETTE 6,PAL_BLUE FX_PAUSE 6*15 FX_PALETTE 46,PAL_GREEN FX_PAUSE 6*15 FX_PALETTE 6,PAL_PURPLE FX_PAUSE 6*15 FX_PALETTE 6,PAL_RED FX_PAUSE 6*15 FX_PALETTE 2,PAL_BLANK FX_MUSICSYNCMASK $0 FX_PAUSE 2*15 ;Star pattern 1 numbobs set 12 numbobsloop set (BOB_SINE_NUMENTRIES*2)/numbobs FX_USERVAL CTRL_NUMBOBS,numbobs FX_USERVAL CTRL_BOB_CURRENT,8 ;Star FX_USERVAL CTRL_SPRITE_CURRENT,8 ;Antiriad FX_SINE_SET 0,0,6*4,numbobsloop,CTRL_SINE_X1 FX_SINE_SET 0,0,6*4,numbobsloop,CTRL_SINE_X2 FX_SINE_SET 0,0,4*4,numbobsloop,CTRL_SINE_Y1 FX_SINE_SET 0,0,4*4,numbobsloop,CTRL_SINE_Y2 FX_SINE_SET 0,0,12*4,0,CTRL_SINE_X3 FX_SINE_SET 0,0,2*4,0,CTRL_SINE_X4 FX_SINE_SET 0,0,14*4,0,CTRL_SINE_Y3 FX_SINE_SET 0,0,4*4,0,CTRL_SINE_Y3 FX_PAUSE 1 FX_PALETTE 4,PAL_FLAME FX_PAUSE 6*15 FX_MUSICSYNCMASK $ff FX_PALETTE 6,PAL_BLUE FX_PAUSE 6*15 FX_PALETTE 6,PAL_GREEN FX_PAUSE 6*15 FX_PALETTE 6,PAL_PURPLE FX_PAUSE 6*15 FX_PALETTE 6,PAL_RED FX_PAUSE 6*15 FX_PALETTE 4,PAL_BLANK FX_MUSICSYNCMASK $00 FX_PAUSE 4*15 ;FX_MUSICSYNCMASK $00 ;FX_PALETTE 4,PAL_ALLBLACK ;FX_PAUSE 4*15 FX_END
Labs/Lab3_Baby-steps/examples/ex1.asm
CristianCotovanu/IOCLA
2
21300
%include "io.inc" section .text global CMAIN CMAIN: mov eax, 7 ; incarca in registrul eax valoarea 7 mov ebx, 8 ; incarca in registrul ebx valoarea 8 add eax, ebx ; aduna valoarea ce se afla in registrul eax ; cu valoarea ce se afla in registrul ebx si ; stocheaza rezultatul in eax PRINT_UDEC 4, eax ; printeaza valoarea din registrul eax
klc3-manual/examples/zjui_ece220_fa20/mp3/extra.asm
liuzikai/klc3
0
3147
.ORIG x4800 ; Weekday bit vector ; A bit vector of -1 ends the event list. ; May assume all bit vectors have 0 bits in the high 11 bits. ; May not assume that event bit vectors are non-zero. ; Event name pointer ; May assume valid and unique ASCII strings ; Event slot bit vector ; Can be anything ; Must ignore the meaningless bit (bit 15) ; KLC3: INPUT_FILE ; KLC3: SET_DATA_DEFAULT_FLAG READ_ONLY ; KLC3: COMMENT Extra event input of the test case. ; KLC3: COMMENT Note that this file may contains additional things after the end of extra list. ; KLC3: COMMENT lease carefully identify the end of the extra list. .BLKW #1 ; KLC3: SYMBOLIC as EXTRA1_WEEKDAY_BV ; KLC3: SYMBOLIC EXTRA1_WEEKDAY_BV >= #-1 & EXTRA1_WEEKDAY_BV <= #3 | EXTRA1_WEEKDAY_BV >= x10 & EXTRA1_WEEKDAY_BV <= x13 ; -1 (empty list), b00000 to b00011, b10000 to b10011 .FILL EXTRA1_NAME ; KLC3: INPUT EXTRA1_NAME_PTR .BLKW #1 ; KLC3: SYMBOLIC as EXTRA1_SLOT_BV ; KLC3: SYMBOLIC EXTRA1_SLOT_BV >= #0 & EXTRA1_SLOT_BV <= #3 | EXTRA1_SLOT_BV >= xC000 & EXTRA1_SLOT_BV <= xC003 | EXTRA1_SLOT_BV >= x8000 & EXTRA1_SLOT_BV <= x8003 | EXTRA1_SLOT_BV >= x4000 & EXTRA1_SLOT_BV <= x4003 ; Bit 0, 1, 14 and 15 (should not matter) ; KLC3: SYMBOLIC EXTRA1_WEEKDAY_BV != #0 | EXTRA1_SLOT_BV != #0 ; The case that won't be test .BLKW #1 ; KLC3: SYMBOLIC as EXTRA2_WEEKDAY_BV ; KLC3: SYMBOLIC EXTRA2_WEEKDAY_BV == #-1 | EXTRA2_WEEKDAY_BV == #14 ; -1 (end), b01110 .FILL EXTRA2_NAME ; KLC3: INPUT EXTRA2_NAME_PTR .BLKW #1 ; KLC3: SYMBOLIC as EXTRA2_SLOT_BV ; KLC3: SYMBOLIC EXTRA2_SLOT_BV > #0 & EXTRA2_SLOT_BV <= #3 | EXTRA2_SLOT_BV >= x4000 & EXTRA2_SLOT_BV <= x4003 ; Bit 0, 1 and 14, excluding all 0 case (already tested at EXTRA1) ; EXTRA2_WEEKDAY_BV won't be 0, EXTRA2_SLOT_BV won't be 0 .BLKW #1 ; KLC3: SYMBOLIC as EXTRA3_WEEKDAY_BV ; KLC3: SYMBOLIC EXTRA3_WEEKDAY_BV == #-1 | EXTRA3_WEEKDAY_BV == #24 ; -1 (end), b11000 .FILL EXTRA3_NAME ; KLC3: INPUT EXTRA3_NAME_PTR .FILL #1 ; KLC3: INPUT EXTRA3_SLOT_BV ; Bit 0 .FILL #-1 ; Mark the end of the extra list EXTRA1_NAME .STRINGZ "Z" ; KLC3: INPUT EXTRA1_NAME EXTRA2_NAME .STRINGZ "YYYYYYYYYY" ; KLC3: INPUT EXTRA2_NAME EXTRA3_NAME .STRINGZ "" ; KLC3: INPUT EXTRA3_NAME .END
src/main/java/org/apache/sysml/parser/pydml/Pydml.g4
fschueler/systemml
1
1198
/* * 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 Pydml; @header { /* * 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. */ } // This antlr grammar is based on Python 3.3 language reference: https://docs.python.org/3.3/reference/grammar.html tokens { INDENT, DEDENT } @lexer::members { private boolean debugIndentRules = false; // Indentation level stack private java.util.Stack<Integer> indents = new java.util.Stack<Integer>(); // Extra tokens queue (see the NEWLINE rule). private java.util.Queue<Token> tokens = new java.util.LinkedList<Token>(); // Number of opened braces, brackets and parenthesis. private int opened = 0; // This is only used to set the line number for dedent private Token lastToken = null; @Override public void emit(Token t) { if(debugIndentRules) System.out.println("Emitted token:" + t); super.setToken(t); tokens.offer(t); } @Override public Token nextToken() { if (_input.LA(1) == EOF && !this.indents.isEmpty()) { if(debugIndentRules) System.out.println("EOF reached and expecting some DEDENTS, so emitting them"); tokens.poll(); this.emit(commonToken(PydmlParser.NEWLINE, "\n")); // Now emit as much DEDENT tokens as needed. while (!indents.isEmpty()) { if(debugIndentRules) System.out.println("Emitting (inserted) DEDENTS"); this.emit(createDedent()); indents.pop(); } // Put the EOF back on the token stream. this.emit(commonToken(PydmlParser.EOF, "<EOF>")); } Token next = super.nextToken(); if (next.getChannel() == Token.DEFAULT_CHANNEL) { // Keep track of the last token on the default channel. this.lastToken = next; } Token retVal = tokens.isEmpty() ? next : tokens.poll(); if(debugIndentRules) System.out.println("Returning nextToken: [" + retVal + "]<<" + tokens.isEmpty()); return retVal; } private Token createDedent() { CommonToken dedent = commonToken(PydmlParser.DEDENT, ""); dedent.setLine(this.lastToken.getLine()); return dedent; } private CommonToken commonToken(int type, String text) { // Nike: Main change: This logic was screwed up and was emitting additional 3 characters, so commenting it for now. // int start = this.getCharIndex(); // int stop = start + text.length(); // return new CommonToken(this._tokenFactorySourcePair, type, DEFAULT_TOKEN_CHANNEL, start, stop); return new CommonToken(type, text); // Main change } // Calculates the indentation level from the spaces: // "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; } } // 2. Modify this g4 by comparing it with Java: // - https://pythonconquerstheuniverse.wordpress.com/2009/10/03/python-java-a-side-by-side-comparison/ // - http://www.cs.gordon.edu/courses/cps122/handouts-2014/From%20Python%20to%20Java%20Lecture/A%20Comparison%20of%20the%20Syntax%20of%20Python%20and%20Java.pdf // - http://cs.joensuu.fi/~pviktor/python/slides/cheatsheet.pdf // - http://www.interfaceware.com/manual/chameleon/scripts/quickreference.pdf // DML Program is a list of expression // For now, we only allow global function definitions (not nested or inside a while block) programroot: (blocks+=statement | functionBlocks+=functionStatement)* NEWLINE* EOF; statement returns [ org.apache.sysml.parser.common.StatementInfo info ] @init { // This actions occurs regardless of how many alternatives in this rule $info = new org.apache.sysml.parser.common.StatementInfo(); } : // ------------------------------------------ // ImportStatement 'source' OPEN_PAREN filePath = STRING CLOSE_PAREN 'as' namespace=ID NEWLINE # ImportStatement | 'setwd' OPEN_PAREN pathValue = STRING CLOSE_PAREN NEWLINE # PathStatement // ------------------------------------------ // AssignmentStatement | targetList=dataIdentifier '=' 'ifdef' OPEN_PAREN commandLineParam=dataIdentifier ',' source=expression CLOSE_PAREN NEWLINE # IfdefAssignmentStatement // ------------------------------------------ // Treat function call as AssignmentStatement or MultiAssignmentStatement // For backward compatibility and also since the behavior of foo() * A + foo() ... where foo returns A // Convert FunctionCallIdentifier(paramExprs, ..) -> source | // TODO: Throw an informative error if user doesnot provide the optional assignment ( targetList=dataIdentifier '=' )? name=ID OPEN_PAREN (paramExprs+=parameterizedExpression (',' paramExprs+=parameterizedExpression)* )? CLOSE_PAREN NEWLINE # FunctionCallAssignmentStatement | OPEN_BRACK targetList+=dataIdentifier (',' targetList+=dataIdentifier)* CLOSE_BRACK '=' name=ID OPEN_PAREN (paramExprs+=parameterizedExpression (',' paramExprs+=parameterizedExpression)* )? CLOSE_PAREN NEWLINE # FunctionCallMultiAssignmentStatement // {notifyErrorListeners("Too many parentheses");} // We don't support block statement // | '{' body+=expression ';'* ( body+=expression ';'* )* '}' # BlockStatement // ------------------------------------------ | targetList=dataIdentifier '=' source=expression NEWLINE # AssignmentStatement // IfStatement // | 'if' OPEN_PAREN predicate=expression CLOSE_PAREN (ifBody+=statement ';'* | NEWLINE INDENT (ifBody+=statement)+ DEDENT ) ('else' (elseBody+=statement ';'* | '{' (elseBody+=statement ';'*)* '}'))? # IfStatement | 'if' (OPEN_PAREN predicate=expression CLOSE_PAREN | predicate=expression) ':' NEWLINE INDENT (ifBody+=statement)+ DEDENT (elifBranches += elifBranch)* ('else' ':' NEWLINE INDENT (elseBody+=statement)+ DEDENT )? # IfStatement // ------------------------------------------ // ForStatement & ParForStatement | 'for' (OPEN_PAREN iterVar=ID 'in' iterPred=iterablePredicate (',' parForParams+=strictParameterizedExpression)* CLOSE_PAREN | iterVar=ID 'in' iterPred=iterablePredicate (',' parForParams+=strictParameterizedExpression)* ) ':' NEWLINE INDENT (body+=statement)+ DEDENT # ForStatement // Convert strictParameterizedExpression to HashMap<String, String> for parForParams | 'parfor' (OPEN_PAREN iterVar=ID 'in' iterPred=iterablePredicate (',' parForParams+=strictParameterizedExpression)* CLOSE_PAREN | iterVar=ID 'in' iterPred=iterablePredicate (',' parForParams+=strictParameterizedExpression)* ) ':' NEWLINE INDENT (body+=statement)+ DEDENT # ParForStatement | 'while' ( OPEN_PAREN predicate=expression CLOSE_PAREN | predicate=expression ) ':' NEWLINE INDENT (body+=statement)+ DEDENT # WhileStatement // ------------------------------------------ | NEWLINE #IgnoreNewLine ; elifBranch returns [ org.apache.sysml.parser.common.StatementInfo info ] @init { // This actions occurs regardless of how many alternatives in this rule $info = new org.apache.sysml.parser.common.StatementInfo(); } : 'elif' (OPEN_PAREN predicate=expression CLOSE_PAREN | predicate=expression) ':' NEWLINE INDENT (elifBody+=statement)+ DEDENT ; iterablePredicate returns [ org.apache.sysml.parser.common.ExpressionInfo info ] @init { // This actions occurs regardless of how many alternatives in this rule $info = new org.apache.sysml.parser.common.ExpressionInfo(); } : from=expression ':' to=expression #IterablePredicateColonExpression | ID OPEN_PAREN from=expression ',' to=expression (',' increment=expression)? CLOSE_PAREN #IterablePredicateSeqExpression ; functionStatement returns [ org.apache.sysml.parser.common.StatementInfo info ] @init { // This actions occurs regardless of how many alternatives in this rule $info = new org.apache.sysml.parser.common.StatementInfo(); } : // ------------------------------------------ // FunctionStatement & ExternalFunctionStatement // small change: only allow typed arguments here ... instead of data identifier 'def' name=ID OPEN_PAREN ( inputParams+=typedArgNoAssign (',' inputParams+=typedArgNoAssign)* )? CLOSE_PAREN ( '->' OPEN_PAREN ( outputParams+=typedArgNoAssign (',' outputParams+=typedArgNoAssign)* )? CLOSE_PAREN )? ':' NEWLINE INDENT (body+=statement)+ DEDENT # InternalFunctionDefExpression | 'defExternal' name=ID OPEN_PAREN ( inputParams+=typedArgNoAssign (',' inputParams+=typedArgNoAssign)* )? CLOSE_PAREN ( '->' OPEN_PAREN ( outputParams+=typedArgNoAssign (',' outputParams+=typedArgNoAssign)* )? CLOSE_PAREN )? 'implemented' 'in' OPEN_PAREN ( otherParams+=strictParameterizedKeyValueString (',' otherParams+=strictParameterizedKeyValueString)* )? CLOSE_PAREN NEWLINE # ExternalFunctionDefExpression // ------------------------------------------ ; // Other data identifiers are typedArgNoAssign, parameterizedExpression and strictParameterizedExpression dataIdentifier returns [ org.apache.sysml.parser.common.ExpressionInfo dataInfo ] @init { // This actions occurs regardless of how many alternatives in this rule $dataInfo = new org.apache.sysml.parser.common.ExpressionInfo(); // $dataInfo.expr = new org.apache.sysml.parser.DataIdentifier(); } : // ------------------------------------------ // IndexedIdentifier -- allows implicit lower and upper bounds name=ID OPEN_BRACK (rowLower=expression)? (rowImplicitSlice=':' (rowUpper=expression)?)? (',' (colLower=expression)? (colImplicitSlice=':' (colUpper=expression)?)?)? CLOSE_BRACK # IndexedExpression // ------------------------------------------ | ID # SimpleDataIdentifierExpression | COMMANDLINE_NAMED_ID # CommandlineParamExpression | COMMANDLINE_POSITION_ID # CommandlinePositionExpression ; expression returns [ org.apache.sysml.parser.common.ExpressionInfo info ] @init { // This actions occurs regardless of how many alternatives in this rule $info = new org.apache.sysml.parser.common.ExpressionInfo(); // $info.expr = new org.apache.sysml.parser.BinaryExpression(org.apache.sysml.parser.Expression.BinaryOp.INVALID); } : // ------------------------------------------ // BinaryExpression // power <assoc=right> left=expression op='**' right=expression # PowerExpression // unary plus and minus | op=('-'|'+') left=expression # UnaryExpression // sequence - since we are only using this into for loop => Array not supported //| left=expression op=':' right=expression # SequenceExpression // matrix multiply // | left=expression op='*' right=expression # MatrixMulExpression // modulus and integer division | left=expression op=('//' | '%' ) right=expression # ModIntDivExpression // arithmetic multiply and divide | left=expression op=('*'|'/') right=expression # MultDivExpression // arithmetic addition and subtraction | left=expression op=('+'|'-') right=expression # AddSubExpression // ------------------------------------------ // RelationalExpression | left=expression op=('>'|'>='|'<'|'<='|'=='|'!=') right=expression # RelationalExpression // ------------------------------------------ // BooleanExpression // boolean not | op='!' left=expression # BooleanNotExpression // boolean and | left=expression op=('&'|'and') right=expression # BooleanAndExpression // boolean or | left=expression op=('|'|'or') right=expression # BooleanOrExpression // --------------------------------- // only applicable for builtin function expressions // Add following additional functions and check number of parameters: // power, full, matrix, reshape, dot // Also take care whether there is y.transpose() => which sometinamespace | name=ID OPEN_PAREN (paramExprs+=parameterizedExpression (',' paramExprs+=parameterizedExpression)* )? CLOSE_PAREN ';'* # BuiltinFunctionExpression // 4. Atomic | OPEN_PAREN left=expression CLOSE_PAREN # AtomicExpression // Should you allow indexed expression here ? // | OPEN_BRACK targetList+=expression (',' targetList+=expression)* CLOSE_BRACK # MultiIdExpression // | BOOLEAN # ConstBooleanIdExpression | 'True' # ConstTrueExpression | 'False' # ConstFalseExpression | INT # ConstIntIdExpression | DOUBLE # ConstDoubleIdExpression | STRING # ConstStringIdExpression | dataIdentifier # DataIdExpression // Special // | 'NULL' | 'NA' | 'Inf' | 'NaN' ; typedArgNoAssign : paramName=ID ':' paramType=ml_type ; parameterizedExpression : (paramName=ID '=')? paramVal=expression; strictParameterizedExpression : paramName=ID '=' paramVal=expression ; strictParameterizedKeyValueString : paramName=ID '=' paramVal=STRING ; // sometimes this is matrix object and sometimes its namespace ID : (ALPHABET (ALPHABET|DIGIT|'_')* '.')? ALPHABET (ALPHABET|DIGIT|'_')* // Special ID cases: // | 'matrix' // --> This is a special case which causes lot of headache // | 'scalar' | 'float' | 'int' | 'bool' // corresponds to as.scalar, as.double, as.integer and as.logical | 'index.return' ; // Unfortunately, we have datatype name clashing with builtin function name: matrix :( // Therefore, ugly work around for checking datatype ml_type : valueType | dataType OPEN_BRACK valueType CLOSE_BRACK; // Note to reduce number of keywords, these are case-sensitive, // To allow case-insenstive, 'int' becomes: ('i' | 'I') ('n' | 'N') ('t' | 'T') valueType: ID # ValueDataTypeCheck // 'int' | 'str' | 'bool' | 'float' ; dataType: // 'scalar' # ScalarDataTypeDummyCheck // | ID # MatrixDataTypeCheck //{ if($ID.text.compareTo("matrix") != 0) { notifyErrorListeners("incorrect datatype"); } } //| 'matrix' //---> See ID, this causes lot of headache ; INT : DIGIT+ [Ll]?; // BOOLEAN : 'TRUE' | 'FALSE'; DOUBLE: DIGIT+ '.' DIGIT* EXP? [Ll]? | DIGIT+ EXP? [Ll]? | '.' DIGIT+ EXP? [Ll]? ; DIGIT: '0'..'9'; ALPHABET : [a-zA-Z] ; fragment EXP : ('E' | 'e') ('+' | '-')? INT ; COMMANDLINE_NAMED_ID: '$' ALPHABET (ALPHABET|DIGIT|'_')*; COMMANDLINE_POSITION_ID: '$' DIGIT+; // supports single and double quoted string with escape characters STRING: '"' ( ESC | ~[\\"] )*? '"' | '\'' ( ESC | ~[\\'] )*? '\''; fragment ESC : '\\' [btnfr"'\\] ; // Comments, whitespaces and new line // LINE_COMMENT : '#' .*? '\r'? '\n' -> skip ; // MULTILINE_BLOCK_COMMENT : '/*' .*? '*/' -> skip ; // WHITESPACE : (' ' | '\r' | '\n')+ -> skip ; OPEN_BRACK : '[' {opened++;}; CLOSE_BRACK : ']' {opened--;}; OPEN_PAREN : '(' {opened++;}; CLOSE_PAREN : ')' {opened--;}; // OPEN_BRACE : '{' {opened++;}; // CLOSE_BRACE : '}' {opened--;}; fragment SPACES : [ \t]+ ; fragment COMMENT : '#' ~[\r\n]* ; fragment LINE_JOINING : '\\' SPACES? ( '\r'? '\n' | '\r' ) ; NEWLINE : ( '\r'? '\n' | '\r' ) SPACES? { String newLine = getText().replaceAll("[^\r\n]+", ""); String spaces = getText().replaceAll("[\r\n]+", ""); int next = _input.LA(1); if (opened > 0 || next == '\r' || next == '\n' || next == '#') { // If we're inside a list or on a blank line, ignore all indents, // dedents and line breaks. skip(); if(debugIndentRules) { if(next == '\r' || next == '\n') { System.out.println("4.1 Skipping (blank lines)"); } else if(next == '#') { System.out.println("4.2 Skipping (comment)"); } else { System.out.println("4.2 Skipping something else"); } } } else { emit(commonToken(NEWLINE, newLine)); int indent = getIndentationCount(spaces); int previous = indents.isEmpty() ? 0 : indents.peek(); if (indent == previous) { if(debugIndentRules) System.out.println("3. Skipping identation as of same size:" + next); // skip indents of the same size as the present indent-size skip(); } else if (indent > previous) { if(debugIndentRules) System.out.println("1. Indent:" + next); indents.push(indent); emit(commonToken(PydmlParser.INDENT, spaces)); } else { // Possibly emit more than 1 DEDENT token. while(!indents.isEmpty() && indents.peek() > indent) { if(debugIndentRules) System.out.println("2. Dedent:" + next); this.emit(createDedent()); indents.pop(); } } } } ; SKIP_WS : ( SPACES | COMMENT | LINE_JOINING ) -> skip ;
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_796.asm
ljhsiun2/medusa
9
27219
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r15 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x4a3f, %r9 inc %rdx vmovups (%r9), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $1, %xmm1, %r11 dec %r9 lea addresses_A_ht+0x3533, %r12 nop nop nop nop nop inc %rax movb (%r12), %r11b nop nop and %rax, %rax lea addresses_WT_ht+0x18b43, %rax nop nop nop nop add %r11, %r11 mov $0x6162636465666768, %rdi movq %rdi, %xmm0 and $0xffffffffffffffc0, %rax movntdq %xmm0, (%rax) xor $24887, %r12 lea addresses_UC_ht+0x6833, %rdx nop nop nop nop inc %r15 movups (%rdx), %xmm6 vpextrq $0, %xmm6, %rdi nop nop nop add %r9, %r9 lea addresses_UC_ht+0x11133, %rsi lea addresses_UC_ht+0x6d33, %rdi clflush (%rdi) inc %r9 mov $91, %rcx rep movsl nop xor %r11, %r11 lea addresses_WT_ht+0x16e33, %rsi lea addresses_normal_ht+0x4b1d, %rdi nop nop nop nop xor $31088, %rax mov $81, %rcx rep movsq nop nop nop sub $65485, %r15 lea addresses_normal_ht+0x8b79, %rsi lea addresses_WT_ht+0x1d09, %rdi xor %rdx, %rdx mov $89, %rcx rep movsw nop nop nop nop nop cmp $51787, %r9 lea addresses_A_ht+0xb933, %r11 nop nop nop nop nop sub $19145, %r12 mov $0x6162636465666768, %r15 movq %r15, %xmm0 movups %xmm0, (%r11) xor $52615, %r15 lea addresses_WC_ht+0x16fd3, %rsi lea addresses_normal_ht+0x65b3, %rdi nop nop nop nop add %rdx, %rdx mov $71, %rcx rep movsb nop nop nop xor $21271, %r15 lea addresses_D_ht+0xceb1, %rsi lea addresses_UC_ht+0x1c843, %rdi nop nop nop cmp %r11, %r11 mov $35, %rcx rep movsb nop nop nop nop nop add %r15, %r15 lea addresses_D_ht+0xe8d3, %rax nop nop nop nop nop cmp $29267, %r11 mov $0x6162636465666768, %rdx movq %rdx, (%rax) nop nop and $31929, %r11 lea addresses_UC_ht+0x1beb3, %rcx nop nop nop dec %r12 mov (%rcx), %si add $8019, %r12 lea addresses_WT_ht+0x8933, %rsi lea addresses_D_ht+0x21b3, %rdi clflush (%rsi) nop nop nop nop and $15269, %rdx mov $23, %rcx rep movsw nop nop nop cmp %rsi, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r8 push %r9 push %rbp push %rdx // Store lea addresses_WT+0x1e613, %rdx nop nop nop xor $50023, %r10 movb $0x51, (%rdx) nop nop nop nop nop and $34778, %r12 // Store lea addresses_PSE+0x1de23, %r9 nop nop nop mfence mov $0x5152535455565758, %r13 movq %r13, %xmm0 movups %xmm0, (%r9) nop nop nop nop cmp $13850, %r12 // Load lea addresses_D+0x743, %rbp inc %r13 mov (%rbp), %r9 nop nop cmp $35613, %rbp // Store lea addresses_PSE+0x11ef3, %r12 nop nop xor $44460, %rdx movb $0x51, (%r12) nop and %r8, %r8 // Load lea addresses_normal+0xde33, %r12 cmp $46523, %r9 movb (%r12), %r10b nop nop nop nop nop sub %r12, %r12 // Load lea addresses_A+0x5d33, %r12 nop nop nop nop cmp %r10, %r10 mov (%r12), %r9 inc %r10 // Faulty Load lea addresses_A+0x5d33, %r9 nop nop nop sub %r12, %r12 movups (%r9), %xmm2 vpextrq $1, %xmm2, %r10 lea oracles, %rdx and $0xff, %r10 shlq $12, %r10 mov (%rdx,%r10,1), %r10 pop %rdx pop %rbp pop %r9 pop %r8 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}} {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 4}} {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': True}} {'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': True}} {'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 10}} {'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 2}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}} {'35': 21829} 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 */
test/Succeed/Issue3579.agda
shlevy/agda
1,989
6926
module Issue3579 where open import Agda.Builtin.String open import Agda.Builtin.Reflection data _==_ {A : Set} (a : A) : A → Set where refl : a == a {-# BUILTIN EQUALITY _==_ #-}
programs/oeis/099/A099563.asm
neoneye/loda
22
243840
<filename>programs/oeis/099/A099563.asm ; A099563: a(0) = 0; for n > 0, a(n) = final nonzero number in the sequence n, f(n,2), f(f(n,2),3), f(f(f(n,2),3),4),..., where f(n,d) = floor(n/d); the most significant digit in the factorial base representation of n. ; 0,1,1,1,2,2,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4 lpb $0 mov $2,1 lpb $0 mov $1,$0 add $2,1 div $0,$2 lpe lpe mov $0,$1
Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_862.asm
ljhsiun2/medusa
9
20540
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r12 push %r9 push %rax push %rcx push %rdx push %rsi lea addresses_UC_ht+0x1c416, %rdx nop inc %rcx movb (%rdx), %r12b nop nop nop and $36828, %rsi lea addresses_WT_ht+0x2e0a, %rcx clflush (%rcx) nop nop nop nop sub %rax, %rax mov $0x6162636465666768, %r9 movq %r9, %xmm4 and $0xffffffffffffffc0, %rcx movaps %xmm4, (%rcx) nop nop nop nop nop and %rsi, %rsi lea addresses_WC_ht+0x16b1a, %rdx add $33600, %r9 movups (%rdx), %xmm5 vpextrq $1, %xmm5, %rcx nop nop nop nop nop xor $6312, %rcx pop %rsi pop %rdx pop %rcx pop %rax pop %r9 pop %r12 ret .global s_faulty_load s_faulty_load: push %r15 push %r8 push %r9 push %rbp push %rcx // Faulty Load lea addresses_US+0xa9a, %r8 nop nop nop sub %rcx, %rcx movb (%r8), %r9b lea oracles, %r8 and $0xff, %r9 shlq $12, %r9 mov (%r8,%r9,1), %r9 pop %rcx pop %rbp pop %r9 pop %r8 pop %r15 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': True, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
oeis/127/A127013.asm
neoneye/loda-programs
11
100150
; A127013: Triangle read by rows: reversal of A126988. ; Submitted by <NAME> ; 1,1,2,1,0,3,1,0,2,4,1,0,0,0,5,1,0,0,2,3,6,1,0,0,0,0,0,7,1,0,0,0,2,0,4,8,1,0,0,0,0,0,3,0,9,1,0,0,0,0,2,0,0,5,10,1,0,0,0,0,0,0,0,0,0,11,1,0,0,0,0,0,2,0,3,4,6,12,1,0,0,0,0,0,0,0,0,0,0,0,13,1,0,0,0,0,0,0,2,0 lpb $0 add $1,1 sub $0,$1 lpe add $1,1 sub $0,$1 mov $2,$1 gcd $1,$0 div $1,$0 mul $2,$1 div $2,$0 mov $0,$2
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/private1-sub.ads
best08618/asylo
7
10402
-- { dg-do compile } -- { dg-options "-gnatct" } package Private1.Sub is package Nested is type T is limited private; function "=" (X, Y : T) return Boolean; private type T is new Private1.T; end Nested; end Private1.Sub;
libsrc/graphics/gray/g_draw.asm
andydansby/z88dk-mk2
1
8297
<reponame>andydansby/z88dk-mk2<gh_stars>1-10 ; ; TI Gray Library Functions ; ; Written by <NAME> - Mar 2001 ; ; ; $Id: g_draw.asm,v 1.3 2001/04/18 13:21:38 stefano Exp $ ; ;Usage: g_draw(int x1, int y1, int x2, int y2, int GrayLevel) XLIB g_draw LIB line LIB plotpixel LIB respixel LIB graypage .g_draw ld ix,0 add ix,sp ld a,(ix+2) ;GrayLevel ld e,(ix+4) ;y1 ld d,(ix+6) ;x1 ld l,(ix+8) ;y0 ld h,(ix+10) ;x0 push af xor a call graypage pop af ld ix,plotpixel rra jr nc,set1 ld ix,respixel .set1 push af push hl push de call line pop de pop hl pop af push af ld a,1 call graypage pop af ld ix,plotpixel rra jr nc,set2 ld ix,respixel .set2 jp line
src/MJ/Syntax/Untyped.agda
metaborg/mj.agda
10
16629
<filename>src/MJ/Syntax/Untyped.agda open import MJ.Types import MJ.Classtable.Core as Core module MJ.Syntax.Untyped {c}(Ct : Core.Classtable c) where open import Prelude open import Data.Maybe as Maybe using (Maybe; just; nothing) open import Data.Maybe.All as MayAll open import Data.Vec as Vec hiding (_∈_) open import Data.Star open import Data.List.Most open import Relation.Binary.PropositionalEquality open import Relation.Nullary.Decidable open import Data.String import Data.Vec.All as Vec∀ open Core c open Classtable Ct open import MJ.Classtable.Membership Ct open import MJ.LexicalScope Ct NativeBinOp = ℕ → ℕ → ℕ data Expr (n : ℕ) : Set where new : Cid c → List (Expr n) → Expr n unit : Expr n null : Expr n num : ℕ → Expr n iop : NativeBinOp → (l r : Expr n) → Expr n call : Expr n → String → List (Expr n) → Expr n var : Fin n → Expr n get : Expr n → String → Expr n mutual data Stmt (i : ℕ) : ℕ → Set where loc : Ty c → Stmt i (suc i) asgn : Fin i → Expr i → Stmt i i set : Expr i → String → Expr i → Stmt i i do : Expr i → Stmt i i ret : Expr i → Stmt i i raise : Stmt i i try_catch_ : ∀ {o o'} → Stmt i o → Stmt i o' → Stmt i i while_do_ : ∀ {o} → Expr i → Stmt i o → Stmt i i block : ∀ {o} → Stmts i o → Stmt i i Stmts : ℕ → ℕ → Set Stmts = Star Stmt data Body (i : ℕ) : Set where body : ∀ {o} → Stmts i o → Expr o → Body i -- let n be the number of formal method arguments data Method (n : ℕ) : Set where super⟨_⟩then_ : List (Expr (suc n)) → Body (suc (suc n)) → Method n body : Body (suc n) → Method n -- let n be the number of formal constructor arguments data Constructor (n : ℕ) : Set where super_then_ : List (Expr (suc n)) → Body (suc n) → Constructor n body : Body (suc n) → Constructor n record Implementation (cid : _): Set where constructor implementation open Class (Σ cid) public field construct : Constructor (length constr) mbodies : All (λ{ (name , (as , b)) → Method (length as) }) (decls METHOD) Classes = ∀ cid → Implementation cid Prog : Set Prog = Classes × (Body 0)
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_1702.asm
ljhsiun2/medusa
9
246292
<filename>Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_1702.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r14 push %r15 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_UC_ht+0x199b5, %r9 nop nop nop nop sub %r11, %r11 movb (%r9), %r12b nop nop nop nop dec %rsi lea addresses_WT_ht+0x11615, %r15 nop nop nop nop and %r14, %r14 mov (%r15), %ebp nop nop nop xor %r15, %r15 lea addresses_D_ht+0xe9b5, %r14 nop nop add $43483, %rsi mov $0x6162636465666768, %rbp movq %rbp, (%r14) nop and $40826, %r15 lea addresses_normal_ht+0x168b5, %rbp nop nop nop nop nop and $56604, %r11 movb $0x61, (%rbp) nop xor %rsi, %rsi lea addresses_WT_ht+0x10db5, %rsi nop nop nop xor $65013, %r12 mov $0x6162636465666768, %rbp movq %rbp, %xmm7 movups %xmm7, (%rsi) cmp %rsi, %rsi lea addresses_A_ht+0x2595, %rsi lea addresses_D_ht+0x18ac5, %rdi nop nop nop sub %r12, %r12 mov $24, %rcx rep movsb and %rbp, %rbp lea addresses_WC_ht+0xd68d, %rsi lea addresses_WT_ht+0x9f21, %rdi nop nop lfence mov $115, %rcx rep movsb nop and %rbp, %rbp lea addresses_UC_ht+0xd5b5, %r15 sub %r11, %r11 mov (%r15), %r9 nop nop and $26588, %r15 lea addresses_UC_ht+0x189b5, %rsi lea addresses_normal_ht+0x135b5, %rdi nop nop nop nop xor $15553, %r14 mov $102, %rcx rep movsw nop nop nop nop and $16043, %r12 lea addresses_WT_ht+0x3dd5, %r15 clflush (%r15) dec %r12 mov (%r15), %di add %r14, %r14 lea addresses_UC_ht+0xd1f5, %r15 clflush (%r15) nop nop inc %rdi mov (%r15), %cx nop nop nop nop add %rdi, %rdi lea addresses_normal_ht+0x1105, %rsi lea addresses_UC_ht+0xb7b5, %rdi and $55977, %r14 mov $37, %rcx rep movsq nop and %r12, %r12 lea addresses_WT_ht+0x12db5, %r11 nop nop nop nop xor %r14, %r14 mov $0x6162636465666768, %r12 movq %r12, %xmm3 movups %xmm3, (%r11) nop sub %r9, %r9 pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r15 pop %r14 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %rax push %rbx push %rcx push %rsi // Store lea addresses_US+0xdab5, %r11 clflush (%r11) nop nop nop nop nop add %rcx, %rcx movw $0x5152, (%r11) nop add %r11, %r11 // Faulty Load lea addresses_UC+0x16db5, %rax nop nop nop nop nop xor %r12, %r12 movups (%rax), %xmm6 vpextrq $0, %xmm6, %r14 lea oracles, %rbx and $0xff, %r14 shlq $12, %r14 mov (%rbx,%r14,1), %r14 pop %rsi pop %rcx pop %rbx pop %rax pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_US', 'AVXalign': True, 'size': 2}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}} {'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}} {'src': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 1, 'type': 'addresses_WT_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': True, 'congruent': 6, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
programs/oeis/158/A158705.asm
jmorken/loda
1
168594
; A158705: Nonnegative integers with an odd number of even powers of 2 in their base-2 representation. ; 1,3,4,6,9,11,12,14,16,18,21,23,24,26,29,31,33,35,36,38,41,43,44,46,48,50,53,55,56,58,61,63,64,66,69,71,72,74,77,79,81,83,84,86,89,91,92,94,96,98,101,103,104,106,109,111,113,115,116,118,121,123,124,126,129,131,132,134,137,139,140,142,144,146,149,151,152,154,157,159,161,163,164,166,169,171,172,174,176,178,181,183,184,186,189,191,192,194,197,199,200,202,205,207,209,211,212,214,217,219,220,222,224,226,229,231,232,234,237,239,241,243,244,246,249,251,252,254,256,258,261,263,264,266,269,271,273,275,276,278,281,283,284,286,288,290,293,295,296,298,301,303,305,307,308,310,313,315,316,318,321,323,324,326,329,331,332,334,336,338,341,343,344,346,349,351,353,355,356,358,361,363,364,366,368,370,373,375,376,378,381,383,384,386,389,391,392,394,397,399,401,403,404,406,409,411,412,414,416,418,421,423,424,426,429,431,433,435,436,438,441,443,444,446,449,451,452,454,457,459,460,462,464,466,469,471,472,474,477,479,481,483,484,486,489,491,492,494,496,498 mov $5,$0 mul $0,2 mov $2,3 mov $3,$0 lpb $0 sub $0,1 div $3,4 add $2,$3 lpe mod $2,2 mov $1,$2 mov $4,$5 mul $4,2 add $1,$4
Examples/ch07/Divide32.asm
satadriver/LiunuxOS
0
164424
<filename>Examples/ch07/Divide32.asm Title 32-bit Division Example (Divide32.asm) ; This program divides a 64-bit integer dividend ; by a 32-bit divisor. The quotient and remainder ; are each 32 bits. ; Last update: 07/18/01 INCLUDE Irvine16.inc .data dividend QWORD 0000000800300020h divisor DWORD 00000100h .code main PROC mov ax,@data mov ds,ax mov edx,dword ptr dividend + 4 ; dividend, high mov eax,dword ptr dividend ; dividend, low div divisor ; quotient(EAX) = 08003000h, remainder(EDX) = 00000020h exit main ENDP END main
data/trainers/parties.asm
zavytar/pokecolorless
0
12482
<gh_stars>0 ; Trainer data structure: ; - db "NAME@", TRAINERTYPE_* constant ; - 1 to 6 Pokémon: ; * for TRAINERTYPE_NORMAL: db level, species ; * for TRAINERTYPE_MOVES: db level, species, 4 moves ; * for TRAINERTYPE_ITEM: db level, species, item ; * for TRAINERTYPE_ITEM_MOVES: db level, species, item, 4 moves ; - db -1 ; end SECTION "Enemy Trainer Parties", ROMX FalknerGroup: ; FALKNER (1) db "FALKNER@", TRAINERTYPE_MOVES db 7, PIDGEY, TACKLE, MUD_SLAP, NO_MOVE, NO_MOVE db 9, PIDGEOTTO, TACKLE, MUD_SLAP, GUST, NO_MOVE db -1 ; end WhitneyGroup: ; WHITNEY (1) db "WHITNEY@", TRAINERTYPE_MOVES db 18, CLEFAIRY, DOUBLESLAP, MIMIC, ENCORE, METRONOME db 20, MILTANK, ROLLOUT, ATTRACT, STOMP, MILK_DRINK db -1 ; end BugsyGroup: ; BUGSY (1) db "BUGSY@", TRAINERTYPE_MOVES db 14, METAPOD, TACKLE, STRING_SHOT, HARDEN, NO_MOVE db 14, KAKUNA, POISON_STING, STRING_SHOT, HARDEN, NO_MOVE db 16, SCYTHER, QUICK_ATTACK, LEER, FURY_CUTTER, NO_MOVE db -1 ; end MortyGroup: ; MORTY (1) db "MORTY@", TRAINERTYPE_MOVES db 21, GASTLY, LICK, SPITE, MEAN_LOOK, CURSE db 21, HAUNTER, HYPNOSIS, MIMIC, CURSE, NIGHT_SHADE db 25, GENGAR, HYPNOSIS, SHADOW_BALL, MEAN_LOOK, DREAM_EATER db 23, HAUNTER, SPITE, MEAN_LOOK, MIMIC, NIGHT_SHADE db -1 ; end PryceGroup: ; PRYCE (1) db "PRYCE@", TRAINERTYPE_MOVES db 27, SEEL, HEADBUTT, ICY_WIND, AURORA_BEAM, REST db 29, DEWGONG, HEADBUTT, ICY_WIND, AURORA_BEAM, REST db 31, PILOSWINE, ICY_WIND, FURY_ATTACK, MIST, BLIZZARD db -1 ; end JasmineGroup: ; JASMINE (1) db "JASMINE@", TRAINERTYPE_MOVES db 30, MAGNEMITE, THUNDERBOLT, SUPERSONIC, SONICBOOM, THUNDER_WAVE db 30, MAGNEMITE, THUNDERBOLT, SUPERSONIC, SONICBOOM, THUNDER_WAVE db 35, STEELIX, SCREECH, SUNNY_DAY, ROCK_THROW, IRON_TAIL db -1 ; end ChuckGroup: ; CHUCK (1) db "CHUCK@", TRAINERTYPE_MOVES db 27, PRIMEAPE, LEER, RAGE, KARATE_CHOP, FURY_SWIPES db 30, POLIWRATH, HYPNOSIS, MIND_READER, SURF, DYNAMICPUNCH db -1 ; end ClairGroup: ; CLAIR (1) db "CLAIR@", TRAINERTYPE_MOVES db 37, DRAGONAIR, THUNDER_WAVE, SURF, SLAM, DRAGONBREATH db 37, DRAGONAIR, THUNDER_WAVE, THUNDERBOLT, SLAM, DRAGONBREATH db 37, DRAGONAIR, THUNDER_WAVE, ICE_BEAM, SLAM, DRAGONBREATH db 40, KINGDRA, SMOKESCREEN, SURF, HYPER_BEAM, DRAGONBREATH db -1 ; end Rival1Group: ; RIVAL1 (1) - Oak's Lab db "?@", TRAINERTYPE_NORMAL db 5, PIKACHU db -1 ; end ; RIVAL1 (2) - Optional - Route 22 db "?@", TRAINERTYPE_NORMAL db 7, PIDGEY db 7, MANKEY db 8, PIKACHU db -1 ; end ; RIVAL1 (3) - Nugget Bridge (Cerulean City) db "?@", TRAINERTYPE_NORMAL db 15, BUTTERFREE db 15, MANKEY db 18, PIDGEOTTO db 15, BULBASAUR db 19, PIKACHU db -1 ; end ; RIVAL1 (4) - <NAME> db "?@", TRAINERTYPE_NORMAL db 20, HAUNTER, LICK, SPITE, MEAN_LOOK, CURSE db 18, MAGNEMITE, TACKLE, THUNDERSHOCK, SUPERSONIC, SONICBOOM db 20, ZUBAT, LEECH_LIFE, SUPERSONIC, BITE, CONFUSE_RAY db 22, BAYLEEF, GROWL, REFLECT, RAZOR_LEAF, POISONPOWDER db 22, BAYLEEF, GROWL, REFLECT, RAZOR_LEAF, POISONPOWDER db -1 ; end db -1 ; end ; RIVAL1 (5) - Pokémon Tower db "?@", TRAINERTYPE_NORMAL db 12, GASTLY db 14, ZUBAT db 16, QUILAVA db -1 ; end ; RIVAL1 (6) - <NAME>. db "?@", TRAINERTYPE_NORMAL db 12, GASTLY db 14, ZUBAT db 16, CROCONAW db -1 ; end ; RIVAL1 (7) - Route 22 db "?@", TRAINERTYPE_MOVES db 20, HAUNTER, LICK, SPITE, MEAN_LOOK, CURSE db 18, MAGNEMITE, TACKLE, THUNDERSHOCK, SUPERSONIC, SONICBOOM db 20, ZUBAT, LEECH_LIFE, SUPERSONIC, BITE, CONFUSE_RAY db 22, BAYLEEF, GROWL, REFLECT, RAZOR_LEAF, POISONPOWDER db -1 ; end ; RIVAL1 (8) - Pokémon League - Title Defense 1 db "?@", TRAINERTYPE_MOVES db 20, HAUNTER, LICK, SPITE, MEAN_LOOK, CURSE db 18, MAGNEMITE, TACKLE, THUNDERSHOCK, SUPERSONIC, SONICBOOM db 20, ZUBAT, LEECH_LIFE, SUPERSONIC, BITE, CONFUSE_RAY db 22, QUILAVA, LEER, SMOKESCREEN, EMBER, QUICK_ATTACK db -1 ; end ; RIVAL1 (9) - Pokémon League - Title Defense 2 db "?@", TRAINERTYPE_MOVES db 20, HAUNTER, LICK, SPITE, MEAN_LOOK, CURSE db 18, MAGNEMITE, TACKLE, THUNDERSHOCK, SUPERSONIC, SONICBOOM db 20, ZUBAT, LEECH_LIFE, SUPERSONIC, BITE, CONFUSE_RAY db 22, CROCONAW, LEER, RAGE, WATER_GUN, BITE db -1 ; end ; RIVAL1 (10) db "?@", TRAINERTYPE_MOVES db 30, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db 28, MAGNEMITE, TACKLE, THUNDERSHOCK, SONICBOOM, THUNDER_WAVE db 30, HAUNTER, LICK, MEAN_LOOK, CURSE, SHADOW_BALL db 32, SNEASEL, LEER, QUICK_ATTACK, SCREECH, FAINT_ATTACK db 32, MEGANIUM, REFLECT, RAZOR_LEAF, POISONPOWDER, BODY_SLAM db -1 ; end ; RIVAL1 (11) db "?@", TRAINERTYPE_MOVES db 30, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db 28, MAGNEMITE, TACKLE, THUNDERSHOCK, SONICBOOM, THUNDER_WAVE db 30, HAUNTER, LICK, MEAN_LOOK, CURSE, SHADOW_BALL db 32, SNEASEL, LEER, QUICK_ATTACK, SCREECH, FAINT_ATTACK db 32, QUILAVA, SMOKESCREEN, EMBER, QUICK_ATTACK, FLAME_WHEEL db -1 ; end ; RIVAL1 (12) db "?@", TRAINERTYPE_MOVES db 30, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db 28, MAGNEMITE, TACKLE, THUNDERSHOCK, SONICBOOM, THUNDER_WAVE db 30, HAUNTER, LICK, MEAN_LOOK, CURSE, SHADOW_BALL db 32, SNEASEL, LEER, QUICK_ATTACK, SCREECH, FAINT_ATTACK db 32, FERALIGATR, RAGE, WATER_GUN, BITE, SCARY_FACE db -1 ; end ; RIVAL1 (13) db "?@", TRAINERTYPE_MOVES db 34, SNEASEL, QUICK_ATTACK, SCREECH, FAINT_ATTACK, FURY_CUTTER db 36, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db 35, MAGNETON, THUNDERSHOCK, SONICBOOM, THUNDER_WAVE, SWIFT db 35, HAUNTER, MEAN_LOOK, CURSE, SHADOW_BALL, CONFUSE_RAY db 35, KADABRA, DISABLE, PSYBEAM, RECOVER, FUTURE_SIGHT db 38, MEGANIUM, REFLECT, RAZOR_LEAF, POISONPOWDER, BODY_SLAM db -1 ; end ; RIVAL1 (14) db "?@", TRAINERTYPE_MOVES db 34, SNEASEL, QUICK_ATTACK, SCREECH, FAINT_ATTACK, FURY_CUTTER db 36, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db 35, MAGNETON, THUNDERSHOCK, SONICBOOM, THUNDER_WAVE, SWIFT db 35, HAUNTER, MEAN_LOOK, CURSE, SHADOW_BALL, CONFUSE_RAY db 35, KADABRA, DISABLE, PSYBEAM, RECOVER, FUTURE_SIGHT db 38, TYPHLOSION, SMOKESCREEN, EMBER, QUICK_ATTACK, FLAME_WHEEL db -1 ; end ; RIVAL1 (15) db "?@", TRAINERTYPE_MOVES db 34, SNEASEL, QUICK_ATTACK, SCREECH, FAINT_ATTACK, FURY_CUTTER db 36, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db 34, MAGNETON, THUNDERSHOCK, SONICBOOM, THUNDER_WAVE, SWIFT db 35, HAUNTER, MEAN_LOOK, CURSE, SHADOW_BALL, CONFUSE_RAY db 35, KADABRA, DISABLE, PSYBEAM, RECOVER, FUTURE_SIGHT db 38, FERALIGATR, RAGE, WATER_GUN, SCARY_FACE, SLASH db -1 ; end PokemonProfGroup: WillGroup: ; WILL (1) db "LORELEI@", TRAINERTYPE_MOVES db 40, XATU, QUICK_ATTACK, FUTURE_SIGHT, CONFUSE_RAY, PSYCHIC_M db 41, JYNX, DOUBLESLAP, LOVELY_KISS, ICE_PUNCH, PSYCHIC_M db 41, EXEGGUTOR, REFLECT, LEECH_SEED, EGG_BOMB, PSYCHIC_M db 41, SLOWBRO, CURSE, AMNESIA, BODY_SLAM, PSYCHIC_M db 42, XATU, QUICK_ATTACK, FUTURE_SIGHT, CONFUSE_RAY, PSYCHIC_M db -1 ; end PKMNTrainerGroup: ; CAL (1) db "CAL@", TRAINERTYPE_NORMAL db 10, CHIKORITA db 10, CYNDAQUIL db 10, TOTODILE db -1 ; end ; CAL (2) db "CAL@", TRAINERTYPE_NORMAL db 30, BAYLEEF db 30, QUILAVA db 30, CROCONAW db -1 ; end ; CAL (3) db "CAL@", TRAINERTYPE_NORMAL db 50, MEGANIUM db 50, TYPHLOSION db 50, FERALIGATR db -1 ; end BrunoGroup: ; BRUNO (1) db "BRUNO@", TRAINERTYPE_MOVES db 42, HITMONTOP, PURSUIT, QUICK_ATTACK, DIG, DETECT db 42, HITMONLEE, SWAGGER, DOUBLE_KICK, HI_JUMP_KICK, FORESIGHT db 42, HITMONCHAN, THUNDERPUNCH, ICE_PUNCH, FIRE_PUNCH, MACH_PUNCH db 43, ONIX, BIND, EARTHQUAKE, SANDSTORM, ROCK_SLIDE db 46, MACHAMP, ROCK_SLIDE, FORESIGHT, VITAL_THROW, CROSS_CHOP db -1 ; end KarenGroup: ; KAREN (1) db "AGATHA@", TRAINERTYPE_MOVES db 42, UMBREON, SAND_ATTACK, CONFUSE_RAY, FAINT_ATTACK, MEAN_LOOK db 42, VILEPLUME, STUN_SPORE, ACID, MOONLIGHT, PETAL_DANCE db 45, GENGAR, LICK, SPITE, CURSE, DESTINY_BOND db 44, MURKROW, QUICK_ATTACK, WHIRLWIND, PURSUIT, FAINT_ATTACK db 47, HOUNDOOM, ROAR, PURSUIT, FLAMETHROWER, CRUNCH db -1 ; end KogaGroup: ; KOGA (1) db "LANCE@", TRAINERTYPE_MOVES db 40, ARIADOS, DOUBLE_TEAM, SPIDER_WEB, BATON_PASS, GIGA_DRAIN db 41, VENOMOTH, SUPERSONIC, GUST, PSYCHIC_M, TOXIC db 43, FORRETRESS, PROTECT, SWIFT, EXPLOSION, SPIKES db 42, MUK, MINIMIZE, ACID_ARMOR, SLUDGE_BOMB, TOXIC db 44, CROBAT, DOUBLE_TEAM, QUICK_ATTACK, WING_ATTACK, TOXIC db -1 ; end ChampionGroup: ; CHAMPION (1) db "LANCE@", TRAINERTYPE_MOVES db 44, GYARADOS, FLAIL, RAIN_DANCE, SURF, HYPER_BEAM db 47, DRAGONITE, THUNDER_WAVE, TWISTER, THUNDER, HYPER_BEAM db 47, DRAGONITE, THUNDER_WAVE, TWISTER, BLIZZARD, HYPER_BEAM db 46, AERODACTYL, WING_ATTACK, ANCIENTPOWER, ROCK_SLIDE, HYPER_BEAM db 46, CHARIZARD, FLAMETHROWER, WING_ATTACK, SLASH, HYPER_BEAM db 50, DRAGONITE, FIRE_BLAST, SAFEGUARD, OUTRAGE, HYPER_BEAM db -1 ; end BrockGroup: ; BROCK (1) db "BROCK@", TRAINERTYPE_MOVES db 12, GEODUDE, TACKLE, DEFENSE_CURL, ROCK_THROW, ROCK_SMASH db 14, ONIX, BIND, ROCK_THROW, HEADBUTT, SCREECH db -1 ; end MistyGroup: ; MISTY (1) db "MISTY@", TRAINERTYPE_MOVES db 19, STARYU, WATER_GUN, HARDEN, ICY_WIND, RAIN_DANCE db 19, PSYDUCK, WATER_GUN, CONFUSION, ICY_WIND, RAIN_DANCE db 21, STARMIE, WATER_GUN, CONFUSE_RAY, HARDEN, ICY_WIND db -1 ; end LtSurgeGroup: ; LT_SURGE (1) db "LT.SURGE@", TRAINERTYPE_MOVES db 44, RAICHU, THUNDER_WAVE, QUICK_ATTACK, THUNDERBOLT, THUNDER db 40, ELECTRODE, SCREECH, DOUBLE_TEAM, SWIFT, EXPLOSION db 40, MAGNETON, LOCK_ON, DOUBLE_TEAM, SWIFT, ZAP_CANNON db 40, ELECTRODE, SCREECH, DOUBLE_TEAM, SWIFT, EXPLOSION db 46, ELECTABUZZ, QUICK_ATTACK, THUNDERPUNCH, LIGHT_SCREEN, THUNDER db -1 ; end ScientistGroup: ; SCIENTIST (1) db "ROSS@", TRAINERTYPE_NORMAL db 22, KOFFING db 22, KOFFING db -1 ; end ; SCIENTIST (2) db "MITCH@", TRAINERTYPE_NORMAL db 24, DITTO db -1 ; end ; SCIENTIST (3) db "JED@", TRAINERTYPE_NORMAL db 20, MAGNEMITE db 20, MAGNEMITE db 20, MAGNEMITE db -1 ; end ; SCIENTIST (4) db "MARC@", TRAINERTYPE_NORMAL db 27, MAGNEMITE db 27, MAGNEMITE db 27, MAGNEMITE db -1 ; end ; SCIENTIST (5) db "RICH@", TRAINERTYPE_MOVES db 30, PORYGON, CONVERSION, CONVERSION2, RECOVER, TRI_ATTACK db -1 ; end ErikaGroup: ; ERIKA (1) db "ERIKA@", TRAINERTYPE_MOVES db 42, TANGELA, VINE_WHIP, BIND, GIGA_DRAIN, SLEEP_POWDER db 41, JUMPLUFF, MEGA_DRAIN, LEECH_SEED, COTTON_SPORE, GIGA_DRAIN db 46, VICTREEBEL, SUNNY_DAY, SYNTHESIS, ACID, RAZOR_LEAF db 46, BELLOSSOM, SUNNY_DAY, SYNTHESIS, PETAL_DANCE, SOLARBEAM db -1 ; end YoungsterGroup: ; YOUNGSTER (1) db "BEN@", TRAINERTYPE_NORMAL db 11, RATTATA db 11, EKANS db -1 ; end ; YOUNGSTER (2) db "CALVIN@", TRAINERTYPE_NORMAL db 14, SPEAROW db -1 ; end ; YOUNGSTER (2) db "JOSH@", TRAINERTYPE_NORMAL db 11, RATTATA db 12, RATTATA db 11, ZUBAT db -1 ; end SchoolboyGroup: ; SCHOOLBOY (1) db "JACK@", TRAINERTYPE_NORMAL db 12, ODDISH db 15, VOLTORB db -1 ; end ; SCHOOLBOY (2) db "KIPP@", TRAINERTYPE_NORMAL db 27, VOLTORB db 27, MAGNEMITE db 31, VOLTORB db 31, MAGNETON db -1 ; end ; SCHOOLBOY (3) db "ALAN@", TRAINERTYPE_NORMAL db 16, TANGELA db -1 ; end ; SCHOOLBOY (4) db "JOHNNY@", TRAINERTYPE_NORMAL db 29, BELLSPROUT db 31, WEEPINBELL db 33, VICTREEBEL db -1 ; end ; SCHOOLBOY (5) db "DANNY@", TRAINERTYPE_NORMAL db 31, JYNX db 31, ELECTABUZZ db 31, MAGMAR db -1 ; end ; SCHOOLBOY (6) db "TOMMY@", TRAINERTYPE_NORMAL db 32, XATU db 34, ALAKAZAM db -1 ; end ; SCHOOLBOY (7) db "DUDLEY@", TRAINERTYPE_NORMAL db 35, ODDISH db -1 ; end ; SCHOOLBOY (8) db "JOE@", TRAINERTYPE_NORMAL db 33, TANGELA db 33, VAPOREON db -1 ; end ; SCHOOLBOY (9) db "BILLY@", TRAINERTYPE_NORMAL db 27, PARAS db 27, PARAS db 27, POLIWHIRL db 35, DITTO db -1 ; end ; SCHOOLBOY (10) db "CHAD@", TRAINERTYPE_NORMAL db 19, MR__MIME db -1 ; end ; SCHOOLBOY (11) db "NATE@", TRAINERTYPE_NORMAL db 32, LEDIAN db 32, EXEGGUTOR db -1 ; end ; SCHOOLBOY (12) db "RICKY@", TRAINERTYPE_NORMAL db 32, AIPOM db 32, DITTO db -1 ; end ; SCHOOLBOY (13) db "JACK@", TRAINERTYPE_NORMAL db 14, ODDISH db 17, VOLTORB db -1 ; end ; SCHOOLBOY (14) db "JACK@", TRAINERTYPE_NORMAL db 28, GLOOM db 31, ELECTRODE db -1 ; end ; SCHOOLBOY (15) db "ALAN@", TRAINERTYPE_NORMAL db 17, TANGELA db 17, YANMA db -1 ; end ; SCHOOLBOY (16) db "ALAN@", TRAINERTYPE_NORMAL db 20, NATU db 22, TANGELA db 20, QUAGSIRE db 25, YANMA db -1 ; end ; SCHOOLBOY (17) db "CHAD@", TRAINERTYPE_NORMAL db 19, MR__MIME db 19, MAGNEMITE db -1 ; end ; SCHOOLBOY (18) db "CHAD@", TRAINERTYPE_NORMAL db 27, MR__MIME db 31, MAGNETON db -1 ; end ; SCHOOLBOY (19) db "JACK@", TRAINERTYPE_NORMAL db 30, GLOOM db 33, GROWLITHE db 33, ELECTRODE db -1 ; end ; SCHOOLBOY (20) db "JACK@", TRAINERTYPE_MOVES db 35, ELECTRODE, SCREECH, SONICBOOM, ROLLOUT, LIGHT_SCREEN db 35, GROWLITHE, SUNNY_DAY, LEER, TAKE_DOWN, FLAME_WHEEL db 37, VILEPLUME, SOLARBEAM, SLEEP_POWDER, ACID, MOONLIGHT db -1 ; end ; SCHOOLBOY (21) db "ALAN@", TRAINERTYPE_NORMAL db 27, NATU db 27, TANGELA db 30, QUAGSIRE db 30, YANMA db -1 ; end ; SCHOOLBOY (22) db "ALAN@", TRAINERTYPE_MOVES db 35, XATU, PECK, NIGHT_SHADE, SWIFT, FUTURE_SIGHT db 32, TANGELA, POISONPOWDER, VINE_WHIP, BIND, MEGA_DRAIN db 32, YANMA, QUICK_ATTACK, DOUBLE_TEAM, SONICBOOM, SUPERSONIC db 35, QUAGSIRE, TAIL_WHIP, SLAM, AMNESIA, EARTHQUAKE db -1 ; end ; SCHOOLBOY (23) db "CHAD@", TRAINERTYPE_NORMAL db 30, MR__MIME db 34, MAGNETON db -1 ; end ; SCHOOLBOY (24) db "CHAD@", TRAINERTYPE_MOVES db 34, MR__MIME, PSYCHIC_M, LIGHT_SCREEN, REFLECT, ENCORE db 38, MAGNETON, ZAP_CANNON, THUNDER_WAVE, LOCK_ON, SWIFT db -1 ; end BirdKeeperGroup: ; BIRD_KEEPER (1) db "ROD@", TRAINERTYPE_NORMAL db 7, PIDGEY db 7, PIDGEY db -1 ; end ; BIRD_KEEPER (2) db "ABE@", TRAINERTYPE_NORMAL db 9, SPEAROW db -1 ; end ; BIRD_KEEPER (3) db "BRYAN@", TRAINERTYPE_NORMAL db 12, PIDGEY db 14, PIDGEOTTO db -1 ; end ; BIRD_KEEPER (4) db "THEO@", TRAINERTYPE_NORMAL db 17, PIDGEY db 15, PIDGEY db 19, PIDGEY db 15, PIDGEY db 15, PIDGEY db -1 ; end ; BIRD_KEEPER (5) db "TOBY@", TRAINERTYPE_NORMAL db 15, DODUO db 16, DODUO db 17, DODUO db -1 ; end ; BIRD_KEEPER (6) db "DENIS@", TRAINERTYPE_NORMAL db 18, SPEAROW db 20, FEAROW db 18, SPEAROW db -1 ; end ; BIRD_KEEPER (7) db "VANCE@", TRAINERTYPE_NORMAL db 25, PIDGEOTTO db 25, PIDGEOTTO db -1 ; end ; BIRD_KEEPER (8) db "HANK@", TRAINERTYPE_NORMAL db 12, PIDGEY db 34, PIDGEOT db -1 ; end ; BIRD_KEEPER (9) db "ROY@", TRAINERTYPE_NORMAL db 29, FEAROW db 35, FEAROW db -1 ; end ; BIRD_KEEPER (10) db "BORIS@", TRAINERTYPE_NORMAL db 30, DODUO db 28, DODUO db 32, DODRIO db -1 ; end ; BIRD_KEEPER (11) db "BOB@", TRAINERTYPE_NORMAL db 34, NOCTOWL db -1 ; end ; BIRD_KEEPER (12) db "JOSE@", TRAINERTYPE_NORMAL db 36, FARFETCH_D db -1 ; end ; BIRD_KEEPER (13) db "PETER@", TRAINERTYPE_NORMAL db 6, PIDGEY db 6, PIDGEY db 8, SPEAROW db -1 ; end ; BIRD_KEEPER (14) db "JOSE@", TRAINERTYPE_NORMAL db 34, FARFETCH_D db -1 ; end ; BIRD_KEEPER (15) db "PERRY@", TRAINERTYPE_NORMAL db 34, FARFETCH_D db -1 ; end ; BIRD_KEEPER (16) db "BRET@", TRAINERTYPE_NORMAL db 32, PIDGEOTTO db 32, FEAROW db -1 ; end ; BIRD_KEEPER (17) db "JOSE@", TRAINERTYPE_MOVES db 40, FARFETCH_D, FURY_ATTACK, DETECT, FLY, SLASH db -1 ; end ; BIRD_KEEPER (18) db "VANCE@", TRAINERTYPE_NORMAL db 32, PIDGEOTTO db 32, PIDGEOTTO db -1 ; end ; BIRD_KEEPER (19) db "VANCE@", TRAINERTYPE_MOVES db 38, PIDGEOT, TOXIC, QUICK_ATTACK, WHIRLWIND, FLY db 38, PIDGEOT, SWIFT, DETECT, STEEL_WING, FLY db -1 ; end LassGroup: ; LASS (1) - Viridian Forest db "CARRIE@", TRAINERTYPE_NORMAL db 6, NIDORAN_F db 6, NIDORAN_M db -1 ; end ; LASS (2) - Route 3 db "JANICE@", TRAINERTYPE_NORMAL db 9, PIDGEY db 9, PIDGEY db -1 ; end ; LASS (3) - Route 3 db "SALLY@", TRAINERTYPE_NORMAL db 10, RATTATA db 10, NIDORAN_F db -1 ; end ; LASS (4) - Route 3 db "ROBIN@", TRAINERTYPE_NORMAL db 14, JIGGLYPUFF db -1 ; end ; LASS (5) - Mt Moon 1F db "IRIS@", TRAINERTYPE_NORMAL db 14, CLEFAIRY db -1 ; end ; LASS (6) - Mt Moon 1F db "MIRIAM@", TRAINERTYPE_NORMAL db 12, BELLSPROUT db 12, ODDISH db -1 ; end ; LASS (7) - Route 4 db "CRISSY@", TRAINERTYPE_NORMAL db 12, PARAS db 12, PARAS db -1 ; end ; LASS (8) - Route 24 db "CRISSY@", TRAINERTYPE_NORMAL db 12, PARAS db 12, PARAS db -1 ; end ; LASS (9) - Route 24 db "CRISSY@", TRAINERTYPE_NORMAL db 12, PARAS db 12, PARAS db -1 ; end JanineGroup: ; JANINE (1) db "JANINE@", TRAINERTYPE_MOVES db 36, CROBAT, SCREECH, SUPERSONIC, CONFUSE_RAY, WING_ATTACK db 36, WEEZING, SMOG, SLUDGE_BOMB, TOXIC, EXPLOSION db 36, WEEZING, SMOG, SLUDGE_BOMB, TOXIC, EXPLOSION db 33, ARIADOS, SCARY_FACE, GIGA_DRAIN, STRING_SHOT, NIGHT_SHADE db 39, VENOMOTH, FORESIGHT, DOUBLE_TEAM, GUST, PSYCHIC_M db -1 ; end CooltrainerMGroup: ; COOLTRAINERM (1) db "DAMIEN@", TRAINERTYPE_NORMAL db 10, CHARMANDER db 12, DROWZEE db -1 ; end ; COOLTRAINERM (2) db "AARON@", TRAINERTYPE_NORMAL db 24, IVYSAUR db 24, CHARMELEON db 24, WARTORTLE db -1 ; end ; COOLTRAINERM (3) db "PAUL@", TRAINERTYPE_NORMAL db 34, DRATINI db 34, DRATINI db 34, DRATINI db -1 ; end ; COOLTRAINERM (4) db "CODY@", TRAINERTYPE_NORMAL db 34, HORSEA db 36, SEADRA db -1 ; end ; COOLTRAINERM (5) db "MIKE@", TRAINERTYPE_NORMAL db 37, DRAGONAIR db -1 ; end ; COOLTRAINERM (6) db "GAVEN@", TRAINERTYPE_MOVES db 35, VICTREEBEL, WRAP, TOXIC, ACID, RAZOR_LEAF db 35, KINGLER, BUBBLEBEAM, STOMP, GUILLOTINE, PROTECT db 35, FLAREON, SAND_ATTACK, QUICK_ATTACK, BITE, FIRE_SPIN db -1 ; end ; COOLTRAINERM (7) db "GAVEN@", TRAINERTYPE_ITEM_MOVES db 39, VICTREEBEL, NO_ITEM, GIGA_DRAIN, TOXIC, SLUDGE_BOMB, RAZOR_LEAF db 39, KINGLER, KINGS_ROCK, SURF, STOMP, GUILLOTINE, BLIZZARD db 39, FLAREON, NO_ITEM, FLAMETHROWER, QUICK_ATTACK, BITE, FIRE_SPIN db -1 ; end ; COOLTRAINERM (8) db "RYAN@", TRAINERTYPE_MOVES db 25, PIDGEOT, SAND_ATTACK, QUICK_ATTACK, WHIRLWIND, WING_ATTACK db 27, ELECTABUZZ, THUNDERPUNCH, LIGHT_SCREEN, SWIFT, SCREECH db -1 ; end ; COOLTRAINERM (9) db "JAKE@", TRAINERTYPE_MOVES db 33, PARASECT, LEECH_LIFE, SPORE, SLASH, SWORDS_DANCE db 35, GOLDUCK, CONFUSION, SCREECH, PSYCH_UP, FURY_SWIPES db -1 ; end ; COOLTRAINERM (10) db "GAVEN@", TRAINERTYPE_MOVES db 32, VICTREEBEL, WRAP, TOXIC, ACID, RAZOR_LEAF db 32, KINGLER, BUBBLEBEAM, STOMP, GUILLOTINE, PROTECT db 32, FLAREON, SAND_ATTACK, QUICK_ATTACK, BITE, FIRE_SPIN db -1 ; end ; COOLTRAINERM (11) db "BLAKE@", TRAINERTYPE_MOVES db 33, MAGNETON, THUNDERBOLT, SUPERSONIC, SWIFT, SCREECH db 31, QUAGSIRE, WATER_GUN, SLAM, AMNESIA, EARTHQUAKE db 31, EXEGGCUTE, LEECH_SEED, CONFUSION, SLEEP_POWDER, SOLARBEAM db -1 ; end ; COOLTRAINERM (12) db "BRIAN@", TRAINERTYPE_MOVES db 35, SANDSLASH, SAND_ATTACK, POISON_STING, SLASH, SWIFT db -1 ; end ; COOLTRAINERM (13) db "ERICK@", TRAINERTYPE_NORMAL db 10, BULBASAUR db 10, CHARMANDER db 10, SQUIRTLE db -1 ; end ; COOLTRAINERM (14) db "ANDY@", TRAINERTYPE_NORMAL db 10, BULBASAUR db 10, CHARMANDER db 10, SQUIRTLE db -1 ; end ; COOLTRAINERM (15) db "TYLER@", TRAINERTYPE_NORMAL db 10, BULBASAUR db 10, CHARMANDER db 10, SQUIRTLE db -1 ; end ; COOLTRAINERM (16) db "SEAN@", TRAINERTYPE_NORMAL db 35, FLAREON db 35, TANGELA db 35, TAUROS db -1 ; end ; COOLTRAINERM (17) db "KEVIN@", TRAINERTYPE_NORMAL db 38, RHYHORN db 35, CHARMELEON db 35, WARTORTLE db -1 ; end ; COOLTRAINERM (18) db "STEVE@", TRAINERTYPE_NORMAL db 14, BULBASAUR db 14, CHARMANDER db 14, SQUIRTLE db -1 ; end ; COOLTRAINERM (19) db "ALLEN@", TRAINERTYPE_MOVES db 27, CHARMELEON, EMBER, SMOKESCREEN, RAGE, SCARY_FACE db -1 ; end ; COOLTRAINERM (20) db "DARIN@", TRAINERTYPE_MOVES db 37, DRAGONAIR, WRAP, SURF, DRAGON_RAGE, SLAM db -1 ; end CooltrainerFGroup: ; COOLTRAINERF (1) db "GWEN@", TRAINERTYPE_NORMAL db 26, EEVEE db 22, FLAREON db 22, VAPOREON db 22, JOLTEON db -1 ; end ; COOLTRAINERF (2) db "LOIS@", TRAINERTYPE_MOVES db 25, SKIPLOOM, SYNTHESIS, POISONPOWDER, MEGA_DRAIN, LEECH_SEED db 25, NINETALES, EMBER, QUICK_ATTACK, CONFUSE_RAY, SAFEGUARD db -1 ; end ; COOLTRAINERF (3) db "FRAN@", TRAINERTYPE_NORMAL db 37, SEADRA db -1 ; end ; COOLTRAINERF (4) db "LOLA@", TRAINERTYPE_NORMAL db 34, DRATINI db 36, DRAGONAIR db -1 ; end ; COOLTRAINERF (5) db "KATE@", TRAINERTYPE_NORMAL db 26, SHELLDER db 28, CLOYSTER db -1 ; end ; COOLTRAINERF (6) db "IRENE@", TRAINERTYPE_NORMAL db 22, GOLDEEN db 24, SEAKING db -1 ; end ; COOLTRAINERF (7) db "KELLY@", TRAINERTYPE_NORMAL db 27, MARILL db 24, WARTORTLE db 24, WARTORTLE db -1 ; end ; COOLTRAINERF (8) db "JOYCE@", TRAINERTYPE_MOVES db 36, PIKACHU, QUICK_ATTACK, DOUBLE_TEAM, THUNDERBOLT, THUNDER db 32, BLASTOISE, BITE, CURSE, SURF, RAIN_DANCE db -1 ; end ; COOLTRAINERF (9) db "BETH@", TRAINERTYPE_MOVES db 36, RAPIDASH, STOMP, FIRE_SPIN, FURY_ATTACK, AGILITY db -1 ; end ; COOLTRAINERF (10) db "REENA@", TRAINERTYPE_NORMAL db 31, STARMIE db 33, NIDOQUEEN db 31, STARMIE db -1 ; end ; COOLTRAINERF (11) db "MEGAN@", TRAINERTYPE_MOVES db 32, BULBASAUR, GROWL, LEECH_SEED, POISONPOWDER, RAZOR_LEAF db 32, IVYSAUR, GROWL, LEECH_SEED, POISONPOWDER, RAZOR_LEAF db 32, VENUSAUR, BODY_SLAM, SLEEP_POWDER, RAZOR_LEAF, SWEET_SCENT db -1 ; end ; COOLTRAINERF (12) db "BETH@", TRAINERTYPE_MOVES db 39, RAPIDASH, STOMP, FIRE_SPIN, FURY_ATTACK, AGILITY db -1 ; end ; COOLTRAINERF (13) db "CAROL@", TRAINERTYPE_NORMAL db 35, ELECTRODE db 35, STARMIE db 35, NINETALES db -1 ; end ; COOLTRAINERF (14) db "QUINN@", TRAINERTYPE_NORMAL db 38, IVYSAUR db 38, STARMIE db -1 ; end ; COOLTRAINERF (15) db "EMMA@", TRAINERTYPE_NORMAL db 28, POLIWHIRL db -1 ; end ; COOLTRAINERF (16) db "CYBIL@", TRAINERTYPE_MOVES db 25, BUTTERFREE, CONFUSION, SLEEP_POWDER, WHIRLWIND, GUST db 25, BELLOSSOM, ABSORB, STUN_SPORE, ACID, SOLARBEAM db -1 ; end ; COOLTRAINERF (17) db "JENN@", TRAINERTYPE_NORMAL db 24, STARYU db 26, STARMIE db -1 ; end ; COOLTRAINERF (18) db "BETH@", TRAINERTYPE_ITEM_MOVES db 43, RAPIDASH, FOCUS_BAND, STOMP, FIRE_SPIN, FURY_ATTACK, FIRE_BLAST db -1 ; end ; COOLTRAINERF (19) db "REENA@", TRAINERTYPE_NORMAL db 34, STARMIE db 36, NIDOQUEEN db 34, STARMIE db -1 ; end ; COOLTRAINERF (20) db "REENA@", TRAINERTYPE_ITEM_MOVES db 38, STARMIE, NO_ITEM, DOUBLE_TEAM, PSYCHIC_M, WATERFALL, CONFUSE_RAY db 40, NIDOQUEEN, PINK_BOW, EARTHQUAKE, DOUBLE_KICK, TOXIC, BODY_SLAM db 38, STARMIE, NO_ITEM, BLIZZARD, PSYCHIC_M, WATERFALL, RECOVER db -1 ; end ; COOLTRAINERF (21) db "CARA@", TRAINERTYPE_MOVES db 33, HORSEA, SMOKESCREEN, LEER, WHIRLPOOL, TWISTER db 33, HORSEA, SMOKESCREEN, LEER, WHIRLPOOL, TWISTER db 35, SEADRA, SWIFT, LEER, WATERFALL, TWISTER db -1 ; end BeautyGroup: ; BEAUTY (1) db "VICTORIA@", TRAINERTYPE_NORMAL db 9, SENTRET db 13, SENTRET db 17, SENTRET db -1 ; end ; BEAUTY (2) db "SAMANTHA@", TRAINERTYPE_MOVES db 16, MEOWTH, SCRATCH, GROWL, BITE, PAY_DAY db 16, MEOWTH, SCRATCH, GROWL, BITE, SLASH db -1 ; end ; BEAUTY (3) db "JULIE@", TRAINERTYPE_NORMAL db 15, SENTRET db -1 ; end ; BEAUTY (4) db "JACLYN@", TRAINERTYPE_NORMAL db 15, SENTRET db -1 ; end ; BEAUTY (5) db "BRENDA@", TRAINERTYPE_NORMAL db 16, FURRET db -1 ; end ; BEAUTY (6) db "CASSIE@", TRAINERTYPE_NORMAL db 28, VILEPLUME db 34, BUTTERFREE db -1 ; end ; BEAUTY (7) db "CAROLINE@", TRAINERTYPE_NORMAL db 30, MARILL db 32, SEEL db 30, MARILL db -1 ; end ; BEAUTY (8) db "CARLENE@", TRAINERTYPE_NORMAL db 15, SENTRET db -1 ; end ; BEAUTY (9) db "JESSICA@", TRAINERTYPE_NORMAL db 15, SENTRET db -1 ; end ; BEAUTY (10) db "RACHAEL@", TRAINERTYPE_NORMAL db 15, SENTRET db -1 ; end ; BEAUTY (11) db "ANGELICA@", TRAINERTYPE_NORMAL db 15, SENTRET db -1 ; end ; BEAUTY (12) db "KENDRA@", TRAINERTYPE_NORMAL db 15, SENTRET db -1 ; end ; BEAUTY (13) db "VERONICA@", TRAINERTYPE_NORMAL db 15, SENTRET db -1 ; end ; BEAUTY (14) db "JULIA@", TRAINERTYPE_NORMAL db 32, PARAS db 32, EXEGGCUTE db 35, PARASECT db -1 ; end ; BEAUTY (15) db "THERESA@", TRAINERTYPE_NORMAL db 15, SENTRET db -1 ; end ; BEAUTY (16) db "VALERIE@", TRAINERTYPE_MOVES db 17, HOPPIP, SYNTHESIS, TAIL_WHIP, TACKLE, POISONPOWDER db 17, SKIPLOOM, SYNTHESIS, TAIL_WHIP, TACKLE, STUN_SPORE db -1 ; end ; BEAUTY (17) db "OLIVIA@", TRAINERTYPE_NORMAL db 19, CORSOLA db -1 ; end PokemaniacGroup: ; POKEMANIAC (1) db "LARRY@", TRAINERTYPE_NORMAL db 10, SLOWPOKE db -1 ; end ; POKEMANIAC (2) db "ANDREW@", TRAINERTYPE_NORMAL db 24, MAROWAK db 24, MAROWAK db -1 ; end ; POKEMANIAC (3) db "CALVIN@", TRAINERTYPE_NORMAL db 26, KANGASKHAN db -1 ; end ; POKEMANIAC (4) db "SHANE@", TRAINERTYPE_NORMAL db 16, NIDORINA db 16, NIDORINO db -1 ; end ; POKEMANIAC (5) db "BEN@", TRAINERTYPE_NORMAL db 19, SLOWBRO db -1 ; end ; POKEMANIAC (6) db "BRENT@", TRAINERTYPE_NORMAL db 19, LICKITUNG db -1 ; end ; POKEMANIAC (7) db "RON@", TRAINERTYPE_NORMAL db 19, NIDOKING db -1 ; end ; POKEMANIAC (8) db "ETHAN@", TRAINERTYPE_NORMAL db 31, RHYHORN db 31, RHYDON db -1 ; end ; POKEMANIAC (9) db "BRENT@", TRAINERTYPE_NORMAL db 25, KANGASKHAN db -1 ; end ; POKEMANIAC (10) db "BRENT@", TRAINERTYPE_MOVES db 36, PORYGON, RECOVER, PSYCHIC_M, CONVERSION2, TRI_ATTACK db -1 ; end ; POKEMANIAC (11) db "ISSAC@", TRAINERTYPE_MOVES db 12, LICKITUNG, LICK, SUPERSONIC, CUT, NO_MOVE db -1 ; end ; POKEMANIAC (12) db "DONALD@", TRAINERTYPE_NORMAL db 10, SLOWPOKE db 10, SLOWPOKE db -1 ; end ; POKEMANIAC (13) db "ZACH@", TRAINERTYPE_NORMAL db 27, RHYHORN db -1 ; end ; POKEMANIAC (14) db "BRENT@", TRAINERTYPE_MOVES db 41, CHANSEY, ROLLOUT, ATTRACT, EGG_BOMB, SOFTBOILED db -1 ; end ; POKEMANIAC (15) db "MILLER@", TRAINERTYPE_NORMAL db 17, NIDOKING db 17, NIDOQUEEN db -1 ; end GruntMGroup: ; GRUNTM (1) db "GRUNT@", TRAINERTYPE_NORMAL db 14, KOFFING db -1 ; end ; GRUNTM (2) db "GRUNT@", TRAINERTYPE_NORMAL db 7, RATTATA db 9, ZUBAT db 9, ZUBAT db -1 ; end ; GRUNTM (3) db "GRUNT@", TRAINERTYPE_NORMAL db 24, RATICATE db 24, RATICATE db -1 ; end ; GRUNTM (4) db "GRUNT@", TRAINERTYPE_NORMAL db 23, GRIMER db 23, GRIMER db 25, MUK db -1 ; end ; GRUNTM (5) db "GRUNT@", TRAINERTYPE_NORMAL db 21, RATTATA db 21, RATTATA db 23, RATTATA db 23, RATTATA db 23, RATTATA db -1 ; end ; GRUNTM (6) db "GRUNT@", TRAINERTYPE_NORMAL db 26, ZUBAT db 26, ZUBAT db -1 ; end ; GRUNTM (7) db "GRUNT@", TRAINERTYPE_NORMAL db 23, KOFFING db 23, GRIMER db 23, ZUBAT db 23, RATTATA db -1 ; end ; GRUNTM (8) db "GRUNT@", TRAINERTYPE_NORMAL db 26, WEEZING db -1 ; end ; GRUNTM (9) db "GRUNT@", TRAINERTYPE_NORMAL db 24, RATICATE db 26, KOFFING db -1 ; end ; GRUNTM (10) db "GRUNT@", TRAINERTYPE_NORMAL db 22, ZUBAT db 24, GOLBAT db 22, GRIMER db -1 ; end ; GRUNTM (11) db "GRUNT@", TRAINERTYPE_NORMAL db 23, MUK db 23, KOFFING db 25, RATTATA db -1 ; end ; GRUNTM (12) db "EXECUTIVE@", TRAINERTYPE_NORMAL db 33, HOUNDOUR db -1 ; end ; GRUNTM (13) db "GRUNT@", TRAINERTYPE_NORMAL db 27, RATTATA db -1 ; end ; GRUNTM (14) db "GRUNT@", TRAINERTYPE_NORMAL db 24, RATICATE db 24, GOLBAT db -1 ; end ; GRUNTM (15) db "GRUNT@", TRAINERTYPE_NORMAL db 26, GRIMER db 23, WEEZING db -1 ; end ; GRUNTM (16) db "GRUNT@", TRAINERTYPE_NORMAL db 16, RATTATA db 16, RATTATA db 16, RATTATA db 16, RATTATA db -1 ; end ; GRUNTM (17) db "GRUNT@", TRAINERTYPE_NORMAL db 18, GOLBAT db -1 ; end ; GRUNTM (18) db "GRUNT@", TRAINERTYPE_NORMAL db 17, RATTATA db 17, ZUBAT db 17, RATTATA db -1 ; end ; GRUNTM (19) db "GRUNT@", TRAINERTYPE_NORMAL db 18, VENONAT db 18, VENONAT db -1 ; end ; GRUNTM (20) db "GRUNT@", TRAINERTYPE_NORMAL db 17, DROWZEE db 19, ZUBAT db -1 ; end ; GRUNTM (21) db "GRUNT@", TRAINERTYPE_NORMAL db 16, ZUBAT db 17, GRIMER db 18, RATTATA db -1 ; end ; GRUNTM (22) db "EXECUTIVE@", TRAINERTYPE_NORMAL db 36, GOLBAT db -1 ; end ; GRUNTM (23) db "EXECUTIVE@", TRAINERTYPE_NORMAL db 30, KOFFING db -1 ; end ; GRUNTM (24) db "GRUNT@", TRAINERTYPE_NORMAL db 25, KOFFING db 25, KOFFING db -1 ; end ; GRUNTM (25) db "GRUNT@", TRAINERTYPE_NORMAL db 24, KOFFING db 24, MUK db -1 ; end ; GRUNTM (26) db "GRUNT@", TRAINERTYPE_NORMAL db 15, RATTATA db 15, RATTATA db -1 ; end ; GRUNTM (27) db "EXECUTIVE@", TRAINERTYPE_NORMAL db 22, ZUBAT db -1 ; end ; GRUNTM (28) db "GRUNT@", TRAINERTYPE_NORMAL db 19, RATICATE db -1 ; end ; GRUNTM (29) db "GRUNT@", TRAINERTYPE_NORMAL db 9, RATTATA db 9, RATTATA db -1 ; end ; GRUNTM (30) db "GRUNT@", TRAINERTYPE_NORMAL db 25, GOLBAT db 25, GOLBAT db 30, ARBOK db -1 ; end ; GRUNTM (31) db "GRUNT@", TRAINERTYPE_NORMAL db 30, GOLBAT db -1 ; end GentlemanGroup: ; GENTLEMAN (1) db "PRESTON@", TRAINERTYPE_NORMAL db 18, GROWLITHE db 18, GROWLITHE db -1 ; end ; GENTLEMAN (2) db "EDWARD@", TRAINERTYPE_NORMAL db 33, PERSIAN db -1 ; end ; GENTLEMAN (3) db "GREGORY@", TRAINERTYPE_NORMAL db 37, PIKACHU db 33, FLAAFFY db -1 ; end ; GENTLEMAN (4) db "VIRGIL@", TRAINERTYPE_NORMAL db 20, PONYTA db -1 ; end ; GENTLEMAN (5) db "ALFRED@", TRAINERTYPE_NORMAL db 20, NOCTOWL db -1 ; end SkierGroup: ; SKIER (1) db "ROXANNE@", TRAINERTYPE_NORMAL db 28, JYNX db -1 ; end ; SKIER (2) db "CLARISSA@", TRAINERTYPE_NORMAL db 28, DEWGONG db -1 ; end TeacherGroup: ; TEACHER (1) ; trainers school db "COLETTE@", TRAINERTYPE_NORMAL db 4, POLIWAG db 4, VULPIX db 4, ODDISH db -1 ; end ; TEACHER (2) db "HILLARY@", TRAINERTYPE_NORMAL db 32, AIPOM db 36, CUBONE db -1 ; end ; TEACHER (3) db "SHIRLEY@", TRAINERTYPE_NORMAL db 35, JIGGLYPUFF db -1 ; end SabrinaGroup: ; SABRINA (1) db "SABRINA@", TRAINERTYPE_MOVES db 46, ESPEON, SAND_ATTACK, QUICK_ATTACK, SWIFT, PSYCHIC_M db 46, MR__MIME, BARRIER, REFLECT, BATON_PASS, PSYCHIC_M db 48, ALAKAZAM, RECOVER, FUTURE_SIGHT, PSYCHIC_M, REFLECT db -1 ; end BugCatcherGroup: ; BUG_CATCHER (1) db "RICK@", TRAINERTYPE_NORMAL db 6, WEEDLE db 6, CATERPIE db -1 ; end ; BUG_CATCHER (2) db "DOUG@", TRAINERTYPE_NORMAL db 6, CATERPIE db 6, CATERPIE db -1 ; end ; BUG_CATCHER (3) db "CHARLIE@", TRAINERTYPE_NORMAL db 6, WEEDLE db 7, KAKUNA db 6, WEEDLE db -1 ; end ; BUG_CATCHER (4) db "ANTHONY@", TRAINERTYPE_NORMAL db 8, METAPOD db 7, PINSIR db -1 ; end ; BUG_CATCHER (5) db "SAMMY@", TRAINERTYPE_NORMAL db 9, WEEDLE db -1 ; end ; BUG_CATCHER (6) db "COLTON@", TRAINERTYPE_NORMAL db 10, CATERPIE db 10, WEEDLE db 10, CATERPIE db -1 ; end ; BUG_CATCHER (7) db "GREG@", TRAINERTYPE_NORMAL db 9, WEEDLE db 9, KAKUNA db 9, CATERPIE db 9, METAPOD db -1 ; end ; BUG_CATCHER (8) db "JAMES@", TRAINERTYPE_NORMAL db 11, CATERPIE db 11, METAPOD db -1 ; end ; BUG_CATCHER (9) db "KENT@", TRAINERTYPE_NORMAL db 12, WEEDLE db 12, KAKUNA db -1 ; end ; BUG_CATCHER (10) db "ROBBIE@", TRAINERTYPE_NORMAL db 11, CATERPIE db 12, METAPOD db 12, KAKUNA db -1 ; end FisherGroup: ; FISHER (1) db "JUSTIN@", TRAINERTYPE_NORMAL db 5, MAGIKARP db 5, MAGIKARP db 15, MAGIKARP db 5, MAGIKARP db -1 ; end ; FISHER (2) db "RALPH@", TRAINERTYPE_NORMAL db 10, GOLDEEN db -1 ; end ; FISHER (3) db "ARNOLD@", TRAINERTYPE_NORMAL db 34, TENTACRUEL db -1 ; end ; FISHER (4) db "KYLE@", TRAINERTYPE_NORMAL db 28, SEAKING db 31, POLIWHIRL db 31, SEAKING db -1 ; end ; FISHER (5) db "HENRY@", TRAINERTYPE_NORMAL db 8, POLIWAG db 8, POLIWAG db -1 ; end ; FISHER (6) db "MARVIN@", TRAINERTYPE_NORMAL db 10, MAGIKARP db 10, GYARADOS db 15, MAGIKARP db 15, GYARADOS db -1 ; end ; FISHER (7) db "TULLY@", TRAINERTYPE_NORMAL db 18, QWILFISH db -1 ; end ; FISHER (8) db "ANDRE@", TRAINERTYPE_NORMAL db 27, GYARADOS db -1 ; end ; FISHER (9) db "RAYMOND@", TRAINERTYPE_NORMAL db 22, MAGIKARP db 22, MAGIKARP db 22, MAGIKARP db 22, MAGIKARP db -1 ; end ; FISHER (10) db "WILTON@", TRAINERTYPE_NORMAL db 23, GOLDEEN db 23, GOLDEEN db 25, SEAKING db -1 ; end ; FISHER (11) db "EDGAR@", TRAINERTYPE_MOVES db 25, REMORAID, LOCK_ON, PSYBEAM, AURORA_BEAM, BUBBLEBEAM db 25, REMORAID, LOCK_ON, PSYBEAM, AURORA_BEAM, BUBBLEBEAM db -1 ; end ; FISHER (12) db "JONAH@", TRAINERTYPE_NORMAL db 25, SHELLDER db 29, OCTILLERY db 25, REMORAID db 29, CLOYSTER db -1 ; end ; FISHER (13) db "MARTIN@", TRAINERTYPE_NORMAL db 32, REMORAID db 32, REMORAID db -1 ; end ; FISHER (14) db "STEPHEN@", TRAINERTYPE_NORMAL db 25, MAGIKARP db 25, MAGIKARP db 31, QWILFISH db 31, TENTACRUEL db -1 ; end ; FISHER (15) db "BARNEY@", TRAINERTYPE_NORMAL db 30, GYARADOS db 30, GYARADOS db 30, GYARADOS db -1 ; end ; FISHER (16) db "RALPH@", TRAINERTYPE_NORMAL db 17, GOLDEEN db -1 ; end ; FISHER (17) db "RALPH@", TRAINERTYPE_NORMAL db 17, QWILFISH db 19, GOLDEEN db -1 ; end ; FISHER (18) db "TULLY@", TRAINERTYPE_NORMAL db 23, QWILFISH db -1 ; end ; FISHER (19) db "TULLY@", TRAINERTYPE_NORMAL db 32, GOLDEEN db 32, GOLDEEN db 32, QWILFISH db -1 ; end ; FISHER (20) db "WILTON@", TRAINERTYPE_NORMAL db 29, GOLDEEN db 29, GOLDEEN db 32, SEAKING db -1 ; end ; FISHER (21) db "SCOTT@", TRAINERTYPE_NORMAL db 30, QWILFISH db 30, QWILFISH db 34, SEAKING db -1 ; end ; FISHER (22) db "WILTON@", TRAINERTYPE_MOVES db 34, SEAKING, SUPERSONIC, WATERFALL, FLAIL, FURY_ATTACK db 34, SEAKING, SUPERSONIC, WATERFALL, FLAIL, FURY_ATTACK db 38, REMORAID, PSYBEAM, AURORA_BEAM, BUBBLEBEAM, HYPER_BEAM db -1 ; end ; FISHER (23) db "RALPH@", TRAINERTYPE_NORMAL db 30, QWILFISH db 32, GOLDEEN db -1 ; end ; FISHER (24) db "RALPH@", TRAINERTYPE_MOVES db 35, QWILFISH, TOXIC, MINIMIZE, SURF, PIN_MISSILE db 39, SEAKING, ENDURE, FLAIL, FURY_ATTACK, WATERFALL db -1 ; end ; FISHER (25) db "TULLY@", TRAINERTYPE_MOVES db 34, SEAKING, SUPERSONIC, RAIN_DANCE, WATERFALL, FURY_ATTACK db 34, SEAKING, SUPERSONIC, RAIN_DANCE, WATERFALL, FURY_ATTACK db 37, QWILFISH, ROLLOUT, SURF, PIN_MISSILE, TAKE_DOWN db -1 ; end SwimmerMGroup: ; SWIMMERM (1) db "HAROLD@", TRAINERTYPE_NORMAL db 32, REMORAID db 30, SEADRA db -1 ; end ; SWIMMERM (2) db "SIMON@", TRAINERTYPE_NORMAL db 20, TENTACOOL db 20, TENTACOOL db -1 ; end ; SWIMMERM (3) db "RANDALL@", TRAINERTYPE_NORMAL db 18, SHELLDER db 20, WARTORTLE db 18, SHELLDER db -1 ; end ; SWIMMERM (4) db "CHARLIE@", TRAINERTYPE_NORMAL db 21, SHELLDER db 19, TENTACOOL db 19, TENTACRUEL db -1 ; end ; SWIMMERM (5) db "GEORGE@", TRAINERTYPE_NORMAL db 16, TENTACOOL db 17, TENTACOOL db 16, TENTACOOL db 19, STARYU db 17, TENTACOOL db 19, REMORAID db -1 ; end ; SWIMMERM (6) db "BERKE@", TRAINERTYPE_NORMAL db 23, QWILFISH db -1 ; end ; SWIMMERM (7) db "KIRK@", TRAINERTYPE_NORMAL db 20, GYARADOS db 20, GYARADOS db -1 ; end ; SWIMMERM (8) db "MATHEW@", TRAINERTYPE_NORMAL db 23, KRABBY db -1 ; end ; SWIMMERM (9) db "HAL@", TRAINERTYPE_NORMAL db 24, SEEL db 25, DEWGONG db 24, SEEL db -1 ; end ; SWIMMERM (10) db "PATON@", TRAINERTYPE_NORMAL db 26, PILOSWINE db 26, PILOSWINE db -1 ; end ; SWIMMERM (11) db "DARYL@", TRAINERTYPE_NORMAL db 24, SHELLDER db 25, CLOYSTER db 24, SHELLDER db -1 ; end ; SWIMMERM (12) db "WALTER@", TRAINERTYPE_NORMAL db 15, HORSEA db 15, HORSEA db 20, SEADRA db -1 ; end ; SWIMMERM (13) db "TONY@", TRAINERTYPE_NORMAL db 13, STARYU db 18, STARMIE db 16, HORSEA db -1 ; end ; SWIMMERM (14) db "JEROME@", TRAINERTYPE_NORMAL db 26, SEADRA db 28, TENTACOOL db 30, TENTACRUEL db 28, GOLDEEN db -1 ; end ; SWIMMERM (15) db "TUCKER@", TRAINERTYPE_NORMAL db 30, SHELLDER db 34, CLOYSTER db -1 ; end ; SWIMMERM (16) db "RICK@", TRAINERTYPE_NORMAL db 13, STARYU db 18, STARMIE db 16, HORSEA db -1 ; end ; SWIMMERM (17) db "CAMERON@", TRAINERTYPE_NORMAL db 34, MARILL db -1 ; end ; SWIMMERM (18) db "SETH@", TRAINERTYPE_NORMAL db 29, QUAGSIRE db 29, OCTILLERY db 32, QUAGSIRE db -1 ; end ; SWIMMERM (19) db "JAMES@", TRAINERTYPE_NORMAL db 13, STARYU db 18, STARMIE db 16, HORSEA db -1 ; end ; SWIMMERM (20) db "LEWIS@", TRAINERTYPE_NORMAL db 13, STARYU db 18, STARMIE db 16, HORSEA db -1 ; end ; SWIMMERM (21) db "PARKER@", TRAINERTYPE_NORMAL db 32, HORSEA db 32, HORSEA db 35, SEADRA db -1 ; end SwimmerFGroup: ; SWIMMERF (1) db "LOUISE@", TRAINERTYPE_NORMAL db 16, HORSEA db 16, SHELLDER db -1 ; end ; SWIMMERF (2) db "DIANA@", TRAINERTYPE_NORMAL db 18, GOLDEEN db -1 ; end ; SWIMMERF (3) db "KAYLEE@", TRAINERTYPE_NORMAL db 18, GOLDEEN db 20, GOLDEEN db 20, SEAKING db -1 ; end ; SWIMMERF (4) db "SUSIE@", TRAINERTYPE_MOVES db 20, PSYDUCK, SCRATCH, TAIL_WHIP, DISABLE, CONFUSION db 22, GOLDEEN, PECK, TAIL_WHIP, SUPERSONIC, HORN_ATTACK db -1 ; end ; SWIMMERF (5) db "DENISE@", TRAINERTYPE_NORMAL db 22, SEEL db -1 ; end ; SWIMMERF (6) db "KARA@", TRAINERTYPE_NORMAL db 20, STARYU db 20, STARMIE db -1 ; end ; SWIMMERF (7) db "WENDY@", TRAINERTYPE_MOVES db 21, HORSEA, BUBBLE, SMOKESCREEN, LEER, WATER_GUN db 21, HORSEA, DRAGON_RAGE, SMOKESCREEN, LEER, WATER_GUN db -1 ; end ; SWIMMERF (8) db "LISA@", TRAINERTYPE_NORMAL db 28, JYNX db -1 ; end ; SWIMMERF (9) db "JILL@", TRAINERTYPE_NORMAL db 28, DEWGONG db -1 ; end ; SWIMMERF (10) db "MARY@", TRAINERTYPE_NORMAL db 20, SEAKING db -1 ; end ; SWIMMERF (11) db "KATIE@", TRAINERTYPE_NORMAL db 33, DEWGONG db -1 ; end ; SWIMMERF (12) db "DAWN@", TRAINERTYPE_NORMAL db 34, SEAKING db -1 ; end ; SWIMMERF (13) db "TARA@", TRAINERTYPE_NORMAL db 20, SEAKING db -1 ; end ; SWIMMERF (14) db "NICOLE@", TRAINERTYPE_NORMAL db 29, MARILL db 29, MARILL db 32, LAPRAS db -1 ; end ; SWIMMERF (15) db "LORI@", TRAINERTYPE_NORMAL db 32, STARMIE db 32, STARMIE db -1 ; end ; SWIMMERF (16) db "JODY@", TRAINERTYPE_NORMAL db 20, SEAKING db -1 ; end ; SWIMMERF (17) db "NIKKI@", TRAINERTYPE_NORMAL db 28, SEEL db 28, SEEL db 28, SEEL db 28, DEWGONG db -1 ; end ; SWIMMERF (18) db "DIANA@", TRAINERTYPE_NORMAL db 37, GOLDUCK db -1 ; end ; SWIMMERF (19) db "BRIANA@", TRAINERTYPE_NORMAL db 35, SEAKING db 35, SEAKING db -1 ; end SailorGroup: ; SAILOR (1) db "EUGENE@", TRAINERTYPE_NORMAL db 17, POLIWHIRL db 17, RATICATE db 19, KRABBY db -1 ; end ; SAILOR (2) db "HUEY@", TRAINERTYPE_NORMAL db 18, POLIWAG db 18, POLIWHIRL db -1 ; end ; SAILOR (3) db "TERRELL@", TRAINERTYPE_NORMAL db 20, POLIWHIRL db -1 ; end ; SAILOR (4) db "KENT@", TRAINERTYPE_MOVES db 18, KRABBY, BUBBLE, LEER, VICEGRIP, HARDEN db 20, KRABBY, BUBBLEBEAM, LEER, VICEGRIP, HARDEN db -1 ; end ; SAILOR (5) db "ERNEST@", TRAINERTYPE_NORMAL db 18, MACHOP db 18, MACHOP db 18, POLIWHIRL db -1 ; end ; SAILOR (6) db "JEFF@", TRAINERTYPE_NORMAL db 32, RATICATE db 32, RATICATE db -1 ; end ; SAILOR (7) db "GARRETT@", TRAINERTYPE_NORMAL db 34, KINGLER db -1 ; end ; SAILOR (8) db "KENNETH@", TRAINERTYPE_NORMAL db 28, MACHOP db 28, MACHOP db 28, POLIWRATH db 28, MACHOP db -1 ; end ; SAILOR (9) db "STANLY@", TRAINERTYPE_NORMAL db 31, MACHOP db 33, MACHOKE db 26, PSYDUCK db -1 ; end ; SAILOR (10) db "HARRY@", TRAINERTYPE_NORMAL db 19, WOOPER db -1 ; end ; SAILOR (11) db "HUEY@", TRAINERTYPE_NORMAL db 28, POLIWHIRL db 28, POLIWHIRL db -1 ; end ; SAILOR (12) db "HUEY@", TRAINERTYPE_NORMAL db 34, POLIWHIRL db 34, POLIWRATH db -1 ; end ; SAILOR (13) db "HUEY@", TRAINERTYPE_MOVES db 38, POLITOED, WHIRLPOOL, RAIN_DANCE, BODY_SLAM, PERISH_SONG db 38, POLIWRATH, SURF, STRENGTH, ICE_PUNCH, SUBMISSION db -1 ; end SuperNerdGroup: ; SUPER_NERD (1) db "JOVAN@", TRAINERTYPE_NORMAL db 10, VOLTORB db 10, MAGNEMITE db -1 ; end ; SUPER_NERD (2) db "MIGUEL@", TRAINERTYPE_NORMAL db 11, KOFFING db 11, VOLTORB db 11, GRIMER db -1 ; end ; SUPER_NERD (3) db "GREGG@", TRAINERTYPE_NORMAL db 20, MAGNEMITE db 20, MAGNEMITE db 20, MAGNEMITE db -1 ; end ; SUPER_NERD (4) db "JAY@", TRAINERTYPE_NORMAL db 22, KOFFING db 22, KOFFING db -1 ; end ; SUPER_NERD (5) db "DAVE@", TRAINERTYPE_NORMAL db 24, DITTO db -1 ; end ; SUPER_NERD (6) db "SAM@", TRAINERTYPE_NORMAL db 34, GRIMER db 34, MUK db -1 ; end ; SUPER_NERD (7) db "TOM@", TRAINERTYPE_NORMAL db 32, MAGNEMITE db 32, MAGNEMITE db 32, MAGNEMITE db -1 ; end ; SUPER_NERD (8) db "PAT@", TRAINERTYPE_NORMAL db 36, PORYGON db -1 ; end ; SUPER_NERD (9) db "SHAWN@", TRAINERTYPE_NORMAL db 31, MAGNEMITE db 33, MUK db 31, MAGNEMITE db -1 ; end ; SUPER_NERD (10) db "TERU@", TRAINERTYPE_NORMAL db 7, MAGNEMITE db 11, VOLTORB db 7, MAGNEMITE db 9, MAGNEMITE db -1 ; end ; SUPER_NERD (11) db "RUSS@", TRAINERTYPE_NORMAL db 27, MAGNEMITE db 27, MAGNEMITE db 27, MAGNEMITE db -1 ; end ; SUPER_NERD (12) db "NORTON@", TRAINERTYPE_MOVES db 30, PORYGON, CONVERSION, CONVERSION2, RECOVER, TRI_ATTACK db -1 ; end ; SUPER_NERD (13) db "HUGH@", TRAINERTYPE_MOVES db 39, SEADRA, SMOKESCREEN, TWISTER, SURF, WATERFALL db -1 ; end ; SUPER_NERD (14) db "MARKUS@", TRAINERTYPE_MOVES db 19, SLOWPOKE, CURSE, WATER_GUN, GROWL, STRENGTH db -1 ; end Rival2Group: ; RIVAL2 (1) db "?@", TRAINERTYPE_MOVES db 41, SNEASEL, QUICK_ATTACK, SCREECH, FAINT_ATTACK, FURY_CUTTER db 42, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db 41, MAGNETON, THUNDERSHOCK, SONICBOOM, THUNDER_WAVE, SWIFT db 43, GENGAR, MEAN_LOOK, CURSE, SHADOW_BALL, CONFUSE_RAY db 43, ALAKAZAM, DISABLE, RECOVER, FUTURE_SIGHT, PSYCHIC_M db 45, MEGANIUM, RAZOR_LEAF, POISONPOWDER, BODY_SLAM, LIGHT_SCREEN db -1 ; end ; RIVAL2 (2) db "?@", TRAINERTYPE_MOVES db 41, SNEASEL, QUICK_ATTACK, SCREECH, FAINT_ATTACK, FURY_CUTTER db 42, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db 41, MAGNETON, THUNDERSHOCK, SONICBOOM, THUNDER_WAVE, SWIFT db 43, GENGAR, MEAN_LOOK, CURSE, SHADOW_BALL, CONFUSE_RAY db 43, ALAKAZAM, DISABLE, RECOVER, FUTURE_SIGHT, PSYCHIC_M db 45, TYPHLOSION, SMOKESCREEN, QUICK_ATTACK, FLAME_WHEEL, SWIFT db -1 ; end ; RIVAL2 (3) db "?@", TRAINERTYPE_MOVES db 41, SNEASEL, QUICK_ATTACK, SCREECH, FAINT_ATTACK, FURY_CUTTER db 42, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db 41, MAGNETON, THUNDERSHOCK, SONICBOOM, THUNDER_WAVE, SWIFT db 43, GENGAR, MEAN_LOOK, CURSE, SHADOW_BALL, CONFUSE_RAY db 43, ALAKAZAM, DISABLE, RECOVER, FUTURE_SIGHT, PSYCHIC_M db 45, FERALIGATR, RAGE, WATER_GUN, SCARY_FACE, SLASH db -1 ; end ; RIVAL2 (4) db "?@", TRAINERTYPE_MOVES db 45, SNEASEL, QUICK_ATTACK, SCREECH, FAINT_ATTACK, FURY_CUTTER db 48, CROBAT, TOXIC, BITE, CONFUSE_RAY, WING_ATTACK db 45, MAGNETON, THUNDER, SONICBOOM, THUNDER_WAVE, SWIFT db 46, GENGAR, MEAN_LOOK, CURSE, SHADOW_BALL, CONFUSE_RAY db 46, ALAKAZAM, RECOVER, FUTURE_SIGHT, PSYCHIC_M, REFLECT db 50, MEGANIUM, GIGA_DRAIN, BODY_SLAM, LIGHT_SCREEN, SAFEGUARD db -1 ; end ; RIVAL2 (5) db "?@", TRAINERTYPE_MOVES db 45, SNEASEL, QUICK_ATTACK, SCREECH, FAINT_ATTACK, FURY_CUTTER db 48, CROBAT, TOXIC, BITE, CONFUSE_RAY, WING_ATTACK db 45, MAGNETON, THUNDER, SONICBOOM, THUNDER_WAVE, SWIFT db 46, GENGAR, MEAN_LOOK, CURSE, SHADOW_BALL, CONFUSE_RAY db 46, ALAKAZAM, RECOVER, FUTURE_SIGHT, PSYCHIC_M, REFLECT db 50, TYPHLOSION, SMOKESCREEN, QUICK_ATTACK, FIRE_BLAST, SWIFT db -1 ; end ; RIVAL2 (6) db "?@", TRAINERTYPE_MOVES db 45, SNEASEL, QUICK_ATTACK, SCREECH, FAINT_ATTACK, FURY_CUTTER db 48, CROBAT, TOXIC, BITE, CONFUSE_RAY, WING_ATTACK db 45, MAGNETON, THUNDER, SONICBOOM, THUNDER_WAVE, SWIFT db 46, GENGAR, MEAN_LOOK, CURSE, SHADOW_BALL, CONFUSE_RAY db 46, ALAKAZAM, RECOVER, FUTURE_SIGHT, PSYCHIC_M, REFLECT db 50, FERALIGATR, SURF, RAIN_DANCE, SLASH, SCREECH db -1 ; end GuitaristGroup: ; GUITARIST (1) db "CLYDE@", TRAINERTYPE_NORMAL db 34, ELECTABUZZ db -1 ; end ; GUITARIST (2) db "VINCENT@", TRAINERTYPE_NORMAL db 27, MAGNEMITE db 33, VOLTORB db 32, MAGNEMITE db 32, MAGNEMITE db -1 ; end HikerGroup: ; HIKER (1) db "MARCUS@", TRAINERTYPE_NORMAL db 10, GEODUDE db 10, GEODUDE db 10, ONIX db -1 ; end ; HIKER (2) db "RUSSELL@", TRAINERTYPE_NORMAL db 4, GEODUDE db 6, GEODUDE db 8, GEODUDE db -1 ; end ; HIKER (3) db "PHILLIP@", TRAINERTYPE_NORMAL db 23, GEODUDE db 23, GEODUDE db 23, GRAVELER db -1 ; end ; HIKER (4) db "LEONARD@", TRAINERTYPE_NORMAL db 23, GEODUDE db 25, MACHOP db -1 ; end ; HIKER (5) db "ANTHONY@", TRAINERTYPE_NORMAL db 11, GEODUDE db 11, MACHOP db -1 ; end ; HIKER (6) db "BENJAMIN@", TRAINERTYPE_NORMAL db 14, DIGLETT db 14, GEODUDE db 16, DUGTRIO db -1 ; end ; HIKER (7) db "ERIK@", TRAINERTYPE_NORMAL db 24, MACHOP db 27, GRAVELER db 27, MACHOP db -1 ; end ; HIKER (8) db "MICHAEL@", TRAINERTYPE_NORMAL db 25, GEODUDE db 25, GRAVELER db 25, GOLEM db -1 ; end ; HIKER (9) db "PARRY@", TRAINERTYPE_NORMAL db 35, ONIX db 33, SWINUB db -1 ; end ; HIKER (10) db "TIMOTHY@", TRAINERTYPE_MOVES db 27, DIGLETT, MAGNITUDE, DIG, SAND_ATTACK, SLASH db 27, DUGTRIO, MAGNITUDE, DIG, SAND_ATTACK, SLASH db -1 ; end ; HIKER (11) db "BAILEY@", TRAINERTYPE_NORMAL db 13, GEODUDE db 13, GEODUDE db 13, GEODUDE db 13, GEODUDE db 13, GEODUDE db -1 ; end ; HIKER (12) db "ANTHONY@", TRAINERTYPE_NORMAL db 25, GRAVELER db 27, GRAVELER db 29, MACHOKE db -1 ; end ; HIKER (13) db "TIM@", TRAINERTYPE_NORMAL db 31, GRAVELER db 31, GRAVELER db 31, GRAVELER db -1 ; end ; HIKER (14) db "NOLAND@", TRAINERTYPE_NORMAL db 31, SANDSLASH db 33, GOLEM db -1 ; end ; HIKER (15) db "SIDNEY@", TRAINERTYPE_NORMAL db 34, DUGTRIO db 32, ONIX db -1 ; end ; HIKER (16) db "KENNY@", TRAINERTYPE_NORMAL db 27, SANDSLASH db 29, GRAVELER db 31, GOLEM db 29, GRAVELER db -1 ; end ; HIKER (17) db "JIM@", TRAINERTYPE_NORMAL db 35, MACHAMP db -1 ; end ; HIKER (18) db "DANIEL@", TRAINERTYPE_NORMAL db 11, ONIX db -1 ; end ; HIKER (19) db "PARRY@", TRAINERTYPE_MOVES db 35, PILOSWINE, EARTHQUAKE, BLIZZARD, REST, TAKE_DOWN db 35, DUGTRIO, MAGNITUDE, DIG, MUD_SLAP, SLASH db 38, STEELIX, DIG, IRON_TAIL, SANDSTORM, SLAM db -1 ; end ; HIKER (20) db "PARRY@", TRAINERTYPE_NORMAL db 29, ONIX db -1 ; end ; HIKER (21) db "ANTHONY@", TRAINERTYPE_NORMAL db 30, GRAVELER db 30, GRAVELER db 32, MACHOKE db -1 ; end ; HIKER (22) db "ANTHONY@", TRAINERTYPE_MOVES db 34, GRAVELER, MAGNITUDE, SELFDESTRUCT, DEFENSE_CURL, ROLLOUT db 36, GOLEM, MAGNITUDE, SELFDESTRUCT, DEFENSE_CURL, ROLLOUT db 34, MACHOKE, KARATE_CHOP, VITAL_THROW, HEADBUTT, DIG db -1 ; end BikerGroup: ; BIKER (1) db "BENNY@", TRAINERTYPE_NORMAL db 20, KOFFING db 20, KOFFING db 20, KOFFING db -1 ; end ; BIKER (2) db "KAZU@", TRAINERTYPE_NORMAL db 20, KOFFING db 20, KOFFING db 20, KOFFING db -1 ; end ; BIKER (3) db "DWAYNE@", TRAINERTYPE_NORMAL db 27, KOFFING db 28, KOFFING db 29, KOFFING db 30, KOFFING db -1 ; end ; BIKER (4) db "HARRIS@", TRAINERTYPE_NORMAL db 34, FLAREON db -1 ; end ; BIKER (5) db "ZEKE@", TRAINERTYPE_NORMAL db 32, KOFFING db 32, KOFFING db -1 ; end ; BIKER (6) db "CHARLES@", TRAINERTYPE_NORMAL db 30, KOFFING db 30, CHARMELEON db 30, WEEZING db -1 ; end ; BIKER (7) db "RILEY@", TRAINERTYPE_NORMAL db 34, WEEZING db -1 ; end ; BIKER (8) db "JOEL@", TRAINERTYPE_NORMAL db 32, MAGMAR db 32, MAGMAR db -1 ; end ; BIKER (9) db "GLENN@", TRAINERTYPE_NORMAL db 28, KOFFING db 30, MAGMAR db 32, WEEZING db -1 ; end BlaineGroup: ; BLAINE (1) db "BLAINE@", TRAINERTYPE_MOVES db 45, MAGCARGO, CURSE, SMOG, FLAMETHROWER, ROCK_SLIDE db 45, MAGMAR, THUNDERPUNCH, FIRE_PUNCH, SUNNY_DAY, CONFUSE_RAY db 50, RAPIDASH, QUICK_ATTACK, FIRE_SPIN, FURY_ATTACK, FIRE_BLAST db -1 ; end BurglarGroup: ; BURGLAR (1) db "DUNCAN@", TRAINERTYPE_NORMAL db 23, KOFFING db 25, MAGMAR db 23, KOFFING db -1 ; end ; BURGLAR (2) db "EDDIE@", TRAINERTYPE_MOVES db 26, GROWLITHE, ROAR, EMBER, LEER, TAKE_DOWN db 24, KOFFING, TACKLE, SMOG, SLUDGE, SMOKESCREEN db -1 ; end ; BURGLAR (3) db "COREY@", TRAINERTYPE_NORMAL db 25, KOFFING db 28, MAGMAR db 25, KOFFING db 30, KOFFING db -1 ; end FirebreatherGroup: ; FIREBREATHER (1) db "OTIS@", TRAINERTYPE_NORMAL db 29, MAGMAR db 32, WEEZING db 29, MAGMAR db -1 ; end ; FIREBREATHER (2) db "DICK@", TRAINERTYPE_NORMAL db 17, CHARMELEON db -1 ; end ; FIREBREATHER (3) db "NED@", TRAINERTYPE_NORMAL db 15, KOFFING db 16, GROWLITHE db 15, KOFFING db -1 ; end ; FIREBREATHER (4) db "BURT@", TRAINERTYPE_NORMAL db 32, KOFFING db 32, SLUGMA db -1 ; end ; FIREBREATHER (5) db "BILL@", TRAINERTYPE_NORMAL db 6, KOFFING db 6, KOFFING db -1 ; end ; FIREBREATHER (6) db "WALT@", TRAINERTYPE_NORMAL db 11, MAGMAR db 13, MAGMAR db -1 ; end ; FIREBREATHER (7) db "RAY@", TRAINERTYPE_NORMAL db 9, VULPIX db -1 ; end ; FIREBREATHER (8) db "LYLE@", TRAINERTYPE_NORMAL db 28, KOFFING db 31, FLAREON db 28, KOFFING db -1 ; end JugglerGroup: ; JUGGLER (1) db "IRWIN@", TRAINERTYPE_NORMAL db 2, VOLTORB db 6, VOLTORB db 10, VOLTORB db 14, VOLTORB db -1 ; end ; JUGGLER (2) db "FRITZ@", TRAINERTYPE_NORMAL db 29, MR__MIME db 29, MAGMAR db 29, MACHOKE db -1 ; end ; JUGGLER (3) db "HORTON@", TRAINERTYPE_NORMAL db 33, ELECTRODE db 33, ELECTRODE db 33, ELECTRODE db 33, ELECTRODE db -1 ; end ; JUGGLER (4) db "IRWIN@", TRAINERTYPE_NORMAL db 6, VOLTORB db 10, VOLTORB db 14, VOLTORB db 18, VOLTORB db -1 ; end ; JUGGLER (5) db "IRWIN@", TRAINERTYPE_NORMAL db 18, VOLTORB db 22, VOLTORB db 26, VOLTORB db 30, ELECTRODE db -1 ; end ; JUGGLER (6) db "IRWIN@", TRAINERTYPE_NORMAL db 18, VOLTORB db 22, VOLTORB db 26, VOLTORB db 30, ELECTRODE db -1 ; end BlackbeltGroup: ; BLACKBELT_T (1) db "KENJI@", TRAINERTYPE_NORMAL db 27, ONIX db 30, HITMONLEE db 27, ONIX db 32, MACHOKE db -1 ; end ; BLACKBELT_T (2) db "YOSHI@", TRAINERTYPE_MOVES db 27, HITMONLEE, DOUBLE_KICK, MEDITATE, JUMP_KICK, FOCUS_ENERGY db -1 ; end ; BLACKBELT_T (3) db "KENJI@", TRAINERTYPE_MOVES db 33, ONIX, BIND, ROCK_THROW, TOXIC, DIG db 38, MACHAMP, HEADBUTT, SWAGGER, THUNDERPUNCH, VITAL_THROW db 33, STEELIX, EARTHQUAKE, ROCK_THROW, IRON_TAIL, SANDSTORM db 36, HITMONLEE, DOUBLE_TEAM, HI_JUMP_KICK, MUD_SLAP, SWIFT db -1 ; end ; BLACKBELT_T (4) db "LAO@", TRAINERTYPE_MOVES db 27, HITMONCHAN, COMET_PUNCH, THUNDERPUNCH, ICE_PUNCH, FIRE_PUNCH db -1 ; end ; BLACKBELT_T (5) db "NOB@", TRAINERTYPE_MOVES db 25, MACHOP, LEER, FOCUS_ENERGY, KARATE_CHOP, SEISMIC_TOSS db 25, MACHOKE, LEER, KARATE_CHOP, SEISMIC_TOSS, ROCK_SLIDE db -1 ; end ; BLACKBELT_T (6) db "KIYO@", TRAINERTYPE_NORMAL db 34, HITMONLEE db 34, HITMONCHAN db -1 ; end ; BLACKBELT_T (7) db "LUNG@", TRAINERTYPE_NORMAL db 23, MANKEY db 23, MANKEY db 25, PRIMEAPE db -1 ; end ; BLACKBELT_T (8) db "KENJI@", TRAINERTYPE_NORMAL db 28, MACHOKE db -1 ; end ; BLACKBELT_T (9) db "WAI@", TRAINERTYPE_NORMAL db 30, MACHOKE db 32, MACHOKE db 34, MACHOKE db -1 ; end ExecutiveMGroup: ; EXECUTIVEM (1) db "EXECUTIVE@", TRAINERTYPE_MOVES db 33, HOUNDOUR, EMBER, ROAR, BITE, FAINT_ATTACK db 33, KOFFING, TACKLE, SLUDGE, SMOKESCREEN, HAZE db 35, HOUNDOOM, EMBER, SMOG, BITE, FAINT_ATTACK db -1 ; end ; EXECUTIVEM (2) db "EXECUTIVE@", TRAINERTYPE_MOVES db 36, GOLBAT, LEECH_LIFE, BITE, CONFUSE_RAY, WING_ATTACK db -1 ; end ; EXECUTIVEM (3) db "EXECUTIVE@", TRAINERTYPE_MOVES db 30, KOFFING, TACKLE, SELFDESTRUCT, SLUDGE, SMOKESCREEN db 30, KOFFING, TACKLE, SELFDESTRUCT, SLUDGE, SMOKESCREEN db 30, KOFFING, TACKLE, SELFDESTRUCT, SLUDGE, SMOKESCREEN db 32, WEEZING, TACKLE, EXPLOSION, SLUDGE, SMOKESCREEN db 30, KOFFING, TACKLE, SELFDESTRUCT, SLUDGE, SMOKESCREEN db 30, KOFFING, TACKLE, SMOG, SLUDGE, SMOKESCREEN db -1 ; end ; EXECUTIVEM (4) db "EXECUTIVE@", TRAINERTYPE_NORMAL db 22, ZUBAT db 24, RATICATE db 22, KOFFING db -1 ; end PsychicGroup: ; PSYCHIC_T (1) db "NATHAN@", TRAINERTYPE_NORMAL db 26, GIRAFARIG db -1 ; end ; PSYCHIC_T (2) db "FRANKLIN@", TRAINERTYPE_NORMAL db 37, KADABRA db -1 ; end ; PSYCHIC_T (3) db "HERMAN@", TRAINERTYPE_NORMAL db 30, EXEGGCUTE db 30, EXEGGCUTE db 30, EXEGGUTOR db -1 ; end ; PSYCHIC_T (4) db "FIDEL@", TRAINERTYPE_NORMAL db 34, XATU db -1 ; end ; PSYCHIC_T (5) db "GREG@", TRAINERTYPE_MOVES db 17, DROWZEE, HYPNOSIS, DISABLE, DREAM_EATER, NO_MOVE db -1 ; end ; PSYCHIC_T (6) db "NORMAN@", TRAINERTYPE_MOVES db 17, SLOWPOKE, TACKLE, GROWL, WATER_GUN, NO_MOVE db 20, SLOWPOKE, CURSE, BODY_SLAM, WATER_GUN, CONFUSION db -1 ; end ; PSYCHIC_T (7) db "MARK@", TRAINERTYPE_MOVES db 13, ABRA, TELEPORT, FLASH, NO_MOVE, NO_MOVE db 13, ABRA, TELEPORT, FLASH, NO_MOVE, NO_MOVE db 15, KADABRA, TELEPORT, KINESIS, CONFUSION, NO_MOVE db -1 ; end ; PSYCHIC_T (8) db "PHIL@", TRAINERTYPE_MOVES db 24, NATU, LEER, NIGHT_SHADE, FUTURE_SIGHT, CONFUSE_RAY db 26, KADABRA, DISABLE, PSYBEAM, RECOVER, FUTURE_SIGHT db -1 ; end ; PSYCHIC_T (9) db "RICHARD@", TRAINERTYPE_NORMAL db 36, ESPEON db -1 ; end ; PSYCHIC_T (10) db "GILBERT@", TRAINERTYPE_NORMAL db 30, STARMIE db 30, EXEGGCUTE db 34, GIRAFARIG db -1 ; end ; PSYCHIC_T (11) db "JARED@", TRAINERTYPE_NORMAL db 32, MR__MIME db 32, EXEGGCUTE db 35, EXEGGCUTE db -1 ; end ; PSYCHIC_T (12) db "RODNEY@", TRAINERTYPE_NORMAL db 29, DROWZEE db 33, HYPNO db -1 ; end PicnickerGroup: ; PICNICKER (1) db "LIZ@", TRAINERTYPE_NORMAL db 9, NIDORAN_F db -1 ; end ; PICNICKER (2) db "GINA@", TRAINERTYPE_NORMAL db 9, HOPPIP db 9, HOPPIP db 12, BULBASAUR db -1 ; end ; PICNICKER (3) db "BROOKE@", TRAINERTYPE_MOVES db 16, PIKACHU, THUNDERSHOCK, GROWL, QUICK_ATTACK, DOUBLE_TEAM db -1 ; end ; PICNICKER (4) db "KIM@", TRAINERTYPE_NORMAL db 15, VULPIX db -1 ; end ; PICNICKER (5) db "CINDY@", TRAINERTYPE_NORMAL db 36, NIDOQUEEN db -1 ; end ; PICNICKER (6) db "HOPE@", TRAINERTYPE_NORMAL db 34, FLAAFFY db -1 ; end ; PICNICKER (7) db "SHARON@", TRAINERTYPE_NORMAL db 31, FURRET db 33, RAPIDASH db -1 ; end ; PICNICKER (8) db "DEBRA@", TRAINERTYPE_NORMAL db 33, SEAKING db -1 ; end ; PICNICKER (9) db "GINA@", TRAINERTYPE_NORMAL db 14, HOPPIP db 14, HOPPIP db 17, IVYSAUR db -1 ; end ; PICNICKER (10) db "ERIN@", TRAINERTYPE_NORMAL db 16, PONYTA db 16, PONYTA db -1 ; end ; PICNICKER (11) db "LIZ@", TRAINERTYPE_NORMAL db 15, WEEPINBELL db 15, NIDORINA db -1 ; end ; PICNICKER (12) db "LIZ@", TRAINERTYPE_NORMAL db 19, WEEPINBELL db 19, NIDORINO db 21, NIDOQUEEN db -1 ; end ; PICNICKER (13) db "HEIDI@", TRAINERTYPE_NORMAL db 32, SKIPLOOM db 32, SKIPLOOM db -1 ; end ; PICNICKER (14) db "EDNA@", TRAINERTYPE_NORMAL db 30, NIDORINA db 34, RAICHU db -1 ; end ; PICNICKER (15) db "GINA@", TRAINERTYPE_NORMAL db 26, SKIPLOOM db 26, SKIPLOOM db 29, IVYSAUR db -1 ; end ; PICNICKER (16) db "TIFFANY@", TRAINERTYPE_MOVES db 31, CLEFAIRY, ENCORE, SING, DOUBLESLAP, MINIMIZE db -1 ; end ; PICNICKER (17) db "TIFFANY@", TRAINERTYPE_MOVES db 37, CLEFAIRY, ENCORE, DOUBLESLAP, MINIMIZE, METRONOME db -1 ; end ; PICNICKER (18) db "ERIN@", TRAINERTYPE_NORMAL db 32, PONYTA db 32, PONYTA db -1 ; end ; PICNICKER (19) db "TANYA@", TRAINERTYPE_NORMAL db 37, EXEGGUTOR db -1 ; end ; PICNICKER (20) db "TIFFANY@", TRAINERTYPE_MOVES db 20, CLEFAIRY, ENCORE, SING, DOUBLESLAP, MINIMIZE db -1 ; end ; PICNICKER (21) db "ERIN@", TRAINERTYPE_MOVES db 36, PONYTA, DOUBLE_TEAM, STOMP, FIRE_SPIN, SUNNY_DAY db 34, RAICHU, SWIFT, MUD_SLAP, QUICK_ATTACK, THUNDERBOLT db 36, PONYTA, DOUBLE_TEAM, STOMP, FIRE_SPIN, SUNNY_DAY db -1 ; end ; PICNICKER (22) db "LIZ@", TRAINERTYPE_NORMAL db 24, WEEPINBELL db 26, NIDORINO db 26, NIDOQUEEN db -1 ; end ; PICNICKER (23) db "LIZ@", TRAINERTYPE_MOVES db 30, WEEPINBELL, SLEEP_POWDER, POISONPOWDER, STUN_SPORE, SLUDGE_BOMB db 32, NIDOKING, EARTHQUAKE, DOUBLE_KICK, POISON_STING, IRON_TAIL db 32, NIDOQUEEN, EARTHQUAKE, DOUBLE_KICK, TAIL_WHIP, BODY_SLAM db -1 ; end ; PICNICKER (24) db "GINA@", TRAINERTYPE_NORMAL db 30, SKIPLOOM db 30, SKIPLOOM db 32, IVYSAUR db -1 ; end ; PICNICKER (25) db "GINA@", TRAINERTYPE_MOVES db 33, JUMPLUFF, STUN_SPORE, SUNNY_DAY, LEECH_SEED, COTTON_SPORE db 33, JUMPLUFF, SUNNY_DAY, SLEEP_POWDER, LEECH_SEED, COTTON_SPORE db 38, VENUSAUR, SOLARBEAM, RAZOR_LEAF, HEADBUTT, MUD_SLAP db -1 ; end ; PICNICKER (26) db "TIFFANY@", TRAINERTYPE_MOVES db 43, CLEFAIRY, METRONOME, ENCORE, MOONLIGHT, MINIMIZE db -1 ; end CamperGroup: ; CAMPER (1) db "JERRY@", TRAINERTYPE_NORMAL db 9, GEODUDE db 9, SANDSHREW db -1 ; end ExecutiveFGroup: ; EXECUTIVEF (1) db "EXECUTIVE@", TRAINERTYPE_MOVES db 32, ARBOK, WRAP, POISON_STING, BITE, GLARE db 32, VILEPLUME, ABSORB, SWEET_SCENT, SLEEP_POWDER, ACID db 32, MURKROW, PECK, PURSUIT, HAZE, NIGHT_SHADE db -1 ; end ; EXECUTIVEF (2) db "EXECUTIVE@", TRAINERTYPE_MOVES db 23, ARBOK, WRAP, LEER, POISON_STING, BITE db 23, GLOOM, ABSORB, SWEET_SCENT, SLEEP_POWDER, ACID db 25, MURKROW, PECK, PURSUIT, HAZE, NO_MOVE db -1 ; end SageGroup: ; SAGE (1) db "CHOW@", TRAINERTYPE_NORMAL db 3, BELLSPROUT db 3, BELLSPROUT db 3, BELLSPROUT db -1 ; end ; SAGE (2) db "NICO@", TRAINERTYPE_NORMAL db 3, BELLSPROUT db 3, BELLSPROUT db 3, BELLSPROUT db -1 ; end ; SAGE (3) db "JIN@", TRAINERTYPE_NORMAL db 6, BELLSPROUT db -1 ; end ; SAGE (4) db "TROY@", TRAINERTYPE_NORMAL db 7, BELLSPROUT db 7, HOOTHOOT db -1 ; end ; SAGE (5) db "JEFFREY@", TRAINERTYPE_NORMAL db 22, HAUNTER db -1 ; end ; SAGE (6) db "PING@", TRAINERTYPE_NORMAL db 16, GASTLY db 16, GASTLY db 16, GASTLY db 16, GASTLY db 16, GASTLY db -1 ; end ; SAGE (7) db "EDMOND@", TRAINERTYPE_NORMAL db 3, BELLSPROUT db 3, BELLSPROUT db 3, BELLSPROUT db -1 ; end ; SAGE (8) db "NEAL@", TRAINERTYPE_NORMAL db 6, BELLSPROUT db -1 ; end ; SAGE (9) db "LI@", TRAINERTYPE_NORMAL db 7, BELLSPROUT db 7, BELLSPROUT db 10, HOOTHOOT db -1 ; end ; SAGE (10) db "GAKU@", TRAINERTYPE_NORMAL db 32, NOCTOWL db 32, FLAREON db -1 ; end ; SAGE (11) db "MASA@", TRAINERTYPE_NORMAL db 32, NOCTOWL db 32, JOLTEON db -1 ; end ; SAGE (12) db "KOJI@", TRAINERTYPE_NORMAL db 32, NOCTOWL db 32, VAPOREON db -1 ; end MediumGroup: ; MEDIUM (1) db "MARTHA@", TRAINERTYPE_NORMAL db 18, GASTLY db 20, HAUNTER db 20, GASTLY db -1 ; end ; MEDIUM (2) db "GRACE@", TRAINERTYPE_NORMAL db 20, HAUNTER db 20, HAUNTER db -1 ; end ; MEDIUM (3) db "BETHANY@", TRAINERTYPE_NORMAL db 25, HAUNTER db -1 ; end ; MEDIUM (4) db "MARGRET@", TRAINERTYPE_NORMAL db 25, HAUNTER db -1 ; end ; MEDIUM (5) db "ETHEL@", TRAINERTYPE_NORMAL db 25, HAUNTER db -1 ; end ; MEDIUM (6) db "REBECCA@", TRAINERTYPE_NORMAL db 35, DROWZEE db 35, HYPNO db -1 ; end ; MEDIUM (7) db "DORIS@", TRAINERTYPE_NORMAL db 34, SLOWPOKE db 36, SLOWBRO db -1 ; end BoarderGroup: ; BOARDER (1) db "RONALD@", TRAINERTYPE_NORMAL db 24, SEEL db 25, DEWGONG db 24, SEEL db -1 ; end ; BOARDER (2) db "BRAD@", TRAINERTYPE_NORMAL db 26, SWINUB db 26, SWINUB db -1 ; end ; BOARDER (3) db "DOUGLAS@", TRAINERTYPE_NORMAL db 24, SHELLDER db 25, CLOYSTER db 24, SHELLDER db -1 ; end PokefanMGroup: ; POKEFANM (1) db "WILLIAM@", TRAINERTYPE_ITEM db 14, RAICHU, BERRY db -1 ; end ; POKEFANM (2) db "DEREK@", TRAINERTYPE_ITEM db 17, PIKACHU, BERRY db -1 ; end ; POKEFANM (3) db "ROBERT@", TRAINERTYPE_ITEM db 33, QUAGSIRE, BERRY db -1 ; end ; POKEFANM (4) db "JOSHUA@", TRAINERTYPE_ITEM db 23, PIKACHU, BERRY db 23, PIKACHU, BERRY db 23, PIKACHU, BERRY db 23, PIKACHU, BERRY db 23, PIKACHU, BERRY db 23, PIKACHU, BERRY db -1 ; end ; POKEFANM (5) db "CARTER@", TRAINERTYPE_ITEM db 29, BULBASAUR, BERRY db 29, CHARMANDER, BERRY db 29, SQUIRTLE, BERRY db -1 ; end ; POKEFANM (6) db "TREVOR@", TRAINERTYPE_ITEM db 33, PSYDUCK, BERRY db -1 ; end ; POKEFANM (7) db "BRANDON@", TRAINERTYPE_ITEM db 13, SNUBBULL, BERRY db -1 ; end ; POKEFANM (8) db "JEREMY@", TRAINERTYPE_ITEM db 28, MEOWTH, BERRY db 28, MEOWTH, BERRY db 28, MEOWTH, BERRY db -1 ; end ; POKEFANM (9) db "COLIN@", TRAINERTYPE_ITEM db 32, DELIBIRD, BERRY db -1 ; end ; POKEFANM (10) db "DEREK@", TRAINERTYPE_ITEM db 19, PIKACHU, BERRY db -1 ; end ; POKEFANM (11) db "DEREK@", TRAINERTYPE_ITEM db 36, PIKACHU, BERRY db -1 ; end ; POKEFANM (12) db "ALEX@", TRAINERTYPE_ITEM db 29, NIDOKING, BERRY db 29, SLOWKING, BERRY db 29, SEAKING, BERRY db -1 ; end ; POKEFANM (13) db "REX@", TRAINERTYPE_ITEM db 35, PHANPY, BERRY db -1 ; end ; POKEFANM (14) db "ALLAN@", TRAINERTYPE_ITEM db 35, TEDDIURSA, BERRY db -1 ; end KimonoGirlGroup: ; KIMONO_GIRL (1) db "NAOKO@", TRAINERTYPE_NORMAL db 20, SKIPLOOM db 20, VULPIX db 18, SKIPLOOM db -1 ; end ; KIMONO_GIRL (2) db "NAOKO@", TRAINERTYPE_NORMAL db 17, FLAREON db -1 ; end ; KIMONO_GIRL (3) db "SAYO@", TRAINERTYPE_NORMAL db 17, ESPEON db -1 ; end ; KIMONO_GIRL (4) db "ZUKI@", TRAINERTYPE_NORMAL db 17, UMBREON db -1 ; end ; KIMONO_GIRL (5) db "KUNI@", TRAINERTYPE_NORMAL db 17, VAPOREON db -1 ; end ; KIMONO_GIRL (6) db "MIKI@", TRAINERTYPE_NORMAL db 17, JOLTEON db -1 ; end TwinsGroup: ; TWINS (1) db "AMY & MAY@", TRAINERTYPE_NORMAL db 10, SPINARAK db 10, LEDYBA db -1 ; end ; TWINS (2) db "ANN & ANNE@", TRAINERTYPE_MOVES db 16, CLEFAIRY, GROWL, ENCORE, DOUBLESLAP, METRONOME db 16, JIGGLYPUFF, SING, DEFENSE_CURL, POUND, DISABLE db -1 ; end ; TWINS (3) db "ANN & ANNE@", TRAINERTYPE_MOVES db 16, JIGGLYPUFF, SING, DEFENSE_CURL, POUND, DISABLE db 16, CLEFAIRY, GROWL, ENCORE, DOUBLESLAP, METRONOME db -1 ; end ; TWINS (4) db "AMY & MAY@", TRAINERTYPE_NORMAL db 10, LEDYBA db 10, SPINARAK db -1 ; end ; TWINS (5) db "JO & ZOE@", TRAINERTYPE_NORMAL db 35, VICTREEBEL db 35, VILEPLUME db -1 ; end ; TWINS (6) db "JO & ZOE@", TRAINERTYPE_NORMAL db 35, VILEPLUME db 35, VICTREEBEL db -1 ; end ; TWINS (7) db "MEG & PEG@", TRAINERTYPE_NORMAL db 31, TEDDIURSA db 31, PHANPY db -1 ; end ; TWINS (8) db "MEG & PEG@", TRAINERTYPE_NORMAL db 31, PHANPY db 31, TEDDIURSA db -1 ; end ; TWINS (9) db "LEA & PIA@", TRAINERTYPE_MOVES db 35, DRATINI, THUNDER_WAVE, TWISTER, FLAMETHROWER, HEADBUTT db 35, DRATINI, THUNDER_WAVE, TWISTER, ICE_BEAM, HEADBUTT db -1 ; end ; TWINS (10) db "LEA & PIA@", TRAINERTYPE_MOVES db 38, DRATINI, THUNDER_WAVE, TWISTER, ICE_BEAM, HEADBUTT db 38, DRATINI, THUNDER_WAVE, TWISTER, FLAMETHROWER, HEADBUTT db -1 ; end PokefanFGroup: ; POKEFANF (1) db "BEVERLY@", TRAINERTYPE_ITEM db 14, SNUBBULL, BERRY db -1 ; end ; POKEFANF (2) db "RUTH@", TRAINERTYPE_ITEM db 17, PIKACHU, BERRY db -1 ; end ; POKEFANF (3) db "BEVERLY@", TRAINERTYPE_ITEM db 18, SNUBBULL, BERRY db -1 ; end ; POKEFANF (4) db "BEVERLY@", TRAINERTYPE_ITEM db 30, GRANBULL, BERRY db -1 ; end ; POKEFANF (5) db "GEORGIA@", TRAINERTYPE_ITEM db 23, SENTRET, BERRY db 23, SENTRET, BERRY db 23, SENTRET, BERRY db 28, FURRET, BERRY db 23, SENTRET, BERRY db -1 ; end ; POKEFANF (6) db "JAIME@", TRAINERTYPE_ITEM db 16, MEOWTH, BERRY db -1 ; end RedGroup: ; RED (1) db "RED@", TRAINERTYPE_MOVES db 81, PIKACHU, CHARM, QUICK_ATTACK, THUNDERBOLT, THUNDER db 73, ESPEON, MUD_SLAP, REFLECT, SWIFT, PSYCHIC_M db 75, SNORLAX, AMNESIA, SNORE, REST, BODY_SLAM db 77, VENUSAUR, SUNNY_DAY, GIGA_DRAIN, SYNTHESIS, SOLARBEAM db 77, CHARIZARD, FLAMETHROWER, WING_ATTACK, SLASH, FIRE_SPIN db 77, BLASTOISE, RAIN_DANCE, SURF, BLIZZARD, WHIRLPOOL db -1 ; end BlueGroup: ; BLUE (1) db "BLUE@", TRAINERTYPE_MOVES db 56, PIDGEOT, QUICK_ATTACK, WHIRLWIND, WING_ATTACK, MIRROR_MOVE db 54, ALAKAZAM, DISABLE, RECOVER, PSYCHIC_M, REFLECT db 56, RHYDON, FURY_ATTACK, SANDSTORM, ROCK_SLIDE, EARTHQUAKE db 58, GYARADOS, TWISTER, HYDRO_PUMP, RAIN_DANCE, HYPER_BEAM db 58, EXEGGUTOR, SUNNY_DAY, LEECH_SEED, EGG_BOMB, SOLARBEAM db 58, ARCANINE, ROAR, SWIFT, FLAMETHROWER, EXTREMESPEED db -1 ; end OfficerGroup: ; OFFICER (1) db "KEITH@", TRAINERTYPE_NORMAL db 17, GROWLITHE db -1 ; end ; OFFICER (2) db "DIRK@", TRAINERTYPE_NORMAL db 14, GROWLITHE db 14, GROWLITHE db -1 ; end GruntFGroup: ; GRUNTF (1) db "GRUNT@", TRAINERTYPE_NORMAL db 9, ZUBAT db 11, EKANS db -1 ; end ; GRUNTF (2) db "GRUNT@", TRAINERTYPE_NORMAL db 26, ARBOK db -1 ; end ; GRUNTF (3) db "GRUNT@", TRAINERTYPE_NORMAL db 25, GLOOM db 25, GLOOM db -1 ; end ; GRUNTF (4) db "GRUNT@", TRAINERTYPE_NORMAL db 21, EKANS db 23, ODDISH db 21, EKANS db 24, GLOOM db -1 ; end ; GRUNTF (5) db "GRUNT@", TRAINERTYPE_MOVES db 18, EKANS, WRAP, LEER, POISON_STING, BITE db 18, GLOOM, ABSORB, SWEET_SCENT, STUN_SPORE, SLEEP_POWDER db -1 ; end RocketAgentsGroup: ; RocketAgents (1) db "AGENTS@", TRAINERTYPE_NORMAL db 16, MANKEY db 16, RATICATE db -1 ; end
src/PJ/flic386p/libsrc/8514/mmmmblin.asm
AnimatorPro/Animator-Pro
119
177027
include a8514.i CGROUP group code code segment dword 'CODE' assume cs:CGROUP,ds:CGROUP ;void pj_8514_blitrect(Vscreen *source, Coor src_x, Coor src_y, ; Vscreen *dest, Coor dest_x, Coor dest_y, ; Coor width, Coor height); pj_8514_blitrect proc near public pj_8514_blitrect mbip struc mbi_ebp dd ? mbi_ret dd ? mbi_source dd ? mbi_sx dd ? mbi_sy dd ? mbi_dest dd ? mbi_dx dd ? mbi_dy dd ? mbi_width dd ? mbi_height dd ? mbip ends push ebp mov ebp,esp push ecx ;make sure GP is free WAITQ 8 ; v1.00 ;set up source x/y mov ecx,[ebp].mbi_source mov eax,[ebp].mbi_sx add eax,[ecx].vm_xcard mov dx,CUR_X_POS out dx,ax mov eax,[ebp].mbi_sy add eax,[ecx].vm_ycard mov dx,CUR_Y_POS out dx,ax ;set up dest x/y mov ecx,[ebp].mbi_dest mov eax,[ebp].mbi_dx add eax,[ecx].vm_xcard mov dx,DESTX_DIASTP out dx,ax mov eax,[ebp].mbi_dy add eax,[ecx].vm_ycard mov dx,DESTY_AXSTP out dx,ax mov eax,[ebp].mbi_width dec eax mov dx,MAJ_AXIS_PCNT out dx,ax mov eax,[ebp].mbi_height dec eax mov dx,MLTFUNC_CNTL out dx,ax ; mov ax,ALL_PLANE_CPY+MIX_SRC mov dx,FGRD_MIX out dx,ax ;mov ax,0c0f3h mov ax,WRITCMD or PLANAR or DRAWCMD or YMAJAXIS or COPY_RECT mov edx,[ebp].mbi_dx cmp [ebp].mbi_sx,edx jb testy or ax,INCX testy: mov edx,[ebp].mbi_dy cmp [ebp].mbi_sy,edx jb blitit or ax,INCY blitit: mov dx,COMMAND out dx,ax WAITQ 1 ; v1.00 ;set foreground mix back for faster put_dot mov ax,F_CLR_ACTIVE+MIX_SRC mov dx,FGRD_MIX out dx,ax pop ecx pop ebp ret pj_8514_blitrect endp code ends end
libsrc/_DEVELOPMENT/target/scz180/device/csio/sdcc/csio_sd_cs_lower.asm
Frodevan/z88dk
640
101872
<reponame>Frodevan/z88dk SECTION code_driver PUBLIC _sd_cs_lower EXTERN asm_sd_cs_lower ;Lower the SC130 SD card CS using the GPIO address ; ;input (H)L = SD CS selector of 0 or 1 ;uses AF ._sd_cs_lower pop af pop hl push hl push af jp asm_sd_cs_lower
src/tools/Dependency_Graph_Extractor/src/extraction-bodies_for_entries.adb
selroc/Renaissance-Ada
1
685
<filename>src/tools/Dependency_Graph_Extractor/src/extraction-bodies_for_entries.adb with Extraction.Node_Edge_Types; with Extraction.Utilities; package body Extraction.Bodies_For_Entries is use type LALCO.Ada_Node_Kind_Type; procedure Extract_Edges (Node : LAL.Ada_Node'Class; Graph : Graph_Operations.Graph_Context) is begin if Node.Kind = LALCO.Ada_Entry_Body then declare Entry_Body : constant LAL.Entry_Body := Node.As_Entry_Body; Entry_Decl : constant LAL.Basic_Decl := Entry_Body.P_Decl_Part; begin Graph.Write_Edge(Entry_Decl, Entry_Body, Node_Edge_Types.Edge_Type_Is_Implemented_By); end; elsif Node.Kind in LALCO.Ada_Accept_Stmt_Range then declare Accept_Stmt : constant LAL.Accept_Stmt := Node.As_Accept_Stmt; Task_Body : constant LAL.Basic_Decl := Utilities.Get_Parent_Basic_Decl(Accept_Stmt); Entry_Decl : constant LAL.Basic_Decl := Utilities.Get_Referenced_Decl(Accept_Stmt.F_Name); begin Graph.Write_Edge(Entry_Decl, Task_Body, Node_Edge_Types.Edge_Type_Is_Implemented_By); end; end if; end Extract_Edges; end Extraction.Bodies_For_Entries;
programs/oeis/017/A017378.asm
karttu/loda
1
96028
; A017378: a(n) = (10*n + 9)^2. ; 81,361,841,1521,2401,3481,4761,6241,7921,9801,11881,14161,16641,19321,22201,25281,28561,32041,35721,39601,43681,47961,52441,57121,62001,67081,72361,77841,83521,89401,95481,101761,108241,114921,121801,128881,136161,143641,151321,159201,167281,175561,184041,192721,201601,210681,219961,229441,239121,249001,259081,269361,279841,290521,301401,312481,323761,335241,346921,358801,370881,383161,395641,408321,421201,434281,447561,461041,474721,488601,502681,516961,531441,546121,561001,576081,591361,606841,622521,638401,654481,670761,687241,703921,720801,737881,755161,772641,790321,808201,826281,844561,863041,881721,900601,919681,938961,958441,978121,998001,1018081,1038361,1058841,1079521,1100401,1121481,1142761,1164241,1185921,1207801,1229881,1252161,1274641,1297321,1320201,1343281,1366561,1390041,1413721,1437601,1461681,1485961,1510441,1535121,1560001,1585081,1610361,1635841,1661521,1687401,1713481,1739761,1766241,1792921,1819801,1846881,1874161,1901641,1929321,1957201,1985281,2013561,2042041,2070721,2099601,2128681,2157961,2187441,2217121,2247001,2277081,2307361,2337841,2368521,2399401,2430481,2461761,2493241,2524921,2556801,2588881,2621161,2653641,2686321,2719201,2752281,2785561,2819041,2852721,2886601,2920681,2954961,2989441,3024121,3059001,3094081,3129361,3164841,3200521,3236401,3272481,3308761,3345241,3381921,3418801,3455881,3493161,3530641,3568321,3606201,3644281,3682561,3721041,3759721,3798601,3837681,3876961,3916441,3956121,3996001,4036081,4076361,4116841,4157521,4198401,4239481,4280761,4322241,4363921,4405801,4447881,4490161,4532641,4575321,4618201,4661281,4704561,4748041,4791721,4835601,4879681,4923961,4968441,5013121,5058001,5103081,5148361,5193841,5239521,5285401,5331481,5377761,5424241,5470921,5517801,5564881,5612161,5659641,5707321,5755201,5803281,5851561,5900041,5948721,5997601,6046681,6095961,6145441,6195121,6245001 mul $0,10 add $0,9 pow $0,2 mov $1,$0
oeis/001/A001254.asm
neoneye/loda-programs
11
6361
; A001254: Squares of Lucas numbers. ; Submitted by <NAME>(s2.) ; 4,1,9,16,49,121,324,841,2209,5776,15129,39601,103684,271441,710649,1860496,4870849,12752041,33385284,87403801,228826129,599074576,1568397609,4106118241,10749957124,28143753121,73681302249,192900153616,505019158609,1322157322201,3461452808004,9062201101801,23725150497409,62113250390416,162614600673849,425730551631121,1114577054219524,2918000611027441,7639424778862809,20000273725560976,52361396397820129,137083915467899401,358890350005878084,939587134549734841,2459871053643326449 mov $2,1 mov $4,2 lpb $0 sub $0,1 mov $3,$4 mov $4,$2 add $2,$3 lpe pow $4,2 mov $0,$4
libsrc/target/sam/graphics/pixeladdress_MODE2.asm
w5Mike/z88dk
0
27248
SECTION code_graphics PUBLIC pixeladdress_MODE2 EXTERN SCREEN_BASE ; Entry: h = y ; l = x ; Exit: hl = addr ; a = pixel offset ; z = pixel @1000000 pixeladdress_MODE2: ld a,l ld l,h ld h,0 add hl,hl ;x32 add hl,hl add hl,hl add hl,hl add hl,hl ld c,a srl c srl c srl c ld b,+(SCREEN_BASE / 256) add hl,bc and 7 ret
hm4_Xiaojie_Zhu.asm
XiaojieZhuForThree/Mips_Codes
0
245426
.data fileName: .asciiz "homework4.txt" textmessage: .asciiz "The quick brown fox jumped over the lazy river." inputBuffer: .space 100 parityBuffer: .space 100 outputOK: .asciiz "The data is intact." outputCorrupt: .asciiz "The data has been corrupted!" .text open_file: li $v0, 13 # created a new file named "homework4.txt" la $a0, fileName li $a1, 1 li $a2, 0 syscall move $s6, $v0 write_file: li $v0, 15 # write the sentence "The quick brown fox jumped over the lazy river." move $a0, $s6 # to the newly created txt file. la $a1, textmessage li $a2, 47 syscall exit_file: li $v0, 16 # exit the file move $a0, $s6 syscall open_created: li $v0, 13 # open the created file la $a0, fileName li $a1, 0 li $a2, 0 syscall move $s6, $v0 read_file: li $v0, 14 # and read the contents of the txt to the inputBuffer move $a0, $s6 la $a1, inputBuffer li $a2, 100 syscall exit_it: li $v0, 16 # after reading the contents, close the file safely move $a0, $s6 syscall getReady: # load both the inputBuffer and the parityBuffer la $t0, inputBuffer la $t1, parityBuffer li $s7, 2 # set 2 as a dividend for checking the odd/even addi $s2, $zero, 7 # used to count the number of loops executed circle: lbu $t2, 0($t0) # determine each byte in the inputBuffer for parity, beq $t2, $zero, checkReady # when reaching the end, start checking the parity setParity: add $s1, $zero, $zero # used to record the number of 1s add $s0, $t2, $zero # copy the byte to $s0 add $s3, $zero, $zero # set up a counter count: beq $s3, $s2, checkOdds # traverse each bit of the byte to determine if it's 1 or 0, and andi $s4, $s0, 1 # record the number of 1s. add $s1, $s1, $s4 addi $s3, $s3, 1 srl $s0, $s0, 1 j count # keep the loop until after 7 times. checkOdds: divu $s1, $s7 # divide the number of 1s by 2 mfhi $s6 bne $s6, $zero, addnumber # and ch if the remainder is 1 or 0 addi $s0, $t2, 0 j writeBuffer addnumber: addi $s0, $t2, 128 # if 1, add 1 to the 7th bit, else don't change writeBuffer: sb $s0, 0($t1) # store the 8-bit data to the new buffer after adding parity addOne: addi $t0, $t0, 1 addi $t1, $t1, 1 j circle checkReady: # after set all the parity and store it to the new data, check if la $t1, parityBuffer # the parity is correct addi $s2, $zero, 8 # used to count the number of loops executed for each byte checkParity: lbu $t2, ($t1) # check the parity byte by byte beq $t2, $zero, okay # when reaching the finally loop, means the data is good checkBegins: add $s1, $zero, $zero # used to record the number of 1s add $s0, $t2, $zero # copy the byte to $s0 add $s3, $zero, $zero # set up a counter countOne: beq $s3, $s2, checkValid # when reach 8 loops, determine the odd/even of the 1s andi $s4, $s0, 1 add $s1, $s1, $s4 addi $s3, $s3, 1 srl $s0, $s0, 1 j countOne checkValid: # if the 1s are odd, means the data has been compromised, otherwise divu $s1, $s7 # the data is good mfhi $s6 bne $s6, $zero, corrupted addi $t1, $t1, 1 j checkParity okay: li $v0, 4 # used to output the results la $a0, outputOK syscall j Exit corrupted: li $v0, 4 la $a0, outputCorrupt syscall Exit: # used to exit the file li $v0, 10 syscall # TestRuns: # 1. First, do not manually set the breakpoint and run the program: # The data is intact. # -- program is finished running -- # 2. Second, we set a breakpoint at checkReady(line 88). Then change the data manually, in my case, # I changed the data 0x65f66fa0 to 0x75f66fa0, which will change the number of 1s, and thus the program will print: # The data has been corrupted! # -- program is finished running --
malban/Release/VRelease/Release.History/VRelease_2017_03_28/objects.asm
mikepea/vectrex-playground
5
169894
<gh_stars>1-10 u_offset1 = -TYPE ; behaviour offset is determined by next structure element ; all following objects "inherit" from defined Objectstruct ; all vars after "NEXT_OBJECT" can be different for each of the objects ; ; all definitions with the same name must be at the same structure position struct LetterObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds SPACE_TO_PREVIOUS,2 ; with what value does the animation get updated ds PREVIOUS_LETTER,2 ; after how many rounds the movement updates (0 = each, 1 = every second etc) ds DIF_DELAY, 1 ; #noDoubleWarn end struct struct DragonObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type, also holds in case of dragon whether dragon was hit befor! ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds DRAGON_COUNTER,1 ; DRAGON TICK_COUNTER - on a different position, therfor named differently ; lower nibble is counter for scale move (inward) ; higher nibble is counter for angle move ds CHILD_1, 2 ds CHILD_2, 2 ds filler, 0 ; #noDoubleWarn end struct ; struct DragonChildObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds WIGGLE,1 ds WIGGLE_DIRECTION, 1 ; ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds ANGLE_OFFSET,2 ; two byte for easier adding ds DRAGON, 2 ; my parent - I have to tell him when I die ds SCALE_OFFSET, 1 ds filler, 0 ; #noDoubleWarn end struct ; struct XObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds ANIM_COUNTER,1 ; with what value does the animation get updated ds TICK_COUNTER,1 ; after how many rounds the movement updates (0 = each, 1 = every second etc) ds SCALE_DELTA,1 ; with what value does the movement get updated (1-4)? ds filler, 2 ; #noDoubleWarn end struct ; struct ShotObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds filler, 1 ; #noDoubleWarn ds TICK_COUNTER,1 ; after how many rounds the movement updates (0 = each, 1 = every second etc) ds SCALE_DELTA,1 ; with what value does the movement get updated (1-4)? ds filler, 2 ; #noDoubleWarn end struct ; struct HunterObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds filler, 1 ; #noDoubleWarn ds TICK_COUNTER,1 ; after how many rounds the movement updates (0 = each, 1 = every second etc) ds SCALE_DELTA,1 ; with what value does the movement get updated (1-4)? ds filler, 2 ; #noDoubleWarn end struct ; struct BomberObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds ANIM_COUNTER,1 ; with what value does the animation get updated ds ANGLE_TICK_COUNTER,1 ; after how many rounds the movement updates (0 = each, 1 = every second etc) ds SHOT_COUNTER_RESET,1 ; after how many ticks will the counter be resetd next time ds SHOT_COUNTER,1 ; after how many ticks do I shoot again? ds ANGLE_DELTA, 1 ; add to angle each countdown ds filler, 0 ; #noDoubleWarn end struct ; struct StarletObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds ANIM_COUNTER,1 ; jmp to current draw routine ds SCORE_COUNTER, 1 ; next time I spawn a bonus score ds SCORE_COUNT, 1 ; what is the current bonus score (2-255) ds I_AM_STAR_NO, 1 ; what number of star am I (0-2) ds filler, 0 ; #noDoubleWarn end struct ; struct ExplosionObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds EXPLOSION_SCALE,1 ds filler, 4 ; #noDoubleWarn end struct ; struct ScoreObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds SCORE_COUNTDOWN,1 ; how long will I be displayed (countdon to zero) ds filler, 4 ; #noDoubleWarn end struct ; struct ScoreXObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds SCORE_POINTER_1,2 ; current list vectorlist of first score digit ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds SCORE_COUNTDOWN,1 ; how long will I be displayed (countdon to zero) DS SCORE_POINTER_2,2 ; current list vectorlist of second score digit DS SCORE_POINTER_3,2 ; current list vectorlist of third score digit ds filler, 0 ; #noDoubleWarn end struct ; struct TimerObjectStruct ds Y_POS,1 ; current position ds X_POS,1 ds CURRENT_LIST,2 ; current list vectorlist of first score digit ds DDRA,1 ds SCALE,1 ; scale to position the object ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds ANGLE,2 ; if angle base, angle in degree *2 ds NEXT_OBJECT,2 ; positive = end of list ds SECOND_COUNTER,1 ; initialized with 50 again and again and countdown ds filler, 4 ; #noDoubleWarn end struct ; struct StarfieldObjectStruct ds POS_1,2 ; current position ds SCALE_1,1 ds POS_2,2 ; current position ds SCALE_2,1 ds BEHAVIOUR,2 ds TYPE,1 ; enemy type ds POS_3,2 ; current position ds NEXT_OBJECT,2 ; positive = end of list ds POS_4,2 ; current position ds SCALE_4,1 ds SCALE_3, 1 ; #noDoubleWarn end struct code ; all behaviour routines leave ; with u pointed to the next object structure ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; GENERAL Object functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; UPDATE_EMPTY_LIST macro dec object_count ldy list_empty_head ; set u free, as new free head sty NEXT_OBJECT,x ; load to u the next linked list element stx list_empty_head endm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in u pointer to the object that must be removed ; destroys x, y ; sets u to pointer of next object in linked list removeObject: ;#isfunction ; since often called from "in move" we disable the move! ldd #$0800 sta VIA_t1_cnt_lo ; disable ramping stb VIA_t1_cnt_hi ; disable ramping MY_MOVE_TO_B_END ; end a move to _ZERO_VECTOR_BEAM leax u_offset1,u ; x -> pointer object strutire (correction of offset) ; leax ,u ; x -> pointer object strutire (correction of offset) cmpx list_objects_head bne was_not_first_re was_first_re ldu NEXT_OBJECT,x ; u pointer to next objext stu list_objects_head bpl was_first_and_last_re was_first_not_last_re UPDATE_EMPTY_LIST pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) was_first_and_last_re stu list_objects_tail UPDATE_EMPTY_LIST pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) was_not_first_re ; find previous, go thru all objects from first and look where "I" am the next... ldy list_objects_head try_next_re cmpx NEXT_OBJECT,y beq found_next_switch_re ldy NEXT_OBJECT,y bra try_next_re found_next_switch_re ldu NEXT_OBJECT,x ; u pointer to next objext stu NEXT_OBJECT,y bpl was_not_first_but_last_re was_not_first_and_not_last_re UPDATE_EMPTY_LIST pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) was_not_first_but_last_re: sty list_objects_tail UPDATE_EMPTY_LIST pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; removeObject_rts: ;#isfunction leax ,u ; x -> pointer object strutire (correction of offset) cmpx list_objects_head bne was_not_first_re_rts was_first_rts: ldu NEXT_OBJECT,x ; u pointer to next objext stu list_objects_head bpl was_first_and_last_rts was_first_not_last_rts: UPDATE_EMPTY_LIST rts was_first_and_last_rts: stu list_objects_tail UPDATE_EMPTY_LIST rts was_not_first_re_rts ldy list_objects_head try_next_re_rts cmpx NEXT_OBJECT,y beq found_next_switch_re_rts ldy NEXT_OBJECT,y bra try_next_re_rts found_next_switch_re_rts ldu NEXT_OBJECT,x ; u pointer to next objext stu NEXT_OBJECT,y bpl was_not_first_but_last_rts was_not_first_and_not_last_rts UPDATE_EMPTY_LIST rts was_not_first_but_last_rts: sty list_objects_tail UPDATE_EMPTY_LIST rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; new list object to U ; leaves with flags set to result ; (positive = not successfull) ROM ; negative = successfull RAM ; destroys d, u , x newObject ;#isfunction ldu list_empty_head bpl cs_done_no ; we don't have any spare objects -> go out ; set the new empty head ldd NEXT_OBJECT,u std list_empty_head ; load last of current object list ldx list_objects_tail ; of our new object, that last object is the previous ; stx PREVIOUS_OBJECT,u bpl no_next_no ; the last object was 0, so we do net set a next there ; of the last object, the new object is the next object stu NEXT_OBJECT,x bra was_not_only_no no_next_no: stu list_objects_head ; if there was no last, than also no first -> therefor set new object as head was_not_only_no: ; the next object of our current object is null, since we are last ldd #PC_MAIN std NEXT_OBJECT,u ; our new object is the new tail inc object_count stu list_objects_tail cs_done_no rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; SPECIFIC Object functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ****************************** ***** OBJECT X *************** ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; X SPAWN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in x pointer to new object structure that should be filled with object ; data spawnX: ; #isfunction bitb #ALLOW_X bne spx_allowed clr spawn_timer ; check spawn next round again jmp returnSpawnNotAllowed spx_allowed: bsr newObject bpl cs_done_no leax ,u ; pointer to new object PLAY_SFX SpawnX_Sound ; copy and initialze new enemy lda #TYPE_X sta TYPE, x lda X_add_delay sta TICK_COUNTER, x lda X_addi sta SCALE_DELTA, x ldd #xBehaviour std BEHAVIOUR,x lda #X_ANIM_DELAY ; anim reset sta ANIM_COUNTER, x ldd #enemyXList_0 ; vectorlist std CURRENT_LIST,x lda #$ff sta DDRA,x ; performance dummy lda #spawn_max sta SCALE,x ; start with max scale (for xEnemy) lda my_random2 anda #%01111111 ; in a random number between 0 - 127 tfr a, b clra MY_LSL_D ; double it tfr d,u leau d,u leau d,u ; u = 0 - 720 -> spawning angle of our new enemy stu ANGLE,x ; store current angle of object ldd #circle leau d,u ; u pointer to spwan angle coordinates ldd ,u std Y_POS,x ; save start pos rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; behaviours control (action) and draw all objects ; each object type has an individual behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; values are set from "u" list as: ; pulu pc,d,x,y ; (D = y,x, X = vectorlist, Y = DDRA+Scale) xBehaviour ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START lda SCALE+u_offset1,u ; load current scale to a - for later calcs cmpa #$80 bhi noMusic_xb1 jsr [inMovePointer] lda SCALE+u_offset1,u noMusic_xb1 dec TICK_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_scale_update_xb ; if not, scale will not be updated ldb X_add_delay ; otherwise reset the delay counter for scale update (this is global now, should I use that from the structure?) stb TICK_COUNTER+u_offset1, u ; store it suba SCALE_DELTA+u_offset1, u ; and actually descrease the scale with the "decrease" value bcs die_xb ; if below zero, than base reaches cmpa #BASE_SCALE+3 ; if lower base scale, than also dead bhi base_not_reached ; if we reached the base - ; a) moveto was SMALL - finished anyway ; b) not interested in move - nothing will be drawn anymore! ; MY_MOVE_TO_B_END die_xb ; cancle move jmp gameOver ; if base was hit -> game over base_not_reached: sta SCALE+u_offset1,u ; store the calculated scale (used next round) no_scale_update_xb: dec ANIM_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_anim_update_xb ; if not, scale will not be updated lda #X_ANIM_DELAY ; anim reset sta ANIM_COUNTER+u_offset1, u ldd CURRENT_LIST+u_offset1,u addd #(enemyXList_1-enemyXList_0) cmpd #(enemyXList_3+(enemyXList_1-enemyXList_0)) bne not_last_anim_xb ldd #enemyXList_0 not_last_anim_xb: std CURRENT_LIST+u_offset1,u no_anim_update_xb: ldu NEXT_OBJECT+u_offset1,u ; preload next user stack lda #6 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$5f ; intensity MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr myDraw_VL_mode _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ***** OBJECT HUNTER ********** ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Hunter SPAWN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in x pointer to new object structure that should be filled with object ; data spawnHunter: ; #isfunction bitb #ALLOW_HUNTER bne sph_allowed clr spawn_timer ; check spawn next round again jmp returnSpawnNotAllowed sph_allowed: jsr newObject lbpl cs_done_no leax ,u ; pointer to new object PLAY_SFX SpawnHunter_Sound ; copy and initialze new enemy lda #TYPE_HUNTER sta TYPE, x lda Hunter_add_delay sta TICK_COUNTER, x lda Hunter_addi sta SCALE_DELTA, x ldd #hunterBehaviour std BEHAVIOUR,x lda #$ff sta DDRA,x ; performance dummy lda #spawn_max sta SCALE,x ; start with max scale (for xEnemy) ldb my_random2 andb #%01111111 ; in a random number between 0 - 127 clra cmpd #120 blt noMax_dh subd #120 ; following calculates the correct angle vectorlist for the hunter noMax_dh MY_LSL_D ; double it tfr d,u leau d,u leau d,u ; u = 0 - 720 -> spawning angle of our new enemy leau 31,u ; u = 0 - 720 -> spawning angle of our new enemy tfr u,d MY_LSR_D MY_LSR_D MY_LSR_D MY_LSR_D MY_LSR_D ; angle / 32 MY_LSL_D ; *2 ldu #HunterList leau d,u ldu ,u stu CURRENT_LIST,x MY_LSL_D ; *2 MY_LSL_D ; *2 MY_LSL_D ; *2 MY_LSL_D ; *2 tfr d,u stu ANGLE,x ; store current angle of object ldd #circle leau d,u ; u pointer to spwan angle coordinates ldd ,u std Y_POS,x ; save start pos rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; behaviours control (action) and draw all objects ; each object type has an individual behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; values are set from "u" list as: ; pulu pc,d,x,y ; (D = y,x, X = vectorlist, Y = DDRA+Scale) hunterBehaviour ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START lda SCALE+u_offset1,u ; load current scale to a - for later calcs dec TICK_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_scale_update_hb ; if not, scale will not be updated ldb Hunter_add_delay ; otherwise reset the delay counter for scale update (this is global now, should I use that from the structure?) stb TICK_COUNTER+u_offset1, u ; store it suba SCALE_DELTA+u_offset1, u ; and actually descrease the scale with the "decrease" value bcs die_hb ; if below zero, than base reaches cmpa #BASE_SCALE+3 ; if lower base scale, than also dead bhi base_not_reached_hb ; bcc base_not_reached ; if the decreas generated an overflow - than we reached the base (scale below zero) ; if we reached the base - ; a) moveto was SMALL - finished anyway ; b) not interested in move - nothing will be drawn anymore! ; MY_MOVE_TO_B_END die_hb ; cancle move jmp gameOver ; if base was hit -> game over base_not_reached_hb: sta SCALE+u_offset1,u ; store the calculated scale (used next round) no_scale_update_hb: ldu NEXT_OBJECT+u_offset1,u ; preload next user stack ldy ,x++ ; load offset of vector list draw leay >(unloop_start_addressSub+LENGTH_OF_HEADER),y ; lda #$5f ; intensity MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr entry_optimized_draw_mvlc_unloop ldd #$cc98 sta <VIA_cntl ; 22 cycles from switch on ZERO disabled, and BLANK enabled STb <VIA_aux_cntl ; pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ***** OBJECT HIDDEN X ******** ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; HIDDEN X SPAWN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in x pointer to new object structure that should be filled with object ; data spawnHiddenX: ; #isfunction bitb #ALLOW_HIDDEN_X bne sphx_allowed clr spawn_timer ; check spawn next round again jmp returnSpawnNotAllowed sphx_allowed: jsr newObject lbpl cs_done_no leax ,u ; pointer to new object PLAY_SFX SpawnX_Sound ; copy and initialze new enemy lda #TYPE_HIDDEN_X sta TYPE, x lda HX_add_delay sta TICK_COUNTER, x lda HX_addi sta SCALE_DELTA, x ldd #hiddenXBehaviour std BEHAVIOUR,x lda #X_ANIM_DELAY ; anim reset sta ANIM_COUNTER, x ldd #enemyXList_0 ; vectorlist std CURRENT_LIST,x lda #$ff sta DDRA,x ; performance dummy lda #spawn_max sta SCALE,x ; start with max scale (for xEnemy) lda my_random anda #%01111111 ; in a random number between 0 - 127 tfr a, b clra MY_LSL_D ; double it tfr d,u leau d,u leau d,u ; u = 0 - 720 -> spawning angle of our new enemy stu ANGLE,x ; store current angle of object ldd #circle leau d,u ; u pointer to spwan angle coordinates ldd ,u std Y_POS,x ; save start pos rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; behaviours control (action) and draw all objects ; each object type has an individual behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; values are set from "u" list as: ; pulu pc,d,x,y ; (D = y,x, X = vectorlist, Y = DDRA+Scale) hiddenXBehaviour ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START lda SCALE+u_offset1,u cmpa #$80 bhi noMusic_hxb1 jsr [inMovePointer] noMusic_hxb1 dec ANIM_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_anim_update_hxb ; if not, scale will not be updated lda #X_ANIM_DELAY ; anim reset sta ANIM_COUNTER+u_offset1, u ldd CURRENT_LIST+u_offset1,u addd #(enemyXList_1-enemyXList_0) cmpd #(enemyXList_3+(enemyXList_1-enemyXList_0)) bne not_last_anim_hxb ldd #enemyXList_0 not_last_anim_hxb: std CURRENT_LIST+u_offset1,u no_anim_update_hxb: lda SCALE+u_offset1,u ; load current scale to a - for later calcs dec TICK_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_scale_update_hxb ; if not, scale will not be updated ldb HX_add_delay ; otherwise reset the delay counter for scale update (this is global now, should I use that from the structure?) stb TICK_COUNTER+u_offset1, u ; store it suba SCALE_DELTA+u_offset1, u ; and actually descrease the scale with the "decrease" value bcs die_hxb ; if below zero, than base reaches cmpa #BASE_SCALE+3 ; if lower base scale, than also dead bhi base_not_reached_hxb ; bcc base_not_reached ; if the decreas generated an overflow - than we reached the base (scale below zero) ; if we reached the base - ; a) moveto was SMALL - finished anyway ; b) not interested in move - nothing will be drawn anymore! ; MY_MOVE_TO_B_END die_hxb ; cancle move jmp gameOver ; if base was hit -> game over base_not_reached_hxb: sta SCALE+u_offset1,u ; store the calculated scale (used next round) no_scale_update_hxb: ldu NEXT_OBJECT+u_offset1,u ; preload next user stack bita #$80 beq go_on_int_hxb clra bra no_int_hxb go_on_int_hxb nega adda #$8f bpl no_int_hxb suba #$10 no_int_hxb: ldb #6 stb VIA_t1_cnt_lo ; to timer t1 (lo= MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr myDraw_VL_mode _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ***** EXPLOSION ************** ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; explosionBehaviour ;#isfunction sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START ; move to last know position of object lda SCALE+u_offset1,u cmpa #$80 bhi noMusic_eb1 jsr [inMovePointer] noMusic_eb1 lda EXPLOSION_SCALE+u_offset1,u inca inca sta EXPLOSION_SCALE+u_offset1,u adda explosionActiveCounter ; trick that not all explosion "die" in the same round - saves cleanup time ; also - the more explosions, the less far they reach :-) cmpa explosionMax ble explosion_alive_eb lda explosionMax adda #5 sta explosionMax dec explosionActiveCounter jmp removeObject explosion_alive_eb: sta VIA_t1_cnt_lo ; explosion scale ldx #rotList ; reuse of the rotation list of shield/base lda ,x+ ; get count of vectors sta tmp_count2 lda #$7f ; explosions are bright! ldu NEXT_OBJECT+u_offset1,u ; correct U for going out later MY_MOVE_TO_B_END ; end a move to _INTENSITY_A next_edd: ldd ,x++ ; load the corners of the polygon MY_MOVE_TO_D_START_NT ; move to the corner, and draw a dot at every corner lda #$ff ; preload shift MY_MOVE_TO_B_END ; end a move to STA <VIA_shift_reg ; Store in VIA shift register ; delay for dot dwell CLR <VIA_shift_reg ; Blank beam in VIA shift register dec tmp_count2 ; check if vector count finished bpl next_edd ; if not - draw next dot done_edd: _ZERO_VECTOR_BEAM ; nop 20 pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ****************************** ***** SCORE ****************** ****************************** scoreBehaviour ;#isfunction sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) MY_MOVE_TO_D_START cmpy ddra_scale_compare lbhi removeObject ; if score scale is higher than max shield - don't bother displaying it lda SCALE+u_offset1,u cmpa #$80 bhi noMusic_ssb1 jsr [inMovePointer] noMusic_ssb1 lda SCORE_COUNTDOWN+u_offset1,u inca sta SCORE_COUNTDOWN+u_offset1,u cmpa score_display_time lbhi removeObject lda RecalCounterLow bita #$01 beq noAdd_sb inc SCALE+u_offset1,u noAdd_sb: lda #3 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$5f ldu NEXT_OBJECT+u_offset1,u MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr myDraw_VL_mode _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ***** SCORE X***************** ****************************** ; special ; the X vectorlist(s) ; are generated in move to scoreXBehaviour ;#isfunction sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) MY_MOVE_TO_D_START cmpy ddra_scale_compare lbhi removeObject ; if score scale is higher than max shield - don't bother displaying it lda SCORE_COUNTDOWN+u_offset1,u inca sta SCORE_COUNTDOWN+u_offset1,u cmpa score_display_time lbhi removeObject lda RecalCounterLow bita #$01 beq noAdd_sxb inc SCALE+u_offset1,u noAdd_sxb: lda #3 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$5f MY_MOVE_TO_B_END ; end a move to _INTENSITY_A ; generate display from score: SCORE_TO_DISPLAY ldx SCORE_POINTER_3+u_offset1,u beq not_3_score_xb jsr myDraw_VL_mode not_3_score_xb ldx SCORE_POINTER_2+u_offset1,u beq not_2_score_xb jsr myDraw_VL_mode not_2_score_xb ldx SCORE_POINTER_1+u_offset1,u jsr myDraw_VL_mode ldu NEXT_OBJECT+u_offset1,u _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ***** OBJECT STARLET ********* ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; STARTLET SPAWN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in x pointer to new object structure that should be filled with object ; data spawnStarlet: ; #isfunction bitb #ALLOW_STAR bne sps_allowed clr spawn_timer ; check spawn next round again jmp returnSpawnNotAllowed sps_allowed: jsr newObject lbpl cs_done_no leax ,u ; pointer to new object PLAY_SFX SpawnX_Sound ; copy and initialze new enemy lda #TYPE_STARLET sta TYPE, x ldd #starletBehaviour std BEHAVIOUR,x ldd #StarletList_0 ; vectorlist std CURRENT_LIST,x lda #STARLET_ANIM_DELAY ; anim reset sta ANIM_COUNTER,x lda #$ff sta DDRA,x ; performance dummy lda #STAR_SCALE sta SCALE,x ; start with max scale (for xEnemy) lda #STARLET_SCORE_DELAY sta SCORE_COUNTER,x lda #STARLET_START_SCORE sta SCORE_COUNT,x lda star_active_flag bita #$01 beq i_am_0 bita #$02 beq i_am_1 i_am_2: ora #$04 sta star_active_flag lda SCALE,x adda #15 -5 sta SCALE,x lda #2 sta I_AM_STAR_NO,x bra my_flag_set_ss i_am_1: ora #$02 sta star_active_flag lda SCALE,x suba #15 sta SCALE,x lda #1 sta I_AM_STAR_NO,x bra my_flag_set_ss i_am_0: ora #$01 sta star_active_flag lda #0 sta I_AM_STAR_NO,x my_flag_set_ss: ; in a my star count. flags should be set ; redundant test ; slightly random angle +- (0-31) ldb my_random2 lsrb lsrb lsrb tsta beq storeStarAngle_ss notFirstStar_ss: cmpa #1 bne notSecondStar_ss ; addb #120 ; addb #150 bra storeStarAngle_ss notSecondStar_ss: addb #90 storeStarAngle_ss clra tfr d,u ; angle from 00 to 720 leau d,u cmpu #720 blt not_oob1_ss leau -720,u not_oob1_ss: stu ANGLE,x ; store current angle of object ldd starletAngle leau d,u cmpu #720 blt not_oob_ss leau -720,u not_oob_ss: ldd #circle leau d,u ; u pointer to spwan angle coordinates ldd ,u std Y_POS,x ; save start pos ; reset quick score math lda I_AM_STAR_NO,x lsla lsla ; times 4 ldu #star_0_score leau a,u ldd #0 std ,u++ lda #STARLET_START_SCORE sta ,u inc starletCount rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; behaviours control (action) and draw all objects ; each object type has an individual behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; values are set from "u" list as: ; pulu pc,d,x,y ; (D = y,x, X = vectorlist, Y = DDRA+Scale) starletBehaviour ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START ldy ANGLE+u_offset1,u ; load current scale to a - for later calcs ldd starletAngle leay d,y cmpy #720 blt not_oob_sb leay -720,y not_oob_sb ldd #circle leay d,y ; ldd ,y std Y_POS+u_offset1,u ; save pos no_angle_update_sb: dec ANIM_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_anim_update_sb ; if not, scale will not be updated lda #STARLET_ANIM_DELAY ; anim reset sta ANIM_COUNTER+u_offset1, u ldd CURRENT_LIST+u_offset1,u addd #(StarletList_1-StarletList_0) cmpd #(StarletList_10+(StarletList_1-StarletList_0)) bne not_last_anim_sb ldd #StarletList_0 not_last_anim_sb: std CURRENT_LIST+u_offset1,u no_anim_update_sb: dec SCORE_COUNTER+u_offset1, u bpl no_score_update_sb lda #STARLET_SCORE_DELAY sta SCORE_COUNTER+u_offset1, u ; following code adds two to the current starlet score ; and correct the csa score pointers lda SCORE_COUNT+u_offset1, u pshs x,u adda #2 bcs abort_new_new_score_sb ; if new score is higher than a "digit" we have to check following digits sta SCORE_COUNT+u_offset1, u lda I_AM_STAR_NO+u_offset1, u lsla lsla ; times 4 ldx #star_0_score adda #2 leax a,x ; in x now pointer to lowest csa score lda ,x inca inca cmpa #9 bls score_ok suba #10 sta ,x lda ,-x inca cmpa #9 bls score_ok suba #10 sta ,x lda ,-x inca score_ok: sta ,x ; pointer x = ; hundreds (0,1,2) ; tens (0-9) ; singles (0-9) abort_new_new_score_sb ; build a new scoreX object jsr buildscoreX puls x,u no_score_update_sb ldu NEXT_OBJECT+u_offset1,u ; preload next user stack lda #3 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$5f ; intensity ldy ,x++ ; load offset of vector list draw leay >(unloop_start_addressSub+LENGTH_OF_HEADER),y ; MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr entry_optimized_draw_mvlc_unloop ldd #$cc98 sta <VIA_cntl ; 22 cycles from switch on ZERO disabled, and BLANK enabled STb <VIA_aux_cntl ; pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ****************************** ***** OBJECT BOMBER ********** ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Bomber SPAWN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in x pointer to new object structure that should be filled with object ; data spawnBomber: ; #isfunction bitb #ALLOW_BOMBER bne spb_allowed clr spawn_timer ; check spawn next round again jmp returnSpawnNotAllowed spb_allowed: jsr newObject lbpl cs_done_no leax ,u ; pointer to new object PLAY_SFX SpawnBomber_Sound ; copy and initialze new enemy lda #TYPE_BOMBER sta TYPE, x lda Bomber_add_delay sta ANGLE_TICK_COUNTER, x lda Bomber_addi sta ANGLE_DELTA, x ldd #bomberBehaviour std BEHAVIOUR,x lda #$ff sta DDRA,x ; performance dummy lda #BOMBER_ANIM_DELAY sta ANIM_COUNTER,x ldd #BomberList_0 std CURRENT_LIST,x lda bomber_delay_start sta SHOT_COUNTER_RESET,x sta SHOT_COUNTER,x ldb my_random2 andb #%00011111 ; max 63 addb #100 ; spawn between scale 63 - 127 stb SCALE,x ; generate another random lda my_random rola rola rola rola eora my_random2 adda my_random2 eora RecalCounterLow anda #%01111111 ; in a random number between 0 - 127 tfr a, b clra MY_LSL_D ; double it tfr d,u leau d,u leau d,u ; u = 0 - 720 -> spawning angle of our new enemy stu ANGLE,x ; store current angle of object ldd #circle leau d,u ; u pointer to spwan angle coordinates ldd ,u std Y_POS,x ; save start pos rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; behaviours control (action) and draw all objects ; each object type has an individual behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; values are set from "u" list as: ; pulu pc,d,x,y ; (D = y,x, X = vectorlist, Y = DDRA+Scale) bomberBehaviour: ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START dec ANGLE_TICK_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_angle_update_bb ; if not, scale will not be updated ldb Bomber_add_delay ; otherwise reset the delay counter for scale update (this is global now, should I use that from the structure?) stb ANGLE_TICK_COUNTER+u_offset1, u ; store it ldd ANGLE+u_offset1,u ; load current scale to a - for later calcs subd #2 bcc angle_ok_bb ; if below zero, than base reaches addd #720 angle_ok_bb: std ANGLE+u_offset1,u ; load current scale to a - for later calcs ldy #circle leay d,y ; u pointer to spwan angle coordinates ldd ,y std Y_POS+u_offset1,u ; save start pos no_angle_update_bb ; check anim dec ANIM_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_anim_update_bb ; if not, scale will not be updated lda #BOMBER_ANIM_DELAY ; anim reset sta ANIM_COUNTER+u_offset1, u ldd CURRENT_LIST+u_offset1,u addd #(BomberList_1-BomberList_0) cmpd #(BomberList_8+(BomberList_1-BomberList_0)) bne not_last_anim_bb ldd #BomberList_0 not_last_anim_bb: std CURRENT_LIST+u_offset1,u no_anim_update_bb: ; check shot ; TODO dec SHOT_COUNTER+u_offset1, u bne no_shot_update_bb lda SHOT_COUNTER_RESET+u_offset1, u suba #BOMB_RELOAD_REDUCTION cmpa minimum_bomb_reload bhi short_timer_ok lda minimum_bomb_reload short_timer_ok sta SHOT_COUNTER+u_offset1, u sta SHOT_COUNTER_RESET+u_offset1, u pshs x,u jsr buildShot puls x,u no_shot_update_bb ldu NEXT_OBJECT+u_offset1,u ; preload next user stack lda #6 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$5f ; intensity MY_MOVE_TO_B_END ; end a move to ldy ,x++ ; load offset of vector list draw leay >(unloop_start_addressSub+LENGTH_OF_HEADER),y ; _INTENSITY_A jsr entry_optimized_draw_mvlc_unloop ldd #$cc98 sta <VIA_cntl ; 22 cycles from switch on ZERO disabled, and BLANK enabled STb <VIA_aux_cntl ; pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; shotBehaviour ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START lda SCALE+u_offset1,u ; load current scale to a - for later calcs dec TICK_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_scale_update_sb ; if not, scale will not be updated ldb shot_add_delay ; otherwise reset the delay counter for scale update (this is global now, should I use that from the structure?) stb TICK_COUNTER+u_offset1, u ; store it suba SCALE_DELTA+u_offset1, u ; and actually descrease the scale with the "decrease" value bcs die_sb ; if below zero, than base reaches cmpa #BASE_SCALE+3 ; if lower base scale, than also dead bhi base_not_reached_sb ; if we reached the base - ; a) moveto was SMALL - finished anyway ; b) not interested in move - nothing will be drawn anymore! ; MY_MOVE_TO_B_END die_sb jmp gameOver ; if base was hit -> game over base_not_reached_sb: sta SCALE+u_offset1,u ; store the calculated scale (used next round) no_scale_update_sb: ldu NEXT_OBJECT+u_offset1,u ; preload next user stack lda #6 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$7f ; intensity ldy ,x++ ; load offset of vector list draw leay >(unloop_start_addressSub_2+LENGTH_OF_HEADER),y ; MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr my_drawVLC_inner pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ***** OBJECT DRAGON ********** ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Dragon SPAWN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in x pointer to new object structure that should be filled with object ; data spawnDragon: ; #isfunction bitb #ALLOW_DRAGON bne spd_allowed clr spawn_timer ; check spawn next round again jmp returnSpawnNotAllowed spd_allowed: jsr newObject lbpl cs_done_no leax ,u ; pointer to new object PLAY_SFX SpawnDragon_Sound ; copy and initialze new enemy lda #TYPE_DRAGON +$40 ; + $40 means it has two shots until dead sta TYPE, x lda Dragon_Angle_delay lsla lsla lsla lsla sta tmp_count2 lda Dragon_Scale_delay anda #%00001111 ora tmp_count2 ; lower nibble is counter for scale move (inward) ; higher nibble is counter for angle move ;Dragon_Angle_delay ;Dragon_Scale_delay sta DRAGON_COUNTER, x ldd #dragonBehaviour std BEHAVIOUR,x ldd #DragonList_0 ; vectorlist std CURRENT_LIST,x lda #$ff sta DDRA,x ; performance dummy ldb my_random2 andb #%00011111 ; max 63 addb #100 ; spawn between scale 73 - 137 stb SCALE,x lda my_random2 anda #%01111111 ; in a random number between 0 - 127 tfr a, b clra MY_LSL_D ; double it tfr d,u leau d,u leau d,u ; u = 0 - 720 -> spawning angle of our new enemy stu ANGLE,x ; store current angle of object ldd #circle leau d,u ; u pointer to spwan angle coordinates ldd ,u std Y_POS,x ; save start pos ; spawn children ldd #0 ; vectorlist std CHILD_1,x std CHILD_2,x tfr x,y ; y is save in respect to newObject jsr newObject lbpl cs_done_no ldd #-20 stu CHILD_1,y sty DRAGON, u bsr initDragonChild lda #4 sta WIGGLE,x lda #0 sta WIGGLE_DIRECTION, x jsr newObject lbpl cs_done_no ldd #-40 stu CHILD_2,y sty DRAGON, u bsr initDragonChild lda #-4 sta WIGGLE,x lda #1 sta WIGGLE_DIRECTION, x rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; initializes the dragon child ; in u pointer to child ; in y pointer to dragon ; in a angle offset ; must leave with y intact initDragonChild leax ,u std ANGLE_OFFSET, x addd ANGLE,y ; this is actually a angle - diff - since dif is a negative value bpl noAngleChange_idc addd #720 ; cmpd #720 ; blt noAngleChange_idc ; subd #720 noAngleChange_idc std ANGLE, x ldu #circle leau d,u ; u pointer to spwan angle coordinates ldd ,u std Y_POS,x ; save start pos lda #TYPE_DRAGONCHILD sta TYPE, x ldd #dragonchildBoundBehaviour std BEHAVIOUR,x ; ldd #Dragonchild_List ; vectorlist ; std CURRENT_LIST,x lda #$ff sta DDRA,x ; performance dummy ldb SCALE,y lda ANGLE_OFFSET+1, x nega lsra sta SCALE_OFFSET, x addb SCALE_OFFSET, x stb SCALE,x rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dragonchildBoundBehaviour ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START ldy DRAGON+u_offset1,u lda SCALE,y adda SCALE_OFFSET+u_offset1, u sta SCALE+u_offset1,u ldd ANGLE_OFFSET+u_offset1,u ; from child addd ANGLE,y ; from dragon bpl noAngleChange_dcb addd #720 noAngleChange_dcb std ANGLE+u_offset1,u ldy #circle leay d,y ; u pointer to spwan angle coordinates ldd ,y std Y_POS+u_offset1,u ; save start pos lda #6 sta VIA_t1_cnt_lo ; to timer t1 (lo= ldb WIGGLE+u_offset1,u lda WIGGLE_DIRECTION+u_offset1,u beq wiggle_minus incb stb WIGGLE+u_offset1,u cmpb #4 bne do_changescale dec WIGGLE_DIRECTION+u_offset1,u bra do_changescale wiggle_minus decb stb WIGGLE+u_offset1,u cmpb #-4 bne do_changescale inc WIGGLE_DIRECTION+u_offset1,u do_changescale addb SCALE+u_offset1, u stb SCALE+u_offset1, u lda #$5f ; intensity ldu NEXT_OBJECT+u_offset1,u ; preload next user stack ldx #Dragonchild_List MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr myDraw_VL_mode _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dragonchildFreeBehaviour ; #isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START lda SCALE+u_offset1,u ; load current scale to a - for later calcs suba dragonchild_addi ; and actually decrease the scale with the "decrease" value bcs die_dcfb ; if below zero, than base reaches cmpa #BASE_SCALE+3 ; if lower base scale, than also dead bhi base_not_reached_dcfb ; if we reached the base - ; a) moveto was SMALL - finished anyway ; b) not interested in move - nothing will be drawn anymore! ; MY_MOVE_TO_B_END die_dcfb ; cancle move jmp gameOver ; if base was hit -> game over base_not_reached_dcfb: sta SCALE+u_offset1,u ; store the calculated scale (used next round) no_scale_update_dcfb: ldu NEXT_OBJECT+u_offset1,u ; preload next user stack ldx #Dragonchild_List lda #6 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$7f ; intensity MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr myDraw_VL_mode _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; behaviours control (action) and draw all objects ; each object type has an individual behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; values are set from "u" list as: ; pulu pc,d,x,y ; (D = y,x, X = vectorlist, Y = DDRA+Scale) dragonBehaviour ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START lda DRAGON_COUNTER+u_offset1, u lsra lsra lsra lsra deca sta tmp_add bpl dragon_no_angle_update ldb Dragon_Angle_delay stb tmp_add ldd ANGLE+u_offset1,u ; load current scale to a - for later calcs addd Dragon_Angle_addi cmpd #720 blo dragonAngleOk_db subd #720 dragonAngleOk_db std ANGLE+u_offset1,u ; load current scale to a - for later calcs ldy #circle leay d,y ; u pointer to spwan angle coordinates ldd ,y std Y_POS+u_offset1,u ; save start pos dragon_no_angle_update lda DRAGON_COUNTER+u_offset1, u anda #%00001111 deca sta tmp_count2 bpl no_scale_update_db ; if not, scale will not be updated ldb Dragon_Scale_delay ; otherwise reset the delay counter for scale update (this is global now, should I use that from the structure?) stb tmp_count2 lda SCALE+u_offset1,u ; load current scale to a - for later calcs deca sta SCALE+u_offset1,u ; store the calculated scale (used next round) cmpa #BASE_SCALE+3 ; if lower base scale, than also dead bhi base_not_reached_db ; if we reached the base - ; a) moveto was SMALL - finished anyway ; b) not interested in move - nothing will be drawn anymore! ; MY_MOVE_TO_B_END die_db: ; cancle move ; following is not really necessary - since the player is dead anyway ; but as long as game over is only a "remove" this makes sense pshs x ldx CHILD_1+u_offset1,u beq no_child1_ex_db ldd #dragonchildFreeBehaviour std BEHAVIOUR,x ldd #0 std DRAGON,x no_child1_ex_db ldx CHILD_2+u_offset1,u beq explodeDragonDone_ex_db ldd #dragonchildFreeBehaviour std BEHAVIOUR,x ldd #0 std DRAGON,x explodeDragonDone_ex_db puls x jmp gameOver ; if base was hit -> game over base_not_reached_db: no_scale_update_db: lda tmp_add ; angle delay lsla lsla lsla lsla anda #%11110000 ora tmp_count2 ; lower nibble is counter for scale move (inward) ; higher nibble is counter for angle move ;Dragon_Angle_delay ;Dragon_Scale_delay sta DRAGON_COUNTER+u_offset1,u lda RecalCounterLow ; only every second tick bita #$01 beq no_anim_update_db ldd CURRENT_LIST+u_offset1,u addd #(DragonList_1-DragonList_0) cmpd #(DragonList_3+(DragonList_1-DragonList_0)) bne not_last_anim_db ldd #DragonList_0 not_last_anim_db: std CURRENT_LIST+u_offset1,u no_anim_update_db: lda #6 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$4f ; intensity ldb TYPE+u_offset1,u cmpb #20 blt half_dead_dragon lda #$7f ; intensity half_dead_dragon: ldu NEXT_OBJECT+u_offset1,u ; preload next user stack ldy ,x++ ; load offset of vector list draw leay >(unloop_start_addressSub+LENGTH_OF_HEADER),y ; MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr entry_optimized_draw_mvlc_unloop ldd #$cc98 sta <VIA_cntl ; 22 cycles from switch on ZERO disabled, and BLANK enabled STb <VIA_aux_cntl ; pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ***** OBJECT BONUS *********** ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Bonus SPAWN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in x pointer to new object structure that should be filled with object ; data spawnBonus: ; #isfunction bitb #ALLOW_BONUS bne bonux_allowed clr spawn_timer ; check spawn next round again jmp returnSpawnNotAllowed bonux_allowed: jsr newObject lbpl cs_done_no inc bonusCounter+1 ; disable other bonus spawns leax ,u ; pointer to new object PLAY_SFX SpawnBonus_Sound ; copy and initialze new enemy lda #TYPE_BONUS sta TYPE, x lda Bonus_add_delay sta TICK_COUNTER, x lda Bonus_addi sta SCALE_DELTA, x ldd #bonusBehaviour std BEHAVIOUR,x lda #BONUS_ANIM_DELAY ; anim reset sta ANIM_COUNTER, x ldd #BonusList_0 ; vectorlist std CURRENT_LIST,x lda #$ff sta DDRA,x ; performance dummy lda spawn_max sta SCALE,x ; start with max scale (for xEnemy) lda my_random2 anda #%01111111 ; in a random number between 0 - 127 tfr a, b clra MY_LSL_D ; double it tfr d,u leau d,u leau d,u ; u = 0 - 720 -> spawning angle of our new enemy stu ANGLE,x ; store current angle of object ldd #circle leau d,u ; u pointer to spwan angle coordinates ldd ,u std Y_POS,x ; save start pos rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; behaviours control (action) and draw all objects ; each object type has an individual behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; values are set from "u" list as: ; pulu pc,d,x,y ; (D = y,x, X = vectorlist, Y = DDRA+Scale) bonusBehaviour ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START lda SCALE+u_offset1,u ; load current scale to a - for later calcs cmpa #$80 bhi noMusic_bb1 jsr [inMovePointer] lda SCALE+u_offset1,u noMusic_bb1 dec TICK_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_scale_update_bob ; if not, scale will not be updated ldb X_add_delay ; otherwise reset the delay counter for scale update (this is global now, should I use that from the structure?) stb TICK_COUNTER+u_offset1, u ; store it suba SCALE_DELTA+u_offset1, u ; and actually descrease the scale with the "decrease" value bcs get_bob ; if below zero, than base reaches cmpa #BASE_SCALE+3 ; if lower base scale, than also dead bhi base_not_reached_bob ; if we reached the base - ; a) moveto was SMALL - finished anyway ; b) not interested in move - nothing will be drawn anymore! ; MY_MOVE_TO_B_END get_bob: ; cancle move ldd #$0a00 std VIA_t1_cnt_lo ; disable ramping _ZERO_VECTOR_BEAM jmp initBonus ; if base was hit -> game over base_not_reached_bob: sta SCALE+u_offset1,u ; store the calculated scale (used next round) no_scale_update_bob: dec ANIM_COUNTER+u_offset1, u ; see if wee need calc at all, compare tick counter with below zero bpl no_anim_update_bob ; if not, scale will not be updated lda #X_ANIM_DELAY ; anim reset sta ANIM_COUNTER+u_offset1, u ldd CURRENT_LIST+u_offset1,u addd #(BonusList_1-BonusList_0) cmpd #(BonusList_16+(BonusList_1-BonusList_0)) bne not_last_anim_bob ldd #BonusList_0 not_last_anim_bob: std CURRENT_LIST+u_offset1,u no_anim_update_bob: ldu NEXT_OBJECT+u_offset1,u ; preload next user stack lda #6 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$5f ; intensity MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr myDraw_VL_mode _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ***** TIMER ****************** ****************************** ; special ; the X vectorlist(s) ; are generated in move to timerBehaviour ;#isfunction sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) MY_MOVE_TO_D_START tst bonus_time_1 beq smallBonusTimer ; large bonus timer ldy bonusCounter leay -1,y sty bonusCounter lbeq endBonus ; must stay here, if shield was used, than the counter will be rest to 0 here! dec SECOND_COUNTER+u_offset1,u bne noTimerChange_tblarge lda #50 sta SECOND_COUNTER+u_offset1,u dec bonus_time_0 bpl no_hi_timer_change_tb lda #9 sta bonus_time_0 dec bonus_time_1 bne still_large_timer_tb ldd #$e0e0 ; y,x pos -1,-10 std Y_POS+u_offset1,u bra entry_small_timer_tb still_large_timer_tb no_hi_timer_change_tb noTimerChange_tblarge lda #3 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$5f _INTENSITY_A ldu NEXT_OBJECT+u_offset1,u ; preload next user stack ldy #NumberList ; list of pointers to number vectorlists lda bonus_time_1 lsla ; times two ldx a,y jsr myDraw_VL_mode lda bonus_time_0 lsla ; times two ldx a,y jsr myDraw_VL_mode _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; smallBonusTimer: ldy bonusCounter leay -1,y sty bonusCounter beq endBonus dec SECOND_COUNTER+u_offset1,u bne noTimerChange_tb lda #50 sta SECOND_COUNTER+u_offset1,u dec bonus_time_0 entry_small_timer_tb: ldy #NumberList ; list of pointers to number vectorlists lda bonus_time_0 lsla ; times two ldd a,y std CURRENT_LIST+u_offset1,u noTimerChange_tb: lda #3 sta VIA_t1_cnt_lo ; to timer t1 (lo= lda #$5f ; MY_MOVE_TO_B_END ; end a move to _INTENSITY_A ldu NEXT_OBJECT+u_offset1,u ; preload next user stack jsr myDraw_VL_mode _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; endBonus ; deinit the actual bonus ldy currentPhaseData lda bonusActiveType cmpa #BONUS_TYPE_FASTER beq deactiveFaster cmpa #BONUS_TYPE_EXPAND beq deactiveExpand cmpa #BONUS_TYPE_SHIELD beq deactiveShield deactiveShield: bra deactivateDone_bb deactiveFaster lda 2,y sta shieldSpeed ; lda 5,y sta shield_width_adder ; 2,x db SHIELD_DEFAULT_SPEED ;2 shield major speed ; update every tick, must be in sum greater than minor increase bra deactivateDone_bb deactiveExpand ;1,x shieldWidthGrowth SHIELD_WIDTH_GROWTH_DEFAULT = 4 ; 2 up ; grow shield width every x ticks with speed (counter) ;5,x shield_width_adder INITIAL_SHIELD_WIDTH_ADDER = 1 ; 1-4 WIDTH OF SHIELD increase (strength) lda 1,y sta shieldWidthGrowth lda 5,y sta shield_width_adder ; lsr shieldWidthGrowth ; faster width change ; lsl shield_width_adder ; more with each adder bra deactivateDone_bb deactivateDone_bb: clr bonusActiveType lbeq removeObject ****************************** ***** STARFIELD ************** ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Starfield SPAWN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in x pointer to new object structure that should be filled with object ; data spawnStarfield: ; #isfunction jsr newObject lbpl cs_done_no leax ,u ; pointer to new object ; copy and initialze new enemy inc starFieldCounter lda #TYPE_STARFIELD_FRESH sta TYPE, x ldd #starfieldBehaviour std BEHAVIOUR,x ldd #$ffff std POS_1, x ; store neg pos as indicator, that nothing is displayed std POS_2, x ; store neg pos as indicator, that nothing is displayed std POS_3, x ; store neg pos as indicator, that nothing is displayed std POS_4, x ; store neg pos as indicator, that nothing is displayed lda my_random2 anda #%01111111 sta SCALE_1, x ; in init - wait for star spawn at 0 ; generate another random lda my_random rola eora my_random2 adda my_random2 eora RecalCounterLow sta my_random2 anda #%01111111 sta SCALE_2, x ; in init - wait for star spawn at 0 lda my_random rola eora my_random2 adda my_random2 eora RecalCounterLow sta my_random2 anda #%01111111 sta SCALE_3, x ; in init - wait for star spawn at 0 lda my_random rola eora my_random2 adda my_random2 eora RecalCounterLow sta my_random2 anda #%01111111 sta SCALE_4, x ; in init - wait for star spawn at 0 rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; behaviours control (action) and draw all objects ; each object type has an individual behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; values are set from "u" list as: ; pulu pc,d,x,y ; (D = y,x, X = vectorlist, Y = DDRA+Scale) DO_ONE_STAR macro mPos, mScale lda mScale+u_offset1,u sta VIA_t1_cnt_lo ldd mPos+u_offset1,u cmpd #$ffff beq inInit1\? showPos1\? MY_MOVE_TO_D_START_NT lda mScale+u_offset1,u cmpa #SPAWN_MAX_SCALE_INIT bhi doInit1\? cmpa #$80 bhi noMusic\? jsr [inMovePointer] lda mScale+u_offset1,u noMusic\? adda #5 cmpa #$b0 bhi s1_done\? deca cmpa #$80 bhi s1_done\? deca cmpa #$40 bhi s1_done\? deca cmpa #$20 bhi s1_done\? deca s1_done\? sta mScale+u_offset1,u adda #10 cmpa #$2f blo b_ok_1\? lda #$2f b_ok_1\? MY_MOVE_TO_B_END ; end a move to _INTENSITY_A lda #$ff STA <VIA_shift_reg ; Store in VIA shift register ; delay for dot dwell CLR <VIA_shift_reg ; Blank beam in VIA shift register _ZERO_VECTOR_BEAM bra do_pos3\? inInit1\? dec mScale+u_offset1,u bne do_pos2\? inc TYPE+u_offset1,u doInit1\?: _ZERO_VECTOR_BEAM ldd #$0a00 std VIA_t1_cnt_lo ; disable ramping lda #8 sta mScale+u_offset1,u lda my_random2 anda #%01111111 ; in a random number between 0 - 127 tfr a, b clra MY_LSL_D ; double it tfr d,x leax d,x leax d,x ; u = 0 - 720 -> spawning angle of our new enemy ldd #circle leax d,x ; u pointer to spwan angle coordinates ldd ,x std mPos+u_offset1,u do_pos2\?: do_pos3\? endm starfieldBehaviour ;#isfunction lda #1 DO_ONE_STAR POS_1, SCALE_1 DO_ONE_STAR POS_2, SCALE_2 DO_ONE_STAR POS_3, SCALE_3 DO_ONE_STAR POS_4, SCALE_4 ;nop 20 glitch? ldu NEXT_OBJECT+u_offset1,u ; preload next user stack pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale) ****************************** ***** OBJECT Letter ********** ****************************** ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; X Letter ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; in x pointer to new object structure that should be filled with object ; data spawnFailed: ldu #0 puls a rts spawnLetter: pshs a jsr newObject bpl spawnFailed leax ,u ; pointer to new object ; copy and initialze new enemy lda #TYPE_LETTER sta TYPE, x puls b cmpb #' ' bne _no_space_found_letter_object ldu #ABC_28 ; and add the abc (table of vector list address of the alphabet's letters) bra cont_letter_object _no_space_found_letter_object SUBB # 'A' ; subtract smallest letter, so A has 0 offset LSLB ; multiply by two, since addresses are 16 bit ldu #_abc ; and add the abc (table of vector list address of the alphabet's letters) LDu b,u ; in x now address of letter vectorlist cont_letter_object stu CURRENT_LIST,x ldd #letterBehaviour std BEHAVIOUR,x lda #$ff sta DDRA,x ; performance dummy lda vector_move_scale sta SCALE,x ; start with max scale (for xEnemy) lda #ADD_DELAY sta DIF_DELAY,x rts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; behaviours control (action) and draw all objects ; each object type has an individual behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; values are set from "u" list as: ; pulu pc,d,x,y ; (D = y,x, X = vectorlist, Y = DDRA+Scale) letterBehaviour ;#isfunction ; do the scaling sty VIA_DDR_a ; also stores to scale :-() VIA_t1_cnt_lo ; to timer t1 (lo) ; start the move to ; following calcs can be done within that move MY_MOVE_TO_D_START ldd ANGLE+u_offset1,u ; load current scale to a - for later calcs std tmp_angle lda TYPE+u_offset1,u cmpa #TYPE_LETTER_7 bne djdjhd bra djdjhd djdjhd ldy PREVIOUS_LETTER+u_offset1,u beq np_previousLetter dec DIF_DELAY+u_offset1,u ; bne no_space_changenow_lb lda #ADD_DELAY sta DIF_DELAY+u_offset1,u ldd print_angle_2 ldy #circle ; leay d,y ldd d,y tstb bmi do_minus beq no_space_changenow_lb ldd SPACE_TO_PREVIOUS+u_offset1,u addd #2 bra change_space_done_lb do_minus ldd SPACE_TO_PREVIOUS+u_offset1,u subd #2 change_space_done_lb std SPACE_TO_PREVIOUS+u_offset1,u no_space_changenow_lb: ldy PREVIOUS_LETTER+u_offset1,u ldd ANGLE,y addd SPACE_TO_PREVIOUS+u_offset1,u ; if (angle_speed > 0) && (newAngle < oldAngle) ; newAngle = oldAngle; ; tst angle_speed ; bpl speed_is_positive ; bra done_speed_reassurance ;speed_is_positive ; cmpd tmp_angle ; bgt done_speed_reassurance ; ldd tmp_angle ; perhaps add angle speed ;done_speed_reassurance bpl no_anglecircle_overflow_lb addd #720 no_anglecircle_overflow_lb: cmpd #720 blt no_anglecircle_overflow2_lb subd #720 no_anglecircle_overflow2_lb: bra angle_lb_done np_previousLetter ldd print_angle angle_lb_done std ANGLE+u_offset1,u ; load current scale to a - for later calcs ldy #circle leay d,y ; u pointer to spwan angle coordinates ldd ,y std Y_POS+u_offset1,u ; save start pos ldu NEXT_OBJECT+u_offset1,u ; preload next user stack lda vector_print_scale _SCALE_A lda #$5f ; intensity MY_MOVE_TO_B_END ; end a move to _INTENSITY_A jsr myDraw_VL_mode4y _ZERO_VECTOR_BEAM pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale)
examples.agda
ayberkt/system-t-normalization
3
11230
<filename>examples.agda open import SystemT open import Data.List using ([]) module Examples where -- λ x . x ex1 : [] ⊢ base ⟶ base ex1 = lam (var i0) -- λ x . λ y . y ex2 : [] ⊢ base ⟶ base ⟶ base ex2 = lam (lam (var i0)) -- λ x . λ y . x ex3 : [] ⊢ base ⟶ base ⟶ base ex3 = lam (lam (var (iS i0)))
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1936.asm
ljhsiun2/medusa
9
242326
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r8 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0xa6d8, %rsi lea addresses_UC_ht+0x11df8, %rdi dec %r8 mov $92, %rcx rep movsl nop nop nop nop nop sub %rbp, %rbp lea addresses_WT_ht+0x14be, %rsi lea addresses_normal_ht+0x83f8, %rdi clflush (%rdi) xor $20753, %rdx mov $110, %rcx rep movsq nop nop nop nop nop xor %rcx, %rcx lea addresses_D_ht+0x21f8, %rcx clflush (%rcx) nop nop nop nop nop inc %rbx movb $0x61, (%rcx) nop nop nop nop add $30308, %rdi lea addresses_D_ht+0x1d9f8, %rbp nop xor $20634, %rdx mov (%rbp), %di nop cmp $9020, %rsi lea addresses_D_ht+0xdf8, %rbp nop nop nop nop nop inc %r8 vmovups (%rbp), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %rdx nop nop nop dec %rcx lea addresses_WC_ht+0x47a8, %rbp nop nop nop cmp $39679, %rsi mov $0x6162636465666768, %r8 movq %r8, %xmm2 vmovups %ymm2, (%rbp) nop nop nop nop nop dec %rsi lea addresses_A_ht+0x248, %rdx nop nop nop nop and %rcx, %rcx vmovups (%rdx), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %r8 nop nop nop inc %rcx lea addresses_normal_ht+0x189be, %r8 nop sub $4771, %rbp mov $0x6162636465666768, %rsi movq %rsi, %xmm1 vmovups %ymm1, (%r8) nop nop nop nop nop and $52402, %rdi lea addresses_A_ht+0x18f36, %rcx nop nop nop nop nop and $20926, %rbp movb $0x61, (%rcx) nop nop nop add %rcx, %rcx lea addresses_normal_ht+0x85f8, %r8 nop nop nop nop xor %rsi, %rsi mov (%r8), %ecx nop nop nop sub %rdx, %rdx lea addresses_UC_ht+0x1b122, %rdx nop nop nop nop and $61353, %r8 mov (%rdx), %di nop nop nop nop xor %rbp, %rbp lea addresses_D_ht+0x19af8, %rsi nop nop add %r8, %r8 mov $0x6162636465666768, %rdi movq %rdi, %xmm2 vmovups %ymm2, (%rsi) nop sub %rbx, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r8 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %rbp push %rbx push %rdi // Faulty Load lea addresses_A+0x1a9f8, %rbp nop nop nop nop nop xor $15650, %rdi mov (%rbp), %rbx lea oracles, %rbp and $0xff, %rbx shlq $12, %rbx mov (%rbp,%rbx,1), %rbx pop %rdi pop %rbx pop %rbp pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 4}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 1}} {'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 8}} {'35': 21829} 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 */
src/rematch.asm
gltchitm/tic-tac-toe-asm
0
165538
prompt_rematch: mov rdi, rematch_prompt mov rsi, rematch_prompt_len call print jmp get_user_input_rematch handle_rematch: cmp rax, 89 je start_game cmp rax, 121 je start_game cmp rax, 78 je exit cmp rax, 110 je exit jmp print_gameboard