Wednesday, March 18, 2015

Code:echo off rem Assemble to OBJ d: \ Tasm5 \ bin \ tasm / m3 / zi% 1.asm if errorlevel 1 goto err


Champions ranking experts in this list Lyskov Igor V. Status: Professional Reputation: 121 increase the rating >> Zenchenko Konstantin Status: Moderator Rank: 60 increase the rating >> election results 2012 Boriss Status: Academic Ranking: 43 increase the rating >> / COMPUTERS AND Software / Programming Languages / Assembler (Assembler) Issue number 1215 of 27.05.2009, 20:05 Administrator mailing Kalashnikov OA , A leader in the delivery: subscribers - 417 experts - 56 Room Facilities: questions - 2 answers - 2 We really appreciate your opinion about this release distribution. You can evaluate this issue on a scale from the following link: To evaluate the release number election results 2012 167965 >> election results 2012 Question: Dear experts, please help with the solution of the problem: A description election results 2012 of X db 50 dup (?); an array of unsigned integers. Write a procedure in language ASSEMBLER, substitute zero elements of the array to their serial numbers using ADR index ... Question number 167971: Dear experts ... huge request to you ... if you could write a commentary on the lines of the program: election results 2012 .386 .model flat, stdcall option casemap: none WinMain election results 2012 proto: DWORD,: DWORD,: DWORD,: DWORD include \ masm32 \ include \ windows.inc <... Question number 167965: Dear experts, please help with the solution of the problem: A description X db 50 dup (?); an array of unsigned integers. Write a procedure in language ASSEMBLER, substitute zero elements of the array to their serial numbers using indexed addressing. Write a caller for the procedure. The procedure and the caller placed in different modules share a common election results 2012 memory area. (Not sure either before or after kompelyatsii better after) The task of offset needed today to five o'clock in the evening. To the great regret one could not help, and the oak tree at this point. The big request to make a program with comments on the action, and then the defense will end collapse and failure in advance ... very grateful. Posted on: 22-05-2009, 10:50 Question asked: Prizrakm, visitor Total of answers: 1 Page >> issue Meets Boriss, Academician: Hello, Prizrakm! Here's what we have now. It is unclear to accelerate the process, ask a miniforume to create an executable file in TASM uses two batch files: election results 2012 1) to obtain the object code
Code:echo off rem Assemble to OBJ d: \ Tasm5 \ bin \ tasm / m3 / zi% 1.asm if errorlevel 1 goto error goto exit: error echo Assembly error. echo Assembly error >> error.txt dir% 1. * >> error.txt: exit pause and to obtain the source code file (where there end star t, I called s_main.asm, and the other where just end - s_unit .asm)
Code:echo off rem Assemble to OBJ if exist asmbl.txt del asmbl.txt d: \ Tasm5 \ bin \ tlink s_main.obj + s_unit.obj, s_main if errorlevel 1 goto error goto exit: error echo Assembly error. echo Assembly error >> error.txt dir% 1. * >> error.txt: exit pause Appendix: The file I called election results 2012 s_main.asm - this causes the program text segment 'code' assume cs: text, ds: data, es : data, ss: mystack EXTRN ChangeElems: near, showArray: near; there is a somewhere outside, near the call start: mov ax, data mov ds, ax mov ax, 3 int 10h lea si, X mov cx, x_len CALL ChangeElems CALL showArray lea dx, Press_any_key mov ah, 9 int 21h xor ax, ax int 16h mov ax, 4C00h int 21h text ends data segment 'data'; data segment X db 1,1,1,0,1,1 x_len equ $ -X Press_any_Key db 13,10, 'Press any key ... $' data ends mystack segment stack 'stack' db 100h dup (?) mystack ends end start; in the main module end with an indication of the entry point is called program, it inserts the subprogram-replacement and display array and a local subroutine to output bytes in decimal pseg segment 'code'; declare segment type 'code' assume cs: pseg; ustanvalivaem this segment to a code segment public ChangeElems, showArray; This procedure can be called from another segment ChangeElems proc near; the beginning of the procedure, indicates the type of call - Middle; it is assumed that DS: SI points to the beginning election results 2012 of the array; CX and the number of elements in the array push ax push cx push si push bx mov bx, 1; will counter elements@@1: mov al, [si + bx-1]; or rather, this is called the base-addressing election results 2012 index or al, al; sets the zero flag, sign jnz@@2; jump if not zero mov [si + bx-1], bl@@2: inc bl LOOP@@1 pop bx pop si pop cx pop ax ret ChangeElems endp showArray proc near; it is assumed that DS: SI points to the beginning election results 2012 of the array; CX and the number of elements in the array push ax push cx push bx xor bx, bx next: mov al, [si + bx] CALL byte_DEC inc bx LOOP next mov al, 13; two characters for transfer to the next line int 29h mov al, 10 int 29h pop bx pop cx pop ax ret showArray endp byte_DEC proc; and this subroutine is local. Displays the bytes in decimal; byte must be in AL push bx push cx xor cx, cx mov bl, 10@@show_1: xor ah, ah div bl push ax inc cx or al, al jnz@@show_1@@show_2: pop

No comments:

Post a Comment