code segment assume cs:code,ds:code org 100h .386 start: include proc.txt ;лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл ;лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл ;CODE SECTION ;лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл mov ecx,10 loopp: get_cmd cl mov al,byte ptr plc_type cmp al,'f' jne s1 copy plc_arg,file,12 s1: ;cmp al,'d' ;jne s2 ;convertsn plc_arg ;mov eax,savedd ;mov delay_printer,eax ;s2: cmp al,'c' jne s3 convertsn plc_arg mov eax,savedd mov count,eax s3: cmp al,'b' jne s4 convertsn plc_arg mov eax,savedd mov bit_depth,eax s4: loop loopp print sign csrlin ligne,colonne create file,0 open file,handle sendp 01110000b ;-------------------------< reset les compteurs mov tosend,110000b cmp bit_depth,16 je skip_16 add tosend,80h skip_16: xor dx,dx xor ecx,ecx boucle: mov one,0 mov al,tosend add al,08h xor ah,ah b8b: sendp al readp and savedb,40h cmp savedb,40h je b8_2b add one,80h b8_2b: ror one,1 inc al inc ah cmp ah,8 jne b8b rol one,1 put handle,one,1 mov one,0 mov al,tosend xor ah,ah b8: sendp al readp and savedb,40h cmp savedb,40h je b8_2 add one,80h b8_2: ror one,1 inc al inc ah cmp ah,8 jne b8 rol one,1 put handle,one,1 inc dx cmp dx,4096 jne no_4096 locate ligne,colonne printn ecx mov al,tosend and al,0cfh sendp al xor dx,dx jmp idle no_4096: mov al,tosend and al,0efh sendp al idle: sendp tosend inc ecx cmp ecx,count jne boucle locate ligne,colonne printn count fin: end_prog ;лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл ;============================================================================ ;DATA SECTION ;============================================================================ one db 0 handle dw 0 ligne db 0 colonne db 0 sign db 'ROM DEAL, asm version - ',0 file db 'romdealf.bin',0 ;13 dup(0) bit_depth dd 16 tosend db 0 count dd 256 buff db 0 ;============================================================================ code ENDS END start